diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 606dc00..9f510b9 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,12 +1,12 @@ -### Swagger Code Generation +# Swagger Code Generation This repository relies on the following Dockerfile in order to run Swagger Codegen inside a Docker container: -https://hub.docker.com/r/jimschubert/swagger-codegen-cli/. +https://hub.docker.com/r/parsertongue/swagger-codegen-cli. -We're currently using version 2.3.1 of Swagger Codegen. +We're currently using version 3.0.32 of Swagger Codegen. -### Generating the API Client +## Generating the API Client Copy the Swagger specification YAML files to the local `./input` directory. @@ -17,27 +17,29 @@ https://docs.jumpcloud.com/2.0. Update the version number for each package in `config_v1.json` or `config_v2.json`. -To generate the API v1 or v2 client, run the commands below (assuming your -API v1 and v2 specification files are `./input/index1.yaml` and -`./input/index2.yaml`): +To generate the API v1 or v2 client, run the commands below: -``` -docker-compose run --rm swagger-codegen generate -i /swagger-api/yaml/index1.yaml -l go -c /config/config_v1.json -o /swagger-api/out/v1 -docker-compose run --rm swagger-codegen generate -i /swagger-api/yaml/index2.yaml -l go -c /config/config_v2.json -o /swagger-api/out/v2 -``` +```bash +# Update API v1 and v2 specification files in `./input/index1.yaml` and `./input/index2.yaml`): +mkdir input +curl https://docs.jumpcloud.com/api/1.0/index.yaml --output input/index1.yaml +curl https://docs.jumpcloud.com/api/2.0/index.yaml --output input/index2.yaml -This will generate the API v1 and v2 client files under the local -`./output/v1` and `./output/v2` directories. +# Generate SDKs +mkdir output +LANG="go" +docker-compose run --rm swagger-codegen generate -i /swagger-api/yaml/index1.yaml -l ${LANG} -c /config/config_v1.json -o /swagger-api/out/jcapiv1 +docker-compose run --rm swagger-codegen generate -i /swagger-api/yaml/index2.yaml -l ${LANG} -c /config/config_v2.json -o /swagger-api/out/jcapiv2 -Once you are satisfied with the generated API client, you can replace the -existing files under the `v1` or `v2` directory with your generated files: +# This will generate the API v1 and v2 client files under the local `./output/jcapiv1` and `./output/jcapiv2` directories. -``` -rm -rf v1 -mv output/v1 . +# Once you are satisfied with the generated API client, you can replace the existing files under the `jcapiv1` or `jcapiv2` directory with your generated files: -rm -rf v2 -mv output/v2 . +rm -rf jcapiv1 +mv output/jcapiv1 . + +rm -rf jcapiv2 +mv output/jcapiv2 . ``` There currently is a bug with Swagger Codegen where it generates redundant @@ -45,29 +47,30 @@ enums for certain structures (namely `GraphType` and `GroupType`). Make sure to run the following commands in order to remove the enums declarations: -``` +```bash sed '/type GraphType string/q' v2/graph_type.go > tmp && mv tmp v2/graph_type.go sed '/type GroupType string/q' v2/group_type.go > tmp && mv tmp v2/group_type.go ``` -### Versioning + +## Versioning [Semantic Versioning](https://semver.org) is used for the generated client packages. -#### Go Export Parser +### Go Export Parser `tools/go-export-parser` can be used to validate a new version and determine the semantic version component to increment for a new release. The tool generates a go source file that references all exported elements of the API. This source file can be compared to the one for the previous version to determine which semantic versioning component (major, minor, or patch) to increment. -In addition, the generated go file can be compiled to validate the correctness of the generated SDK to +In addition, the generated go file can be compiled to validate the correctness of the generated SDK to some extent. The tool is a linux executable. (It runs in docker on other OSs). Here is an example session: -``` +```bash $ git checkout -q 1.6.1 $ ./tools/go-export-parser github.com/TheJumpCloud/jcapi-go/v1 > ref_v1-1_6_1.go $ go run ref_v1-1_6_1.go @@ -111,20 +114,20 @@ $ diff <(sort ref_v1-1_6_1.go) <(sort ref_v1-2_0_0.go) > var _ string = new(v1.SystemSshdParams).Value 657a670 > var _ time.Time = new(v1.Body1).ExclusionUntil -$ +$ ``` In general, changed or deleted lines imply a MAJOR component increment, added lines imply a MINOR component increment, no change implies a PATCH component increment. The above example indicates a new MAJOR version because the type of `SshdParams`, `RequestTime`, and `ResponseTime` changed. -##### Notes +#### Notes The go-export-parser tool requires all of jcapi-go's dependent packages to be installed. If you get failures like: -``` +```bash $ tools/go-export-parser github.com/TheJumpCloud/jcapi-go/v1 > ref_v1_2_0_1.go /go/src/github.com/TheJumpCloud/jcapi-go/v1/api_client.go:20:5: could not import golang.org/x/oauth2 (cannot find package "golang.org/x/oauth2" in any of: /usr/local/go/src/golang.org/x/oauth2 (from $GOROOT) @@ -136,7 +139,8 @@ $ tools/go-export-parser github.com/TheJumpCloud/jcapi-go/v1 > ref_v1_2_0_1.go ``` Install the dependencies with `go get`: -``` + +```bash $ go get golang.org/x/oauth2 $ tools/go-export-parser github.com/TheJumpCloud/jcapi-go/v1 > ref_v1_2_0_1.go $ diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..a612ad9 --- /dev/null +++ b/LICENSE @@ -0,0 +1,373 @@ +Mozilla Public License Version 2.0 +================================== + +1. Definitions +-------------- + +1.1. "Contributor" + means each individual or legal entity that creates, contributes to + the creation of, or owns Covered Software. + +1.2. "Contributor Version" + means the combination of the Contributions of others (if any) used + by a Contributor and that particular Contributor's Contribution. + +1.3. "Contribution" + means Covered Software of a particular Contributor. + +1.4. "Covered Software" + means Source Code Form to which the initial Contributor has attached + the notice in Exhibit A, the Executable Form of such Source Code + Form, and Modifications of such Source Code Form, in each case + including portions thereof. + +1.5. "Incompatible With Secondary Licenses" + means + + (a) that the initial Contributor has attached the notice described + in Exhibit B to the Covered Software; or + + (b) that the Covered Software was made available under the terms of + version 1.1 or earlier of the License, but not also under the + terms of a Secondary License. + +1.6. "Executable Form" + means any form of the work other than Source Code Form. + +1.7. "Larger Work" + means a work that combines Covered Software with other material, in + a separate file or files, that is not Covered Software. + +1.8. "License" + means this document. + +1.9. "Licensable" + means having the right to grant, to the maximum extent possible, + whether at the time of the initial grant or subsequently, any and + all of the rights conveyed by this License. + +1.10. "Modifications" + means any of the following: + + (a) any file in Source Code Form that results from an addition to, + deletion from, or modification of the contents of Covered + Software; or + + (b) any new file in Source Code Form that contains any Covered + Software. + +1.11. "Patent Claims" of a Contributor + means any patent claim(s), including without limitation, method, + process, and apparatus claims, in any patent Licensable by such + Contributor that would be infringed, but for the grant of the + License, by the making, using, selling, offering for sale, having + made, import, or transfer of either its Contributions or its + Contributor Version. + +1.12. "Secondary License" + means either the GNU General Public License, Version 2.0, the GNU + Lesser General Public License, Version 2.1, the GNU Affero General + Public License, Version 3.0, or any later versions of those + licenses. + +1.13. "Source Code Form" + means the form of the work preferred for making modifications. + +1.14. "You" (or "Your") + means an individual or a legal entity exercising rights under this + License. For legal entities, "You" includes any entity that + controls, is controlled by, or is under common control with You. For + purposes of this definition, "control" means (a) the power, direct + or indirect, to cause the direction or management of such entity, + whether by contract or otherwise, or (b) ownership of more than + fifty percent (50%) of the outstanding shares or beneficial + ownership of such entity. + +2. License Grants and Conditions +-------------------------------- + +2.1. Grants + +Each Contributor hereby grants You a world-wide, royalty-free, +non-exclusive license: + +(a) under intellectual property rights (other than patent or trademark) + Licensable by such Contributor to use, reproduce, make available, + modify, display, perform, distribute, and otherwise exploit its + Contributions, either on an unmodified basis, with Modifications, or + as part of a Larger Work; and + +(b) under Patent Claims of such Contributor to make, use, sell, offer + for sale, have made, import, and otherwise transfer either its + Contributions or its Contributor Version. + +2.2. Effective Date + +The licenses granted in Section 2.1 with respect to any Contribution +become effective for each Contribution on the date the Contributor first +distributes such Contribution. + +2.3. Limitations on Grant Scope + +The licenses granted in this Section 2 are the only rights granted under +this License. No additional rights or licenses will be implied from the +distribution or licensing of Covered Software under this License. +Notwithstanding Section 2.1(b) above, no patent license is granted by a +Contributor: + +(a) for any code that a Contributor has removed from Covered Software; + or + +(b) for infringements caused by: (i) Your and any other third party's + modifications of Covered Software, or (ii) the combination of its + Contributions with other software (except as part of its Contributor + Version); or + +(c) under Patent Claims infringed by Covered Software in the absence of + its Contributions. + +This License does not grant any rights in the trademarks, service marks, +or logos of any Contributor (except as may be necessary to comply with +the notice requirements in Section 3.4). + +2.4. Subsequent Licenses + +No Contributor makes additional grants as a result of Your choice to +distribute the Covered Software under a subsequent version of this +License (see Section 10.2) or under the terms of a Secondary License (if +permitted under the terms of Section 3.3). + +2.5. Representation + +Each Contributor represents that the Contributor believes its +Contributions are its original creation(s) or it has sufficient rights +to grant the rights to its Contributions conveyed by this License. + +2.6. Fair Use + +This License is not intended to limit any rights You have under +applicable copyright doctrines of fair use, fair dealing, or other +equivalents. + +2.7. Conditions + +Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted +in Section 2.1. + +3. Responsibilities +------------------- + +3.1. Distribution of Source Form + +All distribution of Covered Software in Source Code Form, including any +Modifications that You create or to which You contribute, must be under +the terms of this License. You must inform recipients that the Source +Code Form of the Covered Software is governed by the terms of this +License, and how they can obtain a copy of this License. You may not +attempt to alter or restrict the recipients' rights in the Source Code +Form. + +3.2. Distribution of Executable Form + +If You distribute Covered Software in Executable Form then: + +(a) such Covered Software must also be made available in Source Code + Form, as described in Section 3.1, and You must inform recipients of + the Executable Form how they can obtain a copy of such Source Code + Form by reasonable means in a timely manner, at a charge no more + than the cost of distribution to the recipient; and + +(b) You may distribute such Executable Form under the terms of this + License, or sublicense it under different terms, provided that the + license for the Executable Form does not attempt to limit or alter + the recipients' rights in the Source Code Form under this License. + +3.3. Distribution of a Larger Work + +You may create and distribute a Larger Work under terms of Your choice, +provided that You also comply with the requirements of this License for +the Covered Software. If the Larger Work is a combination of Covered +Software with a work governed by one or more Secondary Licenses, and the +Covered Software is not Incompatible With Secondary Licenses, this +License permits You to additionally distribute such Covered Software +under the terms of such Secondary License(s), so that the recipient of +the Larger Work may, at their option, further distribute the Covered +Software under the terms of either this License or such Secondary +License(s). + +3.4. Notices + +You may not remove or alter the substance of any license notices +(including copyright notices, patent notices, disclaimers of warranty, +or limitations of liability) contained within the Source Code Form of +the Covered Software, except that You may alter any license notices to +the extent required to remedy known factual inaccuracies. + +3.5. Application of Additional Terms + +You may choose to offer, and to charge a fee for, warranty, support, +indemnity or liability obligations to one or more recipients of Covered +Software. However, You may do so only on Your own behalf, and not on +behalf of any Contributor. You must make it absolutely clear that any +such warranty, support, indemnity, or liability obligation is offered by +You alone, and You hereby agree to indemnify every Contributor for any +liability incurred by such Contributor as a result of warranty, support, +indemnity or liability terms You offer. You may include additional +disclaimers of warranty and limitations of liability specific to any +jurisdiction. + +4. Inability to Comply Due to Statute or Regulation +--------------------------------------------------- + +If it is impossible for You to comply with any of the terms of this +License with respect to some or all of the Covered Software due to +statute, judicial order, or regulation then You must: (a) comply with +the terms of this License to the maximum extent possible; and (b) +describe the limitations and the code they affect. Such description must +be placed in a text file included with all distributions of the Covered +Software under this License. Except to the extent prohibited by statute +or regulation, such description must be sufficiently detailed for a +recipient of ordinary skill to be able to understand it. + +5. Termination +-------------- + +5.1. The rights granted under this License will terminate automatically +if You fail to comply with any of its terms. However, if You become +compliant, then the rights granted under this License from a particular +Contributor are reinstated (a) provisionally, unless and until such +Contributor explicitly and finally terminates Your grants, and (b) on an +ongoing basis, if such Contributor fails to notify You of the +non-compliance by some reasonable means prior to 60 days after You have +come back into compliance. Moreover, Your grants from a particular +Contributor are reinstated on an ongoing basis if such Contributor +notifies You of the non-compliance by some reasonable means, this is the +first time You have received notice of non-compliance with this License +from such Contributor, and You become compliant prior to 30 days after +Your receipt of the notice. + +5.2. If You initiate litigation against any entity by asserting a patent +infringement claim (excluding declaratory judgment actions, +counter-claims, and cross-claims) alleging that a Contributor Version +directly or indirectly infringes any patent, then the rights granted to +You by any and all Contributors for the Covered Software under Section +2.1 of this License shall terminate. + +5.3. In the event of termination under Sections 5.1 or 5.2 above, all +end user license agreements (excluding distributors and resellers) which +have been validly granted by You or Your distributors under this License +prior to termination shall survive termination. + +************************************************************************ +* * +* 6. Disclaimer of Warranty * +* ------------------------- * +* * +* Covered Software is provided under this License on an "as is" * +* basis, without warranty of any kind, either expressed, implied, or * +* statutory, including, without limitation, warranties that the * +* Covered Software is free of defects, merchantable, fit for a * +* particular purpose or non-infringing. The entire risk as to the * +* quality and performance of the Covered Software is with You. * +* Should any Covered Software prove defective in any respect, You * +* (not any Contributor) assume the cost of any necessary servicing, * +* repair, or correction. This disclaimer of warranty constitutes an * +* essential part of this License. No use of any Covered Software is * +* authorized under this License except under this disclaimer. * +* * +************************************************************************ + +************************************************************************ +* * +* 7. Limitation of Liability * +* -------------------------- * +* * +* Under no circumstances and under no legal theory, whether tort * +* (including negligence), contract, or otherwise, shall any * +* Contributor, or anyone who distributes Covered Software as * +* permitted above, be liable to You for any direct, indirect, * +* special, incidental, or consequential damages of any character * +* including, without limitation, damages for lost profits, loss of * +* goodwill, work stoppage, computer failure or malfunction, or any * +* and all other commercial damages or losses, even if such party * +* shall have been informed of the possibility of such damages. This * +* limitation of liability shall not apply to liability for death or * +* personal injury resulting from such party's negligence to the * +* extent applicable law prohibits such limitation. Some * +* jurisdictions do not allow the exclusion or limitation of * +* incidental or consequential damages, so this exclusion and * +* limitation may not apply to You. * +* * +************************************************************************ + +8. Litigation +------------- + +Any litigation relating to this License may be brought only in the +courts of a jurisdiction where the defendant maintains its principal +place of business and such litigation shall be governed by laws of that +jurisdiction, without reference to its conflict-of-law provisions. +Nothing in this Section shall prevent a party's ability to bring +cross-claims or counter-claims. + +9. Miscellaneous +---------------- + +This License represents the complete agreement concerning the subject +matter hereof. If any provision of this License is held to be +unenforceable, such provision shall be reformed only to the extent +necessary to make it enforceable. Any law or regulation which provides +that the language of a contract shall be construed against the drafter +shall not be used to construe this License against a Contributor. + +10. Versions of the License +--------------------------- + +10.1. New Versions + +Mozilla Foundation is the license steward. Except as provided in Section +10.3, no one other than the license steward has the right to modify or +publish new versions of this License. Each version will be given a +distinguishing version number. + +10.2. Effect of New Versions + +You may distribute the Covered Software under the terms of the version +of the License under which You originally received the Covered Software, +or under the terms of any subsequent version published by the license +steward. + +10.3. Modified Versions + +If you create software not governed by this License, and you want to +create a new license for such software, you may create and use a +modified version of this License if you rename the license and remove +any references to the name of the license steward (except to note that +such modified license differs from this License). + +10.4. Distributing Source Code Form that is Incompatible With Secondary +Licenses + +If You choose to distribute Source Code Form that is Incompatible With +Secondary Licenses under the terms of this version of the License, the +notice described in Exhibit B of this License must be attached. + +Exhibit A - Source Code Form License Notice +------------------------------------------- + + This Source Code Form is subject to the terms of the Mozilla Public + License, v. 2.0. If a copy of the MPL was not distributed with this + file, You can obtain one at http://mozilla.org/MPL/2.0/. + +If it is not possible or desirable to put the notice in a particular +file, then You may include the notice in a location (such as a LICENSE +file in a relevant directory) where a recipient would be likely to look +for such a notice. + +You may add additional accurate notices of copyright ownership. + +Exhibit B - "Incompatible With Secondary Licenses" Notice +--------------------------------------------------------- + + This Source Code Form is "Incompatible With Secondary Licenses", as + defined by the Mozilla Public License, v. 2.0. diff --git a/config_v1.json b/config_v1.json index 35fdb72..04d3c87 100644 --- a/config_v1.json +++ b/config_v1.json @@ -1,4 +1,4 @@ { - "packageName": "v1", - "packageVersion": "3.0.0" + "packageName": "jcapiv1", + "packageVersion": "5.0.0" } diff --git a/config_v2.json b/config_v2.json index 0ee4f2f..8fab156 100644 --- a/config_v2.json +++ b/config_v2.json @@ -1,4 +1,4 @@ { - "packageName": "v2", - "packageVersion": "3.0.0" + "packageName": "jcapiv2", + "packageVersion": "5.0.0" } diff --git a/docker-compose.yml b/docker-compose.yml index 6eec966..e820608 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,7 +1,7 @@ version: '2' services: swagger-codegen: - image: jimschubert/swagger-codegen-cli:2.3.1 + image: parsertongue/swagger-codegen-cli:3.0.32 volumes: - ./input:/swagger-api/yaml # volume for input yaml files - ./output:/swagger-api/out # volume for generated files diff --git a/v1/.gitignore b/jcapiv1/.gitignore similarity index 100% rename from v1/.gitignore rename to jcapiv1/.gitignore diff --git a/v1/.swagger-codegen-ignore b/jcapiv1/.swagger-codegen-ignore similarity index 100% rename from v1/.swagger-codegen-ignore rename to jcapiv1/.swagger-codegen-ignore diff --git a/jcapiv1/.swagger-codegen/VERSION b/jcapiv1/.swagger-codegen/VERSION new file mode 100644 index 0000000..8d87cde --- /dev/null +++ b/jcapiv1/.swagger-codegen/VERSION @@ -0,0 +1 @@ +3.0.32 \ No newline at end of file diff --git a/v1/.travis.yml b/jcapiv1/.travis.yml similarity index 100% rename from v1/.travis.yml rename to jcapiv1/.travis.yml diff --git a/jcapiv1/README.md b/jcapiv1/README.md new file mode 100644 index 0000000..08ed4fa --- /dev/null +++ b/jcapiv1/README.md @@ -0,0 +1,207 @@ +# Go API client for jcapiv1 + +# Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + +## Overview +This API client was generated by the [swagger-codegen](https://github.com/swagger-api/swagger-codegen) project. By using the [swagger-spec](https://github.com/swagger-api/swagger-spec) from a remote server, you can easily generate an API client. + +- API version: 1.0 +- Package version: 5.0.0 +- Build package: io.swagger.codegen.v3.generators.go.GoClientCodegen +For more information, please visit [https://support.jumpcloud.com/support/s/](https://support.jumpcloud.com/support/s/) + +## Installation +Put the package under your project folder and add the following in import: +```golang +import "./jcapiv1" +``` + +## Documentation for API Endpoints + +All URIs are relative to *https://console.jumpcloud.com/api* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*ApplicationTemplatesApi* | [**ApplicationTemplatesGet**](docs/ApplicationTemplatesApi.md#applicationtemplatesget) | **Get** /application-templates/{id} | Get an Application Template +*ApplicationTemplatesApi* | [**ApplicationTemplatesList**](docs/ApplicationTemplatesApi.md#applicationtemplateslist) | **Get** /application-templates | List Application Templates +*ApplicationsApi* | [**ApplicationsDelete**](docs/ApplicationsApi.md#applicationsdelete) | **Delete** /applications/{id} | Delete an Application +*ApplicationsApi* | [**ApplicationsGet**](docs/ApplicationsApi.md#applicationsget) | **Get** /applications/{id} | Get an Application +*ApplicationsApi* | [**ApplicationsList**](docs/ApplicationsApi.md#applicationslist) | **Get** /applications | Applications +*ApplicationsApi* | [**ApplicationsPost**](docs/ApplicationsApi.md#applicationspost) | **Post** /applications | Create an Application +*ApplicationsApi* | [**ApplicationsPut**](docs/ApplicationsApi.md#applicationsput) | **Put** /applications/{id} | Update an Application +*CommandResultsApi* | [**CommandResultsDelete**](docs/CommandResultsApi.md#commandresultsdelete) | **Delete** /commandresults/{id} | Delete a Command result +*CommandResultsApi* | [**CommandResultsGet**](docs/CommandResultsApi.md#commandresultsget) | **Get** /commandresults/{id} | List an individual Command result +*CommandResultsApi* | [**CommandResultsList**](docs/CommandResultsApi.md#commandresultslist) | **Get** /commandresults | List all Command Results +*CommandTriggersApi* | [**CommandTriggerWebhookPost**](docs/CommandTriggersApi.md#commandtriggerwebhookpost) | **Post** /command/trigger/{triggername} | Launch a command via a Trigger +*CommandsApi* | [**CommandFileGet**](docs/CommandsApi.md#commandfileget) | **Get** /files/command/{id} | Get a Command File +*CommandsApi* | [**CommandsDelete**](docs/CommandsApi.md#commandsdelete) | **Delete** /commands/{id} | Delete a Command +*CommandsApi* | [**CommandsGet**](docs/CommandsApi.md#commandsget) | **Get** /commands/{id} | List an individual Command +*CommandsApi* | [**CommandsGetResults**](docs/CommandsApi.md#commandsgetresults) | **Get** /commands/{id}/results | Get results for a specific command +*CommandsApi* | [**CommandsList**](docs/CommandsApi.md#commandslist) | **Get** /commands | List All Commands +*CommandsApi* | [**CommandsPost**](docs/CommandsApi.md#commandspost) | **Post** /commands | Create A Command +*CommandsApi* | [**CommandsPut**](docs/CommandsApi.md#commandsput) | **Put** /commands/{id} | Update a Command +*ManagedServiceProviderApi* | [**AdminTotpresetBegin**](docs/ManagedServiceProviderApi.md#admintotpresetbegin) | **Post** /users/resettotp/{id} | Administrator TOTP Reset Initiation +*ManagedServiceProviderApi* | [**OrganizationList**](docs/ManagedServiceProviderApi.md#organizationlist) | **Get** /organizations | Get Organization Details +*ManagedServiceProviderApi* | [**UsersPut**](docs/ManagedServiceProviderApi.md#usersput) | **Put** /users/{id} | Update a user +*ManagedServiceProviderApi* | [**UsersReactivateGet**](docs/ManagedServiceProviderApi.md#usersreactivateget) | **Get** /users/reactivate/{id} | Administrator Password Reset Initiation +*OrganizationsApi* | [**OrganizationList**](docs/OrganizationsApi.md#organizationlist) | **Get** /organizations | Get Organization Details +*OrganizationsApi* | [**OrganizationPut**](docs/OrganizationsApi.md#organizationput) | **Put** /organizations/{id} | Update an Organization +*OrganizationsApi* | [**OrganizationsGet**](docs/OrganizationsApi.md#organizationsget) | **Get** /organizations/{id} | Get an Organization +*RadiusServersApi* | [**RadiusServersDelete**](docs/RadiusServersApi.md#radiusserversdelete) | **Delete** /radiusservers/{id} | Delete Radius Server +*RadiusServersApi* | [**RadiusServersGet**](docs/RadiusServersApi.md#radiusserversget) | **Get** /radiusservers/{id} | Get Radius Server +*RadiusServersApi* | [**RadiusServersList**](docs/RadiusServersApi.md#radiusserverslist) | **Get** /radiusservers | List Radius Servers +*RadiusServersApi* | [**RadiusServersPost**](docs/RadiusServersApi.md#radiusserverspost) | **Post** /radiusservers | Create a Radius Server +*RadiusServersApi* | [**RadiusServersPut**](docs/RadiusServersApi.md#radiusserversput) | **Put** /radiusservers/{id} | Update Radius Servers +*SearchApi* | [**SearchCommandresultsPost**](docs/SearchApi.md#searchcommandresultspost) | **Post** /search/commandresults | Search Commands Results +*SearchApi* | [**SearchCommandsPost**](docs/SearchApi.md#searchcommandspost) | **Post** /search/commands | Search Commands +*SearchApi* | [**SearchOrganizationsPost**](docs/SearchApi.md#searchorganizationspost) | **Post** /search/organizations | Search Organizations +*SearchApi* | [**SearchSystemsPost**](docs/SearchApi.md#searchsystemspost) | **Post** /search/systems | Search Systems +*SearchApi* | [**SearchSystemusersPost**](docs/SearchApi.md#searchsystemuserspost) | **Post** /search/systemusers | Search System Users +*SystemsApi* | [**SystemsCommandBuiltinErase**](docs/SystemsApi.md#systemscommandbuiltinerase) | **Post** /systems/{system_id}/command/builtin/erase | Erase a System +*SystemsApi* | [**SystemsCommandBuiltinLock**](docs/SystemsApi.md#systemscommandbuiltinlock) | **Post** /systems/{system_id}/command/builtin/lock | Lock a System +*SystemsApi* | [**SystemsCommandBuiltinRestart**](docs/SystemsApi.md#systemscommandbuiltinrestart) | **Post** /systems/{system_id}/command/builtin/restart | Restart a System +*SystemsApi* | [**SystemsCommandBuiltinShutdown**](docs/SystemsApi.md#systemscommandbuiltinshutdown) | **Post** /systems/{system_id}/command/builtin/shutdown | Shutdown a System +*SystemsApi* | [**SystemsDelete**](docs/SystemsApi.md#systemsdelete) | **Delete** /systems/{id} | Delete a System +*SystemsApi* | [**SystemsGet**](docs/SystemsApi.md#systemsget) | **Get** /systems/{id} | List an individual system +*SystemsApi* | [**SystemsList**](docs/SystemsApi.md#systemslist) | **Get** /systems | List All Systems +*SystemsApi* | [**SystemsPut**](docs/SystemsApi.md#systemsput) | **Put** /systems/{id} | Update a system +*SystemusersApi* | [**SshkeyDelete**](docs/SystemusersApi.md#sshkeydelete) | **Delete** /systemusers/{systemuser_id}/sshkeys/{id} | Delete a system user's Public SSH Keys +*SystemusersApi* | [**SshkeyList**](docs/SystemusersApi.md#sshkeylist) | **Get** /systemusers/{id}/sshkeys | List a system user's public SSH keys +*SystemusersApi* | [**SshkeyPost**](docs/SystemusersApi.md#sshkeypost) | **Post** /systemusers/{id}/sshkeys | Create a system user's Public SSH Key +*SystemusersApi* | [**SystemusersDelete**](docs/SystemusersApi.md#systemusersdelete) | **Delete** /systemusers/{id} | Delete a system user +*SystemusersApi* | [**SystemusersExpire**](docs/SystemusersApi.md#systemusersexpire) | **Post** /systemusers/{id}/expire | Expire a system user's password +*SystemusersApi* | [**SystemusersGet**](docs/SystemusersApi.md#systemusersget) | **Get** /systemusers/{id} | List a system user +*SystemusersApi* | [**SystemusersList**](docs/SystemusersApi.md#systemuserslist) | **Get** /systemusers | List all system users +*SystemusersApi* | [**SystemusersMfasync**](docs/SystemusersApi.md#systemusersmfasync) | **Post** /systemusers/{id}/mfasync | Sync a systemuser's mfa enrollment status +*SystemusersApi* | [**SystemusersPost**](docs/SystemusersApi.md#systemuserspost) | **Post** /systemusers | Create a system user +*SystemusersApi* | [**SystemusersPut**](docs/SystemusersApi.md#systemusersput) | **Put** /systemusers/{id} | Update a system user +*SystemusersApi* | [**SystemusersResetmfa**](docs/SystemusersApi.md#systemusersresetmfa) | **Post** /systemusers/{id}/resetmfa | Reset a system user's MFA token +*SystemusersApi* | [**SystemusersStateActivate**](docs/SystemusersApi.md#systemusersstateactivate) | **Post** /systemusers/{id}/state/activate | Activate System User +*SystemusersApi* | [**SystemusersUnlock**](docs/SystemusersApi.md#systemusersunlock) | **Post** /systemusers/{id}/unlock | Unlock a system user +*UsersApi* | [**AdminTotpresetBegin**](docs/UsersApi.md#admintotpresetbegin) | **Post** /users/resettotp/{id} | Administrator TOTP Reset Initiation +*UsersApi* | [**UsersPut**](docs/UsersApi.md#usersput) | **Put** /users/{id} | Update a user +*UsersApi* | [**UsersReactivateGet**](docs/UsersApi.md#usersreactivateget) | **Get** /users/reactivate/{id} | Administrator Password Reset Initiation + +## Documentation For Models + + - [Application](docs/Application.md) + - [ApplicationConfig](docs/ApplicationConfig.md) + - [ApplicationConfigAcsUrl](docs/ApplicationConfigAcsUrl.md) + - [ApplicationConfigAcsUrlTooltip](docs/ApplicationConfigAcsUrlTooltip.md) + - [ApplicationConfigAcsUrlTooltipVariables](docs/ApplicationConfigAcsUrlTooltipVariables.md) + - [ApplicationConfigConstantAttributes](docs/ApplicationConfigConstantAttributes.md) + - [ApplicationConfigConstantAttributesValue](docs/ApplicationConfigConstantAttributesValue.md) + - [ApplicationConfigDatabaseAttributes](docs/ApplicationConfigDatabaseAttributes.md) + - [ApplicationLogo](docs/ApplicationLogo.md) + - [Applicationslist](docs/Applicationslist.md) + - [Applicationtemplate](docs/Applicationtemplate.md) + - [ApplicationtemplateJit](docs/ApplicationtemplateJit.md) + - [ApplicationtemplateLogo](docs/ApplicationtemplateLogo.md) + - [ApplicationtemplateOidc](docs/ApplicationtemplateOidc.md) + - [ApplicationtemplateProvision](docs/ApplicationtemplateProvision.md) + - [Applicationtemplateslist](docs/Applicationtemplateslist.md) + - [Command](docs/Command.md) + - [Commandfilereturn](docs/Commandfilereturn.md) + - [CommandfilereturnResults](docs/CommandfilereturnResults.md) + - [Commandresult](docs/Commandresult.md) + - [CommandresultResponse](docs/CommandresultResponse.md) + - [CommandresultResponseData](docs/CommandresultResponseData.md) + - [Commandresultslist](docs/Commandresultslist.md) + - [CommandresultslistResults](docs/CommandresultslistResults.md) + - [Commandslist](docs/Commandslist.md) + - [CommandslistResults](docs/CommandslistResults.md) + - [ErrorDetails](docs/ErrorDetails.md) + - [Fde](docs/Fde.md) + - [IdResetmfaBody](docs/IdResetmfaBody.md) + - [Mfa](docs/Mfa.md) + - [MfaEnrollment](docs/MfaEnrollment.md) + - [MfaEnrollmentStatus](docs/MfaEnrollmentStatus.md) + - [ModelError](docs/ModelError.md) + - [Organization](docs/Organization.md) + - [Organizationentitlement](docs/Organizationentitlement.md) + - [OrganizationentitlementEntitlementProducts](docs/OrganizationentitlementEntitlementProducts.md) + - [OrganizationsIdBody](docs/OrganizationsIdBody.md) + - [Organizationsettings](docs/Organizationsettings.md) + - [OrganizationsettingsDisplayPreferences](docs/OrganizationsettingsDisplayPreferences.md) + - [OrganizationsettingsDisplayPreferencesOrgInsights](docs/OrganizationsettingsDisplayPreferencesOrgInsights.md) + - [OrganizationsettingsDisplayPreferencesOrgInsightsApplicationsUsage](docs/OrganizationsettingsDisplayPreferencesOrgInsightsApplicationsUsage.md) + - [OrganizationsettingsDisplayPreferencesOrgInsightsConsoleStats](docs/OrganizationsettingsDisplayPreferencesOrgInsightsConsoleStats.md) + - [OrganizationsettingsDisplayPreferencesOrgInsightsDeviceNotifications](docs/OrganizationsettingsDisplayPreferencesOrgInsightsDeviceNotifications.md) + - [OrganizationsettingsDisplayPreferencesOrgInsightsUserNotifications](docs/OrganizationsettingsDisplayPreferencesOrgInsightsUserNotifications.md) + - [OrganizationsettingsFeatures](docs/OrganizationsettingsFeatures.md) + - [OrganizationsettingsFeaturesDirectoryInsights](docs/OrganizationsettingsFeaturesDirectoryInsights.md) + - [OrganizationsettingsFeaturesDirectoryInsightsPremium](docs/OrganizationsettingsFeaturesDirectoryInsightsPremium.md) + - [OrganizationsettingsFeaturesSystemInsights](docs/OrganizationsettingsFeaturesSystemInsights.md) + - [OrganizationsettingsNewSystemUserStateDefaults](docs/OrganizationsettingsNewSystemUserStateDefaults.md) + - [OrganizationsettingsPasswordPolicy](docs/OrganizationsettingsPasswordPolicy.md) + - [OrganizationsettingsUserPortal](docs/OrganizationsettingsUserPortal.md) + - [Organizationsettingsput](docs/Organizationsettingsput.md) + - [OrganizationsettingsputNewSystemUserStateDefaults](docs/OrganizationsettingsputNewSystemUserStateDefaults.md) + - [OrganizationsettingsputPasswordPolicy](docs/OrganizationsettingsputPasswordPolicy.md) + - [Organizationslist](docs/Organizationslist.md) + - [OrganizationslistResults](docs/OrganizationslistResults.md) + - [Radiusserver](docs/Radiusserver.md) + - [Radiusserverpost](docs/Radiusserverpost.md) + - [Radiusserverput](docs/Radiusserverput.md) + - [RadiusserversIdBody](docs/RadiusserversIdBody.md) + - [Radiusserverslist](docs/Radiusserverslist.md) + - [Search](docs/Search.md) + - [Sshkeylist](docs/Sshkeylist.md) + - [Sshkeypost](docs/Sshkeypost.md) + - [Sso](docs/Sso.md) + - [StateActivateBody](docs/StateActivateBody.md) + - [System](docs/System.md) + - [SystemBuiltInCommands](docs/SystemBuiltInCommands.md) + - [SystemDomainInfo](docs/SystemDomainInfo.md) + - [SystemMdm](docs/SystemMdm.md) + - [SystemMdmInternal](docs/SystemMdmInternal.md) + - [SystemNetworkInterfaces](docs/SystemNetworkInterfaces.md) + - [SystemOsVersionDetail](docs/SystemOsVersionDetail.md) + - [SystemProvisionMetadata](docs/SystemProvisionMetadata.md) + - [SystemProvisionMetadataProvisioner](docs/SystemProvisionMetadataProvisioner.md) + - [SystemServiceAccountState](docs/SystemServiceAccountState.md) + - [SystemSshdParams](docs/SystemSshdParams.md) + - [SystemSystemInsights](docs/SystemSystemInsights.md) + - [SystemUserMetrics](docs/SystemUserMetrics.md) + - [Systemput](docs/Systemput.md) + - [SystemputAgentBoundMessages](docs/SystemputAgentBoundMessages.md) + - [Systemslist](docs/Systemslist.md) + - [Systemuserput](docs/Systemuserput.md) + - [SystemuserputAddresses](docs/SystemuserputAddresses.md) + - [SystemuserputAttributes](docs/SystemuserputAttributes.md) + - [SystemuserputPhoneNumbers](docs/SystemuserputPhoneNumbers.md) + - [SystemuserputRelationships](docs/SystemuserputRelationships.md) + - [Systemuserputpost](docs/Systemuserputpost.md) + - [SystemuserputpostAddresses](docs/SystemuserputpostAddresses.md) + - [SystemuserputpostPhoneNumbers](docs/SystemuserputpostPhoneNumbers.md) + - [SystemuserputpostRecoveryEmail](docs/SystemuserputpostRecoveryEmail.md) + - [Systemuserreturn](docs/Systemuserreturn.md) + - [SystemuserreturnAddresses](docs/SystemuserreturnAddresses.md) + - [SystemuserreturnPhoneNumbers](docs/SystemuserreturnPhoneNumbers.md) + - [SystemuserreturnRecoveryEmail](docs/SystemuserreturnRecoveryEmail.md) + - [Systemuserslist](docs/Systemuserslist.md) + - [Triggerreturn](docs/Triggerreturn.md) + - [TrustedappConfigGet](docs/TrustedappConfigGet.md) + - [TrustedappConfigGetTrustedApps](docs/TrustedappConfigGetTrustedApps.md) + - [TrustedappConfigPut](docs/TrustedappConfigPut.md) + - [Userput](docs/Userput.md) + - [Userreturn](docs/Userreturn.md) + - [UserreturnGrowthData](docs/UserreturnGrowthData.md) + +## Documentation For Authorization + +## x-api-key +- **Type**: API key + +Example +```golang +auth := context.WithValue(context.Background(), sw.ContextAPIKey, sw.APIKey{ + Key: "APIKEY", + Prefix: "Bearer", // Omit if not necessary. +}) +r, err := client.Service.Operation(auth, args) +``` + +## Author + +support@jumpcloud.com diff --git a/jcapiv1/api/swagger.yaml b/jcapiv1/api/swagger.yaml new file mode 100644 index 0000000..88b7bd4 --- /dev/null +++ b/jcapiv1/api/swagger.yaml @@ -0,0 +1,9905 @@ +openapi: 3.0.1 +info: + title: JumpCloud API + description: "# Overview\n\nJumpCloud's V1 API. This set of endpoints allows JumpCloud\ + \ customers to manage commands, systems, and system users.\n\n# API Key\n\n##\ + \ Access Your API Key\n\nTo locate your API Key:\n\n1. Log into the [JumpCloud\ + \ Admin Console](https://console.jumpcloud.com/).\n2. Go to the username drop\ + \ down located in the top-right of the Console.\n3. Retrieve your API key from\ + \ API Settings.\n\n## API Key Considerations\n\nThis API key is associated to\ + \ the currently logged in administrator. Other admins will have different API\ + \ keys.\n\n**WARNING** Please keep this API key secret, as it grants full access\ + \ to any data accessible via your JumpCloud console account.\n\nYou can also reset\ + \ your API key in the same location in the JumpCloud Admin Console.\n\n## Recycling\ + \ or Resetting Your API Key\n\nIn order to revoke access with the current API\ + \ key, simply reset your API key. This will render all calls using the previous\ + \ API key inaccessible.\n\nYour API key will be passed in as a header with the\ + \ header name \"x-api-key\".\n\n```bash\ncurl -H \"x-api-key: [YOUR_API_KEY_HERE]\"\ + \ \"https://console.jumpcloud.com/api/systemusers\"\n```\n\n# System Context\n\ + \n* [Introduction](#introduction)\n* [Supported endpoints](#supported-endpoints)\n\ + * [Response codes](#response-codes)\n* [Authentication](#authentication)\n* [Additional\ + \ examples](#additional-examples)\n* [Third party](#third-party)\n\n## Introduction\n\ + \nJumpCloud System Context Authorization is an alternative way to authenticate\ + \ with a subset of JumpCloud's REST APIs. Using this method, a system can manage\ + \ its information and resource associations, allowing modern auto provisioning\ + \ environments to scale as needed.\n\n**Notes:**\n\n * The following documentation\ + \ applies to Linux Operating Systems only.\n * Systems that have been automatically\ + \ enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using\ + \ the User Portal install are not eligible to use the System Context API to prevent\ + \ unauthorized access to system groups and resources. If a script that utilizes\ + \ the System Context API is invoked on a system enrolled in this way, it will\ + \ display an error.\n\n## Supported Endpoints\n\nJumpCloud System Context Authorization\ + \ can be used in conjunction with Systems endpoints found in the V1 API and certain\ + \ System Group endpoints found in the v2 API.\n\n* A system may fetch, alter,\ + \ and delete metadata about itself, including manipulating a system's Group and\ + \ Systemuser associations,\n * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get)\ + \ [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put)\n\ + * A system may delete itself from your JumpCloud organization\n * `/api/systems/{system_id}`\ + \ | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete)\n\ + * A system may fetch its direct resource associations under v2 (Groups)\n * `/api/v2/systems/{system_id}/memberof`\ + \ | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership)\n\ + \ * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList)\n\ + \ * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser)\n\ + * A system may alter its direct resource associations under v2 (Groups)\n * `/api/v2/systems/{system_id}/associations`\ + \ | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost)\n\ + * A system may alter its System Group associations\n * `/api/v2/systemgroups/{group_id}/members`\ + \ | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost)\n\ + \ * _NOTE_ If a system attempts to alter the system group membership of a different\ + \ system the request will be rejected\n\n## Response Codes\n\nIf endpoints other\ + \ than those described above are called using the System Context API, the server\ + \ will return a `401` response.\n\n## Authentication\n\nTo allow for secure access\ + \ to our APIs, you must authenticate each API request.\nJumpCloud System Context\ + \ Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00)\ + \ to authenticate API requests.\nThe HTTP Signatures sent with each request are\ + \ similar to the signatures used by the Amazon Web Services REST API.\nTo help\ + \ with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh).\ + \ This example API request simply requests the entire system record. You must\ + \ be root, or have permissions to access the contents of the `/opt/jc` directory\ + \ to generate a signature.\n\nHere is a breakdown of the example script with explanations.\n\ + \nFirst, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf`\ + \ file.\n\n```bash\n#!/bin/bash\nconf=\"`cat /opt/jc/jcagent.conf`\"\nregex=\"\ + systemKey\\\":\\\"(\\w+)\\\"\"\n\nif [[ $conf =~ $regex ]] ; then\n systemKey=\"\ + ${BASH_REMATCH[1]}\"\nfi\n```\n\nThen, the script retrieves the current date in\ + \ the correct format.\n\n```bash\nnow=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"\ + `;\n```\n\nNext, we build a signing string to demonstrate the expected signature\ + \ format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35)\ + \ and the date header, separated by a newline character.\n\n```bash\nsignstr=\"\ + GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\"\n```\n\nThe next step\ + \ is to calculate and apply the signature. This is a two-step process:\n\n1. Create\ + \ a signature from the signing string using the JumpCloud Agent private key: ``printf\ + \ \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key``\n2. Then Base64-encode\ + \ the signature string and trim off the newline characters: ``| openssl enc -e\ + \ -a | tr -d '\\n'``\n\nThe combined steps above result in:\n\n```bash\nsignature=`printf\ + \ \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e\ + \ -a | tr -d '\\n'` ;\n```\n\nFinally, we make sure the API call sending the signature\ + \ has the same Authorization and Date header values, HTTP method, and URL that\ + \ were used in the signing string.\n\n```bash\ncurl -iq \\\n -H \"Accept: application/json\"\ + \ \\\n -H \"Content-Type: application/json\" \\\n -H \"Date: ${now}\" \\\n \ + \ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"\ + request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\ + \"\" \\\n --url https://console.jumpcloud.com/api/systems/${systemKey}\n```\n\ + \n### Input Data\n\nAll PUT and POST methods should use the HTTP Content-Type\ + \ header with a value of 'application/json'. PUT methods are used for updating\ + \ a record. POST methods are used to create a record.\n\nThe following example\ + \ demonstrates how to update the `displayName` of the system.\n\n```bash\nsignstr=\"\ + PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\"\nsignature=`printf \"\ + $signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a\ + \ | tr -d '\\n'` ;\n\ncurl -iq \\\n -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\ + \"}\" \\\n -X \"PUT\" \\\n -H \"Content-Type: application/json\" \\\n -H \"\ + Accept: application/json\" \\\n -H \"Date: ${now}\" \\\n -H \"Authorization:\ + \ Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\"\ + ,algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\\n --url https://console.jumpcloud.com/api/systems/${systemKey}\n\ + ```\n\n### Output Data\n\nAll results will be formatted as JSON.\n\nHere is an\ + \ abbreviated example of response output:\n\n```json\n{\n \"_id\": \"525ee96f52e144993e000015\"\ + ,\n \"agentServer\": \"lappy386\",\n \"agentVersion\": \"0.9.42\",\n \"arch\"\ + : \"x86_64\",\n \"connectionKey\": \"127.0.0.1_51812\",\n \"displayName\": \"\ + ubuntu-1204\",\n \"firstContact\": \"2013-10-16T19:30:55.611Z\",\n \"hostname\"\ + : \"ubuntu-1204\"\n ...\n```\n\n## Additional Examples\n\n### Signing Authentication\ + \ Example\n\nThis example demonstrates how to make an authenticated request to\ + \ fetch the JumpCloud record for this system.\n\n[SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh)\n\ + \n### Shutdown Hook\n\nThis example demonstrates how to make an authenticated\ + \ request on system shutdown.\nUsing an init.d script registered at run level\ + \ 0, you can call the System Context API as the system is shutting down.\n\n[Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd)\ + \ is an example of an init.d script that only runs at system shutdown.\n\nAfter\ + \ customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd)\ + \ script, you should install it on the system(s) running the JumpCloud agent.\n\ + \n1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd)\ + \ to `/etc/init.d/instance-shutdown`.\n2. On Ubuntu systems, run `update-rc.d\ + \ instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add\ + \ instance-shutdown`.\n\n## Third Party\n\n### Chef Cookbooks\n\n[https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud)\n\ + \n[https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud)\n\ + \n# Multi-Tenant Portal Headers\n\nMulti-Tenant Organization API Headers are available\ + \ for JumpCloud Admins to use when making API requests from Organizations that\ + \ have multiple managed organizations.\n\nThe `x-org-id` is a required header\ + \ for all multi-tenant admins when making API requests to JumpCloud. This header\ + \ will define to which organization you would like to make the request.\n\n**NOTE**\ + \ Single Tenant Admins do not need to provide this header when making an API request.\n\ + \n## Header Value\n\n`x-org-id`\n\n## API Response Codes\n\n* `400` Malformed\ + \ ID.\n* `400` x-org-id and Organization path ID do not match.\n* `401` ID not\ + \ included for multi-tenant admin\n* `403` ID included on unsupported route.\n\ + * `404` Organization ID Not Found.\n\n```bash\ncurl -X GET https://console.jumpcloud.com/api/v2/directories\ + \ \\\n -H 'accept: application/json' \\\n -H 'content-type: application/json'\ + \ \\\n -H 'x-api-key: {API_KEY}' \\\n -H 'x-org-id: {ORG_ID}'\n\n```\n\n## To\ + \ Obtain an Individual Organization ID via the UI\n\nAs a prerequisite, your Primary\ + \ Organization will need to be setup for Multi-Tenancy. This provides access to\ + \ the Multi-Tenant Organization Admin Portal.\n\n1. Log into JumpCloud [Admin\ + \ Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you\ + \ will automatically be routed to the Multi-Tenant Admin Portal.\n2. From the\ + \ Multi-Tenant Portal's primary navigation bar, select the Organization you'd\ + \ like to access.\n3. You will automatically be routed to that Organization's\ + \ Admin Console.\n4. Go to Settings in the sub-tenant's primary navigation.\n\ + 5. You can obtain your Organization ID below your Organization's Contact Information\ + \ on the Settings page.\n\n## To Obtain All Organization IDs via the API\n\n*\ + \ You can make an API request to this endpoint using the API key of your Primary\ + \ Organization. `https://console.jumpcloud.com/api/organizations/` This will\ + \ return all your managed organizations.\n\n```bash\ncurl -X GET \\\n https://console.jumpcloud.com/api/organizations/\ + \ \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\ + \ \\\n -H 'x-api-key: {API_KEY}'\n```\n\n# SDKs\n\nYou can find language specific\ + \ SDKs that can help you kickstart your Integration with JumpCloud in the following\ + \ GitHub repositories:\n\n* [Python](https://github.com/TheJumpCloud/jcapi-python)\n\ + * [Go](https://github.com/TheJumpCloud/jcapi-go)\n* [Ruby](https://github.com/TheJumpCloud/jcapi-ruby)\n\ + * [Java](https://github.com/TheJumpCloud/jcapi-java)\n" + contact: + name: JumpCloud Support + url: https://support.jumpcloud.com/support/s/ + email: support@jumpcloud.com + version: "1.0" +servers: +- url: https://console.jumpcloud.com/api +tags: +- name: Active Directory +- name: Application Templates +- name: Applications +- name: Billing +- name: Command Results +- name: Command Triggers +- name: Commands +- name: Managed Service Provider +- name: Notifications +- name: Organizations +- name: Radius Servers +- name: Search +- name: Support +- name: Systems +- name: Systemusers +- name: User Portal +- name: Users +paths: + /application-templates: + get: + tags: + - Application Templates + summary: List Application Templates + description: "The endpoint returns all the SSO / SAML Application Templates.\n\ + \n#### Sample Request\n```\ncurl -X GET https://console.jumpcloud.com/api/application-templates\ + \ \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\ + \ \\\n -H 'x-api-key: {API_KEY}'\n\n```" + operationId: application_templates_list + parameters: + - name: fields + in: query + description: The space separated fields included in the returned records. + If omitted the default list of fields will be returned. + required: false + style: form + explode: true + schema: + type: string + - name: limit + in: query + description: The number of records to return at once. + required: false + style: form + explode: true + schema: + type: integer + - name: skip + in: query + description: The offset into the records to return. + required: false + style: form + explode: true + schema: + type: integer + - name: sort + in: query + description: "The space separated fields used to sort the collection. Default\ + \ sort is ascending, prefix with - to sort descending." + required: false + style: form + explode: true + schema: + type: string + - name: filter + in: query + description: "A filter to apply to the query. See the supported operators\ + \ below. For more complex searches,\nsee the related `/search/`\ + \ endpoints,\ne.g. `/search/systems`.\n\n**Filter structure**: `::`.\n\ + \n**field** = Populate with a valid field from an endpoint response.\n\n\ + **operator** = Supported operators are:\n- `$eq` (equals)\n- `$ne` (does\ + \ not equal)\n- `$gt` (is greater than)\n- `$gte` (is greater than or equal\ + \ to)\n- `$lt` (is less than)\n- `$lte` (is less than or equal to)\n\n_Note:\ + \ v1 operators differ from v2 operators._\n\n_Note: For v1 operators, excluding\ + \ the `$` will result in undefined behavior._\n\n**value** = Populate with\ + \ the value you want to search for. Is case sensitive.\n\n**Examples**\n\ + - `GET /users?filter=username:$eq:testuser`\n- `GET /systemusers?filter=password_expiration_date:$lte:2021-10-24`\n\ + - `GET /systemusers?filter=department:$ne:Accounting`\n- `GET /systems?filter[0]=firstname:$eq:foo&filter[1]=lastname:$eq:bar`\ + \ - this will\n AND the filters together.\n- `GET /systems?filter[or][0]=lastname:$eq:foo&filter[or][1]=lastname:$eq:bar`\ + \ - this will\n OR the filters together." + required: false + style: form + explode: true + schema: + type: string + - name: x-org-id + in: header + required: false + style: simple + explode: false + schema: + type: string + responses: + "200": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/applicationtemplateslist' + security: + - x-api-key: [] + x-scopes: + - applicationtemplates + - applicationtemplates.readonly + x-codeSamples: + - lang: Shell + source: "curl --request GET \\\n --url 'https://console.jumpcloud.com/api/application-templates?fields=SOME_STRING_VALUE&limit=SOME_INTEGER_VALUE&skip=SOME_INTEGER_VALUE&sort=SOME_STRING_VALUE&filter=SOME_STRING_VALUE'\ + \ \\\n --header 'x-api-key: REPLACE_KEY_VALUE' \\\n --header 'x-org-id:\ + \ '" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/application-templates\"\ + \n\nquerystring = {\"fields\":\"SOME_STRING_VALUE\",\"limit\":\"SOME_INTEGER_VALUE\"\ + ,\"skip\":\"SOME_INTEGER_VALUE\",\"sort\":\"SOME_STRING_VALUE\",\"filter\"\ + :\"SOME_STRING_VALUE\"}\n\nheaders = {\n \"x-org-id\": \"\",\n \"\ + x-api-key\": \"REPLACE_KEY_VALUE\"\n}\n\nresponse = requests.request(\"\ + GET\", url, headers=headers, params=querystring)\n\nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-org-id\", \"\")\n$headers.Add(\"x-api-key\"\ + , \"REPLACE_KEY_VALUE\")\n$response = Invoke-RestMethod -Uri 'https://console.jumpcloud.com/api/application-templates?fields=SOME_STRING_VALUE&limit=SOME_INTEGER_VALUE&skip=SOME_INTEGER_VALUE&sort=SOME_STRING_VALUE&filter=SOME_STRING_VALUE'\ + \ -Method GET -Headers $headers" + /application-templates/{id}: + get: + tags: + - Application Templates + summary: Get an Application Template + description: "The endpoint returns a specific SSO / SAML Application Template.\n\ + \n#### Sample Request\n```\ncurl -X GET https://console.jumpcloud.com/api/application-templates/{id}\ + \ \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\ + \ \\\n -H 'x-api-key: {API_KEY}'\n\n```" + operationId: application_templates_get + parameters: + - name: id + in: path + required: true + style: simple + explode: false + schema: + type: string + - name: fields + in: query + description: The space separated fields included in the returned records. + If omitted the default list of fields will be returned. + required: false + style: form + explode: true + schema: + type: string + - name: limit + in: query + description: The number of records to return at once. + required: false + style: form + explode: true + schema: + type: integer + - name: skip + in: query + description: The offset into the records to return. + required: false + style: form + explode: true + schema: + type: integer + - name: sort + in: query + description: "The space separated fields used to sort the collection. Default\ + \ sort is ascending, prefix with - to sort descending." + required: false + style: form + explode: true + schema: + type: string + - name: filter + in: query + description: "A filter to apply to the query. See the supported operators\ + \ below. For more complex searches,\nsee the related `/search/`\ + \ endpoints,\ne.g. `/search/systems`.\n\n**Filter structure**: `::`.\n\ + \n**field** = Populate with a valid field from an endpoint response.\n\n\ + **operator** = Supported operators are:\n- `$eq` (equals)\n- `$ne` (does\ + \ not equal)\n- `$gt` (is greater than)\n- `$gte` (is greater than or equal\ + \ to)\n- `$lt` (is less than)\n- `$lte` (is less than or equal to)\n\n_Note:\ + \ v1 operators differ from v2 operators._\n\n_Note: For v1 operators, excluding\ + \ the `$` will result in undefined behavior._\n\n**value** = Populate with\ + \ the value you want to search for. Is case sensitive.\n\n**Examples**\n\ + - `GET /users?filter=username:$eq:testuser`\n- `GET /systemusers?filter=password_expiration_date:$lte:2021-10-24`\n\ + - `GET /systemusers?filter=department:$ne:Accounting`\n- `GET /systems?filter[0]=firstname:$eq:foo&filter[1]=lastname:$eq:bar`\ + \ - this will\n AND the filters together.\n- `GET /systems?filter[or][0]=lastname:$eq:foo&filter[or][1]=lastname:$eq:bar`\ + \ - this will\n OR the filters together." + required: false + style: form + explode: true + schema: + type: string + - name: x-org-id + in: header + required: false + style: simple + explode: false + schema: + type: string + responses: + "200": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/applicationtemplate' + security: + - x-api-key: [] + x-scopes: + - applicationtemplates + - applicationtemplates.readonly + x-codeSamples: + - lang: Shell + source: "curl --request GET \\\n --url 'https://console.jumpcloud.com/api/application-templates/{id}?fields=SOME_STRING_VALUE&limit=SOME_INTEGER_VALUE&skip=SOME_INTEGER_VALUE&sort=SOME_STRING_VALUE&filter=SOME_STRING_VALUE'\ + \ \\\n --header 'x-api-key: REPLACE_KEY_VALUE' \\\n --header 'x-org-id:\ + \ '" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/application-templates/{id}\"\ + \n\nquerystring = {\"fields\":\"SOME_STRING_VALUE\",\"limit\":\"SOME_INTEGER_VALUE\"\ + ,\"skip\":\"SOME_INTEGER_VALUE\",\"sort\":\"SOME_STRING_VALUE\",\"filter\"\ + :\"SOME_STRING_VALUE\"}\n\nheaders = {\n \"x-org-id\": \"\",\n \"\ + x-api-key\": \"REPLACE_KEY_VALUE\"\n}\n\nresponse = requests.request(\"\ + GET\", url, headers=headers, params=querystring)\n\nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-org-id\", \"\")\n$headers.Add(\"x-api-key\"\ + , \"REPLACE_KEY_VALUE\")\n$response = Invoke-RestMethod -Uri 'https://console.jumpcloud.com/api/application-templates/{id}?fields=SOME_STRING_VALUE&limit=SOME_INTEGER_VALUE&skip=SOME_INTEGER_VALUE&sort=SOME_STRING_VALUE&filter=SOME_STRING_VALUE'\ + \ -Method GET -Headers $headers" + /applications: + get: + tags: + - Applications + summary: Applications + description: "The endpoint returns all your SSO / SAML Applications.\n\n####\ + \ Sample Request\n```\ncurl -X GET https://console.jumpcloud.com/api/applications\ + \ \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\ + \ \\\n -H 'x-api-key: {API_KEY}'\n\n```" + operationId: applications_list + parameters: + - name: fields + in: query + description: The space separated fields included in the returned records. + If omitted the default list of fields will be returned. + required: false + style: form + explode: true + schema: + type: string + - name: limit + in: query + description: The number of records to return at once. + required: false + style: form + explode: true + schema: + type: integer + - name: skip + in: query + description: The offset into the records to return. + required: false + style: form + explode: true + schema: + type: integer + - name: sort + in: query + description: "The space separated fields used to sort the collection. Default\ + \ sort is ascending, prefix with - to sort descending." + required: false + style: form + explode: true + schema: + type: string + default: name + - name: filter + in: query + description: "A filter to apply to the query. See the supported operators\ + \ below. For more complex searches,\nsee the related `/search/`\ + \ endpoints,\ne.g. `/search/systems`.\n\n**Filter structure**: `::`.\n\ + \n**field** = Populate with a valid field from an endpoint response.\n\n\ + **operator** = Supported operators are:\n- `$eq` (equals)\n- `$ne` (does\ + \ not equal)\n- `$gt` (is greater than)\n- `$gte` (is greater than or equal\ + \ to)\n- `$lt` (is less than)\n- `$lte` (is less than or equal to)\n\n_Note:\ + \ v1 operators differ from v2 operators._\n\n_Note: For v1 operators, excluding\ + \ the `$` will result in undefined behavior._\n\n**value** = Populate with\ + \ the value you want to search for. Is case sensitive.\n\n**Examples**\n\ + - `GET /users?filter=username:$eq:testuser`\n- `GET /systemusers?filter=password_expiration_date:$lte:2021-10-24`\n\ + - `GET /systemusers?filter=department:$ne:Accounting`\n- `GET /systems?filter[0]=firstname:$eq:foo&filter[1]=lastname:$eq:bar`\ + \ - this will\n AND the filters together.\n- `GET /systems?filter[or][0]=lastname:$eq:foo&filter[or][1]=lastname:$eq:bar`\ + \ - this will\n OR the filters together." + required: false + style: form + explode: true + schema: + type: string + - name: x-org-id + in: header + required: false + style: simple + explode: false + schema: + type: string + responses: + "200": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/applicationslist' + security: + - x-api-key: [] + x-scopes: + - applications + - applications.readonly + x-codeSamples: + - lang: Shell + source: "curl --request GET \\\n --url 'https://console.jumpcloud.com/api/applications?fields=SOME_STRING_VALUE&limit=SOME_INTEGER_VALUE&skip=SOME_INTEGER_VALUE&sort=name&filter=SOME_STRING_VALUE'\ + \ \\\n --header 'x-api-key: REPLACE_KEY_VALUE' \\\n --header 'x-org-id:\ + \ '" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/applications\"\ + \n\nquerystring = {\"fields\":\"SOME_STRING_VALUE\",\"limit\":\"SOME_INTEGER_VALUE\"\ + ,\"skip\":\"SOME_INTEGER_VALUE\",\"sort\":\"name\",\"filter\":\"SOME_STRING_VALUE\"\ + }\n\nheaders = {\n \"x-org-id\": \"\",\n \"x-api-key\": \"REPLACE_KEY_VALUE\"\ + \n}\n\nresponse = requests.request(\"GET\", url, headers=headers, params=querystring)\n\ + \nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-org-id\", \"\")\n$headers.Add(\"x-api-key\"\ + , \"REPLACE_KEY_VALUE\")\n$response = Invoke-RestMethod -Uri 'https://console.jumpcloud.com/api/applications?fields=SOME_STRING_VALUE&limit=SOME_INTEGER_VALUE&skip=SOME_INTEGER_VALUE&sort=name&filter=SOME_STRING_VALUE'\ + \ -Method GET -Headers $headers" + post: + tags: + - Applications + summary: Create an Application + description: The endpoint adds a new SSO / SAML Applications. + operationId: applications_post + parameters: + - name: x-org-id + in: header + required: false + style: simple + explode: false + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/application' + required: false + responses: + "200": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/application' + "400": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + security: + - x-api-key: [] + x-scopes: + - applications + x-codeSamples: + - lang: Shell + source: "curl --request POST \\\n --url https://console.jumpcloud.com/api/applications\ + \ \\\n --header 'content-type: application/json' \\\n --header 'x-api-key:\ + \ REPLACE_KEY_VALUE' \\\n --header 'x-org-id: ' \\\n --data '{\"_id\"\ + :\"string\",\"active\":true,\"beta\":true,\"color\":\"\",\"config\":{\"\ + acsUrl\":{\"label\":\"string\",\"options\":\"string\",\"position\":0,\"\ + readOnly\":true,\"required\":true,\"toggle\":\"string\",\"tooltip\":{\"\ + template\":\"string\",\"variables\":{\"icon\":\"string\",\"message\":\"\ + string\"}},\"type\":\"string\",\"value\":\"string\",\"visible\":true},\"\ + constantAttributes\":{\"label\":\"string\",\"mutable\":true,\"options\"\ + :null,\"position\":0,\"readOnly\":true,\"required\":true,\"toggle\":null,\"\ + tooltip\":{\"template\":\"string\",\"variables\":{\"icon\":\"string\",\"\ + message\":\"string\"}},\"type\":\"string\",\"value\":[{\"name\":\"string\"\ + ,\"readOnly\":true,\"required\":true,\"value\":\"string\",\"visible\":true}],\"\ + visible\":true},\"databaseAttributes\":{\"position\":0},\"idpCertificate\"\ + :{\"label\":\"string\",\"options\":\"string\",\"position\":0,\"readOnly\"\ + :true,\"required\":true,\"toggle\":\"string\",\"tooltip\":{\"template\"\ + :\"string\",\"variables\":{\"icon\":\"string\",\"message\":\"string\"}},\"\ + type\":\"string\",\"value\":\"string\",\"visible\":true},\"idpEntityId\"\ + :{\"label\":\"string\",\"options\":\"string\",\"position\":0,\"readOnly\"\ + :true,\"required\":true,\"toggle\":\"string\",\"tooltip\":{\"template\"\ + :\"string\",\"variables\":{\"icon\":\"string\",\"message\":\"string\"}},\"\ + type\":\"string\",\"value\":\"string\",\"visible\":true},\"idpPrivateKey\"\ + :{\"label\":\"string\",\"options\":\"string\",\"position\":0,\"readOnly\"\ + :true,\"required\":true,\"toggle\":\"string\",\"tooltip\":{\"template\"\ + :\"string\",\"variables\":{\"icon\":\"string\",\"message\":\"string\"}},\"\ + type\":\"string\",\"value\":\"string\",\"visible\":true},\"spEntityId\"\ + :{\"label\":\"string\",\"options\":\"string\",\"position\":0,\"readOnly\"\ + :true,\"required\":true,\"toggle\":\"string\",\"tooltip\":{\"template\"\ + :\"string\",\"variables\":{\"icon\":\"string\",\"message\":\"string\"}},\"\ + type\":\"string\",\"value\":\"string\",\"visible\":true}},\"created\":\"\ + string\",\"databaseAttributes\":[{}],\"description\":\"string\",\"displayLabel\"\ + :\"string\",\"displayName\":\"string\",\"learnMore\":\"string\",\"logo\"\ + :{\"color\":\"\",\"url\":\"string\"},\"name\":\"string\",\"organization\"\ + :\"string\",\"sso\":{\"beta\":true,\"idpCertExpirationAt\":\"2019-08-24T14:15:22Z\"\ + ,\"jit\":true,\"type\":\"string\"},\"ssoUrl\":\"string\"}'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/applications\"\ + \n\npayload = {\n \"_id\": \"string\",\n \"active\": True,\n \"\ + beta\": True,\n \"color\": \"\",\n \"config\": {\n \"acsUrl\"\ + : {\n \"label\": \"string\",\n \"options\": \"string\"\ + ,\n \"position\": 0,\n \"readOnly\": True,\n \ + \ \"required\": True,\n \"toggle\": \"string\",\n \ + \ \"tooltip\": {\n \"template\": \"string\",\n \ + \ \"variables\": {\n \"icon\": \"string\"\ + ,\n \"message\": \"string\"\n }\n \ + \ },\n \"type\": \"string\",\n \"value\": \"\ + string\",\n \"visible\": True\n },\n \"constantAttributes\"\ + : {\n \"label\": \"string\",\n \"mutable\": True,\n\ + \ \"options\": None,\n \"position\": 0,\n \ + \ \"readOnly\": True,\n \"required\": True,\n \"\ + toggle\": None,\n \"tooltip\": {\n \"template\"\ + : \"string\",\n \"variables\": {\n \"\ + icon\": \"string\",\n \"message\": \"string\"\n \ + \ }\n },\n \"type\": \"string\",\n \ + \ \"value\": [\n {\n \"name\": \"\ + string\",\n \"readOnly\": True,\n \ + \ \"required\": True,\n \"value\": \"string\",\n \ + \ \"visible\": True\n }\n ],\n\ + \ \"visible\": True\n },\n \"databaseAttributes\"\ + : {\"position\": 0},\n \"idpCertificate\": {\n \"label\"\ + : \"string\",\n \"options\": \"string\",\n \"position\"\ + : 0,\n \"readOnly\": True,\n \"required\": True,\n\ + \ \"toggle\": \"string\",\n \"tooltip\": {\n \ + \ \"template\": \"string\",\n \"variables\": {\n\ + \ \"icon\": \"string\",\n \"message\"\ + : \"string\"\n }\n },\n \"type\": \"\ + string\",\n \"value\": \"string\",\n \"visible\":\ + \ True\n },\n \"idpEntityId\": {\n \"label\": \"\ + string\",\n \"options\": \"string\",\n \"position\"\ + : 0,\n \"readOnly\": True,\n \"required\": True,\n\ + \ \"toggle\": \"string\",\n \"tooltip\": {\n \ + \ \"template\": \"string\",\n \"variables\": {\n\ + \ \"icon\": \"string\",\n \"message\"\ + : \"string\"\n }\n },\n \"type\": \"\ + string\",\n \"value\": \"string\",\n \"visible\":\ + \ True\n },\n \"idpPrivateKey\": {\n \"label\"\ + : \"string\",\n \"options\": \"string\",\n \"position\"\ + : 0,\n \"readOnly\": True,\n \"required\": True,\n\ + \ \"toggle\": \"string\",\n \"tooltip\": {\n \ + \ \"template\": \"string\",\n \"variables\": {\n\ + \ \"icon\": \"string\",\n \"message\"\ + : \"string\"\n }\n },\n \"type\": \"\ + string\",\n \"value\": \"string\",\n \"visible\":\ + \ True\n },\n \"spEntityId\": {\n \"label\": \"\ + string\",\n \"options\": \"string\",\n \"position\"\ + : 0,\n \"readOnly\": True,\n \"required\": True,\n\ + \ \"toggle\": \"string\",\n \"tooltip\": {\n \ + \ \"template\": \"string\",\n \"variables\": {\n\ + \ \"icon\": \"string\",\n \"message\"\ + : \"string\"\n }\n },\n \"type\": \"\ + string\",\n \"value\": \"string\",\n \"visible\":\ + \ True\n }\n },\n \"created\": \"string\",\n \"databaseAttributes\"\ + : [{}],\n \"description\": \"string\",\n \"displayLabel\": \"string\"\ + ,\n \"displayName\": \"string\",\n \"learnMore\": \"string\",\n \ + \ \"logo\": {\n \"color\": \"\",\n \"url\": \"string\"\n\ + \ },\n \"name\": \"string\",\n \"organization\": \"string\",\n\ + \ \"sso\": {\n \"beta\": True,\n \"idpCertExpirationAt\"\ + : \"2019-08-24T14:15:22Z\",\n \"jit\": True,\n \"type\": \"\ + string\"\n },\n \"ssoUrl\": \"string\"\n}\nheaders = {\n \"x-org-id\"\ + : \"\",\n \"x-api-key\": \"REPLACE_KEY_VALUE\",\n \"content-type\"\ + : \"application/json\"\n}\n\nresponse = requests.request(\"POST\", url,\ + \ json=payload, headers=headers)\n\nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-org-id\", \"\")\n$headers.Add(\"x-api-key\"\ + , \"REPLACE_KEY_VALUE\")\n$headers.Add(\"content-type\", \"application/json\"\ + )\n$response = Invoke-RestMethod -Uri 'https://console.jumpcloud.com/api/applications'\ + \ -Method POST -Headers $headers -ContentType 'application/json' -Body '{\"\ + _id\":\"string\",\"active\":true,\"beta\":true,\"color\":\"\",\"config\"\ + :{\"acsUrl\":{\"label\":\"string\",\"options\":\"string\",\"position\":0,\"\ + readOnly\":true,\"required\":true,\"toggle\":\"string\",\"tooltip\":{\"\ + template\":\"string\",\"variables\":{\"icon\":\"string\",\"message\":\"\ + string\"}},\"type\":\"string\",\"value\":\"string\",\"visible\":true},\"\ + constantAttributes\":{\"label\":\"string\",\"mutable\":true,\"options\"\ + :null,\"position\":0,\"readOnly\":true,\"required\":true,\"toggle\":null,\"\ + tooltip\":{\"template\":\"string\",\"variables\":{\"icon\":\"string\",\"\ + message\":\"string\"}},\"type\":\"string\",\"value\":[{\"name\":\"string\"\ + ,\"readOnly\":true,\"required\":true,\"value\":\"string\",\"visible\":true}],\"\ + visible\":true},\"databaseAttributes\":{\"position\":0},\"idpCertificate\"\ + :{\"label\":\"string\",\"options\":\"string\",\"position\":0,\"readOnly\"\ + :true,\"required\":true,\"toggle\":\"string\",\"tooltip\":{\"template\"\ + :\"string\",\"variables\":{\"icon\":\"string\",\"message\":\"string\"}},\"\ + type\":\"string\",\"value\":\"string\",\"visible\":true},\"idpEntityId\"\ + :{\"label\":\"string\",\"options\":\"string\",\"position\":0,\"readOnly\"\ + :true,\"required\":true,\"toggle\":\"string\",\"tooltip\":{\"template\"\ + :\"string\",\"variables\":{\"icon\":\"string\",\"message\":\"string\"}},\"\ + type\":\"string\",\"value\":\"string\",\"visible\":true},\"idpPrivateKey\"\ + :{\"label\":\"string\",\"options\":\"string\",\"position\":0,\"readOnly\"\ + :true,\"required\":true,\"toggle\":\"string\",\"tooltip\":{\"template\"\ + :\"string\",\"variables\":{\"icon\":\"string\",\"message\":\"string\"}},\"\ + type\":\"string\",\"value\":\"string\",\"visible\":true},\"spEntityId\"\ + :{\"label\":\"string\",\"options\":\"string\",\"position\":0,\"readOnly\"\ + :true,\"required\":true,\"toggle\":\"string\",\"tooltip\":{\"template\"\ + :\"string\",\"variables\":{\"icon\":\"string\",\"message\":\"string\"}},\"\ + type\":\"string\",\"value\":\"string\",\"visible\":true}},\"created\":\"\ + string\",\"databaseAttributes\":[{}],\"description\":\"string\",\"displayLabel\"\ + :\"string\",\"displayName\":\"string\",\"learnMore\":\"string\",\"logo\"\ + :{\"color\":\"\",\"url\":\"string\"},\"name\":\"string\",\"organization\"\ + :\"string\",\"sso\":{\"beta\":true,\"idpCertExpirationAt\":\"2019-08-24T14:15:22Z\"\ + ,\"jit\":true,\"type\":\"string\"},\"ssoUrl\":\"string\"}'" + x-codegen-request-body-name: body + /applications/{id}: + get: + tags: + - Applications + summary: Get an Application + description: The endpoint retrieves an SSO / SAML Application. + operationId: applications_get + parameters: + - name: id + in: path + required: true + style: simple + explode: false + schema: + type: string + - name: x-org-id + in: header + required: false + style: simple + explode: false + schema: + type: string + responses: + "200": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/application' + security: + - x-api-key: [] + x-scopes: + - applications + - applications.readonly + x-codeSamples: + - lang: Shell + source: "curl --request GET \\\n --url https://console.jumpcloud.com/api/applications/{id}\ + \ \\\n --header 'x-api-key: REPLACE_KEY_VALUE' \\\n --header 'x-org-id:\ + \ '" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/applications/{id}\"\ + \n\nheaders = {\n \"x-org-id\": \"\",\n \"x-api-key\": \"REPLACE_KEY_VALUE\"\ + \n}\n\nresponse = requests.request(\"GET\", url, headers=headers)\n\nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-org-id\", \"\")\n$headers.Add(\"x-api-key\"\ + , \"REPLACE_KEY_VALUE\")\n$response = Invoke-RestMethod -Uri 'https://console.jumpcloud.com/api/applications/{id}'\ + \ -Method GET -Headers $headers" + put: + tags: + - Applications + summary: Update an Application + description: The endpoint updates a SSO / SAML Application. Any fields not provided + will be reset or created with default values. + operationId: applications_put + parameters: + - name: id + in: path + required: true + style: simple + explode: false + schema: + type: string + - name: x-org-id + in: header + required: false + style: simple + explode: false + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/application' + required: false + responses: + "200": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/application' + "400": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + security: + - x-api-key: [] + x-scopes: + - applications + x-codeSamples: + - lang: Shell + source: "curl --request PUT \\\n --url https://console.jumpcloud.com/api/applications/{id}\ + \ \\\n --header 'content-type: application/json' \\\n --header 'x-api-key:\ + \ REPLACE_KEY_VALUE' \\\n --header 'x-org-id: ' \\\n --data '{\"_id\"\ + :\"string\",\"active\":true,\"beta\":true,\"color\":\"\",\"config\":{\"\ + acsUrl\":{\"label\":\"string\",\"options\":\"string\",\"position\":0,\"\ + readOnly\":true,\"required\":true,\"toggle\":\"string\",\"tooltip\":{\"\ + template\":\"string\",\"variables\":{\"icon\":\"string\",\"message\":\"\ + string\"}},\"type\":\"string\",\"value\":\"string\",\"visible\":true},\"\ + constantAttributes\":{\"label\":\"string\",\"mutable\":true,\"options\"\ + :null,\"position\":0,\"readOnly\":true,\"required\":true,\"toggle\":null,\"\ + tooltip\":{\"template\":\"string\",\"variables\":{\"icon\":\"string\",\"\ + message\":\"string\"}},\"type\":\"string\",\"value\":[{\"name\":\"string\"\ + ,\"readOnly\":true,\"required\":true,\"value\":\"string\",\"visible\":true}],\"\ + visible\":true},\"databaseAttributes\":{\"position\":0},\"idpCertificate\"\ + :{\"label\":\"string\",\"options\":\"string\",\"position\":0,\"readOnly\"\ + :true,\"required\":true,\"toggle\":\"string\",\"tooltip\":{\"template\"\ + :\"string\",\"variables\":{\"icon\":\"string\",\"message\":\"string\"}},\"\ + type\":\"string\",\"value\":\"string\",\"visible\":true},\"idpEntityId\"\ + :{\"label\":\"string\",\"options\":\"string\",\"position\":0,\"readOnly\"\ + :true,\"required\":true,\"toggle\":\"string\",\"tooltip\":{\"template\"\ + :\"string\",\"variables\":{\"icon\":\"string\",\"message\":\"string\"}},\"\ + type\":\"string\",\"value\":\"string\",\"visible\":true},\"idpPrivateKey\"\ + :{\"label\":\"string\",\"options\":\"string\",\"position\":0,\"readOnly\"\ + :true,\"required\":true,\"toggle\":\"string\",\"tooltip\":{\"template\"\ + :\"string\",\"variables\":{\"icon\":\"string\",\"message\":\"string\"}},\"\ + type\":\"string\",\"value\":\"string\",\"visible\":true},\"spEntityId\"\ + :{\"label\":\"string\",\"options\":\"string\",\"position\":0,\"readOnly\"\ + :true,\"required\":true,\"toggle\":\"string\",\"tooltip\":{\"template\"\ + :\"string\",\"variables\":{\"icon\":\"string\",\"message\":\"string\"}},\"\ + type\":\"string\",\"value\":\"string\",\"visible\":true}},\"created\":\"\ + string\",\"databaseAttributes\":[{}],\"description\":\"string\",\"displayLabel\"\ + :\"string\",\"displayName\":\"string\",\"learnMore\":\"string\",\"logo\"\ + :{\"color\":\"\",\"url\":\"string\"},\"name\":\"string\",\"organization\"\ + :\"string\",\"sso\":{\"beta\":true,\"idpCertExpirationAt\":\"2019-08-24T14:15:22Z\"\ + ,\"jit\":true,\"type\":\"string\"},\"ssoUrl\":\"string\"}'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/applications/{id}\"\ + \n\npayload = {\n \"_id\": \"string\",\n \"active\": True,\n \"\ + beta\": True,\n \"color\": \"\",\n \"config\": {\n \"acsUrl\"\ + : {\n \"label\": \"string\",\n \"options\": \"string\"\ + ,\n \"position\": 0,\n \"readOnly\": True,\n \ + \ \"required\": True,\n \"toggle\": \"string\",\n \ + \ \"tooltip\": {\n \"template\": \"string\",\n \ + \ \"variables\": {\n \"icon\": \"string\"\ + ,\n \"message\": \"string\"\n }\n \ + \ },\n \"type\": \"string\",\n \"value\": \"\ + string\",\n \"visible\": True\n },\n \"constantAttributes\"\ + : {\n \"label\": \"string\",\n \"mutable\": True,\n\ + \ \"options\": None,\n \"position\": 0,\n \ + \ \"readOnly\": True,\n \"required\": True,\n \"\ + toggle\": None,\n \"tooltip\": {\n \"template\"\ + : \"string\",\n \"variables\": {\n \"\ + icon\": \"string\",\n \"message\": \"string\"\n \ + \ }\n },\n \"type\": \"string\",\n \ + \ \"value\": [\n {\n \"name\": \"\ + string\",\n \"readOnly\": True,\n \ + \ \"required\": True,\n \"value\": \"string\",\n \ + \ \"visible\": True\n }\n ],\n\ + \ \"visible\": True\n },\n \"databaseAttributes\"\ + : {\"position\": 0},\n \"idpCertificate\": {\n \"label\"\ + : \"string\",\n \"options\": \"string\",\n \"position\"\ + : 0,\n \"readOnly\": True,\n \"required\": True,\n\ + \ \"toggle\": \"string\",\n \"tooltip\": {\n \ + \ \"template\": \"string\",\n \"variables\": {\n\ + \ \"icon\": \"string\",\n \"message\"\ + : \"string\"\n }\n },\n \"type\": \"\ + string\",\n \"value\": \"string\",\n \"visible\":\ + \ True\n },\n \"idpEntityId\": {\n \"label\": \"\ + string\",\n \"options\": \"string\",\n \"position\"\ + : 0,\n \"readOnly\": True,\n \"required\": True,\n\ + \ \"toggle\": \"string\",\n \"tooltip\": {\n \ + \ \"template\": \"string\",\n \"variables\": {\n\ + \ \"icon\": \"string\",\n \"message\"\ + : \"string\"\n }\n },\n \"type\": \"\ + string\",\n \"value\": \"string\",\n \"visible\":\ + \ True\n },\n \"idpPrivateKey\": {\n \"label\"\ + : \"string\",\n \"options\": \"string\",\n \"position\"\ + : 0,\n \"readOnly\": True,\n \"required\": True,\n\ + \ \"toggle\": \"string\",\n \"tooltip\": {\n \ + \ \"template\": \"string\",\n \"variables\": {\n\ + \ \"icon\": \"string\",\n \"message\"\ + : \"string\"\n }\n },\n \"type\": \"\ + string\",\n \"value\": \"string\",\n \"visible\":\ + \ True\n },\n \"spEntityId\": {\n \"label\": \"\ + string\",\n \"options\": \"string\",\n \"position\"\ + : 0,\n \"readOnly\": True,\n \"required\": True,\n\ + \ \"toggle\": \"string\",\n \"tooltip\": {\n \ + \ \"template\": \"string\",\n \"variables\": {\n\ + \ \"icon\": \"string\",\n \"message\"\ + : \"string\"\n }\n },\n \"type\": \"\ + string\",\n \"value\": \"string\",\n \"visible\":\ + \ True\n }\n },\n \"created\": \"string\",\n \"databaseAttributes\"\ + : [{}],\n \"description\": \"string\",\n \"displayLabel\": \"string\"\ + ,\n \"displayName\": \"string\",\n \"learnMore\": \"string\",\n \ + \ \"logo\": {\n \"color\": \"\",\n \"url\": \"string\"\n\ + \ },\n \"name\": \"string\",\n \"organization\": \"string\",\n\ + \ \"sso\": {\n \"beta\": True,\n \"idpCertExpirationAt\"\ + : \"2019-08-24T14:15:22Z\",\n \"jit\": True,\n \"type\": \"\ + string\"\n },\n \"ssoUrl\": \"string\"\n}\nheaders = {\n \"x-org-id\"\ + : \"\",\n \"x-api-key\": \"REPLACE_KEY_VALUE\",\n \"content-type\"\ + : \"application/json\"\n}\n\nresponse = requests.request(\"PUT\", url, json=payload,\ + \ headers=headers)\n\nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-org-id\", \"\")\n$headers.Add(\"x-api-key\"\ + , \"REPLACE_KEY_VALUE\")\n$headers.Add(\"content-type\", \"application/json\"\ + )\n$response = Invoke-RestMethod -Uri 'https://console.jumpcloud.com/api/applications/{id}'\ + \ -Method PUT -Headers $headers -ContentType 'application/json' -Body '{\"\ + _id\":\"string\",\"active\":true,\"beta\":true,\"color\":\"\",\"config\"\ + :{\"acsUrl\":{\"label\":\"string\",\"options\":\"string\",\"position\":0,\"\ + readOnly\":true,\"required\":true,\"toggle\":\"string\",\"tooltip\":{\"\ + template\":\"string\",\"variables\":{\"icon\":\"string\",\"message\":\"\ + string\"}},\"type\":\"string\",\"value\":\"string\",\"visible\":true},\"\ + constantAttributes\":{\"label\":\"string\",\"mutable\":true,\"options\"\ + :null,\"position\":0,\"readOnly\":true,\"required\":true,\"toggle\":null,\"\ + tooltip\":{\"template\":\"string\",\"variables\":{\"icon\":\"string\",\"\ + message\":\"string\"}},\"type\":\"string\",\"value\":[{\"name\":\"string\"\ + ,\"readOnly\":true,\"required\":true,\"value\":\"string\",\"visible\":true}],\"\ + visible\":true},\"databaseAttributes\":{\"position\":0},\"idpCertificate\"\ + :{\"label\":\"string\",\"options\":\"string\",\"position\":0,\"readOnly\"\ + :true,\"required\":true,\"toggle\":\"string\",\"tooltip\":{\"template\"\ + :\"string\",\"variables\":{\"icon\":\"string\",\"message\":\"string\"}},\"\ + type\":\"string\",\"value\":\"string\",\"visible\":true},\"idpEntityId\"\ + :{\"label\":\"string\",\"options\":\"string\",\"position\":0,\"readOnly\"\ + :true,\"required\":true,\"toggle\":\"string\",\"tooltip\":{\"template\"\ + :\"string\",\"variables\":{\"icon\":\"string\",\"message\":\"string\"}},\"\ + type\":\"string\",\"value\":\"string\",\"visible\":true},\"idpPrivateKey\"\ + :{\"label\":\"string\",\"options\":\"string\",\"position\":0,\"readOnly\"\ + :true,\"required\":true,\"toggle\":\"string\",\"tooltip\":{\"template\"\ + :\"string\",\"variables\":{\"icon\":\"string\",\"message\":\"string\"}},\"\ + type\":\"string\",\"value\":\"string\",\"visible\":true},\"spEntityId\"\ + :{\"label\":\"string\",\"options\":\"string\",\"position\":0,\"readOnly\"\ + :true,\"required\":true,\"toggle\":\"string\",\"tooltip\":{\"template\"\ + :\"string\",\"variables\":{\"icon\":\"string\",\"message\":\"string\"}},\"\ + type\":\"string\",\"value\":\"string\",\"visible\":true}},\"created\":\"\ + string\",\"databaseAttributes\":[{}],\"description\":\"string\",\"displayLabel\"\ + :\"string\",\"displayName\":\"string\",\"learnMore\":\"string\",\"logo\"\ + :{\"color\":\"\",\"url\":\"string\"},\"name\":\"string\",\"organization\"\ + :\"string\",\"sso\":{\"beta\":true,\"idpCertExpirationAt\":\"2019-08-24T14:15:22Z\"\ + ,\"jit\":true,\"type\":\"string\"},\"ssoUrl\":\"string\"}'" + x-codegen-request-body-name: body + delete: + tags: + - Applications + summary: Delete an Application + description: The endpoint deletes an SSO / SAML Application. + operationId: applications_delete + parameters: + - name: id + in: path + required: true + style: simple + explode: false + schema: + type: string + - name: x-org-id + in: header + required: false + style: simple + explode: false + schema: + type: string + responses: + "200": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/application' + security: + - x-api-key: [] + x-scopes: + - applications + x-codeSamples: + - lang: Shell + source: "curl --request DELETE \\\n --url https://console.jumpcloud.com/api/applications/{id}\ + \ \\\n --header 'x-api-key: REPLACE_KEY_VALUE' \\\n --header 'x-org-id:\ + \ '" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/applications/{id}\"\ + \n\nheaders = {\n \"x-org-id\": \"\",\n \"x-api-key\": \"REPLACE_KEY_VALUE\"\ + \n}\n\nresponse = requests.request(\"DELETE\", url, headers=headers)\n\n\ + print(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-org-id\", \"\")\n$headers.Add(\"x-api-key\"\ + , \"REPLACE_KEY_VALUE\")\n$response = Invoke-RestMethod -Uri 'https://console.jumpcloud.com/api/applications/{id}'\ + \ -Method DELETE -Headers $headers" + /command/trigger/{triggername}: + post: + tags: + - Command Triggers + summary: Launch a command via a Trigger + description: "This endpoint allows you to launch a command based on a defined\ + \ trigger.\n\n#### Sample Requests\n\n**Launch a Command via a Trigger**\n\ + \n```\ncurl --silent \\\n -X 'POST' \\\n -H \"x-api-key: {API_KEY}\"\ + \ \\\n \"https://console.jumpcloud.com/api/command/trigger/{TriggerName}\"\ + \n```\n**Launch a Command via a Trigger passing a JSON object to the command**\n\ + ```\ncurl --silent \\\n -X 'POST' \\\n -H \"x-api-key: {API_KEY}\"\ + \ \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\ + \ \\\n -d '{ \"srcip\":\"192.168.2.32\", \"attack\":\"Cross Site Scripting\ + \ Attempt\" }' \\\n \"https://console.jumpcloud.com/api/command/trigger/{TriggerName}\"\ + \n```" + operationId: command_trigger_webhook_post + parameters: + - name: triggername + in: path + required: true + style: simple + explode: false + schema: + type: string + - name: x-org-id + in: header + required: false + style: simple + explode: false + schema: + type: string + requestBody: + content: + application/json: + schema: + type: object + required: false + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/triggerreturn' + "401": + description: "" + content: {} + security: + - x-api-key: [] + x-scopes: + - commands + x-codeSamples: + - lang: Shell + source: "curl --request POST \\\n --url https://console.jumpcloud.com/api/command/trigger/{triggername}\ + \ \\\n --header 'content-type: application/json' \\\n --header 'x-api-key:\ + \ REPLACE_KEY_VALUE' \\\n --header 'x-org-id: ' \\\n --data '{}'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/command/trigger/{triggername}\"\ + \n\npayload = {}\nheaders = {\n \"x-org-id\": \"\",\n \"x-api-key\"\ + : \"REPLACE_KEY_VALUE\",\n \"content-type\": \"application/json\"\n}\n\ + \nresponse = requests.request(\"POST\", url, json=payload, headers=headers)\n\ + \nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-org-id\", \"\")\n$headers.Add(\"x-api-key\"\ + , \"REPLACE_KEY_VALUE\")\n$headers.Add(\"content-type\", \"application/json\"\ + )\n$response = Invoke-RestMethod -Uri 'https://console.jumpcloud.com/api/command/trigger/{triggername}'\ + \ -Method POST -Headers $headers -ContentType 'application/json' -Body '{}'" + x-codegen-request-body-name: body + /commandresults: + get: + tags: + - Command Results + summary: List all Command Results + description: "This endpoint returns all command results.\n\n#### Sample Request\n\ + ```\ncurl -X GET https://console.jumpcloud.com/api/commandresults \\\n -H\ + \ 'Accept: application/json' \\\n -H 'Content-Type: application/json' \\\n\ + \ -H 'x-api-key:{API_KEY}'\n ```" + operationId: command_results_list + parameters: + - name: fields + in: query + description: "Use a space seperated string of field parameters to include\ + \ the data in the response. If omitted, the default list of fields will\ + \ be returned.\n" + required: false + style: form + explode: true + schema: + type: string + - name: filter + in: query + description: "A filter to apply to the query. See the supported operators\ + \ below. For more complex searches,\nsee the related `/search/`\ + \ endpoints,\ne.g. `/search/systems`.\n\n**Filter structure**: `::`.\n\ + \n**field** = Populate with a valid field from an endpoint response.\n\n\ + **operator** = Supported operators are:\n- `$eq` (equals)\n- `$ne` (does\ + \ not equal)\n- `$gt` (is greater than)\n- `$gte` (is greater than or equal\ + \ to)\n- `$lt` (is less than)\n- `$lte` (is less than or equal to)\n\n_Note:\ + \ v1 operators differ from v2 operators._\n\n_Note: For v1 operators, excluding\ + \ the `$` will result in undefined behavior._\n\n**value** = Populate with\ + \ the value you want to search for. Is case sensitive.\n\n**Examples**\n\ + - `GET /users?filter=username:$eq:testuser`\n- `GET /systemusers?filter=password_expiration_date:$lte:2021-10-24`\n\ + - `GET /systemusers?filter=department:$ne:Accounting`\n- `GET /systems?filter[0]=firstname:$eq:foo&filter[1]=lastname:$eq:bar`\ + \ - this will\n AND the filters together.\n- `GET /systems?filter[or][0]=lastname:$eq:foo&filter[or][1]=lastname:$eq:bar`\ + \ - this will\n OR the filters together." + required: false + style: form + explode: true + schema: + type: string + - name: limit + in: query + description: The number of records to return at once. Limited to 100. + required: false + style: form + explode: true + schema: + type: integer + default: 10 + - name: x-org-id + in: header + required: false + style: simple + explode: false + schema: + type: string + - name: skip + in: query + description: The offset into the records to return. + required: false + style: form + explode: true + schema: + minimum: 0 + type: integer + default: 0 + - name: sort + in: query + description: | + Use space separated sort parameters to sort the collection. + Default sort is ascending. Prefix with `-` to sort descending. + required: false + style: form + explode: true + schema: + type: string + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/commandresultslist' + "401": + description: Unauthorized + content: {} + security: + - x-api-key: [] + x-scopes: + - commands + - commands.readonly + x-codeSamples: + - lang: Shell + source: "curl --request GET \\\n --url 'https://console.jumpcloud.com/api/commandresults?fields=&filter=SOME_STRING_VALUE&limit=10&skip=0&sort='\ + \ \\\n --header 'x-api-key: REPLACE_KEY_VALUE' \\\n --header 'x-org-id:\ + \ '" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/commandresults\"\ + \n\nquerystring = {\"fields\":\"\",\"filter\":\"SOME_STRING_VALUE\",\"limit\"\ + :\"10\",\"skip\":\"0\",\"sort\":\"\"}\n\nheaders = {\n \"x-org-id\":\ + \ \"\",\n \"x-api-key\": \"REPLACE_KEY_VALUE\"\n}\n\nresponse = requests.request(\"\ + GET\", url, headers=headers, params=querystring)\n\nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-org-id\", \"\")\n$headers.Add(\"x-api-key\"\ + , \"REPLACE_KEY_VALUE\")\n$response = Invoke-RestMethod -Uri 'https://console.jumpcloud.com/api/commandresults?fields=&filter=SOME_STRING_VALUE&limit=10&skip=0&sort='\ + \ -Method GET -Headers $headers" + /commandresults/{id}: + get: + tags: + - Command Results + summary: List an individual Command result + description: "This endpoint returns a specific command result.\n\n#### Sample\ + \ Request\n```\ncurl -X GET https://console.jumpcloud.com/api/commandresults/{CommandResultID}\ + \ \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\ + \ \\\n -H 'x-api-key: {API_KEY}'\n ```" + operationId: command_results_get + parameters: + - name: id + in: path + required: true + style: simple + explode: false + schema: + type: string + - name: fields + in: query + description: "Use a space seperated string of field parameters to include\ + \ the data in the response. If omitted, the default list of fields will\ + \ be returned.\n" + required: false + style: form + explode: true + schema: + type: string + - name: filter + in: query + description: "A filter to apply to the query. See the supported operators\ + \ below. For more complex searches,\nsee the related `/search/`\ + \ endpoints,\ne.g. `/search/systems`.\n\n**Filter structure**: `::`.\n\ + \n**field** = Populate with a valid field from an endpoint response.\n\n\ + **operator** = Supported operators are:\n- `$eq` (equals)\n- `$ne` (does\ + \ not equal)\n- `$gt` (is greater than)\n- `$gte` (is greater than or equal\ + \ to)\n- `$lt` (is less than)\n- `$lte` (is less than or equal to)\n\n_Note:\ + \ v1 operators differ from v2 operators._\n\n_Note: For v1 operators, excluding\ + \ the `$` will result in undefined behavior._\n\n**value** = Populate with\ + \ the value you want to search for. Is case sensitive.\n\n**Examples**\n\ + - `GET /users?filter=username:$eq:testuser`\n- `GET /systemusers?filter=password_expiration_date:$lte:2021-10-24`\n\ + - `GET /systemusers?filter=department:$ne:Accounting`\n- `GET /systems?filter[0]=firstname:$eq:foo&filter[1]=lastname:$eq:bar`\ + \ - this will\n AND the filters together.\n- `GET /systems?filter[or][0]=lastname:$eq:foo&filter[or][1]=lastname:$eq:bar`\ + \ - this will\n OR the filters together." + required: false + style: form + explode: true + schema: + type: string + - name: x-org-id + in: header + required: false + style: simple + explode: false + schema: + type: string + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/commandresult' + "401": + description: Unauthorized + content: {} + security: + - x-api-key: [] + x-scopes: + - commands + - commands.readonly + x-codeSamples: + - lang: Shell + source: "curl --request GET \\\n --url 'https://console.jumpcloud.com/api/commandresults/{id}?fields=&filter=SOME_STRING_VALUE'\ + \ \\\n --header 'x-api-key: REPLACE_KEY_VALUE' \\\n --header 'x-org-id:\ + \ '" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/commandresults/{id}\"\ + \n\nquerystring = {\"fields\":\"\",\"filter\":\"SOME_STRING_VALUE\"}\n\n\ + headers = {\n \"x-org-id\": \"\",\n \"x-api-key\": \"REPLACE_KEY_VALUE\"\ + \n}\n\nresponse = requests.request(\"GET\", url, headers=headers, params=querystring)\n\ + \nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-org-id\", \"\")\n$headers.Add(\"x-api-key\"\ + , \"REPLACE_KEY_VALUE\")\n$response = Invoke-RestMethod -Uri 'https://console.jumpcloud.com/api/commandresults/{id}?fields=&filter=SOME_STRING_VALUE'\ + \ -Method GET -Headers $headers" + delete: + tags: + - Command Results + summary: Delete a Command result + description: "This endpoint deletes a specific command result.\n\n#### Sample\ + \ Request\n```\ncurl -X DELETE https://console.jumpcloud.com/api/commandresults/{CommandID}\ + \ \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\ + \ \\\n -H 'x-api-key: {API_KEY}'\n ````" + operationId: command_results_delete + parameters: + - name: id + in: path + required: true + style: simple + explode: false + schema: + type: string + - name: x-org-id + in: header + required: false + style: simple + explode: false + schema: + type: string + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/commandresult' + "401": + description: Unauthorized + content: {} + security: + - x-api-key: [] + x-scopes: + - commands + x-codeSamples: + - lang: Shell + source: "curl --request DELETE \\\n --url https://console.jumpcloud.com/api/commandresults/{id}\ + \ \\\n --header 'x-api-key: REPLACE_KEY_VALUE' \\\n --header 'x-org-id:\ + \ '" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/commandresults/{id}\"\ + \n\nheaders = {\n \"x-org-id\": \"\",\n \"x-api-key\": \"REPLACE_KEY_VALUE\"\ + \n}\n\nresponse = requests.request(\"DELETE\", url, headers=headers)\n\n\ + print(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-org-id\", \"\")\n$headers.Add(\"x-api-key\"\ + , \"REPLACE_KEY_VALUE\")\n$response = Invoke-RestMethod -Uri 'https://console.jumpcloud.com/api/commandresults/{id}'\ + \ -Method DELETE -Headers $headers" + /commands: + get: + tags: + - Commands + summary: List All Commands + description: "This endpoint returns all commands.\n\n#### Sample Request\n```\n\ + curl -X GET https://console.jumpcloud.com/api/commands/ \\\n -H 'Accept:\ + \ application/json' \\\n -H 'Content-Type: application/json' \\\n -H 'x-api-key:\ + \ {API_KEY}'\n\n```" + operationId: commands_list + parameters: + - name: fields + in: query + description: "Use a space seperated string of field parameters to include\ + \ the data in the response. If omitted, the default list of fields will\ + \ be returned.\n" + required: false + style: form + explode: true + schema: + type: string + - name: filter + in: query + description: "A filter to apply to the query. See the supported operators\ + \ below. For more complex searches,\nsee the related `/search/`\ + \ endpoints,\ne.g. `/search/systems`.\n\n**Filter structure**: `::`.\n\ + \n**field** = Populate with a valid field from an endpoint response.\n\n\ + **operator** = Supported operators are:\n- `$eq` (equals)\n- `$ne` (does\ + \ not equal)\n- `$gt` (is greater than)\n- `$gte` (is greater than or equal\ + \ to)\n- `$lt` (is less than)\n- `$lte` (is less than or equal to)\n\n_Note:\ + \ v1 operators differ from v2 operators._\n\n_Note: For v1 operators, excluding\ + \ the `$` will result in undefined behavior._\n\n**value** = Populate with\ + \ the value you want to search for. Is case sensitive.\n\n**Examples**\n\ + - `GET /users?filter=username:$eq:testuser`\n- `GET /systemusers?filter=password_expiration_date:$lte:2021-10-24`\n\ + - `GET /systemusers?filter=department:$ne:Accounting`\n- `GET /systems?filter[0]=firstname:$eq:foo&filter[1]=lastname:$eq:bar`\ + \ - this will\n AND the filters together.\n- `GET /systems?filter[or][0]=lastname:$eq:foo&filter[or][1]=lastname:$eq:bar`\ + \ - this will\n OR the filters together." + required: false + style: form + explode: true + schema: + type: string + - name: limit + in: query + description: The number of records to return at once. Limited to 100. + required: false + style: form + explode: true + schema: + type: integer + default: 10 + - name: x-org-id + in: header + required: false + style: simple + explode: false + schema: + type: string + - name: skip + in: query + description: The offset into the records to return. + required: false + style: form + explode: true + schema: + minimum: 0 + type: integer + default: 0 + - name: sort + in: query + description: | + Use space separated sort parameters to sort the collection. + Default sort is ascending. Prefix with `-` to sort descending. + required: false + style: form + explode: true + schema: + type: string + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/commandslist' + "401": + description: Unauthorized + content: {} + security: + - x-api-key: [] + x-scopes: + - commands + - commands.readonly + x-codeSamples: + - lang: Shell + source: "curl --request GET \\\n --url 'https://console.jumpcloud.com/api/commands?fields=&filter=SOME_STRING_VALUE&limit=10&skip=0&sort='\ + \ \\\n --header 'x-api-key: REPLACE_KEY_VALUE' \\\n --header 'x-org-id:\ + \ '" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/commands\"\ + \n\nquerystring = {\"fields\":\"\",\"filter\":\"SOME_STRING_VALUE\",\"limit\"\ + :\"10\",\"skip\":\"0\",\"sort\":\"\"}\n\nheaders = {\n \"x-org-id\":\ + \ \"\",\n \"x-api-key\": \"REPLACE_KEY_VALUE\"\n}\n\nresponse = requests.request(\"\ + GET\", url, headers=headers, params=querystring)\n\nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-org-id\", \"\")\n$headers.Add(\"x-api-key\"\ + , \"REPLACE_KEY_VALUE\")\n$response = Invoke-RestMethod -Uri 'https://console.jumpcloud.com/api/commands?fields=&filter=SOME_STRING_VALUE&limit=10&skip=0&sort='\ + \ -Method GET -Headers $headers" + post: + tags: + - Commands + summary: Create A Command + description: "This endpoint allows you to create a new command.\n\n#### Sample\ + \ Request\n\n```\ncurl -X POST https://console.jumpcloud.com/api/commands/\ + \ \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\ + \ \\\n -H 'x-api-key: {API_KEY}' \\\n -d '{\n\t\"name\":\"Test API Command\"\ + ,\n\t\"command\":\"String\",\n\t\"user\":\"{UserID}\",\n\t\"schedule\":\"\"\ + ,\n\t\"timeout\":\"100\"\n}'\n\n```" + operationId: commands_post + parameters: + - name: x-org-id + in: header + required: false + style: simple + explode: false + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/command' + required: false + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/command' + "401": + description: Unauthorized + content: {} + security: + - x-api-key: [] + x-scopes: + - commands + x-codeSamples: + - lang: Shell + source: "curl --request POST \\\n --url https://console.jumpcloud.com/api/commands\ + \ \\\n --header 'content-type: application/json' \\\n --header 'x-api-key:\ + \ REPLACE_KEY_VALUE' \\\n --header 'x-org-id: ' \\\n --data '{\"command\"\ + :\"string\",\"commandRunners\":[\"string\"],\"commandType\":\"linux\",\"\ + files\":[\"string\"],\"launchType\":\"string\",\"listensTo\":\"string\"\ + ,\"name\":\"string\",\"organization\":\"string\",\"schedule\":\"string\"\ + ,\"scheduleRepeatType\":\"string\",\"scheduleYear\":0,\"shell\":\"string\"\ + ,\"sudo\":true,\"systems\":[\"string\"],\"template\":\"string\",\"timeToLiveSeconds\"\ + :0,\"timeout\":\"string\",\"trigger\":\"string\",\"user\":\"string\"}'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/commands\"\ + \n\npayload = {\n \"command\": \"string\",\n \"commandRunners\": [\"\ + string\"],\n \"commandType\": \"linux\",\n \"files\": [\"string\"\ + ],\n \"launchType\": \"string\",\n \"listensTo\": \"string\",\n \ + \ \"name\": \"string\",\n \"organization\": \"string\",\n \"schedule\"\ + : \"string\",\n \"scheduleRepeatType\": \"string\",\n \"scheduleYear\"\ + : 0,\n \"shell\": \"string\",\n \"sudo\": True,\n \"systems\":\ + \ [\"string\"],\n \"template\": \"string\",\n \"timeToLiveSeconds\"\ + : 0,\n \"timeout\": \"string\",\n \"trigger\": \"string\",\n \"\ + user\": \"string\"\n}\nheaders = {\n \"x-org-id\": \"\",\n \"x-api-key\"\ + : \"REPLACE_KEY_VALUE\",\n \"content-type\": \"application/json\"\n}\n\ + \nresponse = requests.request(\"POST\", url, json=payload, headers=headers)\n\ + \nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-org-id\", \"\")\n$headers.Add(\"x-api-key\"\ + , \"REPLACE_KEY_VALUE\")\n$headers.Add(\"content-type\", \"application/json\"\ + )\n$response = Invoke-RestMethod -Uri 'https://console.jumpcloud.com/api/commands'\ + \ -Method POST -Headers $headers -ContentType 'application/json' -Body '{\"\ + command\":\"string\",\"commandRunners\":[\"string\"],\"commandType\":\"\ + linux\",\"files\":[\"string\"],\"launchType\":\"string\",\"listensTo\":\"\ + string\",\"name\":\"string\",\"organization\":\"string\",\"schedule\":\"\ + string\",\"scheduleRepeatType\":\"string\",\"scheduleYear\":0,\"shell\"\ + :\"string\",\"sudo\":true,\"systems\":[\"string\"],\"template\":\"string\"\ + ,\"timeToLiveSeconds\":0,\"timeout\":\"string\",\"trigger\":\"string\",\"\ + user\":\"string\"}'" + x-codegen-request-body-name: body + /commands/{id}: + get: + tags: + - Commands + summary: List an individual Command + description: "This endpoint returns a specific command based on the command\ + \ ID.\n\n#### Sample Request\n```\ncurl -X GET https://console.jumpcloud.com/api/commands/{CommandID}\ + \ \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\ + \ \\\n -H 'x-api-key: {API_KEY}'\n```" + operationId: commands_get + parameters: + - name: id + in: path + required: true + style: simple + explode: false + schema: + type: string + - name: fields + in: query + description: "Use a space seperated string of field parameters to include\ + \ the data in the response. If omitted, the default list of fields will\ + \ be returned.\n" + required: false + style: form + explode: true + schema: + type: string + - name: x-org-id + in: header + required: false + style: simple + explode: false + schema: + type: string + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/command' + "401": + description: Unauthorized + content: {} + security: + - x-api-key: [] + x-scopes: + - commands + - commands.readonly + x-codeSamples: + - lang: Shell + source: "curl --request GET \\\n --url 'https://console.jumpcloud.com/api/commands/{id}?fields='\ + \ \\\n --header 'x-api-key: REPLACE_KEY_VALUE' \\\n --header 'x-org-id:\ + \ '" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/commands/{id}\"\ + \n\nquerystring = {\"fields\":\"\"}\n\nheaders = {\n \"x-org-id\": \"\ + \",\n \"x-api-key\": \"REPLACE_KEY_VALUE\"\n}\n\nresponse = requests.request(\"\ + GET\", url, headers=headers, params=querystring)\n\nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-org-id\", \"\")\n$headers.Add(\"x-api-key\"\ + , \"REPLACE_KEY_VALUE\")\n$response = Invoke-RestMethod -Uri 'https://console.jumpcloud.com/api/commands/{id}?fields='\ + \ -Method GET -Headers $headers" + put: + tags: + - Commands + summary: Update a Command + description: "This endpoint Updates a command based on the command ID and returns\ + \ the modified command record.\n\n#### Sample Request\n```\ncurl -X PUT https://console.jumpcloud.com/api/commands/{CommandID}\ + \ \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\ + \ \\\n -H 'x-api-key: {API_KEY}' \\\n -d '{\n\t\"name\":\"Test API Command\"\ + ,\n\t\"command\":\"String\",\n\t\"user\":\"{UserID}\",\n\t\"schedule\":\"\"\ + ,\n\t\"timeout\":\"100\"\n}'\n\n```" + operationId: commands_put + parameters: + - name: id + in: path + required: true + style: simple + explode: false + schema: + type: string + - name: x-org-id + in: header + required: false + style: simple + explode: false + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/command' + required: false + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/command' + "401": + description: Unauthorized + content: {} + security: + - x-api-key: [] + x-scopes: + - commands + x-codeSamples: + - lang: Shell + source: "curl --request PUT \\\n --url https://console.jumpcloud.com/api/commands/{id}\ + \ \\\n --header 'content-type: application/json' \\\n --header 'x-api-key:\ + \ REPLACE_KEY_VALUE' \\\n --header 'x-org-id: ' \\\n --data '{\"command\"\ + :\"string\",\"commandRunners\":[\"string\"],\"commandType\":\"linux\",\"\ + files\":[\"string\"],\"launchType\":\"string\",\"listensTo\":\"string\"\ + ,\"name\":\"string\",\"organization\":\"string\",\"schedule\":\"string\"\ + ,\"scheduleRepeatType\":\"string\",\"scheduleYear\":0,\"shell\":\"string\"\ + ,\"sudo\":true,\"systems\":[\"string\"],\"template\":\"string\",\"timeToLiveSeconds\"\ + :0,\"timeout\":\"string\",\"trigger\":\"string\",\"user\":\"string\"}'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/commands/{id}\"\ + \n\npayload = {\n \"command\": \"string\",\n \"commandRunners\": [\"\ + string\"],\n \"commandType\": \"linux\",\n \"files\": [\"string\"\ + ],\n \"launchType\": \"string\",\n \"listensTo\": \"string\",\n \ + \ \"name\": \"string\",\n \"organization\": \"string\",\n \"schedule\"\ + : \"string\",\n \"scheduleRepeatType\": \"string\",\n \"scheduleYear\"\ + : 0,\n \"shell\": \"string\",\n \"sudo\": True,\n \"systems\":\ + \ [\"string\"],\n \"template\": \"string\",\n \"timeToLiveSeconds\"\ + : 0,\n \"timeout\": \"string\",\n \"trigger\": \"string\",\n \"\ + user\": \"string\"\n}\nheaders = {\n \"x-org-id\": \"\",\n \"x-api-key\"\ + : \"REPLACE_KEY_VALUE\",\n \"content-type\": \"application/json\"\n}\n\ + \nresponse = requests.request(\"PUT\", url, json=payload, headers=headers)\n\ + \nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-org-id\", \"\")\n$headers.Add(\"x-api-key\"\ + , \"REPLACE_KEY_VALUE\")\n$headers.Add(\"content-type\", \"application/json\"\ + )\n$response = Invoke-RestMethod -Uri 'https://console.jumpcloud.com/api/commands/{id}'\ + \ -Method PUT -Headers $headers -ContentType 'application/json' -Body '{\"\ + command\":\"string\",\"commandRunners\":[\"string\"],\"commandType\":\"\ + linux\",\"files\":[\"string\"],\"launchType\":\"string\",\"listensTo\":\"\ + string\",\"name\":\"string\",\"organization\":\"string\",\"schedule\":\"\ + string\",\"scheduleRepeatType\":\"string\",\"scheduleYear\":0,\"shell\"\ + :\"string\",\"sudo\":true,\"systems\":[\"string\"],\"template\":\"string\"\ + ,\"timeToLiveSeconds\":0,\"timeout\":\"string\",\"trigger\":\"string\",\"\ + user\":\"string\"}'" + x-codegen-request-body-name: body + delete: + tags: + - Commands + summary: Delete a Command + description: "This endpoint deletes a specific command based on the Command\ + \ ID.\n\n#### Sample Request\n```\ncurl -X DELETE https://console.jumpcloud.com/api/commands/{CommandID}\ + \ \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\ + \ \\\n -H 'x-api-key: {API_KEY}'\n\n```" + operationId: commands_delete + parameters: + - name: id + in: path + required: true + style: simple + explode: false + schema: + type: string + - name: x-org-id + in: header + required: false + style: simple + explode: false + schema: + type: string + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/command' + "401": + description: Unauthorized + content: {} + security: + - x-api-key: [] + x-scopes: + - commands + x-codeSamples: + - lang: Shell + source: "curl --request DELETE \\\n --url https://console.jumpcloud.com/api/commands/{id}\ + \ \\\n --header 'x-api-key: REPLACE_KEY_VALUE' \\\n --header 'x-org-id:\ + \ '" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/commands/{id}\"\ + \n\nheaders = {\n \"x-org-id\": \"\",\n \"x-api-key\": \"REPLACE_KEY_VALUE\"\ + \n}\n\nresponse = requests.request(\"DELETE\", url, headers=headers)\n\n\ + print(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-org-id\", \"\")\n$headers.Add(\"x-api-key\"\ + , \"REPLACE_KEY_VALUE\")\n$response = Invoke-RestMethod -Uri 'https://console.jumpcloud.com/api/commands/{id}'\ + \ -Method DELETE -Headers $headers" + /commands/{id}/results: + get: + tags: + - Commands + summary: Get results for a specific command + description: "This endpoint returns results for a specific command.\n\n####\ + \ Sample Request\n```\ncurl -X GET https://console.jumpcloud.com/api/commands/{id}/results\ + \ \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\ + \ \\\n -H 'x-api-key: {API_KEY}'\n ````" + operationId: commands_getResults + parameters: + - name: id + in: path + required: true + style: simple + explode: false + schema: + type: string + responses: + "200": + description: OK + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/commandresult' + x-content-type: application/json + security: + - x-api-key: [] + x-scopes: + - commands + - commands.readonly + x-codeSamples: + - lang: Shell + source: "curl --request GET \\\n --url https://console.jumpcloud.com/api/commands/{id}/results\ + \ \\\n --header 'x-api-key: REPLACE_KEY_VALUE'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/commands/{id}/results\"\ + \n\nheaders = {\"x-api-key\": \"REPLACE_KEY_VALUE\"}\n\nresponse = requests.request(\"\ + GET\", url, headers=headers)\n\nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n\ + $response = Invoke-RestMethod -Uri 'https://console.jumpcloud.com/api/commands/{id}/results'\ + \ -Method GET -Headers $headers" + /files/command/{id}: + get: + tags: + - Commands + summary: Get a Command File + description: "This endpoint returns the uploaded file(s) associated with a specific\ + \ command.\n\n#### Sample Request\n\n```\ncurl -X GET https://console.jumpcloud.com/api/files/command/{commandID}\ + \ \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\ + \ \\\n -H 'x-api-key: {API_KEY}'\n ```" + operationId: command_file_get + parameters: + - name: id + in: path + required: true + style: simple + explode: false + schema: + type: string + - name: fields + in: query + description: "Use a space seperated string of field parameters to include\ + \ the data in the response. If omitted, the default list of fields will\ + \ be returned.\n" + required: false + style: form + explode: true + schema: + type: string + - name: limit + in: query + description: The number of records to return at once. Limited to 100. + required: false + style: form + explode: true + schema: + type: integer + default: 10 + - name: x-org-id + in: header + required: false + style: simple + explode: false + schema: + type: string + - name: skip + in: query + description: The offset into the records to return. + required: false + style: form + explode: true + schema: + minimum: 0 + type: integer + default: 0 + responses: + "200": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/commandfilereturn' + "400": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + security: + - x-api-key: [] + x-scopes: + - commands + - commands.readonly + x-codeSamples: + - lang: Shell + source: "curl --request GET \\\n --url 'https://console.jumpcloud.com/api/files/command/{id}?fields=&limit=10&skip=0'\ + \ \\\n --header 'x-api-key: REPLACE_KEY_VALUE' \\\n --header 'x-org-id:\ + \ '" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/files/command/{id}\"\ + \n\nquerystring = {\"fields\":\"\",\"limit\":\"10\",\"skip\":\"0\"}\n\n\ + headers = {\n \"x-org-id\": \"\",\n \"x-api-key\": \"REPLACE_KEY_VALUE\"\ + \n}\n\nresponse = requests.request(\"GET\", url, headers=headers, params=querystring)\n\ + \nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-org-id\", \"\")\n$headers.Add(\"x-api-key\"\ + , \"REPLACE_KEY_VALUE\")\n$response = Invoke-RestMethod -Uri 'https://console.jumpcloud.com/api/files/command/{id}?fields=&limit=10&skip=0'\ + \ -Method GET -Headers $headers" + /organizations: + get: + tags: + - Organizations + - Managed Service Provider + summary: Get Organization Details + description: "This endpoint returns Organization Details.\n\n#### Sample Request\n\ + \n```\ncurl -X GET \\\n https://console.jumpcloud.com/api/organizations \\\ + \n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\ + \ \\\n -H 'x-api-key: {API_KEY}'\n ```" + operationId: organization_list + parameters: + - name: fields + in: query + description: "Use a space seperated string of field parameters to include\ + \ the data in the response. If omitted, the default list of fields will\ + \ be returned.\n" + required: false + style: form + explode: true + schema: + type: string + - name: filter + in: query + description: "A filter to apply to the query. See the supported operators\ + \ below. For more complex searches,\nsee the related `/search/`\ + \ endpoints,\ne.g. `/search/systems`.\n\n**Filter structure**: `::`.\n\ + \n**field** = Populate with a valid field from an endpoint response.\n\n\ + **operator** = Supported operators are:\n- `$eq` (equals)\n- `$ne` (does\ + \ not equal)\n- `$gt` (is greater than)\n- `$gte` (is greater than or equal\ + \ to)\n- `$lt` (is less than)\n- `$lte` (is less than or equal to)\n\n_Note:\ + \ v1 operators differ from v2 operators._\n\n_Note: For v1 operators, excluding\ + \ the `$` will result in undefined behavior._\n\n**value** = Populate with\ + \ the value you want to search for. Is case sensitive.\n\n**Examples**\n\ + - `GET /users?filter=username:$eq:testuser`\n- `GET /systemusers?filter=password_expiration_date:$lte:2021-10-24`\n\ + - `GET /systemusers?filter=department:$ne:Accounting`\n- `GET /systems?filter[0]=firstname:$eq:foo&filter[1]=lastname:$eq:bar`\ + \ - this will\n AND the filters together.\n- `GET /systems?filter[or][0]=lastname:$eq:foo&filter[or][1]=lastname:$eq:bar`\ + \ - this will\n OR the filters together." + required: false + style: form + explode: true + schema: + type: string + - name: limit + in: query + description: The number of records to return at once. Limited to 100. + required: false + style: form + explode: true + schema: + type: integer + default: 10 + - name: search + in: query + description: A nested object containing a `searchTerm` string or array of + strings and a list of `fields` to search on. + required: false + style: form + explode: true + schema: + type: string + - name: skip + in: query + description: The offset into the records to return. + required: false + style: form + explode: true + schema: + minimum: 0 + type: integer + default: 0 + - name: sort + in: query + description: | + Use space separated sort parameters to sort the collection. + Default sort is ascending. Prefix with `-` to sort descending. + required: false + style: form + explode: true + schema: + type: string + responses: + "200": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/organizationslist' + security: + - x-api-key: [] + x-scopes: + - commandrunner.legacy + - organizations + - organizations.readonly + x-codeSamples: + - lang: Shell + source: "curl --request GET \\\n --url 'https://console.jumpcloud.com/api/organizations?fields=&filter=SOME_STRING_VALUE&limit=10&search=SOME_STRING_VALUE&skip=0&sort='\ + \ \\\n --header 'x-api-key: REPLACE_KEY_VALUE'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/organizations\"\ + \n\nquerystring = {\"fields\":\"\",\"filter\":\"SOME_STRING_VALUE\",\"limit\"\ + :\"10\",\"search\":\"SOME_STRING_VALUE\",\"skip\":\"0\",\"sort\":\"\"}\n\ + \nheaders = {\"x-api-key\": \"REPLACE_KEY_VALUE\"}\n\nresponse = requests.request(\"\ + GET\", url, headers=headers, params=querystring)\n\nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n\ + $response = Invoke-RestMethod -Uri 'https://console.jumpcloud.com/api/organizations?fields=&filter=SOME_STRING_VALUE&limit=10&search=SOME_STRING_VALUE&skip=0&sort='\ + \ -Method GET -Headers $headers" + /organizations/{id}: + get: + tags: + - Organizations + summary: Get an Organization + description: "This endpoint returns a particular Organization.\n\n#### Sample\ + \ Request\n\n```\ncurl -X GET https://console.jumpcloud.com/api/organizations/{OrganizationID}\ + \ \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\ + \ \\\n -H 'x-api-key: {API_KEY}'\n```" + operationId: organizations_get + parameters: + - name: id + in: path + required: true + style: simple + explode: false + schema: + type: string + - name: fields + in: query + description: "Use a space seperated string of field parameters to include\ + \ the data in the response. If omitted, the default list of fields will\ + \ be returned.\n" + required: false + style: form + explode: true + schema: + type: string + - name: filter + in: query + description: "A filter to apply to the query. See the supported operators\ + \ below. For more complex searches,\nsee the related `/search/`\ + \ endpoints,\ne.g. `/search/systems`.\n\n**Filter structure**: `::`.\n\ + \n**field** = Populate with a valid field from an endpoint response.\n\n\ + **operator** = Supported operators are:\n- `$eq` (equals)\n- `$ne` (does\ + \ not equal)\n- `$gt` (is greater than)\n- `$gte` (is greater than or equal\ + \ to)\n- `$lt` (is less than)\n- `$lte` (is less than or equal to)\n\n_Note:\ + \ v1 operators differ from v2 operators._\n\n_Note: For v1 operators, excluding\ + \ the `$` will result in undefined behavior._\n\n**value** = Populate with\ + \ the value you want to search for. Is case sensitive.\n\n**Examples**\n\ + - `GET /users?filter=username:$eq:testuser`\n- `GET /systemusers?filter=password_expiration_date:$lte:2021-10-24`\n\ + - `GET /systemusers?filter=department:$ne:Accounting`\n- `GET /systems?filter[0]=firstname:$eq:foo&filter[1]=lastname:$eq:bar`\ + \ - this will\n AND the filters together.\n- `GET /systems?filter[or][0]=lastname:$eq:foo&filter[or][1]=lastname:$eq:bar`\ + \ - this will\n OR the filters together." + required: false + style: form + explode: true + schema: + type: string + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/organization' + "401": + description: Unauthorized + content: {} + "403": + description: "" + content: {} + security: + - x-api-key: [] + x-scopes: + - organizations + - organizations.readonly + x-codeSamples: + - lang: Shell + source: "curl --request GET \\\n --url 'https://console.jumpcloud.com/api/organizations/{id}?fields=&filter=SOME_STRING_VALUE'\ + \ \\\n --header 'x-api-key: REPLACE_KEY_VALUE'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/organizations/{id}\"\ + \n\nquerystring = {\"fields\":\"\",\"filter\":\"SOME_STRING_VALUE\"}\n\n\ + headers = {\"x-api-key\": \"REPLACE_KEY_VALUE\"}\n\nresponse = requests.request(\"\ + GET\", url, headers=headers, params=querystring)\n\nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n\ + $response = Invoke-RestMethod -Uri 'https://console.jumpcloud.com/api/organizations/{id}?fields=&filter=SOME_STRING_VALUE'\ + \ -Method GET -Headers $headers" + put: + tags: + - Organizations + summary: Update an Organization + description: "This endpoint allows you to update an Organization.\n\nNote: `passwordPolicy`\ + \ settings are only used when `passwordCompliance` is set to \"custom\". We\ + \ discourage the use of non-custom passwordCompliance values.\n\n`hasStripeCustomerId`\ + \ is deprecated and will be removed.\n\n#### Sample Request\n\n```\ncurl -X\ + \ PUT https://console.jumpcloud.com/api/organizations/{OrganizationID} \\\n\ + \ -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\ + \ \\\n -H 'x-api-key: {API_KEY}' \\\n -d '{\n \"settings\": {\n \"contactName\"\ + : \"Admin Name\",\n \"contactEmail\": \"admin@company.com\",\n \"systemUsersCanEdit\"\ + :true,\n \"passwordPolicy\": {\n \"enableMaxHistory\": true,\n \ + \ \"maxHistory\": 3\n }\n }\n}'\n```" + operationId: organization_put + parameters: + - name: id + in: path + required: true + style: simple + explode: false + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/organizations_id_body' + required: false + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/organization' + "400": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "401": + description: Unauthorized + content: {} + security: + - x-api-key: [] + x-scopes: + - organizations + x-codeSamples: + - lang: Shell + source: "curl --request PUT \\\n --url https://console.jumpcloud.com/api/organizations/{id}\ + \ \\\n --header 'content-type: application/json' \\\n --header 'x-api-key:\ + \ REPLACE_KEY_VALUE' \\\n --data '{\"settings\":{\"contactEmail\":\"string\"\ + ,\"contactName\":\"string\",\"deviceIdentificationEnabled\":true,\"disableGoogleLogin\"\ + :true,\"disableLdap\":true,\"disableUM\":true,\"duplicateLDAPGroups\":true,\"\ + emailDisclaimer\":\"string\",\"enableManagedUID\":true,\"features\":{\"\ + directoryInsights\":{\"enabled\":true},\"directoryInsightsPremium\":{\"\ + createdAt\":\"string\",\"enabled\":true,\"updatedAt\":\"string\"},\"systemInsights\"\ + :{\"createdAt\":\"string\",\"enableNewDarwin\":true,\"enableNewLinux\":true,\"\ + enableNewWindows\":true,\"enabled\":true,\"updatedAt\":\"string\"}},\"growthData\"\ + :{},\"logo\":\"string\",\"name\":\"string\",\"newSystemUserStateDefaults\"\ + :{\"applicationImport\":\"ACTIVATED\",\"csvImport\":\"ACTIVATED\",\"manualEntry\"\ + :\"ACTIVATED\"},\"passwordCompliance\":\"custom\",\"passwordPolicy\":{\"\ + allowUsernameSubstring\":true,\"daysAfterExpirationToSelfRecover\":0,\"\ + daysBeforeExpirationToForceReset\":1,\"effectiveDate\":\"string\",\"enableDaysAfterExpirationToSelfRecover\"\ + :true,\"enableDaysBeforeExpirationToForceReset\":true,\"enableLockoutTimeInSeconds\"\ + :true,\"enableMaxHistory\":true,\"enableMaxLoginAttempts\":true,\"enableMinChangePeriodInDays\"\ + :true,\"enableMinLength\":true,\"enablePasswordExpirationInDays\":true,\"\ + gracePeriodDate\":\"string\",\"lockoutTimeInSeconds\":0,\"maxHistory\":1,\"\ + maxLoginAttempts\":1,\"minChangePeriodInDays\":0,\"minLength\":0,\"needsLowercase\"\ + :true,\"needsNumeric\":true,\"needsSymbolic\":true,\"needsUppercase\":true,\"\ + passwordExpirationInDays\":1},\"showIntro\":true,\"systemUserPasswordExpirationInDays\"\ + :0,\"systemUsersCanEdit\":true,\"systemUsersCap\":0,\"trustedAppConfig\"\ + :{\"trustedApps\":[{\"name\":\"Application 1\",\"path\":\"/someuser/Applications/application1.app\"\ + ,\"teamid\":\"FakeTeamID\"}]},\"userPortal\":{\"idleSessionDurationMinutes\"\ + :1}}}'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/organizations/{id}\"\ + \n\npayload = {\"settings\": {\n \"contactEmail\": \"string\",\n\ + \ \"contactName\": \"string\",\n \"deviceIdentificationEnabled\"\ + : True,\n \"disableGoogleLogin\": True,\n \"disableLdap\"\ + : True,\n \"disableUM\": True,\n \"duplicateLDAPGroups\":\ + \ True,\n \"emailDisclaimer\": \"string\",\n \"enableManagedUID\"\ + : True,\n \"features\": {\n \"directoryInsights\": {\"\ + enabled\": True},\n \"directoryInsightsPremium\": {\n \ + \ \"createdAt\": \"string\",\n \"enabled\": True,\n\ + \ \"updatedAt\": \"string\"\n },\n \ + \ \"systemInsights\": {\n \"createdAt\": \"string\",\n \ + \ \"enableNewDarwin\": True,\n \"enableNewLinux\"\ + : True,\n \"enableNewWindows\": True,\n \"\ + enabled\": True,\n \"updatedAt\": \"string\"\n \ + \ }\n },\n \"growthData\": {},\n \"logo\": \"string\"\ + ,\n \"name\": \"string\",\n \"newSystemUserStateDefaults\"\ + : {\n \"applicationImport\": \"ACTIVATED\",\n \"csvImport\"\ + : \"ACTIVATED\",\n \"manualEntry\": \"ACTIVATED\"\n },\n\ + \ \"passwordCompliance\": \"custom\",\n \"passwordPolicy\"\ + : {\n \"allowUsernameSubstring\": True,\n \"daysAfterExpirationToSelfRecover\"\ + : 0,\n \"daysBeforeExpirationToForceReset\": 1,\n \ + \ \"effectiveDate\": \"string\",\n \"enableDaysAfterExpirationToSelfRecover\"\ + : True,\n \"enableDaysBeforeExpirationToForceReset\": True,\n\ + \ \"enableLockoutTimeInSeconds\": True,\n \"enableMaxHistory\"\ + : True,\n \"enableMaxLoginAttempts\": True,\n \"enableMinChangePeriodInDays\"\ + : True,\n \"enableMinLength\": True,\n \"enablePasswordExpirationInDays\"\ + : True,\n \"gracePeriodDate\": \"string\",\n \"lockoutTimeInSeconds\"\ + : 0,\n \"maxHistory\": 1,\n \"maxLoginAttempts\":\ + \ 1,\n \"minChangePeriodInDays\": 0,\n \"minLength\"\ + : 0,\n \"needsLowercase\": True,\n \"needsNumeric\"\ + : True,\n \"needsSymbolic\": True,\n \"needsUppercase\"\ + : True,\n \"passwordExpirationInDays\": 1\n },\n \ + \ \"showIntro\": True,\n \"systemUserPasswordExpirationInDays\"\ + : 0,\n \"systemUsersCanEdit\": True,\n \"systemUsersCap\"\ + : 0,\n \"trustedAppConfig\": {\"trustedApps\": [\n \ + \ {\n \"name\": \"Application 1\",\n \ + \ \"path\": \"/someuser/Applications/application1.app\",\n \ + \ \"teamid\": \"FakeTeamID\"\n }\n ]},\n\ + \ \"userPortal\": {\"idleSessionDurationMinutes\": 1}\n }}\nheaders\ + \ = {\n \"x-api-key\": \"REPLACE_KEY_VALUE\",\n \"content-type\":\ + \ \"application/json\"\n}\n\nresponse = requests.request(\"PUT\", url, json=payload,\ + \ headers=headers)\n\nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n\ + $headers.Add(\"content-type\", \"application/json\")\n$response = Invoke-RestMethod\ + \ -Uri 'https://console.jumpcloud.com/api/organizations/{id}' -Method PUT\ + \ -Headers $headers -ContentType 'application/json' -Body '{\"settings\"\ + :{\"contactEmail\":\"string\",\"contactName\":\"string\",\"deviceIdentificationEnabled\"\ + :true,\"disableGoogleLogin\":true,\"disableLdap\":true,\"disableUM\":true,\"\ + duplicateLDAPGroups\":true,\"emailDisclaimer\":\"string\",\"enableManagedUID\"\ + :true,\"features\":{\"directoryInsights\":{\"enabled\":true},\"directoryInsightsPremium\"\ + :{\"createdAt\":\"string\",\"enabled\":true,\"updatedAt\":\"string\"},\"\ + systemInsights\":{\"createdAt\":\"string\",\"enableNewDarwin\":true,\"enableNewLinux\"\ + :true,\"enableNewWindows\":true,\"enabled\":true,\"updatedAt\":\"string\"\ + }},\"growthData\":{},\"logo\":\"string\",\"name\":\"string\",\"newSystemUserStateDefaults\"\ + :{\"applicationImport\":\"ACTIVATED\",\"csvImport\":\"ACTIVATED\",\"manualEntry\"\ + :\"ACTIVATED\"},\"passwordCompliance\":\"custom\",\"passwordPolicy\":{\"\ + allowUsernameSubstring\":true,\"daysAfterExpirationToSelfRecover\":0,\"\ + daysBeforeExpirationToForceReset\":1,\"effectiveDate\":\"string\",\"enableDaysAfterExpirationToSelfRecover\"\ + :true,\"enableDaysBeforeExpirationToForceReset\":true,\"enableLockoutTimeInSeconds\"\ + :true,\"enableMaxHistory\":true,\"enableMaxLoginAttempts\":true,\"enableMinChangePeriodInDays\"\ + :true,\"enableMinLength\":true,\"enablePasswordExpirationInDays\":true,\"\ + gracePeriodDate\":\"string\",\"lockoutTimeInSeconds\":0,\"maxHistory\":1,\"\ + maxLoginAttempts\":1,\"minChangePeriodInDays\":0,\"minLength\":0,\"needsLowercase\"\ + :true,\"needsNumeric\":true,\"needsSymbolic\":true,\"needsUppercase\":true,\"\ + passwordExpirationInDays\":1},\"showIntro\":true,\"systemUserPasswordExpirationInDays\"\ + :0,\"systemUsersCanEdit\":true,\"systemUsersCap\":0,\"trustedAppConfig\"\ + :{\"trustedApps\":[{\"name\":\"Application 1\",\"path\":\"/someuser/Applications/application1.app\"\ + ,\"teamid\":\"FakeTeamID\"}]},\"userPortal\":{\"idleSessionDurationMinutes\"\ + :1}}}'" + x-codegen-request-body-name: body + /radiusservers: + get: + tags: + - Radius Servers + summary: List Radius Servers + description: "This endpoint allows you to get a list of all RADIUS servers in\ + \ your organization.\n\n#### Sample Request\n```\ncurl -X GET https://console.jumpcloud.com/api/radiusservers/\ + \ \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\ + \ \\\n -H 'x-api-key: {API_KEY}' \\\n```" + operationId: radius_servers_list + parameters: + - name: fields + in: query + description: "Use a space seperated string of field parameters to include\ + \ the data in the response. If omitted, the default list of fields will\ + \ be returned.\n" + required: false + style: form + explode: true + schema: + type: string + - name: filter + in: query + description: "A filter to apply to the query. See the supported operators\ + \ below. For more complex searches,\nsee the related `/search/`\ + \ endpoints,\ne.g. `/search/systems`.\n\n**Filter structure**: `::`.\n\ + \n**field** = Populate with a valid field from an endpoint response.\n\n\ + **operator** = Supported operators are:\n- `$eq` (equals)\n- `$ne` (does\ + \ not equal)\n- `$gt` (is greater than)\n- `$gte` (is greater than or equal\ + \ to)\n- `$lt` (is less than)\n- `$lte` (is less than or equal to)\n\n_Note:\ + \ v1 operators differ from v2 operators._\n\n_Note: For v1 operators, excluding\ + \ the `$` will result in undefined behavior._\n\n**value** = Populate with\ + \ the value you want to search for. Is case sensitive.\n\n**Examples**\n\ + - `GET /users?filter=username:$eq:testuser`\n- `GET /systemusers?filter=password_expiration_date:$lte:2021-10-24`\n\ + - `GET /systemusers?filter=department:$ne:Accounting`\n- `GET /systems?filter[0]=firstname:$eq:foo&filter[1]=lastname:$eq:bar`\ + \ - this will\n AND the filters together.\n- `GET /systems?filter[or][0]=lastname:$eq:foo&filter[or][1]=lastname:$eq:bar`\ + \ - this will\n OR the filters together." + required: false + style: form + explode: true + schema: + type: string + - name: limit + in: query + description: The number of records to return at once. Limited to 100. + required: false + style: form + explode: true + schema: + type: integer + default: 10 + - name: skip + in: query + description: The offset into the records to return. + required: false + style: form + explode: true + schema: + minimum: 0 + type: integer + default: 0 + - name: sort + in: query + description: | + Use space separated sort parameters to sort the collection. + Default sort is ascending. Prefix with `-` to sort descending. + required: false + style: form + explode: true + schema: + type: string + - name: x-org-id + in: header + required: false + style: simple + explode: false + schema: + type: string + responses: + "200": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/radiusserverslist' + security: + - x-api-key: [] + x-scopes: + - radius + - radius.readonly + x-codeSamples: + - lang: Shell + source: "curl --request GET \\\n --url 'https://console.jumpcloud.com/api/radiusservers?fields=&filter=SOME_STRING_VALUE&limit=10&skip=0&sort='\ + \ \\\n --header 'x-api-key: REPLACE_KEY_VALUE' \\\n --header 'x-org-id:\ + \ '" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/radiusservers\"\ + \n\nquerystring = {\"fields\":\"\",\"filter\":\"SOME_STRING_VALUE\",\"limit\"\ + :\"10\",\"skip\":\"0\",\"sort\":\"\"}\n\nheaders = {\n \"x-org-id\":\ + \ \"\",\n \"x-api-key\": \"REPLACE_KEY_VALUE\"\n}\n\nresponse = requests.request(\"\ + GET\", url, headers=headers, params=querystring)\n\nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-org-id\", \"\")\n$headers.Add(\"x-api-key\"\ + , \"REPLACE_KEY_VALUE\")\n$response = Invoke-RestMethod -Uri 'https://console.jumpcloud.com/api/radiusservers?fields=&filter=SOME_STRING_VALUE&limit=10&skip=0&sort='\ + \ -Method GET -Headers $headers" + post: + tags: + - Radius Servers + summary: Create a Radius Server + description: "This endpoint allows you to create RADIUS servers in your organization.\n\ + \n#### Sample Request\n```\ncurl -X POST https://console.jumpcloud.com/api/radiusservers/\ + \ \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\ + \ \\\n -H 'x-api-key: {API_KEY}' \\\n -d '{\n \"name\": \"{test_radius}\"\ + ,\n \"networkSourceIp\": \"{0.0.0.0}\",\n \"sharedSecret\":\"{secretpassword}\"\ + ,\n \"userLockoutAction\": \"REMOVE\",\n \"userPasswordExpirationAction\"\ + : \"MAINTAIN\"\n}'\n```" + operationId: radius_servers_post + parameters: + - name: x-org-id + in: header + required: false + style: simple + explode: false + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/radiusserverpost' + required: false + responses: + "200": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/radiusserver' + security: + - x-api-key: [] + x-scopes: + - radius + x-codeSamples: + - lang: Shell + source: "curl --request POST \\\n --url https://console.jumpcloud.com/api/radiusservers\ + \ \\\n --header 'content-type: application/json' \\\n --header 'x-api-key:\ + \ REPLACE_KEY_VALUE' \\\n --header 'x-org-id: ' \\\n --data '{\"authIdp\"\ + :\"JUMPCLOUD\",\"deviceCertEnabled\":true,\"mfa\":\"DISABLED\",\"name\"\ + :\"string\",\"networkSourceIp\":\"string\",\"sharedSecret\":\"string\",\"\ + tagNames\":[\"string\"],\"userCertEnabled\":true,\"userLockoutAction\":\"\ + string\",\"userPasswordEnabled\":true,\"userPasswordExpirationAction\":\"\ + string\"}'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/radiusservers\"\ + \n\npayload = {\n \"authIdp\": \"JUMPCLOUD\",\n \"deviceCertEnabled\"\ + : True,\n \"mfa\": \"DISABLED\",\n \"name\": \"string\",\n \"networkSourceIp\"\ + : \"string\",\n \"sharedSecret\": \"string\",\n \"tagNames\": [\"\ + string\"],\n \"userCertEnabled\": True,\n \"userLockoutAction\": \"\ + string\",\n \"userPasswordEnabled\": True,\n \"userPasswordExpirationAction\"\ + : \"string\"\n}\nheaders = {\n \"x-org-id\": \"\",\n \"x-api-key\"\ + : \"REPLACE_KEY_VALUE\",\n \"content-type\": \"application/json\"\n}\n\ + \nresponse = requests.request(\"POST\", url, json=payload, headers=headers)\n\ + \nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-org-id\", \"\")\n$headers.Add(\"x-api-key\"\ + , \"REPLACE_KEY_VALUE\")\n$headers.Add(\"content-type\", \"application/json\"\ + )\n$response = Invoke-RestMethod -Uri 'https://console.jumpcloud.com/api/radiusservers'\ + \ -Method POST -Headers $headers -ContentType 'application/json' -Body '{\"\ + authIdp\":\"JUMPCLOUD\",\"deviceCertEnabled\":true,\"mfa\":\"DISABLED\"\ + ,\"name\":\"string\",\"networkSourceIp\":\"string\",\"sharedSecret\":\"\ + string\",\"tagNames\":[\"string\"],\"userCertEnabled\":true,\"userLockoutAction\"\ + :\"string\",\"userPasswordEnabled\":true,\"userPasswordExpirationAction\"\ + :\"string\"}'" + x-codegen-request-body-name: body + /radiusservers/{id}: + get: + tags: + - Radius Servers + summary: Get Radius Server + description: "This endpoint allows you to get a RADIUS server in your organization.\n\ + \n####\n```\ncurl -X PUT https://console.jumpcloud.com/api/radiusservers/{ServerID}\ + \ \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\ + \ \\\n -H 'x-api-key: {API_KEY}' \\\n```" + operationId: radius_servers_get + parameters: + - name: id + in: path + required: true + style: simple + explode: false + schema: + type: string + - name: x-org-id + in: header + required: false + style: simple + explode: false + schema: + type: string + responses: + "200": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/radiusserver' + security: + - x-api-key: [] + x-scopes: + - radius + - radius.readonly + x-codeSamples: + - lang: Shell + source: "curl --request GET \\\n --url https://console.jumpcloud.com/api/radiusservers/{id}\ + \ \\\n --header 'x-api-key: REPLACE_KEY_VALUE' \\\n --header 'x-org-id:\ + \ '" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/radiusservers/{id}\"\ + \n\nheaders = {\n \"x-org-id\": \"\",\n \"x-api-key\": \"REPLACE_KEY_VALUE\"\ + \n}\n\nresponse = requests.request(\"GET\", url, headers=headers)\n\nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-org-id\", \"\")\n$headers.Add(\"x-api-key\"\ + , \"REPLACE_KEY_VALUE\")\n$response = Invoke-RestMethod -Uri 'https://console.jumpcloud.com/api/radiusservers/{id}'\ + \ -Method GET -Headers $headers" + put: + tags: + - Radius Servers + summary: Update Radius Servers + description: "This endpoint allows you to update RADIUS servers in your organization.\n\ + \n####\n```\ncurl -X PUT https://console.jumpcloud.com/api/radiusservers/{ServerID}\ + \ \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\ + \ \\\n -H 'x-api-key: {API_KEY}' \\\n -d '{\n \"name\": \"{name_update}\"\ + ,\n \"networkSourceIp\": \"{0.0.0.0}\",\n \"sharedSecret\": \"{secret_password}\"\ + ,\n \"userLockoutAction\": \"REMOVE\",\n \"userPasswordExpirationAction\"\ + : \"MAINTAIN\"\n}'\n```" + operationId: radius_servers_put + parameters: + - name: id + in: path + required: true + style: simple + explode: false + schema: + type: string + - name: x-org-id + in: header + required: false + style: simple + explode: false + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/radiusservers_id_body' + required: false + responses: + "200": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/radiusserverput' + security: + - x-api-key: [] + x-scopes: + - radius + x-codeSamples: + - lang: Shell + source: "curl --request PUT \\\n --url https://console.jumpcloud.com/api/radiusservers/{id}\ + \ \\\n --header 'content-type: application/json' \\\n --header 'x-api-key:\ + \ REPLACE_KEY_VALUE' \\\n --header 'x-org-id: ' \\\n --data '{\"name\"\ + :\"test radius\",\"networkSourceIp\":\"0.0.0.0\",\"sharedSecret\":\"secretradiuspassword\"\ + ,\"tagsNames\":[\"tag1\"]}'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/radiusservers/{id}\"\ + \n\npayload = {\n \"name\": \"test radius\",\n \"networkSourceIp\"\ + : \"0.0.0.0\",\n \"sharedSecret\": \"secretradiuspassword\",\n \"\ + tagsNames\": [\"tag1\"]\n}\nheaders = {\n \"x-org-id\": \"\",\n \"\ + x-api-key\": \"REPLACE_KEY_VALUE\",\n \"content-type\": \"application/json\"\ + \n}\n\nresponse = requests.request(\"PUT\", url, json=payload, headers=headers)\n\ + \nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-org-id\", \"\")\n$headers.Add(\"x-api-key\"\ + , \"REPLACE_KEY_VALUE\")\n$headers.Add(\"content-type\", \"application/json\"\ + )\n$response = Invoke-RestMethod -Uri 'https://console.jumpcloud.com/api/radiusservers/{id}'\ + \ -Method PUT -Headers $headers -ContentType 'application/json' -Body '{\"\ + name\":\"test radius\",\"networkSourceIp\":\"0.0.0.0\",\"sharedSecret\"\ + :\"secretradiuspassword\",\"tagsNames\":[\"tag1\"]}'" + x-codegen-request-body-name: body + delete: + tags: + - Radius Servers + summary: Delete Radius Server + description: "This endpoint allows you to delete RADIUS servers in your organization.\n\ + ```\ncurl -X DELETE https://console.jumpcloud.com/api/radiusservers/{ServerID}\ + \ \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\ + \ \\\n -H 'x-api-key: {API_KEY}' \\\n```" + operationId: radius_servers_delete + parameters: + - name: id + in: path + required: true + style: simple + explode: false + schema: + type: string + - name: x-org-id + in: header + required: false + style: simple + explode: false + schema: + type: string + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/radiusserverput' + security: + - x-api-key: [] + x-scopes: + - radius + x-codeSamples: + - lang: Shell + source: "curl --request DELETE \\\n --url https://console.jumpcloud.com/api/radiusservers/{id}\ + \ \\\n --header 'x-api-key: REPLACE_KEY_VALUE' \\\n --header 'x-org-id:\ + \ '" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/radiusservers/{id}\"\ + \n\nheaders = {\n \"x-org-id\": \"\",\n \"x-api-key\": \"REPLACE_KEY_VALUE\"\ + \n}\n\nresponse = requests.request(\"DELETE\", url, headers=headers)\n\n\ + print(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-org-id\", \"\")\n$headers.Add(\"x-api-key\"\ + , \"REPLACE_KEY_VALUE\")\n$response = Invoke-RestMethod -Uri 'https://console.jumpcloud.com/api/radiusservers/{id}'\ + \ -Method DELETE -Headers $headers" + /search/commandresults: + post: + tags: + - Search + summary: Search Commands Results + description: "Return Command Results in multi-record format allowing for the\ + \ passing of the `filter` parameter.\n\nTo support advanced filtering you\ + \ can use the `filter` and `searchFilter` parameters that can only be passed\ + \ in the body of POST /api/search/commandresults route. The `filter` parameter\ + \ must be passed as Content-Type application/json.\n\nThe `filter` parameter\ + \ is an object with a single property, either `and` or `or` with the value\ + \ of the property being an array of query expressions.\n\nThis allows you\ + \ to filter records using the logic of matching ALL or ANY records in the\ + \ array of query expressions. If the `and` or `or` are not included the default\ + \ behavior is to match ALL query expressions.\n\n\n#### Sample Request\n\n\ + Exact search for a specific command result\n```\ncurl -X POST https://console.jumpcloud.com/api/search/commandresults\ + \ \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\ + \ \\\n -H 'x-api-key: {API_KEY}' \\\n -d '{\n \"filter\" : \"workflowInstanceId:$eq:62f3c599ec4e928499069c7f\"\ + ,\n \"fields\" : \"name workflowId sudo\"\n}'\n```" + operationId: search_commandresults_post + parameters: + - name: fields + in: query + description: "Use a space seperated string of field parameters to include\ + \ the data in the response. If omitted, the default list of fields will\ + \ be returned.\n" + required: false + style: form + explode: true + schema: + type: string + - name: filter + in: query + description: "A filter to apply to the query. See the supported operators\ + \ below. For more complex searches,\nsee the related `/search/`\ + \ endpoints,\ne.g. `/search/systems`.\n\n**Filter structure**: `::`.\n\ + \n**field** = Populate with a valid field from an endpoint response.\n\n\ + **operator** = Supported operators are:\n- `$eq` (equals)\n- `$ne` (does\ + \ not equal)\n- `$gt` (is greater than)\n- `$gte` (is greater than or equal\ + \ to)\n- `$lt` (is less than)\n- `$lte` (is less than or equal to)\n\n_Note:\ + \ v1 operators differ from v2 operators._\n\n_Note: For v1 operators, excluding\ + \ the `$` will result in undefined behavior._\n\n**value** = Populate with\ + \ the value you want to search for. Is case sensitive.\n\n**Examples**\n\ + - `GET /users?filter=username:$eq:testuser`\n- `GET /systemusers?filter=password_expiration_date:$lte:2021-10-24`\n\ + - `GET /systemusers?filter=department:$ne:Accounting`\n- `GET /systems?filter[0]=firstname:$eq:foo&filter[1]=lastname:$eq:bar`\ + \ - this will\n AND the filters together.\n- `GET /systems?filter[or][0]=lastname:$eq:foo&filter[or][1]=lastname:$eq:bar`\ + \ - this will\n OR the filters together." + required: false + style: form + explode: true + schema: + type: string + - name: limit + in: query + description: The number of records to return at once. Limited to 100. + required: false + style: form + explode: true + schema: + type: integer + default: 10 + - name: skip + in: query + description: The offset into the records to return. + required: false + style: form + explode: true + schema: + minimum: 0 + type: integer + default: 0 + - name: x-org-id + in: header + required: false + style: simple + explode: false + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/search' + required: false + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/commandresultslist' + "401": + description: Unauthorized + content: {} + security: + - x-api-key: [] + x-scopes: + - commands + - commands.readonly + x-codeSamples: + - lang: Shell + source: "curl --request POST \\\n --url 'https://console.jumpcloud.com/api/search/commandresults?fields=&filter=SOME_STRING_VALUE&limit=10&skip=0'\ + \ \\\n --header 'content-type: application/json' \\\n --header 'x-api-key:\ + \ REPLACE_KEY_VALUE' \\\n --header 'x-org-id: ' \\\n --data '{\"fields\"\ + :\"string\",\"filter\":{},\"searchFilter\":{}}'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/search/commandresults\"\ + \n\nquerystring = {\"fields\":\"\",\"filter\":\"SOME_STRING_VALUE\",\"limit\"\ + :\"10\",\"skip\":\"0\"}\n\npayload = {\n \"fields\": \"string\",\n \ + \ \"filter\": {},\n \"searchFilter\": {}\n}\nheaders = {\n \"x-org-id\"\ + : \"\",\n \"x-api-key\": \"REPLACE_KEY_VALUE\",\n \"content-type\"\ + : \"application/json\"\n}\n\nresponse = requests.request(\"POST\", url,\ + \ json=payload, headers=headers, params=querystring)\n\nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-org-id\", \"\")\n$headers.Add(\"x-api-key\"\ + , \"REPLACE_KEY_VALUE\")\n$headers.Add(\"content-type\", \"application/json\"\ + )\n$response = Invoke-RestMethod -Uri 'https://console.jumpcloud.com/api/search/commandresults?fields=&filter=SOME_STRING_VALUE&limit=10&skip=0'\ + \ -Method POST -Headers $headers -ContentType 'application/json' -Body '{\"\ + fields\":\"string\",\"filter\":{},\"searchFilter\":{}}'" + x-codegen-request-body-name: body + /search/commands: + post: + tags: + - Search + summary: Search Commands + description: "Return Commands in multi-record format allowing for the passing\ + \ of the `filter` and `searchFilter` parameters. This WILL NOT allow you to\ + \ add a new command.\nTo support advanced filtering you can use the `filter`\ + \ and `searchFilter` parameters that can only be passed in the body of POST\ + \ /api/search/* routes. The `filter` and `searchFilter` parameters must be\ + \ passed as Content-Type application/json.\nThe `filter` parameter is an object\ + \ with a single property, either `and` or `or` with the value of the property\ + \ being an array of query expressions.\nThis allows you to filter records\ + \ using the logic of matching ALL or ANY records in the array of query expressions.\ + \ If the `and` or `or` are not included the default behavior is to match ALL\ + \ query expressions.\nThe `searchFilter` parameter allows text searching on\ + \ supported fields by specifying a `searchTerm` and a list of `fields` to\ + \ query on. If any `field` has a partial text match on the `searchTerm` the\ + \ record will be returned.\n\n#### Sample Request\nExact search for a list\ + \ of commands in a launchType\n```\ncurl -X POST https://console.jumpcloud.com/api/search/commands\ + \ \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\ + \ \\\n -H 'x-api-key: {API_KEY}' \\\n -d '{\n \"filter\" : [{\"launchType\"\ + \ : \"repeated\"}],\n \"fields\" : \"name launchType sudo\"\n}'\n```\nText\ + \ search for commands with name\n```\ncurl -X POST https://console.jumpcloud.com/api/search/commands\ + \ \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\ + \ \\\n -H 'x-api-key: {API_KEY}' \\\n -d '{\n \"searchFilter\" : {\n \ + \ \"searchTerm\": \"List\",\n \"fields\": [\"name\"]\n },\n \"fields\"\ + \ : \"name launchType sudo\"\n}'\n```\nText search for multiple commands\n\ + ```\ncurl -X POST https://console.jumpcloud.com/api/search/commands \\\n \ + \ -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\ + \ \\\n -H 'x-api-key: {API_KEY}' \\\n -d '{\n \"searchFilter\" : {\n \ + \ \"searchTerm\": [\"List\", \"Log\"],\n \"fields\": [\"name\"]\n },\n\ + \ \"fields\" : \"name launchType sudo\"\n}'\n```\nCombining `filter` and\ + \ `searchFilter` to text search for commands with name who are in a list of\ + \ launchType\n```\ncurl -X POST https://console.jumpcloud.com/api/search/commands\ + \ \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\ + \ \\\n -H 'x-api-key: {API_KEY}' \\\n -d '{\n \"searchFilter\": {\n \ + \ \"searchTerm\": \"List\",\n \"fields\": [\"name\"]\n },\n \"filter\"\ + : {\n \"or\": [\n {\"launchType\" : \"repeated\"},\n {\"launchType\"\ + \ : \"one-time\"}\n ]\n },\n \"fields\" : \"name launchType sudo\"\n\ + }'\n```" + operationId: search_commands_post + parameters: + - name: fields + in: query + description: "Use a space seperated string of field parameters to include\ + \ the data in the response. If omitted, the default list of fields will\ + \ be returned.\n" + required: false + style: form + explode: true + schema: + type: string + - name: filter + in: query + description: "A filter to apply to the query. See the supported operators\ + \ below. For more complex searches,\nsee the related `/search/`\ + \ endpoints,\ne.g. `/search/systems`.\n\n**Filter structure**: `::`.\n\ + \n**field** = Populate with a valid field from an endpoint response.\n\n\ + **operator** = Supported operators are:\n- `$eq` (equals)\n- `$ne` (does\ + \ not equal)\n- `$gt` (is greater than)\n- `$gte` (is greater than or equal\ + \ to)\n- `$lt` (is less than)\n- `$lte` (is less than or equal to)\n\n_Note:\ + \ v1 operators differ from v2 operators._\n\n_Note: For v1 operators, excluding\ + \ the `$` will result in undefined behavior._\n\n**value** = Populate with\ + \ the value you want to search for. Is case sensitive.\n\n**Examples**\n\ + - `GET /users?filter=username:$eq:testuser`\n- `GET /systemusers?filter=password_expiration_date:$lte:2021-10-24`\n\ + - `GET /systemusers?filter=department:$ne:Accounting`\n- `GET /systems?filter[0]=firstname:$eq:foo&filter[1]=lastname:$eq:bar`\ + \ - this will\n AND the filters together.\n- `GET /systems?filter[or][0]=lastname:$eq:foo&filter[or][1]=lastname:$eq:bar`\ + \ - this will\n OR the filters together." + required: false + style: form + explode: true + schema: + type: string + - name: limit + in: query + description: The number of records to return at once. Limited to 100. + required: false + style: form + explode: true + schema: + type: integer + default: 10 + - name: skip + in: query + description: The offset into the records to return. + required: false + style: form + explode: true + schema: + minimum: 0 + type: integer + default: 0 + - name: x-org-id + in: header + required: false + style: simple + explode: false + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/search' + required: false + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/commandslist' + "401": + description: Unauthorized + content: {} + security: + - x-api-key: [] + x-scopes: + - commands + - commands.readonly + x-codeSamples: + - lang: Shell + source: "curl --request POST \\\n --url 'https://console.jumpcloud.com/api/search/commands?fields=&filter=SOME_STRING_VALUE&limit=10&skip=0'\ + \ \\\n --header 'content-type: application/json' \\\n --header 'x-api-key:\ + \ REPLACE_KEY_VALUE' \\\n --header 'x-org-id: ' \\\n --data '{\"fields\"\ + :\"string\",\"filter\":{},\"searchFilter\":{}}'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/search/commands\"\ + \n\nquerystring = {\"fields\":\"\",\"filter\":\"SOME_STRING_VALUE\",\"limit\"\ + :\"10\",\"skip\":\"0\"}\n\npayload = {\n \"fields\": \"string\",\n \ + \ \"filter\": {},\n \"searchFilter\": {}\n}\nheaders = {\n \"x-org-id\"\ + : \"\",\n \"x-api-key\": \"REPLACE_KEY_VALUE\",\n \"content-type\"\ + : \"application/json\"\n}\n\nresponse = requests.request(\"POST\", url,\ + \ json=payload, headers=headers, params=querystring)\n\nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-org-id\", \"\")\n$headers.Add(\"x-api-key\"\ + , \"REPLACE_KEY_VALUE\")\n$headers.Add(\"content-type\", \"application/json\"\ + )\n$response = Invoke-RestMethod -Uri 'https://console.jumpcloud.com/api/search/commands?fields=&filter=SOME_STRING_VALUE&limit=10&skip=0'\ + \ -Method POST -Headers $headers -ContentType 'application/json' -Body '{\"\ + fields\":\"string\",\"filter\":{},\"searchFilter\":{}}'" + x-codegen-request-body-name: body + /search/organizations: + post: + tags: + - Search + summary: Search Organizations + description: "This endpoint will return Organization data based on your search\ + \ parameters. This endpoint WILL NOT allow you to add a new Organization.\n\ + \nYou can use the supported parameters and pass those in the body of request.\n\ + \nThe parameters must be passed as Content-Type application/json.\n\n\n####\ + \ Sample Request\n```\ncurl -X POST https://console.jumpcloud.com/api/search/organizations\ + \ \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\ + \ \\\n -H 'x-api-key: {API_KEY}' \\\n -d '{\n \"search\":{\n \"fields\"\ + \ : [\"settings.name\"],\n \"searchTerm\": \"Second\"\n },\n \"fields\"\ + : [\"_id\", \"displayName\", \"logoUrl\"],\n \"limit\" : 0,\n \"skip\" :\ + \ 0\n}'\n```" + operationId: search_organizations_post + parameters: + - name: fields + in: query + description: "Use a space seperated string of field parameters to include\ + \ the data in the response. If omitted, the default list of fields will\ + \ be returned.\n" + required: false + style: form + explode: true + schema: + type: string + - name: filter + in: query + description: "A filter to apply to the query. See the supported operators\ + \ below. For more complex searches,\nsee the related `/search/`\ + \ endpoints,\ne.g. `/search/systems`.\n\n**Filter structure**: `::`.\n\ + \n**field** = Populate with a valid field from an endpoint response.\n\n\ + **operator** = Supported operators are:\n- `$eq` (equals)\n- `$ne` (does\ + \ not equal)\n- `$gt` (is greater than)\n- `$gte` (is greater than or equal\ + \ to)\n- `$lt` (is less than)\n- `$lte` (is less than or equal to)\n\n_Note:\ + \ v1 operators differ from v2 operators._\n\n_Note: For v1 operators, excluding\ + \ the `$` will result in undefined behavior._\n\n**value** = Populate with\ + \ the value you want to search for. Is case sensitive.\n\n**Examples**\n\ + - `GET /users?filter=username:$eq:testuser`\n- `GET /systemusers?filter=password_expiration_date:$lte:2021-10-24`\n\ + - `GET /systemusers?filter=department:$ne:Accounting`\n- `GET /systems?filter[0]=firstname:$eq:foo&filter[1]=lastname:$eq:bar`\ + \ - this will\n AND the filters together.\n- `GET /systems?filter[or][0]=lastname:$eq:foo&filter[or][1]=lastname:$eq:bar`\ + \ - this will\n OR the filters together." + required: false + style: form + explode: true + schema: + type: string + - name: limit + in: query + description: The number of records to return at once. Limited to 100. + required: false + style: form + explode: true + schema: + type: integer + default: 10 + - name: skip + in: query + description: The offset into the records to return. + required: false + style: form + explode: true + schema: + minimum: 0 + type: integer + default: 0 + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/search' + required: false + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/organizationslist' + "401": + description: Unauthorized + content: {} + security: + - x-api-key: [] + x-scopes: + - commandrunner.legacy + - organizations + - organizations.readonly + x-codeSamples: + - lang: Shell + source: "curl --request POST \\\n --url 'https://console.jumpcloud.com/api/search/organizations?fields=&filter=SOME_STRING_VALUE&limit=10&skip=0'\ + \ \\\n --header 'content-type: application/json' \\\n --header 'x-api-key:\ + \ REPLACE_KEY_VALUE' \\\n --data '{\"fields\":\"string\",\"filter\":{},\"\ + searchFilter\":{}}'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/search/organizations\"\ + \n\nquerystring = {\"fields\":\"\",\"filter\":\"SOME_STRING_VALUE\",\"limit\"\ + :\"10\",\"skip\":\"0\"}\n\npayload = {\n \"fields\": \"string\",\n \ + \ \"filter\": {},\n \"searchFilter\": {}\n}\nheaders = {\n \"x-api-key\"\ + : \"REPLACE_KEY_VALUE\",\n \"content-type\": \"application/json\"\n}\n\ + \nresponse = requests.request(\"POST\", url, json=payload, headers=headers,\ + \ params=querystring)\n\nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n\ + $headers.Add(\"content-type\", \"application/json\")\n$response = Invoke-RestMethod\ + \ -Uri 'https://console.jumpcloud.com/api/search/organizations?fields=&filter=SOME_STRING_VALUE&limit=10&skip=0'\ + \ -Method POST -Headers $headers -ContentType 'application/json' -Body '{\"\ + fields\":\"string\",\"filter\":{},\"searchFilter\":{}}'" + x-codegen-request-body-name: body + /search/systems: + post: + tags: + - Search + summary: Search Systems + description: "Return Systems in multi-record format allowing for the passing\ + \ of the `filter` and `searchFilter` parameters. This WILL NOT allow you to\ + \ add a new system.\n\nTo support advanced filtering you can use the `filter`\ + \ and `searchFilter` parameters that can only be passed in the body of POST\ + \ /api/search/* routes. The `filter` and `searchFilter` parameters must be\ + \ passed as Content-Type application/json.\n\nThe `filter` parameter is an\ + \ object with a single property, either `and` or `or` with the value of the\ + \ property being an array of query expressions.\n\nThis allows you to filter\ + \ records using the logic of matching ALL or ANY records in the array of query\ + \ expressions. If the `and` or `or` are not included the default behavior\ + \ is to match ALL query expressions.\n\nThe `searchFilter` parameter allows\ + \ text searching on supported fields by specifying a `searchTerm` and a list\ + \ of `fields` to query on. If any `field` has a partial text match on the\ + \ `searchTerm` the record will be returned.\n\n\n#### Sample Request\n\nExact\ + \ search for a list of hostnames\n```\ncurl -X POST https://console.jumpcloud.com/api/search/systems\ + \ \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\ + \ \\\n -H 'x-api-key: {API_KEY}' \\\n -d '{\n \"filter\": {\n \"or\"\ + : [\n {\"hostname\" : \"my-hostname\"},\n {\"hostname\" : \"other-hostname\"\ + }\n ]\n },\n \"fields\" : \"os hostname displayName\"\n}'\n```\n\nText\ + \ search for a hostname or display name\n```\ncurl -X POST https://console.jumpcloud.com/api/search/systems\ + \ \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\ + \ \\\n -H 'x-api-key: {API_KEY}' \\\n -d '{\n \"searchFilter\": {\n \ + \ \"searchTerm\": \"my-host\",\n \"fields\": [\"hostname\", \"displayName\"\ + ]\n },\n \"fields\": \"os hostname displayName\"\n}'\n```\n\nText search\ + \ for a multiple hostnames.\n```\ncurl -X POST https://console.jumpcloud.com/api/search/systems\ + \ \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\ + \ \\\n -H 'x-api-key: {API_KEY}' \\\n -d '{\n \"searchFilter\": {\n \ + \ \"searchTerm\": [\"my-host\", \"my-other-host\"],\n \"fields\": [\"hostname\"\ + ]\n },\n \"fields\": \"os hostname displayName\"\n}'\n```\n\nCombining `filter`\ + \ and `searchFilter` to search for names that match a given OS\n```\ncurl\ + \ -X POST https://console.jumpcloud.com/api/search/systems \\\n -H 'Accept:\ + \ application/json' \\\n -H 'Content-Type: application/json' \\\n -H 'x-api-key:\ + \ {API_KEY}' \\\n -d '{\n \"searchFilter\": {\n \"searchTerm\": \"my-host\"\ + ,\n \"fields\": [\"hostname\", \"displayName\"]\n },\n \"filter\": {\n\ + \ \"or\": [\n {\"os\" : \"Ubuntu\"},\n {\"os\" : \"Mac OS X\"\ + }\n ]\n },\n \"fields\": \"os hostname displayName\"\n}'\n```" + operationId: search_systems_post + parameters: + - name: fields + in: query + description: "Use a space seperated string of field parameters to include\ + \ the data in the response. If omitted, the default list of fields will\ + \ be returned.\n" + required: false + style: form + explode: true + schema: + type: string + - name: limit + in: query + description: The number of records to return at once. Limited to 100. + required: false + style: form + explode: true + schema: + type: integer + default: 10 + - name: x-org-id + in: header + required: false + style: simple + explode: false + schema: + type: string + - name: skip + in: query + description: The offset into the records to return. + required: false + style: form + explode: true + schema: + minimum: 0 + type: integer + default: 0 + - name: filter + in: query + description: "A filter to apply to the query. See the supported operators\ + \ below. For more complex searches,\nsee the related `/search/`\ + \ endpoints,\ne.g. `/search/systems`.\n\n**Filter structure**: `::`.\n\ + \n**field** = Populate with a valid field from an endpoint response.\n\n\ + **operator** = Supported operators are:\n- `$eq` (equals)\n- `$ne` (does\ + \ not equal)\n- `$gt` (is greater than)\n- `$gte` (is greater than or equal\ + \ to)\n- `$lt` (is less than)\n- `$lte` (is less than or equal to)\n\n_Note:\ + \ v1 operators differ from v2 operators._\n\n_Note: For v1 operators, excluding\ + \ the `$` will result in undefined behavior._\n\n**value** = Populate with\ + \ the value you want to search for. Is case sensitive.\n\n**Examples**\n\ + - `GET /users?filter=username:$eq:testuser`\n- `GET /systemusers?filter=password_expiration_date:$lte:2021-10-24`\n\ + - `GET /systemusers?filter=department:$ne:Accounting`\n- `GET /systems?filter[0]=firstname:$eq:foo&filter[1]=lastname:$eq:bar`\ + \ - this will\n AND the filters together.\n- `GET /systems?filter[or][0]=lastname:$eq:foo&filter[or][1]=lastname:$eq:bar`\ + \ - this will\n OR the filters together." + required: false + style: form + explode: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/search' + required: false + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/systemslist' + "401": + description: Unauthorized + content: {} + security: + - x-api-key: [] + x-scopes: + - systems + - systems.readonly + - commandrunner.legacy + x-codeSamples: + - lang: Shell + source: "curl --request POST \\\n --url 'https://console.jumpcloud.com/api/search/systems?fields=&limit=10&skip=0&filter=SOME_STRING_VALUE'\ + \ \\\n --header 'content-type: application/json' \\\n --header 'x-api-key:\ + \ REPLACE_KEY_VALUE' \\\n --header 'x-org-id: ' \\\n --data '{\"fields\"\ + :\"string\",\"filter\":{},\"searchFilter\":{}}'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/search/systems\"\ + \n\nquerystring = {\"fields\":\"\",\"limit\":\"10\",\"skip\":\"0\",\"filter\"\ + :\"SOME_STRING_VALUE\"}\n\npayload = {\n \"fields\": \"string\",\n \ + \ \"filter\": {},\n \"searchFilter\": {}\n}\nheaders = {\n \"x-org-id\"\ + : \"\",\n \"x-api-key\": \"REPLACE_KEY_VALUE\",\n \"content-type\"\ + : \"application/json\"\n}\n\nresponse = requests.request(\"POST\", url,\ + \ json=payload, headers=headers, params=querystring)\n\nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-org-id\", \"\")\n$headers.Add(\"x-api-key\"\ + , \"REPLACE_KEY_VALUE\")\n$headers.Add(\"content-type\", \"application/json\"\ + )\n$response = Invoke-RestMethod -Uri 'https://console.jumpcloud.com/api/search/systems?fields=&limit=10&skip=0&filter=SOME_STRING_VALUE'\ + \ -Method POST -Headers $headers -ContentType 'application/json' -Body '{\"\ + fields\":\"string\",\"filter\":{},\"searchFilter\":{}}'" + x-codegen-request-body-name: body + /search/systemusers: + post: + tags: + - Search + summary: Search System Users + description: "Return System Users in multi-record format allowing for the passing\ + \ of the `filter` and `searchFilter` parameters. This WILL NOT allow you to\ + \ add a new system user.\n\nTo support advanced filtering you can use the\ + \ `filter` and `searchFilter` parameters that can only be passed in the body\ + \ of POST /api/search/* routes. The `filter` and `searchFilter` parameters\ + \ must be passed as Content-Type application/json.\n\nThe `filter` parameter\ + \ is an object with a single property, either `and` or `or` with the value\ + \ of the property being an array of query expressions.\n\nThis allows you\ + \ to filter records using the logic of matching ALL or ANY records in the\ + \ array of query expressions. If the `and` or `or` are not included the default\ + \ behavior is to match ALL query expressions.\n\nThe `searchFilter` parameter\ + \ allows text searching on supported fields by specifying a `searchTerm` and\ + \ a list of `fields` to query on. If any `field` has a partial text match\ + \ on the `searchTerm` the record will be returned.\n\n\n#### Sample Request\n\ + \nExact search for a list of system users in a department\n```\ncurl -X POST\ + \ https://console.jumpcloud.com/api/search/systemusers \\\n -H 'Accept: application/json'\ + \ \\\n -H 'Content-Type: application/json' \\\n -H 'x-api-key: {API_KEY}'\ + \ \\\n -d '{\n \"filter\" : [{\"department\" : \"IT\"}],\n \"fields\" :\ + \ \"email username sudo\"\n}'\n```\n\nText search for system users with and\ + \ email on a domain\n```\ncurl -X POST https://console.jumpcloud.com/api/search/systemusers\ + \ \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\ + \ \\\n -H 'x-api-key: {API_KEY}' \\\n -d '{\n \"searchFilter\" : {\n \ + \ \"searchTerm\": \"@jumpcloud.com\",\n \"fields\": [\"email\"]\n },\n\ + \ \"fields\" : \"email username sudo\"\n}'\n```\n\nText search for multiple\ + \ system users\n```\ncurl -X POST https://console.jumpcloud.com/api/search/systemusers\ + \ \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\ + \ \\\n -H 'x-api-key: {API_KEY}' \\\n -d '{\n \"searchFilter\" : {\n \ + \ \"searchTerm\": [\"john\", \"sarah\"],\n \"fields\": [\"username\"]\n\ + \ },\n \"fields\" : \"email username sudo\"\n}'\n```\n\nCombining `filter`\ + \ and `searchFilter` to text search for system users with and email on a domain\ + \ who are in a list of departments\n```\ncurl -X POST https://console.jumpcloud.com/api/search/systemusers\ + \ \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\ + \ \\\n -H 'x-api-key: {API_KEY}' \\\n -d '{\n \"searchFilter\": {\n \ + \ \"searchTerm\": \"@jumpcloud.com\",\n \"fields\": [\"email\"]\n },\n\ + \ \"filter\": {\n \"or\": [\n {\"department\" : \"IT\"},\n {\"\ + department\" : \"Sales\"}\n ]\n },\n \"fields\" : \"email username sudo\"\ + \n}'\n```" + operationId: search_systemusers_post + parameters: + - name: fields + in: query + description: "Use a space seperated string of field parameters to include\ + \ the data in the response. If omitted, the default list of fields will\ + \ be returned.\n" + required: false + style: form + explode: true + schema: + type: string + - name: filter + in: query + description: "A filter to apply to the query. See the supported operators\ + \ below. For more complex searches,\nsee the related `/search/`\ + \ endpoints,\ne.g. `/search/systems`.\n\n**Filter structure**: `::`.\n\ + \n**field** = Populate with a valid field from an endpoint response.\n\n\ + **operator** = Supported operators are:\n- `$eq` (equals)\n- `$ne` (does\ + \ not equal)\n- `$gt` (is greater than)\n- `$gte` (is greater than or equal\ + \ to)\n- `$lt` (is less than)\n- `$lte` (is less than or equal to)\n\n_Note:\ + \ v1 operators differ from v2 operators._\n\n_Note: For v1 operators, excluding\ + \ the `$` will result in undefined behavior._\n\n**value** = Populate with\ + \ the value you want to search for. Is case sensitive.\n\n**Examples**\n\ + - `GET /users?filter=username:$eq:testuser`\n- `GET /systemusers?filter=password_expiration_date:$lte:2021-10-24`\n\ + - `GET /systemusers?filter=department:$ne:Accounting`\n- `GET /systems?filter[0]=firstname:$eq:foo&filter[1]=lastname:$eq:bar`\ + \ - this will\n AND the filters together.\n- `GET /systems?filter[or][0]=lastname:$eq:foo&filter[or][1]=lastname:$eq:bar`\ + \ - this will\n OR the filters together." + required: false + style: form + explode: true + schema: + type: string + - name: limit + in: query + description: The number of records to return at once. Limited to 100. + required: false + style: form + explode: true + schema: + type: integer + default: 10 + - name: skip + in: query + description: The offset into the records to return. + required: false + style: form + explode: true + schema: + minimum: 0 + type: integer + default: 0 + - name: x-org-id + in: header + required: false + style: simple + explode: false + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/search' + required: false + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/systemuserslist' + "401": + description: Unauthorized + content: {} + security: + - x-api-key: [] + x-scopes: + - users + - users.readonly + x-codeSamples: + - lang: Shell + source: "curl --request POST \\\n --url 'https://console.jumpcloud.com/api/search/systemusers?fields=&filter=SOME_STRING_VALUE&limit=10&skip=0'\ + \ \\\n --header 'content-type: application/json' \\\n --header 'x-api-key:\ + \ REPLACE_KEY_VALUE' \\\n --header 'x-org-id: ' \\\n --data '{\"fields\"\ + :\"string\",\"filter\":{},\"searchFilter\":{}}'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/search/systemusers\"\ + \n\nquerystring = {\"fields\":\"\",\"filter\":\"SOME_STRING_VALUE\",\"limit\"\ + :\"10\",\"skip\":\"0\"}\n\npayload = {\n \"fields\": \"string\",\n \ + \ \"filter\": {},\n \"searchFilter\": {}\n}\nheaders = {\n \"x-org-id\"\ + : \"\",\n \"x-api-key\": \"REPLACE_KEY_VALUE\",\n \"content-type\"\ + : \"application/json\"\n}\n\nresponse = requests.request(\"POST\", url,\ + \ json=payload, headers=headers, params=querystring)\n\nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-org-id\", \"\")\n$headers.Add(\"x-api-key\"\ + , \"REPLACE_KEY_VALUE\")\n$headers.Add(\"content-type\", \"application/json\"\ + )\n$response = Invoke-RestMethod -Uri 'https://console.jumpcloud.com/api/search/systemusers?fields=&filter=SOME_STRING_VALUE&limit=10&skip=0'\ + \ -Method POST -Headers $headers -ContentType 'application/json' -Body '{\"\ + fields\":\"string\",\"filter\":{},\"searchFilter\":{}}'" + x-codegen-request-body-name: body + /systems: + get: + tags: + - Systems + summary: List All Systems + description: "This endpoint returns all Systems.\n\n#### Sample Requests\n```\n\ + curl -X GET https://console.jumpcloud.com/api/systems \\\n -H 'Accept: application/json'\ + \ \\\n -H 'Content-Type: application/json' \\\n -H 'x-api-key: {API_KEY}'\n\ + \n```" + operationId: systems_list + parameters: + - name: fields + in: query + description: "Use a space seperated string of field parameters to include\ + \ the data in the response. If omitted, the default list of fields will\ + \ be returned.\n" + required: false + style: form + explode: true + schema: + type: string + - name: limit + in: query + description: The number of records to return at once. Limited to 100. + required: false + style: form + explode: true + schema: + type: integer + default: 10 + - name: x-org-id + in: header + required: false + style: simple + explode: false + schema: + type: string + - name: search + in: query + description: A nested object containing a `searchTerm` string or array of + strings and a list of `fields` to search on. + required: false + style: form + explode: true + schema: + type: string + - name: skip + in: query + description: The offset into the records to return. + required: false + style: form + explode: true + schema: + minimum: 0 + type: integer + default: 0 + - name: sort + in: query + description: | + Use space separated sort parameters to sort the collection. + Default sort is ascending. Prefix with `-` to sort descending. + required: false + style: form + explode: true + schema: + type: string + - name: filter + in: query + description: "A filter to apply to the query. See the supported operators\ + \ below. For more complex searches,\nsee the related `/search/`\ + \ endpoints,\ne.g. `/search/systems`.\n\n**Filter structure**: `::`.\n\ + \n**field** = Populate with a valid field from an endpoint response.\n\n\ + **operator** = Supported operators are:\n- `$eq` (equals)\n- `$ne` (does\ + \ not equal)\n- `$gt` (is greater than)\n- `$gte` (is greater than or equal\ + \ to)\n- `$lt` (is less than)\n- `$lte` (is less than or equal to)\n\n_Note:\ + \ v1 operators differ from v2 operators._\n\n_Note: For v1 operators, excluding\ + \ the `$` will result in undefined behavior._\n\n**value** = Populate with\ + \ the value you want to search for. Is case sensitive.\n\n**Examples**\n\ + - `GET /users?filter=username:$eq:testuser`\n- `GET /systemusers?filter=password_expiration_date:$lte:2021-10-24`\n\ + - `GET /systemusers?filter=department:$ne:Accounting`\n- `GET /systems?filter[0]=firstname:$eq:foo&filter[1]=lastname:$eq:bar`\ + \ - this will\n AND the filters together.\n- `GET /systems?filter[or][0]=lastname:$eq:foo&filter[or][1]=lastname:$eq:bar`\ + \ - this will\n OR the filters together." + required: false + style: form + explode: true + schema: + type: string + responses: + "200": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/systemslist' + security: + - x-api-key: [] + x-scopes: + - systems + - systems.readonly + x-codeSamples: + - lang: Shell + source: "curl --request GET \\\n --url 'https://console.jumpcloud.com/api/systems?fields=&limit=10&search=SOME_STRING_VALUE&skip=0&sort=&filter=SOME_STRING_VALUE'\ + \ \\\n --header 'x-api-key: REPLACE_KEY_VALUE' \\\n --header 'x-org-id:\ + \ '" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/systems\"\ + \n\nquerystring = {\"fields\":\"\",\"limit\":\"10\",\"search\":\"SOME_STRING_VALUE\"\ + ,\"skip\":\"0\",\"sort\":\"\",\"filter\":\"SOME_STRING_VALUE\"}\n\nheaders\ + \ = {\n \"x-org-id\": \"\",\n \"x-api-key\": \"REPLACE_KEY_VALUE\"\ + \n}\n\nresponse = requests.request(\"GET\", url, headers=headers, params=querystring)\n\ + \nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-org-id\", \"\")\n$headers.Add(\"x-api-key\"\ + , \"REPLACE_KEY_VALUE\")\n$response = Invoke-RestMethod -Uri 'https://console.jumpcloud.com/api/systems?fields=&limit=10&search=SOME_STRING_VALUE&skip=0&sort=&filter=SOME_STRING_VALUE'\ + \ -Method GET -Headers $headers" + /systems/{id}: + get: + tags: + - Systems + summary: List an individual system + description: "This endpoint returns an individual system.\n\n#### Sample Request\n\ + ```\ncurl -X GET https://console.jumpcloud.com/api/systems/{SystemID} \\\n\ + \ -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\ + \ \\\n -H 'x-api-key: {API_KEY}'\n ```" + operationId: systems_get + parameters: + - name: id + in: path + required: true + style: simple + explode: false + schema: + type: string + - name: fields + in: query + description: "Use a space seperated string of field parameters to include\ + \ the data in the response. If omitted, the default list of fields will\ + \ be returned.\n" + required: false + style: form + explode: true + schema: + type: string + - name: filter + in: query + description: "A filter to apply to the query. See the supported operators\ + \ below. For more complex searches,\nsee the related `/search/`\ + \ endpoints,\ne.g. `/search/systems`.\n\n**Filter structure**: `::`.\n\ + \n**field** = Populate with a valid field from an endpoint response.\n\n\ + **operator** = Supported operators are:\n- `$eq` (equals)\n- `$ne` (does\ + \ not equal)\n- `$gt` (is greater than)\n- `$gte` (is greater than or equal\ + \ to)\n- `$lt` (is less than)\n- `$lte` (is less than or equal to)\n\n_Note:\ + \ v1 operators differ from v2 operators._\n\n_Note: For v1 operators, excluding\ + \ the `$` will result in undefined behavior._\n\n**value** = Populate with\ + \ the value you want to search for. Is case sensitive.\n\n**Examples**\n\ + - `GET /users?filter=username:$eq:testuser`\n- `GET /systemusers?filter=password_expiration_date:$lte:2021-10-24`\n\ + - `GET /systemusers?filter=department:$ne:Accounting`\n- `GET /systems?filter[0]=firstname:$eq:foo&filter[1]=lastname:$eq:bar`\ + \ - this will\n AND the filters together.\n- `GET /systems?filter[or][0]=lastname:$eq:foo&filter[or][1]=lastname:$eq:bar`\ + \ - this will\n OR the filters together." + required: false + style: form + explode: true + schema: + type: string + - name: Date + in: header + description: Current date header for the System Context API + required: false + style: simple + explode: false + schema: + type: string + - name: Authorization + in: header + description: Authorization header for the System Context API + required: false + style: simple + explode: false + schema: + type: string + - name: x-org-id + in: header + required: false + style: simple + explode: false + schema: + type: string + responses: + "200": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/system' + security: + - x-api-key: [] + x-scopes: + - systems + - systems.readonly + - systems.self + x-codeSamples: + - lang: Shell + source: "curl --request GET \\\n --url 'https://console.jumpcloud.com/api/systems/{id}?fields=&filter=SOME_STRING_VALUE'\ + \ \\\n --header 'Authorization: SOME_STRING_VALUE' \\\n --header 'Date:\ + \ SOME_STRING_VALUE' \\\n --header 'x-api-key: REPLACE_KEY_VALUE' \\\n\ + \ --header 'x-org-id: '" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/systems/{id}\"\ + \n\nquerystring = {\"fields\":\"\",\"filter\":\"SOME_STRING_VALUE\"}\n\n\ + headers = {\n \"Date\": \"SOME_STRING_VALUE\",\n \"Authorization\"\ + : \"SOME_STRING_VALUE\",\n \"x-org-id\": \"\",\n \"x-api-key\": \"\ + REPLACE_KEY_VALUE\"\n}\n\nresponse = requests.request(\"GET\", url, headers=headers,\ + \ params=querystring)\n\nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"Date\", \"SOME_STRING_VALUE\")\n$headers.Add(\"\ + Authorization\", \"SOME_STRING_VALUE\")\n$headers.Add(\"x-org-id\", \"\"\ + )\n$headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n$response = Invoke-RestMethod\ + \ -Uri 'https://console.jumpcloud.com/api/systems/{id}?fields=&filter=SOME_STRING_VALUE'\ + \ -Method GET -Headers $headers" + put: + tags: + - Systems + summary: Update a system + description: "This endpoint allows you to update a system.\n\n#### Sample Request\ + \ \n```\ncurl -X PUT https://console.jumpcloud.com/api/systems/{SystemID}\ + \ \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\ + \ \\\n -H 'x-api-key: {API_KEY}' \\\n -d '{\n\t\"displayName\":\"Name_Update\"\ + ,\n\t\"allowSshPasswordAuthentication\":\"true\",\n\t\"allowSshRootLogin\"\ + :\"true\",\n\t\"allowMultiFactorAuthentication\":\"true\",\n\t\"allowPublicKeyAuthentication\"\ + :\"false\"\n}'\n```" + operationId: systems_put + parameters: + - name: id + in: path + required: true + style: simple + explode: false + schema: + type: string + - name: Date + in: header + description: Current date header for the System Context API + required: false + style: simple + explode: false + schema: + type: string + - name: Authorization + in: header + description: Authorization header for the System Context API + required: false + style: simple + explode: false + schema: + type: string + - name: x-org-id + in: header + required: false + style: simple + explode: false + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/systemput' + required: false + responses: + "200": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/system' + security: + - x-api-key: [] + x-scopes: + - systems + - systems.self + x-codeSamples: + - lang: Shell + source: "curl --request PUT \\\n --url https://console.jumpcloud.com/api/systems/{id}\ + \ \\\n --header 'Authorization: SOME_STRING_VALUE' \\\n --header 'Date:\ + \ SOME_STRING_VALUE' \\\n --header 'content-type: application/json' \\\n\ + \ --header 'x-api-key: REPLACE_KEY_VALUE' \\\n --header 'x-org-id: ' \\\ + \n --data '{\"agentBoundMessages\":[{\"cmd\":\"string\"}],\"allowMultiFactorAuthentication\"\ + :true,\"allowPublicKeyAuthentication\":true,\"allowSshPasswordAuthentication\"\ + :true,\"allowSshRootLogin\":true,\"displayName\":\"string\",\"tags\":[\"\ + string\"]}'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/systems/{id}\"\ + \n\npayload = {\n \"agentBoundMessages\": [{\"cmd\": \"string\"}],\n\ + \ \"allowMultiFactorAuthentication\": True,\n \"allowPublicKeyAuthentication\"\ + : True,\n \"allowSshPasswordAuthentication\": True,\n \"allowSshRootLogin\"\ + : True,\n \"displayName\": \"string\",\n \"tags\": [\"string\"]\n\ + }\nheaders = {\n \"Date\": \"SOME_STRING_VALUE\",\n \"Authorization\"\ + : \"SOME_STRING_VALUE\",\n \"x-org-id\": \"\",\n \"x-api-key\": \"\ + REPLACE_KEY_VALUE\",\n \"content-type\": \"application/json\"\n}\n\n\ + response = requests.request(\"PUT\", url, json=payload, headers=headers)\n\ + \nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"Date\", \"SOME_STRING_VALUE\")\n$headers.Add(\"\ + Authorization\", \"SOME_STRING_VALUE\")\n$headers.Add(\"x-org-id\", \"\"\ + )\n$headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n$headers.Add(\"content-type\"\ + , \"application/json\")\n$response = Invoke-RestMethod -Uri 'https://console.jumpcloud.com/api/systems/{id}'\ + \ -Method PUT -Headers $headers -ContentType 'application/json' -Body '{\"\ + agentBoundMessages\":[{\"cmd\":\"string\"}],\"allowMultiFactorAuthentication\"\ + :true,\"allowPublicKeyAuthentication\":true,\"allowSshPasswordAuthentication\"\ + :true,\"allowSshRootLogin\":true,\"displayName\":\"string\",\"tags\":[\"\ + string\"]}'" + x-codegen-request-body-name: body + delete: + tags: + - Systems + summary: Delete a System + description: "This endpoint allows you to delete a system. This command will\ + \ cause the system to uninstall the JumpCloud agent from its self which can\ + \ can take about a minute. If the system is not connected to JumpCloud the\ + \ system record will simply be removed.\n\n#### Sample Request\n```\ncurl\ + \ -X DELETE https://console.jumpcloud.com/api/systems/{SystemID} \\\n -H\ + \ 'Accept: application/json' \\\n -H 'Content-Type: application/json' \\\n\ + \ -H 'x-api-key: {API_KEY}'\n ```" + operationId: systems_delete + parameters: + - name: id + in: path + required: true + style: simple + explode: false + schema: + type: string + - name: Date + in: header + description: Current date header for the System Context API + required: false + style: simple + explode: false + schema: + type: string + - name: Authorization + in: header + description: Authorization header for the System Context API + required: false + style: simple + explode: false + schema: + type: string + - name: x-org-id + in: header + required: false + style: simple + explode: false + schema: + type: string + responses: + "200": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/system' + security: + - x-api-key: [] + x-scopes: + - systems + - systems.self + x-codeSamples: + - lang: Shell + source: "curl --request DELETE \\\n --url https://console.jumpcloud.com/api/systems/{id}\ + \ \\\n --header 'Authorization: SOME_STRING_VALUE' \\\n --header 'Date:\ + \ SOME_STRING_VALUE' \\\n --header 'x-api-key: REPLACE_KEY_VALUE' \\\n\ + \ --header 'x-org-id: '" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/systems/{id}\"\ + \n\nheaders = {\n \"Date\": \"SOME_STRING_VALUE\",\n \"Authorization\"\ + : \"SOME_STRING_VALUE\",\n \"x-org-id\": \"\",\n \"x-api-key\": \"\ + REPLACE_KEY_VALUE\"\n}\n\nresponse = requests.request(\"DELETE\", url, headers=headers)\n\ + \nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"Date\", \"SOME_STRING_VALUE\")\n$headers.Add(\"\ + Authorization\", \"SOME_STRING_VALUE\")\n$headers.Add(\"x-org-id\", \"\"\ + )\n$headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n$response = Invoke-RestMethod\ + \ -Uri 'https://console.jumpcloud.com/api/systems/{id}' -Method DELETE -Headers\ + \ $headers" + /systems/{system_id}/command/builtin/erase: + post: + tags: + - Systems + summary: Erase a System + description: "This endpoint allows you to run the erase command on the specified\ + \ device. If a device is offline, the command will be run when the device\ + \ becomes available.\n\n#### Sample Request\n```\ncurl -X POST \\\n https://console.jumpcloud.com/api/systems/{system_id}/command/builtin/erase\ + \ \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\ + \ \\\n -H 'x-api-key: {API_KEY}' \\\n -d {}\n```" + operationId: systems_commandBuiltinErase + parameters: + - name: system_id + in: path + required: true + style: simple + explode: false + schema: + type: string + - name: x-org-id + in: header + required: false + style: simple + explode: false + schema: + type: string + responses: + "201": + description: Command created + content: {} + "400": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "401": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "403": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "404": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "409": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "500": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + security: + - x-api-key: [] + x-scopes: + - systems + x-codeSamples: + - lang: Shell + source: "curl --request POST \\\n --url https://console.jumpcloud.com/api/systems/{system_id}/command/builtin/erase\ + \ \\\n --header 'x-api-key: REPLACE_KEY_VALUE' \\\n --header 'x-org-id:\ + \ '" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/systems/{system_id}/command/builtin/erase\"\ + \n\nheaders = {\n \"x-org-id\": \"\",\n \"x-api-key\": \"REPLACE_KEY_VALUE\"\ + \n}\n\nresponse = requests.request(\"POST\", url, headers=headers)\n\nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-org-id\", \"\")\n$headers.Add(\"x-api-key\"\ + , \"REPLACE_KEY_VALUE\")\n$response = Invoke-RestMethod -Uri 'https://console.jumpcloud.com/api/systems/{system_id}/command/builtin/erase'\ + \ -Method POST -Headers $headers" + /systems/{system_id}/command/builtin/lock: + post: + tags: + - Systems + summary: Lock a System + description: "This endpoint allows you to run the lock command on the specified\ + \ device. If a device is offline, the command will be run when the device\ + \ becomes available.\n\n#### Sample Request\n```\ncurl -X POST \\\n https://console.jumpcloud.com/api/systems/{system_id}/command/builtin/lock\ + \ \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\ + \ \\\n -H 'x-api-key: {API_KEY}' \\\n -d {}\n```" + operationId: systems_commandBuiltinLock + parameters: + - name: system_id + in: path + required: true + style: simple + explode: false + schema: + type: string + - name: x-org-id + in: header + required: false + style: simple + explode: false + schema: + type: string + responses: + "201": + description: Command created + content: {} + "400": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "401": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "403": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "404": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "409": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "500": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + security: + - x-api-key: [] + x-scopes: + - systems + x-codeSamples: + - lang: Shell + source: "curl --request POST \\\n --url https://console.jumpcloud.com/api/systems/{system_id}/command/builtin/lock\ + \ \\\n --header 'x-api-key: REPLACE_KEY_VALUE' \\\n --header 'x-org-id:\ + \ '" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/systems/{system_id}/command/builtin/lock\"\ + \n\nheaders = {\n \"x-org-id\": \"\",\n \"x-api-key\": \"REPLACE_KEY_VALUE\"\ + \n}\n\nresponse = requests.request(\"POST\", url, headers=headers)\n\nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-org-id\", \"\")\n$headers.Add(\"x-api-key\"\ + , \"REPLACE_KEY_VALUE\")\n$response = Invoke-RestMethod -Uri 'https://console.jumpcloud.com/api/systems/{system_id}/command/builtin/lock'\ + \ -Method POST -Headers $headers" + /systems/{system_id}/command/builtin/restart: + post: + tags: + - Systems + summary: Restart a System + description: "This endpoint allows you to run the restart command on the specified\ + \ device. If a device is offline, the command will be run when the device\ + \ becomes available.\n\n#### Sample Request\n```\ncurl -X POST \\\n https://console.jumpcloud.com/api/systems/{system_id}/command/builtin/restart\ + \ \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\ + \ \\\n -H 'x-api-key: {API_KEY}' \\\n -d {}\n```" + operationId: systems_commandBuiltinRestart + parameters: + - name: system_id + in: path + required: true + style: simple + explode: false + schema: + type: string + - name: x-org-id + in: header + required: false + style: simple + explode: false + schema: + type: string + responses: + "201": + description: Command created + content: {} + "400": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "401": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "403": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "404": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "409": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "500": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + security: + - x-api-key: [] + x-scopes: + - systems + x-codeSamples: + - lang: Shell + source: "curl --request POST \\\n --url https://console.jumpcloud.com/api/systems/{system_id}/command/builtin/restart\ + \ \\\n --header 'x-api-key: REPLACE_KEY_VALUE' \\\n --header 'x-org-id:\ + \ '" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/systems/{system_id}/command/builtin/restart\"\ + \n\nheaders = {\n \"x-org-id\": \"\",\n \"x-api-key\": \"REPLACE_KEY_VALUE\"\ + \n}\n\nresponse = requests.request(\"POST\", url, headers=headers)\n\nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-org-id\", \"\")\n$headers.Add(\"x-api-key\"\ + , \"REPLACE_KEY_VALUE\")\n$response = Invoke-RestMethod -Uri 'https://console.jumpcloud.com/api/systems/{system_id}/command/builtin/restart'\ + \ -Method POST -Headers $headers" + /systems/{system_id}/command/builtin/shutdown: + post: + tags: + - Systems + summary: Shutdown a System + description: "This endpoint allows you to run the shutdown command on the specified\ + \ device. If a device is offline, the command will be run when the device\ + \ becomes available.\n\n#### Sample Request\n```\ncurl -X POST \\\n https://console.jumpcloud.com/api/systems/{system_id}/command/builtin/shutdown\ + \ \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\ + \ \\\n -H 'x-api-key: {API_KEY}' \\\n -d {}\n```" + operationId: systems_commandBuiltinShutdown + parameters: + - name: system_id + in: path + required: true + style: simple + explode: false + schema: + type: string + - name: x-org-id + in: header + required: false + style: simple + explode: false + schema: + type: string + responses: + "201": + description: Command created + content: {} + "400": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "401": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "403": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "404": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "409": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "500": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + security: + - x-api-key: [] + x-scopes: + - systems + x-codeSamples: + - lang: Shell + source: "curl --request POST \\\n --url https://console.jumpcloud.com/api/systems/{system_id}/command/builtin/shutdown\ + \ \\\n --header 'x-api-key: REPLACE_KEY_VALUE' \\\n --header 'x-org-id:\ + \ '" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/systems/{system_id}/command/builtin/shutdown\"\ + \n\nheaders = {\n \"x-org-id\": \"\",\n \"x-api-key\": \"REPLACE_KEY_VALUE\"\ + \n}\n\nresponse = requests.request(\"POST\", url, headers=headers)\n\nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-org-id\", \"\")\n$headers.Add(\"x-api-key\"\ + , \"REPLACE_KEY_VALUE\")\n$response = Invoke-RestMethod -Uri 'https://console.jumpcloud.com/api/systems/{system_id}/command/builtin/shutdown'\ + \ -Method POST -Headers $headers" + /systemusers: + get: + tags: + - Systemusers + summary: List all system users + description: "This endpoint returns all systemusers.\n\n#### Sample Request\n\ + \n```\ncurl -X GET https://console.jumpcloud.com/api/systemusers \\\n -H\ + \ 'Accept: application/json' \\\n -H 'Content-Type: application/json' \\\n\ + \ -H 'x-api-key: {API_KEY}'\n```" + operationId: systemusers_list + parameters: + - name: limit + in: query + description: The number of records to return at once. + required: false + style: form + explode: true + schema: + type: integer + default: 10 + - name: skip + in: query + description: The offset into the records to return. + required: false + style: form + explode: true + schema: + type: integer + default: 0 + - name: sort + in: query + description: "The space separated fields used to sort the collection.\nDefault\ + \ sort is ascending, prefix with `-` to sort descending.\n" + required: false + style: form + explode: true + schema: + type: string + - name: fields + in: query + description: | + The space separated fields included in the returned records. + If omitted the default list of fields will be returned. + required: false + style: form + explode: true + schema: + type: string + - name: filter + in: query + description: "A filter to apply to the query. See the supported operators\ + \ below. For more complex searches,\nsee the related `/search/`\ + \ endpoints,\ne.g. `/search/systems`.\n\n**Filter structure**: `::`.\n\ + \n**field** = Populate with a valid field from an endpoint response.\n\n\ + **operator** = Supported operators are:\n- `$eq` (equals)\n- `$ne` (does\ + \ not equal)\n- `$gt` (is greater than)\n- `$gte` (is greater than or equal\ + \ to)\n- `$lt` (is less than)\n- `$lte` (is less than or equal to)\n\n_Note:\ + \ v1 operators differ from v2 operators._\n\n_Note: For v1 operators, excluding\ + \ the `$` will result in undefined behavior._\n\n**value** = Populate with\ + \ the value you want to search for. Is case sensitive.\n\n**Examples**\n\ + - `GET /users?filter=username:$eq:testuser`\n- `GET /systemusers?filter=password_expiration_date:$lte:2021-10-24`\n\ + - `GET /systemusers?filter=department:$ne:Accounting`\n- `GET /systems?filter[0]=firstname:$eq:foo&filter[1]=lastname:$eq:bar`\ + \ - this will\n AND the filters together.\n- `GET /systems?filter[or][0]=lastname:$eq:foo&filter[or][1]=lastname:$eq:bar`\ + \ - this will\n OR the filters together." + required: false + style: form + explode: true + schema: + type: string + - name: x-org-id + in: header + required: false + style: simple + explode: false + schema: + type: string + - name: search + in: query + description: A nested object containing a `searchTerm` string or array of + strings and a list of `fields` to search on. + required: false + style: form + explode: true + schema: + type: string + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/systemuserslist' + "401": + description: "" + content: {} + security: + - x-api-key: [] + x-scopes: + - commandrunner.legacy + - users + - users.readonly + x-codeSamples: + - lang: Shell + source: "curl --request GET \\\n --url 'https://console.jumpcloud.com/api/systemusers?limit=10&skip=0&sort=&fields=&filter=SOME_STRING_VALUE&search=SOME_STRING_VALUE'\ + \ \\\n --header 'x-api-key: REPLACE_KEY_VALUE' \\\n --header 'x-org-id:\ + \ '" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/systemusers\"\ + \n\nquerystring = {\"limit\":\"10\",\"skip\":\"0\",\"sort\":\"\",\"fields\"\ + :\"\",\"filter\":\"SOME_STRING_VALUE\",\"search\":\"SOME_STRING_VALUE\"\ + }\n\nheaders = {\n \"x-org-id\": \"\",\n \"x-api-key\": \"REPLACE_KEY_VALUE\"\ + \n}\n\nresponse = requests.request(\"GET\", url, headers=headers, params=querystring)\n\ + \nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-org-id\", \"\")\n$headers.Add(\"x-api-key\"\ + , \"REPLACE_KEY_VALUE\")\n$response = Invoke-RestMethod -Uri 'https://console.jumpcloud.com/api/systemusers?limit=10&skip=0&sort=&fields=&filter=SOME_STRING_VALUE&search=SOME_STRING_VALUE'\ + \ -Method GET -Headers $headers" + post: + tags: + - Systemusers + summary: Create a system user + description: "\"This endpoint allows you to create a new system user.\n\n####\ + \ Default User State\nThe `state` of the user can be explicitly passed in\ + \ or omitted. If\n`state` is omitted from the request, then the user will\ + \ get created\nusing the value returned from the\n[Get an Organization](https://docs.jumpcloud.com/api/1.0/index.html#operation/organizations_get)\n\ + endpoint. The default user state for manually created users is stored in\n\ + `settings.newSystemUserStateDefaults.manualEntry`\n\nThese default state values\ + \ can be changed in the admin portal settings\nor by using the\n[Update an\ + \ Organization](https://docs.jumpcloud.com/api/1.0/index.html#operation/organization_put)\n\ + endpoint.\n\n#### Sample Request\n\n```\ncurl -X POST https://console.jumpcloud.com/api/systemusers\ + \ \\\n-H 'Accept: application/json' \\\n-H 'Content-Type: application/json'\ + \ \\\n-H 'x-api-key: {API_KEY}' \\\n-d '{\n \"username\":\"{username}\"\ + ,\n \"email\":\"{email_address}\",\n \"firstname\":\"{Name}\",\n\ + \ \"lastname\":\"{Name}\"\n }'\n```" + operationId: systemusers_post + parameters: + - name: x-org-id + in: header + required: false + style: simple + explode: false + schema: + type: string + - name: fullValidationDetails + in: query + description: "Pass this query parameter when a client wants all validation\ + \ errors\nto be returned with a detailed error response for the form field\n\ + specified. The current form fields are allowed:\n\n* `password`\n\n####\ + \ Password validation flag\nUse the `password` validation flag to receive\ + \ details on a possible\nbad request response\n```\n?fullValidationDetails=password\n\ + ```\nWithout the flag, default behavior will be a normal 400 with only\n\ + a single validation string error\n#### Expected Behavior\nClients can expect\ + \ a list of validation error mappings for the\nvalidation query field in\ + \ the details provided on the response:\n```\n{\n \"code\": 400,\n \"\ + message\": \"Password validation fail\",\n \"status\": \"INVALID_ARGUMENT\"\ + ,\n \"details\": [\n {\n \"fieldViolationsList\": [\n \ + \ {\"field\": \"password\", \"description\": \"specialCharacter\"}\n\ + \ ],\n '@type': 'type.googleapis.com/google.rpc.BadRequest',\n\ + \ },\n ],\n},\n```" + required: false + style: form + explode: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/systemuserputpost' + required: false + responses: + "200": + description: User added successfully + content: + application/json: + schema: + $ref: '#/components/schemas/systemuserreturn' + "400": + description: User already exists or Bad Request + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorDetails' + "401": + description: Unauthorized + content: {} + security: + - x-api-key: [] + x-scopes: + - users + x-codeSamples: + - lang: Shell + source: "curl --request POST \\\n --url 'https://console.jumpcloud.com/api/systemusers?fullValidationDetails=SOME_STRING_VALUE'\ + \ \\\n --header 'content-type: application/json' \\\n --header 'x-api-key:\ + \ REPLACE_KEY_VALUE' \\\n --header 'x-org-id: ' \\\n --data '{\"account_locked\"\ + :true,\"activated\":true,\"addresses\":[{\"country\":\"string\",\"extendedAddress\"\ + :\"string\",\"locality\":\"string\",\"poBox\":\"string\",\"postalCode\"\ + :\"string\",\"region\":\"string\",\"streetAddress\":\"string\",\"type\"\ + :\"string\"}],\"allow_public_key\":true,\"alternateEmail\":\"string\",\"\ + attributes\":[{\"name\":\"string\",\"value\":\"string\"}],\"company\":\"\ + string\",\"costCenter\":\"string\",\"department\":\"string\",\"description\"\ + :\"string\",\"disableDeviceMaxLoginAttempts\":true,\"displayname\":\"string\"\ + ,\"email\":\"string\",\"employeeIdentifier\":\"string\",\"employeeType\"\ + :\"string\",\"enable_managed_uid\":true,\"enable_user_portal_multifactor\"\ + :true,\"external_dn\":\"string\",\"external_password_expiration_date\":\"\ + 2019-08-24T14:15:22Z\",\"external_source_type\":\"string\",\"externally_managed\"\ + :true,\"firstname\":\"string\",\"jobTitle\":\"string\",\"lastname\":\"string\"\ + ,\"ldap_binding_user\":true,\"location\":\"string\",\"managedAppleId\":\"\ + string\",\"manager\":\"string\",\"mfa\":{\"configured\":true,\"exclusion\"\ + :true,\"exclusionDays\":1,\"exclusionUntil\":\"2019-08-24T14:15:22Z\"},\"\ + middlename\":\"string\",\"password\":\"string\",\"password_never_expires\"\ + :true,\"passwordless_sudo\":true,\"phoneNumbers\":[{\"number\":\"string\"\ + ,\"type\":\"string\"}],\"public_key\":\"string\",\"recoveryEmail\":{\"address\"\ + :\"string\"},\"relationships\":[{\"type\":\"string\",\"value\":\"string\"\ + }],\"samba_service_user\":true,\"state\":\"STAGED\",\"sudo\":true,\"suspended\"\ + :true,\"tags\":[\"string\"],\"unix_guid\":1,\"unix_uid\":1,\"username\"\ + :\"string\"}'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/systemusers\"\ + \n\nquerystring = {\"fullValidationDetails\":\"SOME_STRING_VALUE\"}\n\n\ + payload = {\n \"account_locked\": True,\n \"activated\": True,\n \ + \ \"addresses\": [\n {\n \"country\": \"string\",\n\ + \ \"extendedAddress\": \"string\",\n \"locality\"\ + : \"string\",\n \"poBox\": \"string\",\n \"postalCode\"\ + : \"string\",\n \"region\": \"string\",\n \"streetAddress\"\ + : \"string\",\n \"type\": \"string\"\n }\n ],\n \ + \ \"allow_public_key\": True,\n \"alternateEmail\": \"string\",\n \ + \ \"attributes\": [\n {\n \"name\": \"string\",\n \ + \ \"value\": \"string\"\n }\n ],\n \"company\": \"string\"\ + ,\n \"costCenter\": \"string\",\n \"department\": \"string\",\n \ + \ \"description\": \"string\",\n \"disableDeviceMaxLoginAttempts\":\ + \ True,\n \"displayname\": \"string\",\n \"email\": \"string\",\n\ + \ \"employeeIdentifier\": \"string\",\n \"employeeType\": \"string\"\ + ,\n \"enable_managed_uid\": True,\n \"enable_user_portal_multifactor\"\ + : True,\n \"external_dn\": \"string\",\n \"external_password_expiration_date\"\ + : \"2019-08-24T14:15:22Z\",\n \"external_source_type\": \"string\",\n\ + \ \"externally_managed\": True,\n \"firstname\": \"string\",\n \ + \ \"jobTitle\": \"string\",\n \"lastname\": \"string\",\n \"ldap_binding_user\"\ + : True,\n \"location\": \"string\",\n \"managedAppleId\": \"string\"\ + ,\n \"manager\": \"string\",\n \"mfa\": {\n \"configured\"\ + : True,\n \"exclusion\": True,\n \"exclusionDays\": 1,\n \ + \ \"exclusionUntil\": \"2019-08-24T14:15:22Z\"\n },\n \"middlename\"\ + : \"string\",\n \"password\": \"string\",\n \"password_never_expires\"\ + : True,\n \"passwordless_sudo\": True,\n \"phoneNumbers\": [\n \ + \ {\n \"number\": \"string\",\n \"type\": \"string\"\ + \n }\n ],\n \"public_key\": \"string\",\n \"recoveryEmail\"\ + : {\"address\": \"string\"},\n \"relationships\": [\n {\n \ + \ \"type\": \"string\",\n \"value\": \"string\"\n \ + \ }\n ],\n \"samba_service_user\": True,\n \"state\": \"STAGED\"\ + ,\n \"sudo\": True,\n \"suspended\": True,\n \"tags\": [\"string\"\ + ],\n \"unix_guid\": 1,\n \"unix_uid\": 1,\n \"username\": \"string\"\ + \n}\nheaders = {\n \"x-org-id\": \"\",\n \"x-api-key\": \"REPLACE_KEY_VALUE\"\ + ,\n \"content-type\": \"application/json\"\n}\n\nresponse = requests.request(\"\ + POST\", url, json=payload, headers=headers, params=querystring)\n\nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-org-id\", \"\")\n$headers.Add(\"x-api-key\"\ + , \"REPLACE_KEY_VALUE\")\n$headers.Add(\"content-type\", \"application/json\"\ + )\n$response = Invoke-RestMethod -Uri 'https://console.jumpcloud.com/api/systemusers?fullValidationDetails=SOME_STRING_VALUE'\ + \ -Method POST -Headers $headers -ContentType 'application/json' -Body '{\"\ + account_locked\":true,\"activated\":true,\"addresses\":[{\"country\":\"\ + string\",\"extendedAddress\":\"string\",\"locality\":\"string\",\"poBox\"\ + :\"string\",\"postalCode\":\"string\",\"region\":\"string\",\"streetAddress\"\ + :\"string\",\"type\":\"string\"}],\"allow_public_key\":true,\"alternateEmail\"\ + :\"string\",\"attributes\":[{\"name\":\"string\",\"value\":\"string\"}],\"\ + company\":\"string\",\"costCenter\":\"string\",\"department\":\"string\"\ + ,\"description\":\"string\",\"disableDeviceMaxLoginAttempts\":true,\"displayname\"\ + :\"string\",\"email\":\"string\",\"employeeIdentifier\":\"string\",\"employeeType\"\ + :\"string\",\"enable_managed_uid\":true,\"enable_user_portal_multifactor\"\ + :true,\"external_dn\":\"string\",\"external_password_expiration_date\":\"\ + 2019-08-24T14:15:22Z\",\"external_source_type\":\"string\",\"externally_managed\"\ + :true,\"firstname\":\"string\",\"jobTitle\":\"string\",\"lastname\":\"string\"\ + ,\"ldap_binding_user\":true,\"location\":\"string\",\"managedAppleId\":\"\ + string\",\"manager\":\"string\",\"mfa\":{\"configured\":true,\"exclusion\"\ + :true,\"exclusionDays\":1,\"exclusionUntil\":\"2019-08-24T14:15:22Z\"},\"\ + middlename\":\"string\",\"password\":\"string\",\"password_never_expires\"\ + :true,\"passwordless_sudo\":true,\"phoneNumbers\":[{\"number\":\"string\"\ + ,\"type\":\"string\"}],\"public_key\":\"string\",\"recoveryEmail\":{\"address\"\ + :\"string\"},\"relationships\":[{\"type\":\"string\",\"value\":\"string\"\ + }],\"samba_service_user\":true,\"state\":\"STAGED\",\"sudo\":true,\"suspended\"\ + :true,\"tags\":[\"string\"],\"unix_guid\":1,\"unix_uid\":1,\"username\"\ + :\"string\"}'" + x-codegen-request-body-name: body + /systemusers/{id}: + get: + tags: + - Systemusers + summary: List a system user + description: "This endpoint returns a particular System User.\n\n#### Sample\ + \ Request\n\n```\ncurl -X GET https://console.jumpcloud.com/api/systemusers/{UserID}\ + \ \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\ + \ \\\n -H 'x-api-key: {API_KEY}'\n```" + operationId: systemusers_get + parameters: + - name: id + in: path + required: true + style: simple + explode: false + schema: + type: string + - name: fields + in: query + description: "Use a space seperated string of field parameters to include\ + \ the data in the response. If omitted, the default list of fields will\ + \ be returned.\n" + required: false + style: form + explode: true + schema: + type: string + - name: filter + in: query + description: "A filter to apply to the query. See the supported operators\ + \ below. For more complex searches,\nsee the related `/search/`\ + \ endpoints,\ne.g. `/search/systems`.\n\n**Filter structure**: `::`.\n\ + \n**field** = Populate with a valid field from an endpoint response.\n\n\ + **operator** = Supported operators are:\n- `$eq` (equals)\n- `$ne` (does\ + \ not equal)\n- `$gt` (is greater than)\n- `$gte` (is greater than or equal\ + \ to)\n- `$lt` (is less than)\n- `$lte` (is less than or equal to)\n\n_Note:\ + \ v1 operators differ from v2 operators._\n\n_Note: For v1 operators, excluding\ + \ the `$` will result in undefined behavior._\n\n**value** = Populate with\ + \ the value you want to search for. Is case sensitive.\n\n**Examples**\n\ + - `GET /users?filter=username:$eq:testuser`\n- `GET /systemusers?filter=password_expiration_date:$lte:2021-10-24`\n\ + - `GET /systemusers?filter=department:$ne:Accounting`\n- `GET /systems?filter[0]=firstname:$eq:foo&filter[1]=lastname:$eq:bar`\ + \ - this will\n AND the filters together.\n- `GET /systems?filter[or][0]=lastname:$eq:foo&filter[or][1]=lastname:$eq:bar`\ + \ - this will\n OR the filters together." + required: false + style: form + explode: true + schema: + type: string + - name: x-org-id + in: header + required: false + style: simple + explode: false + schema: + type: string + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/systemuserreturn' + "401": + description: Unauthorized + content: {} + security: + - x-api-key: [] + x-scopes: + - users + - users.readonly + x-codeSamples: + - lang: Shell + source: "curl --request GET \\\n --url 'https://console.jumpcloud.com/api/systemusers/{id}?fields=&filter=SOME_STRING_VALUE'\ + \ \\\n --header 'x-api-key: REPLACE_KEY_VALUE' \\\n --header 'x-org-id:\ + \ '" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/systemusers/{id}\"\ + \n\nquerystring = {\"fields\":\"\",\"filter\":\"SOME_STRING_VALUE\"}\n\n\ + headers = {\n \"x-org-id\": \"\",\n \"x-api-key\": \"REPLACE_KEY_VALUE\"\ + \n}\n\nresponse = requests.request(\"GET\", url, headers=headers, params=querystring)\n\ + \nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-org-id\", \"\")\n$headers.Add(\"x-api-key\"\ + , \"REPLACE_KEY_VALUE\")\n$response = Invoke-RestMethod -Uri 'https://console.jumpcloud.com/api/systemusers/{id}?fields=&filter=SOME_STRING_VALUE'\ + \ -Method GET -Headers $headers" + put: + tags: + - Systemusers + summary: Update a system user + description: "This endpoint allows you to update a system user.\n\n#### Sample\ + \ Request\n\n```\ncurl -X PUT https://console.jumpcloud.com/api/systemusers/{UserID}\ + \ \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\ + \ \\\n -H 'x-api-key: {API_KEY}' \\\n -d '{\n\t\"email\":\"{email_address}\"\ + ,\n\t\"firstname\":\"{Name}\",\n\t\"lastname\":\"{Name}\"\n}'\n```" + operationId: systemusers_put + parameters: + - name: id + in: path + required: true + style: simple + explode: false + schema: + type: string + - name: x-org-id + in: header + required: false + style: simple + explode: false + schema: + type: string + - name: fullValidationDetails + in: query + description: "This endpoint can take in a query when a client wants all validation\ + \ errors to be returned with error response for the form field specified,\ + \ i.e. 'password'\n#### Password validation flag\nUse the \"password\" validation\ + \ flag to receive details on a possible bad request response\nWithout the\ + \ `password` flag, default behavior will be a normal 400 with only a validation\ + \ string message\n```\n?fullValidationDetails=password\n```\n#### Expected\ + \ Behavior\nClients can expect a list of validation error mappings for the\ + \ validation query field in the details provided on the response:\n```\n\ + {\n \"code\": 400,\n \"message\": \"Password validation fail\",\n \"\ + status\": \"INVALID_ARGUMENT\",\n \"details\": [\n {\n \"fieldViolationsList\"\ + : [{ \"field\": \"password\", \"description\": \"passwordHistory\" }],\n\ + \ '@type': 'type.googleapis.com/google.rpc.BadRequest',\n },\n\ + \ ],\n},\n```" + required: false + style: form + explode: true + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/systemuserput' + required: false + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/systemuserreturn' + "400": + description: Bad Request + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorDetails' + "401": + description: Unauthorized + content: {} + security: + - x-api-key: [] + x-scopes: + - users + x-codeSamples: + - lang: Shell + source: "curl --request PUT \\\n --url 'https://console.jumpcloud.com/api/systemusers/{id}?fullValidationDetails=SOME_STRING_VALUE'\ + \ \\\n --header 'content-type: application/json' \\\n --header 'x-api-key:\ + \ REPLACE_KEY_VALUE' \\\n --header 'x-org-id: ' \\\n --data '{\"account_locked\"\ + :true,\"addresses\":[{\"country\":\"string\",\"extendedAddress\":\"string\"\ + ,\"locality\":\"string\",\"poBox\":\"string\",\"postalCode\":\"string\"\ + ,\"region\":\"string\",\"streetAddress\":\"string\",\"type\":\"string\"\ + }],\"allow_public_key\":true,\"alternateEmail\":\"string\",\"attributes\"\ + :[{\"name\":\"string\",\"value\":\"string\"}],\"company\":\"string\",\"\ + costCenter\":\"string\",\"department\":\"string\",\"description\":\"string\"\ + ,\"disableDeviceMaxLoginAttempts\":true,\"displayname\":\"string\",\"email\"\ + :\"string\",\"employeeIdentifier\":\"string\",\"employeeType\":\"string\"\ + ,\"enable_managed_uid\":true,\"enable_user_portal_multifactor\":true,\"\ + external_dn\":\"string\",\"external_password_expiration_date\":\"string\"\ + ,\"external_source_type\":\"string\",\"externally_managed\":true,\"firstname\"\ + :\"string\",\"jobTitle\":\"string\",\"lastname\":\"string\",\"ldap_binding_user\"\ + :true,\"location\":\"string\",\"managedAppleId\":\"string\",\"manager\"\ + :\"string\",\"mfa\":{\"configured\":true,\"exclusion\":true,\"exclusionDays\"\ + :1,\"exclusionUntil\":\"2019-08-24T14:15:22Z\"},\"middlename\":\"string\"\ + ,\"password\":\"string\",\"password_never_expires\":true,\"phoneNumbers\"\ + :[{\"number\":\"string\",\"type\":\"string\"}],\"public_key\":\"string\"\ + ,\"relationships\":[{\"type\":\"string\",\"value\":\"string\"}],\"samba_service_user\"\ + :true,\"ssh_keys\":[{\"name\":\"string\",\"public_key\":\"string\"}],\"\ + state\":\"ACTIVATED\",\"sudo\":true,\"suspended\":true,\"tags\":[\"string\"\ + ],\"unix_guid\":1,\"unix_uid\":1,\"username\":\"string\"}'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/systemusers/{id}\"\ + \n\nquerystring = {\"fullValidationDetails\":\"SOME_STRING_VALUE\"}\n\n\ + payload = {\n \"account_locked\": True,\n \"addresses\": [\n \ + \ {\n \"country\": \"string\",\n \"extendedAddress\"\ + : \"string\",\n \"locality\": \"string\",\n \"poBox\"\ + : \"string\",\n \"postalCode\": \"string\",\n \"region\"\ + : \"string\",\n \"streetAddress\": \"string\",\n \"\ + type\": \"string\"\n }\n ],\n \"allow_public_key\": True,\n\ + \ \"alternateEmail\": \"string\",\n \"attributes\": [\n {\n\ + \ \"name\": \"string\",\n \"value\": \"string\"\n\ + \ }\n ],\n \"company\": \"string\",\n \"costCenter\": \"\ + string\",\n \"department\": \"string\",\n \"description\": \"string\"\ + ,\n \"disableDeviceMaxLoginAttempts\": True,\n \"displayname\": \"\ + string\",\n \"email\": \"string\",\n \"employeeIdentifier\": \"string\"\ + ,\n \"employeeType\": \"string\",\n \"enable_managed_uid\": True,\n\ + \ \"enable_user_portal_multifactor\": True,\n \"external_dn\": \"\ + string\",\n \"external_password_expiration_date\": \"string\",\n \"\ + external_source_type\": \"string\",\n \"externally_managed\": True,\n\ + \ \"firstname\": \"string\",\n \"jobTitle\": \"string\",\n \"lastname\"\ + : \"string\",\n \"ldap_binding_user\": True,\n \"location\": \"string\"\ + ,\n \"managedAppleId\": \"string\",\n \"manager\": \"string\",\n \ + \ \"mfa\": {\n \"configured\": True,\n \"exclusion\": True,\n\ + \ \"exclusionDays\": 1,\n \"exclusionUntil\": \"2019-08-24T14:15:22Z\"\ + \n },\n \"middlename\": \"string\",\n \"password\": \"string\"\ + ,\n \"password_never_expires\": True,\n \"phoneNumbers\": [\n \ + \ {\n \"number\": \"string\",\n \"type\": \"string\"\ + \n }\n ],\n \"public_key\": \"string\",\n \"relationships\"\ + : [\n {\n \"type\": \"string\",\n \"value\"\ + : \"string\"\n }\n ],\n \"samba_service_user\": True,\n \ + \ \"ssh_keys\": [\n {\n \"name\": \"string\",\n \ + \ \"public_key\": \"string\"\n }\n ],\n \"state\": \"\ + ACTIVATED\",\n \"sudo\": True,\n \"suspended\": True,\n \"tags\"\ + : [\"string\"],\n \"unix_guid\": 1,\n \"unix_uid\": 1,\n \"username\"\ + : \"string\"\n}\nheaders = {\n \"x-org-id\": \"\",\n \"x-api-key\"\ + : \"REPLACE_KEY_VALUE\",\n \"content-type\": \"application/json\"\n}\n\ + \nresponse = requests.request(\"PUT\", url, json=payload, headers=headers,\ + \ params=querystring)\n\nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-org-id\", \"\")\n$headers.Add(\"x-api-key\"\ + , \"REPLACE_KEY_VALUE\")\n$headers.Add(\"content-type\", \"application/json\"\ + )\n$response = Invoke-RestMethod -Uri 'https://console.jumpcloud.com/api/systemusers/{id}?fullValidationDetails=SOME_STRING_VALUE'\ + \ -Method PUT -Headers $headers -ContentType 'application/json' -Body '{\"\ + account_locked\":true,\"addresses\":[{\"country\":\"string\",\"extendedAddress\"\ + :\"string\",\"locality\":\"string\",\"poBox\":\"string\",\"postalCode\"\ + :\"string\",\"region\":\"string\",\"streetAddress\":\"string\",\"type\"\ + :\"string\"}],\"allow_public_key\":true,\"alternateEmail\":\"string\",\"\ + attributes\":[{\"name\":\"string\",\"value\":\"string\"}],\"company\":\"\ + string\",\"costCenter\":\"string\",\"department\":\"string\",\"description\"\ + :\"string\",\"disableDeviceMaxLoginAttempts\":true,\"displayname\":\"string\"\ + ,\"email\":\"string\",\"employeeIdentifier\":\"string\",\"employeeType\"\ + :\"string\",\"enable_managed_uid\":true,\"enable_user_portal_multifactor\"\ + :true,\"external_dn\":\"string\",\"external_password_expiration_date\":\"\ + string\",\"external_source_type\":\"string\",\"externally_managed\":true,\"\ + firstname\":\"string\",\"jobTitle\":\"string\",\"lastname\":\"string\",\"\ + ldap_binding_user\":true,\"location\":\"string\",\"managedAppleId\":\"string\"\ + ,\"manager\":\"string\",\"mfa\":{\"configured\":true,\"exclusion\":true,\"\ + exclusionDays\":1,\"exclusionUntil\":\"2019-08-24T14:15:22Z\"},\"middlename\"\ + :\"string\",\"password\":\"string\",\"password_never_expires\":true,\"phoneNumbers\"\ + :[{\"number\":\"string\",\"type\":\"string\"}],\"public_key\":\"string\"\ + ,\"relationships\":[{\"type\":\"string\",\"value\":\"string\"}],\"samba_service_user\"\ + :true,\"ssh_keys\":[{\"name\":\"string\",\"public_key\":\"string\"}],\"\ + state\":\"ACTIVATED\",\"sudo\":true,\"suspended\":true,\"tags\":[\"string\"\ + ],\"unix_guid\":1,\"unix_uid\":1,\"username\":\"string\"}'" + x-codegen-request-body-name: body + delete: + tags: + - Systemusers + summary: Delete a system user + description: "This endpoint allows you to delete a particular system user.\n\ + \n#### Sample Request\n```\ncurl -X DELETE https://console.jumpcloud.com/api/systemusers/{UserID}\ + \ \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\ + \ \\\n -H 'x-api-key: {API_KEY}'\n```" + operationId: systemusers_delete + parameters: + - name: id + in: path + required: true + style: simple + explode: false + schema: + type: string + - name: x-org-id + in: header + required: false + style: simple + explode: false + schema: + type: string + - name: cascade_manager + in: query + description: "This is an optional flag that can be enabled on the DELETE call,\ + \ DELETE /systemusers/{id}?cascade_manager=null. This parameter will clear\ + \ the Manager attribute on all direct reports and then delete the account." + required: false + style: form + explode: true + schema: + type: string + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/systemuserreturn' + "401": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "409": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + security: + - x-api-key: [] + x-scopes: + - users + x-codeSamples: + - lang: Shell + source: "curl --request DELETE \\\n --url 'https://console.jumpcloud.com/api/systemusers/{id}?cascade_manager=SOME_STRING_VALUE'\ + \ \\\n --header 'x-api-key: REPLACE_KEY_VALUE' \\\n --header 'x-org-id:\ + \ '" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/systemusers/{id}\"\ + \n\nquerystring = {\"cascade_manager\":\"SOME_STRING_VALUE\"}\n\nheaders\ + \ = {\n \"x-org-id\": \"\",\n \"x-api-key\": \"REPLACE_KEY_VALUE\"\ + \n}\n\nresponse = requests.request(\"DELETE\", url, headers=headers, params=querystring)\n\ + \nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-org-id\", \"\")\n$headers.Add(\"x-api-key\"\ + , \"REPLACE_KEY_VALUE\")\n$response = Invoke-RestMethod -Uri 'https://console.jumpcloud.com/api/systemusers/{id}?cascade_manager=SOME_STRING_VALUE'\ + \ -Method DELETE -Headers $headers" + /systemusers/{id}/expire: + post: + tags: + - Systemusers + summary: Expire a system user's password + description: This endpoint allows you to expire a user's password. + operationId: systemusers_expire + parameters: + - name: id + in: path + required: true + style: simple + explode: false + schema: + type: string + - name: x-org-id + in: header + required: false + style: simple + explode: false + schema: + type: string + responses: + "200": + description: OK + content: + application/json: + schema: + type: string + x-content-type: application/json + text/plain: + schema: + type: string + "400": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + text/plain: + schema: + $ref: '#/components/schemas/Error' + "401": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + text/plain: + schema: + $ref: '#/components/schemas/Error' + "403": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + text/plain: + schema: + $ref: '#/components/schemas/Error' + "404": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + text/plain: + schema: + $ref: '#/components/schemas/Error' + "409": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + text/plain: + schema: + $ref: '#/components/schemas/Error' + "500": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + text/plain: + schema: + $ref: '#/components/schemas/Error' + security: + - x-api-key: [] + x-scopes: + - users + x-codeSamples: + - lang: Shell + source: "curl --request POST \\\n --url https://console.jumpcloud.com/api/systemusers/{id}/expire\ + \ \\\n --header 'x-api-key: REPLACE_KEY_VALUE' \\\n --header 'x-org-id:\ + \ '" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/systemusers/{id}/expire\"\ + \n\nheaders = {\n \"x-org-id\": \"\",\n \"x-api-key\": \"REPLACE_KEY_VALUE\"\ + \n}\n\nresponse = requests.request(\"POST\", url, headers=headers)\n\nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-org-id\", \"\")\n$headers.Add(\"x-api-key\"\ + , \"REPLACE_KEY_VALUE\")\n$response = Invoke-RestMethod -Uri 'https://console.jumpcloud.com/api/systemusers/{id}/expire'\ + \ -Method POST -Headers $headers" + /systemusers/{id}/mfasync: + post: + tags: + - Systemusers + summary: Sync a systemuser's mfa enrollment status + description: "This endpoint allows you to re-sync a user's mfa enrollment status\n\ + \n#### Sample Request\n```\ncurl -X POST \\\n https://console.jumpcloud.com/api/systemusers/{UserID}/mfasync\ + \ \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\ + \ \\\n -H 'x-api-key: {API_KEY}' \\\n\n```" + operationId: systemusers_mfasync + parameters: + - name: id + in: path + required: true + style: simple + explode: false + schema: + type: string + responses: + "200": + description: OK + content: {} + "400": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "401": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "403": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "404": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "409": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "500": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + security: + - x-api-key: [] + x-scopes: + - users + x-codeSamples: + - lang: Shell + source: "curl --request POST \\\n --url https://console.jumpcloud.com/api/systemusers/{id}/mfasync\ + \ \\\n --header 'x-api-key: REPLACE_KEY_VALUE'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/systemusers/{id}/mfasync\"\ + \n\nheaders = {\"x-api-key\": \"REPLACE_KEY_VALUE\"}\n\nresponse = requests.request(\"\ + POST\", url, headers=headers)\n\nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n\ + $response = Invoke-RestMethod -Uri 'https://console.jumpcloud.com/api/systemusers/{id}/mfasync'\ + \ -Method POST -Headers $headers" + /systemusers/{id}/resetmfa: + post: + tags: + - Systemusers + summary: Reset a system user's MFA token + description: "This endpoint allows you to reset the TOTP key for a specified\ + \ system user and put them in an TOTP MFA enrollment period. This will result\ + \ in the user being prompted to setup TOTP MFA when logging into userportal.\ + \ Please be aware that if the user does not complete TOTP MFA setup before\ + \ the `exclusionUntil` date, they will be locked out of any resources that\ + \ require TOTP MFA.\n\nPlease refer to our [Knowledge Base Article](https://support.jumpcloud.com/customer/en/portal/articles/2959138-using-multifactor-authentication-with-jumpcloud)\ + \ on setting up MFA for more information.\n\n#### Sample Request\n```\ncurl\ + \ -X POST \\\n https://console.jumpcloud.com/api/systemusers/{UserID}/resetmfa\ + \ \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\ + \ \\\n -H 'x-api-key: {API_KEY}' \\\n -d '{\"exclusion\": true, \"exclusionUntil\"\ + : \"{date-time}\"}'\n\n```" + operationId: systemusers_resetmfa + parameters: + - name: id + in: path + required: true + style: simple + explode: false + schema: + type: string + - name: x-org-id + in: header + required: false + style: simple + explode: false + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/id_resetmfa_body' + required: false + responses: + "200": + description: OK + content: + application/json: + schema: + type: string + x-content-type: application/json + text/plain: + schema: + type: string + "400": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + text/plain: + schema: + $ref: '#/components/schemas/Error' + "401": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + text/plain: + schema: + $ref: '#/components/schemas/Error' + "403": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + text/plain: + schema: + $ref: '#/components/schemas/Error' + "404": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + text/plain: + schema: + $ref: '#/components/schemas/Error' + "409": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + text/plain: + schema: + $ref: '#/components/schemas/Error' + "500": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + text/plain: + schema: + $ref: '#/components/schemas/Error' + security: + - x-api-key: [] + x-scopes: + - users + x-codeSamples: + - lang: Shell + source: "curl --request POST \\\n --url https://console.jumpcloud.com/api/systemusers/{id}/resetmfa\ + \ \\\n --header 'content-type: application/json' \\\n --header 'x-api-key:\ + \ REPLACE_KEY_VALUE' \\\n --header 'x-org-id: ' \\\n --data '{\"exclusion\"\ + :true,\"exclusionDays\":1,\"exclusionUntil\":\"2019-08-24T14:15:22Z\"}'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/systemusers/{id}/resetmfa\"\ + \n\npayload = {\n \"exclusion\": True,\n \"exclusionDays\": 1,\n \ + \ \"exclusionUntil\": \"2019-08-24T14:15:22Z\"\n}\nheaders = {\n \"\ + x-org-id\": \"\",\n \"x-api-key\": \"REPLACE_KEY_VALUE\",\n \"content-type\"\ + : \"application/json\"\n}\n\nresponse = requests.request(\"POST\", url,\ + \ json=payload, headers=headers)\n\nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-org-id\", \"\")\n$headers.Add(\"x-api-key\"\ + , \"REPLACE_KEY_VALUE\")\n$headers.Add(\"content-type\", \"application/json\"\ + )\n$response = Invoke-RestMethod -Uri 'https://console.jumpcloud.com/api/systemusers/{id}/resetmfa'\ + \ -Method POST -Headers $headers -ContentType 'application/json' -Body '{\"\ + exclusion\":true,\"exclusionDays\":1,\"exclusionUntil\":\"2019-08-24T14:15:22Z\"\ + }'" + x-codegen-request-body-name: body + /systemusers/{id}/sshkeys: + get: + tags: + - Systemusers + summary: List a system user's public SSH keys + description: This endpoint will return a specific System User's public SSH key. + operationId: sshkey_list + parameters: + - name: id + in: path + required: true + style: simple + explode: false + schema: + type: string + - name: x-org-id + in: header + required: false + style: simple + explode: false + schema: + type: string + responses: + "200": + description: "" + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/sshkeylist' + x-content-type: application/json + "400": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + security: + - x-api-key: [] + x-scopes: + - users + - users.readonly + x-codeSamples: + - lang: Shell + source: "curl --request GET \\\n --url https://console.jumpcloud.com/api/systemusers/{id}/sshkeys\ + \ \\\n --header 'x-api-key: REPLACE_KEY_VALUE' \\\n --header 'x-org-id:\ + \ '" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/systemusers/{id}/sshkeys\"\ + \n\nheaders = {\n \"x-org-id\": \"\",\n \"x-api-key\": \"REPLACE_KEY_VALUE\"\ + \n}\n\nresponse = requests.request(\"GET\", url, headers=headers)\n\nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-org-id\", \"\")\n$headers.Add(\"x-api-key\"\ + , \"REPLACE_KEY_VALUE\")\n$response = Invoke-RestMethod -Uri 'https://console.jumpcloud.com/api/systemusers/{id}/sshkeys'\ + \ -Method GET -Headers $headers" + post: + tags: + - Systemusers + summary: Create a system user's Public SSH Key + description: This endpoint will create a specific System User's Public SSH Key. + operationId: sshkey_post + parameters: + - name: id + in: path + required: true + style: simple + explode: false + schema: + type: string + - name: x-org-id + in: header + required: false + style: simple + explode: false + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/sshkeypost' + required: false + responses: + "200": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/sshkeylist' + "400": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + security: + - x-api-key: [] + x-scopes: + - users + x-codeSamples: + - lang: Shell + source: "curl --request POST \\\n --url https://console.jumpcloud.com/api/systemusers/{id}/sshkeys\ + \ \\\n --header 'content-type: application/json' \\\n --header 'x-api-key:\ + \ REPLACE_KEY_VALUE' \\\n --header 'x-org-id: ' \\\n --data '{\"name\"\ + :\"string\",\"public_key\":\"string\"}'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/systemusers/{id}/sshkeys\"\ + \n\npayload = {\n \"name\": \"string\",\n \"public_key\": \"string\"\ + \n}\nheaders = {\n \"x-org-id\": \"\",\n \"x-api-key\": \"REPLACE_KEY_VALUE\"\ + ,\n \"content-type\": \"application/json\"\n}\n\nresponse = requests.request(\"\ + POST\", url, json=payload, headers=headers)\n\nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-org-id\", \"\")\n$headers.Add(\"x-api-key\"\ + , \"REPLACE_KEY_VALUE\")\n$headers.Add(\"content-type\", \"application/json\"\ + )\n$response = Invoke-RestMethod -Uri 'https://console.jumpcloud.com/api/systemusers/{id}/sshkeys'\ + \ -Method POST -Headers $headers -ContentType 'application/json' -Body '{\"\ + name\":\"string\",\"public_key\":\"string\"}'" + x-codegen-request-body-name: body + /systemusers/{id}/state/activate: + post: + tags: + - Systemusers + summary: Activate System User + description: "This endpoint changes the state of a STAGED user to ACTIVATED.\n\ + #### Email Flag\nUse the \"email\" flag to determine whether or not to send\ + \ a Welcome or\nActivation email to the newly activated user. Sending an empty\ + \ body\nwithout the `email` flag, will send an email with default behavior\n\ + (see the \"Behavior\" section below)\n```\n{}\n```\nSending `email=true` flag\ + \ will send an email with default behavior (see `Behavior` below)\n```\n{\ + \ \"email\": true }\n```\nPopulated email will override the default behavior\ + \ and send to the specified email value\n```\n{ \"email\": \"example@example.com\"\ + \ }\n```\nSending `email=false` will suppress sending the email\n```\n{ \"\ + email\": false }\n```\n#### Behavior\nUsers with a password will be sent a\ + \ Welcome email to:\n - The address specified in `email` flag in the request\n\ + \ - If no `email` flag, the user's primary email address (default behavior)\n\ + Users without a password will be sent an Activation email to:\n - The address\ + \ specified in `email` flag in the request\n - If no `email` flag, the user's\ + \ alternate email address (default behavior)\n - If no alternate email address,\ + \ the user's primary email address (default behavior)\n\n#### Sample Request\n\ + ```\ncurl -X POST https://console.jumpcloud.com/api/systemusers/{id}/state/activate\ + \ \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\ + \ \\\n -H 'x-api-key: ' \\\n -d '{ \"email\": \"alternate-activation-email@email.com\"\ + \ }'\n\n```" + operationId: systemusers_state_activate + parameters: + - name: id + in: path + required: true + style: simple + explode: false + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/state_activate_body' + required: false + responses: + "200": + description: OK + content: + application/json: + schema: + type: string + x-content-type: application/json + "400": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "401": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "403": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "404": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "409": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "500": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + security: + - x-api-key: [] + x-scopes: + - users + x-codeSamples: + - lang: Shell + source: "curl --request POST \\\n --url https://console.jumpcloud.com/api/systemusers/{id}/state/activate\ + \ \\\n --header 'content-type: application/json' \\\n --header 'x-api-key:\ + \ REPLACE_KEY_VALUE' \\\n --data '{\"email\":{}}'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/systemusers/{id}/state/activate\"\ + \n\npayload = {\"email\": {}}\nheaders = {\n \"x-api-key\": \"REPLACE_KEY_VALUE\"\ + ,\n \"content-type\": \"application/json\"\n}\n\nresponse = requests.request(\"\ + POST\", url, json=payload, headers=headers)\n\nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n\ + $headers.Add(\"content-type\", \"application/json\")\n$response = Invoke-RestMethod\ + \ -Uri 'https://console.jumpcloud.com/api/systemusers/{id}/state/activate'\ + \ -Method POST -Headers $headers -ContentType 'application/json' -Body '{\"\ + email\":{}}'" + x-codegen-request-body-name: body + /systemusers/{id}/unlock: + post: + tags: + - Systemusers + summary: Unlock a system user + description: This endpoint allows you to unlock a user's account. + operationId: systemusers_unlock + parameters: + - name: id + in: path + required: true + style: simple + explode: false + schema: + type: string + - name: x-org-id + in: header + required: false + style: simple + explode: false + schema: + type: string + responses: + "200": + description: OK + content: + application/json: + schema: + type: string + x-content-type: application/json + text/plain: + schema: + type: string + "400": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + text/plain: + schema: + $ref: '#/components/schemas/Error' + "401": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + text/plain: + schema: + $ref: '#/components/schemas/Error' + "403": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + text/plain: + schema: + $ref: '#/components/schemas/Error' + "404": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + text/plain: + schema: + $ref: '#/components/schemas/Error' + "409": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + text/plain: + schema: + $ref: '#/components/schemas/Error' + "500": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + text/plain: + schema: + $ref: '#/components/schemas/Error' + security: + - x-api-key: [] + x-scopes: + - users + x-codeSamples: + - lang: Shell + source: "curl --request POST \\\n --url https://console.jumpcloud.com/api/systemusers/{id}/unlock\ + \ \\\n --header 'x-api-key: REPLACE_KEY_VALUE' \\\n --header 'x-org-id:\ + \ '" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/systemusers/{id}/unlock\"\ + \n\nheaders = {\n \"x-org-id\": \"\",\n \"x-api-key\": \"REPLACE_KEY_VALUE\"\ + \n}\n\nresponse = requests.request(\"POST\", url, headers=headers)\n\nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-org-id\", \"\")\n$headers.Add(\"x-api-key\"\ + , \"REPLACE_KEY_VALUE\")\n$response = Invoke-RestMethod -Uri 'https://console.jumpcloud.com/api/systemusers/{id}/unlock'\ + \ -Method POST -Headers $headers" + /systemusers/{systemuser_id}/sshkeys/{id}: + delete: + tags: + - Systemusers + summary: Delete a system user's Public SSH Keys + description: This endpoint will delete a specific System User's SSH Key. + operationId: sshkey_delete + parameters: + - name: systemuser_id + in: path + required: true + style: simple + explode: false + schema: + type: string + - name: id + in: path + required: true + style: simple + explode: false + schema: + type: string + - name: x-org-id + in: header + required: false + style: simple + explode: false + schema: + type: string + responses: + "200": + description: OK + content: + application/json: + schema: + type: string + x-content-type: application/json + text/plain: + schema: + type: string + "400": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + text/plain: + schema: + $ref: '#/components/schemas/Error' + security: + - x-api-key: [] + x-scopes: + - users + x-codeSamples: + - lang: Shell + source: "curl --request DELETE \\\n --url https://console.jumpcloud.com/api/systemusers/{systemuser_id}/sshkeys/{id}\ + \ \\\n --header 'x-api-key: REPLACE_KEY_VALUE' \\\n --header 'x-org-id:\ + \ '" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/systemusers/{systemuser_id}/sshkeys/{id}\"\ + \n\nheaders = {\n \"x-org-id\": \"\",\n \"x-api-key\": \"REPLACE_KEY_VALUE\"\ + \n}\n\nresponse = requests.request(\"DELETE\", url, headers=headers)\n\n\ + print(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-org-id\", \"\")\n$headers.Add(\"x-api-key\"\ + , \"REPLACE_KEY_VALUE\")\n$response = Invoke-RestMethod -Uri 'https://console.jumpcloud.com/api/systemusers/{systemuser_id}/sshkeys/{id}'\ + \ -Method DELETE -Headers $headers" + /users/reactivate/{id}: + get: + tags: + - Users + - Managed Service Provider + summary: Administrator Password Reset Initiation + description: This endpoint triggers the sending of a reactivation e-mail to + an administrator. + operationId: users_reactivate_get + parameters: + - name: id + in: path + required: true + style: simple + explode: false + schema: + type: string + responses: + "200": + description: OK + content: {} + "401": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "403": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "404": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "500": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + security: + - x-api-key: [] + x-scopes: + - administrators + x-codeSamples: + - lang: Shell + source: "curl --request GET \\\n --url https://console.jumpcloud.com/api/users/reactivate/{id}\ + \ \\\n --header 'x-api-key: REPLACE_KEY_VALUE'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/users/reactivate/{id}\"\ + \n\nheaders = {\"x-api-key\": \"REPLACE_KEY_VALUE\"}\n\nresponse = requests.request(\"\ + GET\", url, headers=headers)\n\nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n\ + $response = Invoke-RestMethod -Uri 'https://console.jumpcloud.com/api/users/reactivate/{id}'\ + \ -Method GET -Headers $headers" + /users/resettotp/{id}: + post: + tags: + - Users + - Managed Service Provider + summary: Administrator TOTP Reset Initiation + description: This endpoint initiates a TOTP reset for an admin. This request + does not accept a body. + operationId: admin_totpreset_begin + parameters: + - name: id + in: path + required: true + style: simple + explode: false + schema: + type: string + responses: + "200": + description: OK + content: {} + "401": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "403": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "404": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "412": + description: Preconditions not met + content: + application/json: + schema: + type: object + x-content-type: application/json + "500": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + security: + - x-api-key: [] + x-scopes: + - administrators + x-codeSamples: + - lang: Shell + source: "curl --request POST \\\n --url https://console.jumpcloud.com/api/users/resettotp/{id}\ + \ \\\n --header 'x-api-key: REPLACE_KEY_VALUE'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/users/resettotp/{id}\"\ + \n\nheaders = {\"x-api-key\": \"REPLACE_KEY_VALUE\"}\n\nresponse = requests.request(\"\ + POST\", url, headers=headers)\n\nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n\ + $response = Invoke-RestMethod -Uri 'https://console.jumpcloud.com/api/users/resettotp/{id}'\ + \ -Method POST -Headers $headers" + /users/{id}: + put: + tags: + - Users + - Managed Service Provider + summary: Update a user + description: This endpoint allows you to update a user. + operationId: users_put + parameters: + - name: id + in: path + required: true + style: simple + explode: false + schema: + type: string + - name: x-org-id + in: header + required: false + style: simple + explode: false + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/userput' + required: false + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/userreturn' + "400": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "401": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "403": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "404": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "500": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + security: + - x-api-key: [] + x-scopes: + - administrators + x-codeSamples: + - lang: Shell + source: "curl --request PUT \\\n --url https://console.jumpcloud.com/api/users/{id}\ + \ \\\n --header 'content-type: application/json' \\\n --header 'x-api-key:\ + \ REPLACE_KEY_VALUE' \\\n --header 'x-org-id: ' \\\n --data '{\"email\"\ + :\"user@example.com\",\"enableMultiFactor\":true,\"firstname\":\"string\"\ + ,\"growthData\":{},\"lastWhatsNewChecked\":\"2019-08-24\",\"lastname\":\"\ + string\",\"roleName\":\"string\"}'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/users/{id}\"\ + \n\npayload = {\n \"email\": \"user@example.com\",\n \"enableMultiFactor\"\ + : True,\n \"firstname\": \"string\",\n \"growthData\": {},\n \"\ + lastWhatsNewChecked\": \"2019-08-24\",\n \"lastname\": \"string\",\n\ + \ \"roleName\": \"string\"\n}\nheaders = {\n \"x-org-id\": \"\",\n\ + \ \"x-api-key\": \"REPLACE_KEY_VALUE\",\n \"content-type\": \"application/json\"\ + \n}\n\nresponse = requests.request(\"PUT\", url, json=payload, headers=headers)\n\ + \nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-org-id\", \"\")\n$headers.Add(\"x-api-key\"\ + , \"REPLACE_KEY_VALUE\")\n$headers.Add(\"content-type\", \"application/json\"\ + )\n$response = Invoke-RestMethod -Uri 'https://console.jumpcloud.com/api/users/{id}'\ + \ -Method PUT -Headers $headers -ContentType 'application/json' -Body '{\"\ + email\":\"user@example.com\",\"enableMultiFactor\":true,\"firstname\":\"\ + string\",\"growthData\":{},\"lastWhatsNewChecked\":\"2019-08-24\",\"lastname\"\ + :\"string\",\"roleName\":\"string\"}'" + x-codegen-request-body-name: body +components: + schemas: + Error: + title: Error + type: object + properties: + code: + type: integer + description: HTTP status code + format: int32 + message: + type: string + description: Error message + status: + type: string + description: HTTP status description + ErrorDetails: + allOf: + - $ref: '#/components/schemas/Error' + - type: object + properties: + details: + type: array + description: | + Describes a list of objects with more detailed information of the given error. + Each detail schema is according to one of the messages defined in Google's API: + https://github.com/googleapis/googleapis/blob/master/google/rpc/error_details.proto" + items: + type: object + properties: {} + description: Object according to Google's API. + application: + title: Application + required: + - config + - name + - ssoUrl + type: object + properties: + _id: + type: string + active: + type: boolean + beta: + type: boolean + color: + type: string + enum: + - "" + - '#202D38' + - '#005466' + - '#3E8696' + - '#006CAC' + - '#0617AC' + - '#7C6ADA' + - '#D5779D' + - '#9E2F00' + - '#FFB000' + - '#58C469' + - '#57C49F' + - '#FF6C03' + config: + $ref: '#/components/schemas/application_config' + created: + type: string + databaseAttributes: + type: array + items: + type: object + properties: {} + example: {} + description: + maxLength: 256 + type: string + displayLabel: + type: string + displayName: + type: string + learnMore: + type: string + logo: + $ref: '#/components/schemas/application_logo' + name: + type: string + organization: + type: string + sso: + $ref: '#/components/schemas/sso' + ssoUrl: + type: string + example: + displayLabel: displayLabel + color: "" + ssoUrl: ssoUrl + created: created + displayName: displayName + active: true + description: description + sso: + idpCertExpirationAt: 2000-01-23T04:56:07.000+00:00 + jit: true + type: type + beta: true + learnMore: learnMore + organization: organization + name: name + logo: + color: "" + url: url + _id: _id + databaseAttributes: + - {} + - {} + config: + acsUrl: + visible: true + options: options + tooltip: + template: template + variables: + icon: icon + message: message + readOnly: true + toggle: toggle + label: label + position: 0 + type: type + value: value + required: true + constantAttributes: + visible: true + mutable: true + tooltip: null + readOnly: true + label: label + position: 6 + type: type + value: + - visible: true + name: name + readOnly: true + value: value + required: true + - visible: true + name: name + readOnly: true + value: value + required: true + required: true + idpCertificate: null + spEntityId: null + databaseAttributes: + position: 1 + idpPrivateKey: null + idpEntityId: null + beta: true + applicationslist: + title: ApplicationsList + type: object + properties: + name: + type: string + results: + type: array + description: The list of applications. + items: + $ref: '#/components/schemas/application' + totalCount: + type: integer + description: The total number of applications. + example: + name: name + totalCount: 0 + results: + - displayLabel: displayLabel + color: "" + ssoUrl: ssoUrl + created: created + displayName: displayName + active: true + description: description + sso: + idpCertExpirationAt: 2000-01-23T04:56:07.000+00:00 + jit: true + type: type + beta: true + learnMore: learnMore + organization: organization + name: name + logo: + color: "" + url: url + _id: _id + databaseAttributes: + - {} + - {} + config: + acsUrl: + visible: true + options: options + tooltip: + template: template + variables: + icon: icon + message: message + readOnly: true + toggle: toggle + label: label + position: 0 + type: type + value: value + required: true + constantAttributes: + visible: true + mutable: true + tooltip: null + readOnly: true + label: label + position: 6 + type: type + value: + - visible: true + name: name + readOnly: true + value: value + required: true + - visible: true + name: name + readOnly: true + value: value + required: true + required: true + idpCertificate: null + spEntityId: null + databaseAttributes: + position: 1 + idpPrivateKey: null + idpEntityId: null + beta: true + - displayLabel: displayLabel + color: "" + ssoUrl: ssoUrl + created: created + displayName: displayName + active: true + description: description + sso: + idpCertExpirationAt: 2000-01-23T04:56:07.000+00:00 + jit: true + type: type + beta: true + learnMore: learnMore + organization: organization + name: name + logo: + color: "" + url: url + _id: _id + databaseAttributes: + - {} + - {} + config: + acsUrl: + visible: true + options: options + tooltip: + template: template + variables: + icon: icon + message: message + readOnly: true + toggle: toggle + label: label + position: 0 + type: type + value: value + required: true + constantAttributes: + visible: true + mutable: true + tooltip: null + readOnly: true + label: label + position: 6 + type: type + value: + - visible: true + name: name + readOnly: true + value: value + required: true + - visible: true + name: name + readOnly: true + value: value + required: true + required: true + idpCertificate: null + spEntityId: null + databaseAttributes: + position: 1 + idpPrivateKey: null + idpEntityId: null + beta: true + applicationtemplate: + title: ApplicationTemplate + type: object + properties: + _id: + type: string + active: + type: boolean + beta: + type: boolean + color: + type: string + enum: + - "" + - '#202D38' + - '#005466' + - '#3E8696' + - '#006CAC' + - '#0617AC' + - '#7C6ADA' + - '#D5779D' + - '#9E2F00' + - '#FFB000' + - '#58C469' + - '#57C49F' + - '#FF6C03' + config: + $ref: '#/components/schemas/application_config' + displayLabel: + type: string + displayName: + type: string + isConfigured: + type: boolean + jit: + $ref: '#/components/schemas/applicationtemplate_jit' + keywords: + type: array + items: + type: string + learnMore: + type: string + logo: + $ref: '#/components/schemas/applicationtemplate_logo' + name: + type: string + oidc: + $ref: '#/components/schemas/applicationtemplate_oidc' + provision: + $ref: '#/components/schemas/applicationtemplate_provision' + sso: + $ref: '#/components/schemas/sso' + ssoUrl: + type: string + status: + type: string + enum: + - "" + - end_of_life + - end_of_support + - beta + test: + type: string + example: + displayLabel: displayLabel + isConfigured: true + color: "" + keywords: + - keywords + - keywords + test: test + ssoUrl: ssoUrl + displayName: displayName + active: true + oidc: + grantTypes: + - authorization_code + - authorization_code + ssoUrl: ssoUrl + tokenEndpointAuthMethod: none + redirectUris: + - redirectUris + - redirectUris + sso: + idpCertExpirationAt: 2000-01-23T04:56:07.000+00:00 + jit: true + type: type + beta: true + jit: + createOnly: true + attributes: {} + learnMore: learnMore + provision: + groups_supported: true + type: type + beta: true + name: name + logo: + url: url + _id: _id + config: + acsUrl: + visible: true + options: options + tooltip: + template: template + variables: + icon: icon + message: message + readOnly: true + toggle: toggle + label: label + position: 0 + type: type + value: value + required: true + constantAttributes: + visible: true + mutable: true + tooltip: null + readOnly: true + label: label + position: 6 + type: type + value: + - visible: true + name: name + readOnly: true + value: value + required: true + - visible: true + name: name + readOnly: true + value: value + required: true + required: true + idpCertificate: null + spEntityId: null + databaseAttributes: + position: 1 + idpPrivateKey: null + idpEntityId: null + beta: true + status: "" + applicationtemplateslist: + title: ApplicationTemplatesList + type: object + properties: + results: + type: array + description: The list of applications. + items: + $ref: '#/components/schemas/applicationtemplate' + totalCount: + type: integer + description: The total number of applications. + example: + totalCount: 5 + results: + - displayLabel: displayLabel + isConfigured: true + color: "" + keywords: + - keywords + - keywords + test: test + ssoUrl: ssoUrl + displayName: displayName + active: true + oidc: + grantTypes: + - authorization_code + - authorization_code + ssoUrl: ssoUrl + tokenEndpointAuthMethod: none + redirectUris: + - redirectUris + - redirectUris + sso: + idpCertExpirationAt: 2000-01-23T04:56:07.000+00:00 + jit: true + type: type + beta: true + jit: + createOnly: true + attributes: {} + learnMore: learnMore + provision: + groups_supported: true + type: type + beta: true + name: name + logo: + url: url + _id: _id + config: + acsUrl: + visible: true + options: options + tooltip: + template: template + variables: + icon: icon + message: message + readOnly: true + toggle: toggle + label: label + position: 0 + type: type + value: value + required: true + constantAttributes: + visible: true + mutable: true + tooltip: null + readOnly: true + label: label + position: 6 + type: type + value: + - visible: true + name: name + readOnly: true + value: value + required: true + - visible: true + name: name + readOnly: true + value: value + required: true + required: true + idpCertificate: null + spEntityId: null + databaseAttributes: + position: 1 + idpPrivateKey: null + idpEntityId: null + beta: true + status: "" + - displayLabel: displayLabel + isConfigured: true + color: "" + keywords: + - keywords + - keywords + test: test + ssoUrl: ssoUrl + displayName: displayName + active: true + oidc: + grantTypes: + - authorization_code + - authorization_code + ssoUrl: ssoUrl + tokenEndpointAuthMethod: none + redirectUris: + - redirectUris + - redirectUris + sso: + idpCertExpirationAt: 2000-01-23T04:56:07.000+00:00 + jit: true + type: type + beta: true + jit: + createOnly: true + attributes: {} + learnMore: learnMore + provision: + groups_supported: true + type: type + beta: true + name: name + logo: + url: url + _id: _id + config: + acsUrl: + visible: true + options: options + tooltip: + template: template + variables: + icon: icon + message: message + readOnly: true + toggle: toggle + label: label + position: 0 + type: type + value: value + required: true + constantAttributes: + visible: true + mutable: true + tooltip: null + readOnly: true + label: label + position: 6 + type: type + value: + - visible: true + name: name + readOnly: true + value: value + required: true + - visible: true + name: name + readOnly: true + value: value + required: true + required: true + idpCertificate: null + spEntityId: null + databaseAttributes: + position: 1 + idpPrivateKey: null + idpEntityId: null + beta: true + status: "" + command: + title: Command + required: + - command + - commandType + - name + type: object + properties: + command: + type: string + description: The command to execute on the server. + commandRunners: + type: array + description: An array of IDs of the Command Runner Users that can execute + this command. + items: + type: string + commandType: + type: string + description: The Command OS + default: linux + files: + type: array + description: An array of file IDs to include with the command. + items: + type: string + launchType: + type: string + description: How the command will execute. + listensTo: + type: string + description: "" + name: + type: string + organization: + type: string + description: The ID of the organization. + schedule: + type: string + description: "A crontab that consists of: [ (seconds) (minutes) (hours)\ + \ (days of month) (months) (weekdays) ] or [ immediate ]. If you send\ + \ this as an empty string, it will run immediately.\n" + scheduleRepeatType: + type: string + description: When the command will repeat. + scheduleYear: + type: integer + description: The year that a scheduled command will launch in. + shell: + type: string + description: The shell used to run the command. + sudo: + type: boolean + description: "" + systems: + type: array + description: An array of system IDs to run the command on. Not available + if you are using Groups. + items: + type: string + template: + type: string + description: The template this command was created from + timeToLiveSeconds: + type: integer + description: Time in seconds a command can wait in the queue to be run before + timing out + timeout: + type: string + description: The time in seconds to allow the command to run for. + trigger: + type: string + description: The name of the command trigger. + user: + type: string + description: The ID of the system user to run the command as. This field + is required when creating a command with a commandType of "mac" or "linux". + example: + template: template + scheduleRepeatType: scheduleRepeatType + timeToLiveSeconds: 6 + commandType: linux + commandRunners: + - commandRunners + - commandRunners + trigger: trigger + command: command + timeout: timeout + schedule: schedule + scheduleYear: 0 + shell: shell + systems: + - systems + - systems + organization: organization + name: name + files: + - files + - files + listensTo: listensTo + sudo: true + user: user + launchType: launchType + commandfilereturn: + title: CommandFileReturn + type: object + properties: + results: + type: array + items: + $ref: '#/components/schemas/commandfilereturn_results' + totalCount: + type: integer + description: The total number of commands files + example: + totalCount: 0 + results: + - destination: destination + name: name + _id: _id + - destination: destination + name: name + _id: _id + commandresult: + title: CommandResult + type: object + properties: + _id: + type: string + description: The ID of the command. + command: + type: string + description: The command that was executed on the system. + files: + type: array + description: An array of file ids that were included in the command + items: + type: string + name: + type: string + description: The name of the command. + organization: + type: string + description: The ID of the organization. + requestTime: + type: string + description: The time that the command was sent. + format: date-time + response: + $ref: '#/components/schemas/commandresult_response' + responseTime: + type: string + description: The time that the command was completed. + format: date-time + sudo: + type: boolean + description: If the user had sudo rights + system: + type: string + description: The name of the system the command was executed on. + systemId: + type: string + description: The id of the system the command was executed on. + user: + type: string + description: The user the command ran as. + workflowId: + type: string + workflowInstanceId: + type: string + example: + systemId: systemId + responseTime: 2000-01-23T04:56:07.000+00:00 + command: command + requestTime: 2000-01-23T04:56:07.000+00:00 + system: system + response: + data: + output: output + exitCode: 0 + id: id + error: error + organization: organization + name: name + files: + - files + - files + _id: _id + sudo: true + user: user + workflowInstanceId: workflowInstanceId + workflowId: workflowId + commandresultslist: + title: CommandResultsList + type: object + properties: + results: + type: array + items: + $ref: '#/components/schemas/commandresultslist_results' + totalCount: + type: integer + description: The total number of command results. + example: + totalCount: 6 + results: + - requestTime: 2000-01-23T04:56:07.000+00:00 + systemId: systemId + system: system + responseTime: 2000-01-23T04:56:07.000+00:00 + name: name + exitCode: 0 + _id: _id + sudo: true + user: user + command: command + workflowId: workflowId + - requestTime: 2000-01-23T04:56:07.000+00:00 + systemId: systemId + system: system + responseTime: 2000-01-23T04:56:07.000+00:00 + name: name + exitCode: 0 + _id: _id + sudo: true + user: user + command: command + workflowId: workflowId + commandslist: + title: CommandsList + type: object + properties: + results: + type: array + items: + $ref: '#/components/schemas/commandslist_results' + totalCount: + type: integer + description: The total number of commands + example: + totalCount: 0 + results: + - schedule: schedule + scheduleRepeatType: scheduleRepeatType + commandType: commandType + organization: organization + name: name + _id: _id + listensTo: listensTo + trigger: trigger + command: command + launchType: launchType + - schedule: schedule + scheduleRepeatType: scheduleRepeatType + commandType: commandType + organization: organization + name: name + _id: _id + listensTo: listensTo + trigger: trigger + command: command + launchType: launchType + fde: + title: FDE + type: object + properties: + active: + type: boolean + keyPresent: + type: boolean + description: Indicates if the Full Disk Encryption is active in the system + example: + active: true + keyPresent: true + mfa: + title: mfa + type: object + properties: + configured: + type: boolean + exclusion: + type: boolean + exclusionDays: + minimum: 1 + type: integer + exclusionUntil: + type: string + format: date-time + example: + configured: true + exclusion: true + exclusionDays: 1 + exclusionUntil: 2000-01-23T04:56:07.000+00:00 + mfaEnrollment: + title: mfaEnrollment + type: object + properties: + overallStatus: + $ref: '#/components/schemas/mfaEnrollmentStatus' + pushStatus: + $ref: '#/components/schemas/mfaEnrollmentStatus' + totpStatus: + $ref: '#/components/schemas/mfaEnrollmentStatus' + webAuthnStatus: + $ref: '#/components/schemas/mfaEnrollmentStatus' + example: + totpStatus: null + pushStatus: null + overallStatus: NOT_ENROLLED + webAuthnStatus: null + mfaEnrollmentStatus: + type: string + enum: + - NOT_ENROLLED + - DISABLED + - PENDING_ACTIVATION + - ENROLLMENT_EXPIRED + - IN_ENROLLMENT + - PRE_ENROLLMENT + - ENROLLED + organization: + title: Organization + type: object + properties: + _id: + type: string + accountsReceivable: + type: string + created: + type: string + displayName: + type: string + entitlement: + $ref: '#/components/schemas/organizationentitlement' + hasCreditCard: + type: boolean + hasStripeCustomerId: + type: boolean + lastEstimateCalculationTimeStamp: + type: string + lastSfdcSyncStatus: + type: object + properties: {} + example: {} + logoUrl: + type: string + provider: + type: string + settings: + $ref: '#/components/schemas/organizationsettings' + totalBillingEstimate: + type: integer + example: + settings: + emailDisclaimer: emailDisclaimer + disableLdap: true + displayPreferences: + orgInsights: + fundamentals: null + applicationsUsage: + visible: true + expiredPasswords: null + newUsers: null + failedCommands: null + consoleStats: + totalUsers: null + totalConfigurations: null + totalDevices: null + totalGroups: null + totalApplications: null + upcomingPasswordExpiration: null + officeHours: null + diskEncryption: null + mfaEnrolledDevices: null + userNotifications: + usersWithSambaAccess: null + usersWithoutDevices: null + visible: true + userWithAdminSudoPasswordlessAccess: null + usersWithoutPassword: null + usersWithAdminSudoAccess: null + userLockouts: null + mdmCertificateExpirations: null + failedConfigurations: null + learningCenter: null + newOSReleases: null + pendingCommands: null + jcUniversity: null + deviceNotifications: + agentOutOfDateMetric: null + inactiveMetric: null + visible: true + withoutPoliciesMetric: null + withoutUsersMetric: null + uptimeMetric: null + newSystemUserStateDefaults: + applicationImport: ACTIVATED + manualEntry: ACTIVATED + csvImport: ACTIVATED + features: + directoryInsights: + enabled: true + systemInsights: + enableNewLinux: true + enableNewWindows: true + createdAt: createdAt + enableNewDarwin: true + enabled: true + updatedAt: updatedAt + directoryInsightsPremium: + createdAt: createdAt + enabled: true + updatedAt: updatedAt + duplicateLDAPGroups: true + enableO365: true + systemUserPasswordExpirationInDays: 1 + enableGoogleApps: true + disableGoogleLogin: true + userPortal: + idleSessionDurationMinutes: 96652 + logo: logo + systemUsersCap: 0 + disableCommandRunner: true + disableUM: true + enableUserPortalAgentInstall: true + deviceIdentificationEnabled: true + enableManagedUID: true + passwordPolicy: + minChangePeriodInDays: 4 + minLength: 7 + enableResetLockoutCounter: true + enablePasswordExpirationInDays: true + enableMaxHistory: true + enableDaysAfterExpirationToSelfRecover: true + enableMaxLoginAttempts: true + daysAfterExpirationToSelfRecover: 2 + needsSymbolic: true + needsNumeric: true + needsUppercase: true + enableMinLength: true + enableRecoveryEmail: true + resetLockoutCounterMinutes: 1 + allowUsernameSubstring: true + maxHistory: 9 + maxLoginAttempts: 1 + passwordExpirationInDays: 1 + enableDaysBeforeExpirationToForceReset: true + enableMinChangePeriodInDays: true + gracePeriodDate: gracePeriodDate + needsLowercase: true + lockoutTimeInSeconds: 5043 + daysBeforeExpirationToForceReset: 1 + effectiveDate: effectiveDate + enableLockoutTimeInSeconds: true + contactEmail: contactEmail + contactName: contactName + growthData: {} + betaFeatures: {} + passwordCompliance: custom + name: name + agentVersion: agentVersion + systemUsersCanEdit: true + showIntro: true + pendingDelete: true + trustedAppConfig: + checksum: thisIsAnExampleChecksum1234 + trustedApps: + - path: /someuser/Applications/application1.app + teamid: FakeTeamID + name: Application 1 + - path: /someuser/Applications/application1.app + teamid: FakeTeamID + name: Application 1 + created: created + displayName: displayName + lastSfdcSyncStatus: {} + entitlement: + pricePerUserSum: 5 + billingModel: billingModel + entitlementProducts: + - committedUsers: 0 + productCode: productCode + contractType: contractType + uncommittedUsers: 5 + name: name + pricePerUser: 1 + maxUserCount: 6 + productCategory: productCategory + - committedUsers: 0 + productCode: productCode + contractType: contractType + uncommittedUsers: 5 + name: name + pricePerUser: 1 + maxUserCount: 6 + productCategory: productCategory + isManuallyBilled: true + hasStripeCustomerId: true + hasCreditCard: true + logoUrl: logoUrl + lastEstimateCalculationTimeStamp: lastEstimateCalculationTimeStamp + accountsReceivable: accountsReceivable + provider: provider + totalBillingEstimate: 1 + _id: _id + organizationentitlement: + title: OrganizationEntitlement + type: object + properties: + billingModel: + type: string + entitlementProducts: + type: array + items: + $ref: '#/components/schemas/organizationentitlement_entitlementProducts' + isManuallyBilled: + type: boolean + pricePerUserSum: + type: integer + description: "" + example: + pricePerUserSum: 5 + billingModel: billingModel + entitlementProducts: + - committedUsers: 0 + productCode: productCode + contractType: contractType + uncommittedUsers: 5 + name: name + pricePerUser: 1 + maxUserCount: 6 + productCategory: productCategory + - committedUsers: 0 + productCode: productCode + contractType: contractType + uncommittedUsers: 5 + name: name + pricePerUser: 1 + maxUserCount: 6 + productCategory: productCategory + isManuallyBilled: true + x-examples: {} + organizationsettings: + title: OrganizationSettings + type: object + properties: + agentVersion: + type: string + betaFeatures: + type: object + properties: {} + example: {} + contactEmail: + type: string + contactName: + type: string + deviceIdentificationEnabled: + type: boolean + disableCommandRunner: + type: boolean + disableGoogleLogin: + type: boolean + disableLdap: + type: boolean + disableUM: + type: boolean + displayPreferences: + $ref: '#/components/schemas/organizationsettings_displayPreferences' + duplicateLDAPGroups: + type: boolean + emailDisclaimer: + type: string + enableGoogleApps: + type: boolean + enableManagedUID: + type: boolean + enableO365: + type: boolean + enableUserPortalAgentInstall: + type: boolean + features: + $ref: '#/components/schemas/organizationsettings_features' + growthData: + type: object + properties: {} + description: Object containing Optimizely experimentIds and states corresponding + to them + example: {} + logo: + type: string + name: + type: string + newSystemUserStateDefaults: + $ref: '#/components/schemas/organizationsettings_newSystemUserStateDefaults' + passwordCompliance: + type: string + enum: + - custom + - pci3 + - windows + passwordPolicy: + $ref: '#/components/schemas/organizationsettings_passwordPolicy' + pendingDelete: + type: boolean + showIntro: + type: boolean + systemUserPasswordExpirationInDays: + type: integer + systemUsersCanEdit: + type: boolean + systemUsersCap: + minimum: 0 + type: integer + trustedAppConfig: + $ref: '#/components/schemas/trustedappConfigGet' + userPortal: + $ref: '#/components/schemas/organizationsettings_userPortal' + description: "" + example: + emailDisclaimer: emailDisclaimer + disableLdap: true + displayPreferences: + orgInsights: + fundamentals: null + applicationsUsage: + visible: true + expiredPasswords: null + newUsers: null + failedCommands: null + consoleStats: + totalUsers: null + totalConfigurations: null + totalDevices: null + totalGroups: null + totalApplications: null + upcomingPasswordExpiration: null + officeHours: null + diskEncryption: null + mfaEnrolledDevices: null + userNotifications: + usersWithSambaAccess: null + usersWithoutDevices: null + visible: true + userWithAdminSudoPasswordlessAccess: null + usersWithoutPassword: null + usersWithAdminSudoAccess: null + userLockouts: null + mdmCertificateExpirations: null + failedConfigurations: null + learningCenter: null + newOSReleases: null + pendingCommands: null + jcUniversity: null + deviceNotifications: + agentOutOfDateMetric: null + inactiveMetric: null + visible: true + withoutPoliciesMetric: null + withoutUsersMetric: null + uptimeMetric: null + newSystemUserStateDefaults: + applicationImport: ACTIVATED + manualEntry: ACTIVATED + csvImport: ACTIVATED + features: + directoryInsights: + enabled: true + systemInsights: + enableNewLinux: true + enableNewWindows: true + createdAt: createdAt + enableNewDarwin: true + enabled: true + updatedAt: updatedAt + directoryInsightsPremium: + createdAt: createdAt + enabled: true + updatedAt: updatedAt + duplicateLDAPGroups: true + enableO365: true + systemUserPasswordExpirationInDays: 1 + enableGoogleApps: true + disableGoogleLogin: true + userPortal: + idleSessionDurationMinutes: 96652 + logo: logo + systemUsersCap: 0 + disableCommandRunner: true + disableUM: true + enableUserPortalAgentInstall: true + deviceIdentificationEnabled: true + enableManagedUID: true + passwordPolicy: + minChangePeriodInDays: 4 + minLength: 7 + enableResetLockoutCounter: true + enablePasswordExpirationInDays: true + enableMaxHistory: true + enableDaysAfterExpirationToSelfRecover: true + enableMaxLoginAttempts: true + daysAfterExpirationToSelfRecover: 2 + needsSymbolic: true + needsNumeric: true + needsUppercase: true + enableMinLength: true + enableRecoveryEmail: true + resetLockoutCounterMinutes: 1 + allowUsernameSubstring: true + maxHistory: 9 + maxLoginAttempts: 1 + passwordExpirationInDays: 1 + enableDaysBeforeExpirationToForceReset: true + enableMinChangePeriodInDays: true + gracePeriodDate: gracePeriodDate + needsLowercase: true + lockoutTimeInSeconds: 5043 + daysBeforeExpirationToForceReset: 1 + effectiveDate: effectiveDate + enableLockoutTimeInSeconds: true + contactEmail: contactEmail + contactName: contactName + growthData: {} + betaFeatures: {} + passwordCompliance: custom + name: name + agentVersion: agentVersion + systemUsersCanEdit: true + showIntro: true + pendingDelete: true + trustedAppConfig: + checksum: thisIsAnExampleChecksum1234 + trustedApps: + - path: /someuser/Applications/application1.app + teamid: FakeTeamID + name: Application 1 + - path: /someuser/Applications/application1.app + teamid: FakeTeamID + name: Application 1 + x-examples: {} + organizationsettingsput: + title: OrganizationSettingsPut + type: object + properties: + contactEmail: + type: string + contactName: + type: string + deviceIdentificationEnabled: + type: boolean + disableGoogleLogin: + type: boolean + disableLdap: + type: boolean + disableUM: + type: boolean + duplicateLDAPGroups: + type: boolean + emailDisclaimer: + type: string + enableManagedUID: + type: boolean + features: + $ref: '#/components/schemas/organizationsettings_features' + growthData: + type: object + properties: {} + description: Object containing Optimizely experimentIds and states corresponding + to them + logo: + type: string + name: + type: string + newSystemUserStateDefaults: + $ref: '#/components/schemas/organizationsettingsput_newSystemUserStateDefaults' + passwordCompliance: + type: string + enum: + - custom + - pci3 + - windows + passwordPolicy: + $ref: '#/components/schemas/organizationsettingsput_passwordPolicy' + showIntro: + type: boolean + systemUserPasswordExpirationInDays: + type: integer + systemUsersCanEdit: + type: boolean + systemUsersCap: + minimum: 0 + type: integer + trustedAppConfig: + $ref: '#/components/schemas/trustedappConfigPut' + userPortal: + $ref: '#/components/schemas/organizationsettings_userPortal' + organizationslist: + title: OrganizationList + type: object + properties: + results: + type: array + description: The list of organizations. + items: + $ref: '#/components/schemas/organizationslist_results' + totalCount: + type: integer + description: 'The total number of organizations. ' + example: + totalCount: 0 + results: + - displayName: displayName + _id: _id + logoUrl: logoUrl + - displayName: displayName + _id: _id + logoUrl: logoUrl + radiusserver: + title: RadiusServer + type: object + properties: + _id: + type: string + authIdp: + type: string + enum: + - JUMPCLOUD + - AZURE + deviceCertEnabled: + type: boolean + mfa: + type: string + enum: + - DISABLED + - ENABLED + - REQUIRED + - ALWAYS + name: + type: string + networkSourceIp: + type: string + organization: + type: string + sharedSecret: + type: string + tagNames: + type: array + items: + type: string + tags: + type: array + items: + type: string + userCertEnabled: + type: boolean + userLockoutAction: + type: string + userPasswordEnabled: + type: boolean + userPasswordExpirationAction: + type: string + example: + userLockoutAction: userLockoutAction + deviceCertEnabled: true + userCertEnabled: true + mfa: DISABLED + userPasswordExpirationAction: userPasswordExpirationAction + tagNames: + - tagNames + - tagNames + tags: + - tags + - tags + networkSourceIp: networkSourceIp + organization: organization + name: name + userPasswordEnabled: true + _id: _id + authIdp: JUMPCLOUD + sharedSecret: sharedSecret + radiusserverpost: + title: RadiusServerPost + required: + - name + - networkSourceIp + - sharedSecret + type: object + properties: + authIdp: + type: string + enum: + - JUMPCLOUD + - AZURE + deviceCertEnabled: + type: boolean + mfa: + type: string + enum: + - DISABLED + - ENABLED + - REQUIRED + - ALWAYS + name: + type: string + networkSourceIp: + type: string + sharedSecret: + type: string + description: RADIUS shared secret between the server and client. + tagNames: + type: array + items: + type: string + userCertEnabled: + type: boolean + userLockoutAction: + type: string + userPasswordEnabled: + type: boolean + userPasswordExpirationAction: + type: string + radiusserverput: + title: RadiusServerPut + type: object + properties: + _id: + type: string + authIdp: + type: string + enum: + - JUMPCLOUD + - AZURE + deviceCertEnabled: + type: boolean + mfa: + type: string + enum: + - DISABLED + - ENABLED + - REQUIRED + - ALWAYS + name: + type: string + networkSourceIp: + type: string + tagNames: + type: array + items: + type: string + userCertEnabled: + type: boolean + userLockoutAction: + type: string + userPasswordEnabled: + type: boolean + userPasswordExpirationAction: + type: string + example: + networkSourceIp: networkSourceIp + userLockoutAction: userLockoutAction + deviceCertEnabled: true + userCertEnabled: true + name: name + mfa: DISABLED + userPasswordEnabled: true + userPasswordExpirationAction: userPasswordExpirationAction + _id: _id + authIdp: JUMPCLOUD + tagNames: + - tagNames + - tagNames + radiusserverslist: + title: RadiusServersList + type: object + properties: + results: + type: array + items: + $ref: '#/components/schemas/radiusserver' + totalCount: + type: integer + example: + totalCount: 0 + results: + - userLockoutAction: userLockoutAction + deviceCertEnabled: true + userCertEnabled: true + mfa: DISABLED + userPasswordExpirationAction: userPasswordExpirationAction + tagNames: + - tagNames + - tagNames + tags: + - tags + - tags + networkSourceIp: networkSourceIp + organization: organization + name: name + userPasswordEnabled: true + _id: _id + authIdp: JUMPCLOUD + sharedSecret: sharedSecret + - userLockoutAction: userLockoutAction + deviceCertEnabled: true + userCertEnabled: true + mfa: DISABLED + userPasswordExpirationAction: userPasswordExpirationAction + tagNames: + - tagNames + - tagNames + tags: + - tags + - tags + networkSourceIp: networkSourceIp + organization: organization + name: name + userPasswordEnabled: true + _id: _id + authIdp: JUMPCLOUD + sharedSecret: sharedSecret + search: + title: Search + type: object + properties: + fields: + type: string + filter: + type: object + properties: {} + searchFilter: + type: object + properties: {} + sshkeylist: + title: SSHKeyList + type: object + properties: + _id: + type: string + description: The ID of the SSH key. + create_date: + type: string + description: The date the SSH key was created. + name: + type: string + description: The name of the SSH key. + public_key: + type: string + description: The Public SSH key. + example: + public_key: public_key + name: name + _id: _id + create_date: create_date + sshkeypost: + title: SSHKeyPost + required: + - name + - public_key + type: object + properties: + name: + type: string + description: The name of the SSH key. + public_key: + type: string + description: The Public SSH key. + sso: + type: object + properties: + beta: + type: boolean + idpCertExpirationAt: + type: string + format: date-time + jit: + type: boolean + type: + type: string + example: + idpCertExpirationAt: 2000-01-23T04:56:07.000+00:00 + jit: true + type: type + beta: true + system: + title: System + type: object + properties: + _id: + type: string + active: + type: boolean + agentVersion: + type: string + allowMultiFactorAuthentication: + type: boolean + allowPublicKeyAuthentication: + type: boolean + allowSshPasswordAuthentication: + type: boolean + allowSshRootLogin: + type: boolean + amazonInstanceID: + type: string + arch: + type: string + azureAdJoined: + type: boolean + builtInCommands: + type: array + readOnly: true + items: + $ref: '#/components/schemas/system_builtInCommands' + connectionHistory: + type: array + items: + type: object + properties: {} + example: {} + created: + type: string + format: date-time + description: + type: string + displayManager: + type: string + displayName: + type: string + domainInfo: + $ref: '#/components/schemas/system_domainInfo' + fde: + $ref: '#/components/schemas/fde' + fileSystem: + type: string + nullable: true + hasServiceAccount: + type: boolean + hostname: + type: string + lastContact: + type: string + format: date-time + nullable: true + mdm: + $ref: '#/components/schemas/system_mdm' + modifySSHDConfig: + type: boolean + networkInterfaces: + type: array + items: + $ref: '#/components/schemas/system_networkInterfaces' + organization: + type: string + os: + type: string + osFamily: + type: string + osVersionDetail: + $ref: '#/components/schemas/system_osVersionDetail' + provisionMetadata: + $ref: '#/components/schemas/system_provisionMetadata' + remoteIP: + type: string + serialNumber: + type: string + serviceAccountState: + $ref: '#/components/schemas/system_serviceAccountState' + sshRootEnabled: + type: boolean + sshdParams: + type: array + items: + $ref: '#/components/schemas/system_sshdParams' + systemInsights: + $ref: '#/components/schemas/system_systemInsights' + systemTimezone: + type: integer + tags: + type: array + items: + type: string + templateName: + type: string + userMetrics: + type: array + items: + $ref: '#/components/schemas/system_userMetrics' + version: + type: string + example: + userMetrics: + - managed: true + admin: true + userName: userName + secureTokenEnabled: true + suspended: true + - managed: true + admin: true + userName: userName + secureTokenEnabled: true + suspended: true + allowSshRootLogin: true + hasServiceAccount: true + remoteIP: remoteIP + domainInfo: + domainName: domainName + partOfDomain: true + displayName: displayName + description: description + azureAdJoined: true + hostname: hostname + amazonInstanceID: amazonInstanceID + allowSshPasswordAuthentication: true + connectionHistory: + - {} + - {} + systemInsights: + state: enabled + builtInCommands: + - name: erase + type: security + - name: erase + type: security + displayManager: displayManager + fileSystem: fileSystem + osVersionDetail: + patch: patch + major: major + minor: minor + releaseName: releaseName + osName: osName + revision: revision + serialNumber: serialNumber + os: os + osFamily: osFamily + allowMultiFactorAuthentication: true + created: 2000-01-23T04:56:07.000+00:00 + fde: + active: true + keyPresent: true + modifySSHDConfig: true + provisionMetadata: + provisioner: + type: administrator + provisionerId: provisionerId + serviceAccountState: + hasSecureToken: true + passwordAPFSValid: true + passwordODValid: true + active: true + sshRootEnabled: true + version: version + lastContact: 2000-01-23T04:56:07.000+00:00 + tags: + - tags + - tags + allowPublicKeyAuthentication: true + networkInterfaces: + - internal: true + address: address + name: name + family: IPv4 + - internal: true + address: address + name: name + family: IPv4 + templateName: templateName + sshdParams: + - name: name + value: value + - name: name + value: value + mdm: + internal: + deviceId: deviceId + vendor: unknown + profileIdentifier: profileIdentifier + enrollmentType: unknown + userApproved: true + dep: true + organization: organization + agentVersion: agentVersion + _id: _id + arch: arch + systemTimezone: 0 + systemput: + title: SystemPut + type: object + properties: + agentBoundMessages: + type: array + items: + $ref: '#/components/schemas/systemput_agentBoundMessages' + allowMultiFactorAuthentication: + type: boolean + allowPublicKeyAuthentication: + type: boolean + allowSshPasswordAuthentication: + type: boolean + allowSshRootLogin: + type: boolean + displayName: + type: string + tags: + type: array + items: + type: string + systemslist: + title: SystemsList + type: object + properties: + results: + type: array + description: The list of systems. + items: + $ref: '#/components/schemas/system' + totalCount: + type: integer + description: The total number of systems. + example: + totalCount: 6 + results: + - userMetrics: + - managed: true + admin: true + userName: userName + secureTokenEnabled: true + suspended: true + - managed: true + admin: true + userName: userName + secureTokenEnabled: true + suspended: true + allowSshRootLogin: true + hasServiceAccount: true + remoteIP: remoteIP + domainInfo: + domainName: domainName + partOfDomain: true + displayName: displayName + description: description + azureAdJoined: true + hostname: hostname + amazonInstanceID: amazonInstanceID + allowSshPasswordAuthentication: true + connectionHistory: + - {} + - {} + systemInsights: + state: enabled + builtInCommands: + - name: erase + type: security + - name: erase + type: security + displayManager: displayManager + fileSystem: fileSystem + osVersionDetail: + patch: patch + major: major + minor: minor + releaseName: releaseName + osName: osName + revision: revision + serialNumber: serialNumber + os: os + osFamily: osFamily + allowMultiFactorAuthentication: true + created: 2000-01-23T04:56:07.000+00:00 + fde: + active: true + keyPresent: true + modifySSHDConfig: true + provisionMetadata: + provisioner: + type: administrator + provisionerId: provisionerId + serviceAccountState: + hasSecureToken: true + passwordAPFSValid: true + passwordODValid: true + active: true + sshRootEnabled: true + version: version + lastContact: 2000-01-23T04:56:07.000+00:00 + tags: + - tags + - tags + allowPublicKeyAuthentication: true + networkInterfaces: + - internal: true + address: address + name: name + family: IPv4 + - internal: true + address: address + name: name + family: IPv4 + templateName: templateName + sshdParams: + - name: name + value: value + - name: name + value: value + mdm: + internal: + deviceId: deviceId + vendor: unknown + profileIdentifier: profileIdentifier + enrollmentType: unknown + userApproved: true + dep: true + organization: organization + agentVersion: agentVersion + _id: _id + arch: arch + systemTimezone: 0 + - userMetrics: + - managed: true + admin: true + userName: userName + secureTokenEnabled: true + suspended: true + - managed: true + admin: true + userName: userName + secureTokenEnabled: true + suspended: true + allowSshRootLogin: true + hasServiceAccount: true + remoteIP: remoteIP + domainInfo: + domainName: domainName + partOfDomain: true + displayName: displayName + description: description + azureAdJoined: true + hostname: hostname + amazonInstanceID: amazonInstanceID + allowSshPasswordAuthentication: true + connectionHistory: + - {} + - {} + systemInsights: + state: enabled + builtInCommands: + - name: erase + type: security + - name: erase + type: security + displayManager: displayManager + fileSystem: fileSystem + osVersionDetail: + patch: patch + major: major + minor: minor + releaseName: releaseName + osName: osName + revision: revision + serialNumber: serialNumber + os: os + osFamily: osFamily + allowMultiFactorAuthentication: true + created: 2000-01-23T04:56:07.000+00:00 + fde: + active: true + keyPresent: true + modifySSHDConfig: true + provisionMetadata: + provisioner: + type: administrator + provisionerId: provisionerId + serviceAccountState: + hasSecureToken: true + passwordAPFSValid: true + passwordODValid: true + active: true + sshRootEnabled: true + version: version + lastContact: 2000-01-23T04:56:07.000+00:00 + tags: + - tags + - tags + allowPublicKeyAuthentication: true + networkInterfaces: + - internal: true + address: address + name: name + family: IPv4 + - internal: true + address: address + name: name + family: IPv4 + templateName: templateName + sshdParams: + - name: name + value: value + - name: name + value: value + mdm: + internal: + deviceId: deviceId + vendor: unknown + profileIdentifier: profileIdentifier + enrollmentType: unknown + userApproved: true + dep: true + organization: organization + agentVersion: agentVersion + _id: _id + arch: arch + systemTimezone: 0 + systemuserput: + title: SystemUserPut + type: object + properties: + account_locked: + type: boolean + addresses: + type: array + description: "type, poBox, extendedAddress, streetAddress, locality, region,\ + \ postalCode, country" + items: + $ref: '#/components/schemas/systemuserput_addresses' + allow_public_key: + type: boolean + alternateEmail: + type: string + attributes: + type: array + items: + $ref: '#/components/schemas/systemuserput_attributes' + company: + maxLength: 1024 + type: string + costCenter: + maxLength: 1024 + type: string + department: + maxLength: 1024 + type: string + description: + maxLength: 1024 + type: string + disableDeviceMaxLoginAttempts: + type: boolean + displayname: + maxLength: 1024 + type: string + email: + maxLength: 1024 + type: string + employeeIdentifier: + maxLength: 256 + type: string + description: 'Must be unique per user. ' + employeeType: + maxLength: 1024 + type: string + enable_managed_uid: + type: boolean + enable_user_portal_multifactor: + type: boolean + external_dn: + type: string + external_password_expiration_date: + type: string + external_source_type: + type: string + externally_managed: + type: boolean + firstname: + maxLength: 1024 + type: string + jobTitle: + maxLength: 1024 + type: string + lastname: + maxLength: 1024 + type: string + ldap_binding_user: + type: boolean + location: + maxLength: 1024 + type: string + managedAppleId: + maxLength: 1024 + type: string + manager: + type: string + description: Relation with another systemuser to identify the last as a + manager. + mfa: + $ref: '#/components/schemas/mfa' + middlename: + maxLength: 1024 + type: string + password: + type: string + password_never_expires: + type: boolean + phoneNumbers: + type: array + items: + $ref: '#/components/schemas/systemuserput_phoneNumbers' + public_key: + type: string + relationships: + type: array + items: + $ref: '#/components/schemas/systemuserput_relationships' + samba_service_user: + type: boolean + ssh_keys: + type: array + items: + $ref: '#/components/schemas/sshkeypost' + state: + type: string + enum: + - ACTIVATED + - SUSPENDED + sudo: + type: boolean + suspended: + type: boolean + tags: + type: array + items: + type: string + unix_guid: + minimum: 1 + type: integer + unix_uid: + minimum: 1 + type: integer + username: + maxLength: 1024 + type: string + systemuserputpost: + title: SystemUserPost + required: + - email + - username + type: object + properties: + account_locked: + type: boolean + activated: + type: boolean + addresses: + type: array + items: + $ref: '#/components/schemas/systemuserputpost_addresses' + allow_public_key: + type: boolean + alternateEmail: + type: string + attributes: + type: array + items: + $ref: '#/components/schemas/systemuserput_attributes' + company: + type: string + costCenter: + type: string + department: + type: string + description: + maxLength: 1024 + type: string + disableDeviceMaxLoginAttempts: + type: boolean + displayname: + type: string + email: + maxLength: 1024 + type: string + employeeIdentifier: + maxLength: 256 + type: string + description: 'Must be unique per user. ' + employeeType: + type: string + enable_managed_uid: + type: boolean + enable_user_portal_multifactor: + type: boolean + external_dn: + type: string + external_password_expiration_date: + type: string + format: date-time + external_source_type: + type: string + externally_managed: + type: boolean + firstname: + type: string + jobTitle: + type: string + lastname: + type: string + ldap_binding_user: + type: boolean + location: + type: string + managedAppleId: + maxLength: 1024 + type: string + manager: + type: string + description: Relation with another systemuser to identify the last as a + manager. + mfa: + $ref: '#/components/schemas/mfa' + middlename: + type: string + password: + type: string + password_never_expires: + type: boolean + passwordless_sudo: + type: boolean + phoneNumbers: + type: array + items: + $ref: '#/components/schemas/systemuserputpost_phoneNumbers' + public_key: + type: string + recoveryEmail: + $ref: '#/components/schemas/systemuserputpost_recoveryEmail' + relationships: + type: array + items: + $ref: '#/components/schemas/systemuserput_relationships' + samba_service_user: + type: boolean + state: + type: string + enum: + - STAGED + - ACTIVATED + - SUSPENDED + sudo: + type: boolean + suspended: + type: boolean + tags: + type: array + items: + type: string + unix_guid: + minimum: 1 + type: integer + unix_uid: + minimum: 1 + type: integer + username: + type: string + systemuserreturn: + title: SystemUserReturn + type: object + properties: + _id: + type: string + account_locked: + type: boolean + account_locked_date: + type: string + nullable: true + activated: + type: boolean + addresses: + type: array + items: + $ref: '#/components/schemas/systemuserreturn_addresses' + allow_public_key: + type: boolean + alternateEmail: + type: string + attributes: + type: array + items: + $ref: '#/components/schemas/systemuserput_attributes' + badLoginAttempts: + minimum: 0 + type: integer + company: + maxLength: 1024 + type: string + costCenter: + maxLength: 1024 + type: string + created: + type: string + creationSource: + maxLength: 1024 + type: string + department: + maxLength: 1024 + type: string + description: + maxLength: 1024 + type: string + disableDeviceMaxLoginAttempts: + type: boolean + displayname: + maxLength: 1024 + type: string + email: + maxLength: 1024 + type: string + employeeIdentifier: + maxLength: 256 + type: string + description: 'Must be unique per user. ' + employeeType: + maxLength: 1024 + type: string + enable_managed_uid: + type: boolean + enable_user_portal_multifactor: + type: boolean + external_dn: + type: string + external_password_expiration_date: + type: string + external_source_type: + type: string + externally_managed: + type: boolean + firstname: + maxLength: 1024 + type: string + jobTitle: + maxLength: 1024 + type: string + lastname: + maxLength: 1024 + type: string + ldap_binding_user: + type: boolean + location: + maxLength: 1024 + type: string + managedAppleId: + maxLength: 1024 + type: string + manager: + type: string + description: Relation with another systemuser to identify the last as a + manager. + mfa: + $ref: '#/components/schemas/mfa' + mfaEnrollment: + $ref: '#/components/schemas/mfaEnrollment' + middlename: + maxLength: 1024 + type: string + organization: + type: string + password_expiration_date: + type: string + nullable: true + password_expired: + type: boolean + password_never_expires: + type: boolean + passwordless_sudo: + type: boolean + phoneNumbers: + type: array + items: + $ref: '#/components/schemas/systemuserreturn_phoneNumbers' + public_key: + type: string + recoveryEmail: + $ref: '#/components/schemas/systemuserreturn_recoveryEmail' + relationships: + type: array + items: + $ref: '#/components/schemas/systemuserput_relationships' + samba_service_user: + type: boolean + ssh_keys: + type: array + items: + $ref: '#/components/schemas/sshkeylist' + state: + type: string + enum: + - STAGED + - ACTIVATED + - SUSPENDED + sudo: + type: boolean + suspended: + type: boolean + tags: + type: array + items: + type: string + totp_enabled: + type: boolean + unix_guid: + minimum: 1 + type: integer + unix_uid: + minimum: 1 + type: integer + username: + maxLength: 1024 + type: string + example: + public_key: public_key + addresses: + - country: country + poBox: poBox + streetAddress: streetAddress + postalCode: postalCode + locality: locality + id: id + extendedAddress: extendedAddress + region: region + type: type + - country: country + poBox: poBox + streetAddress: streetAddress + postalCode: postalCode + locality: locality + id: id + extendedAddress: extendedAddress + region: region + type: type + badLoginAttempts: 0 + jobTitle: jobTitle + allow_public_key: true + disableDeviceMaxLoginAttempts: true + relationships: + - type: type + value: value + - type: type + value: value + passwordless_sudo: true + externally_managed: true + password_expiration_date: password_expiration_date + state: STAGED + recoveryEmail: + address: address + verified: true + verifiedAt: verifiedAt + external_password_expiration_date: external_password_expiration_date + password_expired: true + account_locked_date: account_locked_date + costCenter: costCenter + created: created + external_source_type: external_source_type + suspended: true + lastname: lastname + tags: + - tags + - tags + ssh_keys: + - public_key: public_key + name: name + _id: _id + create_date: create_date + - public_key: public_key + name: name + _id: _id + create_date: create_date + password_never_expires: true + _id: _id + external_dn: external_dn + firstname: firstname + account_locked: true + totp_enabled: true + unix_guid: 1 + description: description + samba_service_user: true + phoneNumbers: + - number: number + id: id + type: type + - number: number + id: id + type: type + unix_uid: 1 + ldap_binding_user: true + company: company + sudo: true + department: department + email: email + alternateEmail: alternateEmail + enable_managed_uid: true + creationSource: creationSource + manager: manager + mfa: + configured: true + exclusion: true + exclusionDays: 1 + exclusionUntil: 2000-01-23T04:56:07.000+00:00 + middlename: middlename + employeeIdentifier: employeeIdentifier + employeeType: employeeType + managedAppleId: managedAppleId + displayname: displayname + organization: organization + enable_user_portal_multifactor: true + attributes: + - name: name + value: value + - name: name + value: value + location: location + mfaEnrollment: + totpStatus: null + pushStatus: null + overallStatus: NOT_ENROLLED + webAuthnStatus: null + activated: true + username: username + systemuserslist: + title: SystemUsersList + type: object + properties: + results: + type: array + description: The list of system users. + items: + $ref: '#/components/schemas/systemuserreturn' + totalCount: + type: integer + description: The total number of system users. + example: + totalCount: 5 + results: + - public_key: public_key + addresses: + - country: country + poBox: poBox + streetAddress: streetAddress + postalCode: postalCode + locality: locality + id: id + extendedAddress: extendedAddress + region: region + type: type + - country: country + poBox: poBox + streetAddress: streetAddress + postalCode: postalCode + locality: locality + id: id + extendedAddress: extendedAddress + region: region + type: type + badLoginAttempts: 0 + jobTitle: jobTitle + allow_public_key: true + disableDeviceMaxLoginAttempts: true + relationships: + - type: type + value: value + - type: type + value: value + passwordless_sudo: true + externally_managed: true + password_expiration_date: password_expiration_date + state: STAGED + recoveryEmail: + address: address + verified: true + verifiedAt: verifiedAt + external_password_expiration_date: external_password_expiration_date + password_expired: true + account_locked_date: account_locked_date + costCenter: costCenter + created: created + external_source_type: external_source_type + suspended: true + lastname: lastname + tags: + - tags + - tags + ssh_keys: + - public_key: public_key + name: name + _id: _id + create_date: create_date + - public_key: public_key + name: name + _id: _id + create_date: create_date + password_never_expires: true + _id: _id + external_dn: external_dn + firstname: firstname + account_locked: true + totp_enabled: true + unix_guid: 1 + description: description + samba_service_user: true + phoneNumbers: + - number: number + id: id + type: type + - number: number + id: id + type: type + unix_uid: 1 + ldap_binding_user: true + company: company + sudo: true + department: department + email: email + alternateEmail: alternateEmail + enable_managed_uid: true + creationSource: creationSource + manager: manager + mfa: + configured: true + exclusion: true + exclusionDays: 1 + exclusionUntil: 2000-01-23T04:56:07.000+00:00 + middlename: middlename + employeeIdentifier: employeeIdentifier + employeeType: employeeType + managedAppleId: managedAppleId + displayname: displayname + organization: organization + enable_user_portal_multifactor: true + attributes: + - name: name + value: value + - name: name + value: value + location: location + mfaEnrollment: + totpStatus: null + pushStatus: null + overallStatus: NOT_ENROLLED + webAuthnStatus: null + activated: true + username: username + - public_key: public_key + addresses: + - country: country + poBox: poBox + streetAddress: streetAddress + postalCode: postalCode + locality: locality + id: id + extendedAddress: extendedAddress + region: region + type: type + - country: country + poBox: poBox + streetAddress: streetAddress + postalCode: postalCode + locality: locality + id: id + extendedAddress: extendedAddress + region: region + type: type + badLoginAttempts: 0 + jobTitle: jobTitle + allow_public_key: true + disableDeviceMaxLoginAttempts: true + relationships: + - type: type + value: value + - type: type + value: value + passwordless_sudo: true + externally_managed: true + password_expiration_date: password_expiration_date + state: STAGED + recoveryEmail: + address: address + verified: true + verifiedAt: verifiedAt + external_password_expiration_date: external_password_expiration_date + password_expired: true + account_locked_date: account_locked_date + costCenter: costCenter + created: created + external_source_type: external_source_type + suspended: true + lastname: lastname + tags: + - tags + - tags + ssh_keys: + - public_key: public_key + name: name + _id: _id + create_date: create_date + - public_key: public_key + name: name + _id: _id + create_date: create_date + password_never_expires: true + _id: _id + external_dn: external_dn + firstname: firstname + account_locked: true + totp_enabled: true + unix_guid: 1 + description: description + samba_service_user: true + phoneNumbers: + - number: number + id: id + type: type + - number: number + id: id + type: type + unix_uid: 1 + ldap_binding_user: true + company: company + sudo: true + department: department + email: email + alternateEmail: alternateEmail + enable_managed_uid: true + creationSource: creationSource + manager: manager + mfa: + configured: true + exclusion: true + exclusionDays: 1 + exclusionUntil: 2000-01-23T04:56:07.000+00:00 + middlename: middlename + employeeIdentifier: employeeIdentifier + employeeType: employeeType + managedAppleId: managedAppleId + displayname: displayname + organization: organization + enable_user_portal_multifactor: true + attributes: + - name: name + value: value + - name: name + value: value + location: location + mfaEnrollment: + totpStatus: null + pushStatus: null + overallStatus: NOT_ENROLLED + webAuthnStatus: null + activated: true + username: username + triggerreturn: + title: TriggerReturn + type: object + properties: + triggered: + type: array + items: + type: string + example: + triggered: + - triggered + - triggered + trustedappConfigGet: + title: trustedappConfigGet + required: + - checksum + - trustedApps + type: object + properties: + checksum: + type: string + description: Checksum to validate the trustedApp configuration for the organization + example: thisIsAnExampleChecksum1234 + trustedApps: + minItems: 1 + type: array + description: 'List of authorized apps for the organization ' + items: + $ref: '#/components/schemas/trustedappConfigGet_trustedApps' + description: Object containing information about the list of trusted applications + for the organization + example: + checksum: thisIsAnExampleChecksum1234 + trustedApps: + - path: /someuser/Applications/application1.app + teamid: FakeTeamID + name: Application 1 + - path: /someuser/Applications/application1.app + teamid: FakeTeamID + name: Application 1 + trustedappConfigPut: + title: trustedappConfigPut + required: + - trustedApps + type: object + properties: + trustedApps: + minItems: 1 + type: array + description: 'List of authorized apps for the organization ' + items: + $ref: '#/components/schemas/trustedappConfigGet_trustedApps' + description: Object containing information about the list of trusted applications + for the organization + userput: + title: UserPut + type: object + properties: + email: + maxLength: 1024 + type: string + format: email + enableMultiFactor: + type: boolean + firstname: + type: string + growthData: + type: object + properties: {} + lastWhatsNewChecked: + type: string + format: date + lastname: + type: string + roleName: + type: string + userreturn: + title: UserReturn + type: object + properties: + _id: + type: string + created: + type: string + format: date-time + disableIntroduction: + type: boolean + email: + type: string + enableMultiFactor: + type: boolean + firstname: + type: string + growthData: + $ref: '#/components/schemas/userreturn_growthData' + lastWhatsNewChecked: + type: string + format: date-time + lastname: + type: string + organization: + type: string + provider: + type: string + role: + type: string + roleName: + type: string + sessionCount: + type: integer + suspended: + type: boolean + totpEnrolled: + type: boolean + usersTimeZone: + type: string + example: + firstname: firstname + role: role + created: 2000-01-23T04:56:07.000+00:00 + usersTimeZone: usersTimeZone + enableMultiFactor: true + disableIntroduction: true + totpEnrolled: true + growthData: + experimentStates: {} + onboardingState: {} + suspended: true + lastname: lastname + provider: provider + sessionCount: 0 + organization: organization + roleName: roleName + _id: _id + email: email + lastWhatsNewChecked: 2000-01-23T04:56:07.000+00:00 + organizations_id_body: + type: object + properties: + settings: + $ref: '#/components/schemas/organizationsettingsput' + radiusservers_id_body: + required: + - name + - networkSourceIp + - sharedSecret + type: object + properties: + deviceCertEnabled: + type: boolean + mfa: + type: string + enum: + - DISABLED + - ENABLED + - REQUIRED + - ALWAYS + name: + type: string + networkSourceIp: + type: string + sharedSecret: + type: string + tags: + type: array + items: + type: string + userCertEnabled: + type: boolean + userLockoutAction: + type: string + userPasswordEnabled: + type: boolean + userPasswordExpirationAction: + type: string + example: + name: test radius + networkSourceIp: 0.0.0.0 + sharedSecret: secretradiuspassword + tagsNames: + - tag1 + id_resetmfa_body: + type: object + properties: + exclusion: + type: boolean + exclusionDays: + minimum: 1 + type: number + exclusionUntil: + type: string + format: date-time + state_activate_body: + type: object + properties: + email: + type: object + properties: {} + application_config_acsUrl_tooltip_variables: + type: object + properties: + icon: + type: string + message: + type: string + example: + icon: icon + message: message + application_config_acsUrl_tooltip: + type: object + properties: + template: + type: string + variables: + $ref: '#/components/schemas/application_config_acsUrl_tooltip_variables' + example: + template: template + variables: + icon: icon + message: message + application_config_acsUrl: + type: object + properties: + label: + type: string + options: + type: string + position: + type: integer + readOnly: + type: boolean + required: + type: boolean + toggle: + type: string + tooltip: + $ref: '#/components/schemas/application_config_acsUrl_tooltip' + type: + type: string + value: + type: string + visible: + type: boolean + example: + visible: true + options: options + tooltip: + template: template + variables: + icon: icon + message: message + readOnly: true + toggle: toggle + label: label + position: 0 + type: type + value: value + required: true + application_config_constantAttributes_value: + type: object + properties: + name: + type: string + readOnly: + type: boolean + required: + type: boolean + value: + type: string + visible: + type: boolean + example: + visible: true + name: name + readOnly: true + value: value + required: true + application_config_constantAttributes: + type: object + properties: + label: + type: string + mutable: + type: boolean + position: + type: integer + readOnly: + type: boolean + required: + type: boolean + tooltip: + $ref: '#/components/schemas/application_config_acsUrl_tooltip' + type: + type: string + value: + type: array + items: + $ref: '#/components/schemas/application_config_constantAttributes_value' + visible: + type: boolean + example: + visible: true + mutable: true + tooltip: null + readOnly: true + label: label + position: 6 + type: type + value: + - visible: true + name: name + readOnly: true + value: value + required: true + - visible: true + name: name + readOnly: true + value: value + required: true + required: true + application_config_databaseAttributes: + type: object + properties: + position: + type: integer + example: + position: 1 + application_config: + type: object + properties: + acsUrl: + $ref: '#/components/schemas/application_config_acsUrl' + constantAttributes: + $ref: '#/components/schemas/application_config_constantAttributes' + databaseAttributes: + $ref: '#/components/schemas/application_config_databaseAttributes' + idpCertificate: + $ref: '#/components/schemas/application_config_acsUrl' + idpEntityId: + $ref: '#/components/schemas/application_config_acsUrl' + idpPrivateKey: + $ref: '#/components/schemas/application_config_acsUrl' + spEntityId: + $ref: '#/components/schemas/application_config_acsUrl' + example: + acsUrl: + visible: true + options: options + tooltip: + template: template + variables: + icon: icon + message: message + readOnly: true + toggle: toggle + label: label + position: 0 + type: type + value: value + required: true + constantAttributes: + visible: true + mutable: true + tooltip: null + readOnly: true + label: label + position: 6 + type: type + value: + - visible: true + name: name + readOnly: true + value: value + required: true + - visible: true + name: name + readOnly: true + value: value + required: true + required: true + idpCertificate: null + spEntityId: null + databaseAttributes: + position: 1 + idpPrivateKey: null + idpEntityId: null + application_logo: + type: object + properties: + color: + type: string + enum: + - "" + - '#202D38' + - '#005466' + - '#3E8696' + - '#006CAC' + - '#0617AC' + - '#7C6ADA' + - '#D5779D' + - '#9E2F00' + - '#FFB000' + - '#58C469' + - '#57C49F' + - '#FF6C03' + url: + type: string + example: + color: "" + url: url + applicationtemplate_jit: + type: object + properties: + attributes: + type: object + properties: {} + example: {} + createOnly: + type: boolean + example: + createOnly: true + attributes: {} + applicationtemplate_logo: + type: object + properties: + url: + type: string + example: + url: url + applicationtemplate_oidc: + type: object + properties: + grantTypes: + type: array + description: The grant types allowed. Currently only authorization_code + is allowed. + items: + type: string + enum: + - authorization_code + redirectUris: + type: array + description: List of allowed redirectUris + items: + type: string + ssoUrl: + type: string + description: The relying party url to trigger an oidc login. + tokenEndpointAuthMethod: + type: string + description: "Method that the client uses to authenticate when requesting\ + \ a token. If 'none', then the client must use PKCE. If 'client_secret_post',\ + \ then the secret is passed in the post body when requesting the token." + enum: + - none + - client_secret_post + example: + grantTypes: + - authorization_code + - authorization_code + ssoUrl: ssoUrl + tokenEndpointAuthMethod: none + redirectUris: + - redirectUris + - redirectUris + applicationtemplate_provision: + type: object + properties: + beta: + type: boolean + groups_supported: + type: boolean + type: + type: string + example: + groups_supported: true + type: type + beta: true + commandfilereturn_results: + type: object + properties: + _id: + type: string + description: The ID of the file. + destination: + type: string + description: The location where the file will be stored. + name: + type: string + description: The file name. + example: + destination: destination + name: name + _id: _id + commandresult_response_data: + type: object + properties: + exitCode: + type: integer + description: The stderr output from the command that ran. + output: + type: string + description: The output of the command that was executed. + example: + output: output + exitCode: 0 + commandresult_response: + type: object + properties: + data: + $ref: '#/components/schemas/commandresult_response_data' + error: + type: string + description: The stderr output from the command that ran. + id: + type: string + description: ID of the response. + example: + data: + output: output + exitCode: 0 + id: id + error: error + commandresultslist_results: + type: object + properties: + _id: + type: string + description: The ID of the command result. + command: + type: string + description: The command that was executed on the system. + exitCode: + type: integer + description: The stderr output from the command that ran. + name: + type: string + description: The name of the command. + requestTime: + type: string + description: The time (UTC) that the command was sent. + format: date-time + responseTime: + type: string + description: The time (UTC) that the command was completed. + format: date-time + sudo: + type: boolean + description: If the user had sudo rights. + system: + type: string + description: The display name of the system the command was executed on. + systemId: + type: string + description: The id of the system the command was executed on. + user: + type: string + description: The user the command ran as. + workflowId: + type: string + description: The id for the command that ran on the system. + example: + requestTime: 2000-01-23T04:56:07.000+00:00 + systemId: systemId + system: system + responseTime: 2000-01-23T04:56:07.000+00:00 + name: name + exitCode: 0 + _id: _id + sudo: true + user: user + command: command + workflowId: workflowId + commandslist_results: + type: object + properties: + _id: + type: string + description: The ID of the command. + command: + type: string + description: The Command to execute. + commandType: + type: string + description: The Command OS. + launchType: + type: string + description: How the Command is executed. + listensTo: + type: string + name: + type: string + description: The name of the Command. + organization: + type: string + description: The ID of the Organization. + schedule: + type: string + description: "A crontab that consists of: [ (seconds) (minutes) (hours)\ + \ (days of month) (months) (weekdays) ] or [ immediate ]. If you send\ + \ this as an empty string, it will run immediately." + scheduleRepeatType: + type: string + description: When the command will repeat. + trigger: + type: string + description: Trigger to execute command. + example: + schedule: schedule + scheduleRepeatType: scheduleRepeatType + commandType: commandType + organization: organization + name: name + _id: _id + listensTo: listensTo + trigger: trigger + command: command + launchType: launchType + organizationentitlement_entitlementProducts: + type: object + properties: + committedUsers: + type: integer + contractType: + type: string + maxUserCount: + type: integer + name: + type: string + pricePerUser: + type: integer + productCategory: + type: string + productCode: + type: string + uncommittedUsers: + type: integer + example: + committedUsers: 0 + productCode: productCode + contractType: contractType + uncommittedUsers: 5 + name: name + pricePerUser: 1 + maxUserCount: 6 + productCategory: productCategory + organizationsettings_displayPreferences_orgInsights_applicationsUsage: + type: object + properties: + visible: + type: boolean + example: + visible: true + organizationsettings_displayPreferences_orgInsights_consoleStats: + type: object + properties: + totalApplications: + $ref: '#/components/schemas/organizationsettings_displayPreferences_orgInsights_applicationsUsage' + totalConfigurations: + $ref: '#/components/schemas/organizationsettings_displayPreferences_orgInsights_applicationsUsage' + totalDevices: + $ref: '#/components/schemas/organizationsettings_displayPreferences_orgInsights_applicationsUsage' + totalGroups: + $ref: '#/components/schemas/organizationsettings_displayPreferences_orgInsights_applicationsUsage' + totalUsers: + $ref: '#/components/schemas/organizationsettings_displayPreferences_orgInsights_applicationsUsage' + example: + totalUsers: null + totalConfigurations: null + totalDevices: null + totalGroups: null + totalApplications: null + organizationsettings_displayPreferences_orgInsights_deviceNotifications: + type: object + properties: + agentOutOfDateMetric: + $ref: '#/components/schemas/organizationsettings_displayPreferences_orgInsights_applicationsUsage' + inactiveMetric: + $ref: '#/components/schemas/organizationsettings_displayPreferences_orgInsights_applicationsUsage' + uptimeMetric: + $ref: '#/components/schemas/organizationsettings_displayPreferences_orgInsights_applicationsUsage' + visible: + type: boolean + withoutPoliciesMetric: + $ref: '#/components/schemas/organizationsettings_displayPreferences_orgInsights_applicationsUsage' + withoutUsersMetric: + $ref: '#/components/schemas/organizationsettings_displayPreferences_orgInsights_applicationsUsage' + example: + agentOutOfDateMetric: null + inactiveMetric: null + visible: true + withoutPoliciesMetric: null + withoutUsersMetric: null + uptimeMetric: null + organizationsettings_displayPreferences_orgInsights_userNotifications: + type: object + properties: + userWithAdminSudoPasswordlessAccess: + $ref: '#/components/schemas/organizationsettings_displayPreferences_orgInsights_applicationsUsage' + usersWithAdminSudoAccess: + $ref: '#/components/schemas/organizationsettings_displayPreferences_orgInsights_applicationsUsage' + usersWithSambaAccess: + $ref: '#/components/schemas/organizationsettings_displayPreferences_orgInsights_applicationsUsage' + usersWithoutDevices: + $ref: '#/components/schemas/organizationsettings_displayPreferences_orgInsights_applicationsUsage' + usersWithoutPassword: + $ref: '#/components/schemas/organizationsettings_displayPreferences_orgInsights_applicationsUsage' + visible: + type: boolean + example: + usersWithSambaAccess: null + usersWithoutDevices: null + visible: true + userWithAdminSudoPasswordlessAccess: null + usersWithoutPassword: null + usersWithAdminSudoAccess: null + organizationsettings_displayPreferences_orgInsights: + type: object + properties: + applicationsUsage: + $ref: '#/components/schemas/organizationsettings_displayPreferences_orgInsights_applicationsUsage' + consoleStats: + $ref: '#/components/schemas/organizationsettings_displayPreferences_orgInsights_consoleStats' + deviceNotifications: + $ref: '#/components/schemas/organizationsettings_displayPreferences_orgInsights_deviceNotifications' + diskEncryption: + $ref: '#/components/schemas/organizationsettings_displayPreferences_orgInsights_applicationsUsage' + expiredPasswords: + $ref: '#/components/schemas/organizationsettings_displayPreferences_orgInsights_applicationsUsage' + failedCommands: + $ref: '#/components/schemas/organizationsettings_displayPreferences_orgInsights_applicationsUsage' + failedConfigurations: + $ref: '#/components/schemas/organizationsettings_displayPreferences_orgInsights_applicationsUsage' + fundamentals: + $ref: '#/components/schemas/organizationsettings_displayPreferences_orgInsights_applicationsUsage' + jcUniversity: + $ref: '#/components/schemas/organizationsettings_displayPreferences_orgInsights_applicationsUsage' + learningCenter: + $ref: '#/components/schemas/organizationsettings_displayPreferences_orgInsights_applicationsUsage' + mdmCertificateExpirations: + $ref: '#/components/schemas/organizationsettings_displayPreferences_orgInsights_applicationsUsage' + mfaEnrolledDevices: + $ref: '#/components/schemas/organizationsettings_displayPreferences_orgInsights_applicationsUsage' + newOSReleases: + $ref: '#/components/schemas/organizationsettings_displayPreferences_orgInsights_applicationsUsage' + newUsers: + $ref: '#/components/schemas/organizationsettings_displayPreferences_orgInsights_applicationsUsage' + officeHours: + $ref: '#/components/schemas/organizationsettings_displayPreferences_orgInsights_applicationsUsage' + pendingCommands: + $ref: '#/components/schemas/organizationsettings_displayPreferences_orgInsights_applicationsUsage' + upcomingPasswordExpiration: + $ref: '#/components/schemas/organizationsettings_displayPreferences_orgInsights_applicationsUsage' + userLockouts: + $ref: '#/components/schemas/organizationsettings_displayPreferences_orgInsights_applicationsUsage' + userNotifications: + $ref: '#/components/schemas/organizationsettings_displayPreferences_orgInsights_userNotifications' + example: + fundamentals: null + applicationsUsage: + visible: true + expiredPasswords: null + newUsers: null + failedCommands: null + consoleStats: + totalUsers: null + totalConfigurations: null + totalDevices: null + totalGroups: null + totalApplications: null + upcomingPasswordExpiration: null + officeHours: null + diskEncryption: null + mfaEnrolledDevices: null + userNotifications: + usersWithSambaAccess: null + usersWithoutDevices: null + visible: true + userWithAdminSudoPasswordlessAccess: null + usersWithoutPassword: null + usersWithAdminSudoAccess: null + userLockouts: null + mdmCertificateExpirations: null + failedConfigurations: null + learningCenter: null + newOSReleases: null + pendingCommands: null + jcUniversity: null + deviceNotifications: + agentOutOfDateMetric: null + inactiveMetric: null + visible: true + withoutPoliciesMetric: null + withoutUsersMetric: null + uptimeMetric: null + organizationsettings_displayPreferences: + type: object + properties: + orgInsights: + $ref: '#/components/schemas/organizationsettings_displayPreferences_orgInsights' + example: + orgInsights: + fundamentals: null + applicationsUsage: + visible: true + expiredPasswords: null + newUsers: null + failedCommands: null + consoleStats: + totalUsers: null + totalConfigurations: null + totalDevices: null + totalGroups: null + totalApplications: null + upcomingPasswordExpiration: null + officeHours: null + diskEncryption: null + mfaEnrolledDevices: null + userNotifications: + usersWithSambaAccess: null + usersWithoutDevices: null + visible: true + userWithAdminSudoPasswordlessAccess: null + usersWithoutPassword: null + usersWithAdminSudoAccess: null + userLockouts: null + mdmCertificateExpirations: null + failedConfigurations: null + learningCenter: null + newOSReleases: null + pendingCommands: null + jcUniversity: null + deviceNotifications: + agentOutOfDateMetric: null + inactiveMetric: null + visible: true + withoutPoliciesMetric: null + withoutUsersMetric: null + uptimeMetric: null + organizationsettings_features_directoryInsights: + type: object + properties: + enabled: + type: boolean + example: + enabled: true + organizationsettings_features_directoryInsightsPremium: + type: object + properties: + createdAt: + type: string + enabled: + type: boolean + updatedAt: + type: string + example: + createdAt: createdAt + enabled: true + updatedAt: updatedAt + organizationsettings_features_systemInsights: + type: object + properties: + createdAt: + type: string + enableNewDarwin: + type: boolean + enableNewLinux: + type: boolean + enableNewWindows: + type: boolean + enabled: + type: boolean + updatedAt: + type: string + example: + enableNewLinux: true + enableNewWindows: true + createdAt: createdAt + enableNewDarwin: true + enabled: true + updatedAt: updatedAt + organizationsettings_features: + type: object + properties: + directoryInsights: + $ref: '#/components/schemas/organizationsettings_features_directoryInsights' + directoryInsightsPremium: + $ref: '#/components/schemas/organizationsettings_features_directoryInsightsPremium' + systemInsights: + $ref: '#/components/schemas/organizationsettings_features_systemInsights' + example: + directoryInsights: + enabled: true + systemInsights: + enableNewLinux: true + enableNewWindows: true + createdAt: createdAt + enableNewDarwin: true + enabled: true + updatedAt: updatedAt + directoryInsightsPremium: + createdAt: createdAt + enabled: true + updatedAt: updatedAt + organizationsettings_newSystemUserStateDefaults: + type: object + properties: + applicationImport: + type: string + description: "The default user state for a user created using the\n[Bulk\ + \ Users Create](https://docs.jumpcloud.com/api/2.0/index.html#operation/bulk_usersCreate)\n\ + endpoint. See endpoint documentation for more details." + enum: + - ACTIVATED + - STAGED + csvImport: + type: string + description: "The default user state for a user created using the\n[Bulk\ + \ Users Create](https://docs.jumpcloud.com/api/2.0/index.html#operation/bulk_usersCreate)\n\ + endpoint. See endpoint documentation for more details." + enum: + - ACTIVATED + - STAGED + manualEntry: + type: string + description: "The default state for a user that is created using the\n[Create\ + \ a system user](https://docs.jumpcloud.com/api/1.0/index.html#operation/systemusers_post)\n\ + endpoint. See endpoint documentation for more details." + enum: + - ACTIVATED + - STAGED + example: + applicationImport: ACTIVATED + manualEntry: ACTIVATED + csvImport: ACTIVATED + organizationsettings_passwordPolicy: + type: object + properties: + allowUsernameSubstring: + type: boolean + daysAfterExpirationToSelfRecover: + type: integer + description: Deprecated field used for the legacy grace period feature. + daysBeforeExpirationToForceReset: + minimum: 1 + type: integer + effectiveDate: + type: string + enableDaysAfterExpirationToSelfRecover: + type: boolean + enableDaysBeforeExpirationToForceReset: + type: boolean + enableLockoutTimeInSeconds: + type: boolean + enableMaxHistory: + type: boolean + enableMaxLoginAttempts: + type: boolean + enableMinChangePeriodInDays: + type: boolean + enableMinLength: + type: boolean + enablePasswordExpirationInDays: + type: boolean + enableRecoveryEmail: + type: boolean + enableResetLockoutCounter: + type: boolean + gracePeriodDate: + type: string + lockoutTimeInSeconds: + maximum: 5400 + minimum: 300 + type: integer + maxHistory: + maximum: 24 + minimum: 1 + type: integer + maxLoginAttempts: + minimum: 1 + type: integer + minChangePeriodInDays: + type: integer + minLength: + type: integer + needsLowercase: + type: boolean + needsNumeric: + type: boolean + needsSymbolic: + type: boolean + needsUppercase: + type: boolean + passwordExpirationInDays: + minimum: 1 + type: integer + resetLockoutCounterMinutes: + minimum: 1 + type: integer + example: + minChangePeriodInDays: 4 + minLength: 7 + enableResetLockoutCounter: true + enablePasswordExpirationInDays: true + enableMaxHistory: true + enableDaysAfterExpirationToSelfRecover: true + enableMaxLoginAttempts: true + daysAfterExpirationToSelfRecover: 2 + needsSymbolic: true + needsNumeric: true + needsUppercase: true + enableMinLength: true + enableRecoveryEmail: true + resetLockoutCounterMinutes: 1 + allowUsernameSubstring: true + maxHistory: 9 + maxLoginAttempts: 1 + passwordExpirationInDays: 1 + enableDaysBeforeExpirationToForceReset: true + enableMinChangePeriodInDays: true + gracePeriodDate: gracePeriodDate + needsLowercase: true + lockoutTimeInSeconds: 5043 + daysBeforeExpirationToForceReset: 1 + effectiveDate: effectiveDate + enableLockoutTimeInSeconds: true + organizationsettings_userPortal: + type: object + properties: + idleSessionDurationMinutes: + maximum: 129600 + minimum: 1 + type: integer + example: + idleSessionDurationMinutes: 96652 + organizationsettingsput_newSystemUserStateDefaults: + type: object + properties: + applicationImport: + type: string + enum: + - ACTIVATED + - STAGED + csvImport: + type: string + enum: + - ACTIVATED + - STAGED + manualEntry: + type: string + enum: + - ACTIVATED + - STAGED + organizationsettingsput_passwordPolicy: + type: object + properties: + allowUsernameSubstring: + type: boolean + daysAfterExpirationToSelfRecover: + type: integer + description: Deprecated field used for the legacy grace period feature. + daysBeforeExpirationToForceReset: + minimum: 1 + type: integer + effectiveDate: + type: string + enableDaysAfterExpirationToSelfRecover: + type: boolean + enableDaysBeforeExpirationToForceReset: + type: boolean + enableLockoutTimeInSeconds: + type: boolean + enableMaxHistory: + type: boolean + enableMaxLoginAttempts: + type: boolean + enableMinChangePeriodInDays: + type: boolean + enableMinLength: + type: boolean + enablePasswordExpirationInDays: + type: boolean + gracePeriodDate: + type: string + lockoutTimeInSeconds: + type: integer + maxHistory: + maximum: 24 + minimum: 1 + type: integer + maxLoginAttempts: + minimum: 1 + type: integer + minChangePeriodInDays: + type: integer + minLength: + type: integer + needsLowercase: + type: boolean + needsNumeric: + type: boolean + needsSymbolic: + type: boolean + needsUppercase: + type: boolean + passwordExpirationInDays: + minimum: 1 + type: integer + organizationslist_results: + type: object + properties: + _id: + type: string + description: The ID of the organization. + displayName: + type: string + description: The name of the organization. + logoUrl: + type: string + description: 'The organization logo image URL. ' + example: + displayName: displayName + _id: _id + logoUrl: logoUrl + system_builtInCommands: + type: object + properties: + name: + type: string + enum: + - erase + - lock + - restart + - shutdown + type: + type: string + enum: + - security + example: + name: erase + type: security + system_domainInfo: + type: object + properties: + domainName: + type: string + partOfDomain: + type: boolean + example: + domainName: domainName + partOfDomain: true + system_mdm_internal: + type: object + properties: + deviceId: + type: string + example: + deviceId: deviceId + system_mdm: + type: object + properties: + dep: + type: boolean + enrollmentType: + type: string + enum: + - unknown + - automated device + - device + - user + internal: + $ref: '#/components/schemas/system_mdm_internal' + profileIdentifier: + type: string + userApproved: + type: boolean + vendor: + type: string + enum: + - unknown + - none + - internal + - external + example: + internal: + deviceId: deviceId + vendor: unknown + profileIdentifier: profileIdentifier + enrollmentType: unknown + userApproved: true + dep: true + system_networkInterfaces: + type: object + properties: + address: + type: string + family: + type: string + enum: + - IPv4 + - IPv6 + internal: + type: boolean + name: + type: string + example: + internal: true + address: address + name: name + family: IPv4 + system_osVersionDetail: + type: object + properties: + major: + type: string + minor: + type: string + osName: + type: string + patch: + type: string + releaseName: + type: string + revision: + type: string + example: + patch: patch + major: major + minor: minor + releaseName: releaseName + osName: osName + revision: revision + system_provisionMetadata_provisioner: + type: object + properties: + provisionerId: + type: string + type: + type: string + default: administrator + enum: + - administrator + - mdm + - user + example: + type: administrator + provisionerId: provisionerId + system_provisionMetadata: + type: object + properties: + provisioner: + $ref: '#/components/schemas/system_provisionMetadata_provisioner' + example: + provisioner: + type: administrator + provisionerId: provisionerId + system_serviceAccountState: + type: object + properties: + hasSecureToken: + type: boolean + passwordAPFSValid: + type: boolean + passwordODValid: + type: boolean + example: + hasSecureToken: true + passwordAPFSValid: true + passwordODValid: true + system_sshdParams: + type: object + properties: + name: + type: string + value: + type: string + example: + name: name + value: value + system_systemInsights: + type: object + properties: + state: + type: string + enum: + - enabled + - disabled + - deferred + example: + state: enabled + system_userMetrics: + type: object + properties: + admin: + type: boolean + managed: + type: boolean + secureTokenEnabled: + type: boolean + suspended: + type: boolean + userName: + type: string + example: + managed: true + admin: true + userName: userName + secureTokenEnabled: true + suspended: true + systemput_agentBoundMessages: + type: object + properties: + cmd: + type: string + systemuserput_addresses: + type: object + properties: + country: + maxLength: 1024 + type: string + extendedAddress: + maxLength: 1024 + type: string + locality: + maxLength: 1024 + type: string + poBox: + maxLength: 1024 + type: string + postalCode: + maxLength: 1024 + type: string + region: + maxLength: 1024 + type: string + streetAddress: + maxLength: 1024 + type: string + type: + maxLength: 1024 + type: string + systemuserput_attributes: + type: object + properties: + name: + type: string + value: + maxLength: 1024 + type: string + example: + name: name + value: value + systemuserput_phoneNumbers: + type: object + properties: + number: + maxLength: 1024 + type: string + type: + maxLength: 1024 + type: string + systemuserput_relationships: + type: object + properties: + type: + type: string + value: + type: string + example: + type: type + value: value + systemuserputpost_addresses: + type: object + properties: + country: + type: string + extendedAddress: + type: string + locality: + type: string + poBox: + type: string + postalCode: + type: string + region: + type: string + streetAddress: + type: string + type: + type: string + systemuserputpost_phoneNumbers: + type: object + properties: + number: + type: string + type: + type: string + systemuserputpost_recoveryEmail: + type: object + properties: + address: + type: string + systemuserreturn_addresses: + type: object + properties: + country: + maxLength: 1024 + type: string + extendedAddress: + maxLength: 1024 + type: string + id: + type: string + locality: + maxLength: 1024 + type: string + poBox: + maxLength: 1024 + type: string + postalCode: + maxLength: 1024 + type: string + region: + maxLength: 1024 + type: string + streetAddress: + maxLength: 1024 + type: string + type: + maxLength: 1024 + type: string + example: + country: country + poBox: poBox + streetAddress: streetAddress + postalCode: postalCode + locality: locality + id: id + extendedAddress: extendedAddress + region: region + type: type + systemuserreturn_phoneNumbers: + type: object + properties: + id: + type: string + number: + maxLength: 1024 + type: string + type: + maxLength: 1024 + type: string + example: + number: number + id: id + type: type + systemuserreturn_recoveryEmail: + type: object + properties: + address: + type: string + verified: + type: boolean + verifiedAt: + type: string + example: + address: address + verified: true + verifiedAt: verifiedAt + trustedappConfigGet_trustedApps: + required: + - name + type: object + properties: + name: + type: string + description: Name of the trusted application + example: Application 1 + path: + type: string + description: Absolute path for the app's location in user's device + example: /someuser/Applications/application1.app + teamid: + type: string + description: App's Team ID + example: FakeTeamID + description: Represents an application that is going to be trusted by the organization + example: + path: /someuser/Applications/application1.app + teamid: FakeTeamID + name: Application 1 + userreturn_growthData: + type: object + properties: + experimentStates: + type: object + properties: {} + example: {} + onboardingState: + type: object + properties: {} + example: {} + example: + experimentStates: {} + onboardingState: {} + responses: + trait:standardErrors:400: + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + trait:standardErrors:401: + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + trait:standardErrors:403: + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + trait:standardErrors:404: + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + trait:standardErrors:409: + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + trait:standardErrors:500: + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + parameters: + trait:fields:fields: + name: fields + in: query + description: "Use a space seperated string of field parameters to include the\ + \ data in the response. If omitted, the default list of fields will be returned.\n" + required: false + style: form + explode: true + schema: + type: string + trait:filter:filter: + name: filter + in: query + description: "A filter to apply to the query. See the supported operators below.\ + \ For more complex searches,\nsee the related `/search/` endpoints,\n\ + e.g. `/search/systems`.\n\n**Filter structure**: `::`.\n\ + \n**field** = Populate with a valid field from an endpoint response.\n\n**operator**\ + \ = Supported operators are:\n- `$eq` (equals)\n- `$ne` (does not equal)\n\ + - `$gt` (is greater than)\n- `$gte` (is greater than or equal to)\n- `$lt`\ + \ (is less than)\n- `$lte` (is less than or equal to)\n\n_Note: v1 operators\ + \ differ from v2 operators._\n\n_Note: For v1 operators, excluding the `$`\ + \ will result in undefined behavior._\n\n**value** = Populate with the value\ + \ you want to search for. Is case sensitive.\n\n**Examples**\n- `GET /users?filter=username:$eq:testuser`\n\ + - `GET /systemusers?filter=password_expiration_date:$lte:2021-10-24`\n- `GET\ + \ /systemusers?filter=department:$ne:Accounting`\n- `GET /systems?filter[0]=firstname:$eq:foo&filter[1]=lastname:$eq:bar`\ + \ - this will\n AND the filters together.\n- `GET /systems?filter[or][0]=lastname:$eq:foo&filter[or][1]=lastname:$eq:bar`\ + \ - this will\n OR the filters together." + required: false + style: form + explode: true + schema: + type: string + trait:limit:limit: + name: limit + in: query + description: The number of records to return at once. Limited to 100. + required: false + style: form + explode: true + schema: + type: integer + default: 10 + trait:multiTenantRequestHeaders:x-org-id: + name: x-org-id + in: header + required: false + style: simple + explode: false + schema: + type: string + trait:search:search: + name: search + in: query + description: A nested object containing a `searchTerm` string or array of strings + and a list of `fields` to search on. + required: false + style: form + explode: true + schema: + type: string + trait:skip:skip: + name: skip + in: query + description: The offset into the records to return. + required: false + style: form + explode: true + schema: + minimum: 0 + type: integer + default: 0 + trait:sort:sort: + name: sort + in: query + description: | + Use space separated sort parameters to sort the collection. + Default sort is ascending. Prefix with `-` to sort descending. + required: false + style: form + explode: true + schema: + type: string + trait:systemContextAuth:Authorization: + name: Authorization + in: header + description: Authorization header for the System Context API + required: false + style: simple + explode: false + schema: + type: string + trait:systemContextAuth:Date: + name: Date + in: header + description: Current date header for the System Context API + required: false + style: simple + explode: false + schema: + type: string + securitySchemes: + x-api-key: + type: apiKey + name: x-api-key + in: header +x-scopes: +- administrators +- applications +- applications.readonly +- applicationtemplates +- applicationtemplates.readonly +- commandrunner.legacy +- commands +- commands.readonly +- organizations +- organizations.readonly +- radius +- radius.readonly +- systems +- systems.readonly +- systems.self +- users +- users.readonly +x-tagGroups: +- name: endpoints + tags: + - Application Templates + - Applications + - Command Results + - Command Triggers + - Commands + - Managed Service Provider + - Organizations + - Radius Servers + - Search + - Systems + - Systemusers + - Users +x-original-swagger-version: "2.0" diff --git a/jcapiv1/api_application_templates.go b/jcapiv1/api_application_templates.go new file mode 100644 index 0000000..a8d25fb --- /dev/null +++ b/jcapiv1/api_application_templates.go @@ -0,0 +1,292 @@ + +/* + * JumpCloud API + * + * # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 1.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv1 + +import ( + "context" + "io/ioutil" + "net/http" + "net/url" + "strings" + "fmt" + "github.com/antihax/optional" +) + +// Linger please +var ( + _ context.Context +) + +type ApplicationTemplatesApiService service +/* +ApplicationTemplatesApiService Get an Application Template +The endpoint returns a specific SSO / SAML Application Template. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/application-templates/{id} \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param id + * @param optional nil or *ApplicationTemplatesApiApplicationTemplatesGetOpts - Optional Parameters: + * @param "Fields" (optional.String) - The space separated fields included in the returned records. If omitted the default list of fields will be returned. + * @param "Limit" (optional.Int32) - The number of records to return at once. + * @param "Skip" (optional.Int32) - The offset into the records to return. + * @param "Sort" (optional.String) - The space separated fields used to sort the collection. Default sort is ascending, prefix with - to sort descending. + * @param "Filter" (optional.String) - A filter to apply to the query. See the supported operators below. For more complex searches, see the related `/search/<domain>` endpoints, e.g. `/search/systems`. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: - `$eq` (equals) - `$ne` (does not equal) - `$gt` (is greater than) - `$gte` (is greater than or equal to) - `$lt` (is less than) - `$lte` (is less than or equal to) _Note: v1 operators differ from v2 operators._ _Note: For v1 operators, excluding the `$` will result in undefined behavior._ **value** = Populate with the value you want to search for. Is case sensitive. **Examples** - `GET /users?filter=username:$eq:testuser` - `GET /systemusers?filter=password_expiration_date:$lte:2021-10-24` - `GET /systemusers?filter=department:$ne:Accounting` - `GET /systems?filter[0]=firstname:$eq:foo&filter[1]=lastname:$eq:bar` - this will AND the filters together. - `GET /systems?filter[or][0]=lastname:$eq:foo&filter[or][1]=lastname:$eq:bar` - this will OR the filters together. + * @param "XOrgId" (optional.String) - +@return Applicationtemplate +*/ + +type ApplicationTemplatesApiApplicationTemplatesGetOpts struct { + Fields optional.String + Limit optional.Int32 + Skip optional.Int32 + Sort optional.String + Filter optional.String + XOrgId optional.String +} + +func (a *ApplicationTemplatesApiService) ApplicationTemplatesGet(ctx context.Context, id string, localVarOptionals *ApplicationTemplatesApiApplicationTemplatesGetOpts) (Applicationtemplate, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue Applicationtemplate + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/application-templates/{id}" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Fields.IsSet() { + localVarQueryParams.Add("fields", parameterToString(localVarOptionals.Fields.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { + localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Skip.IsSet() { + localVarQueryParams.Add("skip", parameterToString(localVarOptionals.Skip.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Sort.IsSet() { + localVarQueryParams.Add("sort", parameterToString(localVarOptionals.Sort.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Filter.IsSet() { + localVarQueryParams.Add("filter", parameterToString(localVarOptionals.Filter.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v Applicationtemplate + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +ApplicationTemplatesApiService List Application Templates +The endpoint returns all the SSO / SAML Application Templates. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/application-templates \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param optional nil or *ApplicationTemplatesApiApplicationTemplatesListOpts - Optional Parameters: + * @param "Fields" (optional.String) - The space separated fields included in the returned records. If omitted the default list of fields will be returned. + * @param "Limit" (optional.Int32) - The number of records to return at once. + * @param "Skip" (optional.Int32) - The offset into the records to return. + * @param "Sort" (optional.String) - The space separated fields used to sort the collection. Default sort is ascending, prefix with - to sort descending. + * @param "Filter" (optional.String) - A filter to apply to the query. See the supported operators below. For more complex searches, see the related `/search/<domain>` endpoints, e.g. `/search/systems`. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: - `$eq` (equals) - `$ne` (does not equal) - `$gt` (is greater than) - `$gte` (is greater than or equal to) - `$lt` (is less than) - `$lte` (is less than or equal to) _Note: v1 operators differ from v2 operators._ _Note: For v1 operators, excluding the `$` will result in undefined behavior._ **value** = Populate with the value you want to search for. Is case sensitive. **Examples** - `GET /users?filter=username:$eq:testuser` - `GET /systemusers?filter=password_expiration_date:$lte:2021-10-24` - `GET /systemusers?filter=department:$ne:Accounting` - `GET /systems?filter[0]=firstname:$eq:foo&filter[1]=lastname:$eq:bar` - this will AND the filters together. - `GET /systems?filter[or][0]=lastname:$eq:foo&filter[or][1]=lastname:$eq:bar` - this will OR the filters together. + * @param "XOrgId" (optional.String) - +@return Applicationtemplateslist +*/ + +type ApplicationTemplatesApiApplicationTemplatesListOpts struct { + Fields optional.String + Limit optional.Int32 + Skip optional.Int32 + Sort optional.String + Filter optional.String + XOrgId optional.String +} + +func (a *ApplicationTemplatesApiService) ApplicationTemplatesList(ctx context.Context, localVarOptionals *ApplicationTemplatesApiApplicationTemplatesListOpts) (Applicationtemplateslist, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue Applicationtemplateslist + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/application-templates" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Fields.IsSet() { + localVarQueryParams.Add("fields", parameterToString(localVarOptionals.Fields.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { + localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Skip.IsSet() { + localVarQueryParams.Add("skip", parameterToString(localVarOptionals.Skip.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Sort.IsSet() { + localVarQueryParams.Add("sort", parameterToString(localVarOptionals.Sort.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Filter.IsSet() { + localVarQueryParams.Add("filter", parameterToString(localVarOptionals.Filter.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v Applicationtemplateslist + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} diff --git a/jcapiv1/api_applications.go b/jcapiv1/api_applications.go new file mode 100644 index 0000000..2a21cfc --- /dev/null +++ b/jcapiv1/api_applications.go @@ -0,0 +1,625 @@ + +/* + * JumpCloud API + * + * # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 1.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv1 + +import ( + "context" + "io/ioutil" + "net/http" + "net/url" + "strings" + "fmt" + "github.com/antihax/optional" +) + +// Linger please +var ( + _ context.Context +) + +type ApplicationsApiService service +/* +ApplicationsApiService Delete an Application +The endpoint deletes an SSO / SAML Application. + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param id + * @param optional nil or *ApplicationsApiApplicationsDeleteOpts - Optional Parameters: + * @param "XOrgId" (optional.String) - +@return Application +*/ + +type ApplicationsApiApplicationsDeleteOpts struct { + XOrgId optional.String +} + +func (a *ApplicationsApiService) ApplicationsDelete(ctx context.Context, id string, localVarOptionals *ApplicationsApiApplicationsDeleteOpts) (Application, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Delete") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue Application + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/applications/{id}" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v Application + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +ApplicationsApiService Get an Application +The endpoint retrieves an SSO / SAML Application. + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param id + * @param optional nil or *ApplicationsApiApplicationsGetOpts - Optional Parameters: + * @param "XOrgId" (optional.String) - +@return Application +*/ + +type ApplicationsApiApplicationsGetOpts struct { + XOrgId optional.String +} + +func (a *ApplicationsApiService) ApplicationsGet(ctx context.Context, id string, localVarOptionals *ApplicationsApiApplicationsGetOpts) (Application, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue Application + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/applications/{id}" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v Application + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +ApplicationsApiService Applications +The endpoint returns all your SSO / SAML Applications. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/applications \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param optional nil or *ApplicationsApiApplicationsListOpts - Optional Parameters: + * @param "Fields" (optional.String) - The space separated fields included in the returned records. If omitted the default list of fields will be returned. + * @param "Limit" (optional.Int32) - The number of records to return at once. + * @param "Skip" (optional.Int32) - The offset into the records to return. + * @param "Sort" (optional.String) - The space separated fields used to sort the collection. Default sort is ascending, prefix with - to sort descending. + * @param "Filter" (optional.String) - A filter to apply to the query. See the supported operators below. For more complex searches, see the related `/search/<domain>` endpoints, e.g. `/search/systems`. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: - `$eq` (equals) - `$ne` (does not equal) - `$gt` (is greater than) - `$gte` (is greater than or equal to) - `$lt` (is less than) - `$lte` (is less than or equal to) _Note: v1 operators differ from v2 operators._ _Note: For v1 operators, excluding the `$` will result in undefined behavior._ **value** = Populate with the value you want to search for. Is case sensitive. **Examples** - `GET /users?filter=username:$eq:testuser` - `GET /systemusers?filter=password_expiration_date:$lte:2021-10-24` - `GET /systemusers?filter=department:$ne:Accounting` - `GET /systems?filter[0]=firstname:$eq:foo&filter[1]=lastname:$eq:bar` - this will AND the filters together. - `GET /systems?filter[or][0]=lastname:$eq:foo&filter[or][1]=lastname:$eq:bar` - this will OR the filters together. + * @param "XOrgId" (optional.String) - +@return Applicationslist +*/ + +type ApplicationsApiApplicationsListOpts struct { + Fields optional.String + Limit optional.Int32 + Skip optional.Int32 + Sort optional.String + Filter optional.String + XOrgId optional.String +} + +func (a *ApplicationsApiService) ApplicationsList(ctx context.Context, localVarOptionals *ApplicationsApiApplicationsListOpts) (Applicationslist, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue Applicationslist + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/applications" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Fields.IsSet() { + localVarQueryParams.Add("fields", parameterToString(localVarOptionals.Fields.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { + localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Skip.IsSet() { + localVarQueryParams.Add("skip", parameterToString(localVarOptionals.Skip.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Sort.IsSet() { + localVarQueryParams.Add("sort", parameterToString(localVarOptionals.Sort.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Filter.IsSet() { + localVarQueryParams.Add("filter", parameterToString(localVarOptionals.Filter.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v Applicationslist + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +ApplicationsApiService Create an Application +The endpoint adds a new SSO / SAML Applications. + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param optional nil or *ApplicationsApiApplicationsPostOpts - Optional Parameters: + * @param "Body" (optional.Interface of Application) - + * @param "XOrgId" (optional.String) - +@return Application +*/ + +type ApplicationsApiApplicationsPostOpts struct { + Body optional.Interface + XOrgId optional.String +} + +func (a *ApplicationsApiService) ApplicationsPost(ctx context.Context, localVarOptionals *ApplicationsApiApplicationsPostOpts) (Application, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Post") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue Application + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/applications" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + // body params + if localVarOptionals != nil && localVarOptionals.Body.IsSet() { + + localVarOptionalBody:= localVarOptionals.Body.Value() + localVarPostBody = &localVarOptionalBody + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v Application + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 400 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +ApplicationsApiService Update an Application +The endpoint updates a SSO / SAML Application. Any fields not provided will be reset or created with default values. + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param id + * @param optional nil or *ApplicationsApiApplicationsPutOpts - Optional Parameters: + * @param "Body" (optional.Interface of Application) - + * @param "XOrgId" (optional.String) - +@return Application +*/ + +type ApplicationsApiApplicationsPutOpts struct { + Body optional.Interface + XOrgId optional.String +} + +func (a *ApplicationsApiService) ApplicationsPut(ctx context.Context, id string, localVarOptionals *ApplicationsApiApplicationsPutOpts) (Application, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Put") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue Application + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/applications/{id}" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + // body params + if localVarOptionals != nil && localVarOptionals.Body.IsSet() { + + localVarOptionalBody:= localVarOptionals.Body.Value() + localVarPostBody = &localVarOptionalBody + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v Application + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 400 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} diff --git a/jcapiv1/api_client.go b/jcapiv1/api_client.go new file mode 100644 index 0000000..eb022a6 --- /dev/null +++ b/jcapiv1/api_client.go @@ -0,0 +1,451 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 1.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package jcapiv1 + +import ( + "bytes" + "encoding/json" + "encoding/xml" + "fmt" + "errors" + "io" + "mime/multipart" + "golang.org/x/oauth2" + "golang.org/x/net/context" + "net/http" + "net/url" + "time" + "os" + "path/filepath" + "reflect" + "regexp" + "strings" + "unicode/utf8" + "strconv" +) + +var ( + jsonCheck = regexp.MustCompile("(?i:[application|text]/json)") + xmlCheck = regexp.MustCompile("(?i:[application|text]/xml)") +) + +// APIClient manages communication with the JumpCloud API API v1.0 +// In most cases there should be only one, shared, APIClient. +type APIClient struct { + cfg *Configuration + common service // Reuse a single struct instead of allocating one for each service on the heap. + + // API Services + ApplicationTemplatesApi *ApplicationTemplatesApiService + ApplicationsApi *ApplicationsApiService + CommandResultsApi *CommandResultsApiService + CommandTriggersApi *CommandTriggersApiService + CommandsApi *CommandsApiService + ManagedServiceProviderApi *ManagedServiceProviderApiService + OrganizationsApi *OrganizationsApiService + RadiusServersApi *RadiusServersApiService + SearchApi *SearchApiService + SystemsApi *SystemsApiService + SystemusersApi *SystemusersApiService + UsersApi *UsersApiService +} + +type service struct { + client *APIClient +} + +// NewAPIClient creates a new API client. Requires a userAgent string describing your application. +// optionally a custom http.Client to allow for advanced features such as caching. +func NewAPIClient(cfg *Configuration) *APIClient { + if cfg.HTTPClient == nil { + cfg.HTTPClient = http.DefaultClient + } + + c := &APIClient{} + c.cfg = cfg + c.common.client = c + + // API Services + c.ApplicationTemplatesApi = (*ApplicationTemplatesApiService)(&c.common) + c.ApplicationsApi = (*ApplicationsApiService)(&c.common) + c.CommandResultsApi = (*CommandResultsApiService)(&c.common) + c.CommandTriggersApi = (*CommandTriggersApiService)(&c.common) + c.CommandsApi = (*CommandsApiService)(&c.common) + c.ManagedServiceProviderApi = (*ManagedServiceProviderApiService)(&c.common) + c.OrganizationsApi = (*OrganizationsApiService)(&c.common) + c.RadiusServersApi = (*RadiusServersApiService)(&c.common) + c.SearchApi = (*SearchApiService)(&c.common) + c.SystemsApi = (*SystemsApiService)(&c.common) + c.SystemusersApi = (*SystemusersApiService)(&c.common) + c.UsersApi = (*UsersApiService)(&c.common) + + return c +} + +func atoi(in string) (int, error) { + return strconv.Atoi(in) +} + + +// selectHeaderContentType select a content type from the available list. +func selectHeaderContentType(contentTypes []string) string { + if len(contentTypes) == 0 { + return "" + } + if contains(contentTypes, "application/json") { + return "application/json" + } + return contentTypes[0] // use the first content type specified in 'consumes' +} + +// selectHeaderAccept join all accept types and return +func selectHeaderAccept(accepts []string) string { + if len(accepts) == 0 { + return "" + } + + if contains(accepts, "application/json") { + return "application/json" + } + + return strings.Join(accepts, ",") +} + +// contains is a case insenstive match, finding needle in a haystack +func contains(haystack []string, needle string) bool { + for _, a := range haystack { + if strings.ToLower(a) == strings.ToLower(needle) { + return true + } + } + return false +} + +// Verify optional parameters are of the correct type. +func typeCheckParameter(obj interface{}, expected string, name string) error { + // Make sure there is an object. + if obj == nil { + return nil + } + + // Check the type is as expected. + if reflect.TypeOf(obj).String() != expected { + return fmt.Errorf("Expected %s to be of type %s but received %s.", name, expected, reflect.TypeOf(obj).String()) + } + return nil +} + +// parameterToString convert interface{} parameters to string, using a delimiter if format is provided. +func parameterToString(obj interface{}, collectionFormat string) string { + var delimiter string + + switch collectionFormat { + case "pipes": + delimiter = "|" + case "ssv": + delimiter = " " + case "tsv": + delimiter = "\t" + case "csv": + delimiter = "," + } + + if reflect.TypeOf(obj).Kind() == reflect.Slice { + return strings.Trim(strings.Replace(fmt.Sprint(obj), " ", delimiter, -1), "[]") + } + + return fmt.Sprintf("%v", obj) +} + +// callAPI do the request. +func (c *APIClient) callAPI(request *http.Request) (*http.Response, error) { + return c.cfg.HTTPClient.Do(request) +} + +// Change base path to allow switching to mocks +func (c *APIClient) ChangeBasePath (path string) { + c.cfg.BasePath = path +} + +// prepareRequest build the request +func (c *APIClient) prepareRequest ( + ctx context.Context, + path string, method string, + postBody interface{}, + headerParams map[string]string, + queryParams url.Values, + formParams url.Values, + fileName string, + fileBytes []byte) (localVarRequest *http.Request, err error) { + + var body *bytes.Buffer + + // Detect postBody type and post. + if postBody != nil { + contentType := headerParams["Content-Type"] + if contentType == "" { + contentType = detectContentType(postBody) + headerParams["Content-Type"] = contentType + } + + body, err = setBody(postBody, contentType) + if err != nil { + return nil, err + } + } + + // add form parameters and file if available. + if len(formParams) > 0 || (len(fileBytes) > 0 && fileName != "") { + if body != nil { + return nil, errors.New("Cannot specify postBody and multipart form at the same time.") + } + body = &bytes.Buffer{} + w := multipart.NewWriter(body) + + for k, v := range formParams { + for _, iv := range v { + if strings.HasPrefix(k, "@") { // file + err = addFile(w, k[1:], iv) + if err != nil { + return nil, err + } + } else { // form value + w.WriteField(k, iv) + } + } + } + if len(fileBytes) > 0 && fileName != "" { + w.Boundary() + //_, fileNm := filepath.Split(fileName) + part, err := w.CreateFormFile("file", filepath.Base(fileName)) + if err != nil { + return nil, err + } + _, err = part.Write(fileBytes) + if err != nil { + return nil, err + } + // Set the Boundary in the Content-Type + headerParams["Content-Type"] = w.FormDataContentType() + } + + // Set Content-Length + headerParams["Content-Length"] = fmt.Sprintf("%d", body.Len()) + w.Close() + } + + // Setup path and query parameters + url, err := url.Parse(path) + if err != nil { + return nil, err + } + + // Adding Query Param + query := url.Query() + for k, v := range queryParams { + for _, iv := range v { + query.Add(k, iv) + } + } + + // Encode the parameters. + url.RawQuery = query.Encode() + + // Generate a new request + if body != nil { + localVarRequest, err = http.NewRequest(method, url.String(), body) + } else { + localVarRequest, err = http.NewRequest(method, url.String(), nil) + } + if err != nil { + return nil, err + } + + // add header parameters, if any + if len(headerParams) > 0 { + headers := http.Header{} + for h, v := range headerParams { + headers.Set(h, v) + } + localVarRequest.Header = headers + } + + // Override request host, if applicable + if c.cfg.Host != "" { + localVarRequest.Host = c.cfg.Host + } + + // Add the user agent to the request. + localVarRequest.Header.Add("User-Agent", c.cfg.UserAgent) + + + if ctx != nil { + // add context to the request + localVarRequest = localVarRequest.WithContext(ctx) + + // Walk through any authentication. + + // OAuth2 authentication + if tok, ok := ctx.Value(ContextOAuth2).(oauth2.TokenSource); ok { + // We were able to grab an oauth2 token from the context + var latestToken *oauth2.Token + if latestToken, err = tok.Token(); err != nil { + return nil, err + } + + latestToken.SetAuthHeader(localVarRequest) + } + + // Basic HTTP Authentication + if auth, ok := ctx.Value(ContextBasicAuth).(BasicAuth); ok { + localVarRequest.SetBasicAuth(auth.UserName, auth.Password) + } + + // AccessToken Authentication + if auth, ok := ctx.Value(ContextAccessToken).(string); ok { + localVarRequest.Header.Add("Authorization", "Bearer " + auth) + } + } + + for header, value := range c.cfg.DefaultHeader { + localVarRequest.Header.Add(header, value) + } + + return localVarRequest, nil +} + + +// Add a file to the multipart request +func addFile(w *multipart.Writer, fieldName, path string) error { + file, err := os.Open(path) + if err != nil { + return err + } + defer file.Close() + + part, err := w.CreateFormFile(fieldName, filepath.Base(path)) + if err != nil { + return err + } + _, err = io.Copy(part, file) + + return err +} + +// Prevent trying to import "fmt" +func reportError(format string, a ...interface{}) (error) { + return fmt.Errorf(format, a...) +} + +// Set request body from an interface{} +func setBody(body interface{}, contentType string) (bodyBuf *bytes.Buffer, err error) { + if bodyBuf == nil { + bodyBuf = &bytes.Buffer{} + } + + if reader, ok := body.(io.Reader); ok { + _, err = bodyBuf.ReadFrom(reader) + } else if b, ok := body.([]byte); ok { + _, err = bodyBuf.Write(b) + } else if s, ok := body.(string); ok { + _, err = bodyBuf.WriteString(s) + } else if jsonCheck.MatchString(contentType) { + err = json.NewEncoder(bodyBuf).Encode(body) + } else if xmlCheck.MatchString(contentType) { + xml.NewEncoder(bodyBuf).Encode(body) + } + + if err != nil { + return nil, err + } + + if bodyBuf.Len() == 0 { + err = fmt.Errorf("Invalid body type %s\n", contentType) + return nil, err + } + return bodyBuf, nil +} + +// detectContentType method is used to figure out `Request.Body` content type for request header +func detectContentType(body interface{}) string { + contentType := "text/plain; charset=utf-8" + kind := reflect.TypeOf(body).Kind() + + switch kind { + case reflect.Struct, reflect.Map, reflect.Ptr: + contentType = "application/json; charset=utf-8" + case reflect.String: + contentType = "text/plain; charset=utf-8" + default: + if b, ok := body.([]byte); ok { + contentType = http.DetectContentType(b) + } else if kind == reflect.Slice { + contentType = "application/json; charset=utf-8" + } + } + + return contentType +} + + +// Ripped from https://github.com/gregjones/httpcache/blob/master/httpcache.go +type cacheControl map[string]string + +func parseCacheControl(headers http.Header) cacheControl { + cc := cacheControl{} + ccHeader := headers.Get("Cache-Control") + for _, part := range strings.Split(ccHeader, ",") { + part = strings.Trim(part, " ") + if part == "" { + continue + } + if strings.ContainsRune(part, '=') { + keyval := strings.Split(part, "=") + cc[strings.Trim(keyval[0], " ")] = strings.Trim(keyval[1], ",") + } else { + cc[part] = "" + } + } + return cc +} + +// CacheExpires helper function to determine remaining time before repeating a request. +func CacheExpires(r *http.Response) (time.Time) { + // Figure out when the cache expires. + var expires time.Time + now, err := time.Parse(time.RFC1123, r.Header.Get("date")) + if err != nil { + return time.Now() + } + respCacheControl := parseCacheControl(r.Header) + + if maxAge, ok := respCacheControl["max-age"]; ok { + lifetime, err := time.ParseDuration(maxAge + "s") + if err != nil { + expires = now + } + expires = now.Add(lifetime) + } else { + expiresHeader := r.Header.Get("Expires") + if expiresHeader != "" { + expires, err = time.Parse(time.RFC1123, expiresHeader) + if err != nil { + expires = now + } + } + } + return expires +} + +func strlen(s string) (int) { + return utf8.RuneCountInString(s) +} + diff --git a/jcapiv1/api_command_results.go b/jcapiv1/api_command_results.go new file mode 100644 index 0000000..5f4103f --- /dev/null +++ b/jcapiv1/api_command_results.go @@ -0,0 +1,385 @@ + +/* + * JumpCloud API + * + * # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 1.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv1 + +import ( + "context" + "io/ioutil" + "net/http" + "net/url" + "strings" + "fmt" + "github.com/antihax/optional" +) + +// Linger please +var ( + _ context.Context +) + +type CommandResultsApiService service +/* +CommandResultsApiService Delete a Command result +This endpoint deletes a specific command result. #### Sample Request ``` curl -X DELETE https://console.jumpcloud.com/api/commandresults/{CommandID} \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ```` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param id + * @param optional nil or *CommandResultsApiCommandResultsDeleteOpts - Optional Parameters: + * @param "XOrgId" (optional.String) - +@return Commandresult +*/ + +type CommandResultsApiCommandResultsDeleteOpts struct { + XOrgId optional.String +} + +func (a *CommandResultsApiService) CommandResultsDelete(ctx context.Context, id string, localVarOptionals *CommandResultsApiCommandResultsDeleteOpts) (Commandresult, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Delete") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue Commandresult + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/commandresults/{id}" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v Commandresult + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +CommandResultsApiService List an individual Command result +This endpoint returns a specific command result. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/commandresults/{CommandResultID} \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param id + * @param optional nil or *CommandResultsApiCommandResultsGetOpts - Optional Parameters: + * @param "Fields" (optional.String) - Use a space seperated string of field parameters to include the data in the response. If omitted, the default list of fields will be returned. + * @param "Filter" (optional.String) - A filter to apply to the query. See the supported operators below. For more complex searches, see the related `/search/<domain>` endpoints, e.g. `/search/systems`. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: - `$eq` (equals) - `$ne` (does not equal) - `$gt` (is greater than) - `$gte` (is greater than or equal to) - `$lt` (is less than) - `$lte` (is less than or equal to) _Note: v1 operators differ from v2 operators._ _Note: For v1 operators, excluding the `$` will result in undefined behavior._ **value** = Populate with the value you want to search for. Is case sensitive. **Examples** - `GET /users?filter=username:$eq:testuser` - `GET /systemusers?filter=password_expiration_date:$lte:2021-10-24` - `GET /systemusers?filter=department:$ne:Accounting` - `GET /systems?filter[0]=firstname:$eq:foo&filter[1]=lastname:$eq:bar` - this will AND the filters together. - `GET /systems?filter[or][0]=lastname:$eq:foo&filter[or][1]=lastname:$eq:bar` - this will OR the filters together. + * @param "XOrgId" (optional.String) - +@return Commandresult +*/ + +type CommandResultsApiCommandResultsGetOpts struct { + Fields optional.String + Filter optional.String + XOrgId optional.String +} + +func (a *CommandResultsApiService) CommandResultsGet(ctx context.Context, id string, localVarOptionals *CommandResultsApiCommandResultsGetOpts) (Commandresult, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue Commandresult + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/commandresults/{id}" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Fields.IsSet() { + localVarQueryParams.Add("fields", parameterToString(localVarOptionals.Fields.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Filter.IsSet() { + localVarQueryParams.Add("filter", parameterToString(localVarOptionals.Filter.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v Commandresult + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +CommandResultsApiService List all Command Results +This endpoint returns all command results. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/commandresults \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key:{API_KEY}' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param optional nil or *CommandResultsApiCommandResultsListOpts - Optional Parameters: + * @param "Fields" (optional.String) - Use a space seperated string of field parameters to include the data in the response. If omitted, the default list of fields will be returned. + * @param "Filter" (optional.String) - A filter to apply to the query. See the supported operators below. For more complex searches, see the related `/search/<domain>` endpoints, e.g. `/search/systems`. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: - `$eq` (equals) - `$ne` (does not equal) - `$gt` (is greater than) - `$gte` (is greater than or equal to) - `$lt` (is less than) - `$lte` (is less than or equal to) _Note: v1 operators differ from v2 operators._ _Note: For v1 operators, excluding the `$` will result in undefined behavior._ **value** = Populate with the value you want to search for. Is case sensitive. **Examples** - `GET /users?filter=username:$eq:testuser` - `GET /systemusers?filter=password_expiration_date:$lte:2021-10-24` - `GET /systemusers?filter=department:$ne:Accounting` - `GET /systems?filter[0]=firstname:$eq:foo&filter[1]=lastname:$eq:bar` - this will AND the filters together. - `GET /systems?filter[or][0]=lastname:$eq:foo&filter[or][1]=lastname:$eq:bar` - this will OR the filters together. + * @param "Limit" (optional.Int32) - The number of records to return at once. Limited to 100. + * @param "XOrgId" (optional.String) - + * @param "Skip" (optional.Int32) - The offset into the records to return. + * @param "Sort" (optional.String) - Use space separated sort parameters to sort the collection. Default sort is ascending. Prefix with `-` to sort descending. +@return Commandresultslist +*/ + +type CommandResultsApiCommandResultsListOpts struct { + Fields optional.String + Filter optional.String + Limit optional.Int32 + XOrgId optional.String + Skip optional.Int32 + Sort optional.String +} + +func (a *CommandResultsApiService) CommandResultsList(ctx context.Context, localVarOptionals *CommandResultsApiCommandResultsListOpts) (Commandresultslist, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue Commandresultslist + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/commandresults" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Fields.IsSet() { + localVarQueryParams.Add("fields", parameterToString(localVarOptionals.Fields.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Filter.IsSet() { + localVarQueryParams.Add("filter", parameterToString(localVarOptionals.Filter.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { + localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Skip.IsSet() { + localVarQueryParams.Add("skip", parameterToString(localVarOptionals.Skip.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Sort.IsSet() { + localVarQueryParams.Add("sort", parameterToString(localVarOptionals.Sort.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v Commandresultslist + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} diff --git a/jcapiv1/api_command_triggers.go b/jcapiv1/api_command_triggers.go new file mode 100644 index 0000000..7ed67a2 --- /dev/null +++ b/jcapiv1/api_command_triggers.go @@ -0,0 +1,144 @@ + +/* + * JumpCloud API + * + * # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 1.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv1 + +import ( + "context" + "io/ioutil" + "net/http" + "net/url" + "strings" + "fmt" + "github.com/antihax/optional" +) + +// Linger please +var ( + _ context.Context +) + +type CommandTriggersApiService service +/* +CommandTriggersApiService Launch a command via a Trigger +This endpoint allows you to launch a command based on a defined trigger. #### Sample Requests **Launch a Command via a Trigger** ``` curl --silent \\ -X 'POST' \\ -H \"x-api-key: {API_KEY}\" \\ \"https://console.jumpcloud.com/api/command/trigger/{TriggerName}\" ``` **Launch a Command via a Trigger passing a JSON object to the command** ``` curl --silent \\ -X 'POST' \\ -H \"x-api-key: {API_KEY}\" \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -d '{ \"srcip\":\"192.168.2.32\", \"attack\":\"Cross Site Scripting Attempt\" }' \\ \"https://console.jumpcloud.com/api/command/trigger/{TriggerName}\" ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param triggername + * @param optional nil or *CommandTriggersApiCommandTriggerWebhookPostOpts - Optional Parameters: + * @param "Body" (optional.Interface of interface{}) - + * @param "XOrgId" (optional.String) - +@return Triggerreturn +*/ + +type CommandTriggersApiCommandTriggerWebhookPostOpts struct { + Body optional.Interface + XOrgId optional.String +} + +func (a *CommandTriggersApiService) CommandTriggerWebhookPost(ctx context.Context, triggername string, localVarOptionals *CommandTriggersApiCommandTriggerWebhookPostOpts) (Triggerreturn, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Post") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue Triggerreturn + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/command/trigger/{triggername}" + localVarPath = strings.Replace(localVarPath, "{"+"triggername"+"}", fmt.Sprintf("%v", triggername), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + // body params + if localVarOptionals != nil && localVarOptionals.Body.IsSet() { + + localVarOptionalBody:= localVarOptionals.Body.Value() + localVarPostBody = &localVarOptionalBody + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v Triggerreturn + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} diff --git a/jcapiv1/api_commands.go b/jcapiv1/api_commands.go new file mode 100644 index 0000000..8b24138 --- /dev/null +++ b/jcapiv1/api_commands.go @@ -0,0 +1,841 @@ + +/* + * JumpCloud API + * + * # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 1.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv1 + +import ( + "context" + "io/ioutil" + "net/http" + "net/url" + "strings" + "fmt" + "github.com/antihax/optional" +) + +// Linger please +var ( + _ context.Context +) + +type CommandsApiService service +/* +CommandsApiService Get a Command File +This endpoint returns the uploaded file(s) associated with a specific command. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/files/command/{commandID} \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param id + * @param optional nil or *CommandsApiCommandFileGetOpts - Optional Parameters: + * @param "Fields" (optional.String) - Use a space seperated string of field parameters to include the data in the response. If omitted, the default list of fields will be returned. + * @param "Limit" (optional.Int32) - The number of records to return at once. Limited to 100. + * @param "XOrgId" (optional.String) - + * @param "Skip" (optional.Int32) - The offset into the records to return. +@return Commandfilereturn +*/ + +type CommandsApiCommandFileGetOpts struct { + Fields optional.String + Limit optional.Int32 + XOrgId optional.String + Skip optional.Int32 +} + +func (a *CommandsApiService) CommandFileGet(ctx context.Context, id string, localVarOptionals *CommandsApiCommandFileGetOpts) (Commandfilereturn, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue Commandfilereturn + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/files/command/{id}" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Fields.IsSet() { + localVarQueryParams.Add("fields", parameterToString(localVarOptionals.Fields.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { + localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Skip.IsSet() { + localVarQueryParams.Add("skip", parameterToString(localVarOptionals.Skip.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v Commandfilereturn + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 400 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +CommandsApiService Delete a Command +This endpoint deletes a specific command based on the Command ID. #### Sample Request ``` curl -X DELETE https://console.jumpcloud.com/api/commands/{CommandID} \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param id + * @param optional nil or *CommandsApiCommandsDeleteOpts - Optional Parameters: + * @param "XOrgId" (optional.String) - +@return Command +*/ + +type CommandsApiCommandsDeleteOpts struct { + XOrgId optional.String +} + +func (a *CommandsApiService) CommandsDelete(ctx context.Context, id string, localVarOptionals *CommandsApiCommandsDeleteOpts) (Command, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Delete") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue Command + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/commands/{id}" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v Command + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +CommandsApiService List an individual Command +This endpoint returns a specific command based on the command ID. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/commands/{CommandID} \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param id + * @param optional nil or *CommandsApiCommandsGetOpts - Optional Parameters: + * @param "Fields" (optional.String) - Use a space seperated string of field parameters to include the data in the response. If omitted, the default list of fields will be returned. + * @param "XOrgId" (optional.String) - +@return Command +*/ + +type CommandsApiCommandsGetOpts struct { + Fields optional.String + XOrgId optional.String +} + +func (a *CommandsApiService) CommandsGet(ctx context.Context, id string, localVarOptionals *CommandsApiCommandsGetOpts) (Command, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue Command + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/commands/{id}" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Fields.IsSet() { + localVarQueryParams.Add("fields", parameterToString(localVarOptionals.Fields.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v Command + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +CommandsApiService Get results for a specific command +This endpoint returns results for a specific command. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/commands/{id}/results \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ```` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param id +@return []Commandresult +*/ +func (a *CommandsApiService) CommandsGetResults(ctx context.Context, id string) ([]Commandresult, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []Commandresult + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/commands/{id}/results" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v []Commandresult + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +CommandsApiService List All Commands +This endpoint returns all commands. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/commands/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param optional nil or *CommandsApiCommandsListOpts - Optional Parameters: + * @param "Fields" (optional.String) - Use a space seperated string of field parameters to include the data in the response. If omitted, the default list of fields will be returned. + * @param "Filter" (optional.String) - A filter to apply to the query. See the supported operators below. For more complex searches, see the related `/search/<domain>` endpoints, e.g. `/search/systems`. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: - `$eq` (equals) - `$ne` (does not equal) - `$gt` (is greater than) - `$gte` (is greater than or equal to) - `$lt` (is less than) - `$lte` (is less than or equal to) _Note: v1 operators differ from v2 operators._ _Note: For v1 operators, excluding the `$` will result in undefined behavior._ **value** = Populate with the value you want to search for. Is case sensitive. **Examples** - `GET /users?filter=username:$eq:testuser` - `GET /systemusers?filter=password_expiration_date:$lte:2021-10-24` - `GET /systemusers?filter=department:$ne:Accounting` - `GET /systems?filter[0]=firstname:$eq:foo&filter[1]=lastname:$eq:bar` - this will AND the filters together. - `GET /systems?filter[or][0]=lastname:$eq:foo&filter[or][1]=lastname:$eq:bar` - this will OR the filters together. + * @param "Limit" (optional.Int32) - The number of records to return at once. Limited to 100. + * @param "XOrgId" (optional.String) - + * @param "Skip" (optional.Int32) - The offset into the records to return. + * @param "Sort" (optional.String) - Use space separated sort parameters to sort the collection. Default sort is ascending. Prefix with `-` to sort descending. +@return Commandslist +*/ + +type CommandsApiCommandsListOpts struct { + Fields optional.String + Filter optional.String + Limit optional.Int32 + XOrgId optional.String + Skip optional.Int32 + Sort optional.String +} + +func (a *CommandsApiService) CommandsList(ctx context.Context, localVarOptionals *CommandsApiCommandsListOpts) (Commandslist, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue Commandslist + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/commands" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Fields.IsSet() { + localVarQueryParams.Add("fields", parameterToString(localVarOptionals.Fields.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Filter.IsSet() { + localVarQueryParams.Add("filter", parameterToString(localVarOptionals.Filter.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { + localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Skip.IsSet() { + localVarQueryParams.Add("skip", parameterToString(localVarOptionals.Skip.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Sort.IsSet() { + localVarQueryParams.Add("sort", parameterToString(localVarOptionals.Sort.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v Commandslist + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +CommandsApiService Create A Command +This endpoint allows you to create a new command. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/commands/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"name\":\"Test API Command\", \"command\":\"String\", \"user\":\"{UserID}\", \"schedule\":\"\", \"timeout\":\"100\" }' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param optional nil or *CommandsApiCommandsPostOpts - Optional Parameters: + * @param "Body" (optional.Interface of Command) - + * @param "XOrgId" (optional.String) - +@return Command +*/ + +type CommandsApiCommandsPostOpts struct { + Body optional.Interface + XOrgId optional.String +} + +func (a *CommandsApiService) CommandsPost(ctx context.Context, localVarOptionals *CommandsApiCommandsPostOpts) (Command, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Post") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue Command + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/commands" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + // body params + if localVarOptionals != nil && localVarOptionals.Body.IsSet() { + + localVarOptionalBody:= localVarOptionals.Body.Value() + localVarPostBody = &localVarOptionalBody + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v Command + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +CommandsApiService Update a Command +This endpoint Updates a command based on the command ID and returns the modified command record. #### Sample Request ``` curl -X PUT https://console.jumpcloud.com/api/commands/{CommandID} \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"name\":\"Test API Command\", \"command\":\"String\", \"user\":\"{UserID}\", \"schedule\":\"\", \"timeout\":\"100\" }' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param id + * @param optional nil or *CommandsApiCommandsPutOpts - Optional Parameters: + * @param "Body" (optional.Interface of Command) - + * @param "XOrgId" (optional.String) - +@return Command +*/ + +type CommandsApiCommandsPutOpts struct { + Body optional.Interface + XOrgId optional.String +} + +func (a *CommandsApiService) CommandsPut(ctx context.Context, id string, localVarOptionals *CommandsApiCommandsPutOpts) (Command, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Put") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue Command + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/commands/{id}" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + // body params + if localVarOptionals != nil && localVarOptionals.Body.IsSet() { + + localVarOptionalBody:= localVarOptionals.Body.Value() + localVarPostBody = &localVarOptionalBody + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v Command + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} diff --git a/jcapiv1/api_managed_service_provider.go b/jcapiv1/api_managed_service_provider.go new file mode 100644 index 0000000..107e0ff --- /dev/null +++ b/jcapiv1/api_managed_service_provider.go @@ -0,0 +1,577 @@ + +/* + * JumpCloud API + * + * # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 1.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv1 + +import ( + "context" + "io/ioutil" + "net/http" + "net/url" + "strings" + "fmt" + "github.com/antihax/optional" +) + +// Linger please +var ( + _ context.Context +) + +type ManagedServiceProviderApiService service +/* +ManagedServiceProviderApiService Administrator TOTP Reset Initiation +This endpoint initiates a TOTP reset for an admin. This request does not accept a body. + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param id + +*/ +func (a *ManagedServiceProviderApiService) AdminTotpresetBegin(ctx context.Context, id string) (*http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Post") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/users/resettotp/{id}" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarHttpResponse, err + } + + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 401 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarHttpResponse, newErr + } + newErr.model = v + return localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 403 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarHttpResponse, newErr + } + newErr.model = v + return localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 404 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarHttpResponse, newErr + } + newErr.model = v + return localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 412 { + var v interface{} + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarHttpResponse, newErr + } + newErr.model = v + return localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 500 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarHttpResponse, newErr + } + newErr.model = v + return localVarHttpResponse, newErr + } + return localVarHttpResponse, newErr + } + + return localVarHttpResponse, nil +} +/* +ManagedServiceProviderApiService Get Organization Details +This endpoint returns Organization Details. #### Sample Request ``` curl -X GET \\ https://console.jumpcloud.com/api/organizations \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param optional nil or *ManagedServiceProviderApiOrganizationListOpts - Optional Parameters: + * @param "Fields" (optional.String) - Use a space seperated string of field parameters to include the data in the response. If omitted, the default list of fields will be returned. + * @param "Filter" (optional.String) - A filter to apply to the query. See the supported operators below. For more complex searches, see the related `/search/<domain>` endpoints, e.g. `/search/systems`. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: - `$eq` (equals) - `$ne` (does not equal) - `$gt` (is greater than) - `$gte` (is greater than or equal to) - `$lt` (is less than) - `$lte` (is less than or equal to) _Note: v1 operators differ from v2 operators._ _Note: For v1 operators, excluding the `$` will result in undefined behavior._ **value** = Populate with the value you want to search for. Is case sensitive. **Examples** - `GET /users?filter=username:$eq:testuser` - `GET /systemusers?filter=password_expiration_date:$lte:2021-10-24` - `GET /systemusers?filter=department:$ne:Accounting` - `GET /systems?filter[0]=firstname:$eq:foo&filter[1]=lastname:$eq:bar` - this will AND the filters together. - `GET /systems?filter[or][0]=lastname:$eq:foo&filter[or][1]=lastname:$eq:bar` - this will OR the filters together. + * @param "Limit" (optional.Int32) - The number of records to return at once. Limited to 100. + * @param "Search" (optional.String) - A nested object containing a `searchTerm` string or array of strings and a list of `fields` to search on. + * @param "Skip" (optional.Int32) - The offset into the records to return. + * @param "Sort" (optional.String) - Use space separated sort parameters to sort the collection. Default sort is ascending. Prefix with `-` to sort descending. +@return Organizationslist +*/ + +type ManagedServiceProviderApiOrganizationListOpts struct { + Fields optional.String + Filter optional.String + Limit optional.Int32 + Search optional.String + Skip optional.Int32 + Sort optional.String +} + +func (a *ManagedServiceProviderApiService) OrganizationList(ctx context.Context, localVarOptionals *ManagedServiceProviderApiOrganizationListOpts) (Organizationslist, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue Organizationslist + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/organizations" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Fields.IsSet() { + localVarQueryParams.Add("fields", parameterToString(localVarOptionals.Fields.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Filter.IsSet() { + localVarQueryParams.Add("filter", parameterToString(localVarOptionals.Filter.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { + localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Search.IsSet() { + localVarQueryParams.Add("search", parameterToString(localVarOptionals.Search.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Skip.IsSet() { + localVarQueryParams.Add("skip", parameterToString(localVarOptionals.Skip.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Sort.IsSet() { + localVarQueryParams.Add("sort", parameterToString(localVarOptionals.Sort.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v Organizationslist + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +ManagedServiceProviderApiService Update a user +This endpoint allows you to update a user. + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param id + * @param optional nil or *ManagedServiceProviderApiUsersPutOpts - Optional Parameters: + * @param "Body" (optional.Interface of Userput) - + * @param "XOrgId" (optional.String) - +@return Userreturn +*/ + +type ManagedServiceProviderApiUsersPutOpts struct { + Body optional.Interface + XOrgId optional.String +} + +func (a *ManagedServiceProviderApiService) UsersPut(ctx context.Context, id string, localVarOptionals *ManagedServiceProviderApiUsersPutOpts) (Userreturn, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Put") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue Userreturn + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/users/{id}" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + // body params + if localVarOptionals != nil && localVarOptionals.Body.IsSet() { + + localVarOptionalBody:= localVarOptionals.Body.Value() + localVarPostBody = &localVarOptionalBody + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v Userreturn + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 400 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 401 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 403 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 404 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 500 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +ManagedServiceProviderApiService Administrator Password Reset Initiation +This endpoint triggers the sending of a reactivation e-mail to an administrator. + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param id + +*/ +func (a *ManagedServiceProviderApiService) UsersReactivateGet(ctx context.Context, id string) (*http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/users/reactivate/{id}" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarHttpResponse, err + } + + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 401 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarHttpResponse, newErr + } + newErr.model = v + return localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 403 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarHttpResponse, newErr + } + newErr.model = v + return localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 404 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarHttpResponse, newErr + } + newErr.model = v + return localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 500 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarHttpResponse, newErr + } + newErr.model = v + return localVarHttpResponse, newErr + } + return localVarHttpResponse, newErr + } + + return localVarHttpResponse, nil +} diff --git a/jcapiv1/api_organizations.go b/jcapiv1/api_organizations.go new file mode 100644 index 0000000..74b4e39 --- /dev/null +++ b/jcapiv1/api_organizations.go @@ -0,0 +1,393 @@ + +/* + * JumpCloud API + * + * # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 1.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv1 + +import ( + "context" + "io/ioutil" + "net/http" + "net/url" + "strings" + "fmt" + "github.com/antihax/optional" +) + +// Linger please +var ( + _ context.Context +) + +type OrganizationsApiService service +/* +OrganizationsApiService Get Organization Details +This endpoint returns Organization Details. #### Sample Request ``` curl -X GET \\ https://console.jumpcloud.com/api/organizations \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param optional nil or *OrganizationsApiOrganizationListOpts - Optional Parameters: + * @param "Fields" (optional.String) - Use a space seperated string of field parameters to include the data in the response. If omitted, the default list of fields will be returned. + * @param "Filter" (optional.String) - A filter to apply to the query. See the supported operators below. For more complex searches, see the related `/search/<domain>` endpoints, e.g. `/search/systems`. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: - `$eq` (equals) - `$ne` (does not equal) - `$gt` (is greater than) - `$gte` (is greater than or equal to) - `$lt` (is less than) - `$lte` (is less than or equal to) _Note: v1 operators differ from v2 operators._ _Note: For v1 operators, excluding the `$` will result in undefined behavior._ **value** = Populate with the value you want to search for. Is case sensitive. **Examples** - `GET /users?filter=username:$eq:testuser` - `GET /systemusers?filter=password_expiration_date:$lte:2021-10-24` - `GET /systemusers?filter=department:$ne:Accounting` - `GET /systems?filter[0]=firstname:$eq:foo&filter[1]=lastname:$eq:bar` - this will AND the filters together. - `GET /systems?filter[or][0]=lastname:$eq:foo&filter[or][1]=lastname:$eq:bar` - this will OR the filters together. + * @param "Limit" (optional.Int32) - The number of records to return at once. Limited to 100. + * @param "Search" (optional.String) - A nested object containing a `searchTerm` string or array of strings and a list of `fields` to search on. + * @param "Skip" (optional.Int32) - The offset into the records to return. + * @param "Sort" (optional.String) - Use space separated sort parameters to sort the collection. Default sort is ascending. Prefix with `-` to sort descending. +@return Organizationslist +*/ + +type OrganizationsApiOrganizationListOpts struct { + Fields optional.String + Filter optional.String + Limit optional.Int32 + Search optional.String + Skip optional.Int32 + Sort optional.String +} + +func (a *OrganizationsApiService) OrganizationList(ctx context.Context, localVarOptionals *OrganizationsApiOrganizationListOpts) (Organizationslist, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue Organizationslist + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/organizations" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Fields.IsSet() { + localVarQueryParams.Add("fields", parameterToString(localVarOptionals.Fields.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Filter.IsSet() { + localVarQueryParams.Add("filter", parameterToString(localVarOptionals.Filter.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { + localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Search.IsSet() { + localVarQueryParams.Add("search", parameterToString(localVarOptionals.Search.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Skip.IsSet() { + localVarQueryParams.Add("skip", parameterToString(localVarOptionals.Skip.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Sort.IsSet() { + localVarQueryParams.Add("sort", parameterToString(localVarOptionals.Sort.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v Organizationslist + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +OrganizationsApiService Update an Organization +This endpoint allows you to update an Organization. Note: `passwordPolicy` settings are only used when `passwordCompliance` is set to \"custom\". We discourage the use of non-custom passwordCompliance values. `hasStripeCustomerId` is deprecated and will be removed. #### Sample Request ``` curl -X PUT https://console.jumpcloud.com/api/organizations/{OrganizationID} \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"settings\": { \"contactName\": \"Admin Name\", \"contactEmail\": \"admin@company.com\", \"systemUsersCanEdit\":true, \"passwordPolicy\": { \"enableMaxHistory\": true, \"maxHistory\": 3 } } }' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param id + * @param optional nil or *OrganizationsApiOrganizationPutOpts - Optional Parameters: + * @param "Body" (optional.Interface of OrganizationsIdBody) - +@return Organization +*/ + +type OrganizationsApiOrganizationPutOpts struct { + Body optional.Interface +} + +func (a *OrganizationsApiService) OrganizationPut(ctx context.Context, id string, localVarOptionals *OrganizationsApiOrganizationPutOpts) (Organization, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Put") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue Organization + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/organizations/{id}" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + // body params + if localVarOptionals != nil && localVarOptionals.Body.IsSet() { + + localVarOptionalBody:= localVarOptionals.Body.Value() + localVarPostBody = &localVarOptionalBody + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v Organization + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 400 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +OrganizationsApiService Get an Organization +This endpoint returns a particular Organization. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/organizations/{OrganizationID} \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param id + * @param optional nil or *OrganizationsApiOrganizationsGetOpts - Optional Parameters: + * @param "Fields" (optional.String) - Use a space seperated string of field parameters to include the data in the response. If omitted, the default list of fields will be returned. + * @param "Filter" (optional.String) - A filter to apply to the query. See the supported operators below. For more complex searches, see the related `/search/<domain>` endpoints, e.g. `/search/systems`. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: - `$eq` (equals) - `$ne` (does not equal) - `$gt` (is greater than) - `$gte` (is greater than or equal to) - `$lt` (is less than) - `$lte` (is less than or equal to) _Note: v1 operators differ from v2 operators._ _Note: For v1 operators, excluding the `$` will result in undefined behavior._ **value** = Populate with the value you want to search for. Is case sensitive. **Examples** - `GET /users?filter=username:$eq:testuser` - `GET /systemusers?filter=password_expiration_date:$lte:2021-10-24` - `GET /systemusers?filter=department:$ne:Accounting` - `GET /systems?filter[0]=firstname:$eq:foo&filter[1]=lastname:$eq:bar` - this will AND the filters together. - `GET /systems?filter[or][0]=lastname:$eq:foo&filter[or][1]=lastname:$eq:bar` - this will OR the filters together. +@return Organization +*/ + +type OrganizationsApiOrganizationsGetOpts struct { + Fields optional.String + Filter optional.String +} + +func (a *OrganizationsApiService) OrganizationsGet(ctx context.Context, id string, localVarOptionals *OrganizationsApiOrganizationsGetOpts) (Organization, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue Organization + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/organizations/{id}" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Fields.IsSet() { + localVarQueryParams.Add("fields", parameterToString(localVarOptionals.Fields.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Filter.IsSet() { + localVarQueryParams.Add("filter", parameterToString(localVarOptionals.Filter.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v Organization + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} diff --git a/jcapiv1/api_radius_servers.go b/jcapiv1/api_radius_servers.go new file mode 100644 index 0000000..738b906 --- /dev/null +++ b/jcapiv1/api_radius_servers.go @@ -0,0 +1,605 @@ + +/* + * JumpCloud API + * + * # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 1.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv1 + +import ( + "context" + "io/ioutil" + "net/http" + "net/url" + "strings" + "fmt" + "github.com/antihax/optional" +) + +// Linger please +var ( + _ context.Context +) + +type RadiusServersApiService service +/* +RadiusServersApiService Delete Radius Server +This endpoint allows you to delete RADIUS servers in your organization. ``` curl -X DELETE https://console.jumpcloud.com/api/radiusservers/{ServerID} \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param id + * @param optional nil or *RadiusServersApiRadiusServersDeleteOpts - Optional Parameters: + * @param "XOrgId" (optional.String) - +@return Radiusserverput +*/ + +type RadiusServersApiRadiusServersDeleteOpts struct { + XOrgId optional.String +} + +func (a *RadiusServersApiService) RadiusServersDelete(ctx context.Context, id string, localVarOptionals *RadiusServersApiRadiusServersDeleteOpts) (Radiusserverput, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Delete") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue Radiusserverput + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/radiusservers/{id}" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v Radiusserverput + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +RadiusServersApiService Get Radius Server +This endpoint allows you to get a RADIUS server in your organization. #### ``` curl -X PUT https://console.jumpcloud.com/api/radiusservers/{ServerID} \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param id + * @param optional nil or *RadiusServersApiRadiusServersGetOpts - Optional Parameters: + * @param "XOrgId" (optional.String) - +@return Radiusserver +*/ + +type RadiusServersApiRadiusServersGetOpts struct { + XOrgId optional.String +} + +func (a *RadiusServersApiService) RadiusServersGet(ctx context.Context, id string, localVarOptionals *RadiusServersApiRadiusServersGetOpts) (Radiusserver, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue Radiusserver + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/radiusservers/{id}" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v Radiusserver + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +RadiusServersApiService List Radius Servers +This endpoint allows you to get a list of all RADIUS servers in your organization. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/radiusservers/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param optional nil or *RadiusServersApiRadiusServersListOpts - Optional Parameters: + * @param "Fields" (optional.String) - Use a space seperated string of field parameters to include the data in the response. If omitted, the default list of fields will be returned. + * @param "Filter" (optional.String) - A filter to apply to the query. See the supported operators below. For more complex searches, see the related `/search/<domain>` endpoints, e.g. `/search/systems`. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: - `$eq` (equals) - `$ne` (does not equal) - `$gt` (is greater than) - `$gte` (is greater than or equal to) - `$lt` (is less than) - `$lte` (is less than or equal to) _Note: v1 operators differ from v2 operators._ _Note: For v1 operators, excluding the `$` will result in undefined behavior._ **value** = Populate with the value you want to search for. Is case sensitive. **Examples** - `GET /users?filter=username:$eq:testuser` - `GET /systemusers?filter=password_expiration_date:$lte:2021-10-24` - `GET /systemusers?filter=department:$ne:Accounting` - `GET /systems?filter[0]=firstname:$eq:foo&filter[1]=lastname:$eq:bar` - this will AND the filters together. - `GET /systems?filter[or][0]=lastname:$eq:foo&filter[or][1]=lastname:$eq:bar` - this will OR the filters together. + * @param "Limit" (optional.Int32) - The number of records to return at once. Limited to 100. + * @param "Skip" (optional.Int32) - The offset into the records to return. + * @param "Sort" (optional.String) - Use space separated sort parameters to sort the collection. Default sort is ascending. Prefix with `-` to sort descending. + * @param "XOrgId" (optional.String) - +@return Radiusserverslist +*/ + +type RadiusServersApiRadiusServersListOpts struct { + Fields optional.String + Filter optional.String + Limit optional.Int32 + Skip optional.Int32 + Sort optional.String + XOrgId optional.String +} + +func (a *RadiusServersApiService) RadiusServersList(ctx context.Context, localVarOptionals *RadiusServersApiRadiusServersListOpts) (Radiusserverslist, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue Radiusserverslist + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/radiusservers" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Fields.IsSet() { + localVarQueryParams.Add("fields", parameterToString(localVarOptionals.Fields.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Filter.IsSet() { + localVarQueryParams.Add("filter", parameterToString(localVarOptionals.Filter.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { + localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Skip.IsSet() { + localVarQueryParams.Add("skip", parameterToString(localVarOptionals.Skip.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Sort.IsSet() { + localVarQueryParams.Add("sort", parameterToString(localVarOptionals.Sort.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v Radiusserverslist + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +RadiusServersApiService Create a Radius Server +This endpoint allows you to create RADIUS servers in your organization. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/radiusservers/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"name\": \"{test_radius}\", \"networkSourceIp\": \"{0.0.0.0}\", \"sharedSecret\":\"{secretpassword}\", \"userLockoutAction\": \"REMOVE\", \"userPasswordExpirationAction\": \"MAINTAIN\" }' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param optional nil or *RadiusServersApiRadiusServersPostOpts - Optional Parameters: + * @param "Body" (optional.Interface of Radiusserverpost) - + * @param "XOrgId" (optional.String) - +@return Radiusserver +*/ + +type RadiusServersApiRadiusServersPostOpts struct { + Body optional.Interface + XOrgId optional.String +} + +func (a *RadiusServersApiService) RadiusServersPost(ctx context.Context, localVarOptionals *RadiusServersApiRadiusServersPostOpts) (Radiusserver, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Post") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue Radiusserver + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/radiusservers" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + // body params + if localVarOptionals != nil && localVarOptionals.Body.IsSet() { + + localVarOptionalBody:= localVarOptionals.Body.Value() + localVarPostBody = &localVarOptionalBody + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v Radiusserver + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +RadiusServersApiService Update Radius Servers +This endpoint allows you to update RADIUS servers in your organization. #### ``` curl -X PUT https://console.jumpcloud.com/api/radiusservers/{ServerID} \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"name\": \"{name_update}\", \"networkSourceIp\": \"{0.0.0.0}\", \"sharedSecret\": \"{secret_password}\", \"userLockoutAction\": \"REMOVE\", \"userPasswordExpirationAction\": \"MAINTAIN\" }' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param id + * @param optional nil or *RadiusServersApiRadiusServersPutOpts - Optional Parameters: + * @param "Body" (optional.Interface of RadiusserversIdBody) - + * @param "XOrgId" (optional.String) - +@return Radiusserverput +*/ + +type RadiusServersApiRadiusServersPutOpts struct { + Body optional.Interface + XOrgId optional.String +} + +func (a *RadiusServersApiService) RadiusServersPut(ctx context.Context, id string, localVarOptionals *RadiusServersApiRadiusServersPutOpts) (Radiusserverput, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Put") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue Radiusserverput + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/radiusservers/{id}" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + // body params + if localVarOptionals != nil && localVarOptionals.Body.IsSet() { + + localVarOptionalBody:= localVarOptionals.Body.Value() + localVarPostBody = &localVarOptionalBody + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v Radiusserverput + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} diff --git a/jcapiv1/api_response.go b/jcapiv1/api_response.go new file mode 100644 index 0000000..92dc769 --- /dev/null +++ b/jcapiv1/api_response.go @@ -0,0 +1,44 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 1.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package jcapiv1 + +import ( + "net/http" +) + +type APIResponse struct { + *http.Response `json:"-"` + Message string `json:"message,omitempty"` + // Operation is the name of the swagger operation. + Operation string `json:"operation,omitempty"` + // RequestURL is the request URL. This value is always available, even if the + // embedded *http.Response is nil. + RequestURL string `json:"url,omitempty"` + // Method is the HTTP method used for the request. This value is always + // available, even if the embedded *http.Response is nil. + Method string `json:"method,omitempty"` + // Payload holds the contents of the response body (which may be nil or empty). + // This is provided here as the raw response.Body() reader will have already + // been drained. + Payload []byte `json:"-"` +} + +func NewAPIResponse(r *http.Response) *APIResponse { + + response := &APIResponse{Response: r} + return response +} + +func NewAPIResponseWithError(errorMessage string) *APIResponse { + + response := &APIResponse{Message: errorMessage} + return response +} diff --git a/jcapiv1/api_search.go b/jcapiv1/api_search.go new file mode 100644 index 0000000..e3060b6 --- /dev/null +++ b/jcapiv1/api_search.go @@ -0,0 +1,692 @@ + +/* + * JumpCloud API + * + * # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 1.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv1 + +import ( + "context" + "io/ioutil" + "net/http" + "net/url" + "strings" + "github.com/antihax/optional" +) + +// Linger please +var ( + _ context.Context +) + +type SearchApiService service +/* +SearchApiService Search Commands Results +Return Command Results in multi-record format allowing for the passing of the `filter` parameter. To support advanced filtering you can use the `filter` and `searchFilter` parameters that can only be passed in the body of POST /api/search/commandresults route. The `filter` parameter must be passed as Content-Type application/json. The `filter` parameter is an object with a single property, either `and` or `or` with the value of the property being an array of query expressions. This allows you to filter records using the logic of matching ALL or ANY records in the array of query expressions. If the `and` or `or` are not included the default behavior is to match ALL query expressions. #### Sample Request Exact search for a specific command result ``` curl -X POST https://console.jumpcloud.com/api/search/commandresults \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"filter\" : \"workflowInstanceId:$eq:62f3c599ec4e928499069c7f\", \"fields\" : \"name workflowId sudo\" }' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param optional nil or *SearchApiSearchCommandresultsPostOpts - Optional Parameters: + * @param "Body" (optional.Interface of Search) - + * @param "XOrgId" (optional.String) - + * @param "Fields" (optional.String) - Use a space seperated string of field parameters to include the data in the response. If omitted, the default list of fields will be returned. + * @param "Filter" (optional.String) - A filter to apply to the query. See the supported operators below. For more complex searches, see the related `/search/<domain>` endpoints, e.g. `/search/systems`. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: - `$eq` (equals) - `$ne` (does not equal) - `$gt` (is greater than) - `$gte` (is greater than or equal to) - `$lt` (is less than) - `$lte` (is less than or equal to) _Note: v1 operators differ from v2 operators._ _Note: For v1 operators, excluding the `$` will result in undefined behavior._ **value** = Populate with the value you want to search for. Is case sensitive. **Examples** - `GET /users?filter=username:$eq:testuser` - `GET /systemusers?filter=password_expiration_date:$lte:2021-10-24` - `GET /systemusers?filter=department:$ne:Accounting` - `GET /systems?filter[0]=firstname:$eq:foo&filter[1]=lastname:$eq:bar` - this will AND the filters together. - `GET /systems?filter[or][0]=lastname:$eq:foo&filter[or][1]=lastname:$eq:bar` - this will OR the filters together. + * @param "Limit" (optional.Int32) - The number of records to return at once. Limited to 100. + * @param "Skip" (optional.Int32) - The offset into the records to return. +@return Commandresultslist +*/ + +type SearchApiSearchCommandresultsPostOpts struct { + Body optional.Interface + XOrgId optional.String + Fields optional.String + Filter optional.String + Limit optional.Int32 + Skip optional.Int32 +} + +func (a *SearchApiService) SearchCommandresultsPost(ctx context.Context, localVarOptionals *SearchApiSearchCommandresultsPostOpts) (Commandresultslist, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Post") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue Commandresultslist + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/search/commandresults" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Fields.IsSet() { + localVarQueryParams.Add("fields", parameterToString(localVarOptionals.Fields.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Filter.IsSet() { + localVarQueryParams.Add("filter", parameterToString(localVarOptionals.Filter.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { + localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Skip.IsSet() { + localVarQueryParams.Add("skip", parameterToString(localVarOptionals.Skip.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + // body params + if localVarOptionals != nil && localVarOptionals.Body.IsSet() { + + localVarOptionalBody:= localVarOptionals.Body.Value() + localVarPostBody = &localVarOptionalBody + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v Commandresultslist + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +SearchApiService Search Commands +Return Commands in multi-record format allowing for the passing of the `filter` and `searchFilter` parameters. This WILL NOT allow you to add a new command. To support advanced filtering you can use the `filter` and `searchFilter` parameters that can only be passed in the body of POST /api/search/_* routes. The `filter` and `searchFilter` parameters must be passed as Content-Type application/json. The `filter` parameter is an object with a single property, either `and` or `or` with the value of the property being an array of query expressions. This allows you to filter records using the logic of matching ALL or ANY records in the array of query expressions. If the `and` or `or` are not included the default behavior is to match ALL query expressions. The `searchFilter` parameter allows text searching on supported fields by specifying a `searchTerm` and a list of `fields` to query on. If any `field` has a partial text match on the `searchTerm` the record will be returned. #### Sample Request Exact search for a list of commands in a launchType ``` curl -X POST https://console.jumpcloud.com/api/search/commands \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"filter\" : [{\"launchType\" : \"repeated\"}], \"fields\" : \"name launchType sudo\" }' ``` Text search for commands with name ``` curl -X POST https://console.jumpcloud.com/api/search/commands \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"searchFilter\" : { \"searchTerm\": \"List\", \"fields\": [\"name\"] }, \"fields\" : \"name launchType sudo\" }' ``` Text search for multiple commands ``` curl -X POST https://console.jumpcloud.com/api/search/commands \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"searchFilter\" : { \"searchTerm\": [\"List\", \"Log\"], \"fields\": [\"name\"] }, \"fields\" : \"name launchType sudo\" }' ``` Combining `filter` and `searchFilter` to text search for commands with name who are in a list of launchType ``` curl -X POST https://console.jumpcloud.com/api/search/commands \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"searchFilter\": { \"searchTerm\": \"List\", \"fields\": [\"name\"] }, \"filter\": { \"or\": [ {\"launchType\" : \"repeated\"}, {\"launchType\" : \"one-time\"} ] }, \"fields\" : \"name launchType sudo\" }' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param optional nil or *SearchApiSearchCommandsPostOpts - Optional Parameters: + * @param "Body" (optional.Interface of Search) - + * @param "XOrgId" (optional.String) - + * @param "Fields" (optional.String) - Use a space seperated string of field parameters to include the data in the response. If omitted, the default list of fields will be returned. + * @param "Filter" (optional.String) - A filter to apply to the query. See the supported operators below. For more complex searches, see the related `/search/<domain>` endpoints, e.g. `/search/systems`. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: - `$eq` (equals) - `$ne` (does not equal) - `$gt` (is greater than) - `$gte` (is greater than or equal to) - `$lt` (is less than) - `$lte` (is less than or equal to) _Note: v1 operators differ from v2 operators._ _Note: For v1 operators, excluding the `$` will result in undefined behavior._ **value** = Populate with the value you want to search for. Is case sensitive. **Examples** - `GET /users?filter=username:$eq:testuser` - `GET /systemusers?filter=password_expiration_date:$lte:2021-10-24` - `GET /systemusers?filter=department:$ne:Accounting` - `GET /systems?filter[0]=firstname:$eq:foo&filter[1]=lastname:$eq:bar` - this will AND the filters together. - `GET /systems?filter[or][0]=lastname:$eq:foo&filter[or][1]=lastname:$eq:bar` - this will OR the filters together. + * @param "Limit" (optional.Int32) - The number of records to return at once. Limited to 100. + * @param "Skip" (optional.Int32) - The offset into the records to return. +@return Commandslist +*/ + +type SearchApiSearchCommandsPostOpts struct { + Body optional.Interface + XOrgId optional.String + Fields optional.String + Filter optional.String + Limit optional.Int32 + Skip optional.Int32 +} + +func (a *SearchApiService) SearchCommandsPost(ctx context.Context, localVarOptionals *SearchApiSearchCommandsPostOpts) (Commandslist, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Post") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue Commandslist + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/search/commands" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Fields.IsSet() { + localVarQueryParams.Add("fields", parameterToString(localVarOptionals.Fields.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Filter.IsSet() { + localVarQueryParams.Add("filter", parameterToString(localVarOptionals.Filter.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { + localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Skip.IsSet() { + localVarQueryParams.Add("skip", parameterToString(localVarOptionals.Skip.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + // body params + if localVarOptionals != nil && localVarOptionals.Body.IsSet() { + + localVarOptionalBody:= localVarOptionals.Body.Value() + localVarPostBody = &localVarOptionalBody + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v Commandslist + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +SearchApiService Search Organizations +This endpoint will return Organization data based on your search parameters. This endpoint WILL NOT allow you to add a new Organization. You can use the supported parameters and pass those in the body of request. The parameters must be passed as Content-Type application/json. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/search/organizations \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"search\":{ \"fields\" : [\"settings.name\"], \"searchTerm\": \"Second\" }, \"fields\": [\"_id\", \"displayName\", \"logoUrl\"], \"limit\" : 0, \"skip\" : 0 }' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param optional nil or *SearchApiSearchOrganizationsPostOpts - Optional Parameters: + * @param "Body" (optional.Interface of Search) - + * @param "Fields" (optional.String) - Use a space seperated string of field parameters to include the data in the response. If omitted, the default list of fields will be returned. + * @param "Filter" (optional.String) - A filter to apply to the query. See the supported operators below. For more complex searches, see the related `/search/<domain>` endpoints, e.g. `/search/systems`. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: - `$eq` (equals) - `$ne` (does not equal) - `$gt` (is greater than) - `$gte` (is greater than or equal to) - `$lt` (is less than) - `$lte` (is less than or equal to) _Note: v1 operators differ from v2 operators._ _Note: For v1 operators, excluding the `$` will result in undefined behavior._ **value** = Populate with the value you want to search for. Is case sensitive. **Examples** - `GET /users?filter=username:$eq:testuser` - `GET /systemusers?filter=password_expiration_date:$lte:2021-10-24` - `GET /systemusers?filter=department:$ne:Accounting` - `GET /systems?filter[0]=firstname:$eq:foo&filter[1]=lastname:$eq:bar` - this will AND the filters together. - `GET /systems?filter[or][0]=lastname:$eq:foo&filter[or][1]=lastname:$eq:bar` - this will OR the filters together. + * @param "Limit" (optional.Int32) - The number of records to return at once. Limited to 100. + * @param "Skip" (optional.Int32) - The offset into the records to return. +@return Organizationslist +*/ + +type SearchApiSearchOrganizationsPostOpts struct { + Body optional.Interface + Fields optional.String + Filter optional.String + Limit optional.Int32 + Skip optional.Int32 +} + +func (a *SearchApiService) SearchOrganizationsPost(ctx context.Context, localVarOptionals *SearchApiSearchOrganizationsPostOpts) (Organizationslist, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Post") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue Organizationslist + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/search/organizations" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Fields.IsSet() { + localVarQueryParams.Add("fields", parameterToString(localVarOptionals.Fields.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Filter.IsSet() { + localVarQueryParams.Add("filter", parameterToString(localVarOptionals.Filter.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { + localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Skip.IsSet() { + localVarQueryParams.Add("skip", parameterToString(localVarOptionals.Skip.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + // body params + if localVarOptionals != nil && localVarOptionals.Body.IsSet() { + + localVarOptionalBody:= localVarOptionals.Body.Value() + localVarPostBody = &localVarOptionalBody + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v Organizationslist + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +SearchApiService Search Systems +Return Systems in multi-record format allowing for the passing of the `filter` and `searchFilter` parameters. This WILL NOT allow you to add a new system. To support advanced filtering you can use the `filter` and `searchFilter` parameters that can only be passed in the body of POST /api/search/_* routes. The `filter` and `searchFilter` parameters must be passed as Content-Type application/json. The `filter` parameter is an object with a single property, either `and` or `or` with the value of the property being an array of query expressions. This allows you to filter records using the logic of matching ALL or ANY records in the array of query expressions. If the `and` or `or` are not included the default behavior is to match ALL query expressions. The `searchFilter` parameter allows text searching on supported fields by specifying a `searchTerm` and a list of `fields` to query on. If any `field` has a partial text match on the `searchTerm` the record will be returned. #### Sample Request Exact search for a list of hostnames ``` curl -X POST https://console.jumpcloud.com/api/search/systems \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"filter\": { \"or\": [ {\"hostname\" : \"my-hostname\"}, {\"hostname\" : \"other-hostname\"} ] }, \"fields\" : \"os hostname displayName\" }' ``` Text search for a hostname or display name ``` curl -X POST https://console.jumpcloud.com/api/search/systems \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"searchFilter\": { \"searchTerm\": \"my-host\", \"fields\": [\"hostname\", \"displayName\"] }, \"fields\": \"os hostname displayName\" }' ``` Text search for a multiple hostnames. ``` curl -X POST https://console.jumpcloud.com/api/search/systems \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"searchFilter\": { \"searchTerm\": [\"my-host\", \"my-other-host\"], \"fields\": [\"hostname\"] }, \"fields\": \"os hostname displayName\" }' ``` Combining `filter` and `searchFilter` to search for names that match a given OS ``` curl -X POST https://console.jumpcloud.com/api/search/systems \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"searchFilter\": { \"searchTerm\": \"my-host\", \"fields\": [\"hostname\", \"displayName\"] }, \"filter\": { \"or\": [ {\"os\" : \"Ubuntu\"}, {\"os\" : \"Mac OS X\"} ] }, \"fields\": \"os hostname displayName\" }' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param optional nil or *SearchApiSearchSystemsPostOpts - Optional Parameters: + * @param "Body" (optional.Interface of Search) - + * @param "XOrgId" (optional.String) - + * @param "Fields" (optional.String) - Use a space seperated string of field parameters to include the data in the response. If omitted, the default list of fields will be returned. + * @param "Limit" (optional.Int32) - The number of records to return at once. Limited to 100. + * @param "Skip" (optional.Int32) - The offset into the records to return. + * @param "Filter" (optional.String) - A filter to apply to the query. See the supported operators below. For more complex searches, see the related `/search/<domain>` endpoints, e.g. `/search/systems`. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: - `$eq` (equals) - `$ne` (does not equal) - `$gt` (is greater than) - `$gte` (is greater than or equal to) - `$lt` (is less than) - `$lte` (is less than or equal to) _Note: v1 operators differ from v2 operators._ _Note: For v1 operators, excluding the `$` will result in undefined behavior._ **value** = Populate with the value you want to search for. Is case sensitive. **Examples** - `GET /users?filter=username:$eq:testuser` - `GET /systemusers?filter=password_expiration_date:$lte:2021-10-24` - `GET /systemusers?filter=department:$ne:Accounting` - `GET /systems?filter[0]=firstname:$eq:foo&filter[1]=lastname:$eq:bar` - this will AND the filters together. - `GET /systems?filter[or][0]=lastname:$eq:foo&filter[or][1]=lastname:$eq:bar` - this will OR the filters together. +@return Systemslist +*/ + +type SearchApiSearchSystemsPostOpts struct { + Body optional.Interface + XOrgId optional.String + Fields optional.String + Limit optional.Int32 + Skip optional.Int32 + Filter optional.String +} + +func (a *SearchApiService) SearchSystemsPost(ctx context.Context, localVarOptionals *SearchApiSearchSystemsPostOpts) (Systemslist, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Post") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue Systemslist + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/search/systems" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Fields.IsSet() { + localVarQueryParams.Add("fields", parameterToString(localVarOptionals.Fields.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { + localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Skip.IsSet() { + localVarQueryParams.Add("skip", parameterToString(localVarOptionals.Skip.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Filter.IsSet() { + localVarQueryParams.Add("filter", parameterToString(localVarOptionals.Filter.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + // body params + if localVarOptionals != nil && localVarOptionals.Body.IsSet() { + + localVarOptionalBody:= localVarOptionals.Body.Value() + localVarPostBody = &localVarOptionalBody + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v Systemslist + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +SearchApiService Search System Users +Return System Users in multi-record format allowing for the passing of the `filter` and `searchFilter` parameters. This WILL NOT allow you to add a new system user. To support advanced filtering you can use the `filter` and `searchFilter` parameters that can only be passed in the body of POST /api/search/_* routes. The `filter` and `searchFilter` parameters must be passed as Content-Type application/json. The `filter` parameter is an object with a single property, either `and` or `or` with the value of the property being an array of query expressions. This allows you to filter records using the logic of matching ALL or ANY records in the array of query expressions. If the `and` or `or` are not included the default behavior is to match ALL query expressions. The `searchFilter` parameter allows text searching on supported fields by specifying a `searchTerm` and a list of `fields` to query on. If any `field` has a partial text match on the `searchTerm` the record will be returned. #### Sample Request Exact search for a list of system users in a department ``` curl -X POST https://console.jumpcloud.com/api/search/systemusers \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"filter\" : [{\"department\" : \"IT\"}], \"fields\" : \"email username sudo\" }' ``` Text search for system users with and email on a domain ``` curl -X POST https://console.jumpcloud.com/api/search/systemusers \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"searchFilter\" : { \"searchTerm\": \"@jumpcloud.com\", \"fields\": [\"email\"] }, \"fields\" : \"email username sudo\" }' ``` Text search for multiple system users ``` curl -X POST https://console.jumpcloud.com/api/search/systemusers \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"searchFilter\" : { \"searchTerm\": [\"john\", \"sarah\"], \"fields\": [\"username\"] }, \"fields\" : \"email username sudo\" }' ``` Combining `filter` and `searchFilter` to text search for system users with and email on a domain who are in a list of departments ``` curl -X POST https://console.jumpcloud.com/api/search/systemusers \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"searchFilter\": { \"searchTerm\": \"@jumpcloud.com\", \"fields\": [\"email\"] }, \"filter\": { \"or\": [ {\"department\" : \"IT\"}, {\"department\" : \"Sales\"} ] }, \"fields\" : \"email username sudo\" }' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param optional nil or *SearchApiSearchSystemusersPostOpts - Optional Parameters: + * @param "Body" (optional.Interface of Search) - + * @param "XOrgId" (optional.String) - + * @param "Fields" (optional.String) - Use a space seperated string of field parameters to include the data in the response. If omitted, the default list of fields will be returned. + * @param "Filter" (optional.String) - A filter to apply to the query. See the supported operators below. For more complex searches, see the related `/search/<domain>` endpoints, e.g. `/search/systems`. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: - `$eq` (equals) - `$ne` (does not equal) - `$gt` (is greater than) - `$gte` (is greater than or equal to) - `$lt` (is less than) - `$lte` (is less than or equal to) _Note: v1 operators differ from v2 operators._ _Note: For v1 operators, excluding the `$` will result in undefined behavior._ **value** = Populate with the value you want to search for. Is case sensitive. **Examples** - `GET /users?filter=username:$eq:testuser` - `GET /systemusers?filter=password_expiration_date:$lte:2021-10-24` - `GET /systemusers?filter=department:$ne:Accounting` - `GET /systems?filter[0]=firstname:$eq:foo&filter[1]=lastname:$eq:bar` - this will AND the filters together. - `GET /systems?filter[or][0]=lastname:$eq:foo&filter[or][1]=lastname:$eq:bar` - this will OR the filters together. + * @param "Limit" (optional.Int32) - The number of records to return at once. Limited to 100. + * @param "Skip" (optional.Int32) - The offset into the records to return. +@return Systemuserslist +*/ + +type SearchApiSearchSystemusersPostOpts struct { + Body optional.Interface + XOrgId optional.String + Fields optional.String + Filter optional.String + Limit optional.Int32 + Skip optional.Int32 +} + +func (a *SearchApiService) SearchSystemusersPost(ctx context.Context, localVarOptionals *SearchApiSearchSystemusersPostOpts) (Systemuserslist, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Post") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue Systemuserslist + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/search/systemusers" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Fields.IsSet() { + localVarQueryParams.Add("fields", parameterToString(localVarOptionals.Fields.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Filter.IsSet() { + localVarQueryParams.Add("filter", parameterToString(localVarOptionals.Filter.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { + localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Skip.IsSet() { + localVarQueryParams.Add("skip", parameterToString(localVarOptionals.Skip.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + // body params + if localVarOptionals != nil && localVarOptionals.Body.IsSet() { + + localVarOptionalBody:= localVarOptionals.Body.Value() + localVarPostBody = &localVarOptionalBody + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v Systemuserslist + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} diff --git a/jcapiv1/api_systems.go b/jcapiv1/api_systems.go new file mode 100644 index 0000000..1041058 --- /dev/null +++ b/jcapiv1/api_systems.go @@ -0,0 +1,1140 @@ + +/* + * JumpCloud API + * + * # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 1.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv1 + +import ( + "context" + "io/ioutil" + "net/http" + "net/url" + "strings" + "fmt" + "github.com/antihax/optional" +) + +// Linger please +var ( + _ context.Context +) + +type SystemsApiService service +/* +SystemsApiService Erase a System +This endpoint allows you to run the erase command on the specified device. If a device is offline, the command will be run when the device becomes available. #### Sample Request ``` curl -X POST \\ https://console.jumpcloud.com/api/systems/{system_id}/command/builtin/erase \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d {} ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param systemId + * @param optional nil or *SystemsApiSystemsCommandBuiltinEraseOpts - Optional Parameters: + * @param "XOrgId" (optional.String) - + +*/ + +type SystemsApiSystemsCommandBuiltinEraseOpts struct { + XOrgId optional.String +} + +func (a *SystemsApiService) SystemsCommandBuiltinErase(ctx context.Context, systemId string, localVarOptionals *SystemsApiSystemsCommandBuiltinEraseOpts) (*http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Post") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/systems/{system_id}/command/builtin/erase" + localVarPath = strings.Replace(localVarPath, "{"+"system_id"+"}", fmt.Sprintf("%v", systemId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarHttpResponse, err + } + + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 400 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarHttpResponse, newErr + } + newErr.model = v + return localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 401 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarHttpResponse, newErr + } + newErr.model = v + return localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 403 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarHttpResponse, newErr + } + newErr.model = v + return localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 404 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarHttpResponse, newErr + } + newErr.model = v + return localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 409 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarHttpResponse, newErr + } + newErr.model = v + return localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 500 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarHttpResponse, newErr + } + newErr.model = v + return localVarHttpResponse, newErr + } + return localVarHttpResponse, newErr + } + + return localVarHttpResponse, nil +} +/* +SystemsApiService Lock a System +This endpoint allows you to run the lock command on the specified device. If a device is offline, the command will be run when the device becomes available. #### Sample Request ``` curl -X POST \\ https://console.jumpcloud.com/api/systems/{system_id}/command/builtin/lock \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d {} ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param systemId + * @param optional nil or *SystemsApiSystemsCommandBuiltinLockOpts - Optional Parameters: + * @param "XOrgId" (optional.String) - + +*/ + +type SystemsApiSystemsCommandBuiltinLockOpts struct { + XOrgId optional.String +} + +func (a *SystemsApiService) SystemsCommandBuiltinLock(ctx context.Context, systemId string, localVarOptionals *SystemsApiSystemsCommandBuiltinLockOpts) (*http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Post") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/systems/{system_id}/command/builtin/lock" + localVarPath = strings.Replace(localVarPath, "{"+"system_id"+"}", fmt.Sprintf("%v", systemId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarHttpResponse, err + } + + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 400 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarHttpResponse, newErr + } + newErr.model = v + return localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 401 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarHttpResponse, newErr + } + newErr.model = v + return localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 403 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarHttpResponse, newErr + } + newErr.model = v + return localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 404 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarHttpResponse, newErr + } + newErr.model = v + return localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 409 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarHttpResponse, newErr + } + newErr.model = v + return localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 500 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarHttpResponse, newErr + } + newErr.model = v + return localVarHttpResponse, newErr + } + return localVarHttpResponse, newErr + } + + return localVarHttpResponse, nil +} +/* +SystemsApiService Restart a System +This endpoint allows you to run the restart command on the specified device. If a device is offline, the command will be run when the device becomes available. #### Sample Request ``` curl -X POST \\ https://console.jumpcloud.com/api/systems/{system_id}/command/builtin/restart \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d {} ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param systemId + * @param optional nil or *SystemsApiSystemsCommandBuiltinRestartOpts - Optional Parameters: + * @param "XOrgId" (optional.String) - + +*/ + +type SystemsApiSystemsCommandBuiltinRestartOpts struct { + XOrgId optional.String +} + +func (a *SystemsApiService) SystemsCommandBuiltinRestart(ctx context.Context, systemId string, localVarOptionals *SystemsApiSystemsCommandBuiltinRestartOpts) (*http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Post") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/systems/{system_id}/command/builtin/restart" + localVarPath = strings.Replace(localVarPath, "{"+"system_id"+"}", fmt.Sprintf("%v", systemId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarHttpResponse, err + } + + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 400 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarHttpResponse, newErr + } + newErr.model = v + return localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 401 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarHttpResponse, newErr + } + newErr.model = v + return localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 403 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarHttpResponse, newErr + } + newErr.model = v + return localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 404 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarHttpResponse, newErr + } + newErr.model = v + return localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 409 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarHttpResponse, newErr + } + newErr.model = v + return localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 500 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarHttpResponse, newErr + } + newErr.model = v + return localVarHttpResponse, newErr + } + return localVarHttpResponse, newErr + } + + return localVarHttpResponse, nil +} +/* +SystemsApiService Shutdown a System +This endpoint allows you to run the shutdown command on the specified device. If a device is offline, the command will be run when the device becomes available. #### Sample Request ``` curl -X POST \\ https://console.jumpcloud.com/api/systems/{system_id}/command/builtin/shutdown \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d {} ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param systemId + * @param optional nil or *SystemsApiSystemsCommandBuiltinShutdownOpts - Optional Parameters: + * @param "XOrgId" (optional.String) - + +*/ + +type SystemsApiSystemsCommandBuiltinShutdownOpts struct { + XOrgId optional.String +} + +func (a *SystemsApiService) SystemsCommandBuiltinShutdown(ctx context.Context, systemId string, localVarOptionals *SystemsApiSystemsCommandBuiltinShutdownOpts) (*http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Post") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/systems/{system_id}/command/builtin/shutdown" + localVarPath = strings.Replace(localVarPath, "{"+"system_id"+"}", fmt.Sprintf("%v", systemId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarHttpResponse, err + } + + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 400 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarHttpResponse, newErr + } + newErr.model = v + return localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 401 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarHttpResponse, newErr + } + newErr.model = v + return localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 403 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarHttpResponse, newErr + } + newErr.model = v + return localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 404 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarHttpResponse, newErr + } + newErr.model = v + return localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 409 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarHttpResponse, newErr + } + newErr.model = v + return localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 500 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarHttpResponse, newErr + } + newErr.model = v + return localVarHttpResponse, newErr + } + return localVarHttpResponse, newErr + } + + return localVarHttpResponse, nil +} +/* +SystemsApiService Delete a System +This endpoint allows you to delete a system. This command will cause the system to uninstall the JumpCloud agent from its self which can can take about a minute. If the system is not connected to JumpCloud the system record will simply be removed. #### Sample Request ``` curl -X DELETE https://console.jumpcloud.com/api/systems/{SystemID} \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param id + * @param optional nil or *SystemsApiSystemsDeleteOpts - Optional Parameters: + * @param "Date" (optional.String) - Current date header for the System Context API + * @param "Authorization" (optional.String) - Authorization header for the System Context API + * @param "XOrgId" (optional.String) - +@return System +*/ + +type SystemsApiSystemsDeleteOpts struct { + Date optional.String + Authorization optional.String + XOrgId optional.String +} + +func (a *SystemsApiService) SystemsDelete(ctx context.Context, id string, localVarOptionals *SystemsApiSystemsDeleteOpts) (System, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Delete") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue System + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/systems/{id}" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.Date.IsSet() { + localVarHeaderParams["Date"] = parameterToString(localVarOptionals.Date.Value(), "") + } + if localVarOptionals != nil && localVarOptionals.Authorization.IsSet() { + localVarHeaderParams["Authorization"] = parameterToString(localVarOptionals.Authorization.Value(), "") + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v System + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +SystemsApiService List an individual system +This endpoint returns an individual system. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/systems/{SystemID} \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param id + * @param optional nil or *SystemsApiSystemsGetOpts - Optional Parameters: + * @param "Fields" (optional.String) - Use a space seperated string of field parameters to include the data in the response. If omitted, the default list of fields will be returned. + * @param "Filter" (optional.String) - A filter to apply to the query. See the supported operators below. For more complex searches, see the related `/search/<domain>` endpoints, e.g. `/search/systems`. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: - `$eq` (equals) - `$ne` (does not equal) - `$gt` (is greater than) - `$gte` (is greater than or equal to) - `$lt` (is less than) - `$lte` (is less than or equal to) _Note: v1 operators differ from v2 operators._ _Note: For v1 operators, excluding the `$` will result in undefined behavior._ **value** = Populate with the value you want to search for. Is case sensitive. **Examples** - `GET /users?filter=username:$eq:testuser` - `GET /systemusers?filter=password_expiration_date:$lte:2021-10-24` - `GET /systemusers?filter=department:$ne:Accounting` - `GET /systems?filter[0]=firstname:$eq:foo&filter[1]=lastname:$eq:bar` - this will AND the filters together. - `GET /systems?filter[or][0]=lastname:$eq:foo&filter[or][1]=lastname:$eq:bar` - this will OR the filters together. + * @param "Date" (optional.String) - Current date header for the System Context API + * @param "Authorization" (optional.String) - Authorization header for the System Context API + * @param "XOrgId" (optional.String) - +@return System +*/ + +type SystemsApiSystemsGetOpts struct { + Fields optional.String + Filter optional.String + Date optional.String + Authorization optional.String + XOrgId optional.String +} + +func (a *SystemsApiService) SystemsGet(ctx context.Context, id string, localVarOptionals *SystemsApiSystemsGetOpts) (System, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue System + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/systems/{id}" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Fields.IsSet() { + localVarQueryParams.Add("fields", parameterToString(localVarOptionals.Fields.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Filter.IsSet() { + localVarQueryParams.Add("filter", parameterToString(localVarOptionals.Filter.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.Date.IsSet() { + localVarHeaderParams["Date"] = parameterToString(localVarOptionals.Date.Value(), "") + } + if localVarOptionals != nil && localVarOptionals.Authorization.IsSet() { + localVarHeaderParams["Authorization"] = parameterToString(localVarOptionals.Authorization.Value(), "") + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v System + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +SystemsApiService List All Systems +This endpoint returns all Systems. #### Sample Requests ``` curl -X GET https://console.jumpcloud.com/api/systems \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param optional nil or *SystemsApiSystemsListOpts - Optional Parameters: + * @param "Fields" (optional.String) - Use a space seperated string of field parameters to include the data in the response. If omitted, the default list of fields will be returned. + * @param "Limit" (optional.Int32) - The number of records to return at once. Limited to 100. + * @param "XOrgId" (optional.String) - + * @param "Search" (optional.String) - A nested object containing a `searchTerm` string or array of strings and a list of `fields` to search on. + * @param "Skip" (optional.Int32) - The offset into the records to return. + * @param "Sort" (optional.String) - Use space separated sort parameters to sort the collection. Default sort is ascending. Prefix with `-` to sort descending. + * @param "Filter" (optional.String) - A filter to apply to the query. See the supported operators below. For more complex searches, see the related `/search/<domain>` endpoints, e.g. `/search/systems`. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: - `$eq` (equals) - `$ne` (does not equal) - `$gt` (is greater than) - `$gte` (is greater than or equal to) - `$lt` (is less than) - `$lte` (is less than or equal to) _Note: v1 operators differ from v2 operators._ _Note: For v1 operators, excluding the `$` will result in undefined behavior._ **value** = Populate with the value you want to search for. Is case sensitive. **Examples** - `GET /users?filter=username:$eq:testuser` - `GET /systemusers?filter=password_expiration_date:$lte:2021-10-24` - `GET /systemusers?filter=department:$ne:Accounting` - `GET /systems?filter[0]=firstname:$eq:foo&filter[1]=lastname:$eq:bar` - this will AND the filters together. - `GET /systems?filter[or][0]=lastname:$eq:foo&filter[or][1]=lastname:$eq:bar` - this will OR the filters together. +@return Systemslist +*/ + +type SystemsApiSystemsListOpts struct { + Fields optional.String + Limit optional.Int32 + XOrgId optional.String + Search optional.String + Skip optional.Int32 + Sort optional.String + Filter optional.String +} + +func (a *SystemsApiService) SystemsList(ctx context.Context, localVarOptionals *SystemsApiSystemsListOpts) (Systemslist, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue Systemslist + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/systems" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Fields.IsSet() { + localVarQueryParams.Add("fields", parameterToString(localVarOptionals.Fields.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { + localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Search.IsSet() { + localVarQueryParams.Add("search", parameterToString(localVarOptionals.Search.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Skip.IsSet() { + localVarQueryParams.Add("skip", parameterToString(localVarOptionals.Skip.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Sort.IsSet() { + localVarQueryParams.Add("sort", parameterToString(localVarOptionals.Sort.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Filter.IsSet() { + localVarQueryParams.Add("filter", parameterToString(localVarOptionals.Filter.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v Systemslist + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +SystemsApiService Update a system +This endpoint allows you to update a system. #### Sample Request ``` curl -X PUT https://console.jumpcloud.com/api/systems/{SystemID} \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"displayName\":\"Name_Update\", \"allowSshPasswordAuthentication\":\"true\", \"allowSshRootLogin\":\"true\", \"allowMultiFactorAuthentication\":\"true\", \"allowPublicKeyAuthentication\":\"false\" }' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param id + * @param optional nil or *SystemsApiSystemsPutOpts - Optional Parameters: + * @param "Body" (optional.Interface of Systemput) - + * @param "Date" (optional.String) - Current date header for the System Context API + * @param "Authorization" (optional.String) - Authorization header for the System Context API + * @param "XOrgId" (optional.String) - +@return System +*/ + +type SystemsApiSystemsPutOpts struct { + Body optional.Interface + Date optional.String + Authorization optional.String + XOrgId optional.String +} + +func (a *SystemsApiService) SystemsPut(ctx context.Context, id string, localVarOptionals *SystemsApiSystemsPutOpts) (System, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Put") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue System + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/systems/{id}" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.Date.IsSet() { + localVarHeaderParams["Date"] = parameterToString(localVarOptionals.Date.Value(), "") + } + if localVarOptionals != nil && localVarOptionals.Authorization.IsSet() { + localVarHeaderParams["Authorization"] = parameterToString(localVarOptionals.Authorization.Value(), "") + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + // body params + if localVarOptionals != nil && localVarOptionals.Body.IsSet() { + + localVarOptionalBody:= localVarOptionals.Body.Value() + localVarPostBody = &localVarOptionalBody + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v System + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} diff --git a/jcapiv1/api_systemusers.go b/jcapiv1/api_systemusers.go new file mode 100644 index 0000000..2d890e6 --- /dev/null +++ b/jcapiv1/api_systemusers.go @@ -0,0 +1,1863 @@ + +/* + * JumpCloud API + * + * # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 1.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv1 + +import ( + "context" + "io/ioutil" + "net/http" + "net/url" + "strings" + "fmt" + "github.com/antihax/optional" +) + +// Linger please +var ( + _ context.Context +) + +type SystemusersApiService service +/* +SystemusersApiService Delete a system user's Public SSH Keys +This endpoint will delete a specific System User's SSH Key. + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param systemuserId + * @param id + * @param optional nil or *SystemusersApiSshkeyDeleteOpts - Optional Parameters: + * @param "XOrgId" (optional.String) - +@return string +*/ + +type SystemusersApiSshkeyDeleteOpts struct { + XOrgId optional.String +} + +func (a *SystemusersApiService) SshkeyDelete(ctx context.Context, systemuserId string, id string, localVarOptionals *SystemusersApiSshkeyDeleteOpts) (string, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Delete") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue string + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/systemusers/{systemuser_id}/sshkeys/{id}" + localVarPath = strings.Replace(localVarPath, "{"+"systemuser_id"+"}", fmt.Sprintf("%v", systemuserId), -1) + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json", "text/plain"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v string + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 400 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +SystemusersApiService List a system user's public SSH keys +This endpoint will return a specific System User's public SSH key. + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param id + * @param optional nil or *SystemusersApiSshkeyListOpts - Optional Parameters: + * @param "XOrgId" (optional.String) - +@return []Sshkeylist +*/ + +type SystemusersApiSshkeyListOpts struct { + XOrgId optional.String +} + +func (a *SystemusersApiService) SshkeyList(ctx context.Context, id string, localVarOptionals *SystemusersApiSshkeyListOpts) ([]Sshkeylist, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []Sshkeylist + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/systemusers/{id}/sshkeys" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v []Sshkeylist + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 400 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +SystemusersApiService Create a system user's Public SSH Key +This endpoint will create a specific System User's Public SSH Key. + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param id + * @param optional nil or *SystemusersApiSshkeyPostOpts - Optional Parameters: + * @param "Body" (optional.Interface of Sshkeypost) - + * @param "XOrgId" (optional.String) - +@return Sshkeylist +*/ + +type SystemusersApiSshkeyPostOpts struct { + Body optional.Interface + XOrgId optional.String +} + +func (a *SystemusersApiService) SshkeyPost(ctx context.Context, id string, localVarOptionals *SystemusersApiSshkeyPostOpts) (Sshkeylist, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Post") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue Sshkeylist + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/systemusers/{id}/sshkeys" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + // body params + if localVarOptionals != nil && localVarOptionals.Body.IsSet() { + + localVarOptionalBody:= localVarOptionals.Body.Value() + localVarPostBody = &localVarOptionalBody + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v Sshkeylist + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 400 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +SystemusersApiService Delete a system user +This endpoint allows you to delete a particular system user. #### Sample Request ``` curl -X DELETE https://console.jumpcloud.com/api/systemusers/{UserID} \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param id + * @param optional nil or *SystemusersApiSystemusersDeleteOpts - Optional Parameters: + * @param "XOrgId" (optional.String) - + * @param "CascadeManager" (optional.String) - This is an optional flag that can be enabled on the DELETE call, DELETE /systemusers/{id}?cascade_manager=null. This parameter will clear the Manager attribute on all direct reports and then delete the account. +@return Systemuserreturn +*/ + +type SystemusersApiSystemusersDeleteOpts struct { + XOrgId optional.String + CascadeManager optional.String +} + +func (a *SystemusersApiService) SystemusersDelete(ctx context.Context, id string, localVarOptionals *SystemusersApiSystemusersDeleteOpts) (Systemuserreturn, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Delete") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue Systemuserreturn + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/systemusers/{id}" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.CascadeManager.IsSet() { + localVarQueryParams.Add("cascade_manager", parameterToString(localVarOptionals.CascadeManager.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v Systemuserreturn + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 401 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 409 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +SystemusersApiService Expire a system user's password +This endpoint allows you to expire a user's password. + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param id + * @param optional nil or *SystemusersApiSystemusersExpireOpts - Optional Parameters: + * @param "XOrgId" (optional.String) - +@return string +*/ + +type SystemusersApiSystemusersExpireOpts struct { + XOrgId optional.String +} + +func (a *SystemusersApiService) SystemusersExpire(ctx context.Context, id string, localVarOptionals *SystemusersApiSystemusersExpireOpts) (string, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Post") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue string + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/systemusers/{id}/expire" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json", "text/plain"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v string + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 400 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 401 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 403 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 404 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 409 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 500 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +SystemusersApiService List a system user +This endpoint returns a particular System User. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/systemusers/{UserID} \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param id + * @param optional nil or *SystemusersApiSystemusersGetOpts - Optional Parameters: + * @param "Fields" (optional.String) - Use a space seperated string of field parameters to include the data in the response. If omitted, the default list of fields will be returned. + * @param "Filter" (optional.String) - A filter to apply to the query. See the supported operators below. For more complex searches, see the related `/search/<domain>` endpoints, e.g. `/search/systems`. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: - `$eq` (equals) - `$ne` (does not equal) - `$gt` (is greater than) - `$gte` (is greater than or equal to) - `$lt` (is less than) - `$lte` (is less than or equal to) _Note: v1 operators differ from v2 operators._ _Note: For v1 operators, excluding the `$` will result in undefined behavior._ **value** = Populate with the value you want to search for. Is case sensitive. **Examples** - `GET /users?filter=username:$eq:testuser` - `GET /systemusers?filter=password_expiration_date:$lte:2021-10-24` - `GET /systemusers?filter=department:$ne:Accounting` - `GET /systems?filter[0]=firstname:$eq:foo&filter[1]=lastname:$eq:bar` - this will AND the filters together. - `GET /systems?filter[or][0]=lastname:$eq:foo&filter[or][1]=lastname:$eq:bar` - this will OR the filters together. + * @param "XOrgId" (optional.String) - +@return Systemuserreturn +*/ + +type SystemusersApiSystemusersGetOpts struct { + Fields optional.String + Filter optional.String + XOrgId optional.String +} + +func (a *SystemusersApiService) SystemusersGet(ctx context.Context, id string, localVarOptionals *SystemusersApiSystemusersGetOpts) (Systemuserreturn, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue Systemuserreturn + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/systemusers/{id}" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Fields.IsSet() { + localVarQueryParams.Add("fields", parameterToString(localVarOptionals.Fields.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Filter.IsSet() { + localVarQueryParams.Add("filter", parameterToString(localVarOptionals.Filter.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v Systemuserreturn + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +SystemusersApiService List all system users +This endpoint returns all systemusers. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/systemusers \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param optional nil or *SystemusersApiSystemusersListOpts - Optional Parameters: + * @param "Limit" (optional.Int32) - The number of records to return at once. + * @param "Skip" (optional.Int32) - The offset into the records to return. + * @param "Sort" (optional.String) - The space separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. + * @param "Fields" (optional.String) - The space separated fields included in the returned records. If omitted the default list of fields will be returned. + * @param "Filter" (optional.String) - A filter to apply to the query. See the supported operators below. For more complex searches, see the related `/search/<domain>` endpoints, e.g. `/search/systems`. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: - `$eq` (equals) - `$ne` (does not equal) - `$gt` (is greater than) - `$gte` (is greater than or equal to) - `$lt` (is less than) - `$lte` (is less than or equal to) _Note: v1 operators differ from v2 operators._ _Note: For v1 operators, excluding the `$` will result in undefined behavior._ **value** = Populate with the value you want to search for. Is case sensitive. **Examples** - `GET /users?filter=username:$eq:testuser` - `GET /systemusers?filter=password_expiration_date:$lte:2021-10-24` - `GET /systemusers?filter=department:$ne:Accounting` - `GET /systems?filter[0]=firstname:$eq:foo&filter[1]=lastname:$eq:bar` - this will AND the filters together. - `GET /systems?filter[or][0]=lastname:$eq:foo&filter[or][1]=lastname:$eq:bar` - this will OR the filters together. + * @param "XOrgId" (optional.String) - + * @param "Search" (optional.String) - A nested object containing a `searchTerm` string or array of strings and a list of `fields` to search on. +@return Systemuserslist +*/ + +type SystemusersApiSystemusersListOpts struct { + Limit optional.Int32 + Skip optional.Int32 + Sort optional.String + Fields optional.String + Filter optional.String + XOrgId optional.String + Search optional.String +} + +func (a *SystemusersApiService) SystemusersList(ctx context.Context, localVarOptionals *SystemusersApiSystemusersListOpts) (Systemuserslist, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue Systemuserslist + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/systemusers" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { + localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Skip.IsSet() { + localVarQueryParams.Add("skip", parameterToString(localVarOptionals.Skip.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Sort.IsSet() { + localVarQueryParams.Add("sort", parameterToString(localVarOptionals.Sort.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Fields.IsSet() { + localVarQueryParams.Add("fields", parameterToString(localVarOptionals.Fields.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Filter.IsSet() { + localVarQueryParams.Add("filter", parameterToString(localVarOptionals.Filter.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Search.IsSet() { + localVarQueryParams.Add("search", parameterToString(localVarOptionals.Search.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v Systemuserslist + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +SystemusersApiService Sync a systemuser's mfa enrollment status +This endpoint allows you to re-sync a user's mfa enrollment status #### Sample Request ``` curl -X POST \\ https://console.jumpcloud.com/api/systemusers/{UserID}/mfasync \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param id + +*/ +func (a *SystemusersApiService) SystemusersMfasync(ctx context.Context, id string) (*http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Post") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/systemusers/{id}/mfasync" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarHttpResponse, err + } + + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 400 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarHttpResponse, newErr + } + newErr.model = v + return localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 401 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarHttpResponse, newErr + } + newErr.model = v + return localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 403 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarHttpResponse, newErr + } + newErr.model = v + return localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 404 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarHttpResponse, newErr + } + newErr.model = v + return localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 409 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarHttpResponse, newErr + } + newErr.model = v + return localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 500 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarHttpResponse, newErr + } + newErr.model = v + return localVarHttpResponse, newErr + } + return localVarHttpResponse, newErr + } + + return localVarHttpResponse, nil +} +/* +SystemusersApiService Create a system user +\"This endpoint allows you to create a new system user. #### Default User State The `state` of the user can be explicitly passed in or omitted. If `state` is omitted from the request, then the user will get created using the value returned from the [Get an Organization](https://docs.jumpcloud.com/api/1.0/index.html#operation/organizations_get) endpoint. The default user state for manually created users is stored in `settings.newSystemUserStateDefaults.manualEntry` These default state values can be changed in the admin portal settings or by using the [Update an Organization](https://docs.jumpcloud.com/api/1.0/index.html#operation/organization_put) endpoint. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/systemusers \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"username\":\"{username}\", \"email\":\"{email_address}\", \"firstname\":\"{Name}\", \"lastname\":\"{Name}\" }' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param optional nil or *SystemusersApiSystemusersPostOpts - Optional Parameters: + * @param "Body" (optional.Interface of Systemuserputpost) - + * @param "XOrgId" (optional.String) - + * @param "FullValidationDetails" (optional.String) - Pass this query parameter when a client wants all validation errors to be returned with a detailed error response for the form field specified. The current form fields are allowed: * `password` #### Password validation flag Use the `password` validation flag to receive details on a possible bad request response ``` ?fullValidationDetails=password ``` Without the flag, default behavior will be a normal 400 with only a single validation string error #### Expected Behavior Clients can expect a list of validation error mappings for the validation query field in the details provided on the response: ``` { \"code\": 400, \"message\": \"Password validation fail\", \"status\": \"INVALID_ARGUMENT\", \"details\": [ { \"fieldViolationsList\": [ {\"field\": \"password\", \"description\": \"specialCharacter\"} ], '@type': 'type.googleapis.com/google.rpc.BadRequest', }, ], }, ``` +@return Systemuserreturn +*/ + +type SystemusersApiSystemusersPostOpts struct { + Body optional.Interface + XOrgId optional.String + FullValidationDetails optional.String +} + +func (a *SystemusersApiService) SystemusersPost(ctx context.Context, localVarOptionals *SystemusersApiSystemusersPostOpts) (Systemuserreturn, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Post") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue Systemuserreturn + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/systemusers" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.FullValidationDetails.IsSet() { + localVarQueryParams.Add("fullValidationDetails", parameterToString(localVarOptionals.FullValidationDetails.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + // body params + if localVarOptionals != nil && localVarOptionals.Body.IsSet() { + + localVarOptionalBody:= localVarOptionals.Body.Value() + localVarPostBody = &localVarOptionalBody + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v Systemuserreturn + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 400 { + var v ErrorDetails + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +SystemusersApiService Update a system user +This endpoint allows you to update a system user. #### Sample Request ``` curl -X PUT https://console.jumpcloud.com/api/systemusers/{UserID} \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"email\":\"{email_address}\", \"firstname\":\"{Name}\", \"lastname\":\"{Name}\" }' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param id + * @param optional nil or *SystemusersApiSystemusersPutOpts - Optional Parameters: + * @param "Body" (optional.Interface of Systemuserput) - + * @param "XOrgId" (optional.String) - + * @param "FullValidationDetails" (optional.String) - This endpoint can take in a query when a client wants all validation errors to be returned with error response for the form field specified, i.e. 'password' #### Password validation flag Use the \"password\" validation flag to receive details on a possible bad request response Without the `password` flag, default behavior will be a normal 400 with only a validation string message ``` ?fullValidationDetails=password ``` #### Expected Behavior Clients can expect a list of validation error mappings for the validation query field in the details provided on the response: ``` { \"code\": 400, \"message\": \"Password validation fail\", \"status\": \"INVALID_ARGUMENT\", \"details\": [ { \"fieldViolationsList\": [{ \"field\": \"password\", \"description\": \"passwordHistory\" }], '@type': 'type.googleapis.com/google.rpc.BadRequest', }, ], }, ``` +@return Systemuserreturn +*/ + +type SystemusersApiSystemusersPutOpts struct { + Body optional.Interface + XOrgId optional.String + FullValidationDetails optional.String +} + +func (a *SystemusersApiService) SystemusersPut(ctx context.Context, id string, localVarOptionals *SystemusersApiSystemusersPutOpts) (Systemuserreturn, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Put") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue Systemuserreturn + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/systemusers/{id}" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.FullValidationDetails.IsSet() { + localVarQueryParams.Add("fullValidationDetails", parameterToString(localVarOptionals.FullValidationDetails.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + // body params + if localVarOptionals != nil && localVarOptionals.Body.IsSet() { + + localVarOptionalBody:= localVarOptionals.Body.Value() + localVarPostBody = &localVarOptionalBody + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v Systemuserreturn + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 400 { + var v ErrorDetails + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +SystemusersApiService Reset a system user's MFA token +This endpoint allows you to reset the TOTP key for a specified system user and put them in an TOTP MFA enrollment period. This will result in the user being prompted to setup TOTP MFA when logging into userportal. Please be aware that if the user does not complete TOTP MFA setup before the `exclusionUntil` date, they will be locked out of any resources that require TOTP MFA. Please refer to our [Knowledge Base Article](https://support.jumpcloud.com/customer/en/portal/articles/2959138-using-multifactor-authentication-with-jumpcloud) on setting up MFA for more information. #### Sample Request ``` curl -X POST \\ https://console.jumpcloud.com/api/systemusers/{UserID}/resetmfa \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{\"exclusion\": true, \"exclusionUntil\": \"{date-time}\"}' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param id + * @param optional nil or *SystemusersApiSystemusersResetmfaOpts - Optional Parameters: + * @param "Body" (optional.Interface of IdResetmfaBody) - + * @param "XOrgId" (optional.String) - +@return string +*/ + +type SystemusersApiSystemusersResetmfaOpts struct { + Body optional.Interface + XOrgId optional.String +} + +func (a *SystemusersApiService) SystemusersResetmfa(ctx context.Context, id string, localVarOptionals *SystemusersApiSystemusersResetmfaOpts) (string, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Post") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue string + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/systemusers/{id}/resetmfa" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json", "text/plain"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + // body params + if localVarOptionals != nil && localVarOptionals.Body.IsSet() { + + localVarOptionalBody:= localVarOptionals.Body.Value() + localVarPostBody = &localVarOptionalBody + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v string + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 400 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 401 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 403 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 404 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 409 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 500 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +SystemusersApiService Activate System User +This endpoint changes the state of a STAGED user to ACTIVATED. #### Email Flag Use the \"email\" flag to determine whether or not to send a Welcome or Activation email to the newly activated user. Sending an empty body without the `email` flag, will send an email with default behavior (see the \"Behavior\" section below) ``` {} ``` Sending `email=true` flag will send an email with default behavior (see `Behavior` below) ``` { \"email\": true } ``` Populated email will override the default behavior and send to the specified email value ``` { \"email\": \"example@example.com\" } ``` Sending `email=false` will suppress sending the email ``` { \"email\": false } ``` #### Behavior Users with a password will be sent a Welcome email to: - The address specified in `email` flag in the request - If no `email` flag, the user's primary email address (default behavior) Users without a password will be sent an Activation email to: - The address specified in `email` flag in the request - If no `email` flag, the user's alternate email address (default behavior) - If no alternate email address, the user's primary email address (default behavior) #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/systemusers/{id}/state/activate \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: <api-key>' \\ -d '{ \"email\": \"alternate-activation-email@email.com\" }' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param id + * @param optional nil or *SystemusersApiSystemusersStateActivateOpts - Optional Parameters: + * @param "Body" (optional.Interface of StateActivateBody) - +@return string +*/ + +type SystemusersApiSystemusersStateActivateOpts struct { + Body optional.Interface +} + +func (a *SystemusersApiService) SystemusersStateActivate(ctx context.Context, id string, localVarOptionals *SystemusersApiSystemusersStateActivateOpts) (string, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Post") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue string + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/systemusers/{id}/state/activate" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + // body params + if localVarOptionals != nil && localVarOptionals.Body.IsSet() { + + localVarOptionalBody:= localVarOptionals.Body.Value() + localVarPostBody = &localVarOptionalBody + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v string + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 400 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 401 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 403 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 404 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 409 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 500 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +SystemusersApiService Unlock a system user +This endpoint allows you to unlock a user's account. + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param id + * @param optional nil or *SystemusersApiSystemusersUnlockOpts - Optional Parameters: + * @param "XOrgId" (optional.String) - +@return string +*/ + +type SystemusersApiSystemusersUnlockOpts struct { + XOrgId optional.String +} + +func (a *SystemusersApiService) SystemusersUnlock(ctx context.Context, id string, localVarOptionals *SystemusersApiSystemusersUnlockOpts) (string, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Post") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue string + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/systemusers/{id}/unlock" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json", "text/plain"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v string + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 400 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 401 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 403 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 404 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 409 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 500 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} diff --git a/jcapiv1/api_users.go b/jcapiv1/api_users.go new file mode 100644 index 0000000..9204823 --- /dev/null +++ b/jcapiv1/api_users.go @@ -0,0 +1,446 @@ + +/* + * JumpCloud API + * + * # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 1.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv1 + +import ( + "context" + "io/ioutil" + "net/http" + "net/url" + "strings" + "fmt" + "github.com/antihax/optional" +) + +// Linger please +var ( + _ context.Context +) + +type UsersApiService service +/* +UsersApiService Administrator TOTP Reset Initiation +This endpoint initiates a TOTP reset for an admin. This request does not accept a body. + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param id + +*/ +func (a *UsersApiService) AdminTotpresetBegin(ctx context.Context, id string) (*http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Post") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/users/resettotp/{id}" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarHttpResponse, err + } + + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 401 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarHttpResponse, newErr + } + newErr.model = v + return localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 403 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarHttpResponse, newErr + } + newErr.model = v + return localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 404 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarHttpResponse, newErr + } + newErr.model = v + return localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 412 { + var v interface{} + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarHttpResponse, newErr + } + newErr.model = v + return localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 500 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarHttpResponse, newErr + } + newErr.model = v + return localVarHttpResponse, newErr + } + return localVarHttpResponse, newErr + } + + return localVarHttpResponse, nil +} +/* +UsersApiService Update a user +This endpoint allows you to update a user. + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param id + * @param optional nil or *UsersApiUsersPutOpts - Optional Parameters: + * @param "Body" (optional.Interface of Userput) - + * @param "XOrgId" (optional.String) - +@return Userreturn +*/ + +type UsersApiUsersPutOpts struct { + Body optional.Interface + XOrgId optional.String +} + +func (a *UsersApiService) UsersPut(ctx context.Context, id string, localVarOptionals *UsersApiUsersPutOpts) (Userreturn, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Put") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue Userreturn + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/users/{id}" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + // body params + if localVarOptionals != nil && localVarOptionals.Body.IsSet() { + + localVarOptionalBody:= localVarOptionals.Body.Value() + localVarPostBody = &localVarOptionalBody + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v Userreturn + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 400 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 401 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 403 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 404 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 500 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +UsersApiService Administrator Password Reset Initiation +This endpoint triggers the sending of a reactivation e-mail to an administrator. + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param id + +*/ +func (a *UsersApiService) UsersReactivateGet(ctx context.Context, id string) (*http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/users/reactivate/{id}" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarHttpResponse, err + } + + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 401 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarHttpResponse, newErr + } + newErr.model = v + return localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 403 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarHttpResponse, newErr + } + newErr.model = v + return localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 404 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarHttpResponse, newErr + } + newErr.model = v + return localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 500 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarHttpResponse, newErr + } + newErr.model = v + return localVarHttpResponse, newErr + } + return localVarHttpResponse, newErr + } + + return localVarHttpResponse, nil +} diff --git a/jcapiv1/application.go b/jcapiv1/application.go new file mode 100644 index 0000000..69343b2 --- /dev/null +++ b/jcapiv1/application.go @@ -0,0 +1,46 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 1.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package jcapiv1 + +type Application struct { + + Id string `json:"_id,omitempty"` + + Active bool `json:"active,omitempty"` + + Beta bool `json:"beta,omitempty"` + + Color string `json:"color,omitempty"` + + Config *ApplicationConfig `json:"config"` + + Created string `json:"created,omitempty"` + + DatabaseAttributes []interface{} `json:"databaseAttributes,omitempty"` + + Description string `json:"description,omitempty"` + + DisplayLabel string `json:"displayLabel,omitempty"` + + DisplayName string `json:"displayName,omitempty"` + + LearnMore string `json:"learnMore,omitempty"` + + Logo *ApplicationLogo `json:"logo,omitempty"` + + Name string `json:"name"` + + Organization string `json:"organization,omitempty"` + + Sso *Sso `json:"sso,omitempty"` + + SsoUrl string `json:"ssoUrl"` +} diff --git a/jcapiv1/application_config.go b/jcapiv1/application_config.go new file mode 100644 index 0000000..ca892b8 --- /dev/null +++ b/jcapiv1/application_config.go @@ -0,0 +1,28 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 1.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package jcapiv1 + +type ApplicationConfig struct { + + AcsUrl *ApplicationConfigAcsUrl `json:"acsUrl,omitempty"` + + ConstantAttributes *ApplicationConfigConstantAttributes `json:"constantAttributes,omitempty"` + + DatabaseAttributes *ApplicationConfigDatabaseAttributes `json:"databaseAttributes,omitempty"` + + IdpCertificate *ApplicationConfigAcsUrl `json:"idpCertificate,omitempty"` + + IdpEntityId *ApplicationConfigAcsUrl `json:"idpEntityId,omitempty"` + + IdpPrivateKey *ApplicationConfigAcsUrl `json:"idpPrivateKey,omitempty"` + + SpEntityId *ApplicationConfigAcsUrl `json:"spEntityId,omitempty"` +} diff --git a/jcapiv1/application_config_acs_url.go b/jcapiv1/application_config_acs_url.go new file mode 100644 index 0000000..0a499b0 --- /dev/null +++ b/jcapiv1/application_config_acs_url.go @@ -0,0 +1,34 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 1.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package jcapiv1 + +type ApplicationConfigAcsUrl struct { + + Label string `json:"label,omitempty"` + + Options string `json:"options,omitempty"` + + Position int32 `json:"position,omitempty"` + + ReadOnly bool `json:"readOnly,omitempty"` + + Required bool `json:"required,omitempty"` + + Toggle string `json:"toggle,omitempty"` + + Tooltip *ApplicationConfigAcsUrlTooltip `json:"tooltip,omitempty"` + + Type_ string `json:"type,omitempty"` + + Value string `json:"value,omitempty"` + + Visible bool `json:"visible,omitempty"` +} diff --git a/jcapiv1/application_config_acs_url_tooltip.go b/jcapiv1/application_config_acs_url_tooltip.go new file mode 100644 index 0000000..9a2226d --- /dev/null +++ b/jcapiv1/application_config_acs_url_tooltip.go @@ -0,0 +1,18 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 1.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package jcapiv1 + +type ApplicationConfigAcsUrlTooltip struct { + + Template string `json:"template,omitempty"` + + Variables *ApplicationConfigAcsUrlTooltipVariables `json:"variables,omitempty"` +} diff --git a/jcapiv1/application_config_acs_url_tooltip_variables.go b/jcapiv1/application_config_acs_url_tooltip_variables.go new file mode 100644 index 0000000..464b5df --- /dev/null +++ b/jcapiv1/application_config_acs_url_tooltip_variables.go @@ -0,0 +1,18 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 1.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package jcapiv1 + +type ApplicationConfigAcsUrlTooltipVariables struct { + + Icon string `json:"icon,omitempty"` + + Message string `json:"message,omitempty"` +} diff --git a/jcapiv1/application_config_constant_attributes.go b/jcapiv1/application_config_constant_attributes.go new file mode 100644 index 0000000..f404d40 --- /dev/null +++ b/jcapiv1/application_config_constant_attributes.go @@ -0,0 +1,32 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 1.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package jcapiv1 + +type ApplicationConfigConstantAttributes struct { + + Label string `json:"label,omitempty"` + + Mutable bool `json:"mutable,omitempty"` + + Position int32 `json:"position,omitempty"` + + ReadOnly bool `json:"readOnly,omitempty"` + + Required bool `json:"required,omitempty"` + + Tooltip *ApplicationConfigAcsUrlTooltip `json:"tooltip,omitempty"` + + Type_ string `json:"type,omitempty"` + + Value []ApplicationConfigConstantAttributesValue `json:"value,omitempty"` + + Visible bool `json:"visible,omitempty"` +} diff --git a/jcapiv1/application_config_constant_attributes_value.go b/jcapiv1/application_config_constant_attributes_value.go new file mode 100644 index 0000000..a46672c --- /dev/null +++ b/jcapiv1/application_config_constant_attributes_value.go @@ -0,0 +1,24 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 1.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package jcapiv1 + +type ApplicationConfigConstantAttributesValue struct { + + Name string `json:"name,omitempty"` + + ReadOnly bool `json:"readOnly,omitempty"` + + Required bool `json:"required,omitempty"` + + Value string `json:"value,omitempty"` + + Visible bool `json:"visible,omitempty"` +} diff --git a/jcapiv1/application_config_database_attributes.go b/jcapiv1/application_config_database_attributes.go new file mode 100644 index 0000000..4af4b7d --- /dev/null +++ b/jcapiv1/application_config_database_attributes.go @@ -0,0 +1,16 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 1.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package jcapiv1 + +type ApplicationConfigDatabaseAttributes struct { + + Position int32 `json:"position,omitempty"` +} diff --git a/jcapiv1/application_logo.go b/jcapiv1/application_logo.go new file mode 100644 index 0000000..e16a495 --- /dev/null +++ b/jcapiv1/application_logo.go @@ -0,0 +1,18 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 1.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package jcapiv1 + +type ApplicationLogo struct { + + Color string `json:"color,omitempty"` + + Url string `json:"url,omitempty"` +} diff --git a/jcapiv1/application_templates_api.go b/jcapiv1/application_templates_api.go new file mode 100644 index 0000000..3006134 --- /dev/null +++ b/jcapiv1/application_templates_api.go @@ -0,0 +1,268 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 1.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package jcapiv1 + +import ( + "io/ioutil" + "net/url" + "net/http" + "strings" + "golang.org/x/net/context" + "encoding/json" + "fmt" +) + +// Linger please +var ( + _ context.Context +) + +type ApplicationTemplatesApiService service + + +/* ApplicationTemplatesApiService Get an Application Template + The endpoint returns a specific SSO / SAML Application Template. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/application-templates/{id} \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + * @param ctx context.Context for authentication, logging, tracing, etc. + @param id + @param optional (nil or map[string]interface{}) with one or more of: + @param "fields" (string) The space separated fields included in the returned records. If omitted the default list of fields will be returned. + @param "limit" (int32) The number of records to return at once. + @param "skip" (int32) The offset into the records to return. + @param "sort" (string) The space separated fields used to sort the collection. Default sort is ascending, prefix with - to sort descending. + @param "filter" (string) A filter to apply to the query. See the supported operators below. For more complex searches, see the related `/search/<domain>` endpoints, e.g. `/search/systems`. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: - `$eq` (equals) - `$ne` (does not equal) - `$gt` (is greater than) - `$gte` (is greater than or equal to) - `$lt` (is less than) - `$lte` (is less than or equal to) _Note: v1 operators differ from v2 operators._ _Note: For v1 operators, excluding the `$` will result in undefined behavior._ **value** = Populate with the value you want to search for. Is case sensitive. **Examples** - `GET /users?filter=username:$eq:testuser` - `GET /systemusers?filter=password_expiration_date:$lte:2021-10-24` - `GET /systemusers?filter=department:$ne:Accounting` - `GET /systems?filter[0]=firstname:$eq:foo&filter[1]=lastname:$eq:bar` - this will AND the filters together. - `GET /systems?filter[or][0]=lastname:$eq:foo&filter[or][1]=lastname:$eq:bar` - this will OR the filters together. + @param "xOrgId" (string) + @return Applicationtemplate*/ +func (a *ApplicationTemplatesApiService) ApplicationTemplatesGet(ctx context.Context, id string, localVarOptionals map[string]interface{}) (Applicationtemplate, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + successPayload Applicationtemplate + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/application-templates/{id}" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if err := typeCheckParameter(localVarOptionals["fields"], "string", "fields"); err != nil { + return successPayload, nil, err + } + if err := typeCheckParameter(localVarOptionals["limit"], "int32", "limit"); err != nil { + return successPayload, nil, err + } + if err := typeCheckParameter(localVarOptionals["skip"], "int32", "skip"); err != nil { + return successPayload, nil, err + } + if err := typeCheckParameter(localVarOptionals["sort"], "string", "sort"); err != nil { + return successPayload, nil, err + } + if err := typeCheckParameter(localVarOptionals["filter"], "string", "filter"); err != nil { + return successPayload, nil, err + } + if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { + return successPayload, nil, err + } + + if localVarTempParam, localVarOk := localVarOptionals["fields"].(string); localVarOk { + localVarQueryParams.Add("fields", parameterToString(localVarTempParam, "")) + } + if localVarTempParam, localVarOk := localVarOptionals["limit"].(int32); localVarOk { + localVarQueryParams.Add("limit", parameterToString(localVarTempParam, "")) + } + if localVarTempParam, localVarOk := localVarOptionals["skip"].(int32); localVarOk { + localVarQueryParams.Add("skip", parameterToString(localVarTempParam, "")) + } + if localVarTempParam, localVarOk := localVarOptionals["sort"].(string); localVarOk { + localVarQueryParams.Add("sort", parameterToString(localVarTempParam, "")) + } + if localVarTempParam, localVarOk := localVarOptionals["filter"].(string); localVarOk { + localVarQueryParams.Add("filter", parameterToString(localVarTempParam, "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{ "application/json", } + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{ + "application/json", + } + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { + localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return successPayload, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return successPayload, localVarHttpResponse, err + } + defer localVarHttpResponse.Body.Close() + if localVarHttpResponse.StatusCode >= 300 { + bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) + return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) + } + + if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { + return successPayload, localVarHttpResponse, err + } + + + return successPayload, localVarHttpResponse, err +} + +/* ApplicationTemplatesApiService List Application Templates + The endpoint returns all the SSO / SAML Application Templates. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/application-templates \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + * @param ctx context.Context for authentication, logging, tracing, etc. + @param optional (nil or map[string]interface{}) with one or more of: + @param "fields" (string) The space separated fields included in the returned records. If omitted the default list of fields will be returned. + @param "limit" (int32) The number of records to return at once. + @param "skip" (int32) The offset into the records to return. + @param "sort" (string) The space separated fields used to sort the collection. Default sort is ascending, prefix with - to sort descending. + @param "filter" (string) A filter to apply to the query. See the supported operators below. For more complex searches, see the related `/search/<domain>` endpoints, e.g. `/search/systems`. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: - `$eq` (equals) - `$ne` (does not equal) - `$gt` (is greater than) - `$gte` (is greater than or equal to) - `$lt` (is less than) - `$lte` (is less than or equal to) _Note: v1 operators differ from v2 operators._ _Note: For v1 operators, excluding the `$` will result in undefined behavior._ **value** = Populate with the value you want to search for. Is case sensitive. **Examples** - `GET /users?filter=username:$eq:testuser` - `GET /systemusers?filter=password_expiration_date:$lte:2021-10-24` - `GET /systemusers?filter=department:$ne:Accounting` - `GET /systems?filter[0]=firstname:$eq:foo&filter[1]=lastname:$eq:bar` - this will AND the filters together. - `GET /systems?filter[or][0]=lastname:$eq:foo&filter[or][1]=lastname:$eq:bar` - this will OR the filters together. + @param "xOrgId" (string) + @return Applicationtemplateslist*/ +func (a *ApplicationTemplatesApiService) ApplicationTemplatesList(ctx context.Context, localVarOptionals map[string]interface{}) (Applicationtemplateslist, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + successPayload Applicationtemplateslist + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/application-templates" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if err := typeCheckParameter(localVarOptionals["fields"], "string", "fields"); err != nil { + return successPayload, nil, err + } + if err := typeCheckParameter(localVarOptionals["limit"], "int32", "limit"); err != nil { + return successPayload, nil, err + } + if err := typeCheckParameter(localVarOptionals["skip"], "int32", "skip"); err != nil { + return successPayload, nil, err + } + if err := typeCheckParameter(localVarOptionals["sort"], "string", "sort"); err != nil { + return successPayload, nil, err + } + if err := typeCheckParameter(localVarOptionals["filter"], "string", "filter"); err != nil { + return successPayload, nil, err + } + if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { + return successPayload, nil, err + } + + if localVarTempParam, localVarOk := localVarOptionals["fields"].(string); localVarOk { + localVarQueryParams.Add("fields", parameterToString(localVarTempParam, "")) + } + if localVarTempParam, localVarOk := localVarOptionals["limit"].(int32); localVarOk { + localVarQueryParams.Add("limit", parameterToString(localVarTempParam, "")) + } + if localVarTempParam, localVarOk := localVarOptionals["skip"].(int32); localVarOk { + localVarQueryParams.Add("skip", parameterToString(localVarTempParam, "")) + } + if localVarTempParam, localVarOk := localVarOptionals["sort"].(string); localVarOk { + localVarQueryParams.Add("sort", parameterToString(localVarTempParam, "")) + } + if localVarTempParam, localVarOk := localVarOptionals["filter"].(string); localVarOk { + localVarQueryParams.Add("filter", parameterToString(localVarTempParam, "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{ "application/json", } + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{ + "application/json", + } + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { + localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return successPayload, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return successPayload, localVarHttpResponse, err + } + defer localVarHttpResponse.Body.Close() + if localVarHttpResponse.StatusCode >= 300 { + bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) + return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) + } + + if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { + return successPayload, localVarHttpResponse, err + } + + + return successPayload, localVarHttpResponse, err +} + diff --git a/jcapiv1/applications_api.go b/jcapiv1/applications_api.go new file mode 100644 index 0000000..91f8d3b --- /dev/null +++ b/jcapiv1/applications_api.go @@ -0,0 +1,496 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 1.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package jcapiv1 + +import ( + "io/ioutil" + "net/url" + "net/http" + "strings" + "golang.org/x/net/context" + "encoding/json" + "fmt" +) + +// Linger please +var ( + _ context.Context +) + +type ApplicationsApiService service + + +/* ApplicationsApiService Delete an Application + The endpoint deletes an SSO / SAML Application. + * @param ctx context.Context for authentication, logging, tracing, etc. + @param id + @param optional (nil or map[string]interface{}) with one or more of: + @param "xOrgId" (string) + @return Application*/ +func (a *ApplicationsApiService) ApplicationsDelete(ctx context.Context, id string, localVarOptionals map[string]interface{}) (Application, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Delete") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + successPayload Application + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/applications/{id}" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { + return successPayload, nil, err + } + + // to determine the Content-Type header + localVarHttpContentTypes := []string{ "application/json", } + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{ + "application/json", + } + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { + localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return successPayload, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return successPayload, localVarHttpResponse, err + } + defer localVarHttpResponse.Body.Close() + if localVarHttpResponse.StatusCode >= 300 { + bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) + return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) + } + + if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { + return successPayload, localVarHttpResponse, err + } + + + return successPayload, localVarHttpResponse, err +} + +/* ApplicationsApiService Get an Application + The endpoint retrieves an SSO / SAML Application. + * @param ctx context.Context for authentication, logging, tracing, etc. + @param id + @param optional (nil or map[string]interface{}) with one or more of: + @param "xOrgId" (string) + @return Application*/ +func (a *ApplicationsApiService) ApplicationsGet(ctx context.Context, id string, localVarOptionals map[string]interface{}) (Application, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + successPayload Application + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/applications/{id}" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { + return successPayload, nil, err + } + + // to determine the Content-Type header + localVarHttpContentTypes := []string{ "application/json", } + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{ + "application/json", + } + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { + localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return successPayload, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return successPayload, localVarHttpResponse, err + } + defer localVarHttpResponse.Body.Close() + if localVarHttpResponse.StatusCode >= 300 { + bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) + return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) + } + + if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { + return successPayload, localVarHttpResponse, err + } + + + return successPayload, localVarHttpResponse, err +} + +/* ApplicationsApiService Applications + The endpoint returns all your SSO / SAML Applications. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/applications \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + * @param ctx context.Context for authentication, logging, tracing, etc. + @param optional (nil or map[string]interface{}) with one or more of: + @param "fields" (string) The space separated fields included in the returned records. If omitted the default list of fields will be returned. + @param "limit" (int32) The number of records to return at once. + @param "skip" (int32) The offset into the records to return. + @param "sort" (string) The space separated fields used to sort the collection. Default sort is ascending, prefix with - to sort descending. + @param "filter" (string) A filter to apply to the query. See the supported operators below. For more complex searches, see the related `/search/<domain>` endpoints, e.g. `/search/systems`. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: - `$eq` (equals) - `$ne` (does not equal) - `$gt` (is greater than) - `$gte` (is greater than or equal to) - `$lt` (is less than) - `$lte` (is less than or equal to) _Note: v1 operators differ from v2 operators._ _Note: For v1 operators, excluding the `$` will result in undefined behavior._ **value** = Populate with the value you want to search for. Is case sensitive. **Examples** - `GET /users?filter=username:$eq:testuser` - `GET /systemusers?filter=password_expiration_date:$lte:2021-10-24` - `GET /systemusers?filter=department:$ne:Accounting` - `GET /systems?filter[0]=firstname:$eq:foo&filter[1]=lastname:$eq:bar` - this will AND the filters together. - `GET /systems?filter[or][0]=lastname:$eq:foo&filter[or][1]=lastname:$eq:bar` - this will OR the filters together. + @param "xOrgId" (string) + @return Applicationslist*/ +func (a *ApplicationsApiService) ApplicationsList(ctx context.Context, localVarOptionals map[string]interface{}) (Applicationslist, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + successPayload Applicationslist + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/applications" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if err := typeCheckParameter(localVarOptionals["fields"], "string", "fields"); err != nil { + return successPayload, nil, err + } + if err := typeCheckParameter(localVarOptionals["limit"], "int32", "limit"); err != nil { + return successPayload, nil, err + } + if err := typeCheckParameter(localVarOptionals["skip"], "int32", "skip"); err != nil { + return successPayload, nil, err + } + if err := typeCheckParameter(localVarOptionals["sort"], "string", "sort"); err != nil { + return successPayload, nil, err + } + if err := typeCheckParameter(localVarOptionals["filter"], "string", "filter"); err != nil { + return successPayload, nil, err + } + if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { + return successPayload, nil, err + } + + if localVarTempParam, localVarOk := localVarOptionals["fields"].(string); localVarOk { + localVarQueryParams.Add("fields", parameterToString(localVarTempParam, "")) + } + if localVarTempParam, localVarOk := localVarOptionals["limit"].(int32); localVarOk { + localVarQueryParams.Add("limit", parameterToString(localVarTempParam, "")) + } + if localVarTempParam, localVarOk := localVarOptionals["skip"].(int32); localVarOk { + localVarQueryParams.Add("skip", parameterToString(localVarTempParam, "")) + } + if localVarTempParam, localVarOk := localVarOptionals["sort"].(string); localVarOk { + localVarQueryParams.Add("sort", parameterToString(localVarTempParam, "")) + } + if localVarTempParam, localVarOk := localVarOptionals["filter"].(string); localVarOk { + localVarQueryParams.Add("filter", parameterToString(localVarTempParam, "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{ "application/json", } + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{ + "application/json", + } + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { + localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return successPayload, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return successPayload, localVarHttpResponse, err + } + defer localVarHttpResponse.Body.Close() + if localVarHttpResponse.StatusCode >= 300 { + bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) + return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) + } + + if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { + return successPayload, localVarHttpResponse, err + } + + + return successPayload, localVarHttpResponse, err +} + +/* ApplicationsApiService Create an Application + The endpoint adds a new SSO / SAML Applications. + * @param ctx context.Context for authentication, logging, tracing, etc. + @param optional (nil or map[string]interface{}) with one or more of: + @param "body" (Application) + @param "xOrgId" (string) + @return Application*/ +func (a *ApplicationsApiService) ApplicationsPost(ctx context.Context, localVarOptionals map[string]interface{}) (Application, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Post") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + successPayload Application + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/applications" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { + return successPayload, nil, err + } + + // to determine the Content-Type header + localVarHttpContentTypes := []string{ "application/json", } + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{ + "application/json", + } + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { + localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") + } + // body params + if localVarTempParam, localVarOk := localVarOptionals["body"].(Application); localVarOk { + localVarPostBody = &localVarTempParam + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return successPayload, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return successPayload, localVarHttpResponse, err + } + defer localVarHttpResponse.Body.Close() + if localVarHttpResponse.StatusCode >= 300 { + bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) + return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) + } + + if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { + return successPayload, localVarHttpResponse, err + } + + + return successPayload, localVarHttpResponse, err +} + +/* ApplicationsApiService Update an Application + The endpoint updates a SSO / SAML Application. Any fields not provided will be reset or created with default values. + * @param ctx context.Context for authentication, logging, tracing, etc. + @param id + @param optional (nil or map[string]interface{}) with one or more of: + @param "body" (Application) + @param "xOrgId" (string) + @return Application*/ +func (a *ApplicationsApiService) ApplicationsPut(ctx context.Context, id string, localVarOptionals map[string]interface{}) (Application, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Put") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + successPayload Application + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/applications/{id}" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { + return successPayload, nil, err + } + + // to determine the Content-Type header + localVarHttpContentTypes := []string{ "application/json", } + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{ + "application/json", + } + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { + localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") + } + // body params + if localVarTempParam, localVarOk := localVarOptionals["body"].(Application); localVarOk { + localVarPostBody = &localVarTempParam + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return successPayload, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return successPayload, localVarHttpResponse, err + } + defer localVarHttpResponse.Body.Close() + if localVarHttpResponse.StatusCode >= 300 { + bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) + return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) + } + + if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { + return successPayload, localVarHttpResponse, err + } + + + return successPayload, localVarHttpResponse, err +} + diff --git a/jcapiv1/applicationslist.go b/jcapiv1/applicationslist.go new file mode 100644 index 0000000..5e7f7c2 --- /dev/null +++ b/jcapiv1/applicationslist.go @@ -0,0 +1,22 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 1.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package jcapiv1 + +type Applicationslist struct { + + Name string `json:"name,omitempty"` + + // The list of applications. + Results []Application `json:"results,omitempty"` + + // The total number of applications. + TotalCount int32 `json:"totalCount,omitempty"` +} diff --git a/jcapiv1/applicationtemplate.go b/jcapiv1/applicationtemplate.go new file mode 100644 index 0000000..733e135 --- /dev/null +++ b/jcapiv1/applicationtemplate.go @@ -0,0 +1,52 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 1.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package jcapiv1 + +type Applicationtemplate struct { + + Id string `json:"_id,omitempty"` + + Active bool `json:"active,omitempty"` + + Beta bool `json:"beta,omitempty"` + + Color string `json:"color,omitempty"` + + Config *ApplicationConfig `json:"config,omitempty"` + + DisplayLabel string `json:"displayLabel,omitempty"` + + DisplayName string `json:"displayName,omitempty"` + + IsConfigured bool `json:"isConfigured,omitempty"` + + Jit *ApplicationtemplateJit `json:"jit,omitempty"` + + Keywords []string `json:"keywords,omitempty"` + + LearnMore string `json:"learnMore,omitempty"` + + Logo *ApplicationtemplateLogo `json:"logo,omitempty"` + + Name string `json:"name,omitempty"` + + Oidc *ApplicationtemplateOidc `json:"oidc,omitempty"` + + Provision *ApplicationtemplateProvision `json:"provision,omitempty"` + + Sso *Sso `json:"sso,omitempty"` + + SsoUrl string `json:"ssoUrl,omitempty"` + + Status string `json:"status,omitempty"` + + Test string `json:"test,omitempty"` +} diff --git a/jcapiv1/applicationtemplate_jit.go b/jcapiv1/applicationtemplate_jit.go new file mode 100644 index 0000000..f858567 --- /dev/null +++ b/jcapiv1/applicationtemplate_jit.go @@ -0,0 +1,18 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 1.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package jcapiv1 + +type ApplicationtemplateJit struct { + + Attributes *interface{} `json:"attributes,omitempty"` + + CreateOnly bool `json:"createOnly,omitempty"` +} diff --git a/jcapiv1/applicationtemplate_logo.go b/jcapiv1/applicationtemplate_logo.go new file mode 100644 index 0000000..7118a42 --- /dev/null +++ b/jcapiv1/applicationtemplate_logo.go @@ -0,0 +1,16 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 1.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package jcapiv1 + +type ApplicationtemplateLogo struct { + + Url string `json:"url,omitempty"` +} diff --git a/jcapiv1/applicationtemplate_oidc.go b/jcapiv1/applicationtemplate_oidc.go new file mode 100644 index 0000000..b0e2fe9 --- /dev/null +++ b/jcapiv1/applicationtemplate_oidc.go @@ -0,0 +1,26 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 1.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package jcapiv1 + +type ApplicationtemplateOidc struct { + + // The grant types allowed. Currently only authorization_code is allowed. + GrantTypes []string `json:"grantTypes,omitempty"` + + // List of allowed redirectUris + RedirectUris []string `json:"redirectUris,omitempty"` + + // The relying party url to trigger an oidc login. + SsoUrl string `json:"ssoUrl,omitempty"` + + // Method that the client uses to authenticate when requesting a token. If 'none', then the client must use PKCE. If 'client_secret_post', then the secret is passed in the post body when requesting the token. + TokenEndpointAuthMethod string `json:"tokenEndpointAuthMethod,omitempty"` +} diff --git a/jcapiv1/applicationtemplate_provision.go b/jcapiv1/applicationtemplate_provision.go new file mode 100644 index 0000000..f75f1e7 --- /dev/null +++ b/jcapiv1/applicationtemplate_provision.go @@ -0,0 +1,20 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 1.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package jcapiv1 + +type ApplicationtemplateProvision struct { + + Beta bool `json:"beta,omitempty"` + + GroupsSupported bool `json:"groups_supported,omitempty"` + + Type_ string `json:"type,omitempty"` +} diff --git a/jcapiv1/applicationtemplateslist.go b/jcapiv1/applicationtemplateslist.go new file mode 100644 index 0000000..05a244c --- /dev/null +++ b/jcapiv1/applicationtemplateslist.go @@ -0,0 +1,20 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 1.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package jcapiv1 + +type Applicationtemplateslist struct { + + // The list of applications. + Results []Applicationtemplate `json:"results,omitempty"` + + // The total number of applications. + TotalCount int32 `json:"totalCount,omitempty"` +} diff --git a/jcapiv1/body.go b/jcapiv1/body.go new file mode 100644 index 0000000..11e3c39 --- /dev/null +++ b/jcapiv1/body.go @@ -0,0 +1,16 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 1.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package jcapiv1 + +type Body struct { + + Settings *Organizationsettingsput `json:"settings,omitempty"` +} diff --git a/jcapiv1/body_1.go b/jcapiv1/body_1.go new file mode 100644 index 0000000..a2c7a1c --- /dev/null +++ b/jcapiv1/body_1.go @@ -0,0 +1,34 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 1.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package jcapiv1 + +type Body1 struct { + + DeviceCertEnabled bool `json:"deviceCertEnabled,omitempty"` + + Mfa string `json:"mfa,omitempty"` + + Name string `json:"name"` + + NetworkSourceIp string `json:"networkSourceIp"` + + SharedSecret string `json:"sharedSecret"` + + Tags []string `json:"tags,omitempty"` + + UserCertEnabled bool `json:"userCertEnabled,omitempty"` + + UserLockoutAction string `json:"userLockoutAction,omitempty"` + + UserPasswordEnabled bool `json:"userPasswordEnabled,omitempty"` + + UserPasswordExpirationAction string `json:"userPasswordExpirationAction,omitempty"` +} diff --git a/jcapiv1/body_2.go b/jcapiv1/body_2.go new file mode 100644 index 0000000..a4ea21d --- /dev/null +++ b/jcapiv1/body_2.go @@ -0,0 +1,24 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 1.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package jcapiv1 + +import ( + "time" +) + +type Body2 struct { + + Exclusion bool `json:"exclusion,omitempty"` + + ExclusionDays float32 `json:"exclusionDays,omitempty"` + + ExclusionUntil time.Time `json:"exclusionUntil,omitempty"` +} diff --git a/jcapiv1/body_3.go b/jcapiv1/body_3.go new file mode 100644 index 0000000..a5bfdc0 --- /dev/null +++ b/jcapiv1/body_3.go @@ -0,0 +1,16 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 1.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package jcapiv1 + +type Body3 struct { + + Email *interface{} `json:"email,omitempty"` +} diff --git a/jcapiv1/client.go b/jcapiv1/client.go new file mode 100644 index 0000000..bc7b129 --- /dev/null +++ b/jcapiv1/client.go @@ -0,0 +1,507 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 1.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv1 + +import ( + "bytes" + "context" + "encoding/json" + "encoding/xml" + "errors" + "fmt" + "io" + "mime/multipart" + "net/http" + "net/url" + "os" + "path/filepath" + "reflect" + "regexp" + "strconv" + "strings" + "time" + "unicode/utf8" + + "golang.org/x/oauth2" +) + +var ( + jsonCheck = regexp.MustCompile("(?i:[application|text]/json)") + xmlCheck = regexp.MustCompile("(?i:[application|text]/xml)") +) + +// APIClient manages communication with the JumpCloud API API v1.0 +// In most cases there should be only one, shared, APIClient. +type APIClient struct { + cfg *Configuration + common service // Reuse a single struct instead of allocating one for each service on the heap. + + // API Services + + ApplicationTemplatesApi *ApplicationTemplatesApiService + + ApplicationsApi *ApplicationsApiService + + CommandResultsApi *CommandResultsApiService + + CommandTriggersApi *CommandTriggersApiService + + CommandsApi *CommandsApiService + + ManagedServiceProviderApi *ManagedServiceProviderApiService + + OrganizationsApi *OrganizationsApiService + + RadiusServersApi *RadiusServersApiService + + SearchApi *SearchApiService + + SystemsApi *SystemsApiService + + SystemusersApi *SystemusersApiService + + UsersApi *UsersApiService +} + +type service struct { + client *APIClient +} + +// NewAPIClient creates a new API client. Requires a userAgent string describing your application. +// optionally a custom http.Client to allow for advanced features such as caching. +func NewAPIClient(cfg *Configuration) *APIClient { + if cfg.HTTPClient == nil { + cfg.HTTPClient = http.DefaultClient + } + + c := &APIClient{} + c.cfg = cfg + c.common.client = c + + // API Services + c.ApplicationTemplatesApi = (*ApplicationTemplatesApiService)(&c.common) + c.ApplicationsApi = (*ApplicationsApiService)(&c.common) + c.CommandResultsApi = (*CommandResultsApiService)(&c.common) + c.CommandTriggersApi = (*CommandTriggersApiService)(&c.common) + c.CommandsApi = (*CommandsApiService)(&c.common) + c.ManagedServiceProviderApi = (*ManagedServiceProviderApiService)(&c.common) + c.OrganizationsApi = (*OrganizationsApiService)(&c.common) + c.RadiusServersApi = (*RadiusServersApiService)(&c.common) + c.SearchApi = (*SearchApiService)(&c.common) + c.SystemsApi = (*SystemsApiService)(&c.common) + c.SystemusersApi = (*SystemusersApiService)(&c.common) + c.UsersApi = (*UsersApiService)(&c.common) + + return c +} + +func atoi(in string) (int, error) { + return strconv.Atoi(in) +} + +// selectHeaderContentType select a content type from the available list. +func selectHeaderContentType(contentTypes []string) string { + if len(contentTypes) == 0 { + return "" + } + if contains(contentTypes, "application/json") { + return "application/json" + } + return contentTypes[0] // use the first content type specified in 'consumes' +} + +// selectHeaderAccept join all accept types and return +func selectHeaderAccept(accepts []string) string { + if len(accepts) == 0 { + return "" + } + + if contains(accepts, "application/json") { + return "application/json" + } + + return strings.Join(accepts, ",") +} + +// contains is a case insenstive match, finding needle in a haystack +func contains(haystack []string, needle string) bool { + for _, a := range haystack { + if strings.ToLower(a) == strings.ToLower(needle) { + return true + } + } + return false +} + +// Verify optional parameters are of the correct type. +func typeCheckParameter(obj interface{}, expected string, name string) error { + // Make sure there is an object. + if obj == nil { + return nil + } + + // Check the type is as expected. + if reflect.TypeOf(obj).String() != expected { + return fmt.Errorf("Expected %s to be of type %s but received %s.", name, expected, reflect.TypeOf(obj).String()) + } + return nil +} + +// parameterToString convert interface{} parameters to string, using a delimiter if format is provided. +func parameterToString(obj interface{}, collectionFormat string) string { + var delimiter string + + switch collectionFormat { + case "pipes": + delimiter = "|" + case "ssv": + delimiter = " " + case "tsv": + delimiter = "\t" + case "csv": + delimiter = "," + } + + if reflect.TypeOf(obj).Kind() == reflect.Slice { + return strings.Trim(strings.Replace(fmt.Sprint(obj), " ", delimiter, -1), "[]") + } + + return fmt.Sprintf("%v", obj) +} + +// callAPI do the request. +func (c *APIClient) callAPI(request *http.Request) (*http.Response, error) { + return c.cfg.HTTPClient.Do(request) +} + +// Change base path to allow switching to mocks +func (c *APIClient) ChangeBasePath(path string) { + c.cfg.BasePath = path +} + +// prepareRequest build the request +func (c *APIClient) prepareRequest( + ctx context.Context, + path string, method string, + postBody interface{}, + headerParams map[string]string, + queryParams url.Values, + formParams url.Values, + fileName string, + fileBytes []byte) (localVarRequest *http.Request, err error) { + + var body *bytes.Buffer + + // Detect postBody type and post. + if postBody != nil { + contentType := headerParams["Content-Type"] + if contentType == "" { + contentType = detectContentType(postBody) + headerParams["Content-Type"] = contentType + } + + body, err = setBody(postBody, contentType) + if err != nil { + return nil, err + } + } + + // add form parameters and file if available. + if strings.HasPrefix(headerParams["Content-Type"], "multipart/form-data") && len(formParams) > 0 || (len(fileBytes) > 0 && fileName != "") { + if body != nil { + return nil, errors.New("Cannot specify postBody and multipart form at the same time.") + } + body = &bytes.Buffer{} + w := multipart.NewWriter(body) + + for k, v := range formParams { + for _, iv := range v { + if strings.HasPrefix(k, "@") { // file + err = addFile(w, k[1:], iv) + if err != nil { + return nil, err + } + } else { // form value + w.WriteField(k, iv) + } + } + } + if len(fileBytes) > 0 && fileName != "" { + w.Boundary() + //_, fileNm := filepath.Split(fileName) + part, err := w.CreateFormFile("file", filepath.Base(fileName)) + if err != nil { + return nil, err + } + _, err = part.Write(fileBytes) + if err != nil { + return nil, err + } + // Set the Boundary in the Content-Type + headerParams["Content-Type"] = w.FormDataContentType() + } + + // Set Content-Length + headerParams["Content-Length"] = fmt.Sprintf("%d", body.Len()) + w.Close() + } + + if strings.HasPrefix(headerParams["Content-Type"], "application/x-www-form-urlencoded") && len(formParams) > 0 { + if body != nil { + return nil, errors.New("Cannot specify postBody and x-www-form-urlencoded form at the same time.") + } + body = &bytes.Buffer{} + body.WriteString(formParams.Encode()) + // Set Content-Length + headerParams["Content-Length"] = fmt.Sprintf("%d", body.Len()) + } + + // Setup path and query parameters + url, err := url.Parse(path) + if err != nil { + return nil, err + } + + // Adding Query Param + query := url.Query() + for k, v := range queryParams { + for _, iv := range v { + query.Add(k, iv) + } + } + + // Encode the parameters. + url.RawQuery = query.Encode() + + // Generate a new request + if body != nil { + localVarRequest, err = http.NewRequest(method, url.String(), body) + } else { + localVarRequest, err = http.NewRequest(method, url.String(), nil) + } + if err != nil { + return nil, err + } + + // add header parameters, if any + if len(headerParams) > 0 { + headers := http.Header{} + for h, v := range headerParams { + headers.Set(h, v) + } + localVarRequest.Header = headers + } + + // Override request host, if applicable + if c.cfg.Host != "" { + localVarRequest.Host = c.cfg.Host + } + + // Add the user agent to the request. + localVarRequest.Header.Add("User-Agent", c.cfg.UserAgent) + + if ctx != nil { + // add context to the request + localVarRequest = localVarRequest.WithContext(ctx) + + // Walk through any authentication. + + // OAuth2 authentication + if tok, ok := ctx.Value(ContextOAuth2).(oauth2.TokenSource); ok { + // We were able to grab an oauth2 token from the context + var latestToken *oauth2.Token + if latestToken, err = tok.Token(); err != nil { + return nil, err + } + + latestToken.SetAuthHeader(localVarRequest) + } + + // Basic HTTP Authentication + if auth, ok := ctx.Value(ContextBasicAuth).(BasicAuth); ok { + localVarRequest.SetBasicAuth(auth.UserName, auth.Password) + } + + // AccessToken Authentication + if auth, ok := ctx.Value(ContextAccessToken).(string); ok { + localVarRequest.Header.Add("Authorization", "Bearer "+auth) + } + } + + for header, value := range c.cfg.DefaultHeader { + localVarRequest.Header.Add(header, value) + } + + return localVarRequest, nil +} + +func (c *APIClient) decode(v interface{}, b []byte, contentType string) (err error) { + if strings.Contains(contentType, "application/xml") { + if err = xml.Unmarshal(b, v); err != nil { + return err + } + return nil + } else if strings.Contains(contentType, "application/json") { + if err = json.Unmarshal(b, v); err != nil { + return err + } + return nil + } + return errors.New("undefined response type") +} + +// Add a file to the multipart request +func addFile(w *multipart.Writer, fieldName, path string) error { + file, err := os.Open(path) + if err != nil { + return err + } + defer file.Close() + + part, err := w.CreateFormFile(fieldName, filepath.Base(path)) + if err != nil { + return err + } + _, err = io.Copy(part, file) + + return err +} + +// Prevent trying to import "fmt" +func reportError(format string, a ...interface{}) error { + return fmt.Errorf(format, a...) +} + +// Set request body from an interface{} +func setBody(body interface{}, contentType string) (bodyBuf *bytes.Buffer, err error) { + if bodyBuf == nil { + bodyBuf = &bytes.Buffer{} + } + + if reader, ok := body.(io.Reader); ok { + _, err = bodyBuf.ReadFrom(reader) + } else if b, ok := body.([]byte); ok { + _, err = bodyBuf.Write(b) + } else if s, ok := body.(string); ok { + _, err = bodyBuf.WriteString(s) + } else if s, ok := body.(*string); ok { + _, err = bodyBuf.WriteString(*s) + } else if jsonCheck.MatchString(contentType) { + err = json.NewEncoder(bodyBuf).Encode(body) + } else if xmlCheck.MatchString(contentType) { + xml.NewEncoder(bodyBuf).Encode(body) + } + + if err != nil { + return nil, err + } + + if bodyBuf.Len() == 0 { + err = fmt.Errorf("Invalid body type %s\n", contentType) + return nil, err + } + return bodyBuf, nil +} + +// detectContentType method is used to figure out `Request.Body` content type for request header +func detectContentType(body interface{}) string { + contentType := "text/plain; charset=utf-8" + kind := reflect.TypeOf(body).Kind() + + switch kind { + case reflect.Struct, reflect.Map, reflect.Ptr: + contentType = "application/json; charset=utf-8" + case reflect.String: + contentType = "text/plain; charset=utf-8" + default: + if b, ok := body.([]byte); ok { + contentType = http.DetectContentType(b) + } else if kind == reflect.Slice { + contentType = "application/json; charset=utf-8" + } + } + + return contentType +} + +// Ripped from https://github.com/gregjones/httpcache/blob/master/httpcache.go +type cacheControl map[string]string + +func parseCacheControl(headers http.Header) cacheControl { + cc := cacheControl{} + ccHeader := headers.Get("Cache-Control") + for _, part := range strings.Split(ccHeader, ",") { + part = strings.Trim(part, " ") + if part == "" { + continue + } + if strings.ContainsRune(part, '=') { + keyval := strings.Split(part, "=") + cc[strings.Trim(keyval[0], " ")] = strings.Trim(keyval[1], ",") + } else { + cc[part] = "" + } + } + return cc +} + +// CacheExpires helper function to determine remaining time before repeating a request. +func CacheExpires(r *http.Response) time.Time { + // Figure out when the cache expires. + var expires time.Time + now, err := time.Parse(time.RFC1123, r.Header.Get("date")) + if err != nil { + return time.Now() + } + respCacheControl := parseCacheControl(r.Header) + + if maxAge, ok := respCacheControl["max-age"]; ok { + lifetime, err := time.ParseDuration(maxAge + "s") + if err != nil { + expires = now + } + expires = now.Add(lifetime) + } else { + expiresHeader := r.Header.Get("Expires") + if expiresHeader != "" { + expires, err = time.Parse(time.RFC1123, expiresHeader) + if err != nil { + expires = now + } + } + } + return expires +} + +func strlen(s string) int { + return utf8.RuneCountInString(s) +} + +// GenericSwaggerError Provides access to the body, error and model on returned errors. +type GenericSwaggerError struct { + body []byte + error string + model interface{} +} + +// Error returns non-empty string if there was an error. +func (e GenericSwaggerError) Error() string { + return e.error +} + +// Body returns the raw bytes of the response +func (e GenericSwaggerError) Body() []byte { + return e.body +} + +// Model returns the unpacked model of the error +func (e GenericSwaggerError) Model() interface{} { + return e.model +} diff --git a/jcapiv1/command.go b/jcapiv1/command.go new file mode 100644 index 0000000..b63373f --- /dev/null +++ b/jcapiv1/command.go @@ -0,0 +1,70 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 1.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package jcapiv1 + +type Command struct { + + // The command to execute on the server. + Command string `json:"command"` + + // An array of IDs of the Command Runner Users that can execute this command. + CommandRunners []string `json:"commandRunners,omitempty"` + + // The Command OS + CommandType string `json:"commandType"` + + // An array of file IDs to include with the command. + Files []string `json:"files,omitempty"` + + // How the command will execute. + LaunchType string `json:"launchType,omitempty"` + + // + ListensTo string `json:"listensTo,omitempty"` + + Name string `json:"name"` + + // The ID of the organization. + Organization string `json:"organization,omitempty"` + + // A crontab that consists of: [ (seconds) (minutes) (hours) (days of month) (months) (weekdays) ] or [ immediate ]. If you send this as an empty string, it will run immediately. + Schedule string `json:"schedule,omitempty"` + + // When the command will repeat. + ScheduleRepeatType string `json:"scheduleRepeatType,omitempty"` + + // The year that a scheduled command will launch in. + ScheduleYear int32 `json:"scheduleYear,omitempty"` + + // The shell used to run the command. + Shell string `json:"shell,omitempty"` + + // + Sudo bool `json:"sudo,omitempty"` + + // An array of system IDs to run the command on. Not available if you are using Groups. + Systems []string `json:"systems,omitempty"` + + // The template this command was created from + Template string `json:"template,omitempty"` + + // Time in seconds a command can wait in the queue to be run before timing out + TimeToLiveSeconds int32 `json:"timeToLiveSeconds,omitempty"` + + // The time in seconds to allow the command to run for. + Timeout string `json:"timeout,omitempty"` + + // The name of the command trigger. + Trigger string `json:"trigger,omitempty"` + + // The ID of the system user to run the command as. This field is required when creating a command with a commandType of \"mac\" or \"linux\". + User string `json:"user,omitempty"` +} diff --git a/jcapiv1/command_results_api.go b/jcapiv1/command_results_api.go new file mode 100644 index 0000000..e0e51bd --- /dev/null +++ b/jcapiv1/command_results_api.go @@ -0,0 +1,332 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 1.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package jcapiv1 + +import ( + "io/ioutil" + "net/url" + "net/http" + "strings" + "golang.org/x/net/context" + "encoding/json" + "fmt" +) + +// Linger please +var ( + _ context.Context +) + +type CommandResultsApiService service + + +/* CommandResultsApiService Delete a Command result + This endpoint deletes a specific command result. #### Sample Request ``` curl -X DELETE https://console.jumpcloud.com/api/commandresults/{CommandID} \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ```` + * @param ctx context.Context for authentication, logging, tracing, etc. + @param id + @param optional (nil or map[string]interface{}) with one or more of: + @param "xOrgId" (string) + @return Commandresult*/ +func (a *CommandResultsApiService) CommandResultsDelete(ctx context.Context, id string, localVarOptionals map[string]interface{}) (Commandresult, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Delete") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + successPayload Commandresult + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/commandresults/{id}" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { + return successPayload, nil, err + } + + // to determine the Content-Type header + localVarHttpContentTypes := []string{ "application/json", } + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{ + "application/json", + } + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { + localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return successPayload, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return successPayload, localVarHttpResponse, err + } + defer localVarHttpResponse.Body.Close() + if localVarHttpResponse.StatusCode >= 300 { + bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) + return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) + } + + if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { + return successPayload, localVarHttpResponse, err + } + + + return successPayload, localVarHttpResponse, err +} + +/* CommandResultsApiService List an individual Command result + This endpoint returns a specific command result. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/commandresults/{CommandResultID} \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + * @param ctx context.Context for authentication, logging, tracing, etc. + @param id + @param optional (nil or map[string]interface{}) with one or more of: + @param "fields" (string) Use a space seperated string of field parameters to include the data in the response. If omitted, the default list of fields will be returned. + @param "filter" (string) A filter to apply to the query. See the supported operators below. For more complex searches, see the related `/search/<domain>` endpoints, e.g. `/search/systems`. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: - `$eq` (equals) - `$ne` (does not equal) - `$gt` (is greater than) - `$gte` (is greater than or equal to) - `$lt` (is less than) - `$lte` (is less than or equal to) _Note: v1 operators differ from v2 operators._ _Note: For v1 operators, excluding the `$` will result in undefined behavior._ **value** = Populate with the value you want to search for. Is case sensitive. **Examples** - `GET /users?filter=username:$eq:testuser` - `GET /systemusers?filter=password_expiration_date:$lte:2021-10-24` - `GET /systemusers?filter=department:$ne:Accounting` - `GET /systems?filter[0]=firstname:$eq:foo&filter[1]=lastname:$eq:bar` - this will AND the filters together. - `GET /systems?filter[or][0]=lastname:$eq:foo&filter[or][1]=lastname:$eq:bar` - this will OR the filters together. + @param "xOrgId" (string) + @return Commandresult*/ +func (a *CommandResultsApiService) CommandResultsGet(ctx context.Context, id string, localVarOptionals map[string]interface{}) (Commandresult, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + successPayload Commandresult + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/commandresults/{id}" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if err := typeCheckParameter(localVarOptionals["fields"], "string", "fields"); err != nil { + return successPayload, nil, err + } + if err := typeCheckParameter(localVarOptionals["filter"], "string", "filter"); err != nil { + return successPayload, nil, err + } + if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { + return successPayload, nil, err + } + + if localVarTempParam, localVarOk := localVarOptionals["fields"].(string); localVarOk { + localVarQueryParams.Add("fields", parameterToString(localVarTempParam, "")) + } + if localVarTempParam, localVarOk := localVarOptionals["filter"].(string); localVarOk { + localVarQueryParams.Add("filter", parameterToString(localVarTempParam, "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{ "application/json", } + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{ + "application/json", + } + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { + localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return successPayload, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return successPayload, localVarHttpResponse, err + } + defer localVarHttpResponse.Body.Close() + if localVarHttpResponse.StatusCode >= 300 { + bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) + return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) + } + + if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { + return successPayload, localVarHttpResponse, err + } + + + return successPayload, localVarHttpResponse, err +} + +/* CommandResultsApiService List all Command Results + This endpoint returns all command results. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/commandresults \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key:{API_KEY}' ``` + * @param ctx context.Context for authentication, logging, tracing, etc. + @param optional (nil or map[string]interface{}) with one or more of: + @param "fields" (string) Use a space seperated string of field parameters to include the data in the response. If omitted, the default list of fields will be returned. + @param "filter" (string) A filter to apply to the query. See the supported operators below. For more complex searches, see the related `/search/<domain>` endpoints, e.g. `/search/systems`. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: - `$eq` (equals) - `$ne` (does not equal) - `$gt` (is greater than) - `$gte` (is greater than or equal to) - `$lt` (is less than) - `$lte` (is less than or equal to) _Note: v1 operators differ from v2 operators._ _Note: For v1 operators, excluding the `$` will result in undefined behavior._ **value** = Populate with the value you want to search for. Is case sensitive. **Examples** - `GET /users?filter=username:$eq:testuser` - `GET /systemusers?filter=password_expiration_date:$lte:2021-10-24` - `GET /systemusers?filter=department:$ne:Accounting` - `GET /systems?filter[0]=firstname:$eq:foo&filter[1]=lastname:$eq:bar` - this will AND the filters together. - `GET /systems?filter[or][0]=lastname:$eq:foo&filter[or][1]=lastname:$eq:bar` - this will OR the filters together. + @param "limit" (int32) The number of records to return at once. Limited to 100. + @param "xOrgId" (string) + @param "skip" (int32) The offset into the records to return. + @param "sort" (string) Use space separated sort parameters to sort the collection. Default sort is ascending. Prefix with `-` to sort descending. + @return Commandresultslist*/ +func (a *CommandResultsApiService) CommandResultsList(ctx context.Context, localVarOptionals map[string]interface{}) (Commandresultslist, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + successPayload Commandresultslist + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/commandresults" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if err := typeCheckParameter(localVarOptionals["fields"], "string", "fields"); err != nil { + return successPayload, nil, err + } + if err := typeCheckParameter(localVarOptionals["filter"], "string", "filter"); err != nil { + return successPayload, nil, err + } + if err := typeCheckParameter(localVarOptionals["limit"], "int32", "limit"); err != nil { + return successPayload, nil, err + } + if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { + return successPayload, nil, err + } + if err := typeCheckParameter(localVarOptionals["skip"], "int32", "skip"); err != nil { + return successPayload, nil, err + } + if err := typeCheckParameter(localVarOptionals["sort"], "string", "sort"); err != nil { + return successPayload, nil, err + } + + if localVarTempParam, localVarOk := localVarOptionals["fields"].(string); localVarOk { + localVarQueryParams.Add("fields", parameterToString(localVarTempParam, "")) + } + if localVarTempParam, localVarOk := localVarOptionals["filter"].(string); localVarOk { + localVarQueryParams.Add("filter", parameterToString(localVarTempParam, "")) + } + if localVarTempParam, localVarOk := localVarOptionals["limit"].(int32); localVarOk { + localVarQueryParams.Add("limit", parameterToString(localVarTempParam, "")) + } + if localVarTempParam, localVarOk := localVarOptionals["skip"].(int32); localVarOk { + localVarQueryParams.Add("skip", parameterToString(localVarTempParam, "")) + } + if localVarTempParam, localVarOk := localVarOptionals["sort"].(string); localVarOk { + localVarQueryParams.Add("sort", parameterToString(localVarTempParam, "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{ "application/json", } + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{ + "application/json", + } + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { + localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return successPayload, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return successPayload, localVarHttpResponse, err + } + defer localVarHttpResponse.Body.Close() + if localVarHttpResponse.StatusCode >= 300 { + bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) + return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) + } + + if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { + return successPayload, localVarHttpResponse, err + } + + + return successPayload, localVarHttpResponse, err +} + diff --git a/jcapiv1/command_triggers_api.go b/jcapiv1/command_triggers_api.go new file mode 100644 index 0000000..e7ee092 --- /dev/null +++ b/jcapiv1/command_triggers_api.go @@ -0,0 +1,120 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 1.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package jcapiv1 + +import ( + "io/ioutil" + "net/url" + "net/http" + "strings" + "golang.org/x/net/context" + "encoding/json" + "fmt" +) + +// Linger please +var ( + _ context.Context +) + +type CommandTriggersApiService service + + +/* CommandTriggersApiService Launch a command via a Trigger + This endpoint allows you to launch a command based on a defined trigger. #### Sample Requests **Launch a Command via a Trigger** ``` curl --silent \\ -X 'POST' \\ -H \"x-api-key: {API_KEY}\" \\ \"https://console.jumpcloud.com/api/command/trigger/{TriggerName}\" ``` **Launch a Command via a Trigger passing a JSON object to the command** ``` curl --silent \\ -X 'POST' \\ -H \"x-api-key: {API_KEY}\" \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -d '{ \"srcip\":\"192.168.2.32\", \"attack\":\"Cross Site Scripting Attempt\" }' \\ \"https://console.jumpcloud.com/api/command/trigger/{TriggerName}\" ``` + * @param ctx context.Context for authentication, logging, tracing, etc. + @param triggername + @param optional (nil or map[string]interface{}) with one or more of: + @param "xOrgId" (string) + @param "body" (interface{}) + @return Triggerreturn*/ +func (a *CommandTriggersApiService) CommandTriggerWebhookPost(ctx context.Context, triggername string, localVarOptionals map[string]interface{}) (Triggerreturn, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Post") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + successPayload Triggerreturn + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/command/trigger/{triggername}" + localVarPath = strings.Replace(localVarPath, "{"+"triggername"+"}", fmt.Sprintf("%v", triggername), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { + return successPayload, nil, err + } + + // to determine the Content-Type header + localVarHttpContentTypes := []string{ "application/json", } + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{ + "application/json", + } + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { + localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") + } + // body params + if localVarTempParam, localVarOk := localVarOptionals["body"].(interface{}); localVarOk { + localVarPostBody = &localVarTempParam + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return successPayload, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return successPayload, localVarHttpResponse, err + } + defer localVarHttpResponse.Body.Close() + if localVarHttpResponse.StatusCode >= 300 { + bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) + return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) + } + + if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { + return successPayload, localVarHttpResponse, err + } + + + return successPayload, localVarHttpResponse, err +} + diff --git a/jcapiv1/commandfilereturn.go b/jcapiv1/commandfilereturn.go new file mode 100644 index 0000000..afe1d1c --- /dev/null +++ b/jcapiv1/commandfilereturn.go @@ -0,0 +1,19 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 1.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package jcapiv1 + +type Commandfilereturn struct { + + Results []CommandfilereturnResults `json:"results,omitempty"` + + // The total number of commands files + TotalCount int32 `json:"totalCount,omitempty"` +} diff --git a/jcapiv1/commandfilereturn_results.go b/jcapiv1/commandfilereturn_results.go new file mode 100644 index 0000000..0398b03 --- /dev/null +++ b/jcapiv1/commandfilereturn_results.go @@ -0,0 +1,23 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 1.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package jcapiv1 + +type CommandfilereturnResults struct { + + // The ID of the file. + Id string `json:"_id,omitempty"` + + // The location where the file will be stored. + Destination string `json:"destination,omitempty"` + + // The file name. + Name string `json:"name,omitempty"` +} diff --git a/jcapiv1/commandresult.go b/jcapiv1/commandresult.go new file mode 100644 index 0000000..3776840 --- /dev/null +++ b/jcapiv1/commandresult.go @@ -0,0 +1,57 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 1.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package jcapiv1 + +import ( + "time" +) + +type Commandresult struct { + + // The ID of the command. + Id string `json:"_id,omitempty"` + + // The command that was executed on the system. + Command string `json:"command,omitempty"` + + // An array of file ids that were included in the command + Files []string `json:"files,omitempty"` + + // The name of the command. + Name string `json:"name,omitempty"` + + // The ID of the organization. + Organization string `json:"organization,omitempty"` + + // The time that the command was sent. + RequestTime time.Time `json:"requestTime,omitempty"` + + Response *CommandresultResponse `json:"response,omitempty"` + + // The time that the command was completed. + ResponseTime time.Time `json:"responseTime,omitempty"` + + // If the user had sudo rights + Sudo bool `json:"sudo,omitempty"` + + // The name of the system the command was executed on. + System string `json:"system,omitempty"` + + // The id of the system the command was executed on. + SystemId string `json:"systemId,omitempty"` + + // The user the command ran as. + User string `json:"user,omitempty"` + + WorkflowId string `json:"workflowId,omitempty"` + + WorkflowInstanceId string `json:"workflowInstanceId,omitempty"` +} diff --git a/jcapiv1/commandresult_response.go b/jcapiv1/commandresult_response.go new file mode 100644 index 0000000..7ce5e88 --- /dev/null +++ b/jcapiv1/commandresult_response.go @@ -0,0 +1,22 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 1.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package jcapiv1 + +type CommandresultResponse struct { + + Data *CommandresultResponseData `json:"data,omitempty"` + + // The stderr output from the command that ran. + Error_ string `json:"error,omitempty"` + + // ID of the response. + Id string `json:"id,omitempty"` +} diff --git a/jcapiv1/commandresult_response_data.go b/jcapiv1/commandresult_response_data.go new file mode 100644 index 0000000..41e862c --- /dev/null +++ b/jcapiv1/commandresult_response_data.go @@ -0,0 +1,20 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 1.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package jcapiv1 + +type CommandresultResponseData struct { + + // The stderr output from the command that ran. + ExitCode int32 `json:"exitCode,omitempty"` + + // The output of the command that was executed. + Output string `json:"output,omitempty"` +} diff --git a/jcapiv1/commandresultslist.go b/jcapiv1/commandresultslist.go new file mode 100644 index 0000000..cee9a88 --- /dev/null +++ b/jcapiv1/commandresultslist.go @@ -0,0 +1,19 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 1.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package jcapiv1 + +type Commandresultslist struct { + + Results []CommandresultslistResults `json:"results,omitempty"` + + // The total number of command results. + TotalCount int32 `json:"totalCount,omitempty"` +} diff --git a/jcapiv1/commandresultslist_results.go b/jcapiv1/commandresultslist_results.go new file mode 100644 index 0000000..2132e91 --- /dev/null +++ b/jcapiv1/commandresultslist_results.go @@ -0,0 +1,51 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 1.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package jcapiv1 + +import ( + "time" +) + +type CommandresultslistResults struct { + + // The ID of the command result. + Id string `json:"_id,omitempty"` + + // The command that was executed on the system. + Command string `json:"command,omitempty"` + + // The stderr output from the command that ran. + ExitCode int32 `json:"exitCode,omitempty"` + + // The name of the command. + Name string `json:"name,omitempty"` + + // The time (UTC) that the command was sent. + RequestTime time.Time `json:"requestTime,omitempty"` + + // The time (UTC) that the command was completed. + ResponseTime time.Time `json:"responseTime,omitempty"` + + // If the user had sudo rights. + Sudo bool `json:"sudo,omitempty"` + + // The display name of the system the command was executed on. + System string `json:"system,omitempty"` + + // The id of the system the command was executed on. + SystemId string `json:"systemId,omitempty"` + + // The user the command ran as. + User string `json:"user,omitempty"` + + // The id for the command that ran on the system. + WorkflowId string `json:"workflowId,omitempty"` +} diff --git a/jcapiv1/commands_api.go b/jcapiv1/commands_api.go new file mode 100644 index 0000000..b6b37c7 --- /dev/null +++ b/jcapiv1/commands_api.go @@ -0,0 +1,686 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 1.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package jcapiv1 + +import ( + "io/ioutil" + "net/url" + "net/http" + "strings" + "golang.org/x/net/context" + "encoding/json" + "fmt" +) + +// Linger please +var ( + _ context.Context +) + +type CommandsApiService service + + +/* CommandsApiService Get a Command File + This endpoint returns the uploaded file(s) associated with a specific command. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/files/command/{commandID} \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + * @param ctx context.Context for authentication, logging, tracing, etc. + @param id + @param optional (nil or map[string]interface{}) with one or more of: + @param "fields" (string) Use a space seperated string of field parameters to include the data in the response. If omitted, the default list of fields will be returned. + @param "limit" (int32) The number of records to return at once. Limited to 100. + @param "xOrgId" (string) + @param "skip" (int32) The offset into the records to return. + @return Commandfilereturn*/ +func (a *CommandsApiService) CommandFileGet(ctx context.Context, id string, localVarOptionals map[string]interface{}) (Commandfilereturn, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + successPayload Commandfilereturn + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/files/command/{id}" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if err := typeCheckParameter(localVarOptionals["fields"], "string", "fields"); err != nil { + return successPayload, nil, err + } + if err := typeCheckParameter(localVarOptionals["limit"], "int32", "limit"); err != nil { + return successPayload, nil, err + } + if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { + return successPayload, nil, err + } + if err := typeCheckParameter(localVarOptionals["skip"], "int32", "skip"); err != nil { + return successPayload, nil, err + } + + if localVarTempParam, localVarOk := localVarOptionals["fields"].(string); localVarOk { + localVarQueryParams.Add("fields", parameterToString(localVarTempParam, "")) + } + if localVarTempParam, localVarOk := localVarOptionals["limit"].(int32); localVarOk { + localVarQueryParams.Add("limit", parameterToString(localVarTempParam, "")) + } + if localVarTempParam, localVarOk := localVarOptionals["skip"].(int32); localVarOk { + localVarQueryParams.Add("skip", parameterToString(localVarTempParam, "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{ "application/json", } + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{ + "application/json", + } + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { + localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return successPayload, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return successPayload, localVarHttpResponse, err + } + defer localVarHttpResponse.Body.Close() + if localVarHttpResponse.StatusCode >= 300 { + bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) + return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) + } + + if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { + return successPayload, localVarHttpResponse, err + } + + + return successPayload, localVarHttpResponse, err +} + +/* CommandsApiService Delete a Command + This endpoint deletes a specific command based on the Command ID. #### Sample Request ``` curl -X DELETE https://console.jumpcloud.com/api/commands/{CommandID} \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + * @param ctx context.Context for authentication, logging, tracing, etc. + @param id + @param optional (nil or map[string]interface{}) with one or more of: + @param "xOrgId" (string) + @return Command*/ +func (a *CommandsApiService) CommandsDelete(ctx context.Context, id string, localVarOptionals map[string]interface{}) (Command, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Delete") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + successPayload Command + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/commands/{id}" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { + return successPayload, nil, err + } + + // to determine the Content-Type header + localVarHttpContentTypes := []string{ "application/json", } + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{ + "application/json", + } + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { + localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return successPayload, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return successPayload, localVarHttpResponse, err + } + defer localVarHttpResponse.Body.Close() + if localVarHttpResponse.StatusCode >= 300 { + bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) + return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) + } + + if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { + return successPayload, localVarHttpResponse, err + } + + + return successPayload, localVarHttpResponse, err +} + +/* CommandsApiService List an individual Command + This endpoint returns a specific command based on the command ID. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/commands/{CommandID} \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + * @param ctx context.Context for authentication, logging, tracing, etc. + @param id + @param optional (nil or map[string]interface{}) with one or more of: + @param "fields" (string) Use a space seperated string of field parameters to include the data in the response. If omitted, the default list of fields will be returned. + @param "xOrgId" (string) + @return Command*/ +func (a *CommandsApiService) CommandsGet(ctx context.Context, id string, localVarOptionals map[string]interface{}) (Command, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + successPayload Command + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/commands/{id}" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if err := typeCheckParameter(localVarOptionals["fields"], "string", "fields"); err != nil { + return successPayload, nil, err + } + if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { + return successPayload, nil, err + } + + if localVarTempParam, localVarOk := localVarOptionals["fields"].(string); localVarOk { + localVarQueryParams.Add("fields", parameterToString(localVarTempParam, "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{ "application/json", } + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{ + "application/json", + } + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { + localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return successPayload, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return successPayload, localVarHttpResponse, err + } + defer localVarHttpResponse.Body.Close() + if localVarHttpResponse.StatusCode >= 300 { + bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) + return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) + } + + if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { + return successPayload, localVarHttpResponse, err + } + + + return successPayload, localVarHttpResponse, err +} + +/* CommandsApiService Get results for a specific command + This endpoint returns results for a specific command. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/commands/{id}/results \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ```` + * @param ctx context.Context for authentication, logging, tracing, etc. + @param id + @return []Commandresult*/ +func (a *CommandsApiService) CommandsGetResults(ctx context.Context, id string) ([]Commandresult, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + successPayload []Commandresult + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/commands/{id}/results" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + + // to determine the Content-Type header + localVarHttpContentTypes := []string{ "application/json", } + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{ + "application/json", + } + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return successPayload, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return successPayload, localVarHttpResponse, err + } + defer localVarHttpResponse.Body.Close() + if localVarHttpResponse.StatusCode >= 300 { + bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) + return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) + } + + if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { + return successPayload, localVarHttpResponse, err + } + + + return successPayload, localVarHttpResponse, err +} + +/* CommandsApiService List All Commands + This endpoint returns all commands. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/commands/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + * @param ctx context.Context for authentication, logging, tracing, etc. + @param optional (nil or map[string]interface{}) with one or more of: + @param "fields" (string) Use a space seperated string of field parameters to include the data in the response. If omitted, the default list of fields will be returned. + @param "filter" (string) A filter to apply to the query. See the supported operators below. For more complex searches, see the related `/search/<domain>` endpoints, e.g. `/search/systems`. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: - `$eq` (equals) - `$ne` (does not equal) - `$gt` (is greater than) - `$gte` (is greater than or equal to) - `$lt` (is less than) - `$lte` (is less than or equal to) _Note: v1 operators differ from v2 operators._ _Note: For v1 operators, excluding the `$` will result in undefined behavior._ **value** = Populate with the value you want to search for. Is case sensitive. **Examples** - `GET /users?filter=username:$eq:testuser` - `GET /systemusers?filter=password_expiration_date:$lte:2021-10-24` - `GET /systemusers?filter=department:$ne:Accounting` - `GET /systems?filter[0]=firstname:$eq:foo&filter[1]=lastname:$eq:bar` - this will AND the filters together. - `GET /systems?filter[or][0]=lastname:$eq:foo&filter[or][1]=lastname:$eq:bar` - this will OR the filters together. + @param "limit" (int32) The number of records to return at once. Limited to 100. + @param "xOrgId" (string) + @param "skip" (int32) The offset into the records to return. + @param "sort" (string) Use space separated sort parameters to sort the collection. Default sort is ascending. Prefix with `-` to sort descending. + @return Commandslist*/ +func (a *CommandsApiService) CommandsList(ctx context.Context, localVarOptionals map[string]interface{}) (Commandslist, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + successPayload Commandslist + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/commands" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if err := typeCheckParameter(localVarOptionals["fields"], "string", "fields"); err != nil { + return successPayload, nil, err + } + if err := typeCheckParameter(localVarOptionals["filter"], "string", "filter"); err != nil { + return successPayload, nil, err + } + if err := typeCheckParameter(localVarOptionals["limit"], "int32", "limit"); err != nil { + return successPayload, nil, err + } + if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { + return successPayload, nil, err + } + if err := typeCheckParameter(localVarOptionals["skip"], "int32", "skip"); err != nil { + return successPayload, nil, err + } + if err := typeCheckParameter(localVarOptionals["sort"], "string", "sort"); err != nil { + return successPayload, nil, err + } + + if localVarTempParam, localVarOk := localVarOptionals["fields"].(string); localVarOk { + localVarQueryParams.Add("fields", parameterToString(localVarTempParam, "")) + } + if localVarTempParam, localVarOk := localVarOptionals["filter"].(string); localVarOk { + localVarQueryParams.Add("filter", parameterToString(localVarTempParam, "")) + } + if localVarTempParam, localVarOk := localVarOptionals["limit"].(int32); localVarOk { + localVarQueryParams.Add("limit", parameterToString(localVarTempParam, "")) + } + if localVarTempParam, localVarOk := localVarOptionals["skip"].(int32); localVarOk { + localVarQueryParams.Add("skip", parameterToString(localVarTempParam, "")) + } + if localVarTempParam, localVarOk := localVarOptionals["sort"].(string); localVarOk { + localVarQueryParams.Add("sort", parameterToString(localVarTempParam, "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{ "application/json", } + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{ + "application/json", + } + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { + localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return successPayload, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return successPayload, localVarHttpResponse, err + } + defer localVarHttpResponse.Body.Close() + if localVarHttpResponse.StatusCode >= 300 { + bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) + return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) + } + + if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { + return successPayload, localVarHttpResponse, err + } + + + return successPayload, localVarHttpResponse, err +} + +/* CommandsApiService Create A Command + This endpoint allows you to create a new command. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/commands/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"name\":\"Test API Command\", \"command\":\"String\", \"user\":\"{UserID}\", \"schedule\":\"\", \"timeout\":\"100\" }' ``` + * @param ctx context.Context for authentication, logging, tracing, etc. + @param optional (nil or map[string]interface{}) with one or more of: + @param "body" (Command) + @param "xOrgId" (string) + @return Command*/ +func (a *CommandsApiService) CommandsPost(ctx context.Context, localVarOptionals map[string]interface{}) (Command, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Post") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + successPayload Command + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/commands" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { + return successPayload, nil, err + } + + // to determine the Content-Type header + localVarHttpContentTypes := []string{ "application/json", } + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{ + "application/json", + } + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { + localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") + } + // body params + if localVarTempParam, localVarOk := localVarOptionals["body"].(Command); localVarOk { + localVarPostBody = &localVarTempParam + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return successPayload, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return successPayload, localVarHttpResponse, err + } + defer localVarHttpResponse.Body.Close() + if localVarHttpResponse.StatusCode >= 300 { + bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) + return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) + } + + if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { + return successPayload, localVarHttpResponse, err + } + + + return successPayload, localVarHttpResponse, err +} + +/* CommandsApiService Update a Command + This endpoint Updates a command based on the command ID and returns the modified command record. #### Sample Request ``` curl -X PUT https://console.jumpcloud.com/api/commands/{CommandID} \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"name\":\"Test API Command\", \"command\":\"String\", \"user\":\"{UserID}\", \"schedule\":\"\", \"timeout\":\"100\" }' ``` + * @param ctx context.Context for authentication, logging, tracing, etc. + @param id + @param optional (nil or map[string]interface{}) with one or more of: + @param "body" (Command) + @param "xOrgId" (string) + @return Command*/ +func (a *CommandsApiService) CommandsPut(ctx context.Context, id string, localVarOptionals map[string]interface{}) (Command, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Put") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + successPayload Command + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/commands/{id}" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { + return successPayload, nil, err + } + + // to determine the Content-Type header + localVarHttpContentTypes := []string{ "application/json", } + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{ + "application/json", + } + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { + localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") + } + // body params + if localVarTempParam, localVarOk := localVarOptionals["body"].(Command); localVarOk { + localVarPostBody = &localVarTempParam + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return successPayload, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return successPayload, localVarHttpResponse, err + } + defer localVarHttpResponse.Body.Close() + if localVarHttpResponse.StatusCode >= 300 { + bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) + return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) + } + + if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { + return successPayload, localVarHttpResponse, err + } + + + return successPayload, localVarHttpResponse, err +} + diff --git a/jcapiv1/commandslist.go b/jcapiv1/commandslist.go new file mode 100644 index 0000000..921a84e --- /dev/null +++ b/jcapiv1/commandslist.go @@ -0,0 +1,19 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 1.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package jcapiv1 + +type Commandslist struct { + + Results []CommandslistResults `json:"results,omitempty"` + + // The total number of commands + TotalCount int32 `json:"totalCount,omitempty"` +} diff --git a/jcapiv1/commandslist_results.go b/jcapiv1/commandslist_results.go new file mode 100644 index 0000000..f3529fa --- /dev/null +++ b/jcapiv1/commandslist_results.go @@ -0,0 +1,43 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 1.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package jcapiv1 + +type CommandslistResults struct { + + // The ID of the command. + Id string `json:"_id,omitempty"` + + // The Command to execute. + Command string `json:"command,omitempty"` + + // The Command OS. + CommandType string `json:"commandType,omitempty"` + + // How the Command is executed. + LaunchType string `json:"launchType,omitempty"` + + ListensTo string `json:"listensTo,omitempty"` + + // The name of the Command. + Name string `json:"name,omitempty"` + + // The ID of the Organization. + Organization string `json:"organization,omitempty"` + + // A crontab that consists of: [ (seconds) (minutes) (hours) (days of month) (months) (weekdays) ] or [ immediate ]. If you send this as an empty string, it will run immediately. + Schedule string `json:"schedule,omitempty"` + + // When the command will repeat. + ScheduleRepeatType string `json:"scheduleRepeatType,omitempty"` + + // Trigger to execute command. + Trigger string `json:"trigger,omitempty"` +} diff --git a/jcapiv1/configuration.go b/jcapiv1/configuration.go new file mode 100644 index 0000000..d007f9e --- /dev/null +++ b/jcapiv1/configuration.go @@ -0,0 +1,72 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 1.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv1 + +import ( + "net/http" +) + +// contextKeys are used to identify the type of value in the context. +// Since these are string, it is possible to get a short description of the +// context key for logging and debugging using key.String(). + +type contextKey string + +func (c contextKey) String() string { + return "auth " + string(c) +} + +var ( + // ContextOAuth2 takes a oauth2.TokenSource as authentication for the request. + ContextOAuth2 = contextKey("token") + + // ContextBasicAuth takes BasicAuth as authentication for the request. + ContextBasicAuth = contextKey("basic") + + // ContextAccessToken takes a string oauth2 access token as authentication for the request. + ContextAccessToken = contextKey("accesstoken") + + // ContextAPIKey takes an APIKey as authentication for the request + ContextAPIKey = contextKey("apikey") +) + +// BasicAuth provides basic http authentication to a request passed via context using ContextBasicAuth +type BasicAuth struct { + UserName string `json:"userName,omitempty"` + Password string `json:"password,omitempty"` +} + +// APIKey provides API key based authentication to a request passed via context using ContextAPIKey +type APIKey struct { + Key string + Prefix string +} + +type Configuration struct { + BasePath string `json:"basePath,omitempty"` + Host string `json:"host,omitempty"` + Scheme string `json:"scheme,omitempty"` + DefaultHeader map[string]string `json:"defaultHeader,omitempty"` + UserAgent string `json:"userAgent,omitempty"` + HTTPClient *http.Client +} + +func NewConfiguration() *Configuration { + cfg := &Configuration{ + BasePath: "https://console.jumpcloud.com/api", + DefaultHeader: make(map[string]string), + UserAgent: "Swagger-Codegen/5.0.0/go", + } + return cfg +} + +func (c *Configuration) AddDefaultHeader(key string, value string) { + c.DefaultHeader[key] = value +} diff --git a/jcapiv1/docs/Application.md b/jcapiv1/docs/Application.md new file mode 100644 index 0000000..a0b65b9 --- /dev/null +++ b/jcapiv1/docs/Application.md @@ -0,0 +1,24 @@ +# Application + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Id** | **string** | | [optional] [default to null] +**Active** | **bool** | | [optional] [default to null] +**Beta** | **bool** | | [optional] [default to null] +**Color** | **string** | | [optional] [default to null] +**Config** | [***ApplicationConfig**](application_config.md) | | [default to null] +**Created** | **string** | | [optional] [default to null] +**DatabaseAttributes** | [**[]interface{}**](interface{}.md) | | [optional] [default to null] +**Description** | **string** | | [optional] [default to null] +**DisplayLabel** | **string** | | [optional] [default to null] +**DisplayName** | **string** | | [optional] [default to null] +**LearnMore** | **string** | | [optional] [default to null] +**Logo** | [***ApplicationLogo**](application_logo.md) | | [optional] [default to null] +**Name** | **string** | | [default to null] +**Organization** | **string** | | [optional] [default to null] +**Sso** | [***Sso**](sso.md) | | [optional] [default to null] +**SsoUrl** | **string** | | [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/v1/docs/ApplicationConfig.md b/jcapiv1/docs/ApplicationConfig.md similarity index 99% rename from v1/docs/ApplicationConfig.md rename to jcapiv1/docs/ApplicationConfig.md index 9d8b4fc..75714b5 100644 --- a/v1/docs/ApplicationConfig.md +++ b/jcapiv1/docs/ApplicationConfig.md @@ -13,4 +13,3 @@ Name | Type | Description | Notes [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/v1/docs/ApplicationConfigAcsUrl.md b/jcapiv1/docs/ApplicationConfigAcsUrl.md similarity index 87% rename from v1/docs/ApplicationConfigAcsUrl.md rename to jcapiv1/docs/ApplicationConfigAcsUrl.md index 8bc91ed..8d24795 100644 --- a/v1/docs/ApplicationConfigAcsUrl.md +++ b/jcapiv1/docs/ApplicationConfigAcsUrl.md @@ -4,9 +4,11 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **Label** | **string** | | [optional] [default to null] +**Options** | **string** | | [optional] [default to null] **Position** | **int32** | | [optional] [default to null] **ReadOnly** | **bool** | | [optional] [default to null] **Required** | **bool** | | [optional] [default to null] +**Toggle** | **string** | | [optional] [default to null] **Tooltip** | [***ApplicationConfigAcsUrlTooltip**](application_config_acsUrl_tooltip.md) | | [optional] [default to null] **Type_** | **string** | | [optional] [default to null] **Value** | **string** | | [optional] [default to null] @@ -14,4 +16,3 @@ Name | Type | Description | Notes [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/v1/docs/ApplicationConfigAcsUrlTooltip.md b/jcapiv1/docs/ApplicationConfigAcsUrlTooltip.md similarity index 99% rename from v1/docs/ApplicationConfigAcsUrlTooltip.md rename to jcapiv1/docs/ApplicationConfigAcsUrlTooltip.md index 267f348..94d5538 100644 --- a/v1/docs/ApplicationConfigAcsUrlTooltip.md +++ b/jcapiv1/docs/ApplicationConfigAcsUrlTooltip.md @@ -8,4 +8,3 @@ Name | Type | Description | Notes [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/v1/docs/ApplicationConfigAcsUrlTooltipVariables.md b/jcapiv1/docs/ApplicationConfigAcsUrlTooltipVariables.md similarity index 99% rename from v1/docs/ApplicationConfigAcsUrlTooltipVariables.md rename to jcapiv1/docs/ApplicationConfigAcsUrlTooltipVariables.md index a4b9b07..2555360 100644 --- a/v1/docs/ApplicationConfigAcsUrlTooltipVariables.md +++ b/jcapiv1/docs/ApplicationConfigAcsUrlTooltipVariables.md @@ -8,4 +8,3 @@ Name | Type | Description | Notes [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/v1/docs/ApplicationConfigConstantAttributes.md b/jcapiv1/docs/ApplicationConfigConstantAttributes.md similarity index 99% rename from v1/docs/ApplicationConfigConstantAttributes.md rename to jcapiv1/docs/ApplicationConfigConstantAttributes.md index b4a1e45..3c4727a 100644 --- a/v1/docs/ApplicationConfigConstantAttributes.md +++ b/jcapiv1/docs/ApplicationConfigConstantAttributes.md @@ -15,4 +15,3 @@ Name | Type | Description | Notes [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/v1/docs/ApplicationConfigConstantAttributesValue.md b/jcapiv1/docs/ApplicationConfigConstantAttributesValue.md similarity index 99% rename from v1/docs/ApplicationConfigConstantAttributesValue.md rename to jcapiv1/docs/ApplicationConfigConstantAttributesValue.md index 44119c3..01baa08 100644 --- a/v1/docs/ApplicationConfigConstantAttributesValue.md +++ b/jcapiv1/docs/ApplicationConfigConstantAttributesValue.md @@ -11,4 +11,3 @@ Name | Type | Description | Notes [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/v1/docs/ApplicationConfigDatabaseAttributes.md b/jcapiv1/docs/ApplicationConfigDatabaseAttributes.md similarity index 99% rename from v1/docs/ApplicationConfigDatabaseAttributes.md rename to jcapiv1/docs/ApplicationConfigDatabaseAttributes.md index 7b2461a..de24b35 100644 --- a/v1/docs/ApplicationConfigDatabaseAttributes.md +++ b/jcapiv1/docs/ApplicationConfigDatabaseAttributes.md @@ -7,4 +7,3 @@ Name | Type | Description | Notes [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/jcapiv1/docs/ApplicationLogo.md b/jcapiv1/docs/ApplicationLogo.md new file mode 100644 index 0000000..0f86465 --- /dev/null +++ b/jcapiv1/docs/ApplicationLogo.md @@ -0,0 +1,10 @@ +# ApplicationLogo + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Color** | **string** | | [optional] [default to null] +**Url** | **string** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv1/docs/ApplicationTemplatesApi.md b/jcapiv1/docs/ApplicationTemplatesApi.md new file mode 100644 index 0000000..b5a09af --- /dev/null +++ b/jcapiv1/docs/ApplicationTemplatesApi.md @@ -0,0 +1,89 @@ +# {{classname}} + +All URIs are relative to *https://console.jumpcloud.com/api* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**ApplicationTemplatesGet**](ApplicationTemplatesApi.md#ApplicationTemplatesGet) | **Get** /application-templates/{id} | Get an Application Template +[**ApplicationTemplatesList**](ApplicationTemplatesApi.md#ApplicationTemplatesList) | **Get** /application-templates | List Application Templates + +# **ApplicationTemplatesGet** +> Applicationtemplate ApplicationTemplatesGet(ctx, id, optional) +Get an Application Template + +The endpoint returns a specific SSO / SAML Application Template. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/application-templates/{id} \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **id** | **string**| | + **optional** | ***ApplicationTemplatesApiApplicationTemplatesGetOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a ApplicationTemplatesApiApplicationTemplatesGetOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **fields** | **optional.String**| The space separated fields included in the returned records. If omitted the default list of fields will be returned. | + **limit** | **optional.Int32**| The number of records to return at once. | + **skip** | **optional.Int32**| The offset into the records to return. | + **sort** | **optional.String**| The space separated fields used to sort the collection. Default sort is ascending, prefix with - to sort descending. | + **filter** | **optional.String**| A filter to apply to the query. See the supported operators below. For more complex searches, see the related `/search/<domain>` endpoints, e.g. `/search/systems`. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: - `$eq` (equals) - `$ne` (does not equal) - `$gt` (is greater than) - `$gte` (is greater than or equal to) - `$lt` (is less than) - `$lte` (is less than or equal to) _Note: v1 operators differ from v2 operators._ _Note: For v1 operators, excluding the `$` will result in undefined behavior._ **value** = Populate with the value you want to search for. Is case sensitive. **Examples** - `GET /users?filter=username:$eq:testuser` - `GET /systemusers?filter=password_expiration_date:$lte:2021-10-24` - `GET /systemusers?filter=department:$ne:Accounting` - `GET /systems?filter[0]=firstname:$eq:foo&filter[1]=lastname:$eq:bar` - this will AND the filters together. - `GET /systems?filter[or][0]=lastname:$eq:foo&filter[or][1]=lastname:$eq:bar` - this will OR the filters together. | + **xOrgId** | **optional.String**| | + +### Return type + +[**Applicationtemplate**](applicationtemplate.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **ApplicationTemplatesList** +> Applicationtemplateslist ApplicationTemplatesList(ctx, optional) +List Application Templates + +The endpoint returns all the SSO / SAML Application Templates. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/application-templates \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **optional** | ***ApplicationTemplatesApiApplicationTemplatesListOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a ApplicationTemplatesApiApplicationTemplatesListOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **fields** | **optional.String**| The space separated fields included in the returned records. If omitted the default list of fields will be returned. | + **limit** | **optional.Int32**| The number of records to return at once. | + **skip** | **optional.Int32**| The offset into the records to return. | + **sort** | **optional.String**| The space separated fields used to sort the collection. Default sort is ascending, prefix with - to sort descending. | + **filter** | **optional.String**| A filter to apply to the query. See the supported operators below. For more complex searches, see the related `/search/<domain>` endpoints, e.g. `/search/systems`. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: - `$eq` (equals) - `$ne` (does not equal) - `$gt` (is greater than) - `$gte` (is greater than or equal to) - `$lt` (is less than) - `$lte` (is less than or equal to) _Note: v1 operators differ from v2 operators._ _Note: For v1 operators, excluding the `$` will result in undefined behavior._ **value** = Populate with the value you want to search for. Is case sensitive. **Examples** - `GET /users?filter=username:$eq:testuser` - `GET /systemusers?filter=password_expiration_date:$lte:2021-10-24` - `GET /systemusers?filter=department:$ne:Accounting` - `GET /systems?filter[0]=firstname:$eq:foo&filter[1]=lastname:$eq:bar` - this will AND the filters together. - `GET /systems?filter[or][0]=lastname:$eq:foo&filter[or][1]=lastname:$eq:bar` - this will OR the filters together. | + **xOrgId** | **optional.String**| | + +### Return type + +[**Applicationtemplateslist**](applicationtemplateslist.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/jcapiv1/docs/ApplicationsApi.md b/jcapiv1/docs/ApplicationsApi.md new file mode 100644 index 0000000..7275a73 --- /dev/null +++ b/jcapiv1/docs/ApplicationsApi.md @@ -0,0 +1,195 @@ +# {{classname}} + +All URIs are relative to *https://console.jumpcloud.com/api* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**ApplicationsDelete**](ApplicationsApi.md#ApplicationsDelete) | **Delete** /applications/{id} | Delete an Application +[**ApplicationsGet**](ApplicationsApi.md#ApplicationsGet) | **Get** /applications/{id} | Get an Application +[**ApplicationsList**](ApplicationsApi.md#ApplicationsList) | **Get** /applications | Applications +[**ApplicationsPost**](ApplicationsApi.md#ApplicationsPost) | **Post** /applications | Create an Application +[**ApplicationsPut**](ApplicationsApi.md#ApplicationsPut) | **Put** /applications/{id} | Update an Application + +# **ApplicationsDelete** +> Application ApplicationsDelete(ctx, id, optional) +Delete an Application + +The endpoint deletes an SSO / SAML Application. + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **id** | **string**| | + **optional** | ***ApplicationsApiApplicationsDeleteOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a ApplicationsApiApplicationsDeleteOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **xOrgId** | **optional.String**| | + +### Return type + +[**Application**](application.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **ApplicationsGet** +> Application ApplicationsGet(ctx, id, optional) +Get an Application + +The endpoint retrieves an SSO / SAML Application. + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **id** | **string**| | + **optional** | ***ApplicationsApiApplicationsGetOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a ApplicationsApiApplicationsGetOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **xOrgId** | **optional.String**| | + +### Return type + +[**Application**](application.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **ApplicationsList** +> Applicationslist ApplicationsList(ctx, optional) +Applications + +The endpoint returns all your SSO / SAML Applications. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/applications \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **optional** | ***ApplicationsApiApplicationsListOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a ApplicationsApiApplicationsListOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **fields** | **optional.String**| The space separated fields included in the returned records. If omitted the default list of fields will be returned. | + **limit** | **optional.Int32**| The number of records to return at once. | + **skip** | **optional.Int32**| The offset into the records to return. | + **sort** | **optional.String**| The space separated fields used to sort the collection. Default sort is ascending, prefix with - to sort descending. | [default to name] + **filter** | **optional.String**| A filter to apply to the query. See the supported operators below. For more complex searches, see the related `/search/<domain>` endpoints, e.g. `/search/systems`. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: - `$eq` (equals) - `$ne` (does not equal) - `$gt` (is greater than) - `$gte` (is greater than or equal to) - `$lt` (is less than) - `$lte` (is less than or equal to) _Note: v1 operators differ from v2 operators._ _Note: For v1 operators, excluding the `$` will result in undefined behavior._ **value** = Populate with the value you want to search for. Is case sensitive. **Examples** - `GET /users?filter=username:$eq:testuser` - `GET /systemusers?filter=password_expiration_date:$lte:2021-10-24` - `GET /systemusers?filter=department:$ne:Accounting` - `GET /systems?filter[0]=firstname:$eq:foo&filter[1]=lastname:$eq:bar` - this will AND the filters together. - `GET /systems?filter[or][0]=lastname:$eq:foo&filter[or][1]=lastname:$eq:bar` - this will OR the filters together. | + **xOrgId** | **optional.String**| | + +### Return type + +[**Applicationslist**](applicationslist.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **ApplicationsPost** +> Application ApplicationsPost(ctx, optional) +Create an Application + +The endpoint adds a new SSO / SAML Applications. + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **optional** | ***ApplicationsApiApplicationsPostOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a ApplicationsApiApplicationsPostOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**optional.Interface of Application**](Application.md)| | + **xOrgId** | **optional.**| | + +### Return type + +[**Application**](application.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **ApplicationsPut** +> Application ApplicationsPut(ctx, id, optional) +Update an Application + +The endpoint updates a SSO / SAML Application. Any fields not provided will be reset or created with default values. + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **id** | **string**| | + **optional** | ***ApplicationsApiApplicationsPutOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a ApplicationsApiApplicationsPutOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **body** | [**optional.Interface of Application**](Application.md)| | + **xOrgId** | **optional.**| | + +### Return type + +[**Application**](application.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/v1/docs/Applicationslist.md b/jcapiv1/docs/Applicationslist.md similarity index 89% rename from v1/docs/Applicationslist.md rename to jcapiv1/docs/Applicationslist.md index 4776712..8a72e1a 100644 --- a/v1/docs/Applicationslist.md +++ b/jcapiv1/docs/Applicationslist.md @@ -3,9 +3,9 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- +**Name** | **string** | | [optional] [default to null] **Results** | [**[]Application**](application.md) | The list of applications. | [optional] [default to null] **TotalCount** | **int32** | The total number of applications. | [optional] [default to null] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/jcapiv1/docs/Applicationtemplate.md b/jcapiv1/docs/Applicationtemplate.md new file mode 100644 index 0000000..0c367df --- /dev/null +++ b/jcapiv1/docs/Applicationtemplate.md @@ -0,0 +1,27 @@ +# Applicationtemplate + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Id** | **string** | | [optional] [default to null] +**Active** | **bool** | | [optional] [default to null] +**Beta** | **bool** | | [optional] [default to null] +**Color** | **string** | | [optional] [default to null] +**Config** | [***ApplicationConfig**](application_config.md) | | [optional] [default to null] +**DisplayLabel** | **string** | | [optional] [default to null] +**DisplayName** | **string** | | [optional] [default to null] +**IsConfigured** | **bool** | | [optional] [default to null] +**Jit** | [***ApplicationtemplateJit**](applicationtemplate_jit.md) | | [optional] [default to null] +**Keywords** | **[]string** | | [optional] [default to null] +**LearnMore** | **string** | | [optional] [default to null] +**Logo** | [***ApplicationtemplateLogo**](applicationtemplate_logo.md) | | [optional] [default to null] +**Name** | **string** | | [optional] [default to null] +**Oidc** | [***ApplicationtemplateOidc**](applicationtemplate_oidc.md) | | [optional] [default to null] +**Provision** | [***ApplicationtemplateProvision**](applicationtemplate_provision.md) | | [optional] [default to null] +**Sso** | [***Sso**](sso.md) | | [optional] [default to null] +**SsoUrl** | **string** | | [optional] [default to null] +**Status** | **string** | | [optional] [default to null] +**Test** | **string** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/v1/docs/ApplicationtemplateJit.md b/jcapiv1/docs/ApplicationtemplateJit.md similarity index 99% rename from v1/docs/ApplicationtemplateJit.md rename to jcapiv1/docs/ApplicationtemplateJit.md index 32d8159..e93ee83 100644 --- a/v1/docs/ApplicationtemplateJit.md +++ b/jcapiv1/docs/ApplicationtemplateJit.md @@ -8,4 +8,3 @@ Name | Type | Description | Notes [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/jcapiv1/docs/ApplicationtemplateLogo.md b/jcapiv1/docs/ApplicationtemplateLogo.md new file mode 100644 index 0000000..7ddf27f --- /dev/null +++ b/jcapiv1/docs/ApplicationtemplateLogo.md @@ -0,0 +1,9 @@ +# ApplicationtemplateLogo + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Url** | **string** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv1/docs/ApplicationtemplateOidc.md b/jcapiv1/docs/ApplicationtemplateOidc.md new file mode 100644 index 0000000..b68929f --- /dev/null +++ b/jcapiv1/docs/ApplicationtemplateOidc.md @@ -0,0 +1,12 @@ +# ApplicationtemplateOidc + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**GrantTypes** | **[]string** | The grant types allowed. Currently only authorization_code is allowed. | [optional] [default to null] +**RedirectUris** | **[]string** | List of allowed redirectUris | [optional] [default to null] +**SsoUrl** | **string** | The relying party url to trigger an oidc login. | [optional] [default to null] +**TokenEndpointAuthMethod** | **string** | Method that the client uses to authenticate when requesting a token. If 'none', then the client must use PKCE. If 'client_secret_post', then the secret is passed in the post body when requesting the token. | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv1/docs/ApplicationtemplateProvision.md b/jcapiv1/docs/ApplicationtemplateProvision.md new file mode 100644 index 0000000..23990ff --- /dev/null +++ b/jcapiv1/docs/ApplicationtemplateProvision.md @@ -0,0 +1,11 @@ +# ApplicationtemplateProvision + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Beta** | **bool** | | [optional] [default to null] +**GroupsSupported** | **bool** | | [optional] [default to null] +**Type_** | **string** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/v1/docs/Applicationtemplateslist.md b/jcapiv1/docs/Applicationtemplateslist.md similarity index 99% rename from v1/docs/Applicationtemplateslist.md rename to jcapiv1/docs/Applicationtemplateslist.md index 5f5d7c5..e45eaa1 100644 --- a/v1/docs/Applicationtemplateslist.md +++ b/jcapiv1/docs/Applicationtemplateslist.md @@ -8,4 +8,3 @@ Name | Type | Description | Notes [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/jcapiv1/docs/Body.md b/jcapiv1/docs/Body.md new file mode 100644 index 0000000..56251a1 --- /dev/null +++ b/jcapiv1/docs/Body.md @@ -0,0 +1,10 @@ +# Body + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Settings** | [***Organizationsettingsput**](organizationsettingsput.md) | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/jcapiv1/docs/Body1.md b/jcapiv1/docs/Body1.md new file mode 100644 index 0000000..c15996e --- /dev/null +++ b/jcapiv1/docs/Body1.md @@ -0,0 +1,19 @@ +# Body1 + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**DeviceCertEnabled** | **bool** | | [optional] [default to null] +**Mfa** | **string** | | [optional] [default to null] +**Name** | **string** | | [default to null] +**NetworkSourceIp** | **string** | | [default to null] +**SharedSecret** | **string** | | [default to null] +**Tags** | **[]string** | | [optional] [default to null] +**UserCertEnabled** | **bool** | | [optional] [default to null] +**UserLockoutAction** | **string** | | [optional] [default to null] +**UserPasswordEnabled** | **bool** | | [optional] [default to null] +**UserPasswordExpirationAction** | **string** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/jcapiv1/docs/Body2.md b/jcapiv1/docs/Body2.md new file mode 100644 index 0000000..ec53845 --- /dev/null +++ b/jcapiv1/docs/Body2.md @@ -0,0 +1,12 @@ +# Body2 + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Exclusion** | **bool** | | [optional] [default to null] +**ExclusionDays** | **float32** | | [optional] [default to null] +**ExclusionUntil** | [**time.Time**](time.Time.md) | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/jcapiv1/docs/Body3.md b/jcapiv1/docs/Body3.md new file mode 100644 index 0000000..cf6b99e --- /dev/null +++ b/jcapiv1/docs/Body3.md @@ -0,0 +1,10 @@ +# Body3 + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Email** | [***interface{}**](interface{}.md) | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/v1/docs/Command.md b/jcapiv1/docs/Command.md similarity index 76% rename from v1/docs/Command.md rename to jcapiv1/docs/Command.md index 218cae7..265cadc 100644 --- a/v1/docs/Command.md +++ b/jcapiv1/docs/Command.md @@ -5,20 +5,23 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **Command** | **string** | The command to execute on the server. | [default to null] **CommandRunners** | **[]string** | An array of IDs of the Command Runner Users that can execute this command. | [optional] [default to null] -**CommandType** | **string** | The Command OS | [optional] [default to null] +**CommandType** | **string** | The Command OS | [default to linux] **Files** | **[]string** | An array of file IDs to include with the command. | [optional] [default to null] **LaunchType** | **string** | How the command will execute. | [optional] [default to null] **ListensTo** | **string** | | [optional] [default to null] -**Name** | **string** | | [optional] [default to null] +**Name** | **string** | | [default to null] **Organization** | **string** | The ID of the organization. | [optional] [default to null] **Schedule** | **string** | A crontab that consists of: [ (seconds) (minutes) (hours) (days of month) (months) (weekdays) ] or [ immediate ]. If you send this as an empty string, it will run immediately. | [optional] [default to null] **ScheduleRepeatType** | **string** | When the command will repeat. | [optional] [default to null] +**ScheduleYear** | **int32** | The year that a scheduled command will launch in. | [optional] [default to null] +**Shell** | **string** | The shell used to run the command. | [optional] [default to null] **Sudo** | **bool** | | [optional] [default to null] **Systems** | **[]string** | An array of system IDs to run the command on. Not available if you are using Groups. | [optional] [default to null] +**Template** | **string** | The template this command was created from | [optional] [default to null] +**TimeToLiveSeconds** | **int32** | Time in seconds a command can wait in the queue to be run before timing out | [optional] [default to null] **Timeout** | **string** | The time in seconds to allow the command to run for. | [optional] [default to null] **Trigger** | **string** | The name of the command trigger. | [optional] [default to null] **User** | **string** | The ID of the system user to run the command as. This field is required when creating a command with a commandType of \"mac\" or \"linux\". | [optional] [default to null] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/jcapiv1/docs/CommandResultsApi.md b/jcapiv1/docs/CommandResultsApi.md new file mode 100644 index 0000000..bbc3266 --- /dev/null +++ b/jcapiv1/docs/CommandResultsApi.md @@ -0,0 +1,123 @@ +# {{classname}} + +All URIs are relative to *https://console.jumpcloud.com/api* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**CommandResultsDelete**](CommandResultsApi.md#CommandResultsDelete) | **Delete** /commandresults/{id} | Delete a Command result +[**CommandResultsGet**](CommandResultsApi.md#CommandResultsGet) | **Get** /commandresults/{id} | List an individual Command result +[**CommandResultsList**](CommandResultsApi.md#CommandResultsList) | **Get** /commandresults | List all Command Results + +# **CommandResultsDelete** +> Commandresult CommandResultsDelete(ctx, id, optional) +Delete a Command result + +This endpoint deletes a specific command result. #### Sample Request ``` curl -X DELETE https://console.jumpcloud.com/api/commandresults/{CommandID} \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ```` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **id** | **string**| | + **optional** | ***CommandResultsApiCommandResultsDeleteOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a CommandResultsApiCommandResultsDeleteOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **xOrgId** | **optional.String**| | + +### Return type + +[**Commandresult**](commandresult.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **CommandResultsGet** +> Commandresult CommandResultsGet(ctx, id, optional) +List an individual Command result + +This endpoint returns a specific command result. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/commandresults/{CommandResultID} \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **id** | **string**| | + **optional** | ***CommandResultsApiCommandResultsGetOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a CommandResultsApiCommandResultsGetOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **fields** | **optional.String**| Use a space seperated string of field parameters to include the data in the response. If omitted, the default list of fields will be returned. | + **filter** | **optional.String**| A filter to apply to the query. See the supported operators below. For more complex searches, see the related `/search/<domain>` endpoints, e.g. `/search/systems`. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: - `$eq` (equals) - `$ne` (does not equal) - `$gt` (is greater than) - `$gte` (is greater than or equal to) - `$lt` (is less than) - `$lte` (is less than or equal to) _Note: v1 operators differ from v2 operators._ _Note: For v1 operators, excluding the `$` will result in undefined behavior._ **value** = Populate with the value you want to search for. Is case sensitive. **Examples** - `GET /users?filter=username:$eq:testuser` - `GET /systemusers?filter=password_expiration_date:$lte:2021-10-24` - `GET /systemusers?filter=department:$ne:Accounting` - `GET /systems?filter[0]=firstname:$eq:foo&filter[1]=lastname:$eq:bar` - this will AND the filters together. - `GET /systems?filter[or][0]=lastname:$eq:foo&filter[or][1]=lastname:$eq:bar` - this will OR the filters together. | + **xOrgId** | **optional.String**| | + +### Return type + +[**Commandresult**](commandresult.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **CommandResultsList** +> Commandresultslist CommandResultsList(ctx, optional) +List all Command Results + +This endpoint returns all command results. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/commandresults \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key:{API_KEY}' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **optional** | ***CommandResultsApiCommandResultsListOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a CommandResultsApiCommandResultsListOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **fields** | **optional.String**| Use a space seperated string of field parameters to include the data in the response. If omitted, the default list of fields will be returned. | + **filter** | **optional.String**| A filter to apply to the query. See the supported operators below. For more complex searches, see the related `/search/<domain>` endpoints, e.g. `/search/systems`. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: - `$eq` (equals) - `$ne` (does not equal) - `$gt` (is greater than) - `$gte` (is greater than or equal to) - `$lt` (is less than) - `$lte` (is less than or equal to) _Note: v1 operators differ from v2 operators._ _Note: For v1 operators, excluding the `$` will result in undefined behavior._ **value** = Populate with the value you want to search for. Is case sensitive. **Examples** - `GET /users?filter=username:$eq:testuser` - `GET /systemusers?filter=password_expiration_date:$lte:2021-10-24` - `GET /systemusers?filter=department:$ne:Accounting` - `GET /systems?filter[0]=firstname:$eq:foo&filter[1]=lastname:$eq:bar` - this will AND the filters together. - `GET /systems?filter[or][0]=lastname:$eq:foo&filter[or][1]=lastname:$eq:bar` - this will OR the filters together. | + **limit** | **optional.Int32**| The number of records to return at once. Limited to 100. | [default to 10] + **xOrgId** | **optional.String**| | + **skip** | **optional.Int32**| The offset into the records to return. | [default to 0] + **sort** | **optional.String**| Use space separated sort parameters to sort the collection. Default sort is ascending. Prefix with `-` to sort descending. | + +### Return type + +[**Commandresultslist**](commandresultslist.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/jcapiv1/docs/CommandTriggersApi.md b/jcapiv1/docs/CommandTriggersApi.md new file mode 100644 index 0000000..55199db --- /dev/null +++ b/jcapiv1/docs/CommandTriggersApi.md @@ -0,0 +1,45 @@ +# {{classname}} + +All URIs are relative to *https://console.jumpcloud.com/api* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**CommandTriggerWebhookPost**](CommandTriggersApi.md#CommandTriggerWebhookPost) | **Post** /command/trigger/{triggername} | Launch a command via a Trigger + +# **CommandTriggerWebhookPost** +> Triggerreturn CommandTriggerWebhookPost(ctx, triggername, optional) +Launch a command via a Trigger + +This endpoint allows you to launch a command based on a defined trigger. #### Sample Requests **Launch a Command via a Trigger** ``` curl --silent \\ -X 'POST' \\ -H \"x-api-key: {API_KEY}\" \\ \"https://console.jumpcloud.com/api/command/trigger/{TriggerName}\" ``` **Launch a Command via a Trigger passing a JSON object to the command** ``` curl --silent \\ -X 'POST' \\ -H \"x-api-key: {API_KEY}\" \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -d '{ \"srcip\":\"192.168.2.32\", \"attack\":\"Cross Site Scripting Attempt\" }' \\ \"https://console.jumpcloud.com/api/command/trigger/{TriggerName}\" ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **triggername** | **string**| | + **optional** | ***CommandTriggersApiCommandTriggerWebhookPostOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a CommandTriggersApiCommandTriggerWebhookPostOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **body** | [**optional.Interface of interface{}**](interface{}.md)| | + **xOrgId** | **optional.**| | + +### Return type + +[**Triggerreturn**](triggerreturn.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/v1/docs/Commandfilereturn.md b/jcapiv1/docs/Commandfilereturn.md similarity index 77% rename from v1/docs/Commandfilereturn.md rename to jcapiv1/docs/Commandfilereturn.md index 7e334b0..949abc4 100644 --- a/v1/docs/Commandfilereturn.md +++ b/jcapiv1/docs/Commandfilereturn.md @@ -3,9 +3,8 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Results** | [***CommandfilereturnResults**](commandfilereturn_results.md) | | [optional] [default to null] +**Results** | [**[]CommandfilereturnResults**](commandfilereturn_results.md) | | [optional] [default to null] **TotalCount** | **int32** | The total number of commands files | [optional] [default to null] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/v1/docs/CommandfilereturnResults.md b/jcapiv1/docs/CommandfilereturnResults.md similarity index 99% rename from v1/docs/CommandfilereturnResults.md rename to jcapiv1/docs/CommandfilereturnResults.md index 0678a36..196566f 100644 --- a/v1/docs/CommandfilereturnResults.md +++ b/jcapiv1/docs/CommandfilereturnResults.md @@ -9,4 +9,3 @@ Name | Type | Description | Notes [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/v1/docs/Commandresult.md b/jcapiv1/docs/Commandresult.md similarity index 85% rename from v1/docs/Commandresult.md rename to jcapiv1/docs/Commandresult.md index a22c1f1..b1dd65c 100644 --- a/v1/docs/Commandresult.md +++ b/jcapiv1/docs/Commandresult.md @@ -8,9 +8,9 @@ Name | Type | Description | Notes **Files** | **[]string** | An array of file ids that were included in the command | [optional] [default to null] **Name** | **string** | The name of the command. | [optional] [default to null] **Organization** | **string** | The ID of the organization. | [optional] [default to null] -**RequestTime** | **string** | The time that the command was sent. | [optional] [default to null] +**RequestTime** | [**time.Time**](time.Time.md) | The time that the command was sent. | [optional] [default to null] **Response** | [***CommandresultResponse**](commandresult_response.md) | | [optional] [default to null] -**ResponseTime** | **string** | The time that the command was completed. | [optional] [default to null] +**ResponseTime** | [**time.Time**](time.Time.md) | The time that the command was completed. | [optional] [default to null] **Sudo** | **bool** | If the user had sudo rights | [optional] [default to null] **System** | **string** | The name of the system the command was executed on. | [optional] [default to null] **SystemId** | **string** | The id of the system the command was executed on. | [optional] [default to null] @@ -20,4 +20,3 @@ Name | Type | Description | Notes [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/v1/docs/CommandresultResponse.md b/jcapiv1/docs/CommandresultResponse.md similarity index 99% rename from v1/docs/CommandresultResponse.md rename to jcapiv1/docs/CommandresultResponse.md index fda27b2..8c98231 100644 --- a/v1/docs/CommandresultResponse.md +++ b/jcapiv1/docs/CommandresultResponse.md @@ -9,4 +9,3 @@ Name | Type | Description | Notes [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/v1/docs/CommandresultResponseData.md b/jcapiv1/docs/CommandresultResponseData.md similarity index 99% rename from v1/docs/CommandresultResponseData.md rename to jcapiv1/docs/CommandresultResponseData.md index a81b638..0d7e023 100644 --- a/v1/docs/CommandresultResponseData.md +++ b/jcapiv1/docs/CommandresultResponseData.md @@ -8,4 +8,3 @@ Name | Type | Description | Notes [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/jcapiv1/docs/Commandresultslist.md b/jcapiv1/docs/Commandresultslist.md new file mode 100644 index 0000000..ba6014d --- /dev/null +++ b/jcapiv1/docs/Commandresultslist.md @@ -0,0 +1,10 @@ +# Commandresultslist + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Results** | [**[]CommandresultslistResults**](commandresultslist_results.md) | | [optional] [default to null] +**TotalCount** | **int32** | The total number of command results. | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv1/docs/CommandresultslistResults.md b/jcapiv1/docs/CommandresultslistResults.md new file mode 100644 index 0000000..86d8198 --- /dev/null +++ b/jcapiv1/docs/CommandresultslistResults.md @@ -0,0 +1,19 @@ +# CommandresultslistResults + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Id** | **string** | The ID of the command result. | [optional] [default to null] +**Command** | **string** | The command that was executed on the system. | [optional] [default to null] +**ExitCode** | **int32** | The stderr output from the command that ran. | [optional] [default to null] +**Name** | **string** | The name of the command. | [optional] [default to null] +**RequestTime** | [**time.Time**](time.Time.md) | The time (UTC) that the command was sent. | [optional] [default to null] +**ResponseTime** | [**time.Time**](time.Time.md) | The time (UTC) that the command was completed. | [optional] [default to null] +**Sudo** | **bool** | If the user had sudo rights. | [optional] [default to null] +**System** | **string** | The display name of the system the command was executed on. | [optional] [default to null] +**SystemId** | **string** | The id of the system the command was executed on. | [optional] [default to null] +**User** | **string** | The user the command ran as. | [optional] [default to null] +**WorkflowId** | **string** | The id for the command that ran on the system. | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv1/docs/CommandsApi.md b/jcapiv1/docs/CommandsApi.md new file mode 100644 index 0000000..a2d8bc3 --- /dev/null +++ b/jcapiv1/docs/CommandsApi.md @@ -0,0 +1,265 @@ +# {{classname}} + +All URIs are relative to *https://console.jumpcloud.com/api* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**CommandFileGet**](CommandsApi.md#CommandFileGet) | **Get** /files/command/{id} | Get a Command File +[**CommandsDelete**](CommandsApi.md#CommandsDelete) | **Delete** /commands/{id} | Delete a Command +[**CommandsGet**](CommandsApi.md#CommandsGet) | **Get** /commands/{id} | List an individual Command +[**CommandsGetResults**](CommandsApi.md#CommandsGetResults) | **Get** /commands/{id}/results | Get results for a specific command +[**CommandsList**](CommandsApi.md#CommandsList) | **Get** /commands | List All Commands +[**CommandsPost**](CommandsApi.md#CommandsPost) | **Post** /commands | Create A Command +[**CommandsPut**](CommandsApi.md#CommandsPut) | **Put** /commands/{id} | Update a Command + +# **CommandFileGet** +> Commandfilereturn CommandFileGet(ctx, id, optional) +Get a Command File + +This endpoint returns the uploaded file(s) associated with a specific command. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/files/command/{commandID} \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **id** | **string**| | + **optional** | ***CommandsApiCommandFileGetOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a CommandsApiCommandFileGetOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **fields** | **optional.String**| Use a space seperated string of field parameters to include the data in the response. If omitted, the default list of fields will be returned. | + **limit** | **optional.Int32**| The number of records to return at once. Limited to 100. | [default to 10] + **xOrgId** | **optional.String**| | + **skip** | **optional.Int32**| The offset into the records to return. | [default to 0] + +### Return type + +[**Commandfilereturn**](commandfilereturn.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **CommandsDelete** +> Command CommandsDelete(ctx, id, optional) +Delete a Command + +This endpoint deletes a specific command based on the Command ID. #### Sample Request ``` curl -X DELETE https://console.jumpcloud.com/api/commands/{CommandID} \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **id** | **string**| | + **optional** | ***CommandsApiCommandsDeleteOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a CommandsApiCommandsDeleteOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **xOrgId** | **optional.String**| | + +### Return type + +[**Command**](command.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **CommandsGet** +> Command CommandsGet(ctx, id, optional) +List an individual Command + +This endpoint returns a specific command based on the command ID. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/commands/{CommandID} \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **id** | **string**| | + **optional** | ***CommandsApiCommandsGetOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a CommandsApiCommandsGetOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **fields** | **optional.String**| Use a space seperated string of field parameters to include the data in the response. If omitted, the default list of fields will be returned. | + **xOrgId** | **optional.String**| | + +### Return type + +[**Command**](command.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **CommandsGetResults** +> []Commandresult CommandsGetResults(ctx, id) +Get results for a specific command + +This endpoint returns results for a specific command. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/commands/{id}/results \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ```` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **id** | **string**| | + +### Return type + +[**[]Commandresult**](commandresult.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **CommandsList** +> Commandslist CommandsList(ctx, optional) +List All Commands + +This endpoint returns all commands. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/commands/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **optional** | ***CommandsApiCommandsListOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a CommandsApiCommandsListOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **fields** | **optional.String**| Use a space seperated string of field parameters to include the data in the response. If omitted, the default list of fields will be returned. | + **filter** | **optional.String**| A filter to apply to the query. See the supported operators below. For more complex searches, see the related `/search/<domain>` endpoints, e.g. `/search/systems`. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: - `$eq` (equals) - `$ne` (does not equal) - `$gt` (is greater than) - `$gte` (is greater than or equal to) - `$lt` (is less than) - `$lte` (is less than or equal to) _Note: v1 operators differ from v2 operators._ _Note: For v1 operators, excluding the `$` will result in undefined behavior._ **value** = Populate with the value you want to search for. Is case sensitive. **Examples** - `GET /users?filter=username:$eq:testuser` - `GET /systemusers?filter=password_expiration_date:$lte:2021-10-24` - `GET /systemusers?filter=department:$ne:Accounting` - `GET /systems?filter[0]=firstname:$eq:foo&filter[1]=lastname:$eq:bar` - this will AND the filters together. - `GET /systems?filter[or][0]=lastname:$eq:foo&filter[or][1]=lastname:$eq:bar` - this will OR the filters together. | + **limit** | **optional.Int32**| The number of records to return at once. Limited to 100. | [default to 10] + **xOrgId** | **optional.String**| | + **skip** | **optional.Int32**| The offset into the records to return. | [default to 0] + **sort** | **optional.String**| Use space separated sort parameters to sort the collection. Default sort is ascending. Prefix with `-` to sort descending. | + +### Return type + +[**Commandslist**](commandslist.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **CommandsPost** +> Command CommandsPost(ctx, optional) +Create A Command + +This endpoint allows you to create a new command. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/commands/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"name\":\"Test API Command\", \"command\":\"String\", \"user\":\"{UserID}\", \"schedule\":\"\", \"timeout\":\"100\" }' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **optional** | ***CommandsApiCommandsPostOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a CommandsApiCommandsPostOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**optional.Interface of Command**](Command.md)| | + **xOrgId** | **optional.**| | + +### Return type + +[**Command**](command.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **CommandsPut** +> Command CommandsPut(ctx, id, optional) +Update a Command + +This endpoint Updates a command based on the command ID and returns the modified command record. #### Sample Request ``` curl -X PUT https://console.jumpcloud.com/api/commands/{CommandID} \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"name\":\"Test API Command\", \"command\":\"String\", \"user\":\"{UserID}\", \"schedule\":\"\", \"timeout\":\"100\" }' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **id** | **string**| | + **optional** | ***CommandsApiCommandsPutOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a CommandsApiCommandsPutOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **body** | [**optional.Interface of Command**](Command.md)| | + **xOrgId** | **optional.**| | + +### Return type + +[**Command**](command.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/v1/docs/Commandslist.md b/jcapiv1/docs/Commandslist.md similarity index 99% rename from v1/docs/Commandslist.md rename to jcapiv1/docs/Commandslist.md index 03a745d..396ef53 100644 --- a/v1/docs/Commandslist.md +++ b/jcapiv1/docs/Commandslist.md @@ -8,4 +8,3 @@ Name | Type | Description | Notes [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/v1/docs/CommandslistResults.md b/jcapiv1/docs/CommandslistResults.md similarity index 99% rename from v1/docs/CommandslistResults.md rename to jcapiv1/docs/CommandslistResults.md index b4a7381..5283009 100644 --- a/v1/docs/CommandslistResults.md +++ b/jcapiv1/docs/CommandslistResults.md @@ -16,4 +16,3 @@ Name | Type | Description | Notes [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/jcapiv1/docs/ErrorDetails.md b/jcapiv1/docs/ErrorDetails.md new file mode 100644 index 0000000..f977d72 --- /dev/null +++ b/jcapiv1/docs/ErrorDetails.md @@ -0,0 +1,12 @@ +# ErrorDetails + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Code** | **int32** | HTTP status code | [optional] [default to null] +**Message** | **string** | Error message | [optional] [default to null] +**Status** | **string** | HTTP status description | [optional] [default to null] +**Details** | [**[]interface{}**](interface{}.md) | Describes a list of objects with more detailed information of the given error. Each detail schema is according to one of the messages defined in Google's API: https://github.com/googleapis/googleapis/blob/master/google/rpc/error_details.proto\" | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/v1/docs/Fde.md b/jcapiv1/docs/Fde.md similarity index 99% rename from v1/docs/Fde.md rename to jcapiv1/docs/Fde.md index 10f90ef..5175ebf 100644 --- a/v1/docs/Fde.md +++ b/jcapiv1/docs/Fde.md @@ -8,4 +8,3 @@ Name | Type | Description | Notes [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/jcapiv1/docs/IdResetmfaBody.md b/jcapiv1/docs/IdResetmfaBody.md new file mode 100644 index 0000000..b904f72 --- /dev/null +++ b/jcapiv1/docs/IdResetmfaBody.md @@ -0,0 +1,11 @@ +# IdResetmfaBody + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Exclusion** | **bool** | | [optional] [default to null] +**ExclusionDays** | **float64** | | [optional] [default to null] +**ExclusionUntil** | [**time.Time**](time.Time.md) | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv1/docs/InlineResponse412.md b/jcapiv1/docs/InlineResponse412.md new file mode 100644 index 0000000..0ba5772 --- /dev/null +++ b/jcapiv1/docs/InlineResponse412.md @@ -0,0 +1,10 @@ +# InlineResponse412 + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Error_** | **string** | mesasge containing what error occured | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/jcapiv1/docs/ManagedServiceProviderApi.md b/jcapiv1/docs/ManagedServiceProviderApi.md new file mode 100644 index 0000000..ddf6f5a --- /dev/null +++ b/jcapiv1/docs/ManagedServiceProviderApi.md @@ -0,0 +1,143 @@ +# {{classname}} + +All URIs are relative to *https://console.jumpcloud.com/api* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**AdminTotpresetBegin**](ManagedServiceProviderApi.md#AdminTotpresetBegin) | **Post** /users/resettotp/{id} | Administrator TOTP Reset Initiation +[**OrganizationList**](ManagedServiceProviderApi.md#OrganizationList) | **Get** /organizations | Get Organization Details +[**UsersPut**](ManagedServiceProviderApi.md#UsersPut) | **Put** /users/{id} | Update a user +[**UsersReactivateGet**](ManagedServiceProviderApi.md#UsersReactivateGet) | **Get** /users/reactivate/{id} | Administrator Password Reset Initiation + +# **AdminTotpresetBegin** +> AdminTotpresetBegin(ctx, id) +Administrator TOTP Reset Initiation + +This endpoint initiates a TOTP reset for an admin. This request does not accept a body. + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **id** | **string**| | + +### Return type + + (empty response body) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **OrganizationList** +> Organizationslist OrganizationList(ctx, optional) +Get Organization Details + +This endpoint returns Organization Details. #### Sample Request ``` curl -X GET \\ https://console.jumpcloud.com/api/organizations \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **optional** | ***ManagedServiceProviderApiOrganizationListOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a ManagedServiceProviderApiOrganizationListOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **fields** | **optional.String**| Use a space seperated string of field parameters to include the data in the response. If omitted, the default list of fields will be returned. | + **filter** | **optional.String**| A filter to apply to the query. See the supported operators below. For more complex searches, see the related `/search/<domain>` endpoints, e.g. `/search/systems`. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: - `$eq` (equals) - `$ne` (does not equal) - `$gt` (is greater than) - `$gte` (is greater than or equal to) - `$lt` (is less than) - `$lte` (is less than or equal to) _Note: v1 operators differ from v2 operators._ _Note: For v1 operators, excluding the `$` will result in undefined behavior._ **value** = Populate with the value you want to search for. Is case sensitive. **Examples** - `GET /users?filter=username:$eq:testuser` - `GET /systemusers?filter=password_expiration_date:$lte:2021-10-24` - `GET /systemusers?filter=department:$ne:Accounting` - `GET /systems?filter[0]=firstname:$eq:foo&filter[1]=lastname:$eq:bar` - this will AND the filters together. - `GET /systems?filter[or][0]=lastname:$eq:foo&filter[or][1]=lastname:$eq:bar` - this will OR the filters together. | + **limit** | **optional.Int32**| The number of records to return at once. Limited to 100. | [default to 10] + **search** | **optional.String**| A nested object containing a `searchTerm` string or array of strings and a list of `fields` to search on. | + **skip** | **optional.Int32**| The offset into the records to return. | [default to 0] + **sort** | **optional.String**| Use space separated sort parameters to sort the collection. Default sort is ascending. Prefix with `-` to sort descending. | + +### Return type + +[**Organizationslist**](organizationslist.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **UsersPut** +> Userreturn UsersPut(ctx, id, optional) +Update a user + +This endpoint allows you to update a user. + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **id** | **string**| | + **optional** | ***ManagedServiceProviderApiUsersPutOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a ManagedServiceProviderApiUsersPutOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **body** | [**optional.Interface of Userput**](Userput.md)| | + **xOrgId** | **optional.**| | + +### Return type + +[**Userreturn**](userreturn.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **UsersReactivateGet** +> UsersReactivateGet(ctx, id) +Administrator Password Reset Initiation + +This endpoint triggers the sending of a reactivation e-mail to an administrator. + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **id** | **string**| | + +### Return type + + (empty response body) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/jcapiv1/docs/Mfa.md b/jcapiv1/docs/Mfa.md new file mode 100644 index 0000000..0895e7c --- /dev/null +++ b/jcapiv1/docs/Mfa.md @@ -0,0 +1,12 @@ +# Mfa + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Configured** | **bool** | | [optional] [default to null] +**Exclusion** | **bool** | | [optional] [default to null] +**ExclusionDays** | **int32** | | [optional] [default to null] +**ExclusionUntil** | [**time.Time**](time.Time.md) | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv1/docs/MfaEnrollment.md b/jcapiv1/docs/MfaEnrollment.md new file mode 100644 index 0000000..d1cb1b5 --- /dev/null +++ b/jcapiv1/docs/MfaEnrollment.md @@ -0,0 +1,12 @@ +# MfaEnrollment + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**OverallStatus** | [***MfaEnrollmentStatus**](mfaEnrollmentStatus.md) | | [optional] [default to null] +**PushStatus** | [***MfaEnrollmentStatus**](mfaEnrollmentStatus.md) | | [optional] [default to null] +**TotpStatus** | [***MfaEnrollmentStatus**](mfaEnrollmentStatus.md) | | [optional] [default to null] +**WebAuthnStatus** | [***MfaEnrollmentStatus**](mfaEnrollmentStatus.md) | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv1/docs/MfaEnrollmentStatus.md b/jcapiv1/docs/MfaEnrollmentStatus.md new file mode 100644 index 0000000..9fb9c8a --- /dev/null +++ b/jcapiv1/docs/MfaEnrollmentStatus.md @@ -0,0 +1,8 @@ +# MfaEnrollmentStatus + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv1/docs/ModelError.md b/jcapiv1/docs/ModelError.md new file mode 100644 index 0000000..55e4d31 --- /dev/null +++ b/jcapiv1/docs/ModelError.md @@ -0,0 +1,11 @@ +# ModelError + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Code** | **int32** | HTTP status code | [optional] [default to null] +**Message** | **string** | Error message | [optional] [default to null] +**Status** | **string** | HTTP status description | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv1/docs/Organization.md b/jcapiv1/docs/Organization.md new file mode 100644 index 0000000..bafc313 --- /dev/null +++ b/jcapiv1/docs/Organization.md @@ -0,0 +1,21 @@ +# Organization + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Id** | **string** | | [optional] [default to null] +**AccountsReceivable** | **string** | | [optional] [default to null] +**Created** | **string** | | [optional] [default to null] +**DisplayName** | **string** | | [optional] [default to null] +**Entitlement** | [***Organizationentitlement**](organizationentitlement.md) | | [optional] [default to null] +**HasCreditCard** | **bool** | | [optional] [default to null] +**HasStripeCustomerId** | **bool** | | [optional] [default to null] +**LastEstimateCalculationTimeStamp** | **string** | | [optional] [default to null] +**LastSfdcSyncStatus** | [***interface{}**](interface{}.md) | | [optional] [default to null] +**LogoUrl** | **string** | | [optional] [default to null] +**Provider** | **string** | | [optional] [default to null] +**Settings** | [***Organizationsettings**](organizationsettings.md) | | [optional] [default to null] +**TotalBillingEstimate** | **int32** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv1/docs/Organizationentitlement.md b/jcapiv1/docs/Organizationentitlement.md new file mode 100644 index 0000000..acdfc0a --- /dev/null +++ b/jcapiv1/docs/Organizationentitlement.md @@ -0,0 +1,12 @@ +# Organizationentitlement + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**BillingModel** | **string** | | [optional] [default to null] +**EntitlementProducts** | [**[]OrganizationentitlementEntitlementProducts**](organizationentitlement_entitlementProducts.md) | | [optional] [default to null] +**IsManuallyBilled** | **bool** | | [optional] [default to null] +**PricePerUserSum** | **int32** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv1/docs/OrganizationentitlementEntitlementProducts.md b/jcapiv1/docs/OrganizationentitlementEntitlementProducts.md new file mode 100644 index 0000000..65bf79b --- /dev/null +++ b/jcapiv1/docs/OrganizationentitlementEntitlementProducts.md @@ -0,0 +1,16 @@ +# OrganizationentitlementEntitlementProducts + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**CommittedUsers** | **int32** | | [optional] [default to null] +**ContractType** | **string** | | [optional] [default to null] +**MaxUserCount** | **int32** | | [optional] [default to null] +**Name** | **string** | | [optional] [default to null] +**PricePerUser** | **int32** | | [optional] [default to null] +**ProductCategory** | **string** | | [optional] [default to null] +**ProductCode** | **string** | | [optional] [default to null] +**UncommittedUsers** | **int32** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv1/docs/OrganizationsApi.md b/jcapiv1/docs/OrganizationsApi.md new file mode 100644 index 0000000..55ecf80 --- /dev/null +++ b/jcapiv1/docs/OrganizationsApi.md @@ -0,0 +1,122 @@ +# {{classname}} + +All URIs are relative to *https://console.jumpcloud.com/api* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**OrganizationList**](OrganizationsApi.md#OrganizationList) | **Get** /organizations | Get Organization Details +[**OrganizationPut**](OrganizationsApi.md#OrganizationPut) | **Put** /organizations/{id} | Update an Organization +[**OrganizationsGet**](OrganizationsApi.md#OrganizationsGet) | **Get** /organizations/{id} | Get an Organization + +# **OrganizationList** +> Organizationslist OrganizationList(ctx, optional) +Get Organization Details + +This endpoint returns Organization Details. #### Sample Request ``` curl -X GET \\ https://console.jumpcloud.com/api/organizations \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **optional** | ***OrganizationsApiOrganizationListOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a OrganizationsApiOrganizationListOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **fields** | **optional.String**| Use a space seperated string of field parameters to include the data in the response. If omitted, the default list of fields will be returned. | + **filter** | **optional.String**| A filter to apply to the query. See the supported operators below. For more complex searches, see the related `/search/<domain>` endpoints, e.g. `/search/systems`. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: - `$eq` (equals) - `$ne` (does not equal) - `$gt` (is greater than) - `$gte` (is greater than or equal to) - `$lt` (is less than) - `$lte` (is less than or equal to) _Note: v1 operators differ from v2 operators._ _Note: For v1 operators, excluding the `$` will result in undefined behavior._ **value** = Populate with the value you want to search for. Is case sensitive. **Examples** - `GET /users?filter=username:$eq:testuser` - `GET /systemusers?filter=password_expiration_date:$lte:2021-10-24` - `GET /systemusers?filter=department:$ne:Accounting` - `GET /systems?filter[0]=firstname:$eq:foo&filter[1]=lastname:$eq:bar` - this will AND the filters together. - `GET /systems?filter[or][0]=lastname:$eq:foo&filter[or][1]=lastname:$eq:bar` - this will OR the filters together. | + **limit** | **optional.Int32**| The number of records to return at once. Limited to 100. | [default to 10] + **search** | **optional.String**| A nested object containing a `searchTerm` string or array of strings and a list of `fields` to search on. | + **skip** | **optional.Int32**| The offset into the records to return. | [default to 0] + **sort** | **optional.String**| Use space separated sort parameters to sort the collection. Default sort is ascending. Prefix with `-` to sort descending. | + +### Return type + +[**Organizationslist**](organizationslist.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **OrganizationPut** +> Organization OrganizationPut(ctx, id, optional) +Update an Organization + +This endpoint allows you to update an Organization. Note: `passwordPolicy` settings are only used when `passwordCompliance` is set to \"custom\". We discourage the use of non-custom passwordCompliance values. `hasStripeCustomerId` is deprecated and will be removed. #### Sample Request ``` curl -X PUT https://console.jumpcloud.com/api/organizations/{OrganizationID} \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"settings\": { \"contactName\": \"Admin Name\", \"contactEmail\": \"admin@company.com\", \"systemUsersCanEdit\":true, \"passwordPolicy\": { \"enableMaxHistory\": true, \"maxHistory\": 3 } } }' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **id** | **string**| | + **optional** | ***OrganizationsApiOrganizationPutOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a OrganizationsApiOrganizationPutOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **body** | [**optional.Interface of OrganizationsIdBody**](OrganizationsIdBody.md)| | + +### Return type + +[**Organization**](organization.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **OrganizationsGet** +> Organization OrganizationsGet(ctx, id, optional) +Get an Organization + +This endpoint returns a particular Organization. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/organizations/{OrganizationID} \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **id** | **string**| | + **optional** | ***OrganizationsApiOrganizationsGetOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a OrganizationsApiOrganizationsGetOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **fields** | **optional.String**| Use a space seperated string of field parameters to include the data in the response. If omitted, the default list of fields will be returned. | + **filter** | **optional.String**| A filter to apply to the query. See the supported operators below. For more complex searches, see the related `/search/<domain>` endpoints, e.g. `/search/systems`. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: - `$eq` (equals) - `$ne` (does not equal) - `$gt` (is greater than) - `$gte` (is greater than or equal to) - `$lt` (is less than) - `$lte` (is less than or equal to) _Note: v1 operators differ from v2 operators._ _Note: For v1 operators, excluding the `$` will result in undefined behavior._ **value** = Populate with the value you want to search for. Is case sensitive. **Examples** - `GET /users?filter=username:$eq:testuser` - `GET /systemusers?filter=password_expiration_date:$lte:2021-10-24` - `GET /systemusers?filter=department:$ne:Accounting` - `GET /systems?filter[0]=firstname:$eq:foo&filter[1]=lastname:$eq:bar` - this will AND the filters together. - `GET /systems?filter[or][0]=lastname:$eq:foo&filter[or][1]=lastname:$eq:bar` - this will OR the filters together. | + +### Return type + +[**Organization**](organization.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/jcapiv1/docs/OrganizationsIdBody.md b/jcapiv1/docs/OrganizationsIdBody.md new file mode 100644 index 0000000..7b1eb3c --- /dev/null +++ b/jcapiv1/docs/OrganizationsIdBody.md @@ -0,0 +1,9 @@ +# OrganizationsIdBody + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Settings** | [***Organizationsettingsput**](organizationsettingsput.md) | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv1/docs/Organizationsettings.md b/jcapiv1/docs/Organizationsettings.md new file mode 100644 index 0000000..258c698 --- /dev/null +++ b/jcapiv1/docs/Organizationsettings.md @@ -0,0 +1,38 @@ +# Organizationsettings + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**AgentVersion** | **string** | | [optional] [default to null] +**BetaFeatures** | [***interface{}**](interface{}.md) | | [optional] [default to null] +**ContactEmail** | **string** | | [optional] [default to null] +**ContactName** | **string** | | [optional] [default to null] +**DeviceIdentificationEnabled** | **bool** | | [optional] [default to null] +**DisableCommandRunner** | **bool** | | [optional] [default to null] +**DisableGoogleLogin** | **bool** | | [optional] [default to null] +**DisableLdap** | **bool** | | [optional] [default to null] +**DisableUM** | **bool** | | [optional] [default to null] +**DisplayPreferences** | [***OrganizationsettingsDisplayPreferences**](organizationsettings_displayPreferences.md) | | [optional] [default to null] +**DuplicateLDAPGroups** | **bool** | | [optional] [default to null] +**EmailDisclaimer** | **string** | | [optional] [default to null] +**EnableGoogleApps** | **bool** | | [optional] [default to null] +**EnableManagedUID** | **bool** | | [optional] [default to null] +**EnableO365** | **bool** | | [optional] [default to null] +**EnableUserPortalAgentInstall** | **bool** | | [optional] [default to null] +**Features** | [***OrganizationsettingsFeatures**](organizationsettings_features.md) | | [optional] [default to null] +**GrowthData** | [***interface{}**](interface{}.md) | Object containing Optimizely experimentIds and states corresponding to them | [optional] [default to null] +**Logo** | **string** | | [optional] [default to null] +**Name** | **string** | | [optional] [default to null] +**NewSystemUserStateDefaults** | [***OrganizationsettingsNewSystemUserStateDefaults**](organizationsettings_newSystemUserStateDefaults.md) | | [optional] [default to null] +**PasswordCompliance** | **string** | | [optional] [default to null] +**PasswordPolicy** | [***OrganizationsettingsPasswordPolicy**](organizationsettings_passwordPolicy.md) | | [optional] [default to null] +**PendingDelete** | **bool** | | [optional] [default to null] +**ShowIntro** | **bool** | | [optional] [default to null] +**SystemUserPasswordExpirationInDays** | **int32** | | [optional] [default to null] +**SystemUsersCanEdit** | **bool** | | [optional] [default to null] +**SystemUsersCap** | **int32** | | [optional] [default to null] +**TrustedAppConfig** | [***TrustedappConfigGet**](trustedappConfigGet.md) | | [optional] [default to null] +**UserPortal** | [***OrganizationsettingsUserPortal**](organizationsettings_userPortal.md) | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv1/docs/OrganizationsettingsDisplayPreferences.md b/jcapiv1/docs/OrganizationsettingsDisplayPreferences.md new file mode 100644 index 0000000..beb9583 --- /dev/null +++ b/jcapiv1/docs/OrganizationsettingsDisplayPreferences.md @@ -0,0 +1,9 @@ +# OrganizationsettingsDisplayPreferences + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**OrgInsights** | [***OrganizationsettingsDisplayPreferencesOrgInsights**](organizationsettings_displayPreferences_orgInsights.md) | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv1/docs/OrganizationsettingsDisplayPreferencesOrgInsights.md b/jcapiv1/docs/OrganizationsettingsDisplayPreferencesOrgInsights.md new file mode 100644 index 0000000..84be605 --- /dev/null +++ b/jcapiv1/docs/OrganizationsettingsDisplayPreferencesOrgInsights.md @@ -0,0 +1,27 @@ +# OrganizationsettingsDisplayPreferencesOrgInsights + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ApplicationsUsage** | [***OrganizationsettingsDisplayPreferencesOrgInsightsApplicationsUsage**](organizationsettings_displayPreferences_orgInsights_applicationsUsage.md) | | [optional] [default to null] +**ConsoleStats** | [***OrganizationsettingsDisplayPreferencesOrgInsightsConsoleStats**](organizationsettings_displayPreferences_orgInsights_consoleStats.md) | | [optional] [default to null] +**DeviceNotifications** | [***OrganizationsettingsDisplayPreferencesOrgInsightsDeviceNotifications**](organizationsettings_displayPreferences_orgInsights_deviceNotifications.md) | | [optional] [default to null] +**DiskEncryption** | [***OrganizationsettingsDisplayPreferencesOrgInsightsApplicationsUsage**](organizationsettings_displayPreferences_orgInsights_applicationsUsage.md) | | [optional] [default to null] +**ExpiredPasswords** | [***OrganizationsettingsDisplayPreferencesOrgInsightsApplicationsUsage**](organizationsettings_displayPreferences_orgInsights_applicationsUsage.md) | | [optional] [default to null] +**FailedCommands** | [***OrganizationsettingsDisplayPreferencesOrgInsightsApplicationsUsage**](organizationsettings_displayPreferences_orgInsights_applicationsUsage.md) | | [optional] [default to null] +**FailedConfigurations** | [***OrganizationsettingsDisplayPreferencesOrgInsightsApplicationsUsage**](organizationsettings_displayPreferences_orgInsights_applicationsUsage.md) | | [optional] [default to null] +**Fundamentals** | [***OrganizationsettingsDisplayPreferencesOrgInsightsApplicationsUsage**](organizationsettings_displayPreferences_orgInsights_applicationsUsage.md) | | [optional] [default to null] +**JcUniversity** | [***OrganizationsettingsDisplayPreferencesOrgInsightsApplicationsUsage**](organizationsettings_displayPreferences_orgInsights_applicationsUsage.md) | | [optional] [default to null] +**LearningCenter** | [***OrganizationsettingsDisplayPreferencesOrgInsightsApplicationsUsage**](organizationsettings_displayPreferences_orgInsights_applicationsUsage.md) | | [optional] [default to null] +**MdmCertificateExpirations** | [***OrganizationsettingsDisplayPreferencesOrgInsightsApplicationsUsage**](organizationsettings_displayPreferences_orgInsights_applicationsUsage.md) | | [optional] [default to null] +**MfaEnrolledDevices** | [***OrganizationsettingsDisplayPreferencesOrgInsightsApplicationsUsage**](organizationsettings_displayPreferences_orgInsights_applicationsUsage.md) | | [optional] [default to null] +**NewOSReleases** | [***OrganizationsettingsDisplayPreferencesOrgInsightsApplicationsUsage**](organizationsettings_displayPreferences_orgInsights_applicationsUsage.md) | | [optional] [default to null] +**NewUsers** | [***OrganizationsettingsDisplayPreferencesOrgInsightsApplicationsUsage**](organizationsettings_displayPreferences_orgInsights_applicationsUsage.md) | | [optional] [default to null] +**OfficeHours** | [***OrganizationsettingsDisplayPreferencesOrgInsightsApplicationsUsage**](organizationsettings_displayPreferences_orgInsights_applicationsUsage.md) | | [optional] [default to null] +**PendingCommands** | [***OrganizationsettingsDisplayPreferencesOrgInsightsApplicationsUsage**](organizationsettings_displayPreferences_orgInsights_applicationsUsage.md) | | [optional] [default to null] +**UpcomingPasswordExpiration** | [***OrganizationsettingsDisplayPreferencesOrgInsightsApplicationsUsage**](organizationsettings_displayPreferences_orgInsights_applicationsUsage.md) | | [optional] [default to null] +**UserLockouts** | [***OrganizationsettingsDisplayPreferencesOrgInsightsApplicationsUsage**](organizationsettings_displayPreferences_orgInsights_applicationsUsage.md) | | [optional] [default to null] +**UserNotifications** | [***OrganizationsettingsDisplayPreferencesOrgInsightsUserNotifications**](organizationsettings_displayPreferences_orgInsights_userNotifications.md) | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv1/docs/OrganizationsettingsDisplayPreferencesOrgInsightsApplicationsUsage.md b/jcapiv1/docs/OrganizationsettingsDisplayPreferencesOrgInsightsApplicationsUsage.md new file mode 100644 index 0000000..26fae70 --- /dev/null +++ b/jcapiv1/docs/OrganizationsettingsDisplayPreferencesOrgInsightsApplicationsUsage.md @@ -0,0 +1,9 @@ +# OrganizationsettingsDisplayPreferencesOrgInsightsApplicationsUsage + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Visible** | **bool** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv1/docs/OrganizationsettingsDisplayPreferencesOrgInsightsConsoleStats.md b/jcapiv1/docs/OrganizationsettingsDisplayPreferencesOrgInsightsConsoleStats.md new file mode 100644 index 0000000..7c769f7 --- /dev/null +++ b/jcapiv1/docs/OrganizationsettingsDisplayPreferencesOrgInsightsConsoleStats.md @@ -0,0 +1,13 @@ +# OrganizationsettingsDisplayPreferencesOrgInsightsConsoleStats + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**TotalApplications** | [***OrganizationsettingsDisplayPreferencesOrgInsightsApplicationsUsage**](organizationsettings_displayPreferences_orgInsights_applicationsUsage.md) | | [optional] [default to null] +**TotalConfigurations** | [***OrganizationsettingsDisplayPreferencesOrgInsightsApplicationsUsage**](organizationsettings_displayPreferences_orgInsights_applicationsUsage.md) | | [optional] [default to null] +**TotalDevices** | [***OrganizationsettingsDisplayPreferencesOrgInsightsApplicationsUsage**](organizationsettings_displayPreferences_orgInsights_applicationsUsage.md) | | [optional] [default to null] +**TotalGroups** | [***OrganizationsettingsDisplayPreferencesOrgInsightsApplicationsUsage**](organizationsettings_displayPreferences_orgInsights_applicationsUsage.md) | | [optional] [default to null] +**TotalUsers** | [***OrganizationsettingsDisplayPreferencesOrgInsightsApplicationsUsage**](organizationsettings_displayPreferences_orgInsights_applicationsUsage.md) | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv1/docs/OrganizationsettingsDisplayPreferencesOrgInsightsDeviceNotifications.md b/jcapiv1/docs/OrganizationsettingsDisplayPreferencesOrgInsightsDeviceNotifications.md new file mode 100644 index 0000000..76b0351 --- /dev/null +++ b/jcapiv1/docs/OrganizationsettingsDisplayPreferencesOrgInsightsDeviceNotifications.md @@ -0,0 +1,14 @@ +# OrganizationsettingsDisplayPreferencesOrgInsightsDeviceNotifications + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**AgentOutOfDateMetric** | [***OrganizationsettingsDisplayPreferencesOrgInsightsApplicationsUsage**](organizationsettings_displayPreferences_orgInsights_applicationsUsage.md) | | [optional] [default to null] +**InactiveMetric** | [***OrganizationsettingsDisplayPreferencesOrgInsightsApplicationsUsage**](organizationsettings_displayPreferences_orgInsights_applicationsUsage.md) | | [optional] [default to null] +**UptimeMetric** | [***OrganizationsettingsDisplayPreferencesOrgInsightsApplicationsUsage**](organizationsettings_displayPreferences_orgInsights_applicationsUsage.md) | | [optional] [default to null] +**Visible** | **bool** | | [optional] [default to null] +**WithoutPoliciesMetric** | [***OrganizationsettingsDisplayPreferencesOrgInsightsApplicationsUsage**](organizationsettings_displayPreferences_orgInsights_applicationsUsage.md) | | [optional] [default to null] +**WithoutUsersMetric** | [***OrganizationsettingsDisplayPreferencesOrgInsightsApplicationsUsage**](organizationsettings_displayPreferences_orgInsights_applicationsUsage.md) | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv1/docs/OrganizationsettingsDisplayPreferencesOrgInsightsUserNotifications.md b/jcapiv1/docs/OrganizationsettingsDisplayPreferencesOrgInsightsUserNotifications.md new file mode 100644 index 0000000..3166c62 --- /dev/null +++ b/jcapiv1/docs/OrganizationsettingsDisplayPreferencesOrgInsightsUserNotifications.md @@ -0,0 +1,14 @@ +# OrganizationsettingsDisplayPreferencesOrgInsightsUserNotifications + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**UserWithAdminSudoPasswordlessAccess** | [***OrganizationsettingsDisplayPreferencesOrgInsightsApplicationsUsage**](organizationsettings_displayPreferences_orgInsights_applicationsUsage.md) | | [optional] [default to null] +**UsersWithAdminSudoAccess** | [***OrganizationsettingsDisplayPreferencesOrgInsightsApplicationsUsage**](organizationsettings_displayPreferences_orgInsights_applicationsUsage.md) | | [optional] [default to null] +**UsersWithSambaAccess** | [***OrganizationsettingsDisplayPreferencesOrgInsightsApplicationsUsage**](organizationsettings_displayPreferences_orgInsights_applicationsUsage.md) | | [optional] [default to null] +**UsersWithoutDevices** | [***OrganizationsettingsDisplayPreferencesOrgInsightsApplicationsUsage**](organizationsettings_displayPreferences_orgInsights_applicationsUsage.md) | | [optional] [default to null] +**UsersWithoutPassword** | [***OrganizationsettingsDisplayPreferencesOrgInsightsApplicationsUsage**](organizationsettings_displayPreferences_orgInsights_applicationsUsage.md) | | [optional] [default to null] +**Visible** | **bool** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv1/docs/OrganizationsettingsFeatures.md b/jcapiv1/docs/OrganizationsettingsFeatures.md new file mode 100644 index 0000000..5964da4 --- /dev/null +++ b/jcapiv1/docs/OrganizationsettingsFeatures.md @@ -0,0 +1,11 @@ +# OrganizationsettingsFeatures + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**DirectoryInsights** | [***OrganizationsettingsFeaturesDirectoryInsights**](organizationsettings_features_directoryInsights.md) | | [optional] [default to null] +**DirectoryInsightsPremium** | [***OrganizationsettingsFeaturesDirectoryInsightsPremium**](organizationsettings_features_directoryInsightsPremium.md) | | [optional] [default to null] +**SystemInsights** | [***OrganizationsettingsFeaturesSystemInsights**](organizationsettings_features_systemInsights.md) | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv1/docs/OrganizationsettingsFeaturesDirectoryInsights.md b/jcapiv1/docs/OrganizationsettingsFeaturesDirectoryInsights.md new file mode 100644 index 0000000..2d8aec3 --- /dev/null +++ b/jcapiv1/docs/OrganizationsettingsFeaturesDirectoryInsights.md @@ -0,0 +1,9 @@ +# OrganizationsettingsFeaturesDirectoryInsights + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Enabled** | **bool** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv1/docs/OrganizationsettingsFeaturesDirectoryInsightsPremium.md b/jcapiv1/docs/OrganizationsettingsFeaturesDirectoryInsightsPremium.md new file mode 100644 index 0000000..248836c --- /dev/null +++ b/jcapiv1/docs/OrganizationsettingsFeaturesDirectoryInsightsPremium.md @@ -0,0 +1,11 @@ +# OrganizationsettingsFeaturesDirectoryInsightsPremium + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**CreatedAt** | **string** | | [optional] [default to null] +**Enabled** | **bool** | | [optional] [default to null] +**UpdatedAt** | **string** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv1/docs/OrganizationsettingsFeaturesSystemInsights.md b/jcapiv1/docs/OrganizationsettingsFeaturesSystemInsights.md new file mode 100644 index 0000000..8579187 --- /dev/null +++ b/jcapiv1/docs/OrganizationsettingsFeaturesSystemInsights.md @@ -0,0 +1,14 @@ +# OrganizationsettingsFeaturesSystemInsights + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**CreatedAt** | **string** | | [optional] [default to null] +**EnableNewDarwin** | **bool** | | [optional] [default to null] +**EnableNewLinux** | **bool** | | [optional] [default to null] +**EnableNewWindows** | **bool** | | [optional] [default to null] +**Enabled** | **bool** | | [optional] [default to null] +**UpdatedAt** | **string** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv1/docs/OrganizationsettingsNewSystemUserStateDefaults.md b/jcapiv1/docs/OrganizationsettingsNewSystemUserStateDefaults.md new file mode 100644 index 0000000..0c946d6 --- /dev/null +++ b/jcapiv1/docs/OrganizationsettingsNewSystemUserStateDefaults.md @@ -0,0 +1,11 @@ +# OrganizationsettingsNewSystemUserStateDefaults + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ApplicationImport** | **string** | The default user state for a user created using the [Bulk Users Create](https://docs.jumpcloud.com/api/2.0/index.html#operation/bulk_usersCreate) endpoint. See endpoint documentation for more details. | [optional] [default to null] +**CsvImport** | **string** | The default user state for a user created using the [Bulk Users Create](https://docs.jumpcloud.com/api/2.0/index.html#operation/bulk_usersCreate) endpoint. See endpoint documentation for more details. | [optional] [default to null] +**ManualEntry** | **string** | The default state for a user that is created using the [Create a system user](https://docs.jumpcloud.com/api/1.0/index.html#operation/systemusers_post) endpoint. See endpoint documentation for more details. | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv1/docs/OrganizationsettingsPasswordPolicy.md b/jcapiv1/docs/OrganizationsettingsPasswordPolicy.md new file mode 100644 index 0000000..7a42e16 --- /dev/null +++ b/jcapiv1/docs/OrganizationsettingsPasswordPolicy.md @@ -0,0 +1,34 @@ +# OrganizationsettingsPasswordPolicy + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**AllowUsernameSubstring** | **bool** | | [optional] [default to null] +**DaysAfterExpirationToSelfRecover** | **int32** | Deprecated field used for the legacy grace period feature. | [optional] [default to null] +**DaysBeforeExpirationToForceReset** | **int32** | | [optional] [default to null] +**EffectiveDate** | **string** | | [optional] [default to null] +**EnableDaysAfterExpirationToSelfRecover** | **bool** | | [optional] [default to null] +**EnableDaysBeforeExpirationToForceReset** | **bool** | | [optional] [default to null] +**EnableLockoutTimeInSeconds** | **bool** | | [optional] [default to null] +**EnableMaxHistory** | **bool** | | [optional] [default to null] +**EnableMaxLoginAttempts** | **bool** | | [optional] [default to null] +**EnableMinChangePeriodInDays** | **bool** | | [optional] [default to null] +**EnableMinLength** | **bool** | | [optional] [default to null] +**EnablePasswordExpirationInDays** | **bool** | | [optional] [default to null] +**EnableRecoveryEmail** | **bool** | | [optional] [default to null] +**EnableResetLockoutCounter** | **bool** | | [optional] [default to null] +**GracePeriodDate** | **string** | | [optional] [default to null] +**LockoutTimeInSeconds** | **int32** | | [optional] [default to null] +**MaxHistory** | **int32** | | [optional] [default to null] +**MaxLoginAttempts** | **int32** | | [optional] [default to null] +**MinChangePeriodInDays** | **int32** | | [optional] [default to null] +**MinLength** | **int32** | | [optional] [default to null] +**NeedsLowercase** | **bool** | | [optional] [default to null] +**NeedsNumeric** | **bool** | | [optional] [default to null] +**NeedsSymbolic** | **bool** | | [optional] [default to null] +**NeedsUppercase** | **bool** | | [optional] [default to null] +**PasswordExpirationInDays** | **int32** | | [optional] [default to null] +**ResetLockoutCounterMinutes** | **int32** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv1/docs/OrganizationsettingsUserPortal.md b/jcapiv1/docs/OrganizationsettingsUserPortal.md new file mode 100644 index 0000000..7c5c2a9 --- /dev/null +++ b/jcapiv1/docs/OrganizationsettingsUserPortal.md @@ -0,0 +1,9 @@ +# OrganizationsettingsUserPortal + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**IdleSessionDurationMinutes** | **int32** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv1/docs/Organizationsettingsput.md b/jcapiv1/docs/Organizationsettingsput.md new file mode 100644 index 0000000..5275d16 --- /dev/null +++ b/jcapiv1/docs/Organizationsettingsput.md @@ -0,0 +1,30 @@ +# Organizationsettingsput + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ContactEmail** | **string** | | [optional] [default to null] +**ContactName** | **string** | | [optional] [default to null] +**DeviceIdentificationEnabled** | **bool** | | [optional] [default to null] +**DisableGoogleLogin** | **bool** | | [optional] [default to null] +**DisableLdap** | **bool** | | [optional] [default to null] +**DisableUM** | **bool** | | [optional] [default to null] +**DuplicateLDAPGroups** | **bool** | | [optional] [default to null] +**EmailDisclaimer** | **string** | | [optional] [default to null] +**EnableManagedUID** | **bool** | | [optional] [default to null] +**Features** | [***OrganizationsettingsFeatures**](organizationsettings_features.md) | | [optional] [default to null] +**GrowthData** | [***interface{}**](interface{}.md) | Object containing Optimizely experimentIds and states corresponding to them | [optional] [default to null] +**Logo** | **string** | | [optional] [default to null] +**Name** | **string** | | [optional] [default to null] +**NewSystemUserStateDefaults** | [***OrganizationsettingsputNewSystemUserStateDefaults**](organizationsettingsput_newSystemUserStateDefaults.md) | | [optional] [default to null] +**PasswordCompliance** | **string** | | [optional] [default to null] +**PasswordPolicy** | [***OrganizationsettingsputPasswordPolicy**](organizationsettingsput_passwordPolicy.md) | | [optional] [default to null] +**ShowIntro** | **bool** | | [optional] [default to null] +**SystemUserPasswordExpirationInDays** | **int32** | | [optional] [default to null] +**SystemUsersCanEdit** | **bool** | | [optional] [default to null] +**SystemUsersCap** | **int32** | | [optional] [default to null] +**TrustedAppConfig** | [***TrustedappConfigPut**](trustedappConfigPut.md) | | [optional] [default to null] +**UserPortal** | [***OrganizationsettingsUserPortal**](organizationsettings_userPortal.md) | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv1/docs/OrganizationsettingsputNewSystemUserStateDefaults.md b/jcapiv1/docs/OrganizationsettingsputNewSystemUserStateDefaults.md new file mode 100644 index 0000000..350eb95 --- /dev/null +++ b/jcapiv1/docs/OrganizationsettingsputNewSystemUserStateDefaults.md @@ -0,0 +1,11 @@ +# OrganizationsettingsputNewSystemUserStateDefaults + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ApplicationImport** | **string** | | [optional] [default to null] +**CsvImport** | **string** | | [optional] [default to null] +**ManualEntry** | **string** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv1/docs/OrganizationsettingsputPasswordPolicy.md b/jcapiv1/docs/OrganizationsettingsputPasswordPolicy.md new file mode 100644 index 0000000..65a1c9d --- /dev/null +++ b/jcapiv1/docs/OrganizationsettingsputPasswordPolicy.md @@ -0,0 +1,31 @@ +# OrganizationsettingsputPasswordPolicy + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**AllowUsernameSubstring** | **bool** | | [optional] [default to null] +**DaysAfterExpirationToSelfRecover** | **int32** | Deprecated field used for the legacy grace period feature. | [optional] [default to null] +**DaysBeforeExpirationToForceReset** | **int32** | | [optional] [default to null] +**EffectiveDate** | **string** | | [optional] [default to null] +**EnableDaysAfterExpirationToSelfRecover** | **bool** | | [optional] [default to null] +**EnableDaysBeforeExpirationToForceReset** | **bool** | | [optional] [default to null] +**EnableLockoutTimeInSeconds** | **bool** | | [optional] [default to null] +**EnableMaxHistory** | **bool** | | [optional] [default to null] +**EnableMaxLoginAttempts** | **bool** | | [optional] [default to null] +**EnableMinChangePeriodInDays** | **bool** | | [optional] [default to null] +**EnableMinLength** | **bool** | | [optional] [default to null] +**EnablePasswordExpirationInDays** | **bool** | | [optional] [default to null] +**GracePeriodDate** | **string** | | [optional] [default to null] +**LockoutTimeInSeconds** | **int32** | | [optional] [default to null] +**MaxHistory** | **int32** | | [optional] [default to null] +**MaxLoginAttempts** | **int32** | | [optional] [default to null] +**MinChangePeriodInDays** | **int32** | | [optional] [default to null] +**MinLength** | **int32** | | [optional] [default to null] +**NeedsLowercase** | **bool** | | [optional] [default to null] +**NeedsNumeric** | **bool** | | [optional] [default to null] +**NeedsSymbolic** | **bool** | | [optional] [default to null] +**NeedsUppercase** | **bool** | | [optional] [default to null] +**PasswordExpirationInDays** | **int32** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/v1/docs/Organizationslist.md b/jcapiv1/docs/Organizationslist.md similarity index 99% rename from v1/docs/Organizationslist.md rename to jcapiv1/docs/Organizationslist.md index 9e31136..4ed3565 100644 --- a/v1/docs/Organizationslist.md +++ b/jcapiv1/docs/Organizationslist.md @@ -8,4 +8,3 @@ Name | Type | Description | Notes [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/v1/docs/OrganizationslistResults.md b/jcapiv1/docs/OrganizationslistResults.md similarity index 99% rename from v1/docs/OrganizationslistResults.md rename to jcapiv1/docs/OrganizationslistResults.md index ed24047..9741893 100644 --- a/v1/docs/OrganizationslistResults.md +++ b/jcapiv1/docs/OrganizationslistResults.md @@ -9,4 +9,3 @@ Name | Type | Description | Notes [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/jcapiv1/docs/RadiusServersApi.md b/jcapiv1/docs/RadiusServersApi.md new file mode 100644 index 0000000..c19276e --- /dev/null +++ b/jcapiv1/docs/RadiusServersApi.md @@ -0,0 +1,195 @@ +# {{classname}} + +All URIs are relative to *https://console.jumpcloud.com/api* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**RadiusServersDelete**](RadiusServersApi.md#RadiusServersDelete) | **Delete** /radiusservers/{id} | Delete Radius Server +[**RadiusServersGet**](RadiusServersApi.md#RadiusServersGet) | **Get** /radiusservers/{id} | Get Radius Server +[**RadiusServersList**](RadiusServersApi.md#RadiusServersList) | **Get** /radiusservers | List Radius Servers +[**RadiusServersPost**](RadiusServersApi.md#RadiusServersPost) | **Post** /radiusservers | Create a Radius Server +[**RadiusServersPut**](RadiusServersApi.md#RadiusServersPut) | **Put** /radiusservers/{id} | Update Radius Servers + +# **RadiusServersDelete** +> Radiusserverput RadiusServersDelete(ctx, id, optional) +Delete Radius Server + +This endpoint allows you to delete RADIUS servers in your organization. ``` curl -X DELETE https://console.jumpcloud.com/api/radiusservers/{ServerID} \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **id** | **string**| | + **optional** | ***RadiusServersApiRadiusServersDeleteOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a RadiusServersApiRadiusServersDeleteOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **xOrgId** | **optional.String**| | + +### Return type + +[**Radiusserverput**](radiusserverput.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **RadiusServersGet** +> Radiusserver RadiusServersGet(ctx, id, optional) +Get Radius Server + +This endpoint allows you to get a RADIUS server in your organization. #### ``` curl -X PUT https://console.jumpcloud.com/api/radiusservers/{ServerID} \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **id** | **string**| | + **optional** | ***RadiusServersApiRadiusServersGetOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a RadiusServersApiRadiusServersGetOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **xOrgId** | **optional.String**| | + +### Return type + +[**Radiusserver**](radiusserver.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **RadiusServersList** +> Radiusserverslist RadiusServersList(ctx, optional) +List Radius Servers + +This endpoint allows you to get a list of all RADIUS servers in your organization. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/radiusservers/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **optional** | ***RadiusServersApiRadiusServersListOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a RadiusServersApiRadiusServersListOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **fields** | **optional.String**| Use a space seperated string of field parameters to include the data in the response. If omitted, the default list of fields will be returned. | + **filter** | **optional.String**| A filter to apply to the query. See the supported operators below. For more complex searches, see the related `/search/<domain>` endpoints, e.g. `/search/systems`. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: - `$eq` (equals) - `$ne` (does not equal) - `$gt` (is greater than) - `$gte` (is greater than or equal to) - `$lt` (is less than) - `$lte` (is less than or equal to) _Note: v1 operators differ from v2 operators._ _Note: For v1 operators, excluding the `$` will result in undefined behavior._ **value** = Populate with the value you want to search for. Is case sensitive. **Examples** - `GET /users?filter=username:$eq:testuser` - `GET /systemusers?filter=password_expiration_date:$lte:2021-10-24` - `GET /systemusers?filter=department:$ne:Accounting` - `GET /systems?filter[0]=firstname:$eq:foo&filter[1]=lastname:$eq:bar` - this will AND the filters together. - `GET /systems?filter[or][0]=lastname:$eq:foo&filter[or][1]=lastname:$eq:bar` - this will OR the filters together. | + **limit** | **optional.Int32**| The number of records to return at once. Limited to 100. | [default to 10] + **skip** | **optional.Int32**| The offset into the records to return. | [default to 0] + **sort** | **optional.String**| Use space separated sort parameters to sort the collection. Default sort is ascending. Prefix with `-` to sort descending. | + **xOrgId** | **optional.String**| | + +### Return type + +[**Radiusserverslist**](radiusserverslist.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **RadiusServersPost** +> Radiusserver RadiusServersPost(ctx, optional) +Create a Radius Server + +This endpoint allows you to create RADIUS servers in your organization. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/radiusservers/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"name\": \"{test_radius}\", \"networkSourceIp\": \"{0.0.0.0}\", \"sharedSecret\":\"{secretpassword}\", \"userLockoutAction\": \"REMOVE\", \"userPasswordExpirationAction\": \"MAINTAIN\" }' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **optional** | ***RadiusServersApiRadiusServersPostOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a RadiusServersApiRadiusServersPostOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**optional.Interface of Radiusserverpost**](Radiusserverpost.md)| | + **xOrgId** | **optional.**| | + +### Return type + +[**Radiusserver**](radiusserver.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **RadiusServersPut** +> Radiusserverput RadiusServersPut(ctx, id, optional) +Update Radius Servers + +This endpoint allows you to update RADIUS servers in your organization. #### ``` curl -X PUT https://console.jumpcloud.com/api/radiusservers/{ServerID} \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"name\": \"{name_update}\", \"networkSourceIp\": \"{0.0.0.0}\", \"sharedSecret\": \"{secret_password}\", \"userLockoutAction\": \"REMOVE\", \"userPasswordExpirationAction\": \"MAINTAIN\" }' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **id** | **string**| | + **optional** | ***RadiusServersApiRadiusServersPutOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a RadiusServersApiRadiusServersPutOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **body** | [**optional.Interface of RadiusserversIdBody**](RadiusserversIdBody.md)| | + **xOrgId** | **optional.**| | + +### Return type + +[**Radiusserverput**](radiusserverput.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/v1/docs/Radiusserver.md b/jcapiv1/docs/Radiusserver.md similarity index 78% rename from v1/docs/Radiusserver.md rename to jcapiv1/docs/Radiusserver.md index c186c4d..67f4f91 100644 --- a/v1/docs/Radiusserver.md +++ b/jcapiv1/docs/Radiusserver.md @@ -4,6 +4,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **Id** | **string** | | [optional] [default to null] +**AuthIdp** | **string** | | [optional] [default to null] +**DeviceCertEnabled** | **bool** | | [optional] [default to null] **Mfa** | **string** | | [optional] [default to null] **Name** | **string** | | [optional] [default to null] **NetworkSourceIp** | **string** | | [optional] [default to null] @@ -11,9 +13,10 @@ Name | Type | Description | Notes **SharedSecret** | **string** | | [optional] [default to null] **TagNames** | **[]string** | | [optional] [default to null] **Tags** | **[]string** | | [optional] [default to null] +**UserCertEnabled** | **bool** | | [optional] [default to null] **UserLockoutAction** | **string** | | [optional] [default to null] +**UserPasswordEnabled** | **bool** | | [optional] [default to null] **UserPasswordExpirationAction** | **string** | | [optional] [default to null] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/jcapiv1/docs/Radiusserverpost.md b/jcapiv1/docs/Radiusserverpost.md new file mode 100644 index 0000000..65f8807 --- /dev/null +++ b/jcapiv1/docs/Radiusserverpost.md @@ -0,0 +1,19 @@ +# Radiusserverpost + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**AuthIdp** | **string** | | [optional] [default to null] +**DeviceCertEnabled** | **bool** | | [optional] [default to null] +**Mfa** | **string** | | [optional] [default to null] +**Name** | **string** | | [default to null] +**NetworkSourceIp** | **string** | | [default to null] +**SharedSecret** | **string** | RADIUS shared secret between the server and client. | [default to null] +**TagNames** | **[]string** | | [optional] [default to null] +**UserCertEnabled** | **bool** | | [optional] [default to null] +**UserLockoutAction** | **string** | | [optional] [default to null] +**UserPasswordEnabled** | **bool** | | [optional] [default to null] +**UserPasswordExpirationAction** | **string** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv1/docs/Radiusserverput.md b/jcapiv1/docs/Radiusserverput.md new file mode 100644 index 0000000..853df8a --- /dev/null +++ b/jcapiv1/docs/Radiusserverput.md @@ -0,0 +1,19 @@ +# Radiusserverput + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Id** | **string** | | [optional] [default to null] +**AuthIdp** | **string** | | [optional] [default to null] +**DeviceCertEnabled** | **bool** | | [optional] [default to null] +**Mfa** | **string** | | [optional] [default to null] +**Name** | **string** | | [optional] [default to null] +**NetworkSourceIp** | **string** | | [optional] [default to null] +**TagNames** | **[]string** | | [optional] [default to null] +**UserCertEnabled** | **bool** | | [optional] [default to null] +**UserLockoutAction** | **string** | | [optional] [default to null] +**UserPasswordEnabled** | **bool** | | [optional] [default to null] +**UserPasswordExpirationAction** | **string** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv1/docs/RadiusserversIdBody.md b/jcapiv1/docs/RadiusserversIdBody.md new file mode 100644 index 0000000..9593375 --- /dev/null +++ b/jcapiv1/docs/RadiusserversIdBody.md @@ -0,0 +1,18 @@ +# RadiusserversIdBody + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**DeviceCertEnabled** | **bool** | | [optional] [default to null] +**Mfa** | **string** | | [optional] [default to null] +**Name** | **string** | | [default to null] +**NetworkSourceIp** | **string** | | [default to null] +**SharedSecret** | **string** | | [default to null] +**Tags** | **[]string** | | [optional] [default to null] +**UserCertEnabled** | **bool** | | [optional] [default to null] +**UserLockoutAction** | **string** | | [optional] [default to null] +**UserPasswordEnabled** | **bool** | | [optional] [default to null] +**UserPasswordExpirationAction** | **string** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/v1/docs/Radiusserverslist.md b/jcapiv1/docs/Radiusserverslist.md similarity index 99% rename from v1/docs/Radiusserverslist.md rename to jcapiv1/docs/Radiusserverslist.md index 43f0a5e..ec14bb4 100644 --- a/v1/docs/Radiusserverslist.md +++ b/jcapiv1/docs/Radiusserverslist.md @@ -8,4 +8,3 @@ Name | Type | Description | Notes [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/v1/docs/Search.md b/jcapiv1/docs/Search.md similarity index 99% rename from v1/docs/Search.md rename to jcapiv1/docs/Search.md index a071efe..1a0a965 100644 --- a/v1/docs/Search.md +++ b/jcapiv1/docs/Search.md @@ -9,4 +9,3 @@ Name | Type | Description | Notes [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/jcapiv1/docs/SearchApi.md b/jcapiv1/docs/SearchApi.md new file mode 100644 index 0000000..647202f --- /dev/null +++ b/jcapiv1/docs/SearchApi.md @@ -0,0 +1,206 @@ +# {{classname}} + +All URIs are relative to *https://console.jumpcloud.com/api* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**SearchCommandresultsPost**](SearchApi.md#SearchCommandresultsPost) | **Post** /search/commandresults | Search Commands Results +[**SearchCommandsPost**](SearchApi.md#SearchCommandsPost) | **Post** /search/commands | Search Commands +[**SearchOrganizationsPost**](SearchApi.md#SearchOrganizationsPost) | **Post** /search/organizations | Search Organizations +[**SearchSystemsPost**](SearchApi.md#SearchSystemsPost) | **Post** /search/systems | Search Systems +[**SearchSystemusersPost**](SearchApi.md#SearchSystemusersPost) | **Post** /search/systemusers | Search System Users + +# **SearchCommandresultsPost** +> Commandresultslist SearchCommandresultsPost(ctx, optional) +Search Commands Results + +Return Command Results in multi-record format allowing for the passing of the `filter` parameter. To support advanced filtering you can use the `filter` and `searchFilter` parameters that can only be passed in the body of POST /api/search/commandresults route. The `filter` parameter must be passed as Content-Type application/json. The `filter` parameter is an object with a single property, either `and` or `or` with the value of the property being an array of query expressions. This allows you to filter records using the logic of matching ALL or ANY records in the array of query expressions. If the `and` or `or` are not included the default behavior is to match ALL query expressions. #### Sample Request Exact search for a specific command result ``` curl -X POST https://console.jumpcloud.com/api/search/commandresults \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"filter\" : \"workflowInstanceId:$eq:62f3c599ec4e928499069c7f\", \"fields\" : \"name workflowId sudo\" }' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **optional** | ***SearchApiSearchCommandresultsPostOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a SearchApiSearchCommandresultsPostOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**optional.Interface of Search**](Search.md)| | + **fields** | **optional.**| Use a space seperated string of field parameters to include the data in the response. If omitted, the default list of fields will be returned. | + **filter** | **optional.**| A filter to apply to the query. See the supported operators below. For more complex searches, see the related `/search/<domain>` endpoints, e.g. `/search/systems`. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: - `$eq` (equals) - `$ne` (does not equal) - `$gt` (is greater than) - `$gte` (is greater than or equal to) - `$lt` (is less than) - `$lte` (is less than or equal to) _Note: v1 operators differ from v2 operators._ _Note: For v1 operators, excluding the `$` will result in undefined behavior._ **value** = Populate with the value you want to search for. Is case sensitive. **Examples** - `GET /users?filter=username:$eq:testuser` - `GET /systemusers?filter=password_expiration_date:$lte:2021-10-24` - `GET /systemusers?filter=department:$ne:Accounting` - `GET /systems?filter[0]=firstname:$eq:foo&filter[1]=lastname:$eq:bar` - this will AND the filters together. - `GET /systems?filter[or][0]=lastname:$eq:foo&filter[or][1]=lastname:$eq:bar` - this will OR the filters together. | + **limit** | **optional.**| The number of records to return at once. Limited to 100. | [default to 10] + **skip** | **optional.**| The offset into the records to return. | [default to 0] + **xOrgId** | **optional.**| | + +### Return type + +[**Commandresultslist**](commandresultslist.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **SearchCommandsPost** +> Commandslist SearchCommandsPost(ctx, optional) +Search Commands + +Return Commands in multi-record format allowing for the passing of the `filter` and `searchFilter` parameters. This WILL NOT allow you to add a new command. To support advanced filtering you can use the `filter` and `searchFilter` parameters that can only be passed in the body of POST /api/search/_* routes. The `filter` and `searchFilter` parameters must be passed as Content-Type application/json. The `filter` parameter is an object with a single property, either `and` or `or` with the value of the property being an array of query expressions. This allows you to filter records using the logic of matching ALL or ANY records in the array of query expressions. If the `and` or `or` are not included the default behavior is to match ALL query expressions. The `searchFilter` parameter allows text searching on supported fields by specifying a `searchTerm` and a list of `fields` to query on. If any `field` has a partial text match on the `searchTerm` the record will be returned. #### Sample Request Exact search for a list of commands in a launchType ``` curl -X POST https://console.jumpcloud.com/api/search/commands \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"filter\" : [{\"launchType\" : \"repeated\"}], \"fields\" : \"name launchType sudo\" }' ``` Text search for commands with name ``` curl -X POST https://console.jumpcloud.com/api/search/commands \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"searchFilter\" : { \"searchTerm\": \"List\", \"fields\": [\"name\"] }, \"fields\" : \"name launchType sudo\" }' ``` Text search for multiple commands ``` curl -X POST https://console.jumpcloud.com/api/search/commands \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"searchFilter\" : { \"searchTerm\": [\"List\", \"Log\"], \"fields\": [\"name\"] }, \"fields\" : \"name launchType sudo\" }' ``` Combining `filter` and `searchFilter` to text search for commands with name who are in a list of launchType ``` curl -X POST https://console.jumpcloud.com/api/search/commands \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"searchFilter\": { \"searchTerm\": \"List\", \"fields\": [\"name\"] }, \"filter\": { \"or\": [ {\"launchType\" : \"repeated\"}, {\"launchType\" : \"one-time\"} ] }, \"fields\" : \"name launchType sudo\" }' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **optional** | ***SearchApiSearchCommandsPostOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a SearchApiSearchCommandsPostOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**optional.Interface of Search**](Search.md)| | + **fields** | **optional.**| Use a space seperated string of field parameters to include the data in the response. If omitted, the default list of fields will be returned. | + **filter** | **optional.**| A filter to apply to the query. See the supported operators below. For more complex searches, see the related `/search/<domain>` endpoints, e.g. `/search/systems`. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: - `$eq` (equals) - `$ne` (does not equal) - `$gt` (is greater than) - `$gte` (is greater than or equal to) - `$lt` (is less than) - `$lte` (is less than or equal to) _Note: v1 operators differ from v2 operators._ _Note: For v1 operators, excluding the `$` will result in undefined behavior._ **value** = Populate with the value you want to search for. Is case sensitive. **Examples** - `GET /users?filter=username:$eq:testuser` - `GET /systemusers?filter=password_expiration_date:$lte:2021-10-24` - `GET /systemusers?filter=department:$ne:Accounting` - `GET /systems?filter[0]=firstname:$eq:foo&filter[1]=lastname:$eq:bar` - this will AND the filters together. - `GET /systems?filter[or][0]=lastname:$eq:foo&filter[or][1]=lastname:$eq:bar` - this will OR the filters together. | + **limit** | **optional.**| The number of records to return at once. Limited to 100. | [default to 10] + **skip** | **optional.**| The offset into the records to return. | [default to 0] + **xOrgId** | **optional.**| | + +### Return type + +[**Commandslist**](commandslist.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **SearchOrganizationsPost** +> Organizationslist SearchOrganizationsPost(ctx, optional) +Search Organizations + +This endpoint will return Organization data based on your search parameters. This endpoint WILL NOT allow you to add a new Organization. You can use the supported parameters and pass those in the body of request. The parameters must be passed as Content-Type application/json. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/search/organizations \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"search\":{ \"fields\" : [\"settings.name\"], \"searchTerm\": \"Second\" }, \"fields\": [\"_id\", \"displayName\", \"logoUrl\"], \"limit\" : 0, \"skip\" : 0 }' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **optional** | ***SearchApiSearchOrganizationsPostOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a SearchApiSearchOrganizationsPostOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**optional.Interface of Search**](Search.md)| | + **fields** | **optional.**| Use a space seperated string of field parameters to include the data in the response. If omitted, the default list of fields will be returned. | + **filter** | **optional.**| A filter to apply to the query. See the supported operators below. For more complex searches, see the related `/search/<domain>` endpoints, e.g. `/search/systems`. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: - `$eq` (equals) - `$ne` (does not equal) - `$gt` (is greater than) - `$gte` (is greater than or equal to) - `$lt` (is less than) - `$lte` (is less than or equal to) _Note: v1 operators differ from v2 operators._ _Note: For v1 operators, excluding the `$` will result in undefined behavior._ **value** = Populate with the value you want to search for. Is case sensitive. **Examples** - `GET /users?filter=username:$eq:testuser` - `GET /systemusers?filter=password_expiration_date:$lte:2021-10-24` - `GET /systemusers?filter=department:$ne:Accounting` - `GET /systems?filter[0]=firstname:$eq:foo&filter[1]=lastname:$eq:bar` - this will AND the filters together. - `GET /systems?filter[or][0]=lastname:$eq:foo&filter[or][1]=lastname:$eq:bar` - this will OR the filters together. | + **limit** | **optional.**| The number of records to return at once. Limited to 100. | [default to 10] + **skip** | **optional.**| The offset into the records to return. | [default to 0] + +### Return type + +[**Organizationslist**](organizationslist.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **SearchSystemsPost** +> Systemslist SearchSystemsPost(ctx, optional) +Search Systems + +Return Systems in multi-record format allowing for the passing of the `filter` and `searchFilter` parameters. This WILL NOT allow you to add a new system. To support advanced filtering you can use the `filter` and `searchFilter` parameters that can only be passed in the body of POST /api/search/_* routes. The `filter` and `searchFilter` parameters must be passed as Content-Type application/json. The `filter` parameter is an object with a single property, either `and` or `or` with the value of the property being an array of query expressions. This allows you to filter records using the logic of matching ALL or ANY records in the array of query expressions. If the `and` or `or` are not included the default behavior is to match ALL query expressions. The `searchFilter` parameter allows text searching on supported fields by specifying a `searchTerm` and a list of `fields` to query on. If any `field` has a partial text match on the `searchTerm` the record will be returned. #### Sample Request Exact search for a list of hostnames ``` curl -X POST https://console.jumpcloud.com/api/search/systems \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"filter\": { \"or\": [ {\"hostname\" : \"my-hostname\"}, {\"hostname\" : \"other-hostname\"} ] }, \"fields\" : \"os hostname displayName\" }' ``` Text search for a hostname or display name ``` curl -X POST https://console.jumpcloud.com/api/search/systems \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"searchFilter\": { \"searchTerm\": \"my-host\", \"fields\": [\"hostname\", \"displayName\"] }, \"fields\": \"os hostname displayName\" }' ``` Text search for a multiple hostnames. ``` curl -X POST https://console.jumpcloud.com/api/search/systems \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"searchFilter\": { \"searchTerm\": [\"my-host\", \"my-other-host\"], \"fields\": [\"hostname\"] }, \"fields\": \"os hostname displayName\" }' ``` Combining `filter` and `searchFilter` to search for names that match a given OS ``` curl -X POST https://console.jumpcloud.com/api/search/systems \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"searchFilter\": { \"searchTerm\": \"my-host\", \"fields\": [\"hostname\", \"displayName\"] }, \"filter\": { \"or\": [ {\"os\" : \"Ubuntu\"}, {\"os\" : \"Mac OS X\"} ] }, \"fields\": \"os hostname displayName\" }' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **optional** | ***SearchApiSearchSystemsPostOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a SearchApiSearchSystemsPostOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**optional.Interface of Search**](Search.md)| | + **fields** | **optional.**| Use a space seperated string of field parameters to include the data in the response. If omitted, the default list of fields will be returned. | + **limit** | **optional.**| The number of records to return at once. Limited to 100. | [default to 10] + **xOrgId** | **optional.**| | + **skip** | **optional.**| The offset into the records to return. | [default to 0] + **filter** | **optional.**| A filter to apply to the query. See the supported operators below. For more complex searches, see the related `/search/<domain>` endpoints, e.g. `/search/systems`. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: - `$eq` (equals) - `$ne` (does not equal) - `$gt` (is greater than) - `$gte` (is greater than or equal to) - `$lt` (is less than) - `$lte` (is less than or equal to) _Note: v1 operators differ from v2 operators._ _Note: For v1 operators, excluding the `$` will result in undefined behavior._ **value** = Populate with the value you want to search for. Is case sensitive. **Examples** - `GET /users?filter=username:$eq:testuser` - `GET /systemusers?filter=password_expiration_date:$lte:2021-10-24` - `GET /systemusers?filter=department:$ne:Accounting` - `GET /systems?filter[0]=firstname:$eq:foo&filter[1]=lastname:$eq:bar` - this will AND the filters together. - `GET /systems?filter[or][0]=lastname:$eq:foo&filter[or][1]=lastname:$eq:bar` - this will OR the filters together. | + +### Return type + +[**Systemslist**](systemslist.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **SearchSystemusersPost** +> Systemuserslist SearchSystemusersPost(ctx, optional) +Search System Users + +Return System Users in multi-record format allowing for the passing of the `filter` and `searchFilter` parameters. This WILL NOT allow you to add a new system user. To support advanced filtering you can use the `filter` and `searchFilter` parameters that can only be passed in the body of POST /api/search/_* routes. The `filter` and `searchFilter` parameters must be passed as Content-Type application/json. The `filter` parameter is an object with a single property, either `and` or `or` with the value of the property being an array of query expressions. This allows you to filter records using the logic of matching ALL or ANY records in the array of query expressions. If the `and` or `or` are not included the default behavior is to match ALL query expressions. The `searchFilter` parameter allows text searching on supported fields by specifying a `searchTerm` and a list of `fields` to query on. If any `field` has a partial text match on the `searchTerm` the record will be returned. #### Sample Request Exact search for a list of system users in a department ``` curl -X POST https://console.jumpcloud.com/api/search/systemusers \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"filter\" : [{\"department\" : \"IT\"}], \"fields\" : \"email username sudo\" }' ``` Text search for system users with and email on a domain ``` curl -X POST https://console.jumpcloud.com/api/search/systemusers \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"searchFilter\" : { \"searchTerm\": \"@jumpcloud.com\", \"fields\": [\"email\"] }, \"fields\" : \"email username sudo\" }' ``` Text search for multiple system users ``` curl -X POST https://console.jumpcloud.com/api/search/systemusers \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"searchFilter\" : { \"searchTerm\": [\"john\", \"sarah\"], \"fields\": [\"username\"] }, \"fields\" : \"email username sudo\" }' ``` Combining `filter` and `searchFilter` to text search for system users with and email on a domain who are in a list of departments ``` curl -X POST https://console.jumpcloud.com/api/search/systemusers \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"searchFilter\": { \"searchTerm\": \"@jumpcloud.com\", \"fields\": [\"email\"] }, \"filter\": { \"or\": [ {\"department\" : \"IT\"}, {\"department\" : \"Sales\"} ] }, \"fields\" : \"email username sudo\" }' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **optional** | ***SearchApiSearchSystemusersPostOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a SearchApiSearchSystemusersPostOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**optional.Interface of Search**](Search.md)| | + **fields** | **optional.**| Use a space seperated string of field parameters to include the data in the response. If omitted, the default list of fields will be returned. | + **filter** | **optional.**| A filter to apply to the query. See the supported operators below. For more complex searches, see the related `/search/<domain>` endpoints, e.g. `/search/systems`. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: - `$eq` (equals) - `$ne` (does not equal) - `$gt` (is greater than) - `$gte` (is greater than or equal to) - `$lt` (is less than) - `$lte` (is less than or equal to) _Note: v1 operators differ from v2 operators._ _Note: For v1 operators, excluding the `$` will result in undefined behavior._ **value** = Populate with the value you want to search for. Is case sensitive. **Examples** - `GET /users?filter=username:$eq:testuser` - `GET /systemusers?filter=password_expiration_date:$lte:2021-10-24` - `GET /systemusers?filter=department:$ne:Accounting` - `GET /systems?filter[0]=firstname:$eq:foo&filter[1]=lastname:$eq:bar` - this will AND the filters together. - `GET /systems?filter[or][0]=lastname:$eq:foo&filter[or][1]=lastname:$eq:bar` - this will OR the filters together. | + **limit** | **optional.**| The number of records to return at once. Limited to 100. | [default to 10] + **skip** | **optional.**| The offset into the records to return. | [default to 0] + **xOrgId** | **optional.**| | + +### Return type + +[**Systemuserslist**](systemuserslist.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/jcapiv1/docs/Sshkeylist.md b/jcapiv1/docs/Sshkeylist.md new file mode 100644 index 0000000..8adf991 --- /dev/null +++ b/jcapiv1/docs/Sshkeylist.md @@ -0,0 +1,12 @@ +# Sshkeylist + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Id** | **string** | The ID of the SSH key. | [optional] [default to null] +**CreateDate** | **string** | The date the SSH key was created. | [optional] [default to null] +**Name** | **string** | The name of the SSH key. | [optional] [default to null] +**PublicKey** | **string** | The Public SSH key. | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/v1/docs/Sshkeypost.md b/jcapiv1/docs/Sshkeypost.md similarity index 99% rename from v1/docs/Sshkeypost.md rename to jcapiv1/docs/Sshkeypost.md index 6102d42..9c72857 100644 --- a/v1/docs/Sshkeypost.md +++ b/jcapiv1/docs/Sshkeypost.md @@ -8,4 +8,3 @@ Name | Type | Description | Notes [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/jcapiv1/docs/Sso.md b/jcapiv1/docs/Sso.md new file mode 100644 index 0000000..15fffba --- /dev/null +++ b/jcapiv1/docs/Sso.md @@ -0,0 +1,12 @@ +# Sso + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Beta** | **bool** | | [optional] [default to null] +**IdpCertExpirationAt** | [**time.Time**](time.Time.md) | | [optional] [default to null] +**Jit** | **bool** | | [optional] [default to null] +**Type_** | **string** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv1/docs/StateActivateBody.md b/jcapiv1/docs/StateActivateBody.md new file mode 100644 index 0000000..5f39903 --- /dev/null +++ b/jcapiv1/docs/StateActivateBody.md @@ -0,0 +1,9 @@ +# StateActivateBody + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Email** | [***interface{}**](interface{}.md) | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv1/docs/System.md b/jcapiv1/docs/System.md new file mode 100644 index 0000000..9def939 --- /dev/null +++ b/jcapiv1/docs/System.md @@ -0,0 +1,49 @@ +# System + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Id** | **string** | | [optional] [default to null] +**Active** | **bool** | | [optional] [default to null] +**AgentVersion** | **string** | | [optional] [default to null] +**AllowMultiFactorAuthentication** | **bool** | | [optional] [default to null] +**AllowPublicKeyAuthentication** | **bool** | | [optional] [default to null] +**AllowSshPasswordAuthentication** | **bool** | | [optional] [default to null] +**AllowSshRootLogin** | **bool** | | [optional] [default to null] +**AmazonInstanceID** | **string** | | [optional] [default to null] +**Arch** | **string** | | [optional] [default to null] +**AzureAdJoined** | **bool** | | [optional] [default to null] +**BuiltInCommands** | [**[]SystemBuiltInCommands**](system_builtInCommands.md) | | [optional] [default to null] +**ConnectionHistory** | [**[]interface{}**](interface{}.md) | | [optional] [default to null] +**Created** | [**time.Time**](time.Time.md) | | [optional] [default to null] +**Description** | **string** | | [optional] [default to null] +**DisplayManager** | **string** | | [optional] [default to null] +**DisplayName** | **string** | | [optional] [default to null] +**DomainInfo** | [***SystemDomainInfo**](system_domainInfo.md) | | [optional] [default to null] +**Fde** | [***Fde**](fde.md) | | [optional] [default to null] +**FileSystem** | **string** | | [optional] [default to null] +**HasServiceAccount** | **bool** | | [optional] [default to null] +**Hostname** | **string** | | [optional] [default to null] +**LastContact** | [**time.Time**](time.Time.md) | | [optional] [default to null] +**Mdm** | [***SystemMdm**](system_mdm.md) | | [optional] [default to null] +**ModifySSHDConfig** | **bool** | | [optional] [default to null] +**NetworkInterfaces** | [**[]SystemNetworkInterfaces**](system_networkInterfaces.md) | | [optional] [default to null] +**Organization** | **string** | | [optional] [default to null] +**Os** | **string** | | [optional] [default to null] +**OsFamily** | **string** | | [optional] [default to null] +**OsVersionDetail** | [***SystemOsVersionDetail**](system_osVersionDetail.md) | | [optional] [default to null] +**ProvisionMetadata** | [***SystemProvisionMetadata**](system_provisionMetadata.md) | | [optional] [default to null] +**RemoteIP** | **string** | | [optional] [default to null] +**SerialNumber** | **string** | | [optional] [default to null] +**ServiceAccountState** | [***SystemServiceAccountState**](system_serviceAccountState.md) | | [optional] [default to null] +**SshRootEnabled** | **bool** | | [optional] [default to null] +**SshdParams** | [**[]SystemSshdParams**](system_sshdParams.md) | | [optional] [default to null] +**SystemInsights** | [***SystemSystemInsights**](system_systemInsights.md) | | [optional] [default to null] +**SystemTimezone** | **int32** | | [optional] [default to null] +**Tags** | **[]string** | | [optional] [default to null] +**TemplateName** | **string** | | [optional] [default to null] +**UserMetrics** | [**[]SystemUserMetrics**](system_userMetrics.md) | | [optional] [default to null] +**Version** | **string** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv1/docs/SystemBuiltInCommands.md b/jcapiv1/docs/SystemBuiltInCommands.md new file mode 100644 index 0000000..734dcca --- /dev/null +++ b/jcapiv1/docs/SystemBuiltInCommands.md @@ -0,0 +1,10 @@ +# SystemBuiltInCommands + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Name** | **string** | | [optional] [default to null] +**Type_** | **string** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv1/docs/SystemDomainInfo.md b/jcapiv1/docs/SystemDomainInfo.md new file mode 100644 index 0000000..0220f07 --- /dev/null +++ b/jcapiv1/docs/SystemDomainInfo.md @@ -0,0 +1,10 @@ +# SystemDomainInfo + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**DomainName** | **string** | | [optional] [default to null] +**PartOfDomain** | **bool** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv1/docs/SystemMdm.md b/jcapiv1/docs/SystemMdm.md new file mode 100644 index 0000000..9f539ad --- /dev/null +++ b/jcapiv1/docs/SystemMdm.md @@ -0,0 +1,14 @@ +# SystemMdm + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Dep** | **bool** | | [optional] [default to null] +**EnrollmentType** | **string** | | [optional] [default to null] +**Internal** | [***SystemMdmInternal**](system_mdm_internal.md) | | [optional] [default to null] +**ProfileIdentifier** | **string** | | [optional] [default to null] +**UserApproved** | **bool** | | [optional] [default to null] +**Vendor** | **string** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv1/docs/SystemMdmInternal.md b/jcapiv1/docs/SystemMdmInternal.md new file mode 100644 index 0000000..6e82ccc --- /dev/null +++ b/jcapiv1/docs/SystemMdmInternal.md @@ -0,0 +1,9 @@ +# SystemMdmInternal + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**DeviceId** | **string** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/v1/docs/SystemNetworkInterfaces.md b/jcapiv1/docs/SystemNetworkInterfaces.md similarity index 99% rename from v1/docs/SystemNetworkInterfaces.md rename to jcapiv1/docs/SystemNetworkInterfaces.md index 14db9ff..71d3ec2 100644 --- a/v1/docs/SystemNetworkInterfaces.md +++ b/jcapiv1/docs/SystemNetworkInterfaces.md @@ -10,4 +10,3 @@ Name | Type | Description | Notes [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/jcapiv1/docs/SystemOsVersionDetail.md b/jcapiv1/docs/SystemOsVersionDetail.md new file mode 100644 index 0000000..f8dff10 --- /dev/null +++ b/jcapiv1/docs/SystemOsVersionDetail.md @@ -0,0 +1,14 @@ +# SystemOsVersionDetail + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Major** | **string** | | [optional] [default to null] +**Minor** | **string** | | [optional] [default to null] +**OsName** | **string** | | [optional] [default to null] +**Patch** | **string** | | [optional] [default to null] +**ReleaseName** | **string** | | [optional] [default to null] +**Revision** | **string** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv1/docs/SystemProvisionMetadata.md b/jcapiv1/docs/SystemProvisionMetadata.md new file mode 100644 index 0000000..12916ab --- /dev/null +++ b/jcapiv1/docs/SystemProvisionMetadata.md @@ -0,0 +1,9 @@ +# SystemProvisionMetadata + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Provisioner** | [***SystemProvisionMetadataProvisioner**](system_provisionMetadata_provisioner.md) | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv1/docs/SystemProvisionMetadataProvisioner.md b/jcapiv1/docs/SystemProvisionMetadataProvisioner.md new file mode 100644 index 0000000..efc4758 --- /dev/null +++ b/jcapiv1/docs/SystemProvisionMetadataProvisioner.md @@ -0,0 +1,10 @@ +# SystemProvisionMetadataProvisioner + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ProvisionerId** | **string** | | [optional] [default to null] +**Type_** | **string** | | [optional] [default to TYPE_.ADMINISTRATOR] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv1/docs/SystemServiceAccountState.md b/jcapiv1/docs/SystemServiceAccountState.md new file mode 100644 index 0000000..10000de --- /dev/null +++ b/jcapiv1/docs/SystemServiceAccountState.md @@ -0,0 +1,11 @@ +# SystemServiceAccountState + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**HasSecureToken** | **bool** | | [optional] [default to null] +**PasswordAPFSValid** | **bool** | | [optional] [default to null] +**PasswordODValid** | **bool** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/v1/docs/SystemSshdParams.md b/jcapiv1/docs/SystemSshdParams.md similarity index 99% rename from v1/docs/SystemSshdParams.md rename to jcapiv1/docs/SystemSshdParams.md index 2be971d..6c9f102 100644 --- a/v1/docs/SystemSshdParams.md +++ b/jcapiv1/docs/SystemSshdParams.md @@ -8,4 +8,3 @@ Name | Type | Description | Notes [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/v1/docs/SystemSystemInsights.md b/jcapiv1/docs/SystemSystemInsights.md similarity index 99% rename from v1/docs/SystemSystemInsights.md rename to jcapiv1/docs/SystemSystemInsights.md index 231df68..e797dd4 100644 --- a/v1/docs/SystemSystemInsights.md +++ b/jcapiv1/docs/SystemSystemInsights.md @@ -7,4 +7,3 @@ Name | Type | Description | Notes [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/jcapiv1/docs/SystemUserMetrics.md b/jcapiv1/docs/SystemUserMetrics.md new file mode 100644 index 0000000..3d48a8e --- /dev/null +++ b/jcapiv1/docs/SystemUserMetrics.md @@ -0,0 +1,13 @@ +# SystemUserMetrics + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Admin** | **bool** | | [optional] [default to null] +**Managed** | **bool** | | [optional] [default to null] +**SecureTokenEnabled** | **bool** | | [optional] [default to null] +**Suspended** | **bool** | | [optional] [default to null] +**UserName** | **string** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/v1/docs/Systemput.md b/jcapiv1/docs/Systemput.md similarity index 99% rename from v1/docs/Systemput.md rename to jcapiv1/docs/Systemput.md index cdc92dd..07d2522 100644 --- a/v1/docs/Systemput.md +++ b/jcapiv1/docs/Systemput.md @@ -13,4 +13,3 @@ Name | Type | Description | Notes [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/v1/docs/SystemputAgentBoundMessages.md b/jcapiv1/docs/SystemputAgentBoundMessages.md similarity index 99% rename from v1/docs/SystemputAgentBoundMessages.md rename to jcapiv1/docs/SystemputAgentBoundMessages.md index 24d7975..90ac3aa 100644 --- a/v1/docs/SystemputAgentBoundMessages.md +++ b/jcapiv1/docs/SystemputAgentBoundMessages.md @@ -7,4 +7,3 @@ Name | Type | Description | Notes [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/jcapiv1/docs/SystemsApi.md b/jcapiv1/docs/SystemsApi.md new file mode 100644 index 0000000..2d48d94 --- /dev/null +++ b/jcapiv1/docs/SystemsApi.md @@ -0,0 +1,316 @@ +# {{classname}} + +All URIs are relative to *https://console.jumpcloud.com/api* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**SystemsCommandBuiltinErase**](SystemsApi.md#SystemsCommandBuiltinErase) | **Post** /systems/{system_id}/command/builtin/erase | Erase a System +[**SystemsCommandBuiltinLock**](SystemsApi.md#SystemsCommandBuiltinLock) | **Post** /systems/{system_id}/command/builtin/lock | Lock a System +[**SystemsCommandBuiltinRestart**](SystemsApi.md#SystemsCommandBuiltinRestart) | **Post** /systems/{system_id}/command/builtin/restart | Restart a System +[**SystemsCommandBuiltinShutdown**](SystemsApi.md#SystemsCommandBuiltinShutdown) | **Post** /systems/{system_id}/command/builtin/shutdown | Shutdown a System +[**SystemsDelete**](SystemsApi.md#SystemsDelete) | **Delete** /systems/{id} | Delete a System +[**SystemsGet**](SystemsApi.md#SystemsGet) | **Get** /systems/{id} | List an individual system +[**SystemsList**](SystemsApi.md#SystemsList) | **Get** /systems | List All Systems +[**SystemsPut**](SystemsApi.md#SystemsPut) | **Put** /systems/{id} | Update a system + +# **SystemsCommandBuiltinErase** +> SystemsCommandBuiltinErase(ctx, systemId, optional) +Erase a System + +This endpoint allows you to run the erase command on the specified device. If a device is offline, the command will be run when the device becomes available. #### Sample Request ``` curl -X POST \\ https://console.jumpcloud.com/api/systems/{system_id}/command/builtin/erase \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d {} ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **systemId** | **string**| | + **optional** | ***SystemsApiSystemsCommandBuiltinEraseOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a SystemsApiSystemsCommandBuiltinEraseOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **xOrgId** | **optional.String**| | + +### Return type + + (empty response body) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **SystemsCommandBuiltinLock** +> SystemsCommandBuiltinLock(ctx, systemId, optional) +Lock a System + +This endpoint allows you to run the lock command on the specified device. If a device is offline, the command will be run when the device becomes available. #### Sample Request ``` curl -X POST \\ https://console.jumpcloud.com/api/systems/{system_id}/command/builtin/lock \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d {} ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **systemId** | **string**| | + **optional** | ***SystemsApiSystemsCommandBuiltinLockOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a SystemsApiSystemsCommandBuiltinLockOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **xOrgId** | **optional.String**| | + +### Return type + + (empty response body) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **SystemsCommandBuiltinRestart** +> SystemsCommandBuiltinRestart(ctx, systemId, optional) +Restart a System + +This endpoint allows you to run the restart command on the specified device. If a device is offline, the command will be run when the device becomes available. #### Sample Request ``` curl -X POST \\ https://console.jumpcloud.com/api/systems/{system_id}/command/builtin/restart \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d {} ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **systemId** | **string**| | + **optional** | ***SystemsApiSystemsCommandBuiltinRestartOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a SystemsApiSystemsCommandBuiltinRestartOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **xOrgId** | **optional.String**| | + +### Return type + + (empty response body) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **SystemsCommandBuiltinShutdown** +> SystemsCommandBuiltinShutdown(ctx, systemId, optional) +Shutdown a System + +This endpoint allows you to run the shutdown command on the specified device. If a device is offline, the command will be run when the device becomes available. #### Sample Request ``` curl -X POST \\ https://console.jumpcloud.com/api/systems/{system_id}/command/builtin/shutdown \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d {} ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **systemId** | **string**| | + **optional** | ***SystemsApiSystemsCommandBuiltinShutdownOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a SystemsApiSystemsCommandBuiltinShutdownOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **xOrgId** | **optional.String**| | + +### Return type + + (empty response body) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **SystemsDelete** +> System SystemsDelete(ctx, id, optional) +Delete a System + +This endpoint allows you to delete a system. This command will cause the system to uninstall the JumpCloud agent from its self which can can take about a minute. If the system is not connected to JumpCloud the system record will simply be removed. #### Sample Request ``` curl -X DELETE https://console.jumpcloud.com/api/systems/{SystemID} \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **id** | **string**| | + **optional** | ***SystemsApiSystemsDeleteOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a SystemsApiSystemsDeleteOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **date** | **optional.String**| Current date header for the System Context API | + **authorization** | **optional.String**| Authorization header for the System Context API | + **xOrgId** | **optional.String**| | + +### Return type + +[**System**](system.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **SystemsGet** +> System SystemsGet(ctx, id, optional) +List an individual system + +This endpoint returns an individual system. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/systems/{SystemID} \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **id** | **string**| | + **optional** | ***SystemsApiSystemsGetOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a SystemsApiSystemsGetOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **fields** | **optional.String**| Use a space seperated string of field parameters to include the data in the response. If omitted, the default list of fields will be returned. | + **filter** | **optional.String**| A filter to apply to the query. See the supported operators below. For more complex searches, see the related `/search/<domain>` endpoints, e.g. `/search/systems`. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: - `$eq` (equals) - `$ne` (does not equal) - `$gt` (is greater than) - `$gte` (is greater than or equal to) - `$lt` (is less than) - `$lte` (is less than or equal to) _Note: v1 operators differ from v2 operators._ _Note: For v1 operators, excluding the `$` will result in undefined behavior._ **value** = Populate with the value you want to search for. Is case sensitive. **Examples** - `GET /users?filter=username:$eq:testuser` - `GET /systemusers?filter=password_expiration_date:$lte:2021-10-24` - `GET /systemusers?filter=department:$ne:Accounting` - `GET /systems?filter[0]=firstname:$eq:foo&filter[1]=lastname:$eq:bar` - this will AND the filters together. - `GET /systems?filter[or][0]=lastname:$eq:foo&filter[or][1]=lastname:$eq:bar` - this will OR the filters together. | + **date** | **optional.String**| Current date header for the System Context API | + **authorization** | **optional.String**| Authorization header for the System Context API | + **xOrgId** | **optional.String**| | + +### Return type + +[**System**](system.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **SystemsList** +> Systemslist SystemsList(ctx, optional) +List All Systems + +This endpoint returns all Systems. #### Sample Requests ``` curl -X GET https://console.jumpcloud.com/api/systems \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **optional** | ***SystemsApiSystemsListOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a SystemsApiSystemsListOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **fields** | **optional.String**| Use a space seperated string of field parameters to include the data in the response. If omitted, the default list of fields will be returned. | + **limit** | **optional.Int32**| The number of records to return at once. Limited to 100. | [default to 10] + **xOrgId** | **optional.String**| | + **search** | **optional.String**| A nested object containing a `searchTerm` string or array of strings and a list of `fields` to search on. | + **skip** | **optional.Int32**| The offset into the records to return. | [default to 0] + **sort** | **optional.String**| Use space separated sort parameters to sort the collection. Default sort is ascending. Prefix with `-` to sort descending. | + **filter** | **optional.String**| A filter to apply to the query. See the supported operators below. For more complex searches, see the related `/search/<domain>` endpoints, e.g. `/search/systems`. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: - `$eq` (equals) - `$ne` (does not equal) - `$gt` (is greater than) - `$gte` (is greater than or equal to) - `$lt` (is less than) - `$lte` (is less than or equal to) _Note: v1 operators differ from v2 operators._ _Note: For v1 operators, excluding the `$` will result in undefined behavior._ **value** = Populate with the value you want to search for. Is case sensitive. **Examples** - `GET /users?filter=username:$eq:testuser` - `GET /systemusers?filter=password_expiration_date:$lte:2021-10-24` - `GET /systemusers?filter=department:$ne:Accounting` - `GET /systems?filter[0]=firstname:$eq:foo&filter[1]=lastname:$eq:bar` - this will AND the filters together. - `GET /systems?filter[or][0]=lastname:$eq:foo&filter[or][1]=lastname:$eq:bar` - this will OR the filters together. | + +### Return type + +[**Systemslist**](systemslist.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **SystemsPut** +> System SystemsPut(ctx, id, optional) +Update a system + +This endpoint allows you to update a system. #### Sample Request ``` curl -X PUT https://console.jumpcloud.com/api/systems/{SystemID} \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"displayName\":\"Name_Update\", \"allowSshPasswordAuthentication\":\"true\", \"allowSshRootLogin\":\"true\", \"allowMultiFactorAuthentication\":\"true\", \"allowPublicKeyAuthentication\":\"false\" }' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **id** | **string**| | + **optional** | ***SystemsApiSystemsPutOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a SystemsApiSystemsPutOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **body** | [**optional.Interface of Systemput**](Systemput.md)| | + **date** | **optional.**| Current date header for the System Context API | + **authorization** | **optional.**| Authorization header for the System Context API | + **xOrgId** | **optional.**| | + +### Return type + +[**System**](system.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/v1/docs/Systemslist.md b/jcapiv1/docs/Systemslist.md similarity index 99% rename from v1/docs/Systemslist.md rename to jcapiv1/docs/Systemslist.md index 42ff858..14d92e9 100644 --- a/v1/docs/Systemslist.md +++ b/jcapiv1/docs/Systemslist.md @@ -8,4 +8,3 @@ Name | Type | Description | Notes [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/v1/docs/Systemuserput.md b/jcapiv1/docs/Systemuserput.md similarity index 79% rename from v1/docs/Systemuserput.md rename to jcapiv1/docs/Systemuserput.md index 2e01f91..6114265 100644 --- a/v1/docs/Systemuserput.md +++ b/jcapiv1/docs/Systemuserput.md @@ -6,11 +6,13 @@ Name | Type | Description | Notes **AccountLocked** | **bool** | | [optional] [default to null] **Addresses** | [**[]SystemuserputAddresses**](systemuserput_addresses.md) | type, poBox, extendedAddress, streetAddress, locality, region, postalCode, country | [optional] [default to null] **AllowPublicKey** | **bool** | | [optional] [default to null] -**Attributes** | [**[]interface{}**](interface{}.md) | | [optional] [default to null] +**AlternateEmail** | **string** | | [optional] [default to null] +**Attributes** | [**[]SystemuserputAttributes**](systemuserput_attributes.md) | | [optional] [default to null] **Company** | **string** | | [optional] [default to null] **CostCenter** | **string** | | [optional] [default to null] **Department** | **string** | | [optional] [default to null] **Description** | **string** | | [optional] [default to null] +**DisableDeviceMaxLoginAttempts** | **bool** | | [optional] [default to null] **Displayname** | **string** | | [optional] [default to null] **Email** | **string** | | [optional] [default to null] **EmployeeIdentifier** | **string** | Must be unique per user. | [optional] [default to null] @@ -18,6 +20,7 @@ Name | Type | Description | Notes **EnableManagedUid** | **bool** | | [optional] [default to null] **EnableUserPortalMultifactor** | **bool** | | [optional] [default to null] **ExternalDn** | **string** | | [optional] [default to null] +**ExternalPasswordExpirationDate** | **string** | | [optional] [default to null] **ExternalSourceType** | **string** | | [optional] [default to null] **ExternallyManaged** | **bool** | | [optional] [default to null] **Firstname** | **string** | | [optional] [default to null] @@ -25,15 +28,18 @@ Name | Type | Description | Notes **Lastname** | **string** | | [optional] [default to null] **LdapBindingUser** | **bool** | | [optional] [default to null] **Location** | **string** | | [optional] [default to null] +**ManagedAppleId** | **string** | | [optional] [default to null] +**Manager** | **string** | Relation with another systemuser to identify the last as a manager. | [optional] [default to null] **Mfa** | [***Mfa**](mfa.md) | | [optional] [default to null] **Middlename** | **string** | | [optional] [default to null] **Password** | **string** | | [optional] [default to null] **PasswordNeverExpires** | **bool** | | [optional] [default to null] **PhoneNumbers** | [**[]SystemuserputPhoneNumbers**](systemuserput_phoneNumbers.md) | | [optional] [default to null] **PublicKey** | **string** | | [optional] [default to null] -**Relationships** | [**[]interface{}**](interface{}.md) | | [optional] [default to null] +**Relationships** | [**[]SystemuserputRelationships**](systemuserput_relationships.md) | | [optional] [default to null] **SambaServiceUser** | **bool** | | [optional] [default to null] **SshKeys** | [**[]Sshkeypost**](sshkeypost.md) | | [optional] [default to null] +**State** | **string** | | [optional] [default to null] **Sudo** | **bool** | | [optional] [default to null] **Suspended** | **bool** | | [optional] [default to null] **Tags** | **[]string** | | [optional] [default to null] @@ -43,4 +49,3 @@ Name | Type | Description | Notes [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/v1/docs/SystemuserputAddresses.md b/jcapiv1/docs/SystemuserputAddresses.md similarity index 99% rename from v1/docs/SystemuserputAddresses.md rename to jcapiv1/docs/SystemuserputAddresses.md index 7beb662..19691f5 100644 --- a/v1/docs/SystemuserputAddresses.md +++ b/jcapiv1/docs/SystemuserputAddresses.md @@ -14,4 +14,3 @@ Name | Type | Description | Notes [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/jcapiv1/docs/SystemuserputAttributes.md b/jcapiv1/docs/SystemuserputAttributes.md new file mode 100644 index 0000000..feb9efb --- /dev/null +++ b/jcapiv1/docs/SystemuserputAttributes.md @@ -0,0 +1,10 @@ +# SystemuserputAttributes + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Name** | **string** | | [optional] [default to null] +**Value** | **string** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/v1/docs/SystemuserputPhoneNumbers.md b/jcapiv1/docs/SystemuserputPhoneNumbers.md similarity index 99% rename from v1/docs/SystemuserputPhoneNumbers.md rename to jcapiv1/docs/SystemuserputPhoneNumbers.md index 8cb8202..789838c 100644 --- a/v1/docs/SystemuserputPhoneNumbers.md +++ b/jcapiv1/docs/SystemuserputPhoneNumbers.md @@ -8,4 +8,3 @@ Name | Type | Description | Notes [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/jcapiv1/docs/SystemuserputRelationships.md b/jcapiv1/docs/SystemuserputRelationships.md new file mode 100644 index 0000000..0c3bfc9 --- /dev/null +++ b/jcapiv1/docs/SystemuserputRelationships.md @@ -0,0 +1,10 @@ +# SystemuserputRelationships + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Type_** | **string** | | [optional] [default to null] +**Value** | **string** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv1/docs/Systemuserputpost.md b/jcapiv1/docs/Systemuserputpost.md new file mode 100644 index 0000000..61a9400 --- /dev/null +++ b/jcapiv1/docs/Systemuserputpost.md @@ -0,0 +1,53 @@ +# Systemuserputpost + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**AccountLocked** | **bool** | | [optional] [default to null] +**Activated** | **bool** | | [optional] [default to null] +**Addresses** | [**[]SystemuserputpostAddresses**](systemuserputpost_addresses.md) | | [optional] [default to null] +**AllowPublicKey** | **bool** | | [optional] [default to null] +**AlternateEmail** | **string** | | [optional] [default to null] +**Attributes** | [**[]SystemuserputAttributes**](systemuserput_attributes.md) | | [optional] [default to null] +**Company** | **string** | | [optional] [default to null] +**CostCenter** | **string** | | [optional] [default to null] +**Department** | **string** | | [optional] [default to null] +**Description** | **string** | | [optional] [default to null] +**DisableDeviceMaxLoginAttempts** | **bool** | | [optional] [default to null] +**Displayname** | **string** | | [optional] [default to null] +**Email** | **string** | | [default to null] +**EmployeeIdentifier** | **string** | Must be unique per user. | [optional] [default to null] +**EmployeeType** | **string** | | [optional] [default to null] +**EnableManagedUid** | **bool** | | [optional] [default to null] +**EnableUserPortalMultifactor** | **bool** | | [optional] [default to null] +**ExternalDn** | **string** | | [optional] [default to null] +**ExternalPasswordExpirationDate** | [**time.Time**](time.Time.md) | | [optional] [default to null] +**ExternalSourceType** | **string** | | [optional] [default to null] +**ExternallyManaged** | **bool** | | [optional] [default to null] +**Firstname** | **string** | | [optional] [default to null] +**JobTitle** | **string** | | [optional] [default to null] +**Lastname** | **string** | | [optional] [default to null] +**LdapBindingUser** | **bool** | | [optional] [default to null] +**Location** | **string** | | [optional] [default to null] +**ManagedAppleId** | **string** | | [optional] [default to null] +**Manager** | **string** | Relation with another systemuser to identify the last as a manager. | [optional] [default to null] +**Mfa** | [***Mfa**](mfa.md) | | [optional] [default to null] +**Middlename** | **string** | | [optional] [default to null] +**Password** | **string** | | [optional] [default to null] +**PasswordNeverExpires** | **bool** | | [optional] [default to null] +**PasswordlessSudo** | **bool** | | [optional] [default to null] +**PhoneNumbers** | [**[]SystemuserputpostPhoneNumbers**](systemuserputpost_phoneNumbers.md) | | [optional] [default to null] +**PublicKey** | **string** | | [optional] [default to null] +**RecoveryEmail** | [***SystemuserputpostRecoveryEmail**](systemuserputpost_recoveryEmail.md) | | [optional] [default to null] +**Relationships** | [**[]SystemuserputRelationships**](systemuserput_relationships.md) | | [optional] [default to null] +**SambaServiceUser** | **bool** | | [optional] [default to null] +**State** | **string** | | [optional] [default to null] +**Sudo** | **bool** | | [optional] [default to null] +**Suspended** | **bool** | | [optional] [default to null] +**Tags** | **[]string** | | [optional] [default to null] +**UnixGuid** | **int32** | | [optional] [default to null] +**UnixUid** | **int32** | | [optional] [default to null] +**Username** | **string** | | [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv1/docs/SystemuserputpostAddresses.md b/jcapiv1/docs/SystemuserputpostAddresses.md new file mode 100644 index 0000000..85e5d59 --- /dev/null +++ b/jcapiv1/docs/SystemuserputpostAddresses.md @@ -0,0 +1,16 @@ +# SystemuserputpostAddresses + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Country** | **string** | | [optional] [default to null] +**ExtendedAddress** | **string** | | [optional] [default to null] +**Locality** | **string** | | [optional] [default to null] +**PoBox** | **string** | | [optional] [default to null] +**PostalCode** | **string** | | [optional] [default to null] +**Region** | **string** | | [optional] [default to null] +**StreetAddress** | **string** | | [optional] [default to null] +**Type_** | **string** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv1/docs/SystemuserputpostPhoneNumbers.md b/jcapiv1/docs/SystemuserputpostPhoneNumbers.md new file mode 100644 index 0000000..1258527 --- /dev/null +++ b/jcapiv1/docs/SystemuserputpostPhoneNumbers.md @@ -0,0 +1,10 @@ +# SystemuserputpostPhoneNumbers + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Number** | **string** | | [optional] [default to null] +**Type_** | **string** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv1/docs/SystemuserputpostRecoveryEmail.md b/jcapiv1/docs/SystemuserputpostRecoveryEmail.md new file mode 100644 index 0000000..a8141eb --- /dev/null +++ b/jcapiv1/docs/SystemuserputpostRecoveryEmail.md @@ -0,0 +1,9 @@ +# SystemuserputpostRecoveryEmail + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Address** | **string** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv1/docs/Systemuserreturn.md b/jcapiv1/docs/Systemuserreturn.md new file mode 100644 index 0000000..171da42 --- /dev/null +++ b/jcapiv1/docs/Systemuserreturn.md @@ -0,0 +1,63 @@ +# Systemuserreturn + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Id** | **string** | | [optional] [default to null] +**AccountLocked** | **bool** | | [optional] [default to null] +**AccountLockedDate** | **string** | | [optional] [default to null] +**Activated** | **bool** | | [optional] [default to null] +**Addresses** | [**[]SystemuserreturnAddresses**](systemuserreturn_addresses.md) | | [optional] [default to null] +**AllowPublicKey** | **bool** | | [optional] [default to null] +**AlternateEmail** | **string** | | [optional] [default to null] +**Attributes** | [**[]SystemuserputAttributes**](systemuserput_attributes.md) | | [optional] [default to null] +**BadLoginAttempts** | **int32** | | [optional] [default to null] +**Company** | **string** | | [optional] [default to null] +**CostCenter** | **string** | | [optional] [default to null] +**Created** | **string** | | [optional] [default to null] +**CreationSource** | **string** | | [optional] [default to null] +**Department** | **string** | | [optional] [default to null] +**Description** | **string** | | [optional] [default to null] +**DisableDeviceMaxLoginAttempts** | **bool** | | [optional] [default to null] +**Displayname** | **string** | | [optional] [default to null] +**Email** | **string** | | [optional] [default to null] +**EmployeeIdentifier** | **string** | Must be unique per user. | [optional] [default to null] +**EmployeeType** | **string** | | [optional] [default to null] +**EnableManagedUid** | **bool** | | [optional] [default to null] +**EnableUserPortalMultifactor** | **bool** | | [optional] [default to null] +**ExternalDn** | **string** | | [optional] [default to null] +**ExternalPasswordExpirationDate** | **string** | | [optional] [default to null] +**ExternalSourceType** | **string** | | [optional] [default to null] +**ExternallyManaged** | **bool** | | [optional] [default to null] +**Firstname** | **string** | | [optional] [default to null] +**JobTitle** | **string** | | [optional] [default to null] +**Lastname** | **string** | | [optional] [default to null] +**LdapBindingUser** | **bool** | | [optional] [default to null] +**Location** | **string** | | [optional] [default to null] +**ManagedAppleId** | **string** | | [optional] [default to null] +**Manager** | **string** | Relation with another systemuser to identify the last as a manager. | [optional] [default to null] +**Mfa** | [***Mfa**](mfa.md) | | [optional] [default to null] +**MfaEnrollment** | [***MfaEnrollment**](mfaEnrollment.md) | | [optional] [default to null] +**Middlename** | **string** | | [optional] [default to null] +**Organization** | **string** | | [optional] [default to null] +**PasswordExpirationDate** | **string** | | [optional] [default to null] +**PasswordExpired** | **bool** | | [optional] [default to null] +**PasswordNeverExpires** | **bool** | | [optional] [default to null] +**PasswordlessSudo** | **bool** | | [optional] [default to null] +**PhoneNumbers** | [**[]SystemuserreturnPhoneNumbers**](systemuserreturn_phoneNumbers.md) | | [optional] [default to null] +**PublicKey** | **string** | | [optional] [default to null] +**RecoveryEmail** | [***SystemuserreturnRecoveryEmail**](systemuserreturn_recoveryEmail.md) | | [optional] [default to null] +**Relationships** | [**[]SystemuserputRelationships**](systemuserput_relationships.md) | | [optional] [default to null] +**SambaServiceUser** | **bool** | | [optional] [default to null] +**SshKeys** | [**[]Sshkeylist**](sshkeylist.md) | | [optional] [default to null] +**State** | **string** | | [optional] [default to null] +**Sudo** | **bool** | | [optional] [default to null] +**Suspended** | **bool** | | [optional] [default to null] +**Tags** | **[]string** | | [optional] [default to null] +**TotpEnabled** | **bool** | | [optional] [default to null] +**UnixGuid** | **int32** | | [optional] [default to null] +**UnixUid** | **int32** | | [optional] [default to null] +**Username** | **string** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/v1/docs/SystemuserreturnAddresses.md b/jcapiv1/docs/SystemuserreturnAddresses.md similarity index 99% rename from v1/docs/SystemuserreturnAddresses.md rename to jcapiv1/docs/SystemuserreturnAddresses.md index 1d696d4..218cb11 100644 --- a/v1/docs/SystemuserreturnAddresses.md +++ b/jcapiv1/docs/SystemuserreturnAddresses.md @@ -15,4 +15,3 @@ Name | Type | Description | Notes [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/v1/docs/SystemuserreturnPhoneNumbers.md b/jcapiv1/docs/SystemuserreturnPhoneNumbers.md similarity index 99% rename from v1/docs/SystemuserreturnPhoneNumbers.md rename to jcapiv1/docs/SystemuserreturnPhoneNumbers.md index b401bd8..1add321 100644 --- a/v1/docs/SystemuserreturnPhoneNumbers.md +++ b/jcapiv1/docs/SystemuserreturnPhoneNumbers.md @@ -9,4 +9,3 @@ Name | Type | Description | Notes [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/jcapiv1/docs/SystemuserreturnRecoveryEmail.md b/jcapiv1/docs/SystemuserreturnRecoveryEmail.md new file mode 100644 index 0000000..6731068 --- /dev/null +++ b/jcapiv1/docs/SystemuserreturnRecoveryEmail.md @@ -0,0 +1,11 @@ +# SystemuserreturnRecoveryEmail + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Address** | **string** | | [optional] [default to null] +**Verified** | **bool** | | [optional] [default to null] +**VerifiedAt** | **string** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv1/docs/SystemusersApi.md b/jcapiv1/docs/SystemusersApi.md new file mode 100644 index 0000000..77f2bb7 --- /dev/null +++ b/jcapiv1/docs/SystemusersApi.md @@ -0,0 +1,493 @@ +# {{classname}} + +All URIs are relative to *https://console.jumpcloud.com/api* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**SshkeyDelete**](SystemusersApi.md#SshkeyDelete) | **Delete** /systemusers/{systemuser_id}/sshkeys/{id} | Delete a system user's Public SSH Keys +[**SshkeyList**](SystemusersApi.md#SshkeyList) | **Get** /systemusers/{id}/sshkeys | List a system user's public SSH keys +[**SshkeyPost**](SystemusersApi.md#SshkeyPost) | **Post** /systemusers/{id}/sshkeys | Create a system user's Public SSH Key +[**SystemusersDelete**](SystemusersApi.md#SystemusersDelete) | **Delete** /systemusers/{id} | Delete a system user +[**SystemusersExpire**](SystemusersApi.md#SystemusersExpire) | **Post** /systemusers/{id}/expire | Expire a system user's password +[**SystemusersGet**](SystemusersApi.md#SystemusersGet) | **Get** /systemusers/{id} | List a system user +[**SystemusersList**](SystemusersApi.md#SystemusersList) | **Get** /systemusers | List all system users +[**SystemusersMfasync**](SystemusersApi.md#SystemusersMfasync) | **Post** /systemusers/{id}/mfasync | Sync a systemuser's mfa enrollment status +[**SystemusersPost**](SystemusersApi.md#SystemusersPost) | **Post** /systemusers | Create a system user +[**SystemusersPut**](SystemusersApi.md#SystemusersPut) | **Put** /systemusers/{id} | Update a system user +[**SystemusersResetmfa**](SystemusersApi.md#SystemusersResetmfa) | **Post** /systemusers/{id}/resetmfa | Reset a system user's MFA token +[**SystemusersStateActivate**](SystemusersApi.md#SystemusersStateActivate) | **Post** /systemusers/{id}/state/activate | Activate System User +[**SystemusersUnlock**](SystemusersApi.md#SystemusersUnlock) | **Post** /systemusers/{id}/unlock | Unlock a system user + +# **SshkeyDelete** +> string SshkeyDelete(ctx, systemuserId, id, optional) +Delete a system user's Public SSH Keys + +This endpoint will delete a specific System User's SSH Key. + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **systemuserId** | **string**| | + **id** | **string**| | + **optional** | ***SystemusersApiSshkeyDeleteOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a SystemusersApiSshkeyDeleteOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + **xOrgId** | **optional.String**| | + +### Return type + +**string** + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json, text/plain + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **SshkeyList** +> []Sshkeylist SshkeyList(ctx, id, optional) +List a system user's public SSH keys + +This endpoint will return a specific System User's public SSH key. + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **id** | **string**| | + **optional** | ***SystemusersApiSshkeyListOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a SystemusersApiSshkeyListOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **xOrgId** | **optional.String**| | + +### Return type + +[**[]Sshkeylist**](sshkeylist.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **SshkeyPost** +> Sshkeylist SshkeyPost(ctx, id, optional) +Create a system user's Public SSH Key + +This endpoint will create a specific System User's Public SSH Key. + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **id** | **string**| | + **optional** | ***SystemusersApiSshkeyPostOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a SystemusersApiSshkeyPostOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **body** | [**optional.Interface of Sshkeypost**](Sshkeypost.md)| | + **xOrgId** | **optional.**| | + +### Return type + +[**Sshkeylist**](sshkeylist.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **SystemusersDelete** +> Systemuserreturn SystemusersDelete(ctx, id, optional) +Delete a system user + +This endpoint allows you to delete a particular system user. #### Sample Request ``` curl -X DELETE https://console.jumpcloud.com/api/systemusers/{UserID} \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **id** | **string**| | + **optional** | ***SystemusersApiSystemusersDeleteOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a SystemusersApiSystemusersDeleteOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **xOrgId** | **optional.String**| | + **cascadeManager** | **optional.String**| This is an optional flag that can be enabled on the DELETE call, DELETE /systemusers/{id}?cascade_manager=null. This parameter will clear the Manager attribute on all direct reports and then delete the account. | + +### Return type + +[**Systemuserreturn**](systemuserreturn.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **SystemusersExpire** +> string SystemusersExpire(ctx, id, optional) +Expire a system user's password + +This endpoint allows you to expire a user's password. + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **id** | **string**| | + **optional** | ***SystemusersApiSystemusersExpireOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a SystemusersApiSystemusersExpireOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **xOrgId** | **optional.String**| | + +### Return type + +**string** + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json, text/plain + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **SystemusersGet** +> Systemuserreturn SystemusersGet(ctx, id, optional) +List a system user + +This endpoint returns a particular System User. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/systemusers/{UserID} \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **id** | **string**| | + **optional** | ***SystemusersApiSystemusersGetOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a SystemusersApiSystemusersGetOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **fields** | **optional.String**| Use a space seperated string of field parameters to include the data in the response. If omitted, the default list of fields will be returned. | + **filter** | **optional.String**| A filter to apply to the query. See the supported operators below. For more complex searches, see the related `/search/<domain>` endpoints, e.g. `/search/systems`. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: - `$eq` (equals) - `$ne` (does not equal) - `$gt` (is greater than) - `$gte` (is greater than or equal to) - `$lt` (is less than) - `$lte` (is less than or equal to) _Note: v1 operators differ from v2 operators._ _Note: For v1 operators, excluding the `$` will result in undefined behavior._ **value** = Populate with the value you want to search for. Is case sensitive. **Examples** - `GET /users?filter=username:$eq:testuser` - `GET /systemusers?filter=password_expiration_date:$lte:2021-10-24` - `GET /systemusers?filter=department:$ne:Accounting` - `GET /systems?filter[0]=firstname:$eq:foo&filter[1]=lastname:$eq:bar` - this will AND the filters together. - `GET /systems?filter[or][0]=lastname:$eq:foo&filter[or][1]=lastname:$eq:bar` - this will OR the filters together. | + **xOrgId** | **optional.String**| | + +### Return type + +[**Systemuserreturn**](systemuserreturn.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **SystemusersList** +> Systemuserslist SystemusersList(ctx, optional) +List all system users + +This endpoint returns all systemusers. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/systemusers \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **optional** | ***SystemusersApiSystemusersListOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a SystemusersApiSystemusersListOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **limit** | **optional.Int32**| The number of records to return at once. | [default to 10] + **skip** | **optional.Int32**| The offset into the records to return. | [default to 0] + **sort** | **optional.String**| The space separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. | + **fields** | **optional.String**| The space separated fields included in the returned records. If omitted the default list of fields will be returned. | + **filter** | **optional.String**| A filter to apply to the query. See the supported operators below. For more complex searches, see the related `/search/<domain>` endpoints, e.g. `/search/systems`. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: - `$eq` (equals) - `$ne` (does not equal) - `$gt` (is greater than) - `$gte` (is greater than or equal to) - `$lt` (is less than) - `$lte` (is less than or equal to) _Note: v1 operators differ from v2 operators._ _Note: For v1 operators, excluding the `$` will result in undefined behavior._ **value** = Populate with the value you want to search for. Is case sensitive. **Examples** - `GET /users?filter=username:$eq:testuser` - `GET /systemusers?filter=password_expiration_date:$lte:2021-10-24` - `GET /systemusers?filter=department:$ne:Accounting` - `GET /systems?filter[0]=firstname:$eq:foo&filter[1]=lastname:$eq:bar` - this will AND the filters together. - `GET /systems?filter[or][0]=lastname:$eq:foo&filter[or][1]=lastname:$eq:bar` - this will OR the filters together. | + **xOrgId** | **optional.String**| | + **search** | **optional.String**| A nested object containing a `searchTerm` string or array of strings and a list of `fields` to search on. | + +### Return type + +[**Systemuserslist**](systemuserslist.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **SystemusersMfasync** +> SystemusersMfasync(ctx, id) +Sync a systemuser's mfa enrollment status + +This endpoint allows you to re-sync a user's mfa enrollment status #### Sample Request ``` curl -X POST \\ https://console.jumpcloud.com/api/systemusers/{UserID}/mfasync \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **id** | **string**| | + +### Return type + + (empty response body) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **SystemusersPost** +> Systemuserreturn SystemusersPost(ctx, optional) +Create a system user + +\"This endpoint allows you to create a new system user. #### Default User State The `state` of the user can be explicitly passed in or omitted. If `state` is omitted from the request, then the user will get created using the value returned from the [Get an Organization](https://docs.jumpcloud.com/api/1.0/index.html#operation/organizations_get) endpoint. The default user state for manually created users is stored in `settings.newSystemUserStateDefaults.manualEntry` These default state values can be changed in the admin portal settings or by using the [Update an Organization](https://docs.jumpcloud.com/api/1.0/index.html#operation/organization_put) endpoint. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/systemusers \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"username\":\"{username}\", \"email\":\"{email_address}\", \"firstname\":\"{Name}\", \"lastname\":\"{Name}\" }' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **optional** | ***SystemusersApiSystemusersPostOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a SystemusersApiSystemusersPostOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**optional.Interface of Systemuserputpost**](Systemuserputpost.md)| | + **xOrgId** | **optional.**| | + **fullValidationDetails** | **optional.**| Pass this query parameter when a client wants all validation errors to be returned with a detailed error response for the form field specified. The current form fields are allowed: * `password` #### Password validation flag Use the `password` validation flag to receive details on a possible bad request response ``` ?fullValidationDetails=password ``` Without the flag, default behavior will be a normal 400 with only a single validation string error #### Expected Behavior Clients can expect a list of validation error mappings for the validation query field in the details provided on the response: ``` { \"code\": 400, \"message\": \"Password validation fail\", \"status\": \"INVALID_ARGUMENT\", \"details\": [ { \"fieldViolationsList\": [ {\"field\": \"password\", \"description\": \"specialCharacter\"} ], '@type': 'type.googleapis.com/google.rpc.BadRequest', }, ], }, ``` | + +### Return type + +[**Systemuserreturn**](systemuserreturn.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **SystemusersPut** +> Systemuserreturn SystemusersPut(ctx, id, optional) +Update a system user + +This endpoint allows you to update a system user. #### Sample Request ``` curl -X PUT https://console.jumpcloud.com/api/systemusers/{UserID} \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"email\":\"{email_address}\", \"firstname\":\"{Name}\", \"lastname\":\"{Name}\" }' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **id** | **string**| | + **optional** | ***SystemusersApiSystemusersPutOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a SystemusersApiSystemusersPutOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **body** | [**optional.Interface of Systemuserput**](Systemuserput.md)| | + **xOrgId** | **optional.**| | + **fullValidationDetails** | **optional.**| This endpoint can take in a query when a client wants all validation errors to be returned with error response for the form field specified, i.e. 'password' #### Password validation flag Use the \"password\" validation flag to receive details on a possible bad request response Without the `password` flag, default behavior will be a normal 400 with only a validation string message ``` ?fullValidationDetails=password ``` #### Expected Behavior Clients can expect a list of validation error mappings for the validation query field in the details provided on the response: ``` { \"code\": 400, \"message\": \"Password validation fail\", \"status\": \"INVALID_ARGUMENT\", \"details\": [ { \"fieldViolationsList\": [{ \"field\": \"password\", \"description\": \"passwordHistory\" }], '@type': 'type.googleapis.com/google.rpc.BadRequest', }, ], }, ``` | + +### Return type + +[**Systemuserreturn**](systemuserreturn.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **SystemusersResetmfa** +> string SystemusersResetmfa(ctx, id, optional) +Reset a system user's MFA token + +This endpoint allows you to reset the TOTP key for a specified system user and put them in an TOTP MFA enrollment period. This will result in the user being prompted to setup TOTP MFA when logging into userportal. Please be aware that if the user does not complete TOTP MFA setup before the `exclusionUntil` date, they will be locked out of any resources that require TOTP MFA. Please refer to our [Knowledge Base Article](https://support.jumpcloud.com/customer/en/portal/articles/2959138-using-multifactor-authentication-with-jumpcloud) on setting up MFA for more information. #### Sample Request ``` curl -X POST \\ https://console.jumpcloud.com/api/systemusers/{UserID}/resetmfa \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{\"exclusion\": true, \"exclusionUntil\": \"{date-time}\"}' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **id** | **string**| | + **optional** | ***SystemusersApiSystemusersResetmfaOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a SystemusersApiSystemusersResetmfaOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **body** | [**optional.Interface of IdResetmfaBody**](IdResetmfaBody.md)| | + **xOrgId** | **optional.**| | + +### Return type + +**string** + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json, text/plain + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **SystemusersStateActivate** +> string SystemusersStateActivate(ctx, id, optional) +Activate System User + +This endpoint changes the state of a STAGED user to ACTIVATED. #### Email Flag Use the \"email\" flag to determine whether or not to send a Welcome or Activation email to the newly activated user. Sending an empty body without the `email` flag, will send an email with default behavior (see the \"Behavior\" section below) ``` {} ``` Sending `email=true` flag will send an email with default behavior (see `Behavior` below) ``` { \"email\": true } ``` Populated email will override the default behavior and send to the specified email value ``` { \"email\": \"example@example.com\" } ``` Sending `email=false` will suppress sending the email ``` { \"email\": false } ``` #### Behavior Users with a password will be sent a Welcome email to: - The address specified in `email` flag in the request - If no `email` flag, the user's primary email address (default behavior) Users without a password will be sent an Activation email to: - The address specified in `email` flag in the request - If no `email` flag, the user's alternate email address (default behavior) - If no alternate email address, the user's primary email address (default behavior) #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/systemusers/{id}/state/activate \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: ' \\ -d '{ \"email\": \"alternate-activation-email@email.com\" }' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **id** | **string**| | + **optional** | ***SystemusersApiSystemusersStateActivateOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a SystemusersApiSystemusersStateActivateOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **body** | [**optional.Interface of StateActivateBody**](StateActivateBody.md)| | + +### Return type + +**string** + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **SystemusersUnlock** +> string SystemusersUnlock(ctx, id, optional) +Unlock a system user + +This endpoint allows you to unlock a user's account. + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **id** | **string**| | + **optional** | ***SystemusersApiSystemusersUnlockOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a SystemusersApiSystemusersUnlockOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **xOrgId** | **optional.String**| | + +### Return type + +**string** + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json, text/plain + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/v1/docs/Systemuserslist.md b/jcapiv1/docs/Systemuserslist.md similarity index 99% rename from v1/docs/Systemuserslist.md rename to jcapiv1/docs/Systemuserslist.md index 7a6bada..ab12a51 100644 --- a/v1/docs/Systemuserslist.md +++ b/jcapiv1/docs/Systemuserslist.md @@ -8,4 +8,3 @@ Name | Type | Description | Notes [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/jcapiv1/docs/Triggerreturn.md b/jcapiv1/docs/Triggerreturn.md new file mode 100644 index 0000000..20e35e2 --- /dev/null +++ b/jcapiv1/docs/Triggerreturn.md @@ -0,0 +1,9 @@ +# Triggerreturn + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Triggered** | **[]string** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv1/docs/TrustedappConfigGet.md b/jcapiv1/docs/TrustedappConfigGet.md new file mode 100644 index 0000000..79925bd --- /dev/null +++ b/jcapiv1/docs/TrustedappConfigGet.md @@ -0,0 +1,10 @@ +# TrustedappConfigGet + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Checksum** | **string** | Checksum to validate the trustedApp configuration for the organization | [default to null] +**TrustedApps** | [**[]TrustedappConfigGetTrustedApps**](trustedappConfigGet_trustedApps.md) | List of authorized apps for the organization | [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv1/docs/TrustedappConfigGetTrustedApps.md b/jcapiv1/docs/TrustedappConfigGetTrustedApps.md new file mode 100644 index 0000000..b48c438 --- /dev/null +++ b/jcapiv1/docs/TrustedappConfigGetTrustedApps.md @@ -0,0 +1,11 @@ +# TrustedappConfigGetTrustedApps + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Name** | **string** | Name of the trusted application | [default to null] +**Path** | **string** | Absolute path for the app's location in user's device | [optional] [default to null] +**Teamid** | **string** | App's Team ID | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv1/docs/TrustedappConfigPut.md b/jcapiv1/docs/TrustedappConfigPut.md new file mode 100644 index 0000000..a522584 --- /dev/null +++ b/jcapiv1/docs/TrustedappConfigPut.md @@ -0,0 +1,9 @@ +# TrustedappConfigPut + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**TrustedApps** | [**[]TrustedappConfigGetTrustedApps**](trustedappConfigGet_trustedApps.md) | List of authorized apps for the organization | [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv1/docs/Userput.md b/jcapiv1/docs/Userput.md new file mode 100644 index 0000000..32cb5c5 --- /dev/null +++ b/jcapiv1/docs/Userput.md @@ -0,0 +1,15 @@ +# Userput + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Email** | **string** | | [optional] [default to null] +**EnableMultiFactor** | **bool** | | [optional] [default to null] +**Firstname** | **string** | | [optional] [default to null] +**GrowthData** | [***interface{}**](interface{}.md) | | [optional] [default to null] +**LastWhatsNewChecked** | **string** | | [optional] [default to null] +**Lastname** | **string** | | [optional] [default to null] +**RoleName** | **string** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv1/docs/Userreturn.md b/jcapiv1/docs/Userreturn.md new file mode 100644 index 0000000..4955a50 --- /dev/null +++ b/jcapiv1/docs/Userreturn.md @@ -0,0 +1,25 @@ +# Userreturn + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Id** | **string** | | [optional] [default to null] +**Created** | [**time.Time**](time.Time.md) | | [optional] [default to null] +**DisableIntroduction** | **bool** | | [optional] [default to null] +**Email** | **string** | | [optional] [default to null] +**EnableMultiFactor** | **bool** | | [optional] [default to null] +**Firstname** | **string** | | [optional] [default to null] +**GrowthData** | [***UserreturnGrowthData**](userreturn_growthData.md) | | [optional] [default to null] +**LastWhatsNewChecked** | [**time.Time**](time.Time.md) | | [optional] [default to null] +**Lastname** | **string** | | [optional] [default to null] +**Organization** | **string** | | [optional] [default to null] +**Provider** | **string** | | [optional] [default to null] +**Role** | **string** | | [optional] [default to null] +**RoleName** | **string** | | [optional] [default to null] +**SessionCount** | **int32** | | [optional] [default to null] +**Suspended** | **bool** | | [optional] [default to null] +**TotpEnrolled** | **bool** | | [optional] [default to null] +**UsersTimeZone** | **string** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv1/docs/UserreturnGrowthData.md b/jcapiv1/docs/UserreturnGrowthData.md new file mode 100644 index 0000000..55621a2 --- /dev/null +++ b/jcapiv1/docs/UserreturnGrowthData.md @@ -0,0 +1,10 @@ +# UserreturnGrowthData + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ExperimentStates** | [***interface{}**](interface{}.md) | | [optional] [default to null] +**OnboardingState** | [***interface{}**](interface{}.md) | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv1/docs/UsersApi.md b/jcapiv1/docs/UsersApi.md new file mode 100644 index 0000000..e90d01d --- /dev/null +++ b/jcapiv1/docs/UsersApi.md @@ -0,0 +1,103 @@ +# {{classname}} + +All URIs are relative to *https://console.jumpcloud.com/api* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**AdminTotpresetBegin**](UsersApi.md#AdminTotpresetBegin) | **Post** /users/resettotp/{id} | Administrator TOTP Reset Initiation +[**UsersPut**](UsersApi.md#UsersPut) | **Put** /users/{id} | Update a user +[**UsersReactivateGet**](UsersApi.md#UsersReactivateGet) | **Get** /users/reactivate/{id} | Administrator Password Reset Initiation + +# **AdminTotpresetBegin** +> AdminTotpresetBegin(ctx, id) +Administrator TOTP Reset Initiation + +This endpoint initiates a TOTP reset for an admin. This request does not accept a body. + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **id** | **string**| | + +### Return type + + (empty response body) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **UsersPut** +> Userreturn UsersPut(ctx, id, optional) +Update a user + +This endpoint allows you to update a user. + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **id** | **string**| | + **optional** | ***UsersApiUsersPutOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a UsersApiUsersPutOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **body** | [**optional.Interface of Userput**](Userput.md)| | + **xOrgId** | **optional.**| | + +### Return type + +[**Userreturn**](userreturn.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **UsersReactivateGet** +> UsersReactivateGet(ctx, id) +Administrator Password Reset Initiation + +This endpoint triggers the sending of a reactivation e-mail to an administrator. + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **id** | **string**| | + +### Return type + + (empty response body) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/jcapiv1/error_details.go b/jcapiv1/error_details.go new file mode 100644 index 0000000..d586d81 --- /dev/null +++ b/jcapiv1/error_details.go @@ -0,0 +1,26 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 1.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package jcapiv1 + +type ErrorDetails struct { + + // HTTP status code + Code int32 `json:"code,omitempty"` + + // Error message + Message string `json:"message,omitempty"` + + // HTTP status description + Status string `json:"status,omitempty"` + + // Describes a list of objects with more detailed information of the given error. Each detail schema is according to one of the messages defined in Google's API: https://github.com/googleapis/googleapis/blob/master/google/rpc/error_details.proto\" + Details []interface{} `json:"details,omitempty"` +} diff --git a/jcapiv1/fde.go b/jcapiv1/fde.go new file mode 100644 index 0000000..960a46c --- /dev/null +++ b/jcapiv1/fde.go @@ -0,0 +1,19 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 1.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package jcapiv1 + +// Indicates if the Full Disk Encryption is active in the system +type Fde struct { + + Active bool `json:"active,omitempty"` + + KeyPresent bool `json:"keyPresent,omitempty"` +} diff --git a/v1/git_push.sh b/jcapiv1/git_push.sh similarity index 100% rename from v1/git_push.sh rename to jcapiv1/git_push.sh diff --git a/jcapiv1/inline_response_412.go b/jcapiv1/inline_response_412.go new file mode 100644 index 0000000..5632bba --- /dev/null +++ b/jcapiv1/inline_response_412.go @@ -0,0 +1,17 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 1.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package jcapiv1 + +type InlineResponse412 struct { + + // mesasge containing what error occured + Error_ string `json:"error,omitempty"` +} diff --git a/jcapiv1/managed_service_provider_api.go b/jcapiv1/managed_service_provider_api.go new file mode 100644 index 0000000..adafe16 --- /dev/null +++ b/jcapiv1/managed_service_provider_api.go @@ -0,0 +1,380 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 1.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package jcapiv1 + +import ( + "io/ioutil" + "net/url" + "net/http" + "strings" + "golang.org/x/net/context" + "encoding/json" + "fmt" +) + +// Linger please +var ( + _ context.Context +) + +type ManagedServiceProviderApiService service + + +/* ManagedServiceProviderApiService Administrator TOTP Reset Initiation + This endpoint initiates a TOTP reset for an admin. This request does not accept a body. + * @param ctx context.Context for authentication, logging, tracing, etc. + @param id + @return */ +func (a *ManagedServiceProviderApiService) AdminTotpresetBegin(ctx context.Context, id string) ( *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Post") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/users/resettotp/{id}" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + + // to determine the Content-Type header + localVarHttpContentTypes := []string{ "application/json", } + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{ + "application/json", + } + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarHttpResponse, err + } + defer localVarHttpResponse.Body.Close() + if localVarHttpResponse.StatusCode >= 300 { + bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) + return localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) + } + + return localVarHttpResponse, err +} + +/* ManagedServiceProviderApiService Get Organization Details + This endpoint returns Organization Details. #### Sample Request ``` curl -X GET \\ https://console.jumpcloud.com/api/organizations \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + * @param ctx context.Context for authentication, logging, tracing, etc. + @param optional (nil or map[string]interface{}) with one or more of: + @param "fields" (string) Use a space seperated string of field parameters to include the data in the response. If omitted, the default list of fields will be returned. + @param "filter" (string) A filter to apply to the query. See the supported operators below. For more complex searches, see the related `/search/<domain>` endpoints, e.g. `/search/systems`. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: - `$eq` (equals) - `$ne` (does not equal) - `$gt` (is greater than) - `$gte` (is greater than or equal to) - `$lt` (is less than) - `$lte` (is less than or equal to) _Note: v1 operators differ from v2 operators._ _Note: For v1 operators, excluding the `$` will result in undefined behavior._ **value** = Populate with the value you want to search for. Is case sensitive. **Examples** - `GET /users?filter=username:$eq:testuser` - `GET /systemusers?filter=password_expiration_date:$lte:2021-10-24` - `GET /systemusers?filter=department:$ne:Accounting` - `GET /systems?filter[0]=firstname:$eq:foo&filter[1]=lastname:$eq:bar` - this will AND the filters together. - `GET /systems?filter[or][0]=lastname:$eq:foo&filter[or][1]=lastname:$eq:bar` - this will OR the filters together. + @param "limit" (int32) The number of records to return at once. Limited to 100. + @param "search" (string) A nested object containing a `searchTerm` string or array of strings and a list of `fields` to search on. + @param "skip" (int32) The offset into the records to return. + @param "sort" (string) Use space separated sort parameters to sort the collection. Default sort is ascending. Prefix with `-` to sort descending. + @return Organizationslist*/ +func (a *ManagedServiceProviderApiService) OrganizationList(ctx context.Context, localVarOptionals map[string]interface{}) (Organizationslist, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + successPayload Organizationslist + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/organizations" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if err := typeCheckParameter(localVarOptionals["fields"], "string", "fields"); err != nil { + return successPayload, nil, err + } + if err := typeCheckParameter(localVarOptionals["filter"], "string", "filter"); err != nil { + return successPayload, nil, err + } + if err := typeCheckParameter(localVarOptionals["limit"], "int32", "limit"); err != nil { + return successPayload, nil, err + } + if err := typeCheckParameter(localVarOptionals["search"], "string", "search"); err != nil { + return successPayload, nil, err + } + if err := typeCheckParameter(localVarOptionals["skip"], "int32", "skip"); err != nil { + return successPayload, nil, err + } + if err := typeCheckParameter(localVarOptionals["sort"], "string", "sort"); err != nil { + return successPayload, nil, err + } + + if localVarTempParam, localVarOk := localVarOptionals["fields"].(string); localVarOk { + localVarQueryParams.Add("fields", parameterToString(localVarTempParam, "")) + } + if localVarTempParam, localVarOk := localVarOptionals["filter"].(string); localVarOk { + localVarQueryParams.Add("filter", parameterToString(localVarTempParam, "")) + } + if localVarTempParam, localVarOk := localVarOptionals["limit"].(int32); localVarOk { + localVarQueryParams.Add("limit", parameterToString(localVarTempParam, "")) + } + if localVarTempParam, localVarOk := localVarOptionals["search"].(string); localVarOk { + localVarQueryParams.Add("search", parameterToString(localVarTempParam, "")) + } + if localVarTempParam, localVarOk := localVarOptionals["skip"].(int32); localVarOk { + localVarQueryParams.Add("skip", parameterToString(localVarTempParam, "")) + } + if localVarTempParam, localVarOk := localVarOptionals["sort"].(string); localVarOk { + localVarQueryParams.Add("sort", parameterToString(localVarTempParam, "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{ "application/json", } + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{ + "application/json", + } + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return successPayload, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return successPayload, localVarHttpResponse, err + } + defer localVarHttpResponse.Body.Close() + if localVarHttpResponse.StatusCode >= 300 { + bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) + return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) + } + + if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { + return successPayload, localVarHttpResponse, err + } + + + return successPayload, localVarHttpResponse, err +} + +/* ManagedServiceProviderApiService Update a user + This endpoint allows you to update a user. + * @param ctx context.Context for authentication, logging, tracing, etc. + @param id + @param optional (nil or map[string]interface{}) with one or more of: + @param "body" (Userput) + @param "xOrgId" (string) + @return Userreturn*/ +func (a *ManagedServiceProviderApiService) UsersPut(ctx context.Context, id string, localVarOptionals map[string]interface{}) (Userreturn, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Put") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + successPayload Userreturn + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/users/{id}" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { + return successPayload, nil, err + } + + // to determine the Content-Type header + localVarHttpContentTypes := []string{ "application/json", } + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{ + "application/json", + } + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { + localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") + } + // body params + if localVarTempParam, localVarOk := localVarOptionals["body"].(Userput); localVarOk { + localVarPostBody = &localVarTempParam + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return successPayload, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return successPayload, localVarHttpResponse, err + } + defer localVarHttpResponse.Body.Close() + if localVarHttpResponse.StatusCode >= 300 { + bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) + return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) + } + + if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { + return successPayload, localVarHttpResponse, err + } + + + return successPayload, localVarHttpResponse, err +} + +/* ManagedServiceProviderApiService Administrator Password Reset Initiation + This endpoint triggers the sending of a reactivation e-mail to an administrator. + * @param ctx context.Context for authentication, logging, tracing, etc. + @param id + @return */ +func (a *ManagedServiceProviderApiService) UsersReactivateGet(ctx context.Context, id string) ( *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/users/reactivate/{id}" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + + // to determine the Content-Type header + localVarHttpContentTypes := []string{ "application/json", } + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{ + "application/json", + } + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarHttpResponse, err + } + defer localVarHttpResponse.Body.Close() + if localVarHttpResponse.StatusCode >= 300 { + bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) + return localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) + } + + return localVarHttpResponse, err +} + diff --git a/jcapiv1/mfa.go b/jcapiv1/mfa.go new file mode 100644 index 0000000..1d2e943 --- /dev/null +++ b/jcapiv1/mfa.go @@ -0,0 +1,26 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 1.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package jcapiv1 + +import ( + "time" +) + +type Mfa struct { + + Configured bool `json:"configured,omitempty"` + + Exclusion bool `json:"exclusion,omitempty"` + + ExclusionDays int32 `json:"exclusionDays,omitempty"` + + ExclusionUntil time.Time `json:"exclusionUntil,omitempty"` +} diff --git a/jcapiv1/mfa_enrollment.go b/jcapiv1/mfa_enrollment.go new file mode 100644 index 0000000..f2e395f --- /dev/null +++ b/jcapiv1/mfa_enrollment.go @@ -0,0 +1,22 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 1.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package jcapiv1 + +type MfaEnrollment struct { + + OverallStatus *MfaEnrollmentStatus `json:"overallStatus,omitempty"` + + PushStatus *MfaEnrollmentStatus `json:"pushStatus,omitempty"` + + TotpStatus *MfaEnrollmentStatus `json:"totpStatus,omitempty"` + + WebAuthnStatus *MfaEnrollmentStatus `json:"webAuthnStatus,omitempty"` +} diff --git a/jcapiv1/mfa_enrollment_status.go b/jcapiv1/mfa_enrollment_status.go new file mode 100644 index 0000000..8a6fa77 --- /dev/null +++ b/jcapiv1/mfa_enrollment_status.go @@ -0,0 +1,24 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 1.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package jcapiv1 + +type mfaEnrollmentStatus string + +// List of mfaEnrollmentStatus +const ( + NOT_ENROLLED MfaEnrollmentStatus = "NOT_ENROLLED" + DISABLED MfaEnrollmentStatus = "DISABLED" + PENDING_ACTIVATION MfaEnrollmentStatus = "PENDING_ACTIVATION" + ENROLLMENT_EXPIRED MfaEnrollmentStatus = "ENROLLMENT_EXPIRED" + IN_ENROLLMENT MfaEnrollmentStatus = "IN_ENROLLMENT" + PRE_ENROLLMENT MfaEnrollmentStatus = "PRE_ENROLLMENT" + ENROLLED MfaEnrollmentStatus = "ENROLLED" +) diff --git a/jcapiv1/model_application.go b/jcapiv1/model_application.go new file mode 100644 index 0000000..5605c79 --- /dev/null +++ b/jcapiv1/model_application.go @@ -0,0 +1,29 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 1.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv1 + +type Application struct { + Id string `json:"_id,omitempty"` + Active bool `json:"active,omitempty"` + Beta bool `json:"beta,omitempty"` + Color string `json:"color,omitempty"` + Config *ApplicationConfig `json:"config"` + Created string `json:"created,omitempty"` + DatabaseAttributes []interface{} `json:"databaseAttributes,omitempty"` + Description string `json:"description,omitempty"` + DisplayLabel string `json:"displayLabel,omitempty"` + DisplayName string `json:"displayName,omitempty"` + LearnMore string `json:"learnMore,omitempty"` + Logo *ApplicationLogo `json:"logo,omitempty"` + Name string `json:"name"` + Organization string `json:"organization,omitempty"` + Sso *Sso `json:"sso,omitempty"` + SsoUrl string `json:"ssoUrl"` +} diff --git a/jcapiv1/model_application_config.go b/jcapiv1/model_application_config.go new file mode 100644 index 0000000..44b679f --- /dev/null +++ b/jcapiv1/model_application_config.go @@ -0,0 +1,20 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 1.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv1 + +type ApplicationConfig struct { + AcsUrl *ApplicationConfigAcsUrl `json:"acsUrl,omitempty"` + ConstantAttributes *ApplicationConfigConstantAttributes `json:"constantAttributes,omitempty"` + DatabaseAttributes *ApplicationConfigDatabaseAttributes `json:"databaseAttributes,omitempty"` + IdpCertificate *ApplicationConfigAcsUrl `json:"idpCertificate,omitempty"` + IdpEntityId *ApplicationConfigAcsUrl `json:"idpEntityId,omitempty"` + IdpPrivateKey *ApplicationConfigAcsUrl `json:"idpPrivateKey,omitempty"` + SpEntityId *ApplicationConfigAcsUrl `json:"spEntityId,omitempty"` +} diff --git a/jcapiv1/model_application_config_acs_url.go b/jcapiv1/model_application_config_acs_url.go new file mode 100644 index 0000000..f194998 --- /dev/null +++ b/jcapiv1/model_application_config_acs_url.go @@ -0,0 +1,23 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 1.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv1 + +type ApplicationConfigAcsUrl struct { + Label string `json:"label,omitempty"` + Options string `json:"options,omitempty"` + Position int32 `json:"position,omitempty"` + ReadOnly bool `json:"readOnly,omitempty"` + Required bool `json:"required,omitempty"` + Toggle string `json:"toggle,omitempty"` + Tooltip *ApplicationConfigAcsUrlTooltip `json:"tooltip,omitempty"` + Type_ string `json:"type,omitempty"` + Value string `json:"value,omitempty"` + Visible bool `json:"visible,omitempty"` +} diff --git a/jcapiv1/model_application_config_acs_url_tooltip.go b/jcapiv1/model_application_config_acs_url_tooltip.go new file mode 100644 index 0000000..9661302 --- /dev/null +++ b/jcapiv1/model_application_config_acs_url_tooltip.go @@ -0,0 +1,15 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 1.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv1 + +type ApplicationConfigAcsUrlTooltip struct { + Template string `json:"template,omitempty"` + Variables *ApplicationConfigAcsUrlTooltipVariables `json:"variables,omitempty"` +} diff --git a/jcapiv1/model_application_config_acs_url_tooltip_variables.go b/jcapiv1/model_application_config_acs_url_tooltip_variables.go new file mode 100644 index 0000000..7cfa1eb --- /dev/null +++ b/jcapiv1/model_application_config_acs_url_tooltip_variables.go @@ -0,0 +1,15 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 1.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv1 + +type ApplicationConfigAcsUrlTooltipVariables struct { + Icon string `json:"icon,omitempty"` + Message string `json:"message,omitempty"` +} diff --git a/jcapiv1/model_application_config_constant_attributes.go b/jcapiv1/model_application_config_constant_attributes.go new file mode 100644 index 0000000..122a2a3 --- /dev/null +++ b/jcapiv1/model_application_config_constant_attributes.go @@ -0,0 +1,22 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 1.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv1 + +type ApplicationConfigConstantAttributes struct { + Label string `json:"label,omitempty"` + Mutable bool `json:"mutable,omitempty"` + Position int32 `json:"position,omitempty"` + ReadOnly bool `json:"readOnly,omitempty"` + Required bool `json:"required,omitempty"` + Tooltip *ApplicationConfigAcsUrlTooltip `json:"tooltip,omitempty"` + Type_ string `json:"type,omitempty"` + Value []ApplicationConfigConstantAttributesValue `json:"value,omitempty"` + Visible bool `json:"visible,omitempty"` +} diff --git a/jcapiv1/model_application_config_constant_attributes_value.go b/jcapiv1/model_application_config_constant_attributes_value.go new file mode 100644 index 0000000..e79f846 --- /dev/null +++ b/jcapiv1/model_application_config_constant_attributes_value.go @@ -0,0 +1,18 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 1.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv1 + +type ApplicationConfigConstantAttributesValue struct { + Name string `json:"name,omitempty"` + ReadOnly bool `json:"readOnly,omitempty"` + Required bool `json:"required,omitempty"` + Value string `json:"value,omitempty"` + Visible bool `json:"visible,omitempty"` +} diff --git a/jcapiv1/model_application_config_database_attributes.go b/jcapiv1/model_application_config_database_attributes.go new file mode 100644 index 0000000..bc0d298 --- /dev/null +++ b/jcapiv1/model_application_config_database_attributes.go @@ -0,0 +1,14 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 1.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv1 + +type ApplicationConfigDatabaseAttributes struct { + Position int32 `json:"position,omitempty"` +} diff --git a/jcapiv1/model_application_logo.go b/jcapiv1/model_application_logo.go new file mode 100644 index 0000000..df78400 --- /dev/null +++ b/jcapiv1/model_application_logo.go @@ -0,0 +1,15 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 1.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv1 + +type ApplicationLogo struct { + Color string `json:"color,omitempty"` + Url string `json:"url,omitempty"` +} diff --git a/jcapiv1/model_applicationslist.go b/jcapiv1/model_applicationslist.go new file mode 100644 index 0000000..c85d17d --- /dev/null +++ b/jcapiv1/model_applicationslist.go @@ -0,0 +1,18 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 1.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv1 + +type Applicationslist struct { + Name string `json:"name,omitempty"` + // The list of applications. + Results []Application `json:"results,omitempty"` + // The total number of applications. + TotalCount int32 `json:"totalCount,omitempty"` +} diff --git a/jcapiv1/model_applicationtemplate.go b/jcapiv1/model_applicationtemplate.go new file mode 100644 index 0000000..3920a7d --- /dev/null +++ b/jcapiv1/model_applicationtemplate.go @@ -0,0 +1,32 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 1.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv1 + +type Applicationtemplate struct { + Id string `json:"_id,omitempty"` + Active bool `json:"active,omitempty"` + Beta bool `json:"beta,omitempty"` + Color string `json:"color,omitempty"` + Config *ApplicationConfig `json:"config,omitempty"` + DisplayLabel string `json:"displayLabel,omitempty"` + DisplayName string `json:"displayName,omitempty"` + IsConfigured bool `json:"isConfigured,omitempty"` + Jit *ApplicationtemplateJit `json:"jit,omitempty"` + Keywords []string `json:"keywords,omitempty"` + LearnMore string `json:"learnMore,omitempty"` + Logo *ApplicationtemplateLogo `json:"logo,omitempty"` + Name string `json:"name,omitempty"` + Oidc *ApplicationtemplateOidc `json:"oidc,omitempty"` + Provision *ApplicationtemplateProvision `json:"provision,omitempty"` + Sso *Sso `json:"sso,omitempty"` + SsoUrl string `json:"ssoUrl,omitempty"` + Status string `json:"status,omitempty"` + Test string `json:"test,omitempty"` +} diff --git a/jcapiv1/model_applicationtemplate_jit.go b/jcapiv1/model_applicationtemplate_jit.go new file mode 100644 index 0000000..25911e4 --- /dev/null +++ b/jcapiv1/model_applicationtemplate_jit.go @@ -0,0 +1,15 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 1.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv1 + +type ApplicationtemplateJit struct { + Attributes *interface{} `json:"attributes,omitempty"` + CreateOnly bool `json:"createOnly,omitempty"` +} diff --git a/jcapiv1/model_applicationtemplate_logo.go b/jcapiv1/model_applicationtemplate_logo.go new file mode 100644 index 0000000..839e25b --- /dev/null +++ b/jcapiv1/model_applicationtemplate_logo.go @@ -0,0 +1,14 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 1.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv1 + +type ApplicationtemplateLogo struct { + Url string `json:"url,omitempty"` +} diff --git a/jcapiv1/model_applicationtemplate_oidc.go b/jcapiv1/model_applicationtemplate_oidc.go new file mode 100644 index 0000000..ff9faf9 --- /dev/null +++ b/jcapiv1/model_applicationtemplate_oidc.go @@ -0,0 +1,21 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 1.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv1 + +type ApplicationtemplateOidc struct { + // The grant types allowed. Currently only authorization_code is allowed. + GrantTypes []string `json:"grantTypes,omitempty"` + // List of allowed redirectUris + RedirectUris []string `json:"redirectUris,omitempty"` + // The relying party url to trigger an oidc login. + SsoUrl string `json:"ssoUrl,omitempty"` + // Method that the client uses to authenticate when requesting a token. If 'none', then the client must use PKCE. If 'client_secret_post', then the secret is passed in the post body when requesting the token. + TokenEndpointAuthMethod string `json:"tokenEndpointAuthMethod,omitempty"` +} diff --git a/jcapiv1/model_applicationtemplate_provision.go b/jcapiv1/model_applicationtemplate_provision.go new file mode 100644 index 0000000..05876a3 --- /dev/null +++ b/jcapiv1/model_applicationtemplate_provision.go @@ -0,0 +1,16 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 1.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv1 + +type ApplicationtemplateProvision struct { + Beta bool `json:"beta,omitempty"` + GroupsSupported bool `json:"groups_supported,omitempty"` + Type_ string `json:"type,omitempty"` +} diff --git a/jcapiv1/model_applicationtemplateslist.go b/jcapiv1/model_applicationtemplateslist.go new file mode 100644 index 0000000..cbb6fa1 --- /dev/null +++ b/jcapiv1/model_applicationtemplateslist.go @@ -0,0 +1,17 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 1.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv1 + +type Applicationtemplateslist struct { + // The list of applications. + Results []Applicationtemplate `json:"results,omitempty"` + // The total number of applications. + TotalCount int32 `json:"totalCount,omitempty"` +} diff --git a/jcapiv1/model_command.go b/jcapiv1/model_command.go new file mode 100644 index 0000000..59c1d6d --- /dev/null +++ b/jcapiv1/model_command.go @@ -0,0 +1,48 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 1.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv1 + +type Command struct { + // The command to execute on the server. + Command string `json:"command"` + // An array of IDs of the Command Runner Users that can execute this command. + CommandRunners []string `json:"commandRunners,omitempty"` + // The Command OS + CommandType string `json:"commandType"` + // An array of file IDs to include with the command. + Files []string `json:"files,omitempty"` + // How the command will execute. + LaunchType string `json:"launchType,omitempty"` + ListensTo string `json:"listensTo,omitempty"` + Name string `json:"name"` + // The ID of the organization. + Organization string `json:"organization,omitempty"` + // A crontab that consists of: [ (seconds) (minutes) (hours) (days of month) (months) (weekdays) ] or [ immediate ]. If you send this as an empty string, it will run immediately. + Schedule string `json:"schedule,omitempty"` + // When the command will repeat. + ScheduleRepeatType string `json:"scheduleRepeatType,omitempty"` + // The year that a scheduled command will launch in. + ScheduleYear int32 `json:"scheduleYear,omitempty"` + // The shell used to run the command. + Shell string `json:"shell,omitempty"` + Sudo bool `json:"sudo,omitempty"` + // An array of system IDs to run the command on. Not available if you are using Groups. + Systems []string `json:"systems,omitempty"` + // The template this command was created from + Template string `json:"template,omitempty"` + // Time in seconds a command can wait in the queue to be run before timing out + TimeToLiveSeconds int32 `json:"timeToLiveSeconds,omitempty"` + // The time in seconds to allow the command to run for. + Timeout string `json:"timeout,omitempty"` + // The name of the command trigger. + Trigger string `json:"trigger,omitempty"` + // The ID of the system user to run the command as. This field is required when creating a command with a commandType of \"mac\" or \"linux\". + User string `json:"user,omitempty"` +} diff --git a/jcapiv1/model_commandfilereturn.go b/jcapiv1/model_commandfilereturn.go new file mode 100644 index 0000000..1d2b8b2 --- /dev/null +++ b/jcapiv1/model_commandfilereturn.go @@ -0,0 +1,16 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 1.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv1 + +type Commandfilereturn struct { + Results []CommandfilereturnResults `json:"results,omitempty"` + // The total number of commands files + TotalCount int32 `json:"totalCount,omitempty"` +} diff --git a/jcapiv1/model_commandfilereturn_results.go b/jcapiv1/model_commandfilereturn_results.go new file mode 100644 index 0000000..a5a06ec --- /dev/null +++ b/jcapiv1/model_commandfilereturn_results.go @@ -0,0 +1,19 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 1.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv1 + +type CommandfilereturnResults struct { + // The ID of the file. + Id string `json:"_id,omitempty"` + // The location where the file will be stored. + Destination string `json:"destination,omitempty"` + // The file name. + Name string `json:"name,omitempty"` +} diff --git a/jcapiv1/model_commandresult.go b/jcapiv1/model_commandresult.go new file mode 100644 index 0000000..29f2d98 --- /dev/null +++ b/jcapiv1/model_commandresult.go @@ -0,0 +1,41 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 1.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv1 +import ( + "time" +) + +type Commandresult struct { + // The ID of the command. + Id string `json:"_id,omitempty"` + // The command that was executed on the system. + Command string `json:"command,omitempty"` + // An array of file ids that were included in the command + Files []string `json:"files,omitempty"` + // The name of the command. + Name string `json:"name,omitempty"` + // The ID of the organization. + Organization string `json:"organization,omitempty"` + // The time that the command was sent. + RequestTime time.Time `json:"requestTime,omitempty"` + Response *CommandresultResponse `json:"response,omitempty"` + // The time that the command was completed. + ResponseTime time.Time `json:"responseTime,omitempty"` + // If the user had sudo rights + Sudo bool `json:"sudo,omitempty"` + // The name of the system the command was executed on. + System string `json:"system,omitempty"` + // The id of the system the command was executed on. + SystemId string `json:"systemId,omitempty"` + // The user the command ran as. + User string `json:"user,omitempty"` + WorkflowId string `json:"workflowId,omitempty"` + WorkflowInstanceId string `json:"workflowInstanceId,omitempty"` +} diff --git a/jcapiv1/model_commandresult_response.go b/jcapiv1/model_commandresult_response.go new file mode 100644 index 0000000..5d3ea7c --- /dev/null +++ b/jcapiv1/model_commandresult_response.go @@ -0,0 +1,18 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 1.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv1 + +type CommandresultResponse struct { + Data *CommandresultResponseData `json:"data,omitempty"` + // The stderr output from the command that ran. + Error_ string `json:"error,omitempty"` + // ID of the response. + Id string `json:"id,omitempty"` +} diff --git a/jcapiv1/model_commandresult_response_data.go b/jcapiv1/model_commandresult_response_data.go new file mode 100644 index 0000000..8ce0e2b --- /dev/null +++ b/jcapiv1/model_commandresult_response_data.go @@ -0,0 +1,17 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 1.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv1 + +type CommandresultResponseData struct { + // The stderr output from the command that ran. + ExitCode int32 `json:"exitCode,omitempty"` + // The output of the command that was executed. + Output string `json:"output,omitempty"` +} diff --git a/jcapiv1/model_commandresultslist.go b/jcapiv1/model_commandresultslist.go new file mode 100644 index 0000000..f266d57 --- /dev/null +++ b/jcapiv1/model_commandresultslist.go @@ -0,0 +1,16 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 1.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv1 + +type Commandresultslist struct { + Results []CommandresultslistResults `json:"results,omitempty"` + // The total number of command results. + TotalCount int32 `json:"totalCount,omitempty"` +} diff --git a/jcapiv1/model_commandresultslist_results.go b/jcapiv1/model_commandresultslist_results.go new file mode 100644 index 0000000..c3d89d3 --- /dev/null +++ b/jcapiv1/model_commandresultslist_results.go @@ -0,0 +1,38 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 1.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv1 +import ( + "time" +) + +type CommandresultslistResults struct { + // The ID of the command result. + Id string `json:"_id,omitempty"` + // The command that was executed on the system. + Command string `json:"command,omitempty"` + // The stderr output from the command that ran. + ExitCode int32 `json:"exitCode,omitempty"` + // The name of the command. + Name string `json:"name,omitempty"` + // The time (UTC) that the command was sent. + RequestTime time.Time `json:"requestTime,omitempty"` + // The time (UTC) that the command was completed. + ResponseTime time.Time `json:"responseTime,omitempty"` + // If the user had sudo rights. + Sudo bool `json:"sudo,omitempty"` + // The display name of the system the command was executed on. + System string `json:"system,omitempty"` + // The id of the system the command was executed on. + SystemId string `json:"systemId,omitempty"` + // The user the command ran as. + User string `json:"user,omitempty"` + // The id for the command that ran on the system. + WorkflowId string `json:"workflowId,omitempty"` +} diff --git a/jcapiv1/model_commandslist.go b/jcapiv1/model_commandslist.go new file mode 100644 index 0000000..fc19a35 --- /dev/null +++ b/jcapiv1/model_commandslist.go @@ -0,0 +1,16 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 1.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv1 + +type Commandslist struct { + Results []CommandslistResults `json:"results,omitempty"` + // The total number of commands + TotalCount int32 `json:"totalCount,omitempty"` +} diff --git a/jcapiv1/model_commandslist_results.go b/jcapiv1/model_commandslist_results.go new file mode 100644 index 0000000..164c165 --- /dev/null +++ b/jcapiv1/model_commandslist_results.go @@ -0,0 +1,32 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 1.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv1 + +type CommandslistResults struct { + // The ID of the command. + Id string `json:"_id,omitempty"` + // The Command to execute. + Command string `json:"command,omitempty"` + // The Command OS. + CommandType string `json:"commandType,omitempty"` + // How the Command is executed. + LaunchType string `json:"launchType,omitempty"` + ListensTo string `json:"listensTo,omitempty"` + // The name of the Command. + Name string `json:"name,omitempty"` + // The ID of the Organization. + Organization string `json:"organization,omitempty"` + // A crontab that consists of: [ (seconds) (minutes) (hours) (days of month) (months) (weekdays) ] or [ immediate ]. If you send this as an empty string, it will run immediately. + Schedule string `json:"schedule,omitempty"` + // When the command will repeat. + ScheduleRepeatType string `json:"scheduleRepeatType,omitempty"` + // Trigger to execute command. + Trigger string `json:"trigger,omitempty"` +} diff --git a/jcapiv1/model_error.go b/jcapiv1/model_error.go new file mode 100644 index 0000000..2598228 --- /dev/null +++ b/jcapiv1/model_error.go @@ -0,0 +1,19 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 1.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv1 + +type ModelError struct { + // HTTP status code + Code int32 `json:"code,omitempty"` + // Error message + Message string `json:"message,omitempty"` + // HTTP status description + Status string `json:"status,omitempty"` +} diff --git a/jcapiv1/model_error_details.go b/jcapiv1/model_error_details.go new file mode 100644 index 0000000..f8c241b --- /dev/null +++ b/jcapiv1/model_error_details.go @@ -0,0 +1,21 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 1.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv1 + +type ErrorDetails struct { + // HTTP status code + Code int32 `json:"code,omitempty"` + // Error message + Message string `json:"message,omitempty"` + // HTTP status description + Status string `json:"status,omitempty"` + // Describes a list of objects with more detailed information of the given error. Each detail schema is according to one of the messages defined in Google's API: https://github.com/googleapis/googleapis/blob/master/google/rpc/error_details.proto\" + Details []interface{} `json:"details,omitempty"` +} diff --git a/jcapiv1/model_fde.go b/jcapiv1/model_fde.go new file mode 100644 index 0000000..44e6086 --- /dev/null +++ b/jcapiv1/model_fde.go @@ -0,0 +1,16 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 1.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv1 + +// Indicates if the Full Disk Encryption is active in the system +type Fde struct { + Active bool `json:"active,omitempty"` + KeyPresent bool `json:"keyPresent,omitempty"` +} diff --git a/jcapiv1/model_id_resetmfa_body.go b/jcapiv1/model_id_resetmfa_body.go new file mode 100644 index 0000000..f995cc0 --- /dev/null +++ b/jcapiv1/model_id_resetmfa_body.go @@ -0,0 +1,19 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 1.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv1 +import ( + "time" +) + +type IdResetmfaBody struct { + Exclusion bool `json:"exclusion,omitempty"` + ExclusionDays float64 `json:"exclusionDays,omitempty"` + ExclusionUntil time.Time `json:"exclusionUntil,omitempty"` +} diff --git a/jcapiv1/model_mfa.go b/jcapiv1/model_mfa.go new file mode 100644 index 0000000..da32dfc --- /dev/null +++ b/jcapiv1/model_mfa.go @@ -0,0 +1,20 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 1.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv1 +import ( + "time" +) + +type Mfa struct { + Configured bool `json:"configured,omitempty"` + Exclusion bool `json:"exclusion,omitempty"` + ExclusionDays int32 `json:"exclusionDays,omitempty"` + ExclusionUntil time.Time `json:"exclusionUntil,omitempty"` +} diff --git a/jcapiv1/model_mfa_enrollment.go b/jcapiv1/model_mfa_enrollment.go new file mode 100644 index 0000000..0d984b6 --- /dev/null +++ b/jcapiv1/model_mfa_enrollment.go @@ -0,0 +1,17 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 1.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv1 + +type MfaEnrollment struct { + OverallStatus *MfaEnrollmentStatus `json:"overallStatus,omitempty"` + PushStatus *MfaEnrollmentStatus `json:"pushStatus,omitempty"` + TotpStatus *MfaEnrollmentStatus `json:"totpStatus,omitempty"` + WebAuthnStatus *MfaEnrollmentStatus `json:"webAuthnStatus,omitempty"` +} diff --git a/jcapiv1/model_mfa_enrollment_status.go b/jcapiv1/model_mfa_enrollment_status.go new file mode 100644 index 0000000..4862d0b --- /dev/null +++ b/jcapiv1/model_mfa_enrollment_status.go @@ -0,0 +1,23 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 1.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv1 + +type MfaEnrollmentStatus string + +// List of mfaEnrollmentStatus +const ( + NOT_ENROLLED_MfaEnrollmentStatus MfaEnrollmentStatus = "NOT_ENROLLED" + DISABLED_MfaEnrollmentStatus MfaEnrollmentStatus = "DISABLED" + PENDING_ACTIVATION_MfaEnrollmentStatus MfaEnrollmentStatus = "PENDING_ACTIVATION" + ENROLLMENT_EXPIRED_MfaEnrollmentStatus MfaEnrollmentStatus = "ENROLLMENT_EXPIRED" + IN_ENROLLMENT_MfaEnrollmentStatus MfaEnrollmentStatus = "IN_ENROLLMENT" + PRE_ENROLLMENT_MfaEnrollmentStatus MfaEnrollmentStatus = "PRE_ENROLLMENT" + ENROLLED_MfaEnrollmentStatus MfaEnrollmentStatus = "ENROLLED" +) diff --git a/jcapiv1/model_organization.go b/jcapiv1/model_organization.go new file mode 100644 index 0000000..444bfc7 --- /dev/null +++ b/jcapiv1/model_organization.go @@ -0,0 +1,26 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 1.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv1 + +type Organization struct { + Id string `json:"_id,omitempty"` + AccountsReceivable string `json:"accountsReceivable,omitempty"` + Created string `json:"created,omitempty"` + DisplayName string `json:"displayName,omitempty"` + Entitlement *Organizationentitlement `json:"entitlement,omitempty"` + HasCreditCard bool `json:"hasCreditCard,omitempty"` + HasStripeCustomerId bool `json:"hasStripeCustomerId,omitempty"` + LastEstimateCalculationTimeStamp string `json:"lastEstimateCalculationTimeStamp,omitempty"` + LastSfdcSyncStatus *interface{} `json:"lastSfdcSyncStatus,omitempty"` + LogoUrl string `json:"logoUrl,omitempty"` + Provider string `json:"provider,omitempty"` + Settings *Organizationsettings `json:"settings,omitempty"` + TotalBillingEstimate int32 `json:"totalBillingEstimate,omitempty"` +} diff --git a/jcapiv1/model_organizationentitlement.go b/jcapiv1/model_organizationentitlement.go new file mode 100644 index 0000000..77b9816 --- /dev/null +++ b/jcapiv1/model_organizationentitlement.go @@ -0,0 +1,17 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 1.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv1 + +type Organizationentitlement struct { + BillingModel string `json:"billingModel,omitempty"` + EntitlementProducts []OrganizationentitlementEntitlementProducts `json:"entitlementProducts,omitempty"` + IsManuallyBilled bool `json:"isManuallyBilled,omitempty"` + PricePerUserSum int32 `json:"pricePerUserSum,omitempty"` +} diff --git a/jcapiv1/model_organizationentitlement_entitlement_products.go b/jcapiv1/model_organizationentitlement_entitlement_products.go new file mode 100644 index 0000000..422d671 --- /dev/null +++ b/jcapiv1/model_organizationentitlement_entitlement_products.go @@ -0,0 +1,21 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 1.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv1 + +type OrganizationentitlementEntitlementProducts struct { + CommittedUsers int32 `json:"committedUsers,omitempty"` + ContractType string `json:"contractType,omitempty"` + MaxUserCount int32 `json:"maxUserCount,omitempty"` + Name string `json:"name,omitempty"` + PricePerUser int32 `json:"pricePerUser,omitempty"` + ProductCategory string `json:"productCategory,omitempty"` + ProductCode string `json:"productCode,omitempty"` + UncommittedUsers int32 `json:"uncommittedUsers,omitempty"` +} diff --git a/jcapiv1/model_organizations_id_body.go b/jcapiv1/model_organizations_id_body.go new file mode 100644 index 0000000..a9df51e --- /dev/null +++ b/jcapiv1/model_organizations_id_body.go @@ -0,0 +1,14 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 1.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv1 + +type OrganizationsIdBody struct { + Settings *Organizationsettingsput `json:"settings,omitempty"` +} diff --git a/jcapiv1/model_organizationsettings.go b/jcapiv1/model_organizationsettings.go new file mode 100644 index 0000000..57af94d --- /dev/null +++ b/jcapiv1/model_organizationsettings.go @@ -0,0 +1,44 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 1.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv1 + +type Organizationsettings struct { + AgentVersion string `json:"agentVersion,omitempty"` + BetaFeatures *interface{} `json:"betaFeatures,omitempty"` + ContactEmail string `json:"contactEmail,omitempty"` + ContactName string `json:"contactName,omitempty"` + DeviceIdentificationEnabled bool `json:"deviceIdentificationEnabled,omitempty"` + DisableCommandRunner bool `json:"disableCommandRunner,omitempty"` + DisableGoogleLogin bool `json:"disableGoogleLogin,omitempty"` + DisableLdap bool `json:"disableLdap,omitempty"` + DisableUM bool `json:"disableUM,omitempty"` + DisplayPreferences *OrganizationsettingsDisplayPreferences `json:"displayPreferences,omitempty"` + DuplicateLDAPGroups bool `json:"duplicateLDAPGroups,omitempty"` + EmailDisclaimer string `json:"emailDisclaimer,omitempty"` + EnableGoogleApps bool `json:"enableGoogleApps,omitempty"` + EnableManagedUID bool `json:"enableManagedUID,omitempty"` + EnableO365 bool `json:"enableO365,omitempty"` + EnableUserPortalAgentInstall bool `json:"enableUserPortalAgentInstall,omitempty"` + Features *OrganizationsettingsFeatures `json:"features,omitempty"` + // Object containing Optimizely experimentIds and states corresponding to them + GrowthData *interface{} `json:"growthData,omitempty"` + Logo string `json:"logo,omitempty"` + Name string `json:"name,omitempty"` + NewSystemUserStateDefaults *OrganizationsettingsNewSystemUserStateDefaults `json:"newSystemUserStateDefaults,omitempty"` + PasswordCompliance string `json:"passwordCompliance,omitempty"` + PasswordPolicy *OrganizationsettingsPasswordPolicy `json:"passwordPolicy,omitempty"` + PendingDelete bool `json:"pendingDelete,omitempty"` + ShowIntro bool `json:"showIntro,omitempty"` + SystemUserPasswordExpirationInDays int32 `json:"systemUserPasswordExpirationInDays,omitempty"` + SystemUsersCanEdit bool `json:"systemUsersCanEdit,omitempty"` + SystemUsersCap int32 `json:"systemUsersCap,omitempty"` + TrustedAppConfig *TrustedappConfigGet `json:"trustedAppConfig,omitempty"` + UserPortal *OrganizationsettingsUserPortal `json:"userPortal,omitempty"` +} diff --git a/jcapiv1/model_organizationsettings_display_preferences.go b/jcapiv1/model_organizationsettings_display_preferences.go new file mode 100644 index 0000000..12f85b2 --- /dev/null +++ b/jcapiv1/model_organizationsettings_display_preferences.go @@ -0,0 +1,14 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 1.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv1 + +type OrganizationsettingsDisplayPreferences struct { + OrgInsights *OrganizationsettingsDisplayPreferencesOrgInsights `json:"orgInsights,omitempty"` +} diff --git a/jcapiv1/model_organizationsettings_display_preferences_org_insights.go b/jcapiv1/model_organizationsettings_display_preferences_org_insights.go new file mode 100644 index 0000000..a7f0798 --- /dev/null +++ b/jcapiv1/model_organizationsettings_display_preferences_org_insights.go @@ -0,0 +1,32 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 1.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv1 + +type OrganizationsettingsDisplayPreferencesOrgInsights struct { + ApplicationsUsage *OrganizationsettingsDisplayPreferencesOrgInsightsApplicationsUsage `json:"applicationsUsage,omitempty"` + ConsoleStats *OrganizationsettingsDisplayPreferencesOrgInsightsConsoleStats `json:"consoleStats,omitempty"` + DeviceNotifications *OrganizationsettingsDisplayPreferencesOrgInsightsDeviceNotifications `json:"deviceNotifications,omitempty"` + DiskEncryption *OrganizationsettingsDisplayPreferencesOrgInsightsApplicationsUsage `json:"diskEncryption,omitempty"` + ExpiredPasswords *OrganizationsettingsDisplayPreferencesOrgInsightsApplicationsUsage `json:"expiredPasswords,omitempty"` + FailedCommands *OrganizationsettingsDisplayPreferencesOrgInsightsApplicationsUsage `json:"failedCommands,omitempty"` + FailedConfigurations *OrganizationsettingsDisplayPreferencesOrgInsightsApplicationsUsage `json:"failedConfigurations,omitempty"` + Fundamentals *OrganizationsettingsDisplayPreferencesOrgInsightsApplicationsUsage `json:"fundamentals,omitempty"` + JcUniversity *OrganizationsettingsDisplayPreferencesOrgInsightsApplicationsUsage `json:"jcUniversity,omitempty"` + LearningCenter *OrganizationsettingsDisplayPreferencesOrgInsightsApplicationsUsage `json:"learningCenter,omitempty"` + MdmCertificateExpirations *OrganizationsettingsDisplayPreferencesOrgInsightsApplicationsUsage `json:"mdmCertificateExpirations,omitempty"` + MfaEnrolledDevices *OrganizationsettingsDisplayPreferencesOrgInsightsApplicationsUsage `json:"mfaEnrolledDevices,omitempty"` + NewOSReleases *OrganizationsettingsDisplayPreferencesOrgInsightsApplicationsUsage `json:"newOSReleases,omitempty"` + NewUsers *OrganizationsettingsDisplayPreferencesOrgInsightsApplicationsUsage `json:"newUsers,omitempty"` + OfficeHours *OrganizationsettingsDisplayPreferencesOrgInsightsApplicationsUsage `json:"officeHours,omitempty"` + PendingCommands *OrganizationsettingsDisplayPreferencesOrgInsightsApplicationsUsage `json:"pendingCommands,omitempty"` + UpcomingPasswordExpiration *OrganizationsettingsDisplayPreferencesOrgInsightsApplicationsUsage `json:"upcomingPasswordExpiration,omitempty"` + UserLockouts *OrganizationsettingsDisplayPreferencesOrgInsightsApplicationsUsage `json:"userLockouts,omitempty"` + UserNotifications *OrganizationsettingsDisplayPreferencesOrgInsightsUserNotifications `json:"userNotifications,omitempty"` +} diff --git a/jcapiv1/model_organizationsettings_display_preferences_org_insights_applications_usage.go b/jcapiv1/model_organizationsettings_display_preferences_org_insights_applications_usage.go new file mode 100644 index 0000000..13a22e5 --- /dev/null +++ b/jcapiv1/model_organizationsettings_display_preferences_org_insights_applications_usage.go @@ -0,0 +1,14 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 1.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv1 + +type OrganizationsettingsDisplayPreferencesOrgInsightsApplicationsUsage struct { + Visible bool `json:"visible,omitempty"` +} diff --git a/jcapiv1/model_organizationsettings_display_preferences_org_insights_console_stats.go b/jcapiv1/model_organizationsettings_display_preferences_org_insights_console_stats.go new file mode 100644 index 0000000..79b8304 --- /dev/null +++ b/jcapiv1/model_organizationsettings_display_preferences_org_insights_console_stats.go @@ -0,0 +1,18 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 1.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv1 + +type OrganizationsettingsDisplayPreferencesOrgInsightsConsoleStats struct { + TotalApplications *OrganizationsettingsDisplayPreferencesOrgInsightsApplicationsUsage `json:"totalApplications,omitempty"` + TotalConfigurations *OrganizationsettingsDisplayPreferencesOrgInsightsApplicationsUsage `json:"totalConfigurations,omitempty"` + TotalDevices *OrganizationsettingsDisplayPreferencesOrgInsightsApplicationsUsage `json:"totalDevices,omitempty"` + TotalGroups *OrganizationsettingsDisplayPreferencesOrgInsightsApplicationsUsage `json:"totalGroups,omitempty"` + TotalUsers *OrganizationsettingsDisplayPreferencesOrgInsightsApplicationsUsage `json:"totalUsers,omitempty"` +} diff --git a/jcapiv1/model_organizationsettings_display_preferences_org_insights_device_notifications.go b/jcapiv1/model_organizationsettings_display_preferences_org_insights_device_notifications.go new file mode 100644 index 0000000..a7a4634 --- /dev/null +++ b/jcapiv1/model_organizationsettings_display_preferences_org_insights_device_notifications.go @@ -0,0 +1,19 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 1.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv1 + +type OrganizationsettingsDisplayPreferencesOrgInsightsDeviceNotifications struct { + AgentOutOfDateMetric *OrganizationsettingsDisplayPreferencesOrgInsightsApplicationsUsage `json:"agentOutOfDateMetric,omitempty"` + InactiveMetric *OrganizationsettingsDisplayPreferencesOrgInsightsApplicationsUsage `json:"inactiveMetric,omitempty"` + UptimeMetric *OrganizationsettingsDisplayPreferencesOrgInsightsApplicationsUsage `json:"uptimeMetric,omitempty"` + Visible bool `json:"visible,omitempty"` + WithoutPoliciesMetric *OrganizationsettingsDisplayPreferencesOrgInsightsApplicationsUsage `json:"withoutPoliciesMetric,omitempty"` + WithoutUsersMetric *OrganizationsettingsDisplayPreferencesOrgInsightsApplicationsUsage `json:"withoutUsersMetric,omitempty"` +} diff --git a/jcapiv1/model_organizationsettings_display_preferences_org_insights_user_notifications.go b/jcapiv1/model_organizationsettings_display_preferences_org_insights_user_notifications.go new file mode 100644 index 0000000..6ab940c --- /dev/null +++ b/jcapiv1/model_organizationsettings_display_preferences_org_insights_user_notifications.go @@ -0,0 +1,19 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 1.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv1 + +type OrganizationsettingsDisplayPreferencesOrgInsightsUserNotifications struct { + UserWithAdminSudoPasswordlessAccess *OrganizationsettingsDisplayPreferencesOrgInsightsApplicationsUsage `json:"userWithAdminSudoPasswordlessAccess,omitempty"` + UsersWithAdminSudoAccess *OrganizationsettingsDisplayPreferencesOrgInsightsApplicationsUsage `json:"usersWithAdminSudoAccess,omitempty"` + UsersWithSambaAccess *OrganizationsettingsDisplayPreferencesOrgInsightsApplicationsUsage `json:"usersWithSambaAccess,omitempty"` + UsersWithoutDevices *OrganizationsettingsDisplayPreferencesOrgInsightsApplicationsUsage `json:"usersWithoutDevices,omitempty"` + UsersWithoutPassword *OrganizationsettingsDisplayPreferencesOrgInsightsApplicationsUsage `json:"usersWithoutPassword,omitempty"` + Visible bool `json:"visible,omitempty"` +} diff --git a/jcapiv1/model_organizationsettings_features.go b/jcapiv1/model_organizationsettings_features.go new file mode 100644 index 0000000..531c28a --- /dev/null +++ b/jcapiv1/model_organizationsettings_features.go @@ -0,0 +1,16 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 1.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv1 + +type OrganizationsettingsFeatures struct { + DirectoryInsights *OrganizationsettingsFeaturesDirectoryInsights `json:"directoryInsights,omitempty"` + DirectoryInsightsPremium *OrganizationsettingsFeaturesDirectoryInsightsPremium `json:"directoryInsightsPremium,omitempty"` + SystemInsights *OrganizationsettingsFeaturesSystemInsights `json:"systemInsights,omitempty"` +} diff --git a/jcapiv1/model_organizationsettings_features_directory_insights.go b/jcapiv1/model_organizationsettings_features_directory_insights.go new file mode 100644 index 0000000..3e350bc --- /dev/null +++ b/jcapiv1/model_organizationsettings_features_directory_insights.go @@ -0,0 +1,14 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 1.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv1 + +type OrganizationsettingsFeaturesDirectoryInsights struct { + Enabled bool `json:"enabled,omitempty"` +} diff --git a/jcapiv1/model_organizationsettings_features_directory_insights_premium.go b/jcapiv1/model_organizationsettings_features_directory_insights_premium.go new file mode 100644 index 0000000..ab021b7 --- /dev/null +++ b/jcapiv1/model_organizationsettings_features_directory_insights_premium.go @@ -0,0 +1,16 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 1.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv1 + +type OrganizationsettingsFeaturesDirectoryInsightsPremium struct { + CreatedAt string `json:"createdAt,omitempty"` + Enabled bool `json:"enabled,omitempty"` + UpdatedAt string `json:"updatedAt,omitempty"` +} diff --git a/jcapiv1/model_organizationsettings_features_system_insights.go b/jcapiv1/model_organizationsettings_features_system_insights.go new file mode 100644 index 0000000..974e589 --- /dev/null +++ b/jcapiv1/model_organizationsettings_features_system_insights.go @@ -0,0 +1,19 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 1.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv1 + +type OrganizationsettingsFeaturesSystemInsights struct { + CreatedAt string `json:"createdAt,omitempty"` + EnableNewDarwin bool `json:"enableNewDarwin,omitempty"` + EnableNewLinux bool `json:"enableNewLinux,omitempty"` + EnableNewWindows bool `json:"enableNewWindows,omitempty"` + Enabled bool `json:"enabled,omitempty"` + UpdatedAt string `json:"updatedAt,omitempty"` +} diff --git a/jcapiv1/model_organizationsettings_new_system_user_state_defaults.go b/jcapiv1/model_organizationsettings_new_system_user_state_defaults.go new file mode 100644 index 0000000..ae33e68 --- /dev/null +++ b/jcapiv1/model_organizationsettings_new_system_user_state_defaults.go @@ -0,0 +1,19 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 1.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv1 + +type OrganizationsettingsNewSystemUserStateDefaults struct { + // The default user state for a user created using the [Bulk Users Create](https://docs.jumpcloud.com/api/2.0/index.html#operation/bulk_usersCreate) endpoint. See endpoint documentation for more details. + ApplicationImport string `json:"applicationImport,omitempty"` + // The default user state for a user created using the [Bulk Users Create](https://docs.jumpcloud.com/api/2.0/index.html#operation/bulk_usersCreate) endpoint. See endpoint documentation for more details. + CsvImport string `json:"csvImport,omitempty"` + // The default state for a user that is created using the [Create a system user](https://docs.jumpcloud.com/api/1.0/index.html#operation/systemusers_post) endpoint. See endpoint documentation for more details. + ManualEntry string `json:"manualEntry,omitempty"` +} diff --git a/jcapiv1/model_organizationsettings_password_policy.go b/jcapiv1/model_organizationsettings_password_policy.go new file mode 100644 index 0000000..0fa2c80 --- /dev/null +++ b/jcapiv1/model_organizationsettings_password_policy.go @@ -0,0 +1,40 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 1.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv1 + +type OrganizationsettingsPasswordPolicy struct { + AllowUsernameSubstring bool `json:"allowUsernameSubstring,omitempty"` + // Deprecated field used for the legacy grace period feature. + DaysAfterExpirationToSelfRecover int32 `json:"daysAfterExpirationToSelfRecover,omitempty"` + DaysBeforeExpirationToForceReset int32 `json:"daysBeforeExpirationToForceReset,omitempty"` + EffectiveDate string `json:"effectiveDate,omitempty"` + EnableDaysAfterExpirationToSelfRecover bool `json:"enableDaysAfterExpirationToSelfRecover,omitempty"` + EnableDaysBeforeExpirationToForceReset bool `json:"enableDaysBeforeExpirationToForceReset,omitempty"` + EnableLockoutTimeInSeconds bool `json:"enableLockoutTimeInSeconds,omitempty"` + EnableMaxHistory bool `json:"enableMaxHistory,omitempty"` + EnableMaxLoginAttempts bool `json:"enableMaxLoginAttempts,omitempty"` + EnableMinChangePeriodInDays bool `json:"enableMinChangePeriodInDays,omitempty"` + EnableMinLength bool `json:"enableMinLength,omitempty"` + EnablePasswordExpirationInDays bool `json:"enablePasswordExpirationInDays,omitempty"` + EnableRecoveryEmail bool `json:"enableRecoveryEmail,omitempty"` + EnableResetLockoutCounter bool `json:"enableResetLockoutCounter,omitempty"` + GracePeriodDate string `json:"gracePeriodDate,omitempty"` + LockoutTimeInSeconds int32 `json:"lockoutTimeInSeconds,omitempty"` + MaxHistory int32 `json:"maxHistory,omitempty"` + MaxLoginAttempts int32 `json:"maxLoginAttempts,omitempty"` + MinChangePeriodInDays int32 `json:"minChangePeriodInDays,omitempty"` + MinLength int32 `json:"minLength,omitempty"` + NeedsLowercase bool `json:"needsLowercase,omitempty"` + NeedsNumeric bool `json:"needsNumeric,omitempty"` + NeedsSymbolic bool `json:"needsSymbolic,omitempty"` + NeedsUppercase bool `json:"needsUppercase,omitempty"` + PasswordExpirationInDays int32 `json:"passwordExpirationInDays,omitempty"` + ResetLockoutCounterMinutes int32 `json:"resetLockoutCounterMinutes,omitempty"` +} diff --git a/jcapiv1/model_organizationsettings_user_portal.go b/jcapiv1/model_organizationsettings_user_portal.go new file mode 100644 index 0000000..9bd4e92 --- /dev/null +++ b/jcapiv1/model_organizationsettings_user_portal.go @@ -0,0 +1,14 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 1.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv1 + +type OrganizationsettingsUserPortal struct { + IdleSessionDurationMinutes int32 `json:"idleSessionDurationMinutes,omitempty"` +} diff --git a/jcapiv1/model_organizationsettingsput.go b/jcapiv1/model_organizationsettingsput.go new file mode 100644 index 0000000..b0e12aa --- /dev/null +++ b/jcapiv1/model_organizationsettingsput.go @@ -0,0 +1,36 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 1.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv1 + +type Organizationsettingsput struct { + ContactEmail string `json:"contactEmail,omitempty"` + ContactName string `json:"contactName,omitempty"` + DeviceIdentificationEnabled bool `json:"deviceIdentificationEnabled,omitempty"` + DisableGoogleLogin bool `json:"disableGoogleLogin,omitempty"` + DisableLdap bool `json:"disableLdap,omitempty"` + DisableUM bool `json:"disableUM,omitempty"` + DuplicateLDAPGroups bool `json:"duplicateLDAPGroups,omitempty"` + EmailDisclaimer string `json:"emailDisclaimer,omitempty"` + EnableManagedUID bool `json:"enableManagedUID,omitempty"` + Features *OrganizationsettingsFeatures `json:"features,omitempty"` + // Object containing Optimizely experimentIds and states corresponding to them + GrowthData *interface{} `json:"growthData,omitempty"` + Logo string `json:"logo,omitempty"` + Name string `json:"name,omitempty"` + NewSystemUserStateDefaults *OrganizationsettingsputNewSystemUserStateDefaults `json:"newSystemUserStateDefaults,omitempty"` + PasswordCompliance string `json:"passwordCompliance,omitempty"` + PasswordPolicy *OrganizationsettingsputPasswordPolicy `json:"passwordPolicy,omitempty"` + ShowIntro bool `json:"showIntro,omitempty"` + SystemUserPasswordExpirationInDays int32 `json:"systemUserPasswordExpirationInDays,omitempty"` + SystemUsersCanEdit bool `json:"systemUsersCanEdit,omitempty"` + SystemUsersCap int32 `json:"systemUsersCap,omitempty"` + TrustedAppConfig *TrustedappConfigPut `json:"trustedAppConfig,omitempty"` + UserPortal *OrganizationsettingsUserPortal `json:"userPortal,omitempty"` +} diff --git a/jcapiv1/model_organizationsettingsput_new_system_user_state_defaults.go b/jcapiv1/model_organizationsettingsput_new_system_user_state_defaults.go new file mode 100644 index 0000000..b6032ad --- /dev/null +++ b/jcapiv1/model_organizationsettingsput_new_system_user_state_defaults.go @@ -0,0 +1,16 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 1.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv1 + +type OrganizationsettingsputNewSystemUserStateDefaults struct { + ApplicationImport string `json:"applicationImport,omitempty"` + CsvImport string `json:"csvImport,omitempty"` + ManualEntry string `json:"manualEntry,omitempty"` +} diff --git a/jcapiv1/model_organizationsettingsput_password_policy.go b/jcapiv1/model_organizationsettingsput_password_policy.go new file mode 100644 index 0000000..cbba159 --- /dev/null +++ b/jcapiv1/model_organizationsettingsput_password_policy.go @@ -0,0 +1,37 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 1.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv1 + +type OrganizationsettingsputPasswordPolicy struct { + AllowUsernameSubstring bool `json:"allowUsernameSubstring,omitempty"` + // Deprecated field used for the legacy grace period feature. + DaysAfterExpirationToSelfRecover int32 `json:"daysAfterExpirationToSelfRecover,omitempty"` + DaysBeforeExpirationToForceReset int32 `json:"daysBeforeExpirationToForceReset,omitempty"` + EffectiveDate string `json:"effectiveDate,omitempty"` + EnableDaysAfterExpirationToSelfRecover bool `json:"enableDaysAfterExpirationToSelfRecover,omitempty"` + EnableDaysBeforeExpirationToForceReset bool `json:"enableDaysBeforeExpirationToForceReset,omitempty"` + EnableLockoutTimeInSeconds bool `json:"enableLockoutTimeInSeconds,omitempty"` + EnableMaxHistory bool `json:"enableMaxHistory,omitempty"` + EnableMaxLoginAttempts bool `json:"enableMaxLoginAttempts,omitempty"` + EnableMinChangePeriodInDays bool `json:"enableMinChangePeriodInDays,omitempty"` + EnableMinLength bool `json:"enableMinLength,omitempty"` + EnablePasswordExpirationInDays bool `json:"enablePasswordExpirationInDays,omitempty"` + GracePeriodDate string `json:"gracePeriodDate,omitempty"` + LockoutTimeInSeconds int32 `json:"lockoutTimeInSeconds,omitempty"` + MaxHistory int32 `json:"maxHistory,omitempty"` + MaxLoginAttempts int32 `json:"maxLoginAttempts,omitempty"` + MinChangePeriodInDays int32 `json:"minChangePeriodInDays,omitempty"` + MinLength int32 `json:"minLength,omitempty"` + NeedsLowercase bool `json:"needsLowercase,omitempty"` + NeedsNumeric bool `json:"needsNumeric,omitempty"` + NeedsSymbolic bool `json:"needsSymbolic,omitempty"` + NeedsUppercase bool `json:"needsUppercase,omitempty"` + PasswordExpirationInDays int32 `json:"passwordExpirationInDays,omitempty"` +} diff --git a/jcapiv1/model_organizationslist.go b/jcapiv1/model_organizationslist.go new file mode 100644 index 0000000..ac60894 --- /dev/null +++ b/jcapiv1/model_organizationslist.go @@ -0,0 +1,17 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 1.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv1 + +type Organizationslist struct { + // The list of organizations. + Results []OrganizationslistResults `json:"results,omitempty"` + // The total number of organizations. + TotalCount int32 `json:"totalCount,omitempty"` +} diff --git a/jcapiv1/model_organizationslist_results.go b/jcapiv1/model_organizationslist_results.go new file mode 100644 index 0000000..05e0232 --- /dev/null +++ b/jcapiv1/model_organizationslist_results.go @@ -0,0 +1,19 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 1.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv1 + +type OrganizationslistResults struct { + // The ID of the organization. + Id string `json:"_id,omitempty"` + // The name of the organization. + DisplayName string `json:"displayName,omitempty"` + // The organization logo image URL. + LogoUrl string `json:"logoUrl,omitempty"` +} diff --git a/jcapiv1/model_radiusserver.go b/jcapiv1/model_radiusserver.go new file mode 100644 index 0000000..6d1b43d --- /dev/null +++ b/jcapiv1/model_radiusserver.go @@ -0,0 +1,27 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 1.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv1 + +type Radiusserver struct { + Id string `json:"_id,omitempty"` + AuthIdp string `json:"authIdp,omitempty"` + DeviceCertEnabled bool `json:"deviceCertEnabled,omitempty"` + Mfa string `json:"mfa,omitempty"` + Name string `json:"name,omitempty"` + NetworkSourceIp string `json:"networkSourceIp,omitempty"` + Organization string `json:"organization,omitempty"` + SharedSecret string `json:"sharedSecret,omitempty"` + TagNames []string `json:"tagNames,omitempty"` + Tags []string `json:"tags,omitempty"` + UserCertEnabled bool `json:"userCertEnabled,omitempty"` + UserLockoutAction string `json:"userLockoutAction,omitempty"` + UserPasswordEnabled bool `json:"userPasswordEnabled,omitempty"` + UserPasswordExpirationAction string `json:"userPasswordExpirationAction,omitempty"` +} diff --git a/jcapiv1/model_radiusserverpost.go b/jcapiv1/model_radiusserverpost.go new file mode 100644 index 0000000..056753e --- /dev/null +++ b/jcapiv1/model_radiusserverpost.go @@ -0,0 +1,25 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 1.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv1 + +type Radiusserverpost struct { + AuthIdp string `json:"authIdp,omitempty"` + DeviceCertEnabled bool `json:"deviceCertEnabled,omitempty"` + Mfa string `json:"mfa,omitempty"` + Name string `json:"name"` + NetworkSourceIp string `json:"networkSourceIp"` + // RADIUS shared secret between the server and client. + SharedSecret string `json:"sharedSecret"` + TagNames []string `json:"tagNames,omitempty"` + UserCertEnabled bool `json:"userCertEnabled,omitempty"` + UserLockoutAction string `json:"userLockoutAction,omitempty"` + UserPasswordEnabled bool `json:"userPasswordEnabled,omitempty"` + UserPasswordExpirationAction string `json:"userPasswordExpirationAction,omitempty"` +} diff --git a/jcapiv1/model_radiusserverput.go b/jcapiv1/model_radiusserverput.go new file mode 100644 index 0000000..964b662 --- /dev/null +++ b/jcapiv1/model_radiusserverput.go @@ -0,0 +1,24 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 1.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv1 + +type Radiusserverput struct { + Id string `json:"_id,omitempty"` + AuthIdp string `json:"authIdp,omitempty"` + DeviceCertEnabled bool `json:"deviceCertEnabled,omitempty"` + Mfa string `json:"mfa,omitempty"` + Name string `json:"name,omitempty"` + NetworkSourceIp string `json:"networkSourceIp,omitempty"` + TagNames []string `json:"tagNames,omitempty"` + UserCertEnabled bool `json:"userCertEnabled,omitempty"` + UserLockoutAction string `json:"userLockoutAction,omitempty"` + UserPasswordEnabled bool `json:"userPasswordEnabled,omitempty"` + UserPasswordExpirationAction string `json:"userPasswordExpirationAction,omitempty"` +} diff --git a/jcapiv1/model_radiusservers_id_body.go b/jcapiv1/model_radiusservers_id_body.go new file mode 100644 index 0000000..6dafdf6 --- /dev/null +++ b/jcapiv1/model_radiusservers_id_body.go @@ -0,0 +1,23 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 1.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv1 + +type RadiusserversIdBody struct { + DeviceCertEnabled bool `json:"deviceCertEnabled,omitempty"` + Mfa string `json:"mfa,omitempty"` + Name string `json:"name"` + NetworkSourceIp string `json:"networkSourceIp"` + SharedSecret string `json:"sharedSecret"` + Tags []string `json:"tags,omitempty"` + UserCertEnabled bool `json:"userCertEnabled,omitempty"` + UserLockoutAction string `json:"userLockoutAction,omitempty"` + UserPasswordEnabled bool `json:"userPasswordEnabled,omitempty"` + UserPasswordExpirationAction string `json:"userPasswordExpirationAction,omitempty"` +} diff --git a/jcapiv1/model_radiusserverslist.go b/jcapiv1/model_radiusserverslist.go new file mode 100644 index 0000000..8155dad --- /dev/null +++ b/jcapiv1/model_radiusserverslist.go @@ -0,0 +1,15 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 1.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv1 + +type Radiusserverslist struct { + Results []Radiusserver `json:"results,omitempty"` + TotalCount int32 `json:"totalCount,omitempty"` +} diff --git a/jcapiv1/model_search.go b/jcapiv1/model_search.go new file mode 100644 index 0000000..ae65aa2 --- /dev/null +++ b/jcapiv1/model_search.go @@ -0,0 +1,16 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 1.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv1 + +type Search struct { + Fields string `json:"fields,omitempty"` + Filter *interface{} `json:"filter,omitempty"` + SearchFilter *interface{} `json:"searchFilter,omitempty"` +} diff --git a/jcapiv1/model_sshkeylist.go b/jcapiv1/model_sshkeylist.go new file mode 100644 index 0000000..0e6fa5a --- /dev/null +++ b/jcapiv1/model_sshkeylist.go @@ -0,0 +1,21 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 1.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv1 + +type Sshkeylist struct { + // The ID of the SSH key. + Id string `json:"_id,omitempty"` + // The date the SSH key was created. + CreateDate string `json:"create_date,omitempty"` + // The name of the SSH key. + Name string `json:"name,omitempty"` + // The Public SSH key. + PublicKey string `json:"public_key,omitempty"` +} diff --git a/jcapiv1/model_sshkeypost.go b/jcapiv1/model_sshkeypost.go new file mode 100644 index 0000000..461b97b --- /dev/null +++ b/jcapiv1/model_sshkeypost.go @@ -0,0 +1,17 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 1.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv1 + +type Sshkeypost struct { + // The name of the SSH key. + Name string `json:"name"` + // The Public SSH key. + PublicKey string `json:"public_key"` +} diff --git a/jcapiv1/model_sso.go b/jcapiv1/model_sso.go new file mode 100644 index 0000000..d184883 --- /dev/null +++ b/jcapiv1/model_sso.go @@ -0,0 +1,20 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 1.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv1 +import ( + "time" +) + +type Sso struct { + Beta bool `json:"beta,omitempty"` + IdpCertExpirationAt time.Time `json:"idpCertExpirationAt,omitempty"` + Jit bool `json:"jit,omitempty"` + Type_ string `json:"type,omitempty"` +} diff --git a/jcapiv1/model_state_activate_body.go b/jcapiv1/model_state_activate_body.go new file mode 100644 index 0000000..6781663 --- /dev/null +++ b/jcapiv1/model_state_activate_body.go @@ -0,0 +1,14 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 1.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv1 + +type StateActivateBody struct { + Email *interface{} `json:"email,omitempty"` +} diff --git a/jcapiv1/model_system.go b/jcapiv1/model_system.go new file mode 100644 index 0000000..8b5ad04 --- /dev/null +++ b/jcapiv1/model_system.go @@ -0,0 +1,57 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 1.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv1 +import ( + "time" +) + +type System struct { + Id string `json:"_id,omitempty"` + Active bool `json:"active,omitempty"` + AgentVersion string `json:"agentVersion,omitempty"` + AllowMultiFactorAuthentication bool `json:"allowMultiFactorAuthentication,omitempty"` + AllowPublicKeyAuthentication bool `json:"allowPublicKeyAuthentication,omitempty"` + AllowSshPasswordAuthentication bool `json:"allowSshPasswordAuthentication,omitempty"` + AllowSshRootLogin bool `json:"allowSshRootLogin,omitempty"` + AmazonInstanceID string `json:"amazonInstanceID,omitempty"` + Arch string `json:"arch,omitempty"` + AzureAdJoined bool `json:"azureAdJoined,omitempty"` + BuiltInCommands []SystemBuiltInCommands `json:"builtInCommands,omitempty"` + ConnectionHistory []interface{} `json:"connectionHistory,omitempty"` + Created time.Time `json:"created,omitempty"` + Description string `json:"description,omitempty"` + DisplayManager string `json:"displayManager,omitempty"` + DisplayName string `json:"displayName,omitempty"` + DomainInfo *SystemDomainInfo `json:"domainInfo,omitempty"` + Fde *Fde `json:"fde,omitempty"` + FileSystem string `json:"fileSystem,omitempty"` + HasServiceAccount bool `json:"hasServiceAccount,omitempty"` + Hostname string `json:"hostname,omitempty"` + LastContact time.Time `json:"lastContact,omitempty"` + Mdm *SystemMdm `json:"mdm,omitempty"` + ModifySSHDConfig bool `json:"modifySSHDConfig,omitempty"` + NetworkInterfaces []SystemNetworkInterfaces `json:"networkInterfaces,omitempty"` + Organization string `json:"organization,omitempty"` + Os string `json:"os,omitempty"` + OsFamily string `json:"osFamily,omitempty"` + OsVersionDetail *SystemOsVersionDetail `json:"osVersionDetail,omitempty"` + ProvisionMetadata *SystemProvisionMetadata `json:"provisionMetadata,omitempty"` + RemoteIP string `json:"remoteIP,omitempty"` + SerialNumber string `json:"serialNumber,omitempty"` + ServiceAccountState *SystemServiceAccountState `json:"serviceAccountState,omitempty"` + SshRootEnabled bool `json:"sshRootEnabled,omitempty"` + SshdParams []SystemSshdParams `json:"sshdParams,omitempty"` + SystemInsights *SystemSystemInsights `json:"systemInsights,omitempty"` + SystemTimezone int32 `json:"systemTimezone,omitempty"` + Tags []string `json:"tags,omitempty"` + TemplateName string `json:"templateName,omitempty"` + UserMetrics []SystemUserMetrics `json:"userMetrics,omitempty"` + Version string `json:"version,omitempty"` +} diff --git a/jcapiv1/model_system_built_in_commands.go b/jcapiv1/model_system_built_in_commands.go new file mode 100644 index 0000000..af2a3a5 --- /dev/null +++ b/jcapiv1/model_system_built_in_commands.go @@ -0,0 +1,15 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 1.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv1 + +type SystemBuiltInCommands struct { + Name string `json:"name,omitempty"` + Type_ string `json:"type,omitempty"` +} diff --git a/jcapiv1/model_system_domain_info.go b/jcapiv1/model_system_domain_info.go new file mode 100644 index 0000000..3d25769 --- /dev/null +++ b/jcapiv1/model_system_domain_info.go @@ -0,0 +1,15 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 1.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv1 + +type SystemDomainInfo struct { + DomainName string `json:"domainName,omitempty"` + PartOfDomain bool `json:"partOfDomain,omitempty"` +} diff --git a/jcapiv1/model_system_mdm.go b/jcapiv1/model_system_mdm.go new file mode 100644 index 0000000..e9b9871 --- /dev/null +++ b/jcapiv1/model_system_mdm.go @@ -0,0 +1,19 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 1.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv1 + +type SystemMdm struct { + Dep bool `json:"dep,omitempty"` + EnrollmentType string `json:"enrollmentType,omitempty"` + Internal *SystemMdmInternal `json:"internal,omitempty"` + ProfileIdentifier string `json:"profileIdentifier,omitempty"` + UserApproved bool `json:"userApproved,omitempty"` + Vendor string `json:"vendor,omitempty"` +} diff --git a/jcapiv1/model_system_mdm_internal.go b/jcapiv1/model_system_mdm_internal.go new file mode 100644 index 0000000..074e7e2 --- /dev/null +++ b/jcapiv1/model_system_mdm_internal.go @@ -0,0 +1,14 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 1.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv1 + +type SystemMdmInternal struct { + DeviceId string `json:"deviceId,omitempty"` +} diff --git a/jcapiv1/model_system_network_interfaces.go b/jcapiv1/model_system_network_interfaces.go new file mode 100644 index 0000000..23649c2 --- /dev/null +++ b/jcapiv1/model_system_network_interfaces.go @@ -0,0 +1,17 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 1.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv1 + +type SystemNetworkInterfaces struct { + Address string `json:"address,omitempty"` + Family string `json:"family,omitempty"` + Internal bool `json:"internal,omitempty"` + Name string `json:"name,omitempty"` +} diff --git a/jcapiv1/model_system_os_version_detail.go b/jcapiv1/model_system_os_version_detail.go new file mode 100644 index 0000000..cecb653 --- /dev/null +++ b/jcapiv1/model_system_os_version_detail.go @@ -0,0 +1,19 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 1.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv1 + +type SystemOsVersionDetail struct { + Major string `json:"major,omitempty"` + Minor string `json:"minor,omitempty"` + OsName string `json:"osName,omitempty"` + Patch string `json:"patch,omitempty"` + ReleaseName string `json:"releaseName,omitempty"` + Revision string `json:"revision,omitempty"` +} diff --git a/jcapiv1/model_system_provision_metadata.go b/jcapiv1/model_system_provision_metadata.go new file mode 100644 index 0000000..c4cd084 --- /dev/null +++ b/jcapiv1/model_system_provision_metadata.go @@ -0,0 +1,14 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 1.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv1 + +type SystemProvisionMetadata struct { + Provisioner *SystemProvisionMetadataProvisioner `json:"provisioner,omitempty"` +} diff --git a/jcapiv1/model_system_provision_metadata_provisioner.go b/jcapiv1/model_system_provision_metadata_provisioner.go new file mode 100644 index 0000000..884ad54 --- /dev/null +++ b/jcapiv1/model_system_provision_metadata_provisioner.go @@ -0,0 +1,15 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 1.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv1 + +type SystemProvisionMetadataProvisioner struct { + ProvisionerId string `json:"provisionerId,omitempty"` + Type_ string `json:"type,omitempty"` +} diff --git a/jcapiv1/model_system_service_account_state.go b/jcapiv1/model_system_service_account_state.go new file mode 100644 index 0000000..510dcc0 --- /dev/null +++ b/jcapiv1/model_system_service_account_state.go @@ -0,0 +1,16 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 1.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv1 + +type SystemServiceAccountState struct { + HasSecureToken bool `json:"hasSecureToken,omitempty"` + PasswordAPFSValid bool `json:"passwordAPFSValid,omitempty"` + PasswordODValid bool `json:"passwordODValid,omitempty"` +} diff --git a/jcapiv1/model_system_sshd_params.go b/jcapiv1/model_system_sshd_params.go new file mode 100644 index 0000000..374acb7 --- /dev/null +++ b/jcapiv1/model_system_sshd_params.go @@ -0,0 +1,15 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 1.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv1 + +type SystemSshdParams struct { + Name string `json:"name,omitempty"` + Value string `json:"value,omitempty"` +} diff --git a/jcapiv1/model_system_system_insights.go b/jcapiv1/model_system_system_insights.go new file mode 100644 index 0000000..dfcc3fb --- /dev/null +++ b/jcapiv1/model_system_system_insights.go @@ -0,0 +1,14 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 1.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv1 + +type SystemSystemInsights struct { + State string `json:"state,omitempty"` +} diff --git a/jcapiv1/model_system_user_metrics.go b/jcapiv1/model_system_user_metrics.go new file mode 100644 index 0000000..28181ef --- /dev/null +++ b/jcapiv1/model_system_user_metrics.go @@ -0,0 +1,18 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 1.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv1 + +type SystemUserMetrics struct { + Admin bool `json:"admin,omitempty"` + Managed bool `json:"managed,omitempty"` + SecureTokenEnabled bool `json:"secureTokenEnabled,omitempty"` + Suspended bool `json:"suspended,omitempty"` + UserName string `json:"userName,omitempty"` +} diff --git a/jcapiv1/model_systemput.go b/jcapiv1/model_systemput.go new file mode 100644 index 0000000..b4b2271 --- /dev/null +++ b/jcapiv1/model_systemput.go @@ -0,0 +1,20 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 1.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv1 + +type Systemput struct { + AgentBoundMessages []SystemputAgentBoundMessages `json:"agentBoundMessages,omitempty"` + AllowMultiFactorAuthentication bool `json:"allowMultiFactorAuthentication,omitempty"` + AllowPublicKeyAuthentication bool `json:"allowPublicKeyAuthentication,omitempty"` + AllowSshPasswordAuthentication bool `json:"allowSshPasswordAuthentication,omitempty"` + AllowSshRootLogin bool `json:"allowSshRootLogin,omitempty"` + DisplayName string `json:"displayName,omitempty"` + Tags []string `json:"tags,omitempty"` +} diff --git a/jcapiv1/model_systemput_agent_bound_messages.go b/jcapiv1/model_systemput_agent_bound_messages.go new file mode 100644 index 0000000..c4e532b --- /dev/null +++ b/jcapiv1/model_systemput_agent_bound_messages.go @@ -0,0 +1,14 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 1.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv1 + +type SystemputAgentBoundMessages struct { + Cmd string `json:"cmd,omitempty"` +} diff --git a/jcapiv1/model_systemslist.go b/jcapiv1/model_systemslist.go new file mode 100644 index 0000000..640ad5b --- /dev/null +++ b/jcapiv1/model_systemslist.go @@ -0,0 +1,17 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 1.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv1 + +type Systemslist struct { + // The list of systems. + Results []System `json:"results,omitempty"` + // The total number of systems. + TotalCount int32 `json:"totalCount,omitempty"` +} diff --git a/jcapiv1/model_systemuserput.go b/jcapiv1/model_systemuserput.go new file mode 100644 index 0000000..429ec58 --- /dev/null +++ b/jcapiv1/model_systemuserput.go @@ -0,0 +1,59 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 1.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv1 + +type Systemuserput struct { + AccountLocked bool `json:"account_locked,omitempty"` + // type, poBox, extendedAddress, streetAddress, locality, region, postalCode, country + Addresses []SystemuserputAddresses `json:"addresses,omitempty"` + AllowPublicKey bool `json:"allow_public_key,omitempty"` + AlternateEmail string `json:"alternateEmail,omitempty"` + Attributes []SystemuserputAttributes `json:"attributes,omitempty"` + Company string `json:"company,omitempty"` + CostCenter string `json:"costCenter,omitempty"` + Department string `json:"department,omitempty"` + Description string `json:"description,omitempty"` + DisableDeviceMaxLoginAttempts bool `json:"disableDeviceMaxLoginAttempts,omitempty"` + Displayname string `json:"displayname,omitempty"` + Email string `json:"email,omitempty"` + // Must be unique per user. + EmployeeIdentifier string `json:"employeeIdentifier,omitempty"` + EmployeeType string `json:"employeeType,omitempty"` + EnableManagedUid bool `json:"enable_managed_uid,omitempty"` + EnableUserPortalMultifactor bool `json:"enable_user_portal_multifactor,omitempty"` + ExternalDn string `json:"external_dn,omitempty"` + ExternalPasswordExpirationDate string `json:"external_password_expiration_date,omitempty"` + ExternalSourceType string `json:"external_source_type,omitempty"` + ExternallyManaged bool `json:"externally_managed,omitempty"` + Firstname string `json:"firstname,omitempty"` + JobTitle string `json:"jobTitle,omitempty"` + Lastname string `json:"lastname,omitempty"` + LdapBindingUser bool `json:"ldap_binding_user,omitempty"` + Location string `json:"location,omitempty"` + ManagedAppleId string `json:"managedAppleId,omitempty"` + // Relation with another systemuser to identify the last as a manager. + Manager string `json:"manager,omitempty"` + Mfa *Mfa `json:"mfa,omitempty"` + Middlename string `json:"middlename,omitempty"` + Password string `json:"password,omitempty"` + PasswordNeverExpires bool `json:"password_never_expires,omitempty"` + PhoneNumbers []SystemuserputPhoneNumbers `json:"phoneNumbers,omitempty"` + PublicKey string `json:"public_key,omitempty"` + Relationships []SystemuserputRelationships `json:"relationships,omitempty"` + SambaServiceUser bool `json:"samba_service_user,omitempty"` + SshKeys []Sshkeypost `json:"ssh_keys,omitempty"` + State string `json:"state,omitempty"` + Sudo bool `json:"sudo,omitempty"` + Suspended bool `json:"suspended,omitempty"` + Tags []string `json:"tags,omitempty"` + UnixGuid int32 `json:"unix_guid,omitempty"` + UnixUid int32 `json:"unix_uid,omitempty"` + Username string `json:"username,omitempty"` +} diff --git a/jcapiv1/model_systemuserput_addresses.go b/jcapiv1/model_systemuserput_addresses.go new file mode 100644 index 0000000..b8623ae --- /dev/null +++ b/jcapiv1/model_systemuserput_addresses.go @@ -0,0 +1,21 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 1.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv1 + +type SystemuserputAddresses struct { + Country string `json:"country,omitempty"` + ExtendedAddress string `json:"extendedAddress,omitempty"` + Locality string `json:"locality,omitempty"` + PoBox string `json:"poBox,omitempty"` + PostalCode string `json:"postalCode,omitempty"` + Region string `json:"region,omitempty"` + StreetAddress string `json:"streetAddress,omitempty"` + Type_ string `json:"type,omitempty"` +} diff --git a/jcapiv1/model_systemuserput_attributes.go b/jcapiv1/model_systemuserput_attributes.go new file mode 100644 index 0000000..1a4326c --- /dev/null +++ b/jcapiv1/model_systemuserput_attributes.go @@ -0,0 +1,15 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 1.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv1 + +type SystemuserputAttributes struct { + Name string `json:"name,omitempty"` + Value string `json:"value,omitempty"` +} diff --git a/jcapiv1/model_systemuserput_phone_numbers.go b/jcapiv1/model_systemuserput_phone_numbers.go new file mode 100644 index 0000000..757312c --- /dev/null +++ b/jcapiv1/model_systemuserput_phone_numbers.go @@ -0,0 +1,15 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 1.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv1 + +type SystemuserputPhoneNumbers struct { + Number string `json:"number,omitempty"` + Type_ string `json:"type,omitempty"` +} diff --git a/jcapiv1/model_systemuserput_relationships.go b/jcapiv1/model_systemuserput_relationships.go new file mode 100644 index 0000000..78b0caf --- /dev/null +++ b/jcapiv1/model_systemuserput_relationships.go @@ -0,0 +1,15 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 1.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv1 + +type SystemuserputRelationships struct { + Type_ string `json:"type,omitempty"` + Value string `json:"value,omitempty"` +} diff --git a/jcapiv1/model_systemuserputpost.go b/jcapiv1/model_systemuserputpost.go new file mode 100644 index 0000000..61bcc81 --- /dev/null +++ b/jcapiv1/model_systemuserputpost.go @@ -0,0 +1,63 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 1.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv1 +import ( + "time" +) + +type Systemuserputpost struct { + AccountLocked bool `json:"account_locked,omitempty"` + Activated bool `json:"activated,omitempty"` + Addresses []SystemuserputpostAddresses `json:"addresses,omitempty"` + AllowPublicKey bool `json:"allow_public_key,omitempty"` + AlternateEmail string `json:"alternateEmail,omitempty"` + Attributes []SystemuserputAttributes `json:"attributes,omitempty"` + Company string `json:"company,omitempty"` + CostCenter string `json:"costCenter,omitempty"` + Department string `json:"department,omitempty"` + Description string `json:"description,omitempty"` + DisableDeviceMaxLoginAttempts bool `json:"disableDeviceMaxLoginAttempts,omitempty"` + Displayname string `json:"displayname,omitempty"` + Email string `json:"email"` + // Must be unique per user. + EmployeeIdentifier string `json:"employeeIdentifier,omitempty"` + EmployeeType string `json:"employeeType,omitempty"` + EnableManagedUid bool `json:"enable_managed_uid,omitempty"` + EnableUserPortalMultifactor bool `json:"enable_user_portal_multifactor,omitempty"` + ExternalDn string `json:"external_dn,omitempty"` + ExternalPasswordExpirationDate time.Time `json:"external_password_expiration_date,omitempty"` + ExternalSourceType string `json:"external_source_type,omitempty"` + ExternallyManaged bool `json:"externally_managed,omitempty"` + Firstname string `json:"firstname,omitempty"` + JobTitle string `json:"jobTitle,omitempty"` + Lastname string `json:"lastname,omitempty"` + LdapBindingUser bool `json:"ldap_binding_user,omitempty"` + Location string `json:"location,omitempty"` + ManagedAppleId string `json:"managedAppleId,omitempty"` + // Relation with another systemuser to identify the last as a manager. + Manager string `json:"manager,omitempty"` + Mfa *Mfa `json:"mfa,omitempty"` + Middlename string `json:"middlename,omitempty"` + Password string `json:"password,omitempty"` + PasswordNeverExpires bool `json:"password_never_expires,omitempty"` + PasswordlessSudo bool `json:"passwordless_sudo,omitempty"` + PhoneNumbers []SystemuserputpostPhoneNumbers `json:"phoneNumbers,omitempty"` + PublicKey string `json:"public_key,omitempty"` + RecoveryEmail *SystemuserputpostRecoveryEmail `json:"recoveryEmail,omitempty"` + Relationships []SystemuserputRelationships `json:"relationships,omitempty"` + SambaServiceUser bool `json:"samba_service_user,omitempty"` + State string `json:"state,omitempty"` + Sudo bool `json:"sudo,omitempty"` + Suspended bool `json:"suspended,omitempty"` + Tags []string `json:"tags,omitempty"` + UnixGuid int32 `json:"unix_guid,omitempty"` + UnixUid int32 `json:"unix_uid,omitempty"` + Username string `json:"username"` +} diff --git a/jcapiv1/model_systemuserputpost_addresses.go b/jcapiv1/model_systemuserputpost_addresses.go new file mode 100644 index 0000000..cb0e1da --- /dev/null +++ b/jcapiv1/model_systemuserputpost_addresses.go @@ -0,0 +1,21 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 1.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv1 + +type SystemuserputpostAddresses struct { + Country string `json:"country,omitempty"` + ExtendedAddress string `json:"extendedAddress,omitempty"` + Locality string `json:"locality,omitempty"` + PoBox string `json:"poBox,omitempty"` + PostalCode string `json:"postalCode,omitempty"` + Region string `json:"region,omitempty"` + StreetAddress string `json:"streetAddress,omitempty"` + Type_ string `json:"type,omitempty"` +} diff --git a/jcapiv1/model_systemuserputpost_phone_numbers.go b/jcapiv1/model_systemuserputpost_phone_numbers.go new file mode 100644 index 0000000..5841191 --- /dev/null +++ b/jcapiv1/model_systemuserputpost_phone_numbers.go @@ -0,0 +1,15 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 1.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv1 + +type SystemuserputpostPhoneNumbers struct { + Number string `json:"number,omitempty"` + Type_ string `json:"type,omitempty"` +} diff --git a/jcapiv1/model_systemuserputpost_recovery_email.go b/jcapiv1/model_systemuserputpost_recovery_email.go new file mode 100644 index 0000000..1ab7379 --- /dev/null +++ b/jcapiv1/model_systemuserputpost_recovery_email.go @@ -0,0 +1,14 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 1.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv1 + +type SystemuserputpostRecoveryEmail struct { + Address string `json:"address,omitempty"` +} diff --git a/jcapiv1/model_systemuserreturn.go b/jcapiv1/model_systemuserreturn.go new file mode 100644 index 0000000..645c92b --- /dev/null +++ b/jcapiv1/model_systemuserreturn.go @@ -0,0 +1,70 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 1.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv1 + +type Systemuserreturn struct { + Id string `json:"_id,omitempty"` + AccountLocked bool `json:"account_locked,omitempty"` + AccountLockedDate string `json:"account_locked_date,omitempty"` + Activated bool `json:"activated,omitempty"` + Addresses []SystemuserreturnAddresses `json:"addresses,omitempty"` + AllowPublicKey bool `json:"allow_public_key,omitempty"` + AlternateEmail string `json:"alternateEmail,omitempty"` + Attributes []SystemuserputAttributes `json:"attributes,omitempty"` + BadLoginAttempts int32 `json:"badLoginAttempts,omitempty"` + Company string `json:"company,omitempty"` + CostCenter string `json:"costCenter,omitempty"` + Created string `json:"created,omitempty"` + CreationSource string `json:"creationSource,omitempty"` + Department string `json:"department,omitempty"` + Description string `json:"description,omitempty"` + DisableDeviceMaxLoginAttempts bool `json:"disableDeviceMaxLoginAttempts,omitempty"` + Displayname string `json:"displayname,omitempty"` + Email string `json:"email,omitempty"` + // Must be unique per user. + EmployeeIdentifier string `json:"employeeIdentifier,omitempty"` + EmployeeType string `json:"employeeType,omitempty"` + EnableManagedUid bool `json:"enable_managed_uid,omitempty"` + EnableUserPortalMultifactor bool `json:"enable_user_portal_multifactor,omitempty"` + ExternalDn string `json:"external_dn,omitempty"` + ExternalPasswordExpirationDate string `json:"external_password_expiration_date,omitempty"` + ExternalSourceType string `json:"external_source_type,omitempty"` + ExternallyManaged bool `json:"externally_managed,omitempty"` + Firstname string `json:"firstname,omitempty"` + JobTitle string `json:"jobTitle,omitempty"` + Lastname string `json:"lastname,omitempty"` + LdapBindingUser bool `json:"ldap_binding_user,omitempty"` + Location string `json:"location,omitempty"` + ManagedAppleId string `json:"managedAppleId,omitempty"` + // Relation with another systemuser to identify the last as a manager. + Manager string `json:"manager,omitempty"` + Mfa *Mfa `json:"mfa,omitempty"` + MfaEnrollment *MfaEnrollment `json:"mfaEnrollment,omitempty"` + Middlename string `json:"middlename,omitempty"` + Organization string `json:"organization,omitempty"` + PasswordExpirationDate string `json:"password_expiration_date,omitempty"` + PasswordExpired bool `json:"password_expired,omitempty"` + PasswordNeverExpires bool `json:"password_never_expires,omitempty"` + PasswordlessSudo bool `json:"passwordless_sudo,omitempty"` + PhoneNumbers []SystemuserreturnPhoneNumbers `json:"phoneNumbers,omitempty"` + PublicKey string `json:"public_key,omitempty"` + RecoveryEmail *SystemuserreturnRecoveryEmail `json:"recoveryEmail,omitempty"` + Relationships []SystemuserputRelationships `json:"relationships,omitempty"` + SambaServiceUser bool `json:"samba_service_user,omitempty"` + SshKeys []Sshkeylist `json:"ssh_keys,omitempty"` + State string `json:"state,omitempty"` + Sudo bool `json:"sudo,omitempty"` + Suspended bool `json:"suspended,omitempty"` + Tags []string `json:"tags,omitempty"` + TotpEnabled bool `json:"totp_enabled,omitempty"` + UnixGuid int32 `json:"unix_guid,omitempty"` + UnixUid int32 `json:"unix_uid,omitempty"` + Username string `json:"username,omitempty"` +} diff --git a/jcapiv1/model_systemuserreturn_addresses.go b/jcapiv1/model_systemuserreturn_addresses.go new file mode 100644 index 0000000..e69431b --- /dev/null +++ b/jcapiv1/model_systemuserreturn_addresses.go @@ -0,0 +1,22 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 1.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv1 + +type SystemuserreturnAddresses struct { + Country string `json:"country,omitempty"` + ExtendedAddress string `json:"extendedAddress,omitempty"` + Id string `json:"id,omitempty"` + Locality string `json:"locality,omitempty"` + PoBox string `json:"poBox,omitempty"` + PostalCode string `json:"postalCode,omitempty"` + Region string `json:"region,omitempty"` + StreetAddress string `json:"streetAddress,omitempty"` + Type_ string `json:"type,omitempty"` +} diff --git a/jcapiv1/model_systemuserreturn_phone_numbers.go b/jcapiv1/model_systemuserreturn_phone_numbers.go new file mode 100644 index 0000000..c76a267 --- /dev/null +++ b/jcapiv1/model_systemuserreturn_phone_numbers.go @@ -0,0 +1,16 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 1.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv1 + +type SystemuserreturnPhoneNumbers struct { + Id string `json:"id,omitempty"` + Number string `json:"number,omitempty"` + Type_ string `json:"type,omitempty"` +} diff --git a/jcapiv1/model_systemuserreturn_recovery_email.go b/jcapiv1/model_systemuserreturn_recovery_email.go new file mode 100644 index 0000000..53fa565 --- /dev/null +++ b/jcapiv1/model_systemuserreturn_recovery_email.go @@ -0,0 +1,16 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 1.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv1 + +type SystemuserreturnRecoveryEmail struct { + Address string `json:"address,omitempty"` + Verified bool `json:"verified,omitempty"` + VerifiedAt string `json:"verifiedAt,omitempty"` +} diff --git a/jcapiv1/model_systemuserslist.go b/jcapiv1/model_systemuserslist.go new file mode 100644 index 0000000..e29adfb --- /dev/null +++ b/jcapiv1/model_systemuserslist.go @@ -0,0 +1,17 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 1.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv1 + +type Systemuserslist struct { + // The list of system users. + Results []Systemuserreturn `json:"results,omitempty"` + // The total number of system users. + TotalCount int32 `json:"totalCount,omitempty"` +} diff --git a/jcapiv1/model_triggerreturn.go b/jcapiv1/model_triggerreturn.go new file mode 100644 index 0000000..6215d42 --- /dev/null +++ b/jcapiv1/model_triggerreturn.go @@ -0,0 +1,14 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 1.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv1 + +type Triggerreturn struct { + Triggered []string `json:"triggered,omitempty"` +} diff --git a/jcapiv1/model_trustedapp_config_get.go b/jcapiv1/model_trustedapp_config_get.go new file mode 100644 index 0000000..20ea8d5 --- /dev/null +++ b/jcapiv1/model_trustedapp_config_get.go @@ -0,0 +1,18 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 1.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv1 + +// Object containing information about the list of trusted applications for the organization +type TrustedappConfigGet struct { + // Checksum to validate the trustedApp configuration for the organization + Checksum string `json:"checksum"` + // List of authorized apps for the organization + TrustedApps []TrustedappConfigGetTrustedApps `json:"trustedApps"` +} diff --git a/jcapiv1/model_trustedapp_config_get_trusted_apps.go b/jcapiv1/model_trustedapp_config_get_trusted_apps.go new file mode 100644 index 0000000..b83708f --- /dev/null +++ b/jcapiv1/model_trustedapp_config_get_trusted_apps.go @@ -0,0 +1,20 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 1.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv1 + +// Represents an application that is going to be trusted by the organization +type TrustedappConfigGetTrustedApps struct { + // Name of the trusted application + Name string `json:"name"` + // Absolute path for the app's location in user's device + Path string `json:"path,omitempty"` + // App's Team ID + Teamid string `json:"teamid,omitempty"` +} diff --git a/jcapiv1/model_trustedapp_config_put.go b/jcapiv1/model_trustedapp_config_put.go new file mode 100644 index 0000000..f32463b --- /dev/null +++ b/jcapiv1/model_trustedapp_config_put.go @@ -0,0 +1,16 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 1.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv1 + +// Object containing information about the list of trusted applications for the organization +type TrustedappConfigPut struct { + // List of authorized apps for the organization + TrustedApps []TrustedappConfigGetTrustedApps `json:"trustedApps"` +} diff --git a/jcapiv1/model_userput.go b/jcapiv1/model_userput.go new file mode 100644 index 0000000..c147da5 --- /dev/null +++ b/jcapiv1/model_userput.go @@ -0,0 +1,20 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 1.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv1 + +type Userput struct { + Email string `json:"email,omitempty"` + EnableMultiFactor bool `json:"enableMultiFactor,omitempty"` + Firstname string `json:"firstname,omitempty"` + GrowthData *interface{} `json:"growthData,omitempty"` + LastWhatsNewChecked string `json:"lastWhatsNewChecked,omitempty"` + Lastname string `json:"lastname,omitempty"` + RoleName string `json:"roleName,omitempty"` +} diff --git a/jcapiv1/model_userreturn.go b/jcapiv1/model_userreturn.go new file mode 100644 index 0000000..0967dfb --- /dev/null +++ b/jcapiv1/model_userreturn.go @@ -0,0 +1,33 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 1.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv1 +import ( + "time" +) + +type Userreturn struct { + Id string `json:"_id,omitempty"` + Created time.Time `json:"created,omitempty"` + DisableIntroduction bool `json:"disableIntroduction,omitempty"` + Email string `json:"email,omitempty"` + EnableMultiFactor bool `json:"enableMultiFactor,omitempty"` + Firstname string `json:"firstname,omitempty"` + GrowthData *UserreturnGrowthData `json:"growthData,omitempty"` + LastWhatsNewChecked time.Time `json:"lastWhatsNewChecked,omitempty"` + Lastname string `json:"lastname,omitempty"` + Organization string `json:"organization,omitempty"` + Provider string `json:"provider,omitempty"` + Role string `json:"role,omitempty"` + RoleName string `json:"roleName,omitempty"` + SessionCount int32 `json:"sessionCount,omitempty"` + Suspended bool `json:"suspended,omitempty"` + TotpEnrolled bool `json:"totpEnrolled,omitempty"` + UsersTimeZone string `json:"usersTimeZone,omitempty"` +} diff --git a/jcapiv1/model_userreturn_growth_data.go b/jcapiv1/model_userreturn_growth_data.go new file mode 100644 index 0000000..3479558 --- /dev/null +++ b/jcapiv1/model_userreturn_growth_data.go @@ -0,0 +1,15 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 1.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv1 + +type UserreturnGrowthData struct { + ExperimentStates *interface{} `json:"experimentStates,omitempty"` + OnboardingState *interface{} `json:"onboardingState,omitempty"` +} diff --git a/jcapiv1/organization.go b/jcapiv1/organization.go new file mode 100644 index 0000000..b136591 --- /dev/null +++ b/jcapiv1/organization.go @@ -0,0 +1,40 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 1.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package jcapiv1 + +type Organization struct { + + Id string `json:"_id,omitempty"` + + AccountsReceivable string `json:"accountsReceivable,omitempty"` + + Created string `json:"created,omitempty"` + + DisplayName string `json:"displayName,omitempty"` + + Entitlement *Organizationentitlement `json:"entitlement,omitempty"` + + HasCreditCard bool `json:"hasCreditCard,omitempty"` + + HasStripeCustomerId bool `json:"hasStripeCustomerId,omitempty"` + + LastEstimateCalculationTimeStamp string `json:"lastEstimateCalculationTimeStamp,omitempty"` + + LastSfdcSyncStatus *interface{} `json:"lastSfdcSyncStatus,omitempty"` + + LogoUrl string `json:"logoUrl,omitempty"` + + Provider string `json:"provider,omitempty"` + + Settings *Organizationsettings `json:"settings,omitempty"` + + TotalBillingEstimate int32 `json:"totalBillingEstimate,omitempty"` +} diff --git a/jcapiv1/organizationentitlement.go b/jcapiv1/organizationentitlement.go new file mode 100644 index 0000000..87ca6bb --- /dev/null +++ b/jcapiv1/organizationentitlement.go @@ -0,0 +1,23 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 1.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package jcapiv1 + +// +type Organizationentitlement struct { + + BillingModel string `json:"billingModel,omitempty"` + + EntitlementProducts []OrganizationentitlementEntitlementProducts `json:"entitlementProducts,omitempty"` + + IsManuallyBilled bool `json:"isManuallyBilled,omitempty"` + + PricePerUserSum int32 `json:"pricePerUserSum,omitempty"` +} diff --git a/jcapiv1/organizationentitlement_entitlement_products.go b/jcapiv1/organizationentitlement_entitlement_products.go new file mode 100644 index 0000000..ce220c1 --- /dev/null +++ b/jcapiv1/organizationentitlement_entitlement_products.go @@ -0,0 +1,30 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 1.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package jcapiv1 + +type OrganizationentitlementEntitlementProducts struct { + + CommittedUsers int32 `json:"committedUsers,omitempty"` + + ContractType string `json:"contractType,omitempty"` + + MaxUserCount int32 `json:"maxUserCount,omitempty"` + + Name string `json:"name,omitempty"` + + PricePerUser int32 `json:"pricePerUser,omitempty"` + + ProductCategory string `json:"productCategory,omitempty"` + + ProductCode string `json:"productCode,omitempty"` + + UncommittedUsers int32 `json:"uncommittedUsers,omitempty"` +} diff --git a/jcapiv1/organizations_api.go b/jcapiv1/organizations_api.go new file mode 100644 index 0000000..d8afc6a --- /dev/null +++ b/jcapiv1/organizations_api.go @@ -0,0 +1,323 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 1.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package jcapiv1 + +import ( + "io/ioutil" + "net/url" + "net/http" + "strings" + "golang.org/x/net/context" + "encoding/json" + "fmt" +) + +// Linger please +var ( + _ context.Context +) + +type OrganizationsApiService service + + +/* OrganizationsApiService Get Organization Details + This endpoint returns Organization Details. #### Sample Request ``` curl -X GET \\ https://console.jumpcloud.com/api/organizations \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + * @param ctx context.Context for authentication, logging, tracing, etc. + @param optional (nil or map[string]interface{}) with one or more of: + @param "fields" (string) Use a space seperated string of field parameters to include the data in the response. If omitted, the default list of fields will be returned. + @param "filter" (string) A filter to apply to the query. See the supported operators below. For more complex searches, see the related `/search/<domain>` endpoints, e.g. `/search/systems`. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: - `$eq` (equals) - `$ne` (does not equal) - `$gt` (is greater than) - `$gte` (is greater than or equal to) - `$lt` (is less than) - `$lte` (is less than or equal to) _Note: v1 operators differ from v2 operators._ _Note: For v1 operators, excluding the `$` will result in undefined behavior._ **value** = Populate with the value you want to search for. Is case sensitive. **Examples** - `GET /users?filter=username:$eq:testuser` - `GET /systemusers?filter=password_expiration_date:$lte:2021-10-24` - `GET /systemusers?filter=department:$ne:Accounting` - `GET /systems?filter[0]=firstname:$eq:foo&filter[1]=lastname:$eq:bar` - this will AND the filters together. - `GET /systems?filter[or][0]=lastname:$eq:foo&filter[or][1]=lastname:$eq:bar` - this will OR the filters together. + @param "limit" (int32) The number of records to return at once. Limited to 100. + @param "search" (string) A nested object containing a `searchTerm` string or array of strings and a list of `fields` to search on. + @param "skip" (int32) The offset into the records to return. + @param "sort" (string) Use space separated sort parameters to sort the collection. Default sort is ascending. Prefix with `-` to sort descending. + @return Organizationslist*/ +func (a *OrganizationsApiService) OrganizationList(ctx context.Context, localVarOptionals map[string]interface{}) (Organizationslist, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + successPayload Organizationslist + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/organizations" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if err := typeCheckParameter(localVarOptionals["fields"], "string", "fields"); err != nil { + return successPayload, nil, err + } + if err := typeCheckParameter(localVarOptionals["filter"], "string", "filter"); err != nil { + return successPayload, nil, err + } + if err := typeCheckParameter(localVarOptionals["limit"], "int32", "limit"); err != nil { + return successPayload, nil, err + } + if err := typeCheckParameter(localVarOptionals["search"], "string", "search"); err != nil { + return successPayload, nil, err + } + if err := typeCheckParameter(localVarOptionals["skip"], "int32", "skip"); err != nil { + return successPayload, nil, err + } + if err := typeCheckParameter(localVarOptionals["sort"], "string", "sort"); err != nil { + return successPayload, nil, err + } + + if localVarTempParam, localVarOk := localVarOptionals["fields"].(string); localVarOk { + localVarQueryParams.Add("fields", parameterToString(localVarTempParam, "")) + } + if localVarTempParam, localVarOk := localVarOptionals["filter"].(string); localVarOk { + localVarQueryParams.Add("filter", parameterToString(localVarTempParam, "")) + } + if localVarTempParam, localVarOk := localVarOptionals["limit"].(int32); localVarOk { + localVarQueryParams.Add("limit", parameterToString(localVarTempParam, "")) + } + if localVarTempParam, localVarOk := localVarOptionals["search"].(string); localVarOk { + localVarQueryParams.Add("search", parameterToString(localVarTempParam, "")) + } + if localVarTempParam, localVarOk := localVarOptionals["skip"].(int32); localVarOk { + localVarQueryParams.Add("skip", parameterToString(localVarTempParam, "")) + } + if localVarTempParam, localVarOk := localVarOptionals["sort"].(string); localVarOk { + localVarQueryParams.Add("sort", parameterToString(localVarTempParam, "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{ "application/json", } + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{ + "application/json", + } + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return successPayload, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return successPayload, localVarHttpResponse, err + } + defer localVarHttpResponse.Body.Close() + if localVarHttpResponse.StatusCode >= 300 { + bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) + return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) + } + + if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { + return successPayload, localVarHttpResponse, err + } + + + return successPayload, localVarHttpResponse, err +} + +/* OrganizationsApiService Update an Organization + This endpoint allows you to update an Organization. Note: `passwordPolicy` settings are only used when `passwordCompliance` is set to \"custom\". We discourage the use of non-custom passwordCompliance values. `hasStripeCustomerId` is deprecated and will be removed. #### Sample Request ``` curl -X PUT https://console.jumpcloud.com/api/organizations/{OrganizationID} \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"settings\": { \"contactName\": \"Admin Name\", \"contactEmail\": \"admin@company.com\", \"systemUsersCanEdit\":true, \"passwordPolicy\": { \"enableMaxHistory\": true, \"maxHistory\": 3 } } }' ``` + * @param ctx context.Context for authentication, logging, tracing, etc. + @param id + @param optional (nil or map[string]interface{}) with one or more of: + @param "body" (Body) + @return Organization*/ +func (a *OrganizationsApiService) OrganizationPut(ctx context.Context, id string, localVarOptionals map[string]interface{}) (Organization, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Put") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + successPayload Organization + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/organizations/{id}" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + + // to determine the Content-Type header + localVarHttpContentTypes := []string{ "application/json", } + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{ + "application/json", + } + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + // body params + if localVarTempParam, localVarOk := localVarOptionals["body"].(Body); localVarOk { + localVarPostBody = &localVarTempParam + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return successPayload, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return successPayload, localVarHttpResponse, err + } + defer localVarHttpResponse.Body.Close() + if localVarHttpResponse.StatusCode >= 300 { + bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) + return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) + } + + if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { + return successPayload, localVarHttpResponse, err + } + + + return successPayload, localVarHttpResponse, err +} + +/* OrganizationsApiService Get an Organization + This endpoint returns a particular Organization. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/organizations/{OrganizationID} \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + * @param ctx context.Context for authentication, logging, tracing, etc. + @param id + @param optional (nil or map[string]interface{}) with one or more of: + @param "fields" (string) Use a space seperated string of field parameters to include the data in the response. If omitted, the default list of fields will be returned. + @param "filter" (string) A filter to apply to the query. See the supported operators below. For more complex searches, see the related `/search/<domain>` endpoints, e.g. `/search/systems`. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: - `$eq` (equals) - `$ne` (does not equal) - `$gt` (is greater than) - `$gte` (is greater than or equal to) - `$lt` (is less than) - `$lte` (is less than or equal to) _Note: v1 operators differ from v2 operators._ _Note: For v1 operators, excluding the `$` will result in undefined behavior._ **value** = Populate with the value you want to search for. Is case sensitive. **Examples** - `GET /users?filter=username:$eq:testuser` - `GET /systemusers?filter=password_expiration_date:$lte:2021-10-24` - `GET /systemusers?filter=department:$ne:Accounting` - `GET /systems?filter[0]=firstname:$eq:foo&filter[1]=lastname:$eq:bar` - this will AND the filters together. - `GET /systems?filter[or][0]=lastname:$eq:foo&filter[or][1]=lastname:$eq:bar` - this will OR the filters together. + @return Organization*/ +func (a *OrganizationsApiService) OrganizationsGet(ctx context.Context, id string, localVarOptionals map[string]interface{}) (Organization, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + successPayload Organization + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/organizations/{id}" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if err := typeCheckParameter(localVarOptionals["fields"], "string", "fields"); err != nil { + return successPayload, nil, err + } + if err := typeCheckParameter(localVarOptionals["filter"], "string", "filter"); err != nil { + return successPayload, nil, err + } + + if localVarTempParam, localVarOk := localVarOptionals["fields"].(string); localVarOk { + localVarQueryParams.Add("fields", parameterToString(localVarTempParam, "")) + } + if localVarTempParam, localVarOk := localVarOptionals["filter"].(string); localVarOk { + localVarQueryParams.Add("filter", parameterToString(localVarTempParam, "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{ "application/json", } + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{ + "application/json", + } + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return successPayload, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return successPayload, localVarHttpResponse, err + } + defer localVarHttpResponse.Body.Close() + if localVarHttpResponse.StatusCode >= 300 { + bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) + return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) + } + + if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { + return successPayload, localVarHttpResponse, err + } + + + return successPayload, localVarHttpResponse, err +} + diff --git a/jcapiv1/organizationsettings.go b/jcapiv1/organizationsettings.go new file mode 100644 index 0000000..93fab01 --- /dev/null +++ b/jcapiv1/organizationsettings.go @@ -0,0 +1,76 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 1.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package jcapiv1 + +// +type Organizationsettings struct { + + AgentVersion string `json:"agentVersion,omitempty"` + + BetaFeatures *interface{} `json:"betaFeatures,omitempty"` + + ContactEmail string `json:"contactEmail,omitempty"` + + ContactName string `json:"contactName,omitempty"` + + DeviceIdentificationEnabled bool `json:"deviceIdentificationEnabled,omitempty"` + + DisableCommandRunner bool `json:"disableCommandRunner,omitempty"` + + DisableGoogleLogin bool `json:"disableGoogleLogin,omitempty"` + + DisableLdap bool `json:"disableLdap,omitempty"` + + DisableUM bool `json:"disableUM,omitempty"` + + DisplayPreferences *OrganizationsettingsDisplayPreferences `json:"displayPreferences,omitempty"` + + DuplicateLDAPGroups bool `json:"duplicateLDAPGroups,omitempty"` + + EmailDisclaimer string `json:"emailDisclaimer,omitempty"` + + EnableGoogleApps bool `json:"enableGoogleApps,omitempty"` + + EnableManagedUID bool `json:"enableManagedUID,omitempty"` + + EnableO365 bool `json:"enableO365,omitempty"` + + EnableUserPortalAgentInstall bool `json:"enableUserPortalAgentInstall,omitempty"` + + Features *OrganizationsettingsFeatures `json:"features,omitempty"` + + // Object containing Optimizely experimentIds and states corresponding to them + GrowthData *interface{} `json:"growthData,omitempty"` + + Logo string `json:"logo,omitempty"` + + Name string `json:"name,omitempty"` + + NewSystemUserStateDefaults *OrganizationsettingsNewSystemUserStateDefaults `json:"newSystemUserStateDefaults,omitempty"` + + PasswordCompliance string `json:"passwordCompliance,omitempty"` + + PasswordPolicy *OrganizationsettingsPasswordPolicy `json:"passwordPolicy,omitempty"` + + PendingDelete bool `json:"pendingDelete,omitempty"` + + ShowIntro bool `json:"showIntro,omitempty"` + + SystemUserPasswordExpirationInDays int32 `json:"systemUserPasswordExpirationInDays,omitempty"` + + SystemUsersCanEdit bool `json:"systemUsersCanEdit,omitempty"` + + SystemUsersCap int32 `json:"systemUsersCap,omitempty"` + + TrustedAppConfig *TrustedappConfigGet `json:"trustedAppConfig,omitempty"` + + UserPortal *OrganizationsettingsUserPortal `json:"userPortal,omitempty"` +} diff --git a/jcapiv1/organizationsettings_display_preferences.go b/jcapiv1/organizationsettings_display_preferences.go new file mode 100644 index 0000000..1262b29 --- /dev/null +++ b/jcapiv1/organizationsettings_display_preferences.go @@ -0,0 +1,16 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 1.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package jcapiv1 + +type OrganizationsettingsDisplayPreferences struct { + + OrgInsights *OrganizationsettingsDisplayPreferencesOrgInsights `json:"orgInsights,omitempty"` +} diff --git a/jcapiv1/organizationsettings_display_preferences_org_insights.go b/jcapiv1/organizationsettings_display_preferences_org_insights.go new file mode 100644 index 0000000..c58ebe3 --- /dev/null +++ b/jcapiv1/organizationsettings_display_preferences_org_insights.go @@ -0,0 +1,52 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 1.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package jcapiv1 + +type OrganizationsettingsDisplayPreferencesOrgInsights struct { + + ApplicationsUsage *OrganizationsettingsDisplayPreferencesOrgInsightsApplicationsUsage `json:"applicationsUsage,omitempty"` + + ConsoleStats *OrganizationsettingsDisplayPreferencesOrgInsightsConsoleStats `json:"consoleStats,omitempty"` + + DeviceNotifications *OrganizationsettingsDisplayPreferencesOrgInsightsDeviceNotifications `json:"deviceNotifications,omitempty"` + + DiskEncryption *OrganizationsettingsDisplayPreferencesOrgInsightsApplicationsUsage `json:"diskEncryption,omitempty"` + + ExpiredPasswords *OrganizationsettingsDisplayPreferencesOrgInsightsApplicationsUsage `json:"expiredPasswords,omitempty"` + + FailedCommands *OrganizationsettingsDisplayPreferencesOrgInsightsApplicationsUsage `json:"failedCommands,omitempty"` + + FailedConfigurations *OrganizationsettingsDisplayPreferencesOrgInsightsApplicationsUsage `json:"failedConfigurations,omitempty"` + + Fundamentals *OrganizationsettingsDisplayPreferencesOrgInsightsApplicationsUsage `json:"fundamentals,omitempty"` + + JcUniversity *OrganizationsettingsDisplayPreferencesOrgInsightsApplicationsUsage `json:"jcUniversity,omitempty"` + + LearningCenter *OrganizationsettingsDisplayPreferencesOrgInsightsApplicationsUsage `json:"learningCenter,omitempty"` + + MdmCertificateExpirations *OrganizationsettingsDisplayPreferencesOrgInsightsApplicationsUsage `json:"mdmCertificateExpirations,omitempty"` + + MfaEnrolledDevices *OrganizationsettingsDisplayPreferencesOrgInsightsApplicationsUsage `json:"mfaEnrolledDevices,omitempty"` + + NewOSReleases *OrganizationsettingsDisplayPreferencesOrgInsightsApplicationsUsage `json:"newOSReleases,omitempty"` + + NewUsers *OrganizationsettingsDisplayPreferencesOrgInsightsApplicationsUsage `json:"newUsers,omitempty"` + + OfficeHours *OrganizationsettingsDisplayPreferencesOrgInsightsApplicationsUsage `json:"officeHours,omitempty"` + + PendingCommands *OrganizationsettingsDisplayPreferencesOrgInsightsApplicationsUsage `json:"pendingCommands,omitempty"` + + UpcomingPasswordExpiration *OrganizationsettingsDisplayPreferencesOrgInsightsApplicationsUsage `json:"upcomingPasswordExpiration,omitempty"` + + UserLockouts *OrganizationsettingsDisplayPreferencesOrgInsightsApplicationsUsage `json:"userLockouts,omitempty"` + + UserNotifications *OrganizationsettingsDisplayPreferencesOrgInsightsUserNotifications `json:"userNotifications,omitempty"` +} diff --git a/jcapiv1/organizationsettings_display_preferences_org_insights_applications_usage.go b/jcapiv1/organizationsettings_display_preferences_org_insights_applications_usage.go new file mode 100644 index 0000000..5b1e2c0 --- /dev/null +++ b/jcapiv1/organizationsettings_display_preferences_org_insights_applications_usage.go @@ -0,0 +1,16 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 1.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package jcapiv1 + +type OrganizationsettingsDisplayPreferencesOrgInsightsApplicationsUsage struct { + + Visible bool `json:"visible,omitempty"` +} diff --git a/jcapiv1/organizationsettings_display_preferences_org_insights_console_stats.go b/jcapiv1/organizationsettings_display_preferences_org_insights_console_stats.go new file mode 100644 index 0000000..25ab8aa --- /dev/null +++ b/jcapiv1/organizationsettings_display_preferences_org_insights_console_stats.go @@ -0,0 +1,24 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 1.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package jcapiv1 + +type OrganizationsettingsDisplayPreferencesOrgInsightsConsoleStats struct { + + TotalApplications *OrganizationsettingsDisplayPreferencesOrgInsightsApplicationsUsage `json:"totalApplications,omitempty"` + + TotalConfigurations *OrganizationsettingsDisplayPreferencesOrgInsightsApplicationsUsage `json:"totalConfigurations,omitempty"` + + TotalDevices *OrganizationsettingsDisplayPreferencesOrgInsightsApplicationsUsage `json:"totalDevices,omitempty"` + + TotalGroups *OrganizationsettingsDisplayPreferencesOrgInsightsApplicationsUsage `json:"totalGroups,omitempty"` + + TotalUsers *OrganizationsettingsDisplayPreferencesOrgInsightsApplicationsUsage `json:"totalUsers,omitempty"` +} diff --git a/jcapiv1/organizationsettings_display_preferences_org_insights_device_notifications.go b/jcapiv1/organizationsettings_display_preferences_org_insights_device_notifications.go new file mode 100644 index 0000000..5f0ad50 --- /dev/null +++ b/jcapiv1/organizationsettings_display_preferences_org_insights_device_notifications.go @@ -0,0 +1,26 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 1.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package jcapiv1 + +type OrganizationsettingsDisplayPreferencesOrgInsightsDeviceNotifications struct { + + AgentOutOfDateMetric *OrganizationsettingsDisplayPreferencesOrgInsightsApplicationsUsage `json:"agentOutOfDateMetric,omitempty"` + + InactiveMetric *OrganizationsettingsDisplayPreferencesOrgInsightsApplicationsUsage `json:"inactiveMetric,omitempty"` + + UptimeMetric *OrganizationsettingsDisplayPreferencesOrgInsightsApplicationsUsage `json:"uptimeMetric,omitempty"` + + Visible bool `json:"visible,omitempty"` + + WithoutPoliciesMetric *OrganizationsettingsDisplayPreferencesOrgInsightsApplicationsUsage `json:"withoutPoliciesMetric,omitempty"` + + WithoutUsersMetric *OrganizationsettingsDisplayPreferencesOrgInsightsApplicationsUsage `json:"withoutUsersMetric,omitempty"` +} diff --git a/jcapiv1/organizationsettings_display_preferences_org_insights_user_notifications.go b/jcapiv1/organizationsettings_display_preferences_org_insights_user_notifications.go new file mode 100644 index 0000000..a236cd7 --- /dev/null +++ b/jcapiv1/organizationsettings_display_preferences_org_insights_user_notifications.go @@ -0,0 +1,26 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 1.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package jcapiv1 + +type OrganizationsettingsDisplayPreferencesOrgInsightsUserNotifications struct { + + UserWithAdminSudoPasswordlessAccess *OrganizationsettingsDisplayPreferencesOrgInsightsApplicationsUsage `json:"userWithAdminSudoPasswordlessAccess,omitempty"` + + UsersWithAdminSudoAccess *OrganizationsettingsDisplayPreferencesOrgInsightsApplicationsUsage `json:"usersWithAdminSudoAccess,omitempty"` + + UsersWithSambaAccess *OrganizationsettingsDisplayPreferencesOrgInsightsApplicationsUsage `json:"usersWithSambaAccess,omitempty"` + + UsersWithoutDevices *OrganizationsettingsDisplayPreferencesOrgInsightsApplicationsUsage `json:"usersWithoutDevices,omitempty"` + + UsersWithoutPassword *OrganizationsettingsDisplayPreferencesOrgInsightsApplicationsUsage `json:"usersWithoutPassword,omitempty"` + + Visible bool `json:"visible,omitempty"` +} diff --git a/jcapiv1/organizationsettings_features.go b/jcapiv1/organizationsettings_features.go new file mode 100644 index 0000000..99100c5 --- /dev/null +++ b/jcapiv1/organizationsettings_features.go @@ -0,0 +1,20 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 1.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package jcapiv1 + +type OrganizationsettingsFeatures struct { + + DirectoryInsights *OrganizationsettingsFeaturesDirectoryInsights `json:"directoryInsights,omitempty"` + + DirectoryInsightsPremium *OrganizationsettingsFeaturesDirectoryInsightsPremium `json:"directoryInsightsPremium,omitempty"` + + SystemInsights *OrganizationsettingsFeaturesSystemInsights `json:"systemInsights,omitempty"` +} diff --git a/jcapiv1/organizationsettings_features_directory_insights.go b/jcapiv1/organizationsettings_features_directory_insights.go new file mode 100644 index 0000000..733013d --- /dev/null +++ b/jcapiv1/organizationsettings_features_directory_insights.go @@ -0,0 +1,16 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 1.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package jcapiv1 + +type OrganizationsettingsFeaturesDirectoryInsights struct { + + Enabled bool `json:"enabled,omitempty"` +} diff --git a/jcapiv1/organizationsettings_features_directory_insights_premium.go b/jcapiv1/organizationsettings_features_directory_insights_premium.go new file mode 100644 index 0000000..e0da703 --- /dev/null +++ b/jcapiv1/organizationsettings_features_directory_insights_premium.go @@ -0,0 +1,20 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 1.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package jcapiv1 + +type OrganizationsettingsFeaturesDirectoryInsightsPremium struct { + + CreatedAt string `json:"createdAt,omitempty"` + + Enabled bool `json:"enabled,omitempty"` + + UpdatedAt string `json:"updatedAt,omitempty"` +} diff --git a/jcapiv1/organizationsettings_features_system_insights.go b/jcapiv1/organizationsettings_features_system_insights.go new file mode 100644 index 0000000..b219d87 --- /dev/null +++ b/jcapiv1/organizationsettings_features_system_insights.go @@ -0,0 +1,26 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 1.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package jcapiv1 + +type OrganizationsettingsFeaturesSystemInsights struct { + + CreatedAt string `json:"createdAt,omitempty"` + + EnableNewDarwin bool `json:"enableNewDarwin,omitempty"` + + EnableNewLinux bool `json:"enableNewLinux,omitempty"` + + EnableNewWindows bool `json:"enableNewWindows,omitempty"` + + Enabled bool `json:"enabled,omitempty"` + + UpdatedAt string `json:"updatedAt,omitempty"` +} diff --git a/jcapiv1/organizationsettings_new_system_user_state_defaults.go b/jcapiv1/organizationsettings_new_system_user_state_defaults.go new file mode 100644 index 0000000..7218c73 --- /dev/null +++ b/jcapiv1/organizationsettings_new_system_user_state_defaults.go @@ -0,0 +1,23 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 1.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package jcapiv1 + +type OrganizationsettingsNewSystemUserStateDefaults struct { + + // The default user state for a user created using the [Bulk Users Create](https://docs.jumpcloud.com/api/2.0/index.html#operation/bulk_usersCreate) endpoint. See endpoint documentation for more details. + ApplicationImport string `json:"applicationImport,omitempty"` + + // The default user state for a user created using the [Bulk Users Create](https://docs.jumpcloud.com/api/2.0/index.html#operation/bulk_usersCreate) endpoint. See endpoint documentation for more details. + CsvImport string `json:"csvImport,omitempty"` + + // The default state for a user that is created using the [Create a system user](https://docs.jumpcloud.com/api/1.0/index.html#operation/systemusers_post) endpoint. See endpoint documentation for more details. + ManualEntry string `json:"manualEntry,omitempty"` +} diff --git a/jcapiv1/organizationsettings_password_policy.go b/jcapiv1/organizationsettings_password_policy.go new file mode 100644 index 0000000..3787ff6 --- /dev/null +++ b/jcapiv1/organizationsettings_password_policy.go @@ -0,0 +1,67 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 1.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package jcapiv1 + +type OrganizationsettingsPasswordPolicy struct { + + AllowUsernameSubstring bool `json:"allowUsernameSubstring,omitempty"` + + // Deprecated field used for the legacy grace period feature. + DaysAfterExpirationToSelfRecover int32 `json:"daysAfterExpirationToSelfRecover,omitempty"` + + DaysBeforeExpirationToForceReset int32 `json:"daysBeforeExpirationToForceReset,omitempty"` + + EffectiveDate string `json:"effectiveDate,omitempty"` + + EnableDaysAfterExpirationToSelfRecover bool `json:"enableDaysAfterExpirationToSelfRecover,omitempty"` + + EnableDaysBeforeExpirationToForceReset bool `json:"enableDaysBeforeExpirationToForceReset,omitempty"` + + EnableLockoutTimeInSeconds bool `json:"enableLockoutTimeInSeconds,omitempty"` + + EnableMaxHistory bool `json:"enableMaxHistory,omitempty"` + + EnableMaxLoginAttempts bool `json:"enableMaxLoginAttempts,omitempty"` + + EnableMinChangePeriodInDays bool `json:"enableMinChangePeriodInDays,omitempty"` + + EnableMinLength bool `json:"enableMinLength,omitempty"` + + EnablePasswordExpirationInDays bool `json:"enablePasswordExpirationInDays,omitempty"` + + EnableRecoveryEmail bool `json:"enableRecoveryEmail,omitempty"` + + EnableResetLockoutCounter bool `json:"enableResetLockoutCounter,omitempty"` + + GracePeriodDate string `json:"gracePeriodDate,omitempty"` + + LockoutTimeInSeconds int32 `json:"lockoutTimeInSeconds,omitempty"` + + MaxHistory int32 `json:"maxHistory,omitempty"` + + MaxLoginAttempts int32 `json:"maxLoginAttempts,omitempty"` + + MinChangePeriodInDays int32 `json:"minChangePeriodInDays,omitempty"` + + MinLength int32 `json:"minLength,omitempty"` + + NeedsLowercase bool `json:"needsLowercase,omitempty"` + + NeedsNumeric bool `json:"needsNumeric,omitempty"` + + NeedsSymbolic bool `json:"needsSymbolic,omitempty"` + + NeedsUppercase bool `json:"needsUppercase,omitempty"` + + PasswordExpirationInDays int32 `json:"passwordExpirationInDays,omitempty"` + + ResetLockoutCounterMinutes int32 `json:"resetLockoutCounterMinutes,omitempty"` +} diff --git a/jcapiv1/organizationsettings_user_portal.go b/jcapiv1/organizationsettings_user_portal.go new file mode 100644 index 0000000..598e267 --- /dev/null +++ b/jcapiv1/organizationsettings_user_portal.go @@ -0,0 +1,16 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 1.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package jcapiv1 + +type OrganizationsettingsUserPortal struct { + + IdleSessionDurationMinutes int32 `json:"idleSessionDurationMinutes,omitempty"` +} diff --git a/jcapiv1/organizationsettingsput.go b/jcapiv1/organizationsettingsput.go new file mode 100644 index 0000000..82ead6b --- /dev/null +++ b/jcapiv1/organizationsettingsput.go @@ -0,0 +1,59 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 1.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package jcapiv1 + +type Organizationsettingsput struct { + + ContactEmail string `json:"contactEmail,omitempty"` + + ContactName string `json:"contactName,omitempty"` + + DeviceIdentificationEnabled bool `json:"deviceIdentificationEnabled,omitempty"` + + DisableGoogleLogin bool `json:"disableGoogleLogin,omitempty"` + + DisableLdap bool `json:"disableLdap,omitempty"` + + DisableUM bool `json:"disableUM,omitempty"` + + DuplicateLDAPGroups bool `json:"duplicateLDAPGroups,omitempty"` + + EmailDisclaimer string `json:"emailDisclaimer,omitempty"` + + EnableManagedUID bool `json:"enableManagedUID,omitempty"` + + Features *OrganizationsettingsFeatures `json:"features,omitempty"` + + // Object containing Optimizely experimentIds and states corresponding to them + GrowthData *interface{} `json:"growthData,omitempty"` + + Logo string `json:"logo,omitempty"` + + Name string `json:"name,omitempty"` + + NewSystemUserStateDefaults *OrganizationsettingsputNewSystemUserStateDefaults `json:"newSystemUserStateDefaults,omitempty"` + + PasswordCompliance string `json:"passwordCompliance,omitempty"` + + PasswordPolicy *OrganizationsettingsputPasswordPolicy `json:"passwordPolicy,omitempty"` + + ShowIntro bool `json:"showIntro,omitempty"` + + SystemUserPasswordExpirationInDays int32 `json:"systemUserPasswordExpirationInDays,omitempty"` + + SystemUsersCanEdit bool `json:"systemUsersCanEdit,omitempty"` + + SystemUsersCap int32 `json:"systemUsersCap,omitempty"` + + TrustedAppConfig *TrustedappConfigPut `json:"trustedAppConfig,omitempty"` + + UserPortal *OrganizationsettingsUserPortal `json:"userPortal,omitempty"` +} diff --git a/jcapiv1/organizationsettingsput_new_system_user_state_defaults.go b/jcapiv1/organizationsettingsput_new_system_user_state_defaults.go new file mode 100644 index 0000000..5e0bec0 --- /dev/null +++ b/jcapiv1/organizationsettingsput_new_system_user_state_defaults.go @@ -0,0 +1,20 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 1.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package jcapiv1 + +type OrganizationsettingsputNewSystemUserStateDefaults struct { + + ApplicationImport string `json:"applicationImport,omitempty"` + + CsvImport string `json:"csvImport,omitempty"` + + ManualEntry string `json:"manualEntry,omitempty"` +} diff --git a/jcapiv1/organizationsettingsput_password_policy.go b/jcapiv1/organizationsettingsput_password_policy.go new file mode 100644 index 0000000..e05cb2b --- /dev/null +++ b/jcapiv1/organizationsettingsput_password_policy.go @@ -0,0 +1,61 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 1.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package jcapiv1 + +type OrganizationsettingsputPasswordPolicy struct { + + AllowUsernameSubstring bool `json:"allowUsernameSubstring,omitempty"` + + // Deprecated field used for the legacy grace period feature. + DaysAfterExpirationToSelfRecover int32 `json:"daysAfterExpirationToSelfRecover,omitempty"` + + DaysBeforeExpirationToForceReset int32 `json:"daysBeforeExpirationToForceReset,omitempty"` + + EffectiveDate string `json:"effectiveDate,omitempty"` + + EnableDaysAfterExpirationToSelfRecover bool `json:"enableDaysAfterExpirationToSelfRecover,omitempty"` + + EnableDaysBeforeExpirationToForceReset bool `json:"enableDaysBeforeExpirationToForceReset,omitempty"` + + EnableLockoutTimeInSeconds bool `json:"enableLockoutTimeInSeconds,omitempty"` + + EnableMaxHistory bool `json:"enableMaxHistory,omitempty"` + + EnableMaxLoginAttempts bool `json:"enableMaxLoginAttempts,omitempty"` + + EnableMinChangePeriodInDays bool `json:"enableMinChangePeriodInDays,omitempty"` + + EnableMinLength bool `json:"enableMinLength,omitempty"` + + EnablePasswordExpirationInDays bool `json:"enablePasswordExpirationInDays,omitempty"` + + GracePeriodDate string `json:"gracePeriodDate,omitempty"` + + LockoutTimeInSeconds int32 `json:"lockoutTimeInSeconds,omitempty"` + + MaxHistory int32 `json:"maxHistory,omitempty"` + + MaxLoginAttempts int32 `json:"maxLoginAttempts,omitempty"` + + MinChangePeriodInDays int32 `json:"minChangePeriodInDays,omitempty"` + + MinLength int32 `json:"minLength,omitempty"` + + NeedsLowercase bool `json:"needsLowercase,omitempty"` + + NeedsNumeric bool `json:"needsNumeric,omitempty"` + + NeedsSymbolic bool `json:"needsSymbolic,omitempty"` + + NeedsUppercase bool `json:"needsUppercase,omitempty"` + + PasswordExpirationInDays int32 `json:"passwordExpirationInDays,omitempty"` +} diff --git a/jcapiv1/organizationslist.go b/jcapiv1/organizationslist.go new file mode 100644 index 0000000..a247ccf --- /dev/null +++ b/jcapiv1/organizationslist.go @@ -0,0 +1,20 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 1.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package jcapiv1 + +type Organizationslist struct { + + // The list of organizations. + Results []OrganizationslistResults `json:"results,omitempty"` + + // The total number of organizations. + TotalCount int32 `json:"totalCount,omitempty"` +} diff --git a/jcapiv1/organizationslist_results.go b/jcapiv1/organizationslist_results.go new file mode 100644 index 0000000..2a50955 --- /dev/null +++ b/jcapiv1/organizationslist_results.go @@ -0,0 +1,23 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 1.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package jcapiv1 + +type OrganizationslistResults struct { + + // The ID of the organization. + Id string `json:"_id,omitempty"` + + // The name of the organization. + DisplayName string `json:"displayName,omitempty"` + + // The organization logo image URL. + LogoUrl string `json:"logoUrl,omitempty"` +} diff --git a/jcapiv1/radius_servers_api.go b/jcapiv1/radius_servers_api.go new file mode 100644 index 0000000..453e886 --- /dev/null +++ b/jcapiv1/radius_servers_api.go @@ -0,0 +1,496 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 1.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package jcapiv1 + +import ( + "io/ioutil" + "net/url" + "net/http" + "strings" + "golang.org/x/net/context" + "encoding/json" + "fmt" +) + +// Linger please +var ( + _ context.Context +) + +type RadiusServersApiService service + + +/* RadiusServersApiService Delete Radius Server + This endpoint allows you to delete RADIUS servers in your organization. ``` curl -X DELETE https://console.jumpcloud.com/api/radiusservers/{ServerID} \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ ``` + * @param ctx context.Context for authentication, logging, tracing, etc. + @param id + @param optional (nil or map[string]interface{}) with one or more of: + @param "xOrgId" (string) + @return Radiusserverput*/ +func (a *RadiusServersApiService) RadiusServersDelete(ctx context.Context, id string, localVarOptionals map[string]interface{}) (Radiusserverput, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Delete") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + successPayload Radiusserverput + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/radiusservers/{id}" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { + return successPayload, nil, err + } + + // to determine the Content-Type header + localVarHttpContentTypes := []string{ "application/json", } + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{ + "application/json", + } + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { + localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return successPayload, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return successPayload, localVarHttpResponse, err + } + defer localVarHttpResponse.Body.Close() + if localVarHttpResponse.StatusCode >= 300 { + bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) + return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) + } + + if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { + return successPayload, localVarHttpResponse, err + } + + + return successPayload, localVarHttpResponse, err +} + +/* RadiusServersApiService Get Radius Server + This endpoint allows you to get a RADIUS server in your organization. #### ``` curl -X PUT https://console.jumpcloud.com/api/radiusservers/{ServerID} \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ ``` + * @param ctx context.Context for authentication, logging, tracing, etc. + @param id + @param optional (nil or map[string]interface{}) with one or more of: + @param "xOrgId" (string) + @return Radiusserver*/ +func (a *RadiusServersApiService) RadiusServersGet(ctx context.Context, id string, localVarOptionals map[string]interface{}) (Radiusserver, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + successPayload Radiusserver + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/radiusservers/{id}" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { + return successPayload, nil, err + } + + // to determine the Content-Type header + localVarHttpContentTypes := []string{ "application/json", } + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{ + "application/json", + } + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { + localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return successPayload, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return successPayload, localVarHttpResponse, err + } + defer localVarHttpResponse.Body.Close() + if localVarHttpResponse.StatusCode >= 300 { + bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) + return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) + } + + if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { + return successPayload, localVarHttpResponse, err + } + + + return successPayload, localVarHttpResponse, err +} + +/* RadiusServersApiService List Radius Servers + This endpoint allows you to get a list of all RADIUS servers in your organization. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/radiusservers/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ ``` + * @param ctx context.Context for authentication, logging, tracing, etc. + @param optional (nil or map[string]interface{}) with one or more of: + @param "fields" (string) Use a space seperated string of field parameters to include the data in the response. If omitted, the default list of fields will be returned. + @param "filter" (string) A filter to apply to the query. See the supported operators below. For more complex searches, see the related `/search/<domain>` endpoints, e.g. `/search/systems`. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: - `$eq` (equals) - `$ne` (does not equal) - `$gt` (is greater than) - `$gte` (is greater than or equal to) - `$lt` (is less than) - `$lte` (is less than or equal to) _Note: v1 operators differ from v2 operators._ _Note: For v1 operators, excluding the `$` will result in undefined behavior._ **value** = Populate with the value you want to search for. Is case sensitive. **Examples** - `GET /users?filter=username:$eq:testuser` - `GET /systemusers?filter=password_expiration_date:$lte:2021-10-24` - `GET /systemusers?filter=department:$ne:Accounting` - `GET /systems?filter[0]=firstname:$eq:foo&filter[1]=lastname:$eq:bar` - this will AND the filters together. - `GET /systems?filter[or][0]=lastname:$eq:foo&filter[or][1]=lastname:$eq:bar` - this will OR the filters together. + @param "limit" (int32) The number of records to return at once. Limited to 100. + @param "skip" (int32) The offset into the records to return. + @param "sort" (string) Use space separated sort parameters to sort the collection. Default sort is ascending. Prefix with `-` to sort descending. + @param "xOrgId" (string) + @return Radiusserverslist*/ +func (a *RadiusServersApiService) RadiusServersList(ctx context.Context, localVarOptionals map[string]interface{}) (Radiusserverslist, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + successPayload Radiusserverslist + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/radiusservers" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if err := typeCheckParameter(localVarOptionals["fields"], "string", "fields"); err != nil { + return successPayload, nil, err + } + if err := typeCheckParameter(localVarOptionals["filter"], "string", "filter"); err != nil { + return successPayload, nil, err + } + if err := typeCheckParameter(localVarOptionals["limit"], "int32", "limit"); err != nil { + return successPayload, nil, err + } + if err := typeCheckParameter(localVarOptionals["skip"], "int32", "skip"); err != nil { + return successPayload, nil, err + } + if err := typeCheckParameter(localVarOptionals["sort"], "string", "sort"); err != nil { + return successPayload, nil, err + } + if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { + return successPayload, nil, err + } + + if localVarTempParam, localVarOk := localVarOptionals["fields"].(string); localVarOk { + localVarQueryParams.Add("fields", parameterToString(localVarTempParam, "")) + } + if localVarTempParam, localVarOk := localVarOptionals["filter"].(string); localVarOk { + localVarQueryParams.Add("filter", parameterToString(localVarTempParam, "")) + } + if localVarTempParam, localVarOk := localVarOptionals["limit"].(int32); localVarOk { + localVarQueryParams.Add("limit", parameterToString(localVarTempParam, "")) + } + if localVarTempParam, localVarOk := localVarOptionals["skip"].(int32); localVarOk { + localVarQueryParams.Add("skip", parameterToString(localVarTempParam, "")) + } + if localVarTempParam, localVarOk := localVarOptionals["sort"].(string); localVarOk { + localVarQueryParams.Add("sort", parameterToString(localVarTempParam, "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{ "application/json", } + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{ + "application/json", + } + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { + localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return successPayload, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return successPayload, localVarHttpResponse, err + } + defer localVarHttpResponse.Body.Close() + if localVarHttpResponse.StatusCode >= 300 { + bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) + return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) + } + + if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { + return successPayload, localVarHttpResponse, err + } + + + return successPayload, localVarHttpResponse, err +} + +/* RadiusServersApiService Create a Radius Server + This endpoint allows you to create RADIUS servers in your organization. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/radiusservers/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"name\": \"{test_radius}\", \"networkSourceIp\": \"{0.0.0.0}\", \"sharedSecret\":\"{secretpassword}\", \"userLockoutAction\": \"REMOVE\", \"userPasswordExpirationAction\": \"MAINTAIN\" }' ``` + * @param ctx context.Context for authentication, logging, tracing, etc. + @param optional (nil or map[string]interface{}) with one or more of: + @param "body" (Radiusserverpost) + @param "xOrgId" (string) + @return Radiusserver*/ +func (a *RadiusServersApiService) RadiusServersPost(ctx context.Context, localVarOptionals map[string]interface{}) (Radiusserver, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Post") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + successPayload Radiusserver + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/radiusservers" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { + return successPayload, nil, err + } + + // to determine the Content-Type header + localVarHttpContentTypes := []string{ "application/json", } + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{ + "application/json", + } + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { + localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") + } + // body params + if localVarTempParam, localVarOk := localVarOptionals["body"].(Radiusserverpost); localVarOk { + localVarPostBody = &localVarTempParam + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return successPayload, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return successPayload, localVarHttpResponse, err + } + defer localVarHttpResponse.Body.Close() + if localVarHttpResponse.StatusCode >= 300 { + bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) + return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) + } + + if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { + return successPayload, localVarHttpResponse, err + } + + + return successPayload, localVarHttpResponse, err +} + +/* RadiusServersApiService Update Radius Servers + This endpoint allows you to update RADIUS servers in your organization. #### ``` curl -X PUT https://console.jumpcloud.com/api/radiusservers/{ServerID} \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"name\": \"{name_update}\", \"networkSourceIp\": \"{0.0.0.0}\", \"sharedSecret\": \"{secret_password}\", \"userLockoutAction\": \"REMOVE\", \"userPasswordExpirationAction\": \"MAINTAIN\" }' ``` + * @param ctx context.Context for authentication, logging, tracing, etc. + @param id + @param optional (nil or map[string]interface{}) with one or more of: + @param "body" (Body1) + @param "xOrgId" (string) + @return Radiusserverput*/ +func (a *RadiusServersApiService) RadiusServersPut(ctx context.Context, id string, localVarOptionals map[string]interface{}) (Radiusserverput, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Put") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + successPayload Radiusserverput + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/radiusservers/{id}" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { + return successPayload, nil, err + } + + // to determine the Content-Type header + localVarHttpContentTypes := []string{ "application/json", } + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{ + "application/json", + } + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { + localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") + } + // body params + if localVarTempParam, localVarOk := localVarOptionals["body"].(Body1); localVarOk { + localVarPostBody = &localVarTempParam + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return successPayload, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return successPayload, localVarHttpResponse, err + } + defer localVarHttpResponse.Body.Close() + if localVarHttpResponse.StatusCode >= 300 { + bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) + return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) + } + + if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { + return successPayload, localVarHttpResponse, err + } + + + return successPayload, localVarHttpResponse, err +} + diff --git a/jcapiv1/radiusserver.go b/jcapiv1/radiusserver.go new file mode 100644 index 0000000..f73042d --- /dev/null +++ b/jcapiv1/radiusserver.go @@ -0,0 +1,42 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 1.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package jcapiv1 + +type Radiusserver struct { + + Id string `json:"_id,omitempty"` + + AuthIdp string `json:"authIdp,omitempty"` + + DeviceCertEnabled bool `json:"deviceCertEnabled,omitempty"` + + Mfa string `json:"mfa,omitempty"` + + Name string `json:"name,omitempty"` + + NetworkSourceIp string `json:"networkSourceIp,omitempty"` + + Organization string `json:"organization,omitempty"` + + SharedSecret string `json:"sharedSecret,omitempty"` + + TagNames []string `json:"tagNames,omitempty"` + + Tags []string `json:"tags,omitempty"` + + UserCertEnabled bool `json:"userCertEnabled,omitempty"` + + UserLockoutAction string `json:"userLockoutAction,omitempty"` + + UserPasswordEnabled bool `json:"userPasswordEnabled,omitempty"` + + UserPasswordExpirationAction string `json:"userPasswordExpirationAction,omitempty"` +} diff --git a/jcapiv1/radiusserverpost.go b/jcapiv1/radiusserverpost.go new file mode 100644 index 0000000..2ab42d1 --- /dev/null +++ b/jcapiv1/radiusserverpost.go @@ -0,0 +1,37 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 1.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package jcapiv1 + +type Radiusserverpost struct { + + AuthIdp string `json:"authIdp,omitempty"` + + DeviceCertEnabled bool `json:"deviceCertEnabled,omitempty"` + + Mfa string `json:"mfa,omitempty"` + + Name string `json:"name"` + + NetworkSourceIp string `json:"networkSourceIp"` + + // RADIUS shared secret between the server and client. + SharedSecret string `json:"sharedSecret"` + + TagNames []string `json:"tagNames,omitempty"` + + UserCertEnabled bool `json:"userCertEnabled,omitempty"` + + UserLockoutAction string `json:"userLockoutAction,omitempty"` + + UserPasswordEnabled bool `json:"userPasswordEnabled,omitempty"` + + UserPasswordExpirationAction string `json:"userPasswordExpirationAction,omitempty"` +} diff --git a/jcapiv1/radiusserverput.go b/jcapiv1/radiusserverput.go new file mode 100644 index 0000000..11e17c8 --- /dev/null +++ b/jcapiv1/radiusserverput.go @@ -0,0 +1,36 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 1.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package jcapiv1 + +type Radiusserverput struct { + + Id string `json:"_id,omitempty"` + + AuthIdp string `json:"authIdp,omitempty"` + + DeviceCertEnabled bool `json:"deviceCertEnabled,omitempty"` + + Mfa string `json:"mfa,omitempty"` + + Name string `json:"name,omitempty"` + + NetworkSourceIp string `json:"networkSourceIp,omitempty"` + + TagNames []string `json:"tagNames,omitempty"` + + UserCertEnabled bool `json:"userCertEnabled,omitempty"` + + UserLockoutAction string `json:"userLockoutAction,omitempty"` + + UserPasswordEnabled bool `json:"userPasswordEnabled,omitempty"` + + UserPasswordExpirationAction string `json:"userPasswordExpirationAction,omitempty"` +} diff --git a/jcapiv1/radiusserverslist.go b/jcapiv1/radiusserverslist.go new file mode 100644 index 0000000..e301628 --- /dev/null +++ b/jcapiv1/radiusserverslist.go @@ -0,0 +1,18 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 1.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package jcapiv1 + +type Radiusserverslist struct { + + Results []Radiusserver `json:"results,omitempty"` + + TotalCount int32 `json:"totalCount,omitempty"` +} diff --git a/jcapiv1/response.go b/jcapiv1/response.go new file mode 100644 index 0000000..cd6d30c --- /dev/null +++ b/jcapiv1/response.go @@ -0,0 +1,43 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 1.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv1 + +import ( + "net/http" +) + +type APIResponse struct { + *http.Response `json:"-"` + Message string `json:"message,omitempty"` + // Operation is the name of the swagger operation. + Operation string `json:"operation,omitempty"` + // RequestURL is the request URL. This value is always available, even if the + // embedded *http.Response is nil. + RequestURL string `json:"url,omitempty"` + // Method is the HTTP method used for the request. This value is always + // available, even if the embedded *http.Response is nil. + Method string `json:"method,omitempty"` + // Payload holds the contents of the response body (which may be nil or empty). + // This is provided here as the raw response.Body() reader will have already + // been drained. + Payload []byte `json:"-"` +} + +func NewAPIResponse(r *http.Response) *APIResponse { + + response := &APIResponse{Response: r} + return response +} + +func NewAPIResponseWithError(errorMessage string) *APIResponse { + + response := &APIResponse{Message: errorMessage} + return response +} diff --git a/jcapiv1/search.go b/jcapiv1/search.go new file mode 100644 index 0000000..cc9f3f0 --- /dev/null +++ b/jcapiv1/search.go @@ -0,0 +1,20 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 1.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package jcapiv1 + +type Search struct { + + Fields string `json:"fields,omitempty"` + + Filter *interface{} `json:"filter,omitempty"` + + SearchFilter *interface{} `json:"searchFilter,omitempty"` +} diff --git a/jcapiv1/search_api.go b/jcapiv1/search_api.go new file mode 100644 index 0000000..653b93c --- /dev/null +++ b/jcapiv1/search_api.go @@ -0,0 +1,602 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 1.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package jcapiv1 + +import ( + "io/ioutil" + "net/url" + "net/http" + "strings" + "golang.org/x/net/context" + "encoding/json" +) + +// Linger please +var ( + _ context.Context +) + +type SearchApiService service + + +/* SearchApiService Search Commands Results + Return Command Results in multi-record format allowing for the passing of the `filter` parameter. To support advanced filtering you can use the `filter` and `searchFilter` parameters that can only be passed in the body of POST /api/search/commandresults route. The `filter` parameter must be passed as Content-Type application/json. The `filter` parameter is an object with a single property, either `and` or `or` with the value of the property being an array of query expressions. This allows you to filter records using the logic of matching ALL or ANY records in the array of query expressions. If the `and` or `or` are not included the default behavior is to match ALL query expressions. #### Sample Request Exact search for a specific command result ``` curl -X POST https://console.jumpcloud.com/api/search/commandresults \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"filter\" : \"workflowInstanceId:$eq:62f3c599ec4e928499069c7f\", \"fields\" : \"name workflowId sudo\" }' ``` + * @param ctx context.Context for authentication, logging, tracing, etc. + @param optional (nil or map[string]interface{}) with one or more of: + @param "body" (Search) + @param "fields" (string) Use a space seperated string of field parameters to include the data in the response. If omitted, the default list of fields will be returned. + @param "filter" (string) A filter to apply to the query. See the supported operators below. For more complex searches, see the related `/search/<domain>` endpoints, e.g. `/search/systems`. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: - `$eq` (equals) - `$ne` (does not equal) - `$gt` (is greater than) - `$gte` (is greater than or equal to) - `$lt` (is less than) - `$lte` (is less than or equal to) _Note: v1 operators differ from v2 operators._ _Note: For v1 operators, excluding the `$` will result in undefined behavior._ **value** = Populate with the value you want to search for. Is case sensitive. **Examples** - `GET /users?filter=username:$eq:testuser` - `GET /systemusers?filter=password_expiration_date:$lte:2021-10-24` - `GET /systemusers?filter=department:$ne:Accounting` - `GET /systems?filter[0]=firstname:$eq:foo&filter[1]=lastname:$eq:bar` - this will AND the filters together. - `GET /systems?filter[or][0]=lastname:$eq:foo&filter[or][1]=lastname:$eq:bar` - this will OR the filters together. + @param "limit" (int32) The number of records to return at once. Limited to 100. + @param "skip" (int32) The offset into the records to return. + @param "xOrgId" (string) + @return Commandresultslist*/ +func (a *SearchApiService) SearchCommandresultsPost(ctx context.Context, localVarOptionals map[string]interface{}) (Commandresultslist, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Post") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + successPayload Commandresultslist + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/search/commandresults" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if err := typeCheckParameter(localVarOptionals["fields"], "string", "fields"); err != nil { + return successPayload, nil, err + } + if err := typeCheckParameter(localVarOptionals["filter"], "string", "filter"); err != nil { + return successPayload, nil, err + } + if err := typeCheckParameter(localVarOptionals["limit"], "int32", "limit"); err != nil { + return successPayload, nil, err + } + if err := typeCheckParameter(localVarOptionals["skip"], "int32", "skip"); err != nil { + return successPayload, nil, err + } + if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { + return successPayload, nil, err + } + + if localVarTempParam, localVarOk := localVarOptionals["fields"].(string); localVarOk { + localVarQueryParams.Add("fields", parameterToString(localVarTempParam, "")) + } + if localVarTempParam, localVarOk := localVarOptionals["filter"].(string); localVarOk { + localVarQueryParams.Add("filter", parameterToString(localVarTempParam, "")) + } + if localVarTempParam, localVarOk := localVarOptionals["limit"].(int32); localVarOk { + localVarQueryParams.Add("limit", parameterToString(localVarTempParam, "")) + } + if localVarTempParam, localVarOk := localVarOptionals["skip"].(int32); localVarOk { + localVarQueryParams.Add("skip", parameterToString(localVarTempParam, "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{ "application/json", } + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{ + "application/json", + } + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { + localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") + } + // body params + if localVarTempParam, localVarOk := localVarOptionals["body"].(Search); localVarOk { + localVarPostBody = &localVarTempParam + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return successPayload, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return successPayload, localVarHttpResponse, err + } + defer localVarHttpResponse.Body.Close() + if localVarHttpResponse.StatusCode >= 300 { + bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) + return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) + } + + if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { + return successPayload, localVarHttpResponse, err + } + + + return successPayload, localVarHttpResponse, err +} + +/* SearchApiService Search Commands + Return Commands in multi-record format allowing for the passing of the `filter` and `searchFilter` parameters. This WILL NOT allow you to add a new command. To support advanced filtering you can use the `filter` and `searchFilter` parameters that can only be passed in the body of POST /api/search/_* routes. The `filter` and `searchFilter` parameters must be passed as Content-Type application/json. The `filter` parameter is an object with a single property, either `and` or `or` with the value of the property being an array of query expressions. This allows you to filter records using the logic of matching ALL or ANY records in the array of query expressions. If the `and` or `or` are not included the default behavior is to match ALL query expressions. The `searchFilter` parameter allows text searching on supported fields by specifying a `searchTerm` and a list of `fields` to query on. If any `field` has a partial text match on the `searchTerm` the record will be returned. #### Sample Request Exact search for a list of commands in a launchType ``` curl -X POST https://console.jumpcloud.com/api/search/commands \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"filter\" : [{\"launchType\" : \"repeated\"}], \"fields\" : \"name launchType sudo\" }' ``` Text search for commands with name ``` curl -X POST https://console.jumpcloud.com/api/search/commands \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"searchFilter\" : { \"searchTerm\": \"List\", \"fields\": [\"name\"] }, \"fields\" : \"name launchType sudo\" }' ``` Text search for multiple commands ``` curl -X POST https://console.jumpcloud.com/api/search/commands \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"searchFilter\" : { \"searchTerm\": [\"List\", \"Log\"], \"fields\": [\"name\"] }, \"fields\" : \"name launchType sudo\" }' ``` Combining `filter` and `searchFilter` to text search for commands with name who are in a list of launchType ``` curl -X POST https://console.jumpcloud.com/api/search/commands \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"searchFilter\": { \"searchTerm\": \"List\", \"fields\": [\"name\"] }, \"filter\": { \"or\": [ {\"launchType\" : \"repeated\"}, {\"launchType\" : \"one-time\"} ] }, \"fields\" : \"name launchType sudo\" }' ``` + * @param ctx context.Context for authentication, logging, tracing, etc. + @param optional (nil or map[string]interface{}) with one or more of: + @param "body" (Search) + @param "fields" (string) Use a space seperated string of field parameters to include the data in the response. If omitted, the default list of fields will be returned. + @param "filter" (string) A filter to apply to the query. See the supported operators below. For more complex searches, see the related `/search/<domain>` endpoints, e.g. `/search/systems`. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: - `$eq` (equals) - `$ne` (does not equal) - `$gt` (is greater than) - `$gte` (is greater than or equal to) - `$lt` (is less than) - `$lte` (is less than or equal to) _Note: v1 operators differ from v2 operators._ _Note: For v1 operators, excluding the `$` will result in undefined behavior._ **value** = Populate with the value you want to search for. Is case sensitive. **Examples** - `GET /users?filter=username:$eq:testuser` - `GET /systemusers?filter=password_expiration_date:$lte:2021-10-24` - `GET /systemusers?filter=department:$ne:Accounting` - `GET /systems?filter[0]=firstname:$eq:foo&filter[1]=lastname:$eq:bar` - this will AND the filters together. - `GET /systems?filter[or][0]=lastname:$eq:foo&filter[or][1]=lastname:$eq:bar` - this will OR the filters together. + @param "limit" (int32) The number of records to return at once. Limited to 100. + @param "skip" (int32) The offset into the records to return. + @param "xOrgId" (string) + @return Commandslist*/ +func (a *SearchApiService) SearchCommandsPost(ctx context.Context, localVarOptionals map[string]interface{}) (Commandslist, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Post") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + successPayload Commandslist + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/search/commands" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if err := typeCheckParameter(localVarOptionals["fields"], "string", "fields"); err != nil { + return successPayload, nil, err + } + if err := typeCheckParameter(localVarOptionals["filter"], "string", "filter"); err != nil { + return successPayload, nil, err + } + if err := typeCheckParameter(localVarOptionals["limit"], "int32", "limit"); err != nil { + return successPayload, nil, err + } + if err := typeCheckParameter(localVarOptionals["skip"], "int32", "skip"); err != nil { + return successPayload, nil, err + } + if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { + return successPayload, nil, err + } + + if localVarTempParam, localVarOk := localVarOptionals["fields"].(string); localVarOk { + localVarQueryParams.Add("fields", parameterToString(localVarTempParam, "")) + } + if localVarTempParam, localVarOk := localVarOptionals["filter"].(string); localVarOk { + localVarQueryParams.Add("filter", parameterToString(localVarTempParam, "")) + } + if localVarTempParam, localVarOk := localVarOptionals["limit"].(int32); localVarOk { + localVarQueryParams.Add("limit", parameterToString(localVarTempParam, "")) + } + if localVarTempParam, localVarOk := localVarOptionals["skip"].(int32); localVarOk { + localVarQueryParams.Add("skip", parameterToString(localVarTempParam, "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{ "application/json", } + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{ + "application/json", + } + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { + localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") + } + // body params + if localVarTempParam, localVarOk := localVarOptionals["body"].(Search); localVarOk { + localVarPostBody = &localVarTempParam + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return successPayload, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return successPayload, localVarHttpResponse, err + } + defer localVarHttpResponse.Body.Close() + if localVarHttpResponse.StatusCode >= 300 { + bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) + return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) + } + + if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { + return successPayload, localVarHttpResponse, err + } + + + return successPayload, localVarHttpResponse, err +} + +/* SearchApiService Search Organizations + This endpoint will return Organization data based on your search parameters. This endpoint WILL NOT allow you to add a new Organization. You can use the supported parameters and pass those in the body of request. The parameters must be passed as Content-Type application/json. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/search/organizations \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"search\":{ \"fields\" : [\"settings.name\"], \"searchTerm\": \"Second\" }, \"fields\": [\"_id\", \"displayName\", \"logoUrl\"], \"limit\" : 0, \"skip\" : 0 }' ``` + * @param ctx context.Context for authentication, logging, tracing, etc. + @param optional (nil or map[string]interface{}) with one or more of: + @param "body" (Search) + @param "fields" (string) Use a space seperated string of field parameters to include the data in the response. If omitted, the default list of fields will be returned. + @param "filter" (string) A filter to apply to the query. See the supported operators below. For more complex searches, see the related `/search/<domain>` endpoints, e.g. `/search/systems`. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: - `$eq` (equals) - `$ne` (does not equal) - `$gt` (is greater than) - `$gte` (is greater than or equal to) - `$lt` (is less than) - `$lte` (is less than or equal to) _Note: v1 operators differ from v2 operators._ _Note: For v1 operators, excluding the `$` will result in undefined behavior._ **value** = Populate with the value you want to search for. Is case sensitive. **Examples** - `GET /users?filter=username:$eq:testuser` - `GET /systemusers?filter=password_expiration_date:$lte:2021-10-24` - `GET /systemusers?filter=department:$ne:Accounting` - `GET /systems?filter[0]=firstname:$eq:foo&filter[1]=lastname:$eq:bar` - this will AND the filters together. - `GET /systems?filter[or][0]=lastname:$eq:foo&filter[or][1]=lastname:$eq:bar` - this will OR the filters together. + @param "limit" (int32) The number of records to return at once. Limited to 100. + @param "skip" (int32) The offset into the records to return. + @return Organizationslist*/ +func (a *SearchApiService) SearchOrganizationsPost(ctx context.Context, localVarOptionals map[string]interface{}) (Organizationslist, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Post") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + successPayload Organizationslist + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/search/organizations" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if err := typeCheckParameter(localVarOptionals["fields"], "string", "fields"); err != nil { + return successPayload, nil, err + } + if err := typeCheckParameter(localVarOptionals["filter"], "string", "filter"); err != nil { + return successPayload, nil, err + } + if err := typeCheckParameter(localVarOptionals["limit"], "int32", "limit"); err != nil { + return successPayload, nil, err + } + if err := typeCheckParameter(localVarOptionals["skip"], "int32", "skip"); err != nil { + return successPayload, nil, err + } + + if localVarTempParam, localVarOk := localVarOptionals["fields"].(string); localVarOk { + localVarQueryParams.Add("fields", parameterToString(localVarTempParam, "")) + } + if localVarTempParam, localVarOk := localVarOptionals["filter"].(string); localVarOk { + localVarQueryParams.Add("filter", parameterToString(localVarTempParam, "")) + } + if localVarTempParam, localVarOk := localVarOptionals["limit"].(int32); localVarOk { + localVarQueryParams.Add("limit", parameterToString(localVarTempParam, "")) + } + if localVarTempParam, localVarOk := localVarOptionals["skip"].(int32); localVarOk { + localVarQueryParams.Add("skip", parameterToString(localVarTempParam, "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{ "application/json", } + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{ + "application/json", + } + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + // body params + if localVarTempParam, localVarOk := localVarOptionals["body"].(Search); localVarOk { + localVarPostBody = &localVarTempParam + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return successPayload, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return successPayload, localVarHttpResponse, err + } + defer localVarHttpResponse.Body.Close() + if localVarHttpResponse.StatusCode >= 300 { + bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) + return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) + } + + if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { + return successPayload, localVarHttpResponse, err + } + + + return successPayload, localVarHttpResponse, err +} + +/* SearchApiService Search Systems + Return Systems in multi-record format allowing for the passing of the `filter` and `searchFilter` parameters. This WILL NOT allow you to add a new system. To support advanced filtering you can use the `filter` and `searchFilter` parameters that can only be passed in the body of POST /api/search/_* routes. The `filter` and `searchFilter` parameters must be passed as Content-Type application/json. The `filter` parameter is an object with a single property, either `and` or `or` with the value of the property being an array of query expressions. This allows you to filter records using the logic of matching ALL or ANY records in the array of query expressions. If the `and` or `or` are not included the default behavior is to match ALL query expressions. The `searchFilter` parameter allows text searching on supported fields by specifying a `searchTerm` and a list of `fields` to query on. If any `field` has a partial text match on the `searchTerm` the record will be returned. #### Sample Request Exact search for a list of hostnames ``` curl -X POST https://console.jumpcloud.com/api/search/systems \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"filter\": { \"or\": [ {\"hostname\" : \"my-hostname\"}, {\"hostname\" : \"other-hostname\"} ] }, \"fields\" : \"os hostname displayName\" }' ``` Text search for a hostname or display name ``` curl -X POST https://console.jumpcloud.com/api/search/systems \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"searchFilter\": { \"searchTerm\": \"my-host\", \"fields\": [\"hostname\", \"displayName\"] }, \"fields\": \"os hostname displayName\" }' ``` Text search for a multiple hostnames. ``` curl -X POST https://console.jumpcloud.com/api/search/systems \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"searchFilter\": { \"searchTerm\": [\"my-host\", \"my-other-host\"], \"fields\": [\"hostname\"] }, \"fields\": \"os hostname displayName\" }' ``` Combining `filter` and `searchFilter` to search for names that match a given OS ``` curl -X POST https://console.jumpcloud.com/api/search/systems \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"searchFilter\": { \"searchTerm\": \"my-host\", \"fields\": [\"hostname\", \"displayName\"] }, \"filter\": { \"or\": [ {\"os\" : \"Ubuntu\"}, {\"os\" : \"Mac OS X\"} ] }, \"fields\": \"os hostname displayName\" }' ``` + * @param ctx context.Context for authentication, logging, tracing, etc. + @param optional (nil or map[string]interface{}) with one or more of: + @param "body" (Search) + @param "fields" (string) Use a space seperated string of field parameters to include the data in the response. If omitted, the default list of fields will be returned. + @param "limit" (int32) The number of records to return at once. Limited to 100. + @param "xOrgId" (string) + @param "skip" (int32) The offset into the records to return. + @param "filter" (string) A filter to apply to the query. See the supported operators below. For more complex searches, see the related `/search/<domain>` endpoints, e.g. `/search/systems`. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: - `$eq` (equals) - `$ne` (does not equal) - `$gt` (is greater than) - `$gte` (is greater than or equal to) - `$lt` (is less than) - `$lte` (is less than or equal to) _Note: v1 operators differ from v2 operators._ _Note: For v1 operators, excluding the `$` will result in undefined behavior._ **value** = Populate with the value you want to search for. Is case sensitive. **Examples** - `GET /users?filter=username:$eq:testuser` - `GET /systemusers?filter=password_expiration_date:$lte:2021-10-24` - `GET /systemusers?filter=department:$ne:Accounting` - `GET /systems?filter[0]=firstname:$eq:foo&filter[1]=lastname:$eq:bar` - this will AND the filters together. - `GET /systems?filter[or][0]=lastname:$eq:foo&filter[or][1]=lastname:$eq:bar` - this will OR the filters together. + @return Systemslist*/ +func (a *SearchApiService) SearchSystemsPost(ctx context.Context, localVarOptionals map[string]interface{}) (Systemslist, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Post") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + successPayload Systemslist + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/search/systems" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if err := typeCheckParameter(localVarOptionals["fields"], "string", "fields"); err != nil { + return successPayload, nil, err + } + if err := typeCheckParameter(localVarOptionals["limit"], "int32", "limit"); err != nil { + return successPayload, nil, err + } + if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { + return successPayload, nil, err + } + if err := typeCheckParameter(localVarOptionals["skip"], "int32", "skip"); err != nil { + return successPayload, nil, err + } + if err := typeCheckParameter(localVarOptionals["filter"], "string", "filter"); err != nil { + return successPayload, nil, err + } + + if localVarTempParam, localVarOk := localVarOptionals["fields"].(string); localVarOk { + localVarQueryParams.Add("fields", parameterToString(localVarTempParam, "")) + } + if localVarTempParam, localVarOk := localVarOptionals["limit"].(int32); localVarOk { + localVarQueryParams.Add("limit", parameterToString(localVarTempParam, "")) + } + if localVarTempParam, localVarOk := localVarOptionals["skip"].(int32); localVarOk { + localVarQueryParams.Add("skip", parameterToString(localVarTempParam, "")) + } + if localVarTempParam, localVarOk := localVarOptionals["filter"].(string); localVarOk { + localVarQueryParams.Add("filter", parameterToString(localVarTempParam, "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{ "application/json", } + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{ + "application/json", + } + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { + localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") + } + // body params + if localVarTempParam, localVarOk := localVarOptionals["body"].(Search); localVarOk { + localVarPostBody = &localVarTempParam + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return successPayload, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return successPayload, localVarHttpResponse, err + } + defer localVarHttpResponse.Body.Close() + if localVarHttpResponse.StatusCode >= 300 { + bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) + return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) + } + + if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { + return successPayload, localVarHttpResponse, err + } + + + return successPayload, localVarHttpResponse, err +} + +/* SearchApiService Search System Users + Return System Users in multi-record format allowing for the passing of the `filter` and `searchFilter` parameters. This WILL NOT allow you to add a new system user. To support advanced filtering you can use the `filter` and `searchFilter` parameters that can only be passed in the body of POST /api/search/_* routes. The `filter` and `searchFilter` parameters must be passed as Content-Type application/json. The `filter` parameter is an object with a single property, either `and` or `or` with the value of the property being an array of query expressions. This allows you to filter records using the logic of matching ALL or ANY records in the array of query expressions. If the `and` or `or` are not included the default behavior is to match ALL query expressions. The `searchFilter` parameter allows text searching on supported fields by specifying a `searchTerm` and a list of `fields` to query on. If any `field` has a partial text match on the `searchTerm` the record will be returned. #### Sample Request Exact search for a list of system users in a department ``` curl -X POST https://console.jumpcloud.com/api/search/systemusers \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"filter\" : [{\"department\" : \"IT\"}], \"fields\" : \"email username sudo\" }' ``` Text search for system users with and email on a domain ``` curl -X POST https://console.jumpcloud.com/api/search/systemusers \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"searchFilter\" : { \"searchTerm\": \"@jumpcloud.com\", \"fields\": [\"email\"] }, \"fields\" : \"email username sudo\" }' ``` Text search for multiple system users ``` curl -X POST https://console.jumpcloud.com/api/search/systemusers \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"searchFilter\" : { \"searchTerm\": [\"john\", \"sarah\"], \"fields\": [\"username\"] }, \"fields\" : \"email username sudo\" }' ``` Combining `filter` and `searchFilter` to text search for system users with and email on a domain who are in a list of departments ``` curl -X POST https://console.jumpcloud.com/api/search/systemusers \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"searchFilter\": { \"searchTerm\": \"@jumpcloud.com\", \"fields\": [\"email\"] }, \"filter\": { \"or\": [ {\"department\" : \"IT\"}, {\"department\" : \"Sales\"} ] }, \"fields\" : \"email username sudo\" }' ``` + * @param ctx context.Context for authentication, logging, tracing, etc. + @param optional (nil or map[string]interface{}) with one or more of: + @param "body" (Search) + @param "fields" (string) Use a space seperated string of field parameters to include the data in the response. If omitted, the default list of fields will be returned. + @param "filter" (string) A filter to apply to the query. See the supported operators below. For more complex searches, see the related `/search/<domain>` endpoints, e.g. `/search/systems`. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: - `$eq` (equals) - `$ne` (does not equal) - `$gt` (is greater than) - `$gte` (is greater than or equal to) - `$lt` (is less than) - `$lte` (is less than or equal to) _Note: v1 operators differ from v2 operators._ _Note: For v1 operators, excluding the `$` will result in undefined behavior._ **value** = Populate with the value you want to search for. Is case sensitive. **Examples** - `GET /users?filter=username:$eq:testuser` - `GET /systemusers?filter=password_expiration_date:$lte:2021-10-24` - `GET /systemusers?filter=department:$ne:Accounting` - `GET /systems?filter[0]=firstname:$eq:foo&filter[1]=lastname:$eq:bar` - this will AND the filters together. - `GET /systems?filter[or][0]=lastname:$eq:foo&filter[or][1]=lastname:$eq:bar` - this will OR the filters together. + @param "limit" (int32) The number of records to return at once. Limited to 100. + @param "skip" (int32) The offset into the records to return. + @param "xOrgId" (string) + @return Systemuserslist*/ +func (a *SearchApiService) SearchSystemusersPost(ctx context.Context, localVarOptionals map[string]interface{}) (Systemuserslist, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Post") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + successPayload Systemuserslist + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/search/systemusers" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if err := typeCheckParameter(localVarOptionals["fields"], "string", "fields"); err != nil { + return successPayload, nil, err + } + if err := typeCheckParameter(localVarOptionals["filter"], "string", "filter"); err != nil { + return successPayload, nil, err + } + if err := typeCheckParameter(localVarOptionals["limit"], "int32", "limit"); err != nil { + return successPayload, nil, err + } + if err := typeCheckParameter(localVarOptionals["skip"], "int32", "skip"); err != nil { + return successPayload, nil, err + } + if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { + return successPayload, nil, err + } + + if localVarTempParam, localVarOk := localVarOptionals["fields"].(string); localVarOk { + localVarQueryParams.Add("fields", parameterToString(localVarTempParam, "")) + } + if localVarTempParam, localVarOk := localVarOptionals["filter"].(string); localVarOk { + localVarQueryParams.Add("filter", parameterToString(localVarTempParam, "")) + } + if localVarTempParam, localVarOk := localVarOptionals["limit"].(int32); localVarOk { + localVarQueryParams.Add("limit", parameterToString(localVarTempParam, "")) + } + if localVarTempParam, localVarOk := localVarOptionals["skip"].(int32); localVarOk { + localVarQueryParams.Add("skip", parameterToString(localVarTempParam, "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{ "application/json", } + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{ + "application/json", + } + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { + localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") + } + // body params + if localVarTempParam, localVarOk := localVarOptionals["body"].(Search); localVarOk { + localVarPostBody = &localVarTempParam + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return successPayload, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return successPayload, localVarHttpResponse, err + } + defer localVarHttpResponse.Body.Close() + if localVarHttpResponse.StatusCode >= 300 { + bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) + return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) + } + + if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { + return successPayload, localVarHttpResponse, err + } + + + return successPayload, localVarHttpResponse, err +} + diff --git a/jcapiv1/sshkeylist.go b/jcapiv1/sshkeylist.go new file mode 100644 index 0000000..851ad6a --- /dev/null +++ b/jcapiv1/sshkeylist.go @@ -0,0 +1,26 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 1.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package jcapiv1 + +type Sshkeylist struct { + + // The ID of the SSH key. + Id string `json:"_id,omitempty"` + + // The date the SSH key was created. + CreateDate string `json:"create_date,omitempty"` + + // The name of the SSH key. + Name string `json:"name,omitempty"` + + // The Public SSH key. + PublicKey string `json:"public_key,omitempty"` +} diff --git a/jcapiv1/sshkeypost.go b/jcapiv1/sshkeypost.go new file mode 100644 index 0000000..e71087d --- /dev/null +++ b/jcapiv1/sshkeypost.go @@ -0,0 +1,20 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 1.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package jcapiv1 + +type Sshkeypost struct { + + // The name of the SSH key. + Name string `json:"name"` + + // The Public SSH key. + PublicKey string `json:"public_key"` +} diff --git a/jcapiv1/sso.go b/jcapiv1/sso.go new file mode 100644 index 0000000..3a2595c --- /dev/null +++ b/jcapiv1/sso.go @@ -0,0 +1,26 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 1.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package jcapiv1 + +import ( + "time" +) + +type Sso struct { + + Beta bool `json:"beta,omitempty"` + + IdpCertExpirationAt time.Time `json:"idpCertExpirationAt,omitempty"` + + Jit bool `json:"jit,omitempty"` + + Type_ string `json:"type,omitempty"` +} diff --git a/jcapiv1/system.go b/jcapiv1/system.go new file mode 100644 index 0000000..e09249d --- /dev/null +++ b/jcapiv1/system.go @@ -0,0 +1,100 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 1.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package jcapiv1 + +import ( + "time" +) + +type System struct { + + Id string `json:"_id,omitempty"` + + Active bool `json:"active,omitempty"` + + AgentVersion string `json:"agentVersion,omitempty"` + + AllowMultiFactorAuthentication bool `json:"allowMultiFactorAuthentication,omitempty"` + + AllowPublicKeyAuthentication bool `json:"allowPublicKeyAuthentication,omitempty"` + + AllowSshPasswordAuthentication bool `json:"allowSshPasswordAuthentication,omitempty"` + + AllowSshRootLogin bool `json:"allowSshRootLogin,omitempty"` + + AmazonInstanceID string `json:"amazonInstanceID,omitempty"` + + Arch string `json:"arch,omitempty"` + + AzureAdJoined bool `json:"azureAdJoined,omitempty"` + + BuiltInCommands []SystemBuiltInCommands `json:"builtInCommands,omitempty"` + + ConnectionHistory []interface{} `json:"connectionHistory,omitempty"` + + Created time.Time `json:"created,omitempty"` + + Description string `json:"description,omitempty"` + + DisplayManager string `json:"displayManager,omitempty"` + + DisplayName string `json:"displayName,omitempty"` + + DomainInfo *SystemDomainInfo `json:"domainInfo,omitempty"` + + Fde *Fde `json:"fde,omitempty"` + + FileSystem string `json:"fileSystem,omitempty"` + + HasServiceAccount bool `json:"hasServiceAccount,omitempty"` + + Hostname string `json:"hostname,omitempty"` + + LastContact time.Time `json:"lastContact,omitempty"` + + Mdm *SystemMdm `json:"mdm,omitempty"` + + ModifySSHDConfig bool `json:"modifySSHDConfig,omitempty"` + + NetworkInterfaces []SystemNetworkInterfaces `json:"networkInterfaces,omitempty"` + + Organization string `json:"organization,omitempty"` + + Os string `json:"os,omitempty"` + + OsFamily string `json:"osFamily,omitempty"` + + OsVersionDetail *SystemOsVersionDetail `json:"osVersionDetail,omitempty"` + + ProvisionMetadata *SystemProvisionMetadata `json:"provisionMetadata,omitempty"` + + RemoteIP string `json:"remoteIP,omitempty"` + + SerialNumber string `json:"serialNumber,omitempty"` + + ServiceAccountState *SystemServiceAccountState `json:"serviceAccountState,omitempty"` + + SshRootEnabled bool `json:"sshRootEnabled,omitempty"` + + SshdParams []SystemSshdParams `json:"sshdParams,omitempty"` + + SystemInsights *SystemSystemInsights `json:"systemInsights,omitempty"` + + SystemTimezone int32 `json:"systemTimezone,omitempty"` + + Tags []string `json:"tags,omitempty"` + + TemplateName string `json:"templateName,omitempty"` + + UserMetrics []SystemUserMetrics `json:"userMetrics,omitempty"` + + Version string `json:"version,omitempty"` +} diff --git a/jcapiv1/system_built_in_commands.go b/jcapiv1/system_built_in_commands.go new file mode 100644 index 0000000..5efd74e --- /dev/null +++ b/jcapiv1/system_built_in_commands.go @@ -0,0 +1,18 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 1.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package jcapiv1 + +type SystemBuiltInCommands struct { + + Name string `json:"name,omitempty"` + + Type_ string `json:"type,omitempty"` +} diff --git a/jcapiv1/system_domain_info.go b/jcapiv1/system_domain_info.go new file mode 100644 index 0000000..a18f1c6 --- /dev/null +++ b/jcapiv1/system_domain_info.go @@ -0,0 +1,18 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 1.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package jcapiv1 + +type SystemDomainInfo struct { + + DomainName string `json:"domainName,omitempty"` + + PartOfDomain bool `json:"partOfDomain,omitempty"` +} diff --git a/jcapiv1/system_mdm.go b/jcapiv1/system_mdm.go new file mode 100644 index 0000000..dd027d7 --- /dev/null +++ b/jcapiv1/system_mdm.go @@ -0,0 +1,26 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 1.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package jcapiv1 + +type SystemMdm struct { + + Dep bool `json:"dep,omitempty"` + + EnrollmentType string `json:"enrollmentType,omitempty"` + + Internal *SystemMdmInternal `json:"internal,omitempty"` + + ProfileIdentifier string `json:"profileIdentifier,omitempty"` + + UserApproved bool `json:"userApproved,omitempty"` + + Vendor string `json:"vendor,omitempty"` +} diff --git a/jcapiv1/system_mdm_internal.go b/jcapiv1/system_mdm_internal.go new file mode 100644 index 0000000..27dd19a --- /dev/null +++ b/jcapiv1/system_mdm_internal.go @@ -0,0 +1,16 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 1.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package jcapiv1 + +type SystemMdmInternal struct { + + DeviceId string `json:"deviceId,omitempty"` +} diff --git a/jcapiv1/system_network_interfaces.go b/jcapiv1/system_network_interfaces.go new file mode 100644 index 0000000..0584939 --- /dev/null +++ b/jcapiv1/system_network_interfaces.go @@ -0,0 +1,22 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 1.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package jcapiv1 + +type SystemNetworkInterfaces struct { + + Address string `json:"address,omitempty"` + + Family string `json:"family,omitempty"` + + Internal bool `json:"internal,omitempty"` + + Name string `json:"name,omitempty"` +} diff --git a/jcapiv1/system_os_version_detail.go b/jcapiv1/system_os_version_detail.go new file mode 100644 index 0000000..4717aac --- /dev/null +++ b/jcapiv1/system_os_version_detail.go @@ -0,0 +1,26 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 1.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package jcapiv1 + +type SystemOsVersionDetail struct { + + Major string `json:"major,omitempty"` + + Minor string `json:"minor,omitempty"` + + OsName string `json:"osName,omitempty"` + + Patch string `json:"patch,omitempty"` + + ReleaseName string `json:"releaseName,omitempty"` + + Revision string `json:"revision,omitempty"` +} diff --git a/jcapiv1/system_provision_metadata.go b/jcapiv1/system_provision_metadata.go new file mode 100644 index 0000000..6fd942d --- /dev/null +++ b/jcapiv1/system_provision_metadata.go @@ -0,0 +1,16 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 1.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package jcapiv1 + +type SystemProvisionMetadata struct { + + Provisioner *SystemProvisionMetadataProvisioner `json:"provisioner,omitempty"` +} diff --git a/jcapiv1/system_provision_metadata_provisioner.go b/jcapiv1/system_provision_metadata_provisioner.go new file mode 100644 index 0000000..8fddd38 --- /dev/null +++ b/jcapiv1/system_provision_metadata_provisioner.go @@ -0,0 +1,18 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 1.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package jcapiv1 + +type SystemProvisionMetadataProvisioner struct { + + ProvisionerId string `json:"provisionerId,omitempty"` + + Type_ string `json:"type,omitempty"` +} diff --git a/jcapiv1/system_service_account_state.go b/jcapiv1/system_service_account_state.go new file mode 100644 index 0000000..6789d56 --- /dev/null +++ b/jcapiv1/system_service_account_state.go @@ -0,0 +1,20 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 1.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package jcapiv1 + +type SystemServiceAccountState struct { + + HasSecureToken bool `json:"hasSecureToken,omitempty"` + + PasswordAPFSValid bool `json:"passwordAPFSValid,omitempty"` + + PasswordODValid bool `json:"passwordODValid,omitempty"` +} diff --git a/jcapiv1/system_sshd_params.go b/jcapiv1/system_sshd_params.go new file mode 100644 index 0000000..7c99d51 --- /dev/null +++ b/jcapiv1/system_sshd_params.go @@ -0,0 +1,18 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 1.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package jcapiv1 + +type SystemSshdParams struct { + + Name string `json:"name,omitempty"` + + Value string `json:"value,omitempty"` +} diff --git a/jcapiv1/system_system_insights.go b/jcapiv1/system_system_insights.go new file mode 100644 index 0000000..4bf8fd1 --- /dev/null +++ b/jcapiv1/system_system_insights.go @@ -0,0 +1,16 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 1.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package jcapiv1 + +type SystemSystemInsights struct { + + State string `json:"state,omitempty"` +} diff --git a/jcapiv1/system_user_metrics.go b/jcapiv1/system_user_metrics.go new file mode 100644 index 0000000..65f4ac1 --- /dev/null +++ b/jcapiv1/system_user_metrics.go @@ -0,0 +1,24 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 1.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package jcapiv1 + +type SystemUserMetrics struct { + + Admin bool `json:"admin,omitempty"` + + Managed bool `json:"managed,omitempty"` + + SecureTokenEnabled bool `json:"secureTokenEnabled,omitempty"` + + Suspended bool `json:"suspended,omitempty"` + + UserName string `json:"userName,omitempty"` +} diff --git a/jcapiv1/systemput.go b/jcapiv1/systemput.go new file mode 100644 index 0000000..ba2bfc8 --- /dev/null +++ b/jcapiv1/systemput.go @@ -0,0 +1,28 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 1.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package jcapiv1 + +type Systemput struct { + + AgentBoundMessages []SystemputAgentBoundMessages `json:"agentBoundMessages,omitempty"` + + AllowMultiFactorAuthentication bool `json:"allowMultiFactorAuthentication,omitempty"` + + AllowPublicKeyAuthentication bool `json:"allowPublicKeyAuthentication,omitempty"` + + AllowSshPasswordAuthentication bool `json:"allowSshPasswordAuthentication,omitempty"` + + AllowSshRootLogin bool `json:"allowSshRootLogin,omitempty"` + + DisplayName string `json:"displayName,omitempty"` + + Tags []string `json:"tags,omitempty"` +} diff --git a/jcapiv1/systemput_agent_bound_messages.go b/jcapiv1/systemput_agent_bound_messages.go new file mode 100644 index 0000000..28fbca0 --- /dev/null +++ b/jcapiv1/systemput_agent_bound_messages.go @@ -0,0 +1,16 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 1.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package jcapiv1 + +type SystemputAgentBoundMessages struct { + + Cmd string `json:"cmd,omitempty"` +} diff --git a/jcapiv1/systems_api.go b/jcapiv1/systems_api.go new file mode 100644 index 0000000..3af1b4f --- /dev/null +++ b/jcapiv1/systems_api.go @@ -0,0 +1,787 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 1.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package jcapiv1 + +import ( + "io/ioutil" + "net/url" + "net/http" + "strings" + "golang.org/x/net/context" + "encoding/json" + "fmt" +) + +// Linger please +var ( + _ context.Context +) + +type SystemsApiService service + + +/* SystemsApiService Erase a System + This endpoint allows you to run the erase command on the specified device. If a device is offline, the command will be run when the device becomes available. #### Sample Request ``` curl -X POST \\ https://console.jumpcloud.com/api/systems/{system_id}/command/builtin/erase \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d {} ``` + * @param ctx context.Context for authentication, logging, tracing, etc. + @param systemId + @param optional (nil or map[string]interface{}) with one or more of: + @param "xOrgId" (string) + @return */ +func (a *SystemsApiService) SystemsCommandBuiltinErase(ctx context.Context, systemId string, localVarOptionals map[string]interface{}) ( *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Post") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/systems/{system_id}/command/builtin/erase" + localVarPath = strings.Replace(localVarPath, "{"+"system_id"+"}", fmt.Sprintf("%v", systemId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { + return nil, err + } + + // to determine the Content-Type header + localVarHttpContentTypes := []string{ "application/json", } + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{ + "application/json", + } + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { + localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarHttpResponse, err + } + defer localVarHttpResponse.Body.Close() + if localVarHttpResponse.StatusCode >= 300 { + bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) + return localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) + } + + return localVarHttpResponse, err +} + +/* SystemsApiService Lock a System + This endpoint allows you to run the lock command on the specified device. If a device is offline, the command will be run when the device becomes available. #### Sample Request ``` curl -X POST \\ https://console.jumpcloud.com/api/systems/{system_id}/command/builtin/lock \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d {} ``` + * @param ctx context.Context for authentication, logging, tracing, etc. + @param systemId + @param optional (nil or map[string]interface{}) with one or more of: + @param "xOrgId" (string) + @return */ +func (a *SystemsApiService) SystemsCommandBuiltinLock(ctx context.Context, systemId string, localVarOptionals map[string]interface{}) ( *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Post") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/systems/{system_id}/command/builtin/lock" + localVarPath = strings.Replace(localVarPath, "{"+"system_id"+"}", fmt.Sprintf("%v", systemId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { + return nil, err + } + + // to determine the Content-Type header + localVarHttpContentTypes := []string{ "application/json", } + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{ + "application/json", + } + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { + localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarHttpResponse, err + } + defer localVarHttpResponse.Body.Close() + if localVarHttpResponse.StatusCode >= 300 { + bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) + return localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) + } + + return localVarHttpResponse, err +} + +/* SystemsApiService Restart a System + This endpoint allows you to run the restart command on the specified device. If a device is offline, the command will be run when the device becomes available. #### Sample Request ``` curl -X POST \\ https://console.jumpcloud.com/api/systems/{system_id}/command/builtin/restart \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d {} ``` + * @param ctx context.Context for authentication, logging, tracing, etc. + @param systemId + @param optional (nil or map[string]interface{}) with one or more of: + @param "xOrgId" (string) + @return */ +func (a *SystemsApiService) SystemsCommandBuiltinRestart(ctx context.Context, systemId string, localVarOptionals map[string]interface{}) ( *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Post") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/systems/{system_id}/command/builtin/restart" + localVarPath = strings.Replace(localVarPath, "{"+"system_id"+"}", fmt.Sprintf("%v", systemId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { + return nil, err + } + + // to determine the Content-Type header + localVarHttpContentTypes := []string{ "application/json", } + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{ + "application/json", + } + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { + localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarHttpResponse, err + } + defer localVarHttpResponse.Body.Close() + if localVarHttpResponse.StatusCode >= 300 { + bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) + return localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) + } + + return localVarHttpResponse, err +} + +/* SystemsApiService Shutdown a System + This endpoint allows you to run the shutdown command on the specified device. If a device is offline, the command will be run when the device becomes available. #### Sample Request ``` curl -X POST \\ https://console.jumpcloud.com/api/systems/{system_id}/command/builtin/shutdown \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d {} ``` + * @param ctx context.Context for authentication, logging, tracing, etc. + @param systemId + @param optional (nil or map[string]interface{}) with one or more of: + @param "xOrgId" (string) + @return */ +func (a *SystemsApiService) SystemsCommandBuiltinShutdown(ctx context.Context, systemId string, localVarOptionals map[string]interface{}) ( *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Post") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/systems/{system_id}/command/builtin/shutdown" + localVarPath = strings.Replace(localVarPath, "{"+"system_id"+"}", fmt.Sprintf("%v", systemId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { + return nil, err + } + + // to determine the Content-Type header + localVarHttpContentTypes := []string{ "application/json", } + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{ + "application/json", + } + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { + localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarHttpResponse, err + } + defer localVarHttpResponse.Body.Close() + if localVarHttpResponse.StatusCode >= 300 { + bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) + return localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) + } + + return localVarHttpResponse, err +} + +/* SystemsApiService Delete a System + This endpoint allows you to delete a system. This command will cause the system to uninstall the JumpCloud agent from its self which can can take about a minute. If the system is not connected to JumpCloud the system record will simply be removed. #### Sample Request ``` curl -X DELETE https://console.jumpcloud.com/api/systems/{SystemID} \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + * @param ctx context.Context for authentication, logging, tracing, etc. + @param id + @param optional (nil or map[string]interface{}) with one or more of: + @param "date" (string) Current date header for the System Context API + @param "authorization" (string) Authorization header for the System Context API + @param "xOrgId" (string) + @return System*/ +func (a *SystemsApiService) SystemsDelete(ctx context.Context, id string, localVarOptionals map[string]interface{}) (System, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Delete") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + successPayload System + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/systems/{id}" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if err := typeCheckParameter(localVarOptionals["date"], "string", "date"); err != nil { + return successPayload, nil, err + } + if err := typeCheckParameter(localVarOptionals["authorization"], "string", "authorization"); err != nil { + return successPayload, nil, err + } + if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { + return successPayload, nil, err + } + + // to determine the Content-Type header + localVarHttpContentTypes := []string{ "application/json", } + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{ + "application/json", + } + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarTempParam, localVarOk := localVarOptionals["date"].(string); localVarOk { + localVarHeaderParams["Date"] = parameterToString(localVarTempParam, "") + } + if localVarTempParam, localVarOk := localVarOptionals["authorization"].(string); localVarOk { + localVarHeaderParams["Authorization"] = parameterToString(localVarTempParam, "") + } + if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { + localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return successPayload, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return successPayload, localVarHttpResponse, err + } + defer localVarHttpResponse.Body.Close() + if localVarHttpResponse.StatusCode >= 300 { + bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) + return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) + } + + if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { + return successPayload, localVarHttpResponse, err + } + + + return successPayload, localVarHttpResponse, err +} + +/* SystemsApiService List an individual system + This endpoint returns an individual system. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/systems/{SystemID} \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + * @param ctx context.Context for authentication, logging, tracing, etc. + @param id + @param optional (nil or map[string]interface{}) with one or more of: + @param "fields" (string) Use a space seperated string of field parameters to include the data in the response. If omitted, the default list of fields will be returned. + @param "filter" (string) A filter to apply to the query. See the supported operators below. For more complex searches, see the related `/search/<domain>` endpoints, e.g. `/search/systems`. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: - `$eq` (equals) - `$ne` (does not equal) - `$gt` (is greater than) - `$gte` (is greater than or equal to) - `$lt` (is less than) - `$lte` (is less than or equal to) _Note: v1 operators differ from v2 operators._ _Note: For v1 operators, excluding the `$` will result in undefined behavior._ **value** = Populate with the value you want to search for. Is case sensitive. **Examples** - `GET /users?filter=username:$eq:testuser` - `GET /systemusers?filter=password_expiration_date:$lte:2021-10-24` - `GET /systemusers?filter=department:$ne:Accounting` - `GET /systems?filter[0]=firstname:$eq:foo&filter[1]=lastname:$eq:bar` - this will AND the filters together. - `GET /systems?filter[or][0]=lastname:$eq:foo&filter[or][1]=lastname:$eq:bar` - this will OR the filters together. + @param "date" (string) Current date header for the System Context API + @param "authorization" (string) Authorization header for the System Context API + @param "xOrgId" (string) + @return System*/ +func (a *SystemsApiService) SystemsGet(ctx context.Context, id string, localVarOptionals map[string]interface{}) (System, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + successPayload System + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/systems/{id}" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if err := typeCheckParameter(localVarOptionals["fields"], "string", "fields"); err != nil { + return successPayload, nil, err + } + if err := typeCheckParameter(localVarOptionals["filter"], "string", "filter"); err != nil { + return successPayload, nil, err + } + if err := typeCheckParameter(localVarOptionals["date"], "string", "date"); err != nil { + return successPayload, nil, err + } + if err := typeCheckParameter(localVarOptionals["authorization"], "string", "authorization"); err != nil { + return successPayload, nil, err + } + if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { + return successPayload, nil, err + } + + if localVarTempParam, localVarOk := localVarOptionals["fields"].(string); localVarOk { + localVarQueryParams.Add("fields", parameterToString(localVarTempParam, "")) + } + if localVarTempParam, localVarOk := localVarOptionals["filter"].(string); localVarOk { + localVarQueryParams.Add("filter", parameterToString(localVarTempParam, "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{ "application/json", } + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{ + "application/json", + } + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarTempParam, localVarOk := localVarOptionals["date"].(string); localVarOk { + localVarHeaderParams["Date"] = parameterToString(localVarTempParam, "") + } + if localVarTempParam, localVarOk := localVarOptionals["authorization"].(string); localVarOk { + localVarHeaderParams["Authorization"] = parameterToString(localVarTempParam, "") + } + if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { + localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return successPayload, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return successPayload, localVarHttpResponse, err + } + defer localVarHttpResponse.Body.Close() + if localVarHttpResponse.StatusCode >= 300 { + bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) + return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) + } + + if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { + return successPayload, localVarHttpResponse, err + } + + + return successPayload, localVarHttpResponse, err +} + +/* SystemsApiService List All Systems + This endpoint returns all Systems. #### Sample Requests ``` curl -X GET https://console.jumpcloud.com/api/systems \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + * @param ctx context.Context for authentication, logging, tracing, etc. + @param optional (nil or map[string]interface{}) with one or more of: + @param "fields" (string) Use a space seperated string of field parameters to include the data in the response. If omitted, the default list of fields will be returned. + @param "limit" (int32) The number of records to return at once. Limited to 100. + @param "xOrgId" (string) + @param "search" (string) A nested object containing a `searchTerm` string or array of strings and a list of `fields` to search on. + @param "skip" (int32) The offset into the records to return. + @param "sort" (string) Use space separated sort parameters to sort the collection. Default sort is ascending. Prefix with `-` to sort descending. + @param "filter" (string) A filter to apply to the query. See the supported operators below. For more complex searches, see the related `/search/<domain>` endpoints, e.g. `/search/systems`. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: - `$eq` (equals) - `$ne` (does not equal) - `$gt` (is greater than) - `$gte` (is greater than or equal to) - `$lt` (is less than) - `$lte` (is less than or equal to) _Note: v1 operators differ from v2 operators._ _Note: For v1 operators, excluding the `$` will result in undefined behavior._ **value** = Populate with the value you want to search for. Is case sensitive. **Examples** - `GET /users?filter=username:$eq:testuser` - `GET /systemusers?filter=password_expiration_date:$lte:2021-10-24` - `GET /systemusers?filter=department:$ne:Accounting` - `GET /systems?filter[0]=firstname:$eq:foo&filter[1]=lastname:$eq:bar` - this will AND the filters together. - `GET /systems?filter[or][0]=lastname:$eq:foo&filter[or][1]=lastname:$eq:bar` - this will OR the filters together. + @return Systemslist*/ +func (a *SystemsApiService) SystemsList(ctx context.Context, localVarOptionals map[string]interface{}) (Systemslist, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + successPayload Systemslist + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/systems" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if err := typeCheckParameter(localVarOptionals["fields"], "string", "fields"); err != nil { + return successPayload, nil, err + } + if err := typeCheckParameter(localVarOptionals["limit"], "int32", "limit"); err != nil { + return successPayload, nil, err + } + if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { + return successPayload, nil, err + } + if err := typeCheckParameter(localVarOptionals["search"], "string", "search"); err != nil { + return successPayload, nil, err + } + if err := typeCheckParameter(localVarOptionals["skip"], "int32", "skip"); err != nil { + return successPayload, nil, err + } + if err := typeCheckParameter(localVarOptionals["sort"], "string", "sort"); err != nil { + return successPayload, nil, err + } + if err := typeCheckParameter(localVarOptionals["filter"], "string", "filter"); err != nil { + return successPayload, nil, err + } + + if localVarTempParam, localVarOk := localVarOptionals["fields"].(string); localVarOk { + localVarQueryParams.Add("fields", parameterToString(localVarTempParam, "")) + } + if localVarTempParam, localVarOk := localVarOptionals["limit"].(int32); localVarOk { + localVarQueryParams.Add("limit", parameterToString(localVarTempParam, "")) + } + if localVarTempParam, localVarOk := localVarOptionals["search"].(string); localVarOk { + localVarQueryParams.Add("search", parameterToString(localVarTempParam, "")) + } + if localVarTempParam, localVarOk := localVarOptionals["skip"].(int32); localVarOk { + localVarQueryParams.Add("skip", parameterToString(localVarTempParam, "")) + } + if localVarTempParam, localVarOk := localVarOptionals["sort"].(string); localVarOk { + localVarQueryParams.Add("sort", parameterToString(localVarTempParam, "")) + } + if localVarTempParam, localVarOk := localVarOptionals["filter"].(string); localVarOk { + localVarQueryParams.Add("filter", parameterToString(localVarTempParam, "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{ "application/json", } + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{ + "application/json", + } + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { + localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return successPayload, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return successPayload, localVarHttpResponse, err + } + defer localVarHttpResponse.Body.Close() + if localVarHttpResponse.StatusCode >= 300 { + bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) + return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) + } + + if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { + return successPayload, localVarHttpResponse, err + } + + + return successPayload, localVarHttpResponse, err +} + +/* SystemsApiService Update a system + This endpoint allows you to update a system. #### Sample Request ``` curl -X PUT https://console.jumpcloud.com/api/systems/{SystemID} \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"displayName\":\"Name_Update\", \"allowSshPasswordAuthentication\":\"true\", \"allowSshRootLogin\":\"true\", \"allowMultiFactorAuthentication\":\"true\", \"allowPublicKeyAuthentication\":\"false\" }' ``` + * @param ctx context.Context for authentication, logging, tracing, etc. + @param id + @param optional (nil or map[string]interface{}) with one or more of: + @param "body" (Systemput) + @param "date" (string) Current date header for the System Context API + @param "authorization" (string) Authorization header for the System Context API + @param "xOrgId" (string) + @return System*/ +func (a *SystemsApiService) SystemsPut(ctx context.Context, id string, localVarOptionals map[string]interface{}) (System, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Put") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + successPayload System + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/systems/{id}" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if err := typeCheckParameter(localVarOptionals["date"], "string", "date"); err != nil { + return successPayload, nil, err + } + if err := typeCheckParameter(localVarOptionals["authorization"], "string", "authorization"); err != nil { + return successPayload, nil, err + } + if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { + return successPayload, nil, err + } + + // to determine the Content-Type header + localVarHttpContentTypes := []string{ "application/json", } + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{ + "application/json", + } + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarTempParam, localVarOk := localVarOptionals["date"].(string); localVarOk { + localVarHeaderParams["Date"] = parameterToString(localVarTempParam, "") + } + if localVarTempParam, localVarOk := localVarOptionals["authorization"].(string); localVarOk { + localVarHeaderParams["Authorization"] = parameterToString(localVarTempParam, "") + } + if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { + localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") + } + // body params + if localVarTempParam, localVarOk := localVarOptionals["body"].(Systemput); localVarOk { + localVarPostBody = &localVarTempParam + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return successPayload, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return successPayload, localVarHttpResponse, err + } + defer localVarHttpResponse.Body.Close() + if localVarHttpResponse.StatusCode >= 300 { + bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) + return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) + } + + if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { + return successPayload, localVarHttpResponse, err + } + + + return successPayload, localVarHttpResponse, err +} + diff --git a/jcapiv1/systemslist.go b/jcapiv1/systemslist.go new file mode 100644 index 0000000..8bbd85c --- /dev/null +++ b/jcapiv1/systemslist.go @@ -0,0 +1,20 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 1.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package jcapiv1 + +type Systemslist struct { + + // The list of systems. + Results []System `json:"results,omitempty"` + + // The total number of systems. + TotalCount int32 `json:"totalCount,omitempty"` +} diff --git a/jcapiv1/systemuserput.go b/jcapiv1/systemuserput.go new file mode 100644 index 0000000..83f8c03 --- /dev/null +++ b/jcapiv1/systemuserput.go @@ -0,0 +1,103 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 1.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package jcapiv1 + +type Systemuserput struct { + + AccountLocked bool `json:"account_locked,omitempty"` + + // type, poBox, extendedAddress, streetAddress, locality, region, postalCode, country + Addresses []SystemuserputAddresses `json:"addresses,omitempty"` + + AllowPublicKey bool `json:"allow_public_key,omitempty"` + + AlternateEmail string `json:"alternateEmail,omitempty"` + + Attributes []SystemuserputAttributes `json:"attributes,omitempty"` + + Company string `json:"company,omitempty"` + + CostCenter string `json:"costCenter,omitempty"` + + Department string `json:"department,omitempty"` + + Description string `json:"description,omitempty"` + + DisableDeviceMaxLoginAttempts bool `json:"disableDeviceMaxLoginAttempts,omitempty"` + + Displayname string `json:"displayname,omitempty"` + + Email string `json:"email,omitempty"` + + // Must be unique per user. + EmployeeIdentifier string `json:"employeeIdentifier,omitempty"` + + EmployeeType string `json:"employeeType,omitempty"` + + EnableManagedUid bool `json:"enable_managed_uid,omitempty"` + + EnableUserPortalMultifactor bool `json:"enable_user_portal_multifactor,omitempty"` + + ExternalDn string `json:"external_dn,omitempty"` + + ExternalPasswordExpirationDate string `json:"external_password_expiration_date,omitempty"` + + ExternalSourceType string `json:"external_source_type,omitempty"` + + ExternallyManaged bool `json:"externally_managed,omitempty"` + + Firstname string `json:"firstname,omitempty"` + + JobTitle string `json:"jobTitle,omitempty"` + + Lastname string `json:"lastname,omitempty"` + + LdapBindingUser bool `json:"ldap_binding_user,omitempty"` + + Location string `json:"location,omitempty"` + + ManagedAppleId string `json:"managedAppleId,omitempty"` + + // Relation with another systemuser to identify the last as a manager. + Manager string `json:"manager,omitempty"` + + Mfa *Mfa `json:"mfa,omitempty"` + + Middlename string `json:"middlename,omitempty"` + + Password string `json:"password,omitempty"` + + PasswordNeverExpires bool `json:"password_never_expires,omitempty"` + + PhoneNumbers []SystemuserputPhoneNumbers `json:"phoneNumbers,omitempty"` + + PublicKey string `json:"public_key,omitempty"` + + Relationships []SystemuserputRelationships `json:"relationships,omitempty"` + + SambaServiceUser bool `json:"samba_service_user,omitempty"` + + SshKeys []Sshkeypost `json:"ssh_keys,omitempty"` + + State string `json:"state,omitempty"` + + Sudo bool `json:"sudo,omitempty"` + + Suspended bool `json:"suspended,omitempty"` + + Tags []string `json:"tags,omitempty"` + + UnixGuid int32 `json:"unix_guid,omitempty"` + + UnixUid int32 `json:"unix_uid,omitempty"` + + Username string `json:"username,omitempty"` +} diff --git a/jcapiv1/systemuserput_addresses.go b/jcapiv1/systemuserput_addresses.go new file mode 100644 index 0000000..0853b18 --- /dev/null +++ b/jcapiv1/systemuserput_addresses.go @@ -0,0 +1,30 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 1.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package jcapiv1 + +type SystemuserputAddresses struct { + + Country string `json:"country,omitempty"` + + ExtendedAddress string `json:"extendedAddress,omitempty"` + + Locality string `json:"locality,omitempty"` + + PoBox string `json:"poBox,omitempty"` + + PostalCode string `json:"postalCode,omitempty"` + + Region string `json:"region,omitempty"` + + StreetAddress string `json:"streetAddress,omitempty"` + + Type_ string `json:"type,omitempty"` +} diff --git a/jcapiv1/systemuserput_attributes.go b/jcapiv1/systemuserput_attributes.go new file mode 100644 index 0000000..4f9d9e3 --- /dev/null +++ b/jcapiv1/systemuserput_attributes.go @@ -0,0 +1,18 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 1.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package jcapiv1 + +type SystemuserputAttributes struct { + + Name string `json:"name,omitempty"` + + Value string `json:"value,omitempty"` +} diff --git a/jcapiv1/systemuserput_phone_numbers.go b/jcapiv1/systemuserput_phone_numbers.go new file mode 100644 index 0000000..2ca2375 --- /dev/null +++ b/jcapiv1/systemuserput_phone_numbers.go @@ -0,0 +1,18 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 1.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package jcapiv1 + +type SystemuserputPhoneNumbers struct { + + Number string `json:"number,omitempty"` + + Type_ string `json:"type,omitempty"` +} diff --git a/jcapiv1/systemuserput_relationships.go b/jcapiv1/systemuserput_relationships.go new file mode 100644 index 0000000..5cb0d44 --- /dev/null +++ b/jcapiv1/systemuserput_relationships.go @@ -0,0 +1,18 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 1.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package jcapiv1 + +type SystemuserputRelationships struct { + + Type_ string `json:"type,omitempty"` + + Value string `json:"value,omitempty"` +} diff --git a/jcapiv1/systemuserputpost.go b/jcapiv1/systemuserputpost.go new file mode 100644 index 0000000..3e7bd6b --- /dev/null +++ b/jcapiv1/systemuserputpost.go @@ -0,0 +1,110 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 1.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package jcapiv1 + +import ( + "time" +) + +type Systemuserputpost struct { + + AccountLocked bool `json:"account_locked,omitempty"` + + Activated bool `json:"activated,omitempty"` + + Addresses []SystemuserputpostAddresses `json:"addresses,omitempty"` + + AllowPublicKey bool `json:"allow_public_key,omitempty"` + + AlternateEmail string `json:"alternateEmail,omitempty"` + + Attributes []SystemuserputAttributes `json:"attributes,omitempty"` + + Company string `json:"company,omitempty"` + + CostCenter string `json:"costCenter,omitempty"` + + Department string `json:"department,omitempty"` + + Description string `json:"description,omitempty"` + + DisableDeviceMaxLoginAttempts bool `json:"disableDeviceMaxLoginAttempts,omitempty"` + + Displayname string `json:"displayname,omitempty"` + + Email string `json:"email"` + + // Must be unique per user. + EmployeeIdentifier string `json:"employeeIdentifier,omitempty"` + + EmployeeType string `json:"employeeType,omitempty"` + + EnableManagedUid bool `json:"enable_managed_uid,omitempty"` + + EnableUserPortalMultifactor bool `json:"enable_user_portal_multifactor,omitempty"` + + ExternalDn string `json:"external_dn,omitempty"` + + ExternalPasswordExpirationDate time.Time `json:"external_password_expiration_date,omitempty"` + + ExternalSourceType string `json:"external_source_type,omitempty"` + + ExternallyManaged bool `json:"externally_managed,omitempty"` + + Firstname string `json:"firstname,omitempty"` + + JobTitle string `json:"jobTitle,omitempty"` + + Lastname string `json:"lastname,omitempty"` + + LdapBindingUser bool `json:"ldap_binding_user,omitempty"` + + Location string `json:"location,omitempty"` + + ManagedAppleId string `json:"managedAppleId,omitempty"` + + // Relation with another systemuser to identify the last as a manager. + Manager string `json:"manager,omitempty"` + + Mfa *Mfa `json:"mfa,omitempty"` + + Middlename string `json:"middlename,omitempty"` + + Password string `json:"password,omitempty"` + + PasswordNeverExpires bool `json:"password_never_expires,omitempty"` + + PasswordlessSudo bool `json:"passwordless_sudo,omitempty"` + + PhoneNumbers []SystemuserputpostPhoneNumbers `json:"phoneNumbers,omitempty"` + + PublicKey string `json:"public_key,omitempty"` + + RecoveryEmail *SystemuserputpostRecoveryEmail `json:"recoveryEmail,omitempty"` + + Relationships []SystemuserputRelationships `json:"relationships,omitempty"` + + SambaServiceUser bool `json:"samba_service_user,omitempty"` + + State string `json:"state,omitempty"` + + Sudo bool `json:"sudo,omitempty"` + + Suspended bool `json:"suspended,omitempty"` + + Tags []string `json:"tags,omitempty"` + + UnixGuid int32 `json:"unix_guid,omitempty"` + + UnixUid int32 `json:"unix_uid,omitempty"` + + Username string `json:"username"` +} diff --git a/jcapiv1/systemuserputpost_addresses.go b/jcapiv1/systemuserputpost_addresses.go new file mode 100644 index 0000000..55430c7 --- /dev/null +++ b/jcapiv1/systemuserputpost_addresses.go @@ -0,0 +1,30 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 1.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package jcapiv1 + +type SystemuserputpostAddresses struct { + + Country string `json:"country,omitempty"` + + ExtendedAddress string `json:"extendedAddress,omitempty"` + + Locality string `json:"locality,omitempty"` + + PoBox string `json:"poBox,omitempty"` + + PostalCode string `json:"postalCode,omitempty"` + + Region string `json:"region,omitempty"` + + StreetAddress string `json:"streetAddress,omitempty"` + + Type_ string `json:"type,omitempty"` +} diff --git a/jcapiv1/systemuserputpost_phone_numbers.go b/jcapiv1/systemuserputpost_phone_numbers.go new file mode 100644 index 0000000..080aaae --- /dev/null +++ b/jcapiv1/systemuserputpost_phone_numbers.go @@ -0,0 +1,18 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 1.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package jcapiv1 + +type SystemuserputpostPhoneNumbers struct { + + Number string `json:"number,omitempty"` + + Type_ string `json:"type,omitempty"` +} diff --git a/jcapiv1/systemuserputpost_recovery_email.go b/jcapiv1/systemuserputpost_recovery_email.go new file mode 100644 index 0000000..10f4d0f --- /dev/null +++ b/jcapiv1/systemuserputpost_recovery_email.go @@ -0,0 +1,16 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 1.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package jcapiv1 + +type SystemuserputpostRecoveryEmail struct { + + Address string `json:"address,omitempty"` +} diff --git a/jcapiv1/systemuserreturn.go b/jcapiv1/systemuserreturn.go new file mode 100644 index 0000000..89de99f --- /dev/null +++ b/jcapiv1/systemuserreturn.go @@ -0,0 +1,126 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 1.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package jcapiv1 + +type Systemuserreturn struct { + + Id string `json:"_id,omitempty"` + + AccountLocked bool `json:"account_locked,omitempty"` + + AccountLockedDate string `json:"account_locked_date,omitempty"` + + Activated bool `json:"activated,omitempty"` + + Addresses []SystemuserreturnAddresses `json:"addresses,omitempty"` + + AllowPublicKey bool `json:"allow_public_key,omitempty"` + + AlternateEmail string `json:"alternateEmail,omitempty"` + + Attributes []SystemuserputAttributes `json:"attributes,omitempty"` + + BadLoginAttempts int32 `json:"badLoginAttempts,omitempty"` + + Company string `json:"company,omitempty"` + + CostCenter string `json:"costCenter,omitempty"` + + Created string `json:"created,omitempty"` + + CreationSource string `json:"creationSource,omitempty"` + + Department string `json:"department,omitempty"` + + Description string `json:"description,omitempty"` + + DisableDeviceMaxLoginAttempts bool `json:"disableDeviceMaxLoginAttempts,omitempty"` + + Displayname string `json:"displayname,omitempty"` + + Email string `json:"email,omitempty"` + + // Must be unique per user. + EmployeeIdentifier string `json:"employeeIdentifier,omitempty"` + + EmployeeType string `json:"employeeType,omitempty"` + + EnableManagedUid bool `json:"enable_managed_uid,omitempty"` + + EnableUserPortalMultifactor bool `json:"enable_user_portal_multifactor,omitempty"` + + ExternalDn string `json:"external_dn,omitempty"` + + ExternalPasswordExpirationDate string `json:"external_password_expiration_date,omitempty"` + + ExternalSourceType string `json:"external_source_type,omitempty"` + + ExternallyManaged bool `json:"externally_managed,omitempty"` + + Firstname string `json:"firstname,omitempty"` + + JobTitle string `json:"jobTitle,omitempty"` + + Lastname string `json:"lastname,omitempty"` + + LdapBindingUser bool `json:"ldap_binding_user,omitempty"` + + Location string `json:"location,omitempty"` + + ManagedAppleId string `json:"managedAppleId,omitempty"` + + // Relation with another systemuser to identify the last as a manager. + Manager string `json:"manager,omitempty"` + + Mfa *Mfa `json:"mfa,omitempty"` + + MfaEnrollment *MfaEnrollment `json:"mfaEnrollment,omitempty"` + + Middlename string `json:"middlename,omitempty"` + + Organization string `json:"organization,omitempty"` + + PasswordExpirationDate string `json:"password_expiration_date,omitempty"` + + PasswordExpired bool `json:"password_expired,omitempty"` + + PasswordNeverExpires bool `json:"password_never_expires,omitempty"` + + PasswordlessSudo bool `json:"passwordless_sudo,omitempty"` + + PhoneNumbers []SystemuserreturnPhoneNumbers `json:"phoneNumbers,omitempty"` + + PublicKey string `json:"public_key,omitempty"` + + RecoveryEmail *SystemuserreturnRecoveryEmail `json:"recoveryEmail,omitempty"` + + Relationships []SystemuserputRelationships `json:"relationships,omitempty"` + + SambaServiceUser bool `json:"samba_service_user,omitempty"` + + SshKeys []Sshkeylist `json:"ssh_keys,omitempty"` + + State string `json:"state,omitempty"` + + Sudo bool `json:"sudo,omitempty"` + + Suspended bool `json:"suspended,omitempty"` + + Tags []string `json:"tags,omitempty"` + + TotpEnabled bool `json:"totp_enabled,omitempty"` + + UnixGuid int32 `json:"unix_guid,omitempty"` + + UnixUid int32 `json:"unix_uid,omitempty"` + + Username string `json:"username,omitempty"` +} diff --git a/jcapiv1/systemuserreturn_addresses.go b/jcapiv1/systemuserreturn_addresses.go new file mode 100644 index 0000000..0bac726 --- /dev/null +++ b/jcapiv1/systemuserreturn_addresses.go @@ -0,0 +1,32 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 1.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package jcapiv1 + +type SystemuserreturnAddresses struct { + + Country string `json:"country,omitempty"` + + ExtendedAddress string `json:"extendedAddress,omitempty"` + + Id string `json:"id,omitempty"` + + Locality string `json:"locality,omitempty"` + + PoBox string `json:"poBox,omitempty"` + + PostalCode string `json:"postalCode,omitempty"` + + Region string `json:"region,omitempty"` + + StreetAddress string `json:"streetAddress,omitempty"` + + Type_ string `json:"type,omitempty"` +} diff --git a/jcapiv1/systemuserreturn_phone_numbers.go b/jcapiv1/systemuserreturn_phone_numbers.go new file mode 100644 index 0000000..b403656 --- /dev/null +++ b/jcapiv1/systemuserreturn_phone_numbers.go @@ -0,0 +1,20 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 1.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package jcapiv1 + +type SystemuserreturnPhoneNumbers struct { + + Id string `json:"id,omitempty"` + + Number string `json:"number,omitempty"` + + Type_ string `json:"type,omitempty"` +} diff --git a/jcapiv1/systemuserreturn_recovery_email.go b/jcapiv1/systemuserreturn_recovery_email.go new file mode 100644 index 0000000..3c7641f --- /dev/null +++ b/jcapiv1/systemuserreturn_recovery_email.go @@ -0,0 +1,20 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 1.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package jcapiv1 + +type SystemuserreturnRecoveryEmail struct { + + Address string `json:"address,omitempty"` + + Verified bool `json:"verified,omitempty"` + + VerifiedAt string `json:"verifiedAt,omitempty"` +} diff --git a/jcapiv1/systemusers_api.go b/jcapiv1/systemusers_api.go new file mode 100644 index 0000000..c6c9b1b --- /dev/null +++ b/jcapiv1/systemusers_api.go @@ -0,0 +1,1218 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 1.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package jcapiv1 + +import ( + "io/ioutil" + "net/url" + "net/http" + "strings" + "golang.org/x/net/context" + "encoding/json" + "fmt" +) + +// Linger please +var ( + _ context.Context +) + +type SystemusersApiService service + + +/* SystemusersApiService Delete a system user's Public SSH Keys + This endpoint will delete a specific System User's SSH Key. + * @param ctx context.Context for authentication, logging, tracing, etc. + @param systemuserId + @param id + @param optional (nil or map[string]interface{}) with one or more of: + @param "xOrgId" (string) + @return string*/ +func (a *SystemusersApiService) SshkeyDelete(ctx context.Context, systemuserId string, id string, localVarOptionals map[string]interface{}) (string, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Delete") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + successPayload string + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/systemusers/{systemuser_id}/sshkeys/{id}" + localVarPath = strings.Replace(localVarPath, "{"+"systemuser_id"+"}", fmt.Sprintf("%v", systemuserId), -1) + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { + return successPayload, nil, err + } + + // to determine the Content-Type header + localVarHttpContentTypes := []string{ "application/json", } + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{ + "application/json", + "text/plain", + } + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { + localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return successPayload, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return successPayload, localVarHttpResponse, err + } + defer localVarHttpResponse.Body.Close() + if localVarHttpResponse.StatusCode >= 300 { + bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) + return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) + } + + if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { + return successPayload, localVarHttpResponse, err + } + + + return successPayload, localVarHttpResponse, err +} + +/* SystemusersApiService List a system user's public SSH keys + This endpoint will return a specific System User's public SSH key. + * @param ctx context.Context for authentication, logging, tracing, etc. + @param id + @param optional (nil or map[string]interface{}) with one or more of: + @param "xOrgId" (string) + @return []Sshkeylist*/ +func (a *SystemusersApiService) SshkeyList(ctx context.Context, id string, localVarOptionals map[string]interface{}) ([]Sshkeylist, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + successPayload []Sshkeylist + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/systemusers/{id}/sshkeys" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { + return successPayload, nil, err + } + + // to determine the Content-Type header + localVarHttpContentTypes := []string{ "application/json", } + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{ + "application/json", + } + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { + localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return successPayload, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return successPayload, localVarHttpResponse, err + } + defer localVarHttpResponse.Body.Close() + if localVarHttpResponse.StatusCode >= 300 { + bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) + return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) + } + + if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { + return successPayload, localVarHttpResponse, err + } + + + return successPayload, localVarHttpResponse, err +} + +/* SystemusersApiService Create a system user's Public SSH Key + This endpoint will create a specific System User's Public SSH Key. + * @param ctx context.Context for authentication, logging, tracing, etc. + @param id + @param optional (nil or map[string]interface{}) with one or more of: + @param "body" (Sshkeypost) + @param "xOrgId" (string) + @return Sshkeylist*/ +func (a *SystemusersApiService) SshkeyPost(ctx context.Context, id string, localVarOptionals map[string]interface{}) (Sshkeylist, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Post") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + successPayload Sshkeylist + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/systemusers/{id}/sshkeys" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { + return successPayload, nil, err + } + + // to determine the Content-Type header + localVarHttpContentTypes := []string{ "application/json", } + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{ + "application/json", + } + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { + localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") + } + // body params + if localVarTempParam, localVarOk := localVarOptionals["body"].(Sshkeypost); localVarOk { + localVarPostBody = &localVarTempParam + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return successPayload, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return successPayload, localVarHttpResponse, err + } + defer localVarHttpResponse.Body.Close() + if localVarHttpResponse.StatusCode >= 300 { + bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) + return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) + } + + if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { + return successPayload, localVarHttpResponse, err + } + + + return successPayload, localVarHttpResponse, err +} + +/* SystemusersApiService Delete a system user + This endpoint allows you to delete a particular system user. #### Sample Request ``` curl -X DELETE https://console.jumpcloud.com/api/systemusers/{UserID} \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + * @param ctx context.Context for authentication, logging, tracing, etc. + @param id + @param optional (nil or map[string]interface{}) with one or more of: + @param "xOrgId" (string) + @param "cascadeManager" (string) This is an optional flag that can be enabled on the DELETE call, DELETE /systemusers/{id}?cascade_manager=null. This parameter will clear the Manager attribute on all direct reports and then delete the account. + @return Systemuserreturn*/ +func (a *SystemusersApiService) SystemusersDelete(ctx context.Context, id string, localVarOptionals map[string]interface{}) (Systemuserreturn, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Delete") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + successPayload Systemuserreturn + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/systemusers/{id}" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { + return successPayload, nil, err + } + if err := typeCheckParameter(localVarOptionals["cascadeManager"], "string", "cascadeManager"); err != nil { + return successPayload, nil, err + } + + if localVarTempParam, localVarOk := localVarOptionals["cascadeManager"].(string); localVarOk { + localVarQueryParams.Add("cascade_manager", parameterToString(localVarTempParam, "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{ "application/json", } + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{ + "application/json", + } + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { + localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return successPayload, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return successPayload, localVarHttpResponse, err + } + defer localVarHttpResponse.Body.Close() + if localVarHttpResponse.StatusCode >= 300 { + bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) + return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) + } + + if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { + return successPayload, localVarHttpResponse, err + } + + + return successPayload, localVarHttpResponse, err +} + +/* SystemusersApiService Expire a system user's password + This endpoint allows you to expire a user's password. + * @param ctx context.Context for authentication, logging, tracing, etc. + @param id + @param optional (nil or map[string]interface{}) with one or more of: + @param "xOrgId" (string) + @return string*/ +func (a *SystemusersApiService) SystemusersExpire(ctx context.Context, id string, localVarOptionals map[string]interface{}) (string, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Post") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + successPayload string + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/systemusers/{id}/expire" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { + return successPayload, nil, err + } + + // to determine the Content-Type header + localVarHttpContentTypes := []string{ "application/json", } + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{ + "application/json", + "text/plain", + } + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { + localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return successPayload, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return successPayload, localVarHttpResponse, err + } + defer localVarHttpResponse.Body.Close() + if localVarHttpResponse.StatusCode >= 300 { + bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) + return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) + } + + if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { + return successPayload, localVarHttpResponse, err + } + + + return successPayload, localVarHttpResponse, err +} + +/* SystemusersApiService List a system user + This endpoint returns a particular System User. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/systemusers/{UserID} \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + * @param ctx context.Context for authentication, logging, tracing, etc. + @param id + @param optional (nil or map[string]interface{}) with one or more of: + @param "fields" (string) Use a space seperated string of field parameters to include the data in the response. If omitted, the default list of fields will be returned. + @param "filter" (string) A filter to apply to the query. See the supported operators below. For more complex searches, see the related `/search/<domain>` endpoints, e.g. `/search/systems`. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: - `$eq` (equals) - `$ne` (does not equal) - `$gt` (is greater than) - `$gte` (is greater than or equal to) - `$lt` (is less than) - `$lte` (is less than or equal to) _Note: v1 operators differ from v2 operators._ _Note: For v1 operators, excluding the `$` will result in undefined behavior._ **value** = Populate with the value you want to search for. Is case sensitive. **Examples** - `GET /users?filter=username:$eq:testuser` - `GET /systemusers?filter=password_expiration_date:$lte:2021-10-24` - `GET /systemusers?filter=department:$ne:Accounting` - `GET /systems?filter[0]=firstname:$eq:foo&filter[1]=lastname:$eq:bar` - this will AND the filters together. - `GET /systems?filter[or][0]=lastname:$eq:foo&filter[or][1]=lastname:$eq:bar` - this will OR the filters together. + @param "xOrgId" (string) + @return Systemuserreturn*/ +func (a *SystemusersApiService) SystemusersGet(ctx context.Context, id string, localVarOptionals map[string]interface{}) (Systemuserreturn, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + successPayload Systemuserreturn + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/systemusers/{id}" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if err := typeCheckParameter(localVarOptionals["fields"], "string", "fields"); err != nil { + return successPayload, nil, err + } + if err := typeCheckParameter(localVarOptionals["filter"], "string", "filter"); err != nil { + return successPayload, nil, err + } + if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { + return successPayload, nil, err + } + + if localVarTempParam, localVarOk := localVarOptionals["fields"].(string); localVarOk { + localVarQueryParams.Add("fields", parameterToString(localVarTempParam, "")) + } + if localVarTempParam, localVarOk := localVarOptionals["filter"].(string); localVarOk { + localVarQueryParams.Add("filter", parameterToString(localVarTempParam, "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{ "application/json", } + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{ + "application/json", + } + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { + localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return successPayload, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return successPayload, localVarHttpResponse, err + } + defer localVarHttpResponse.Body.Close() + if localVarHttpResponse.StatusCode >= 300 { + bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) + return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) + } + + if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { + return successPayload, localVarHttpResponse, err + } + + + return successPayload, localVarHttpResponse, err +} + +/* SystemusersApiService List all system users + This endpoint returns all systemusers. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/systemusers \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + * @param ctx context.Context for authentication, logging, tracing, etc. + @param optional (nil or map[string]interface{}) with one or more of: + @param "limit" (int32) The number of records to return at once. + @param "skip" (int32) The offset into the records to return. + @param "sort" (string) The space separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. + @param "fields" (string) The space separated fields included in the returned records. If omitted the default list of fields will be returned. + @param "filter" (string) A filter to apply to the query. See the supported operators below. For more complex searches, see the related `/search/<domain>` endpoints, e.g. `/search/systems`. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: - `$eq` (equals) - `$ne` (does not equal) - `$gt` (is greater than) - `$gte` (is greater than or equal to) - `$lt` (is less than) - `$lte` (is less than or equal to) _Note: v1 operators differ from v2 operators._ _Note: For v1 operators, excluding the `$` will result in undefined behavior._ **value** = Populate with the value you want to search for. Is case sensitive. **Examples** - `GET /users?filter=username:$eq:testuser` - `GET /systemusers?filter=password_expiration_date:$lte:2021-10-24` - `GET /systemusers?filter=department:$ne:Accounting` - `GET /systems?filter[0]=firstname:$eq:foo&filter[1]=lastname:$eq:bar` - this will AND the filters together. - `GET /systems?filter[or][0]=lastname:$eq:foo&filter[or][1]=lastname:$eq:bar` - this will OR the filters together. + @param "xOrgId" (string) + @param "search" (string) A nested object containing a `searchTerm` string or array of strings and a list of `fields` to search on. + @return Systemuserslist*/ +func (a *SystemusersApiService) SystemusersList(ctx context.Context, localVarOptionals map[string]interface{}) (Systemuserslist, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + successPayload Systemuserslist + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/systemusers" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if err := typeCheckParameter(localVarOptionals["limit"], "int32", "limit"); err != nil { + return successPayload, nil, err + } + if err := typeCheckParameter(localVarOptionals["skip"], "int32", "skip"); err != nil { + return successPayload, nil, err + } + if err := typeCheckParameter(localVarOptionals["sort"], "string", "sort"); err != nil { + return successPayload, nil, err + } + if err := typeCheckParameter(localVarOptionals["fields"], "string", "fields"); err != nil { + return successPayload, nil, err + } + if err := typeCheckParameter(localVarOptionals["filter"], "string", "filter"); err != nil { + return successPayload, nil, err + } + if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { + return successPayload, nil, err + } + if err := typeCheckParameter(localVarOptionals["search"], "string", "search"); err != nil { + return successPayload, nil, err + } + + if localVarTempParam, localVarOk := localVarOptionals["limit"].(int32); localVarOk { + localVarQueryParams.Add("limit", parameterToString(localVarTempParam, "")) + } + if localVarTempParam, localVarOk := localVarOptionals["skip"].(int32); localVarOk { + localVarQueryParams.Add("skip", parameterToString(localVarTempParam, "")) + } + if localVarTempParam, localVarOk := localVarOptionals["sort"].(string); localVarOk { + localVarQueryParams.Add("sort", parameterToString(localVarTempParam, "")) + } + if localVarTempParam, localVarOk := localVarOptionals["fields"].(string); localVarOk { + localVarQueryParams.Add("fields", parameterToString(localVarTempParam, "")) + } + if localVarTempParam, localVarOk := localVarOptionals["filter"].(string); localVarOk { + localVarQueryParams.Add("filter", parameterToString(localVarTempParam, "")) + } + if localVarTempParam, localVarOk := localVarOptionals["search"].(string); localVarOk { + localVarQueryParams.Add("search", parameterToString(localVarTempParam, "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{ "application/json", } + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{ + "application/json", + } + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { + localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return successPayload, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return successPayload, localVarHttpResponse, err + } + defer localVarHttpResponse.Body.Close() + if localVarHttpResponse.StatusCode >= 300 { + bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) + return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) + } + + if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { + return successPayload, localVarHttpResponse, err + } + + + return successPayload, localVarHttpResponse, err +} + +/* SystemusersApiService Sync a systemuser's mfa enrollment status + This endpoint allows you to re-sync a user's mfa enrollment status #### Sample Request ``` curl -X POST \\ https://console.jumpcloud.com/api/systemusers/{UserID}/mfasync \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ ``` + * @param ctx context.Context for authentication, logging, tracing, etc. + @param id + @return */ +func (a *SystemusersApiService) SystemusersMfasync(ctx context.Context, id string) ( *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Post") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/systemusers/{id}/mfasync" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + + // to determine the Content-Type header + localVarHttpContentTypes := []string{ "application/json", } + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{ + "application/json", + } + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarHttpResponse, err + } + defer localVarHttpResponse.Body.Close() + if localVarHttpResponse.StatusCode >= 300 { + bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) + return localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) + } + + return localVarHttpResponse, err +} + +/* SystemusersApiService Create a system user + \"This endpoint allows you to create a new system user. #### Default User State The `state` of the user can be explicitly passed in or omitted. If `state` is omitted from the request, then the user will get created using the value returned from the [Get an Organization](https://docs.jumpcloud.com/api/1.0/index.html#operation/organizations_get) endpoint. The default user state for manually created users is stored in `settings.newSystemUserStateDefaults.manualEntry` These default state values can be changed in the admin portal settings or by using the [Update an Organization](https://docs.jumpcloud.com/api/1.0/index.html#operation/organization_put) endpoint. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/systemusers \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"username\":\"{username}\", \"email\":\"{email_address}\", \"firstname\":\"{Name}\", \"lastname\":\"{Name}\" }' ``` + * @param ctx context.Context for authentication, logging, tracing, etc. + @param optional (nil or map[string]interface{}) with one or more of: + @param "body" (Systemuserputpost) + @param "xOrgId" (string) + @param "fullValidationDetails" (string) Pass this query parameter when a client wants all validation errors to be returned with a detailed error response for the form field specified. The current form fields are allowed: * `password` #### Password validation flag Use the `password` validation flag to receive details on a possible bad request response ``` ?fullValidationDetails=password ``` Without the flag, default behavior will be a normal 400 with only a single validation string error #### Expected Behavior Clients can expect a list of validation error mappings for the validation query field in the details provided on the response: ``` { \"code\": 400, \"message\": \"Password validation fail\", \"status\": \"INVALID_ARGUMENT\", \"details\": [ { \"fieldViolationsList\": [ {\"field\": \"password\", \"description\": \"specialCharacter\"} ], '@type': 'type.googleapis.com/google.rpc.BadRequest', }, ], }, ``` + @return Systemuserreturn*/ +func (a *SystemusersApiService) SystemusersPost(ctx context.Context, localVarOptionals map[string]interface{}) (Systemuserreturn, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Post") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + successPayload Systemuserreturn + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/systemusers" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { + return successPayload, nil, err + } + if err := typeCheckParameter(localVarOptionals["fullValidationDetails"], "string", "fullValidationDetails"); err != nil { + return successPayload, nil, err + } + + if localVarTempParam, localVarOk := localVarOptionals["fullValidationDetails"].(string); localVarOk { + localVarQueryParams.Add("fullValidationDetails", parameterToString(localVarTempParam, "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{ "application/json", } + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{ + "application/json", + } + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { + localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") + } + // body params + if localVarTempParam, localVarOk := localVarOptionals["body"].(Systemuserputpost); localVarOk { + localVarPostBody = &localVarTempParam + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return successPayload, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return successPayload, localVarHttpResponse, err + } + defer localVarHttpResponse.Body.Close() + if localVarHttpResponse.StatusCode >= 300 { + bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) + return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) + } + + if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { + return successPayload, localVarHttpResponse, err + } + + + return successPayload, localVarHttpResponse, err +} + +/* SystemusersApiService Update a system user + This endpoint allows you to update a system user. #### Sample Request ``` curl -X PUT https://console.jumpcloud.com/api/systemusers/{UserID} \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"email\":\"{email_address}\", \"firstname\":\"{Name}\", \"lastname\":\"{Name}\" }' ``` + * @param ctx context.Context for authentication, logging, tracing, etc. + @param id + @param optional (nil or map[string]interface{}) with one or more of: + @param "body" (Systemuserput) + @param "xOrgId" (string) + @param "fullValidationDetails" (string) This endpoint can take in a query when a client wants all validation errors to be returned with error response for the form field specified, i.e. 'password' #### Password validation flag Use the \"password\" validation flag to receive details on a possible bad request response Without the `password` flag, default behavior will be a normal 400 with only a validation string message ``` ?fullValidationDetails=password ``` #### Expected Behavior Clients can expect a list of validation error mappings for the validation query field in the details provided on the response: ``` { \"code\": 400, \"message\": \"Password validation fail\", \"status\": \"INVALID_ARGUMENT\", \"details\": [ { \"fieldViolationsList\": [{ \"field\": \"password\", \"description\": \"passwordHistory\" }], '@type': 'type.googleapis.com/google.rpc.BadRequest', }, ], }, ``` + @return Systemuserreturn*/ +func (a *SystemusersApiService) SystemusersPut(ctx context.Context, id string, localVarOptionals map[string]interface{}) (Systemuserreturn, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Put") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + successPayload Systemuserreturn + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/systemusers/{id}" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { + return successPayload, nil, err + } + if err := typeCheckParameter(localVarOptionals["fullValidationDetails"], "string", "fullValidationDetails"); err != nil { + return successPayload, nil, err + } + + if localVarTempParam, localVarOk := localVarOptionals["fullValidationDetails"].(string); localVarOk { + localVarQueryParams.Add("fullValidationDetails", parameterToString(localVarTempParam, "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{ "application/json", } + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{ + "application/json", + } + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { + localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") + } + // body params + if localVarTempParam, localVarOk := localVarOptionals["body"].(Systemuserput); localVarOk { + localVarPostBody = &localVarTempParam + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return successPayload, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return successPayload, localVarHttpResponse, err + } + defer localVarHttpResponse.Body.Close() + if localVarHttpResponse.StatusCode >= 300 { + bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) + return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) + } + + if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { + return successPayload, localVarHttpResponse, err + } + + + return successPayload, localVarHttpResponse, err +} + +/* SystemusersApiService Reset a system user's MFA token + This endpoint allows you to reset the TOTP key for a specified system user and put them in an TOTP MFA enrollment period. This will result in the user being prompted to setup TOTP MFA when logging into userportal. Please be aware that if the user does not complete TOTP MFA setup before the `exclusionUntil` date, they will be locked out of any resources that require TOTP MFA. Please refer to our [Knowledge Base Article](https://support.jumpcloud.com/customer/en/portal/articles/2959138-using-multifactor-authentication-with-jumpcloud) on setting up MFA for more information. #### Sample Request ``` curl -X POST \\ https://console.jumpcloud.com/api/systemusers/{UserID}/resetmfa \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{\"exclusion\": true, \"exclusionUntil\": \"{date-time}\"}' ``` + * @param ctx context.Context for authentication, logging, tracing, etc. + @param id + @param optional (nil or map[string]interface{}) with one or more of: + @param "body" (Body2) + @param "xOrgId" (string) + @return string*/ +func (a *SystemusersApiService) SystemusersResetmfa(ctx context.Context, id string, localVarOptionals map[string]interface{}) (string, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Post") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + successPayload string + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/systemusers/{id}/resetmfa" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { + return successPayload, nil, err + } + + // to determine the Content-Type header + localVarHttpContentTypes := []string{ "application/json", } + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{ + "application/json", + "text/plain", + } + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { + localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") + } + // body params + if localVarTempParam, localVarOk := localVarOptionals["body"].(Body2); localVarOk { + localVarPostBody = &localVarTempParam + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return successPayload, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return successPayload, localVarHttpResponse, err + } + defer localVarHttpResponse.Body.Close() + if localVarHttpResponse.StatusCode >= 300 { + bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) + return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) + } + + if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { + return successPayload, localVarHttpResponse, err + } + + + return successPayload, localVarHttpResponse, err +} + +/* SystemusersApiService Activate System User + This endpoint changes the state of a STAGED user to ACTIVATED. #### Email Flag Use the \"email\" flag to determine whether or not to send a Welcome or Activation email to the newly activated user. Sending an empty body without the `email` flag, will send an email with default behavior (see the \"Behavior\" section below) ``` {} ``` Sending `email=true` flag will send an email with default behavior (see `Behavior` below) ``` { \"email\": true } ``` Populated email will override the default behavior and send to the specified email value ``` { \"email\": \"example@example.com\" } ``` Sending `email=false` will suppress sending the email ``` { \"email\": false } ``` #### Behavior Users with a password will be sent a Welcome email to: - The address specified in `email` flag in the request - If no `email` flag, the user's primary email address (default behavior) Users without a password will be sent an Activation email to: - The address specified in `email` flag in the request - If no `email` flag, the user's alternate email address (default behavior) - If no alternate email address, the user's primary email address (default behavior) #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/systemusers/{id}/state/activate \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: <api-key>' \\ -d '{ \"email\": \"alternate-activation-email@email.com\" }' ``` + * @param ctx context.Context for authentication, logging, tracing, etc. + @param id + @param optional (nil or map[string]interface{}) with one or more of: + @param "body" (Body3) + @return string*/ +func (a *SystemusersApiService) SystemusersStateActivate(ctx context.Context, id string, localVarOptionals map[string]interface{}) (string, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Post") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + successPayload string + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/systemusers/{id}/state/activate" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + + // to determine the Content-Type header + localVarHttpContentTypes := []string{ "application/json", } + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{ + "application/json", + } + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + // body params + if localVarTempParam, localVarOk := localVarOptionals["body"].(Body3); localVarOk { + localVarPostBody = &localVarTempParam + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return successPayload, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return successPayload, localVarHttpResponse, err + } + defer localVarHttpResponse.Body.Close() + if localVarHttpResponse.StatusCode >= 300 { + bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) + return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) + } + + if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { + return successPayload, localVarHttpResponse, err + } + + + return successPayload, localVarHttpResponse, err +} + +/* SystemusersApiService Unlock a system user + This endpoint allows you to unlock a user's account. + * @param ctx context.Context for authentication, logging, tracing, etc. + @param id + @param optional (nil or map[string]interface{}) with one or more of: + @param "xOrgId" (string) + @return string*/ +func (a *SystemusersApiService) SystemusersUnlock(ctx context.Context, id string, localVarOptionals map[string]interface{}) (string, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Post") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + successPayload string + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/systemusers/{id}/unlock" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { + return successPayload, nil, err + } + + // to determine the Content-Type header + localVarHttpContentTypes := []string{ "application/json", } + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{ + "application/json", + "text/plain", + } + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { + localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return successPayload, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return successPayload, localVarHttpResponse, err + } + defer localVarHttpResponse.Body.Close() + if localVarHttpResponse.StatusCode >= 300 { + bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) + return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) + } + + if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { + return successPayload, localVarHttpResponse, err + } + + + return successPayload, localVarHttpResponse, err +} + diff --git a/jcapiv1/systemuserslist.go b/jcapiv1/systemuserslist.go new file mode 100644 index 0000000..63c2915 --- /dev/null +++ b/jcapiv1/systemuserslist.go @@ -0,0 +1,20 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 1.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package jcapiv1 + +type Systemuserslist struct { + + // The list of system users. + Results []Systemuserreturn `json:"results,omitempty"` + + // The total number of system users. + TotalCount int32 `json:"totalCount,omitempty"` +} diff --git a/jcapiv1/triggerreturn.go b/jcapiv1/triggerreturn.go new file mode 100644 index 0000000..5f5d849 --- /dev/null +++ b/jcapiv1/triggerreturn.go @@ -0,0 +1,16 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 1.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package jcapiv1 + +type Triggerreturn struct { + + Triggered []string `json:"triggered,omitempty"` +} diff --git a/jcapiv1/trustedapp_config_get.go b/jcapiv1/trustedapp_config_get.go new file mode 100644 index 0000000..1c58614 --- /dev/null +++ b/jcapiv1/trustedapp_config_get.go @@ -0,0 +1,21 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 1.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package jcapiv1 + +// Object containing information about the list of trusted applications for the organization +type TrustedappConfigGet struct { + + // Checksum to validate the trustedApp configuration for the organization + Checksum string `json:"checksum"` + + // List of authorized apps for the organization + TrustedApps []TrustedappConfigGetTrustedApps `json:"trustedApps"` +} diff --git a/jcapiv1/trustedapp_config_get_trusted_apps.go b/jcapiv1/trustedapp_config_get_trusted_apps.go new file mode 100644 index 0000000..9a9ee5c --- /dev/null +++ b/jcapiv1/trustedapp_config_get_trusted_apps.go @@ -0,0 +1,24 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 1.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package jcapiv1 + +// Represents an application that is going to be trusted by the organization +type TrustedappConfigGetTrustedApps struct { + + // Name of the trusted application + Name string `json:"name"` + + // Absolute path for the app's location in user's device + Path string `json:"path,omitempty"` + + // App's Team ID + Teamid string `json:"teamid,omitempty"` +} diff --git a/jcapiv1/trustedapp_config_put.go b/jcapiv1/trustedapp_config_put.go new file mode 100644 index 0000000..afb4da7 --- /dev/null +++ b/jcapiv1/trustedapp_config_put.go @@ -0,0 +1,18 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 1.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package jcapiv1 + +// Object containing information about the list of trusted applications for the organization +type TrustedappConfigPut struct { + + // List of authorized apps for the organization + TrustedApps []TrustedappConfigGetTrustedApps `json:"trustedApps"` +} diff --git a/jcapiv1/userput.go b/jcapiv1/userput.go new file mode 100644 index 0000000..70b75d1 --- /dev/null +++ b/jcapiv1/userput.go @@ -0,0 +1,28 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 1.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package jcapiv1 + +type Userput struct { + + Email string `json:"email,omitempty"` + + EnableMultiFactor bool `json:"enableMultiFactor,omitempty"` + + Firstname string `json:"firstname,omitempty"` + + GrowthData *interface{} `json:"growthData,omitempty"` + + LastWhatsNewChecked string `json:"lastWhatsNewChecked,omitempty"` + + Lastname string `json:"lastname,omitempty"` + + RoleName string `json:"roleName,omitempty"` +} diff --git a/jcapiv1/userreturn.go b/jcapiv1/userreturn.go new file mode 100644 index 0000000..62b62a5 --- /dev/null +++ b/jcapiv1/userreturn.go @@ -0,0 +1,52 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 1.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package jcapiv1 + +import ( + "time" +) + +type Userreturn struct { + + Id string `json:"_id,omitempty"` + + Created time.Time `json:"created,omitempty"` + + DisableIntroduction bool `json:"disableIntroduction,omitempty"` + + Email string `json:"email,omitempty"` + + EnableMultiFactor bool `json:"enableMultiFactor,omitempty"` + + Firstname string `json:"firstname,omitempty"` + + GrowthData *UserreturnGrowthData `json:"growthData,omitempty"` + + LastWhatsNewChecked time.Time `json:"lastWhatsNewChecked,omitempty"` + + Lastname string `json:"lastname,omitempty"` + + Organization string `json:"organization,omitempty"` + + Provider string `json:"provider,omitempty"` + + Role string `json:"role,omitempty"` + + RoleName string `json:"roleName,omitempty"` + + SessionCount int32 `json:"sessionCount,omitempty"` + + Suspended bool `json:"suspended,omitempty"` + + TotpEnrolled bool `json:"totpEnrolled,omitempty"` + + UsersTimeZone string `json:"usersTimeZone,omitempty"` +} diff --git a/jcapiv1/userreturn_growth_data.go b/jcapiv1/userreturn_growth_data.go new file mode 100644 index 0000000..3c5d799 --- /dev/null +++ b/jcapiv1/userreturn_growth_data.go @@ -0,0 +1,18 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 1.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package jcapiv1 + +type UserreturnGrowthData struct { + + ExperimentStates *interface{} `json:"experimentStates,omitempty"` + + OnboardingState *interface{} `json:"onboardingState,omitempty"` +} diff --git a/jcapiv1/users_api.go b/jcapiv1/users_api.go new file mode 100644 index 0000000..4cbf7a0 --- /dev/null +++ b/jcapiv1/users_api.go @@ -0,0 +1,262 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, and system users. # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 1.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package jcapiv1 + +import ( + "io/ioutil" + "net/url" + "net/http" + "strings" + "golang.org/x/net/context" + "encoding/json" + "fmt" +) + +// Linger please +var ( + _ context.Context +) + +type UsersApiService service + + +/* UsersApiService Administrator TOTP Reset Initiation + This endpoint initiates a TOTP reset for an admin. This request does not accept a body. + * @param ctx context.Context for authentication, logging, tracing, etc. + @param id + @return */ +func (a *UsersApiService) AdminTotpresetBegin(ctx context.Context, id string) ( *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Post") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/users/resettotp/{id}" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + + // to determine the Content-Type header + localVarHttpContentTypes := []string{ "application/json", } + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{ + "application/json", + } + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarHttpResponse, err + } + defer localVarHttpResponse.Body.Close() + if localVarHttpResponse.StatusCode >= 300 { + bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) + return localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) + } + + return localVarHttpResponse, err +} + +/* UsersApiService Update a user + This endpoint allows you to update a user. + * @param ctx context.Context for authentication, logging, tracing, etc. + @param id + @param optional (nil or map[string]interface{}) with one or more of: + @param "body" (Userput) + @param "xOrgId" (string) + @return Userreturn*/ +func (a *UsersApiService) UsersPut(ctx context.Context, id string, localVarOptionals map[string]interface{}) (Userreturn, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Put") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + successPayload Userreturn + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/users/{id}" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { + return successPayload, nil, err + } + + // to determine the Content-Type header + localVarHttpContentTypes := []string{ "application/json", } + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{ + "application/json", + } + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { + localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") + } + // body params + if localVarTempParam, localVarOk := localVarOptionals["body"].(Userput); localVarOk { + localVarPostBody = &localVarTempParam + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return successPayload, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return successPayload, localVarHttpResponse, err + } + defer localVarHttpResponse.Body.Close() + if localVarHttpResponse.StatusCode >= 300 { + bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) + return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) + } + + if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { + return successPayload, localVarHttpResponse, err + } + + + return successPayload, localVarHttpResponse, err +} + +/* UsersApiService Administrator Password Reset Initiation + This endpoint triggers the sending of a reactivation e-mail to an administrator. + * @param ctx context.Context for authentication, logging, tracing, etc. + @param id + @return */ +func (a *UsersApiService) UsersReactivateGet(ctx context.Context, id string) ( *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/users/reactivate/{id}" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + + // to determine the Content-Type header + localVarHttpContentTypes := []string{ "application/json", } + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{ + "application/json", + } + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarHttpResponse, err + } + defer localVarHttpResponse.Body.Close() + if localVarHttpResponse.StatusCode >= 300 { + bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) + return localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) + } + + return localVarHttpResponse, err +} + diff --git a/v2/.gitignore b/jcapiv2/.gitignore similarity index 100% rename from v2/.gitignore rename to jcapiv2/.gitignore diff --git a/v2/.swagger-codegen-ignore b/jcapiv2/.swagger-codegen-ignore similarity index 100% rename from v2/.swagger-codegen-ignore rename to jcapiv2/.swagger-codegen-ignore diff --git a/jcapiv2/.swagger-codegen/VERSION b/jcapiv2/.swagger-codegen/VERSION new file mode 100644 index 0000000..8d87cde --- /dev/null +++ b/jcapiv2/.swagger-codegen/VERSION @@ -0,0 +1 @@ +3.0.32 \ No newline at end of file diff --git a/v2/.travis.yml b/jcapiv2/.travis.yml similarity index 100% rename from v2/.travis.yml rename to jcapiv2/.travis.yml diff --git a/jcapiv2/README.md b/jcapiv2/README.md new file mode 100644 index 0000000..2af92ed --- /dev/null +++ b/jcapiv2/README.md @@ -0,0 +1,857 @@ +# Go API client for jcapiv2 + +# Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + +## Overview +This API client was generated by the [swagger-codegen](https://github.com/swagger-api/swagger-codegen) project. By using the [swagger-spec](https://github.com/swagger-api/swagger-spec) from a remote server, you can easily generate an API client. + +- API version: 2.0 +- Package version: 5.0.0 +- Build package: io.swagger.codegen.v3.generators.go.GoClientCodegen +For more information, please visit [https://support.jumpcloud.com/support/s/](https://support.jumpcloud.com/support/s/) + +## Installation +Put the package under your project folder and add the following in import: +```golang +import "./jcapiv2" +``` + +## Documentation for API Endpoints + +All URIs are relative to *https://console.jumpcloud.com/api/v2* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*ActiveDirectoryApi* | [**ActivedirectoriesAgentsDelete**](docs/ActiveDirectoryApi.md#activedirectoriesagentsdelete) | **Delete** /activedirectories/{activedirectory_id}/agents/{agent_id} | Delete Active Directory Agent +*ActiveDirectoryApi* | [**ActivedirectoriesAgentsGet**](docs/ActiveDirectoryApi.md#activedirectoriesagentsget) | **Get** /activedirectories/{activedirectory_id}/agents/{agent_id} | Get Active Directory Agent +*ActiveDirectoryApi* | [**ActivedirectoriesAgentsList**](docs/ActiveDirectoryApi.md#activedirectoriesagentslist) | **Get** /activedirectories/{activedirectory_id}/agents | List Active Directory Agents +*ActiveDirectoryApi* | [**ActivedirectoriesAgentsPost**](docs/ActiveDirectoryApi.md#activedirectoriesagentspost) | **Post** /activedirectories/{activedirectory_id}/agents | Create a new Active Directory Agent +*ActiveDirectoryApi* | [**ActivedirectoriesDelete**](docs/ActiveDirectoryApi.md#activedirectoriesdelete) | **Delete** /activedirectories/{id} | Delete an Active Directory +*ActiveDirectoryApi* | [**ActivedirectoriesGet**](docs/ActiveDirectoryApi.md#activedirectoriesget) | **Get** /activedirectories/{id} | Get an Active Directory +*ActiveDirectoryApi* | [**ActivedirectoriesList**](docs/ActiveDirectoryApi.md#activedirectorieslist) | **Get** /activedirectories | List Active Directories +*ActiveDirectoryApi* | [**ActivedirectoriesPost**](docs/ActiveDirectoryApi.md#activedirectoriespost) | **Post** /activedirectories | Create a new Active Directory +*ActiveDirectoryApi* | [**GraphActiveDirectoryAssociationsList**](docs/ActiveDirectoryApi.md#graphactivedirectoryassociationslist) | **Get** /activedirectories/{activedirectory_id}/associations | List the associations of an Active Directory instance +*ActiveDirectoryApi* | [**GraphActiveDirectoryAssociationsPost**](docs/ActiveDirectoryApi.md#graphactivedirectoryassociationspost) | **Post** /activedirectories/{activedirectory_id}/associations | Manage the associations of an Active Directory instance +*ActiveDirectoryApi* | [**GraphActiveDirectoryTraverseUser**](docs/ActiveDirectoryApi.md#graphactivedirectorytraverseuser) | **Get** /activedirectories/{activedirectory_id}/users | List the Users bound to an Active Directory instance +*ActiveDirectoryApi* | [**GraphActiveDirectoryTraverseUserGroup**](docs/ActiveDirectoryApi.md#graphactivedirectorytraverseusergroup) | **Get** /activedirectories/{activedirectory_id}/usergroups | List the User Groups bound to an Active Directory instance +*AdministratorsApi* | [**AdministratorOrganizationsCreateByAdministrator**](docs/AdministratorsApi.md#administratororganizationscreatebyadministrator) | **Post** /administrators/{id}/organizationlinks | Allow Adminstrator access to an Organization. +*AdministratorsApi* | [**AdministratorOrganizationsListByAdministrator**](docs/AdministratorsApi.md#administratororganizationslistbyadministrator) | **Get** /administrators/{id}/organizationlinks | List the association links between an Administrator and Organizations. +*AdministratorsApi* | [**AdministratorOrganizationsListByOrganization**](docs/AdministratorsApi.md#administratororganizationslistbyorganization) | **Get** /organizations/{id}/administratorlinks | List the association links between an Organization and Administrators. +*AdministratorsApi* | [**AdministratorOrganizationsRemoveByAdministrator**](docs/AdministratorsApi.md#administratororganizationsremovebyadministrator) | **Delete** /administrators/{administrator_id}/organizationlinks/{id} | Remove association between an Administrator and an Organization. +*AppleMDMApi* | [**ApplemdmsCsrget**](docs/AppleMDMApi.md#applemdmscsrget) | **Get** /applemdms/{apple_mdm_id}/csr | Get Apple MDM CSR Plist +*AppleMDMApi* | [**ApplemdmsDelete**](docs/AppleMDMApi.md#applemdmsdelete) | **Delete** /applemdms/{id} | Delete an Apple MDM +*AppleMDMApi* | [**ApplemdmsDeletedevice**](docs/AppleMDMApi.md#applemdmsdeletedevice) | **Delete** /applemdms/{apple_mdm_id}/devices/{device_id} | Remove an Apple MDM Device's Enrollment +*AppleMDMApi* | [**ApplemdmsDepkeyget**](docs/AppleMDMApi.md#applemdmsdepkeyget) | **Get** /applemdms/{apple_mdm_id}/depkey | Get Apple MDM DEP Public Key +*AppleMDMApi* | [**ApplemdmsDevicesClearActivationLock**](docs/AppleMDMApi.md#applemdmsdevicesclearactivationlock) | **Post** /applemdms/{apple_mdm_id}/devices/{device_id}/clearActivationLock | Clears the Activation Lock for a Device +*AppleMDMApi* | [**ApplemdmsDevicesRefreshActivationLockInformation**](docs/AppleMDMApi.md#applemdmsdevicesrefreshactivationlockinformation) | **Post** /applemdms/{apple_mdm_id}/devices/{device_id}/refreshActivationLockInformation | Refresh activation lock information for a device +*AppleMDMApi* | [**ApplemdmsDeviceserase**](docs/AppleMDMApi.md#applemdmsdeviceserase) | **Post** /applemdms/{apple_mdm_id}/devices/{device_id}/erase | Erase Device +*AppleMDMApi* | [**ApplemdmsDeviceslist**](docs/AppleMDMApi.md#applemdmsdeviceslist) | **Get** /applemdms/{apple_mdm_id}/devices | List AppleMDM Devices +*AppleMDMApi* | [**ApplemdmsDeviceslock**](docs/AppleMDMApi.md#applemdmsdeviceslock) | **Post** /applemdms/{apple_mdm_id}/devices/{device_id}/lock | Lock Device +*AppleMDMApi* | [**ApplemdmsDevicesrestart**](docs/AppleMDMApi.md#applemdmsdevicesrestart) | **Post** /applemdms/{apple_mdm_id}/devices/{device_id}/restart | Restart Device +*AppleMDMApi* | [**ApplemdmsDevicesshutdown**](docs/AppleMDMApi.md#applemdmsdevicesshutdown) | **Post** /applemdms/{apple_mdm_id}/devices/{device_id}/shutdown | Shut Down Device +*AppleMDMApi* | [**ApplemdmsEnrollmentprofilesget**](docs/AppleMDMApi.md#applemdmsenrollmentprofilesget) | **Get** /applemdms/{apple_mdm_id}/enrollmentprofiles/{id} | Get an Apple MDM Enrollment Profile +*AppleMDMApi* | [**ApplemdmsEnrollmentprofileslist**](docs/AppleMDMApi.md#applemdmsenrollmentprofileslist) | **Get** /applemdms/{apple_mdm_id}/enrollmentprofiles | List Apple MDM Enrollment Profiles +*AppleMDMApi* | [**ApplemdmsGetdevice**](docs/AppleMDMApi.md#applemdmsgetdevice) | **Get** /applemdms/{apple_mdm_id}/devices/{device_id} | Details of an AppleMDM Device +*AppleMDMApi* | [**ApplemdmsList**](docs/AppleMDMApi.md#applemdmslist) | **Get** /applemdms | List Apple MDMs +*AppleMDMApi* | [**ApplemdmsPut**](docs/AppleMDMApi.md#applemdmsput) | **Put** /applemdms/{id} | Update an Apple MDM +*AppleMDMApi* | [**ApplemdmsRefreshdepdevices**](docs/AppleMDMApi.md#applemdmsrefreshdepdevices) | **Post** /applemdms/{apple_mdm_id}/refreshdepdevices | Refresh DEP Devices +*ApplicationsApi* | [**ApplicationsDeleteLogo**](docs/ApplicationsApi.md#applicationsdeletelogo) | **Delete** /applications/{application_id}/logo | Delete application image +*ApplicationsApi* | [**ApplicationsGet**](docs/ApplicationsApi.md#applicationsget) | **Get** /applications/{application_id} | Get an Application +*ApplicationsApi* | [**ApplicationsPostLogo**](docs/ApplicationsApi.md#applicationspostlogo) | **Post** /applications/{application_id}/logo | +*ApplicationsApi* | [**GraphApplicationAssociationsList**](docs/ApplicationsApi.md#graphapplicationassociationslist) | **Get** /applications/{application_id}/associations | List the associations of an Application +*ApplicationsApi* | [**GraphApplicationAssociationsPost**](docs/ApplicationsApi.md#graphapplicationassociationspost) | **Post** /applications/{application_id}/associations | Manage the associations of an Application +*ApplicationsApi* | [**GraphApplicationTraverseUser**](docs/ApplicationsApi.md#graphapplicationtraverseuser) | **Get** /applications/{application_id}/users | List the Users bound to an Application +*ApplicationsApi* | [**GraphApplicationTraverseUserGroup**](docs/ApplicationsApi.md#graphapplicationtraverseusergroup) | **Get** /applications/{application_id}/usergroups | List the User Groups bound to an Application +*ApplicationsApi* | [**ImportUsers**](docs/ApplicationsApi.md#importusers) | **Get** /applications/{application_id}/import/users | Get a list of users to import from an Application IdM service provider +*AuthenticationPoliciesApi* | [**AuthnpoliciesDelete**](docs/AuthenticationPoliciesApi.md#authnpoliciesdelete) | **Delete** /authn/policies/{id} | Delete Authentication Policy +*AuthenticationPoliciesApi* | [**AuthnpoliciesGet**](docs/AuthenticationPoliciesApi.md#authnpoliciesget) | **Get** /authn/policies/{id} | Get an authentication policy +*AuthenticationPoliciesApi* | [**AuthnpoliciesList**](docs/AuthenticationPoliciesApi.md#authnpolicieslist) | **Get** /authn/policies | List Authentication Policies +*AuthenticationPoliciesApi* | [**AuthnpoliciesPatch**](docs/AuthenticationPoliciesApi.md#authnpoliciespatch) | **Patch** /authn/policies/{id} | Patch Authentication Policy +*AuthenticationPoliciesApi* | [**AuthnpoliciesPost**](docs/AuthenticationPoliciesApi.md#authnpoliciespost) | **Post** /authn/policies | Create an Authentication Policy +*BulkJobRequestsApi* | [**BulkUserStatesCreate**](docs/BulkJobRequestsApi.md#bulkuserstatescreate) | **Post** /bulk/userstates | Create Scheduled Userstate Job +*BulkJobRequestsApi* | [**BulkUserStatesDelete**](docs/BulkJobRequestsApi.md#bulkuserstatesdelete) | **Delete** /bulk/userstates/{id} | Delete Scheduled Userstate Job +*BulkJobRequestsApi* | [**BulkUserStatesGetNextScheduled**](docs/BulkJobRequestsApi.md#bulkuserstatesgetnextscheduled) | **Get** /bulk/userstates/eventlist/next | Gets the next scheduled state change for each user in a list of system users +*BulkJobRequestsApi* | [**BulkUserStatesList**](docs/BulkJobRequestsApi.md#bulkuserstateslist) | **Get** /bulk/userstates | List Scheduled Userstate Change Jobs +*BulkJobRequestsApi* | [**BulkUsersCreate**](docs/BulkJobRequestsApi.md#bulkuserscreate) | **Post** /bulk/users | Bulk Users Create +*BulkJobRequestsApi* | [**BulkUsersCreateResults**](docs/BulkJobRequestsApi.md#bulkuserscreateresults) | **Get** /bulk/users/{job_id}/results | List Bulk Users Results +*BulkJobRequestsApi* | [**BulkUsersUpdate**](docs/BulkJobRequestsApi.md#bulkusersupdate) | **Patch** /bulk/users | Bulk Users Update +*CommandResultsApi* | [**CommandsListResultsByWorkflow**](docs/CommandResultsApi.md#commandslistresultsbyworkflow) | **Get** /commandresult/workflows | List all Command Results by Workflow +*CommandsApi* | [**CommandsCancelQueuedCommandsByWorkflowInstanceId**](docs/CommandsApi.md#commandscancelqueuedcommandsbyworkflowinstanceid) | **Delete** /commandqueue/{workflow_instance_id} | Cancel all queued commands for an organization by workflow instance Id +*CommandsApi* | [**CommandsGetQueuedCommandsByWorkflow**](docs/CommandsApi.md#commandsgetqueuedcommandsbyworkflow) | **Get** /queuedcommand/workflows | Fetch the queued Commands for an Organization +*CommandsApi* | [**GraphCommandAssociationsList**](docs/CommandsApi.md#graphcommandassociationslist) | **Get** /commands/{command_id}/associations | List the associations of a Command +*CommandsApi* | [**GraphCommandAssociationsPost**](docs/CommandsApi.md#graphcommandassociationspost) | **Post** /commands/{command_id}/associations | Manage the associations of a Command +*CommandsApi* | [**GraphCommandTraverseSystem**](docs/CommandsApi.md#graphcommandtraversesystem) | **Get** /commands/{command_id}/systems | List the Systems bound to a Command +*CommandsApi* | [**GraphCommandTraverseSystemGroup**](docs/CommandsApi.md#graphcommandtraversesystemgroup) | **Get** /commands/{command_id}/systemgroups | List the System Groups bound to a Command +*CustomEmailsApi* | [**CustomEmailsCreate**](docs/CustomEmailsApi.md#customemailscreate) | **Post** /customemails | Create custom email configuration +*CustomEmailsApi* | [**CustomEmailsDestroy**](docs/CustomEmailsApi.md#customemailsdestroy) | **Delete** /customemails/{custom_email_type} | Delete custom email configuration +*CustomEmailsApi* | [**CustomEmailsGetTemplates**](docs/CustomEmailsApi.md#customemailsgettemplates) | **Get** /customemail/templates | List custom email templates +*CustomEmailsApi* | [**CustomEmailsRead**](docs/CustomEmailsApi.md#customemailsread) | **Get** /customemails/{custom_email_type} | Get custom email configuration +*CustomEmailsApi* | [**CustomEmailsUpdate**](docs/CustomEmailsApi.md#customemailsupdate) | **Put** /customemails/{custom_email_type} | Update custom email configuration +*DirectoriesApi* | [**DirectoriesList**](docs/DirectoriesApi.md#directorieslist) | **Get** /directories | List All Directories +*DuoApi* | [**DuoAccountDelete**](docs/DuoApi.md#duoaccountdelete) | **Delete** /duo/accounts/{id} | Delete a Duo Account +*DuoApi* | [**DuoAccountGet**](docs/DuoApi.md#duoaccountget) | **Get** /duo/accounts/{id} | Get a Duo Acount +*DuoApi* | [**DuoAccountList**](docs/DuoApi.md#duoaccountlist) | **Get** /duo/accounts | List Duo Accounts +*DuoApi* | [**DuoAccountPost**](docs/DuoApi.md#duoaccountpost) | **Post** /duo/accounts | Create Duo Account +*DuoApi* | [**DuoApplicationDelete**](docs/DuoApi.md#duoapplicationdelete) | **Delete** /duo/accounts/{account_id}/applications/{application_id} | Delete a Duo Application +*DuoApi* | [**DuoApplicationGet**](docs/DuoApi.md#duoapplicationget) | **Get** /duo/accounts/{account_id}/applications/{application_id} | Get a Duo application +*DuoApi* | [**DuoApplicationList**](docs/DuoApi.md#duoapplicationlist) | **Get** /duo/accounts/{account_id}/applications | List Duo Applications +*DuoApi* | [**DuoApplicationPost**](docs/DuoApi.md#duoapplicationpost) | **Post** /duo/accounts/{account_id}/applications | Create Duo Application +*DuoApi* | [**DuoApplicationUpdate**](docs/DuoApi.md#duoapplicationupdate) | **Put** /duo/accounts/{account_id}/applications/{application_id} | Update Duo Application +*FdeApi* | [**SystemsGetFDEKey**](docs/FdeApi.md#systemsgetfdekey) | **Get** /systems/{system_id}/fdekey | Get System FDE Key +*GSuiteApi* | [**GraphGSuiteAssociationsList**](docs/GSuiteApi.md#graphgsuiteassociationslist) | **Get** /gsuites/{gsuite_id}/associations | List the associations of a G Suite instance +*GSuiteApi* | [**GraphGSuiteAssociationsPost**](docs/GSuiteApi.md#graphgsuiteassociationspost) | **Post** /gsuites/{gsuite_id}/associations | Manage the associations of a G Suite instance +*GSuiteApi* | [**GraphGSuiteTraverseUser**](docs/GSuiteApi.md#graphgsuitetraverseuser) | **Get** /gsuites/{gsuite_id}/users | List the Users bound to a G Suite instance +*GSuiteApi* | [**GraphGSuiteTraverseUserGroup**](docs/GSuiteApi.md#graphgsuitetraverseusergroup) | **Get** /gsuites/{gsuite_id}/usergroups | List the User Groups bound to a G Suite instance +*GSuiteApi* | [**GsuitesGet**](docs/GSuiteApi.md#gsuitesget) | **Get** /gsuites/{id} | Get G Suite +*GSuiteApi* | [**GsuitesListImportJumpcloudUsers**](docs/GSuiteApi.md#gsuiteslistimportjumpcloudusers) | **Get** /gsuites/{gsuite_id}/import/jumpcloudusers | Get a list of users in Jumpcloud format to import from a Google Workspace account. +*GSuiteApi* | [**GsuitesListImportUsers**](docs/GSuiteApi.md#gsuiteslistimportusers) | **Get** /gsuites/{gsuite_id}/import/users | Get a list of users to import from a G Suite instance +*GSuiteApi* | [**GsuitesPatch**](docs/GSuiteApi.md#gsuitespatch) | **Patch** /gsuites/{id} | Update existing G Suite +*GSuiteApi* | [**TranslationRulesGSuiteDelete**](docs/GSuiteApi.md#translationrulesgsuitedelete) | **Delete** /gsuites/{gsuite_id}/translationrules/{id} | Deletes a G Suite translation rule +*GSuiteApi* | [**TranslationRulesGSuiteGet**](docs/GSuiteApi.md#translationrulesgsuiteget) | **Get** /gsuites/{gsuite_id}/translationrules/{id} | Gets a specific G Suite translation rule +*GSuiteApi* | [**TranslationRulesGSuiteList**](docs/GSuiteApi.md#translationrulesgsuitelist) | **Get** /gsuites/{gsuite_id}/translationrules | List all the G Suite Translation Rules +*GSuiteApi* | [**TranslationRulesGSuitePost**](docs/GSuiteApi.md#translationrulesgsuitepost) | **Post** /gsuites/{gsuite_id}/translationrules | Create a new G Suite Translation Rule +*GSuiteImportApi* | [**GsuitesListImportJumpcloudUsers**](docs/GSuiteImportApi.md#gsuiteslistimportjumpcloudusers) | **Get** /gsuites/{gsuite_id}/import/jumpcloudusers | Get a list of users in Jumpcloud format to import from a Google Workspace account. +*GSuiteImportApi* | [**GsuitesListImportUsers**](docs/GSuiteImportApi.md#gsuiteslistimportusers) | **Get** /gsuites/{gsuite_id}/import/users | Get a list of users to import from a G Suite instance +*GraphApi* | [**GraphActiveDirectoryAssociationsList**](docs/GraphApi.md#graphactivedirectoryassociationslist) | **Get** /activedirectories/{activedirectory_id}/associations | List the associations of an Active Directory instance +*GraphApi* | [**GraphActiveDirectoryAssociationsPost**](docs/GraphApi.md#graphactivedirectoryassociationspost) | **Post** /activedirectories/{activedirectory_id}/associations | Manage the associations of an Active Directory instance +*GraphApi* | [**GraphActiveDirectoryTraverseUser**](docs/GraphApi.md#graphactivedirectorytraverseuser) | **Get** /activedirectories/{activedirectory_id}/users | List the Users bound to an Active Directory instance +*GraphApi* | [**GraphActiveDirectoryTraverseUserGroup**](docs/GraphApi.md#graphactivedirectorytraverseusergroup) | **Get** /activedirectories/{activedirectory_id}/usergroups | List the User Groups bound to an Active Directory instance +*GraphApi* | [**GraphApplicationAssociationsList**](docs/GraphApi.md#graphapplicationassociationslist) | **Get** /applications/{application_id}/associations | List the associations of an Application +*GraphApi* | [**GraphApplicationAssociationsPost**](docs/GraphApi.md#graphapplicationassociationspost) | **Post** /applications/{application_id}/associations | Manage the associations of an Application +*GraphApi* | [**GraphApplicationTraverseUser**](docs/GraphApi.md#graphapplicationtraverseuser) | **Get** /applications/{application_id}/users | List the Users bound to an Application +*GraphApi* | [**GraphApplicationTraverseUserGroup**](docs/GraphApi.md#graphapplicationtraverseusergroup) | **Get** /applications/{application_id}/usergroups | List the User Groups bound to an Application +*GraphApi* | [**GraphCommandAssociationsList**](docs/GraphApi.md#graphcommandassociationslist) | **Get** /commands/{command_id}/associations | List the associations of a Command +*GraphApi* | [**GraphCommandAssociationsPost**](docs/GraphApi.md#graphcommandassociationspost) | **Post** /commands/{command_id}/associations | Manage the associations of a Command +*GraphApi* | [**GraphCommandTraverseSystem**](docs/GraphApi.md#graphcommandtraversesystem) | **Get** /commands/{command_id}/systems | List the Systems bound to a Command +*GraphApi* | [**GraphCommandTraverseSystemGroup**](docs/GraphApi.md#graphcommandtraversesystemgroup) | **Get** /commands/{command_id}/systemgroups | List the System Groups bound to a Command +*GraphApi* | [**GraphGSuiteAssociationsList**](docs/GraphApi.md#graphgsuiteassociationslist) | **Get** /gsuites/{gsuite_id}/associations | List the associations of a G Suite instance +*GraphApi* | [**GraphGSuiteAssociationsPost**](docs/GraphApi.md#graphgsuiteassociationspost) | **Post** /gsuites/{gsuite_id}/associations | Manage the associations of a G Suite instance +*GraphApi* | [**GraphGSuiteTraverseUser**](docs/GraphApi.md#graphgsuitetraverseuser) | **Get** /gsuites/{gsuite_id}/users | List the Users bound to a G Suite instance +*GraphApi* | [**GraphGSuiteTraverseUserGroup**](docs/GraphApi.md#graphgsuitetraverseusergroup) | **Get** /gsuites/{gsuite_id}/usergroups | List the User Groups bound to a G Suite instance +*GraphApi* | [**GraphLdapServerAssociationsList**](docs/GraphApi.md#graphldapserverassociationslist) | **Get** /ldapservers/{ldapserver_id}/associations | List the associations of a LDAP Server +*GraphApi* | [**GraphLdapServerAssociationsPost**](docs/GraphApi.md#graphldapserverassociationspost) | **Post** /ldapservers/{ldapserver_id}/associations | Manage the associations of a LDAP Server +*GraphApi* | [**GraphLdapServerTraverseUser**](docs/GraphApi.md#graphldapservertraverseuser) | **Get** /ldapservers/{ldapserver_id}/users | List the Users bound to a LDAP Server +*GraphApi* | [**GraphLdapServerTraverseUserGroup**](docs/GraphApi.md#graphldapservertraverseusergroup) | **Get** /ldapservers/{ldapserver_id}/usergroups | List the User Groups bound to a LDAP Server +*GraphApi* | [**GraphOffice365AssociationsList**](docs/GraphApi.md#graphoffice365associationslist) | **Get** /office365s/{office365_id}/associations | List the associations of an Office 365 instance +*GraphApi* | [**GraphOffice365AssociationsPost**](docs/GraphApi.md#graphoffice365associationspost) | **Post** /office365s/{office365_id}/associations | Manage the associations of an Office 365 instance +*GraphApi* | [**GraphOffice365TraverseUser**](docs/GraphApi.md#graphoffice365traverseuser) | **Get** /office365s/{office365_id}/users | List the Users bound to an Office 365 instance +*GraphApi* | [**GraphOffice365TraverseUserGroup**](docs/GraphApi.md#graphoffice365traverseusergroup) | **Get** /office365s/{office365_id}/usergroups | List the User Groups bound to an Office 365 instance +*GraphApi* | [**GraphPolicyAssociationsList**](docs/GraphApi.md#graphpolicyassociationslist) | **Get** /policies/{policy_id}/associations | List the associations of a Policy +*GraphApi* | [**GraphPolicyAssociationsPost**](docs/GraphApi.md#graphpolicyassociationspost) | **Post** /policies/{policy_id}/associations | Manage the associations of a Policy +*GraphApi* | [**GraphPolicyGroupAssociationsList**](docs/GraphApi.md#graphpolicygroupassociationslist) | **Get** /policygroups/{group_id}/associations | List the associations of a Policy Group. +*GraphApi* | [**GraphPolicyGroupAssociationsPost**](docs/GraphApi.md#graphpolicygroupassociationspost) | **Post** /policygroups/{group_id}/associations | Manage the associations of a Policy Group +*GraphApi* | [**GraphPolicyGroupMembersList**](docs/GraphApi.md#graphpolicygroupmemberslist) | **Get** /policygroups/{group_id}/members | List the members of a Policy Group +*GraphApi* | [**GraphPolicyGroupMembersPost**](docs/GraphApi.md#graphpolicygroupmemberspost) | **Post** /policygroups/{group_id}/members | Manage the members of a Policy Group +*GraphApi* | [**GraphPolicyGroupMembership**](docs/GraphApi.md#graphpolicygroupmembership) | **Get** /policygroups/{group_id}/membership | List the Policy Group's membership +*GraphApi* | [**GraphPolicyGroupTraverseSystem**](docs/GraphApi.md#graphpolicygrouptraversesystem) | **Get** /policygroups/{group_id}/systems | List the Systems bound to a Policy Group +*GraphApi* | [**GraphPolicyGroupTraverseSystemGroup**](docs/GraphApi.md#graphpolicygrouptraversesystemgroup) | **Get** /policygroups/{group_id}/systemgroups | List the System Groups bound to Policy Groups +*GraphApi* | [**GraphPolicyMemberOf**](docs/GraphApi.md#graphpolicymemberof) | **Get** /policies/{policy_id}/memberof | List the parent Groups of a Policy +*GraphApi* | [**GraphPolicyTraverseSystem**](docs/GraphApi.md#graphpolicytraversesystem) | **Get** /policies/{policy_id}/systems | List the Systems bound to a Policy +*GraphApi* | [**GraphPolicyTraverseSystemGroup**](docs/GraphApi.md#graphpolicytraversesystemgroup) | **Get** /policies/{policy_id}/systemgroups | List the System Groups bound to a Policy +*GraphApi* | [**GraphRadiusServerAssociationsList**](docs/GraphApi.md#graphradiusserverassociationslist) | **Get** /radiusservers/{radiusserver_id}/associations | List the associations of a RADIUS Server +*GraphApi* | [**GraphRadiusServerAssociationsPost**](docs/GraphApi.md#graphradiusserverassociationspost) | **Post** /radiusservers/{radiusserver_id}/associations | Manage the associations of a RADIUS Server +*GraphApi* | [**GraphRadiusServerTraverseUser**](docs/GraphApi.md#graphradiusservertraverseuser) | **Get** /radiusservers/{radiusserver_id}/users | List the Users bound to a RADIUS Server +*GraphApi* | [**GraphRadiusServerTraverseUserGroup**](docs/GraphApi.md#graphradiusservertraverseusergroup) | **Get** /radiusservers/{radiusserver_id}/usergroups | List the User Groups bound to a RADIUS Server +*GraphApi* | [**GraphSoftwareappsAssociationsList**](docs/GraphApi.md#graphsoftwareappsassociationslist) | **Get** /softwareapps/{software_app_id}/associations | List the associations of a Software Application +*GraphApi* | [**GraphSoftwareappsAssociationsPost**](docs/GraphApi.md#graphsoftwareappsassociationspost) | **Post** /softwareapps/{software_app_id}/associations | Manage the associations of a software application. +*GraphApi* | [**GraphSoftwareappsTraverseSystem**](docs/GraphApi.md#graphsoftwareappstraversesystem) | **Get** /softwareapps/{software_app_id}/systems | List the Systems bound to a Software App. +*GraphApi* | [**GraphSoftwareappsTraverseSystemGroup**](docs/GraphApi.md#graphsoftwareappstraversesystemgroup) | **Get** /softwareapps/{software_app_id}/systemgroups | List the System Groups bound to a Software App. +*GraphApi* | [**GraphSystemAssociationsList**](docs/GraphApi.md#graphsystemassociationslist) | **Get** /systems/{system_id}/associations | List the associations of a System +*GraphApi* | [**GraphSystemAssociationsPost**](docs/GraphApi.md#graphsystemassociationspost) | **Post** /systems/{system_id}/associations | Manage associations of a System +*GraphApi* | [**GraphSystemGroupAssociationsList**](docs/GraphApi.md#graphsystemgroupassociationslist) | **Get** /systemgroups/{group_id}/associations | List the associations of a System Group +*GraphApi* | [**GraphSystemGroupAssociationsPost**](docs/GraphApi.md#graphsystemgroupassociationspost) | **Post** /systemgroups/{group_id}/associations | Manage the associations of a System Group +*GraphApi* | [**GraphSystemGroupMembersList**](docs/GraphApi.md#graphsystemgroupmemberslist) | **Get** /systemgroups/{group_id}/members | List the members of a System Group +*GraphApi* | [**GraphSystemGroupMembersPost**](docs/GraphApi.md#graphsystemgroupmemberspost) | **Post** /systemgroups/{group_id}/members | Manage the members of a System Group +*GraphApi* | [**GraphSystemGroupMembership**](docs/GraphApi.md#graphsystemgroupmembership) | **Get** /systemgroups/{group_id}/membership | List the System Group's membership +*GraphApi* | [**GraphSystemGroupTraverseCommand**](docs/GraphApi.md#graphsystemgrouptraversecommand) | **Get** /systemgroups/{group_id}/commands | List the Commands bound to a System Group +*GraphApi* | [**GraphSystemGroupTraversePolicy**](docs/GraphApi.md#graphsystemgrouptraversepolicy) | **Get** /systemgroups/{group_id}/policies | List the Policies bound to a System Group +*GraphApi* | [**GraphSystemGroupTraversePolicyGroup**](docs/GraphApi.md#graphsystemgrouptraversepolicygroup) | **Get** /systemgroups/{group_id}/policygroups | List the Policy Groups bound to a System Group +*GraphApi* | [**GraphSystemGroupTraverseUser**](docs/GraphApi.md#graphsystemgrouptraverseuser) | **Get** /systemgroups/{group_id}/users | List the Users bound to a System Group +*GraphApi* | [**GraphSystemGroupTraverseUserGroup**](docs/GraphApi.md#graphsystemgrouptraverseusergroup) | **Get** /systemgroups/{group_id}/usergroups | List the User Groups bound to a System Group +*GraphApi* | [**GraphSystemMemberOf**](docs/GraphApi.md#graphsystemmemberof) | **Get** /systems/{system_id}/memberof | List the parent Groups of a System +*GraphApi* | [**GraphSystemTraverseCommand**](docs/GraphApi.md#graphsystemtraversecommand) | **Get** /systems/{system_id}/commands | List the Commands bound to a System +*GraphApi* | [**GraphSystemTraversePolicy**](docs/GraphApi.md#graphsystemtraversepolicy) | **Get** /systems/{system_id}/policies | List the Policies bound to a System +*GraphApi* | [**GraphSystemTraversePolicyGroup**](docs/GraphApi.md#graphsystemtraversepolicygroup) | **Get** /systems/{system_id}/policygroups | List the Policy Groups bound to a System +*GraphApi* | [**GraphSystemTraverseUser**](docs/GraphApi.md#graphsystemtraverseuser) | **Get** /systems/{system_id}/users | List the Users bound to a System +*GraphApi* | [**GraphSystemTraverseUserGroup**](docs/GraphApi.md#graphsystemtraverseusergroup) | **Get** /systems/{system_id}/usergroups | List the User Groups bound to a System +*GraphApi* | [**GraphUserAssociationsList**](docs/GraphApi.md#graphuserassociationslist) | **Get** /users/{user_id}/associations | List the associations of a User +*GraphApi* | [**GraphUserAssociationsPost**](docs/GraphApi.md#graphuserassociationspost) | **Post** /users/{user_id}/associations | Manage the associations of a User +*GraphApi* | [**GraphUserGroupAssociationsList**](docs/GraphApi.md#graphusergroupassociationslist) | **Get** /usergroups/{group_id}/associations | List the associations of a User Group. +*GraphApi* | [**GraphUserGroupAssociationsPost**](docs/GraphApi.md#graphusergroupassociationspost) | **Post** /usergroups/{group_id}/associations | Manage the associations of a User Group +*GraphApi* | [**GraphUserGroupMembersList**](docs/GraphApi.md#graphusergroupmemberslist) | **Get** /usergroups/{group_id}/members | List the members of a User Group +*GraphApi* | [**GraphUserGroupMembersPost**](docs/GraphApi.md#graphusergroupmemberspost) | **Post** /usergroups/{group_id}/members | Manage the members of a User Group +*GraphApi* | [**GraphUserGroupMembership**](docs/GraphApi.md#graphusergroupmembership) | **Get** /usergroups/{group_id}/membership | List the User Group's membership +*GraphApi* | [**GraphUserGroupTraverseActiveDirectory**](docs/GraphApi.md#graphusergrouptraverseactivedirectory) | **Get** /usergroups/{group_id}/activedirectories | List the Active Directories bound to a User Group +*GraphApi* | [**GraphUserGroupTraverseApplication**](docs/GraphApi.md#graphusergrouptraverseapplication) | **Get** /usergroups/{group_id}/applications | List the Applications bound to a User Group +*GraphApi* | [**GraphUserGroupTraverseDirectory**](docs/GraphApi.md#graphusergrouptraversedirectory) | **Get** /usergroups/{group_id}/directories | List the Directories bound to a User Group +*GraphApi* | [**GraphUserGroupTraverseGSuite**](docs/GraphApi.md#graphusergrouptraversegsuite) | **Get** /usergroups/{group_id}/gsuites | List the G Suite instances bound to a User Group +*GraphApi* | [**GraphUserGroupTraverseLdapServer**](docs/GraphApi.md#graphusergrouptraverseldapserver) | **Get** /usergroups/{group_id}/ldapservers | List the LDAP Servers bound to a User Group +*GraphApi* | [**GraphUserGroupTraverseOffice365**](docs/GraphApi.md#graphusergrouptraverseoffice365) | **Get** /usergroups/{group_id}/office365s | List the Office 365 instances bound to a User Group +*GraphApi* | [**GraphUserGroupTraverseRadiusServer**](docs/GraphApi.md#graphusergrouptraverseradiusserver) | **Get** /usergroups/{group_id}/radiusservers | List the RADIUS Servers bound to a User Group +*GraphApi* | [**GraphUserGroupTraverseSystem**](docs/GraphApi.md#graphusergrouptraversesystem) | **Get** /usergroups/{group_id}/systems | List the Systems bound to a User Group +*GraphApi* | [**GraphUserGroupTraverseSystemGroup**](docs/GraphApi.md#graphusergrouptraversesystemgroup) | **Get** /usergroups/{group_id}/systemgroups | List the System Groups bound to User Groups +*GraphApi* | [**GraphUserMemberOf**](docs/GraphApi.md#graphusermemberof) | **Get** /users/{user_id}/memberof | List the parent Groups of a User +*GraphApi* | [**GraphUserTraverseActiveDirectory**](docs/GraphApi.md#graphusertraverseactivedirectory) | **Get** /users/{user_id}/activedirectories | List the Active Directory instances bound to a User +*GraphApi* | [**GraphUserTraverseApplication**](docs/GraphApi.md#graphusertraverseapplication) | **Get** /users/{user_id}/applications | List the Applications bound to a User +*GraphApi* | [**GraphUserTraverseDirectory**](docs/GraphApi.md#graphusertraversedirectory) | **Get** /users/{user_id}/directories | List the Directories bound to a User +*GraphApi* | [**GraphUserTraverseGSuite**](docs/GraphApi.md#graphusertraversegsuite) | **Get** /users/{user_id}/gsuites | List the G Suite instances bound to a User +*GraphApi* | [**GraphUserTraverseLdapServer**](docs/GraphApi.md#graphusertraverseldapserver) | **Get** /users/{user_id}/ldapservers | List the LDAP servers bound to a User +*GraphApi* | [**GraphUserTraverseOffice365**](docs/GraphApi.md#graphusertraverseoffice365) | **Get** /users/{user_id}/office365s | List the Office 365 instances bound to a User +*GraphApi* | [**GraphUserTraverseRadiusServer**](docs/GraphApi.md#graphusertraverseradiusserver) | **Get** /users/{user_id}/radiusservers | List the RADIUS Servers bound to a User +*GraphApi* | [**GraphUserTraverseSystem**](docs/GraphApi.md#graphusertraversesystem) | **Get** /users/{user_id}/systems | List the Systems bound to a User +*GraphApi* | [**GraphUserTraverseSystemGroup**](docs/GraphApi.md#graphusertraversesystemgroup) | **Get** /users/{user_id}/systemgroups | List the System Groups bound to a User +*GraphApi* | [**PolicystatusesSystemsList**](docs/GraphApi.md#policystatusessystemslist) | **Get** /systems/{system_id}/policystatuses | List the policy statuses for a system +*GroupsApi* | [**GroupsList**](docs/GroupsApi.md#groupslist) | **Get** /groups | List All Groups +*IPListsApi* | [**IplistsDelete**](docs/IPListsApi.md#iplistsdelete) | **Delete** /iplists/{id} | Delete an IP list +*IPListsApi* | [**IplistsGet**](docs/IPListsApi.md#iplistsget) | **Get** /iplists/{id} | Get an IP list +*IPListsApi* | [**IplistsList**](docs/IPListsApi.md#iplistslist) | **Get** /iplists | List IP Lists +*IPListsApi* | [**IplistsPatch**](docs/IPListsApi.md#iplistspatch) | **Patch** /iplists/{id} | Update an IP list +*IPListsApi* | [**IplistsPost**](docs/IPListsApi.md#iplistspost) | **Post** /iplists | Create IP List +*IPListsApi* | [**IplistsPut**](docs/IPListsApi.md#iplistsput) | **Put** /iplists/{id} | Replace an IP list +*ImageApi* | [**ApplicationsDeleteLogo**](docs/ImageApi.md#applicationsdeletelogo) | **Delete** /applications/{application_id}/logo | Delete application image +*LDAPServersApi* | [**GraphLdapServerAssociationsList**](docs/LDAPServersApi.md#graphldapserverassociationslist) | **Get** /ldapservers/{ldapserver_id}/associations | List the associations of a LDAP Server +*LDAPServersApi* | [**GraphLdapServerAssociationsPost**](docs/LDAPServersApi.md#graphldapserverassociationspost) | **Post** /ldapservers/{ldapserver_id}/associations | Manage the associations of a LDAP Server +*LDAPServersApi* | [**GraphLdapServerTraverseUser**](docs/LDAPServersApi.md#graphldapservertraverseuser) | **Get** /ldapservers/{ldapserver_id}/users | List the Users bound to a LDAP Server +*LDAPServersApi* | [**GraphLdapServerTraverseUserGroup**](docs/LDAPServersApi.md#graphldapservertraverseusergroup) | **Get** /ldapservers/{ldapserver_id}/usergroups | List the User Groups bound to a LDAP Server +*LDAPServersApi* | [**LdapserversGet**](docs/LDAPServersApi.md#ldapserversget) | **Get** /ldapservers/{id} | Get LDAP Server +*LDAPServersApi* | [**LdapserversList**](docs/LDAPServersApi.md#ldapserverslist) | **Get** /ldapservers | List LDAP Servers +*LDAPServersApi* | [**LdapserversPatch**](docs/LDAPServersApi.md#ldapserverspatch) | **Patch** /ldapservers/{id} | Update existing LDAP server +*LogosApi* | [**LogosGet**](docs/LogosApi.md#logosget) | **Get** /logos/{id} | Get the logo associated with the specified id +*ManagedServiceProviderApi* | [**AdministratorOrganizationsCreateByAdministrator**](docs/ManagedServiceProviderApi.md#administratororganizationscreatebyadministrator) | **Post** /administrators/{id}/organizationlinks | Allow Adminstrator access to an Organization. +*ManagedServiceProviderApi* | [**AdministratorOrganizationsListByAdministrator**](docs/ManagedServiceProviderApi.md#administratororganizationslistbyadministrator) | **Get** /administrators/{id}/organizationlinks | List the association links between an Administrator and Organizations. +*ManagedServiceProviderApi* | [**AdministratorOrganizationsListByOrganization**](docs/ManagedServiceProviderApi.md#administratororganizationslistbyorganization) | **Get** /organizations/{id}/administratorlinks | List the association links between an Organization and Administrators. +*ManagedServiceProviderApi* | [**AdministratorOrganizationsRemoveByAdministrator**](docs/ManagedServiceProviderApi.md#administratororganizationsremovebyadministrator) | **Delete** /administrators/{administrator_id}/organizationlinks/{id} | Remove association between an Administrator and an Organization. +*ManagedServiceProviderApi* | [**ProviderOrganizationsUpdateOrg**](docs/ManagedServiceProviderApi.md#providerorganizationsupdateorg) | **Put** /providers/{provider_id}/organizations/{id} | Update Provider Organization +*ManagedServiceProviderApi* | [**ProvidersGetProvider**](docs/ManagedServiceProviderApi.md#providersgetprovider) | **Get** /providers/{provider_id} | Retrieve Provider +*ManagedServiceProviderApi* | [**ProvidersListAdministrators**](docs/ManagedServiceProviderApi.md#providerslistadministrators) | **Get** /providers/{provider_id}/administrators | List Provider Administrators +*ManagedServiceProviderApi* | [**ProvidersListOrganizations**](docs/ManagedServiceProviderApi.md#providerslistorganizations) | **Get** /providers/{provider_id}/organizations | List Provider Organizations +*ManagedServiceProviderApi* | [**ProvidersPostAdmins**](docs/ManagedServiceProviderApi.md#providerspostadmins) | **Post** /providers/{provider_id}/administrators | Create a new Provider Administrator +*ManagedServiceProviderApi* | [**ProvidersRetrieveInvoice**](docs/ManagedServiceProviderApi.md#providersretrieveinvoice) | **Get** /providers/{provider_id}/invoices/{ID} | Download a provider's invoice. +*ManagedServiceProviderApi* | [**ProvidersRetrieveInvoices**](docs/ManagedServiceProviderApi.md#providersretrieveinvoices) | **Get** /providers/{provider_id}/invoices | List a provider's invoices. +*Office365Api* | [**GraphOffice365AssociationsList**](docs/Office365Api.md#graphoffice365associationslist) | **Get** /office365s/{office365_id}/associations | List the associations of an Office 365 instance +*Office365Api* | [**GraphOffice365AssociationsPost**](docs/Office365Api.md#graphoffice365associationspost) | **Post** /office365s/{office365_id}/associations | Manage the associations of an Office 365 instance +*Office365Api* | [**GraphOffice365TraverseUser**](docs/Office365Api.md#graphoffice365traverseuser) | **Get** /office365s/{office365_id}/users | List the Users bound to an Office 365 instance +*Office365Api* | [**GraphOffice365TraverseUserGroup**](docs/Office365Api.md#graphoffice365traverseusergroup) | **Get** /office365s/{office365_id}/usergroups | List the User Groups bound to an Office 365 instance +*Office365Api* | [**Office365sGet**](docs/Office365Api.md#office365sget) | **Get** /office365s/{office365_id} | Get Office 365 instance +*Office365Api* | [**Office365sListImportUsers**](docs/Office365Api.md#office365slistimportusers) | **Get** /office365s/{office365_id}/import/users | Get a list of users to import from an Office 365 instance +*Office365Api* | [**Office365sPatch**](docs/Office365Api.md#office365spatch) | **Patch** /office365s/{office365_id} | Update existing Office 365 instance. +*Office365Api* | [**TranslationRulesOffice365Delete**](docs/Office365Api.md#translationrulesoffice365delete) | **Delete** /office365s/{office365_id}/translationrules/{id} | Deletes a Office 365 translation rule +*Office365Api* | [**TranslationRulesOffice365Get**](docs/Office365Api.md#translationrulesoffice365get) | **Get** /office365s/{office365_id}/translationrules/{id} | Gets a specific Office 365 translation rule +*Office365Api* | [**TranslationRulesOffice365List**](docs/Office365Api.md#translationrulesoffice365list) | **Get** /office365s/{office365_id}/translationrules | List all the Office 365 Translation Rules +*Office365Api* | [**TranslationRulesOffice365Post**](docs/Office365Api.md#translationrulesoffice365post) | **Post** /office365s/{office365_id}/translationrules | Create a new Office 365 Translation Rule +*Office365ImportApi* | [**Office365sListImportUsers**](docs/Office365ImportApi.md#office365slistimportusers) | **Get** /office365s/{office365_id}/import/users | Get a list of users to import from an Office 365 instance +*OrganizationsApi* | [**AdministratorOrganizationsCreateByAdministrator**](docs/OrganizationsApi.md#administratororganizationscreatebyadministrator) | **Post** /administrators/{id}/organizationlinks | Allow Adminstrator access to an Organization. +*OrganizationsApi* | [**AdministratorOrganizationsListByAdministrator**](docs/OrganizationsApi.md#administratororganizationslistbyadministrator) | **Get** /administrators/{id}/organizationlinks | List the association links between an Administrator and Organizations. +*OrganizationsApi* | [**AdministratorOrganizationsListByOrganization**](docs/OrganizationsApi.md#administratororganizationslistbyorganization) | **Get** /organizations/{id}/administratorlinks | List the association links between an Organization and Administrators. +*OrganizationsApi* | [**AdministratorOrganizationsRemoveByAdministrator**](docs/OrganizationsApi.md#administratororganizationsremovebyadministrator) | **Delete** /administrators/{administrator_id}/organizationlinks/{id} | Remove association between an Administrator and an Organization. +*OrganizationsApi* | [**OrganizationsListCases**](docs/OrganizationsApi.md#organizationslistcases) | **Get** /organizations/cases | Get all cases (Support/Feature requests) for organization +*PoliciesApi* | [**GraphPolicyAssociationsList**](docs/PoliciesApi.md#graphpolicyassociationslist) | **Get** /policies/{policy_id}/associations | List the associations of a Policy +*PoliciesApi* | [**GraphPolicyAssociationsPost**](docs/PoliciesApi.md#graphpolicyassociationspost) | **Post** /policies/{policy_id}/associations | Manage the associations of a Policy +*PoliciesApi* | [**GraphPolicyMemberOf**](docs/PoliciesApi.md#graphpolicymemberof) | **Get** /policies/{policy_id}/memberof | List the parent Groups of a Policy +*PoliciesApi* | [**GraphPolicyTraverseSystem**](docs/PoliciesApi.md#graphpolicytraversesystem) | **Get** /policies/{policy_id}/systems | List the Systems bound to a Policy +*PoliciesApi* | [**GraphPolicyTraverseSystemGroup**](docs/PoliciesApi.md#graphpolicytraversesystemgroup) | **Get** /policies/{policy_id}/systemgroups | List the System Groups bound to a Policy +*PoliciesApi* | [**PoliciesDelete**](docs/PoliciesApi.md#policiesdelete) | **Delete** /policies/{id} | Deletes a Policy +*PoliciesApi* | [**PoliciesGet**](docs/PoliciesApi.md#policiesget) | **Get** /policies/{id} | Gets a specific Policy. +*PoliciesApi* | [**PoliciesList**](docs/PoliciesApi.md#policieslist) | **Get** /policies | Lists all the Policies +*PoliciesApi* | [**PoliciesPost**](docs/PoliciesApi.md#policiespost) | **Post** /policies | Create a new Policy +*PoliciesApi* | [**PoliciesPut**](docs/PoliciesApi.md#policiesput) | **Put** /policies/{id} | Update an existing Policy +*PoliciesApi* | [**PolicyresultsGet**](docs/PoliciesApi.md#policyresultsget) | **Get** /policyresults/{id} | Get a specific Policy Result. +*PoliciesApi* | [**PolicyresultsList**](docs/PoliciesApi.md#policyresultslist) | **Get** /policies/{policy_id}/policyresults | Lists all the policy results of a policy. +*PoliciesApi* | [**PolicyresultsOrgList**](docs/PoliciesApi.md#policyresultsorglist) | **Get** /policyresults | Lists all of the policy results for an organization. +*PoliciesApi* | [**PolicystatusesPoliciesList**](docs/PoliciesApi.md#policystatusespolicieslist) | **Get** /policies/{policy_id}/policystatuses | Lists the latest policy results of a policy. +*PoliciesApi* | [**PolicystatusesSystemsList**](docs/PoliciesApi.md#policystatusessystemslist) | **Get** /systems/{system_id}/policystatuses | List the policy statuses for a system +*PoliciesApi* | [**PolicytemplatesGet**](docs/PoliciesApi.md#policytemplatesget) | **Get** /policytemplates/{id} | Get a specific Policy Template +*PoliciesApi* | [**PolicytemplatesList**](docs/PoliciesApi.md#policytemplateslist) | **Get** /policytemplates | Lists all of the Policy Templates +*PolicyGroupAssociationsApi* | [**GraphPolicyGroupAssociationsList**](docs/PolicyGroupAssociationsApi.md#graphpolicygroupassociationslist) | **Get** /policygroups/{group_id}/associations | List the associations of a Policy Group. +*PolicyGroupAssociationsApi* | [**GraphPolicyGroupAssociationsPost**](docs/PolicyGroupAssociationsApi.md#graphpolicygroupassociationspost) | **Post** /policygroups/{group_id}/associations | Manage the associations of a Policy Group +*PolicyGroupAssociationsApi* | [**GraphPolicyGroupTraverseSystem**](docs/PolicyGroupAssociationsApi.md#graphpolicygrouptraversesystem) | **Get** /policygroups/{group_id}/systems | List the Systems bound to a Policy Group +*PolicyGroupAssociationsApi* | [**GraphPolicyGroupTraverseSystemGroup**](docs/PolicyGroupAssociationsApi.md#graphpolicygrouptraversesystemgroup) | **Get** /policygroups/{group_id}/systemgroups | List the System Groups bound to Policy Groups +*PolicyGroupMembersMembershipApi* | [**GraphPolicyGroupMembersList**](docs/PolicyGroupMembersMembershipApi.md#graphpolicygroupmemberslist) | **Get** /policygroups/{group_id}/members | List the members of a Policy Group +*PolicyGroupMembersMembershipApi* | [**GraphPolicyGroupMembersPost**](docs/PolicyGroupMembersMembershipApi.md#graphpolicygroupmemberspost) | **Post** /policygroups/{group_id}/members | Manage the members of a Policy Group +*PolicyGroupMembersMembershipApi* | [**GraphPolicyGroupMembership**](docs/PolicyGroupMembersMembershipApi.md#graphpolicygroupmembership) | **Get** /policygroups/{group_id}/membership | List the Policy Group's membership +*PolicyGroupsApi* | [**GraphPolicyGroupAssociationsList**](docs/PolicyGroupsApi.md#graphpolicygroupassociationslist) | **Get** /policygroups/{group_id}/associations | List the associations of a Policy Group. +*PolicyGroupsApi* | [**GraphPolicyGroupAssociationsPost**](docs/PolicyGroupsApi.md#graphpolicygroupassociationspost) | **Post** /policygroups/{group_id}/associations | Manage the associations of a Policy Group +*PolicyGroupsApi* | [**GraphPolicyGroupMembersList**](docs/PolicyGroupsApi.md#graphpolicygroupmemberslist) | **Get** /policygroups/{group_id}/members | List the members of a Policy Group +*PolicyGroupsApi* | [**GraphPolicyGroupMembersPost**](docs/PolicyGroupsApi.md#graphpolicygroupmemberspost) | **Post** /policygroups/{group_id}/members | Manage the members of a Policy Group +*PolicyGroupsApi* | [**GraphPolicyGroupMembership**](docs/PolicyGroupsApi.md#graphpolicygroupmembership) | **Get** /policygroups/{group_id}/membership | List the Policy Group's membership +*PolicyGroupsApi* | [**GraphPolicyGroupTraverseSystem**](docs/PolicyGroupsApi.md#graphpolicygrouptraversesystem) | **Get** /policygroups/{group_id}/systems | List the Systems bound to a Policy Group +*PolicyGroupsApi* | [**GraphPolicyGroupTraverseSystemGroup**](docs/PolicyGroupsApi.md#graphpolicygrouptraversesystemgroup) | **Get** /policygroups/{group_id}/systemgroups | List the System Groups bound to Policy Groups +*PolicyGroupsApi* | [**GroupsPolicyDelete**](docs/PolicyGroupsApi.md#groupspolicydelete) | **Delete** /policygroups/{id} | Delete a Policy Group +*PolicyGroupsApi* | [**GroupsPolicyGet**](docs/PolicyGroupsApi.md#groupspolicyget) | **Get** /policygroups/{id} | View an individual Policy Group details +*PolicyGroupsApi* | [**GroupsPolicyList**](docs/PolicyGroupsApi.md#groupspolicylist) | **Get** /policygroups | List all Policy Groups +*PolicyGroupsApi* | [**GroupsPolicyPost**](docs/PolicyGroupsApi.md#groupspolicypost) | **Post** /policygroups | Create a new Policy Group +*PolicyGroupsApi* | [**GroupsPolicyPut**](docs/PolicyGroupsApi.md#groupspolicyput) | **Put** /policygroups/{id} | Update a Policy Group +*PolicytemplatesApi* | [**PolicytemplatesGet**](docs/PolicytemplatesApi.md#policytemplatesget) | **Get** /policytemplates/{id} | Get a specific Policy Template +*PolicytemplatesApi* | [**PolicytemplatesList**](docs/PolicytemplatesApi.md#policytemplateslist) | **Get** /policytemplates | Lists all of the Policy Templates +*ProvidersApi* | [**AutotaskCreateConfiguration**](docs/ProvidersApi.md#autotaskcreateconfiguration) | **Post** /providers/{provider_id}/integrations/autotask | Creates a new Autotask integration for the provider +*ProvidersApi* | [**AutotaskDeleteConfiguration**](docs/ProvidersApi.md#autotaskdeleteconfiguration) | **Delete** /integrations/autotask/{UUID} | Delete Autotask Integration +*ProvidersApi* | [**AutotaskGetConfiguration**](docs/ProvidersApi.md#autotaskgetconfiguration) | **Get** /integrations/autotask/{UUID} | Retrieve Autotask Integration Configuration +*ProvidersApi* | [**AutotaskPatchMappings**](docs/ProvidersApi.md#autotaskpatchmappings) | **Patch** /integrations/autotask/{UUID}/mappings | Create, edit, and/or delete Autotask Mappings +*ProvidersApi* | [**AutotaskPatchSettings**](docs/ProvidersApi.md#autotaskpatchsettings) | **Patch** /integrations/autotask/{UUID}/settings | Create, edit, and/or delete Autotask Integration settings +*ProvidersApi* | [**AutotaskRetrieveAllAlertConfigurationOptions**](docs/ProvidersApi.md#autotaskretrieveallalertconfigurationoptions) | **Get** /providers/{provider_id}/integrations/autotask/alerts/configuration/options | Get all Autotask ticketing alert configuration options for a provider +*ProvidersApi* | [**AutotaskRetrieveAllAlertConfigurations**](docs/ProvidersApi.md#autotaskretrieveallalertconfigurations) | **Get** /providers/{provider_id}/integrations/autotask/alerts/configuration | Get all Autotask ticketing alert configurations for a provider +*ProvidersApi* | [**AutotaskRetrieveCompanies**](docs/ProvidersApi.md#autotaskretrievecompanies) | **Get** /integrations/autotask/{UUID}/companies | Retrieve Autotask Companies +*ProvidersApi* | [**AutotaskRetrieveCompanyTypes**](docs/ProvidersApi.md#autotaskretrievecompanytypes) | **Get** /integrations/autotask/{UUID}/companytypes | Retrieve Autotask Company Types +*ProvidersApi* | [**AutotaskRetrieveContracts**](docs/ProvidersApi.md#autotaskretrievecontracts) | **Get** /integrations/autotask/{UUID}/contracts | Retrieve Autotask Contracts +*ProvidersApi* | [**AutotaskRetrieveContractsFields**](docs/ProvidersApi.md#autotaskretrievecontractsfields) | **Get** /integrations/autotask/{UUID}/contracts/fields | Retrieve Autotask Contract Fields +*ProvidersApi* | [**AutotaskRetrieveMappings**](docs/ProvidersApi.md#autotaskretrievemappings) | **Get** /integrations/autotask/{UUID}/mappings | Retrieve Autotask mappings +*ProvidersApi* | [**AutotaskRetrieveServices**](docs/ProvidersApi.md#autotaskretrieveservices) | **Get** /integrations/autotask/{UUID}/contracts/services | Retrieve Autotask Contract Services +*ProvidersApi* | [**AutotaskRetrieveSettings**](docs/ProvidersApi.md#autotaskretrievesettings) | **Get** /integrations/autotask/{UUID}/settings | Retrieve Autotask Integration settings +*ProvidersApi* | [**AutotaskUpdateAlertConfiguration**](docs/ProvidersApi.md#autotaskupdatealertconfiguration) | **Put** /providers/{provider_id}/integrations/autotask/alerts/{alert_UUID}/configuration | Update an Autotask ticketing alert's configuration +*ProvidersApi* | [**AutotaskUpdateConfiguration**](docs/ProvidersApi.md#autotaskupdateconfiguration) | **Patch** /integrations/autotask/{UUID} | Update Autotask Integration configuration +*ProvidersApi* | [**ConnectwiseCreateConfiguration**](docs/ProvidersApi.md#connectwisecreateconfiguration) | **Post** /providers/{provider_id}/integrations/connectwise | Creates a new ConnectWise integration for the provider +*ProvidersApi* | [**ConnectwiseDeleteConfiguration**](docs/ProvidersApi.md#connectwisedeleteconfiguration) | **Delete** /integrations/connectwise/{UUID} | Delete ConnectWise Integration +*ProvidersApi* | [**ConnectwiseGetConfiguration**](docs/ProvidersApi.md#connectwisegetconfiguration) | **Get** /integrations/connectwise/{UUID} | Retrieve ConnectWise Integration Configuration +*ProvidersApi* | [**ConnectwisePatchMappings**](docs/ProvidersApi.md#connectwisepatchmappings) | **Patch** /integrations/connectwise/{UUID}/mappings | Create, edit, and/or delete ConnectWise Mappings +*ProvidersApi* | [**ConnectwisePatchSettings**](docs/ProvidersApi.md#connectwisepatchsettings) | **Patch** /integrations/connectwise/{UUID}/settings | Create, edit, and/or delete ConnectWise Integration settings +*ProvidersApi* | [**ConnectwiseRetrieveAdditions**](docs/ProvidersApi.md#connectwiseretrieveadditions) | **Get** /integrations/connectwise/{UUID}/agreements/{agreement_ID}/additions | Retrieve ConnectWise Additions +*ProvidersApi* | [**ConnectwiseRetrieveAgreements**](docs/ProvidersApi.md#connectwiseretrieveagreements) | **Get** /integrations/connectwise/{UUID}/agreements | Retrieve ConnectWise Agreements +*ProvidersApi* | [**ConnectwiseRetrieveAllAlertConfigurationOptions**](docs/ProvidersApi.md#connectwiseretrieveallalertconfigurationoptions) | **Get** /providers/{provider_id}/integrations/connectwise/alerts/configuration/options | Get all ConnectWise ticketing alert configuration options for a provider +*ProvidersApi* | [**ConnectwiseRetrieveAllAlertConfigurations**](docs/ProvidersApi.md#connectwiseretrieveallalertconfigurations) | **Get** /providers/{provider_id}/integrations/connectwise/alerts/configuration | Get all ConnectWise ticketing alert configurations for a provider +*ProvidersApi* | [**ConnectwiseRetrieveCompanies**](docs/ProvidersApi.md#connectwiseretrievecompanies) | **Get** /integrations/connectwise/{UUID}/companies | Retrieve ConnectWise Companies +*ProvidersApi* | [**ConnectwiseRetrieveCompanyTypes**](docs/ProvidersApi.md#connectwiseretrievecompanytypes) | **Get** /integrations/connectwise/{UUID}/companytypes | Retrieve ConnectWise Company Types +*ProvidersApi* | [**ConnectwiseRetrieveMappings**](docs/ProvidersApi.md#connectwiseretrievemappings) | **Get** /integrations/connectwise/{UUID}/mappings | Retrieve ConnectWise mappings +*ProvidersApi* | [**ConnectwiseRetrieveSettings**](docs/ProvidersApi.md#connectwiseretrievesettings) | **Get** /integrations/connectwise/{UUID}/settings | Retrieve ConnectWise Integration settings +*ProvidersApi* | [**ConnectwiseUpdateAlertConfiguration**](docs/ProvidersApi.md#connectwiseupdatealertconfiguration) | **Put** /providers/{provider_id}/integrations/connectwise/alerts/{alert_UUID}/configuration | Update a ConnectWise ticketing alert's configuration +*ProvidersApi* | [**ConnectwiseUpdateConfiguration**](docs/ProvidersApi.md#connectwiseupdateconfiguration) | **Patch** /integrations/connectwise/{UUID} | Update ConnectWise Integration configuration +*ProvidersApi* | [**MtpIntegrationRetrieveAlerts**](docs/ProvidersApi.md#mtpintegrationretrievealerts) | **Get** /providers/{provider_id}/integrations/ticketing/alerts | Get all ticketing alerts available for a provider's ticketing integration. +*ProvidersApi* | [**MtpIntegrationRetrieveSyncErrors**](docs/ProvidersApi.md#mtpintegrationretrievesyncerrors) | **Get** /integrations/{integration_type}/{UUID}/errors | Retrieve Recent Integration Sync Errors +*ProvidersApi* | [**ProviderOrganizationsUpdateOrg**](docs/ProvidersApi.md#providerorganizationsupdateorg) | **Put** /providers/{provider_id}/organizations/{id} | Update Provider Organization +*ProvidersApi* | [**ProvidersGetProvider**](docs/ProvidersApi.md#providersgetprovider) | **Get** /providers/{provider_id} | Retrieve Provider +*ProvidersApi* | [**ProvidersListAdministrators**](docs/ProvidersApi.md#providerslistadministrators) | **Get** /providers/{provider_id}/administrators | List Provider Administrators +*ProvidersApi* | [**ProvidersListOrganizations**](docs/ProvidersApi.md#providerslistorganizations) | **Get** /providers/{provider_id}/organizations | List Provider Organizations +*ProvidersApi* | [**ProvidersPostAdmins**](docs/ProvidersApi.md#providerspostadmins) | **Post** /providers/{provider_id}/administrators | Create a new Provider Administrator +*ProvidersApi* | [**ProvidersRemoveAdministrator**](docs/ProvidersApi.md#providersremoveadministrator) | **Delete** /providers/{provider_id}/administrators/{id} | Delete Provider Administrator +*ProvidersApi* | [**ProvidersRetrieveIntegrations**](docs/ProvidersApi.md#providersretrieveintegrations) | **Get** /providers/{provider_id}/integrations | Retrieve Integrations for Provider +*ProvidersApi* | [**ProvidersRetrieveInvoice**](docs/ProvidersApi.md#providersretrieveinvoice) | **Get** /providers/{provider_id}/invoices/{ID} | Download a provider's invoice. +*ProvidersApi* | [**ProvidersRetrieveInvoices**](docs/ProvidersApi.md#providersretrieveinvoices) | **Get** /providers/{provider_id}/invoices | List a provider's invoices. +*RADIUSServersApi* | [**GraphRadiusServerAssociationsList**](docs/RADIUSServersApi.md#graphradiusserverassociationslist) | **Get** /radiusservers/{radiusserver_id}/associations | List the associations of a RADIUS Server +*RADIUSServersApi* | [**GraphRadiusServerAssociationsPost**](docs/RADIUSServersApi.md#graphradiusserverassociationspost) | **Post** /radiusservers/{radiusserver_id}/associations | Manage the associations of a RADIUS Server +*RADIUSServersApi* | [**GraphRadiusServerTraverseUser**](docs/RADIUSServersApi.md#graphradiusservertraverseuser) | **Get** /radiusservers/{radiusserver_id}/users | List the Users bound to a RADIUS Server +*RADIUSServersApi* | [**GraphRadiusServerTraverseUserGroup**](docs/RADIUSServersApi.md#graphradiusservertraverseusergroup) | **Get** /radiusservers/{radiusserver_id}/usergroups | List the User Groups bound to a RADIUS Server +*SCIMImportApi* | [**ImportUsers**](docs/SCIMImportApi.md#importusers) | **Get** /applications/{application_id}/import/users | Get a list of users to import from an Application IdM service provider +*SambaDomainsApi* | [**LdapserversSambaDomainsDelete**](docs/SambaDomainsApi.md#ldapserverssambadomainsdelete) | **Delete** /ldapservers/{ldapserver_id}/sambadomains/{id} | Delete Samba Domain +*SambaDomainsApi* | [**LdapserversSambaDomainsGet**](docs/SambaDomainsApi.md#ldapserverssambadomainsget) | **Get** /ldapservers/{ldapserver_id}/sambadomains/{id} | Get Samba Domain +*SambaDomainsApi* | [**LdapserversSambaDomainsList**](docs/SambaDomainsApi.md#ldapserverssambadomainslist) | **Get** /ldapservers/{ldapserver_id}/sambadomains | List Samba Domains +*SambaDomainsApi* | [**LdapserversSambaDomainsPost**](docs/SambaDomainsApi.md#ldapserverssambadomainspost) | **Post** /ldapservers/{ldapserver_id}/sambadomains | Create Samba Domain +*SambaDomainsApi* | [**LdapserversSambaDomainsPut**](docs/SambaDomainsApi.md#ldapserverssambadomainsput) | **Put** /ldapservers/{ldapserver_id}/sambadomains/{id} | Update Samba Domain +*SoftwareAppsApi* | [**GraphSoftwareappsAssociationsList**](docs/SoftwareAppsApi.md#graphsoftwareappsassociationslist) | **Get** /softwareapps/{software_app_id}/associations | List the associations of a Software Application +*SoftwareAppsApi* | [**GraphSoftwareappsAssociationsPost**](docs/SoftwareAppsApi.md#graphsoftwareappsassociationspost) | **Post** /softwareapps/{software_app_id}/associations | Manage the associations of a software application. +*SoftwareAppsApi* | [**GraphSoftwareappsTraverseSystem**](docs/SoftwareAppsApi.md#graphsoftwareappstraversesystem) | **Get** /softwareapps/{software_app_id}/systems | List the Systems bound to a Software App. +*SoftwareAppsApi* | [**GraphSoftwareappsTraverseSystemGroup**](docs/SoftwareAppsApi.md#graphsoftwareappstraversesystemgroup) | **Get** /softwareapps/{software_app_id}/systemgroups | List the System Groups bound to a Software App. +*SoftwareAppsApi* | [**SoftwareAppStatusesList**](docs/SoftwareAppsApi.md#softwareappstatuseslist) | **Get** /softwareapps/{software_app_id}/statuses | Get the status of the provided Software Application +*SoftwareAppsApi* | [**SoftwareAppsDelete**](docs/SoftwareAppsApi.md#softwareappsdelete) | **Delete** /softwareapps/{id} | Delete a configured Software Application +*SoftwareAppsApi* | [**SoftwareAppsGet**](docs/SoftwareAppsApi.md#softwareappsget) | **Get** /softwareapps/{id} | Retrieve a configured Software Application. +*SoftwareAppsApi* | [**SoftwareAppsList**](docs/SoftwareAppsApi.md#softwareappslist) | **Get** /softwareapps | Get all configured Software Applications. +*SoftwareAppsApi* | [**SoftwareAppsPost**](docs/SoftwareAppsApi.md#softwareappspost) | **Post** /softwareapps | Create a Software Application that will be managed by JumpCloud. +*SoftwareAppsApi* | [**SoftwareAppsReclaimLicenses**](docs/SoftwareAppsApi.md#softwareappsreclaimlicenses) | **Post** /softwareapps/{software_app_id}/reclaim-licenses | Reclaim Licenses for a Software Application. +*SoftwareAppsApi* | [**SoftwareAppsRetryInstallation**](docs/SoftwareAppsApi.md#softwareappsretryinstallation) | **Post** /softwareapps/{software_app_id}/retry-installation | Retry Installation for a Software Application +*SoftwareAppsApi* | [**SoftwareAppsUpdate**](docs/SoftwareAppsApi.md#softwareappsupdate) | **Put** /softwareapps/{id} | Update a Software Application Configuration. +*SubscriptionsApi* | [**SubscriptionsGet**](docs/SubscriptionsApi.md#subscriptionsget) | **Get** /subscriptions | Lists all the Pricing & Packaging Subscriptions +*SystemGroupAssociationsApi* | [**GraphSystemGroupAssociationsList**](docs/SystemGroupAssociationsApi.md#graphsystemgroupassociationslist) | **Get** /systemgroups/{group_id}/associations | List the associations of a System Group +*SystemGroupAssociationsApi* | [**GraphSystemGroupAssociationsPost**](docs/SystemGroupAssociationsApi.md#graphsystemgroupassociationspost) | **Post** /systemgroups/{group_id}/associations | Manage the associations of a System Group +*SystemGroupAssociationsApi* | [**GraphSystemGroupTraverseCommand**](docs/SystemGroupAssociationsApi.md#graphsystemgrouptraversecommand) | **Get** /systemgroups/{group_id}/commands | List the Commands bound to a System Group +*SystemGroupAssociationsApi* | [**GraphSystemGroupTraversePolicy**](docs/SystemGroupAssociationsApi.md#graphsystemgrouptraversepolicy) | **Get** /systemgroups/{group_id}/policies | List the Policies bound to a System Group +*SystemGroupAssociationsApi* | [**GraphSystemGroupTraversePolicyGroup**](docs/SystemGroupAssociationsApi.md#graphsystemgrouptraversepolicygroup) | **Get** /systemgroups/{group_id}/policygroups | List the Policy Groups bound to a System Group +*SystemGroupAssociationsApi* | [**GraphSystemGroupTraverseUser**](docs/SystemGroupAssociationsApi.md#graphsystemgrouptraverseuser) | **Get** /systemgroups/{group_id}/users | List the Users bound to a System Group +*SystemGroupAssociationsApi* | [**GraphSystemGroupTraverseUserGroup**](docs/SystemGroupAssociationsApi.md#graphsystemgrouptraverseusergroup) | **Get** /systemgroups/{group_id}/usergroups | List the User Groups bound to a System Group +*SystemGroupMembersMembershipApi* | [**GraphSystemGroupMembersList**](docs/SystemGroupMembersMembershipApi.md#graphsystemgroupmemberslist) | **Get** /systemgroups/{group_id}/members | List the members of a System Group +*SystemGroupMembersMembershipApi* | [**GraphSystemGroupMembersPost**](docs/SystemGroupMembersMembershipApi.md#graphsystemgroupmemberspost) | **Post** /systemgroups/{group_id}/members | Manage the members of a System Group +*SystemGroupMembersMembershipApi* | [**GraphSystemGroupMembership**](docs/SystemGroupMembersMembershipApi.md#graphsystemgroupmembership) | **Get** /systemgroups/{group_id}/membership | List the System Group's membership +*SystemGroupsApi* | [**GraphSystemGroupAssociationsList**](docs/SystemGroupsApi.md#graphsystemgroupassociationslist) | **Get** /systemgroups/{group_id}/associations | List the associations of a System Group +*SystemGroupsApi* | [**GraphSystemGroupAssociationsPost**](docs/SystemGroupsApi.md#graphsystemgroupassociationspost) | **Post** /systemgroups/{group_id}/associations | Manage the associations of a System Group +*SystemGroupsApi* | [**GraphSystemGroupMembersList**](docs/SystemGroupsApi.md#graphsystemgroupmemberslist) | **Get** /systemgroups/{group_id}/members | List the members of a System Group +*SystemGroupsApi* | [**GraphSystemGroupMembersPost**](docs/SystemGroupsApi.md#graphsystemgroupmemberspost) | **Post** /systemgroups/{group_id}/members | Manage the members of a System Group +*SystemGroupsApi* | [**GraphSystemGroupMembership**](docs/SystemGroupsApi.md#graphsystemgroupmembership) | **Get** /systemgroups/{group_id}/membership | List the System Group's membership +*SystemGroupsApi* | [**GraphSystemGroupTraversePolicy**](docs/SystemGroupsApi.md#graphsystemgrouptraversepolicy) | **Get** /systemgroups/{group_id}/policies | List the Policies bound to a System Group +*SystemGroupsApi* | [**GraphSystemGroupTraversePolicyGroup**](docs/SystemGroupsApi.md#graphsystemgrouptraversepolicygroup) | **Get** /systemgroups/{group_id}/policygroups | List the Policy Groups bound to a System Group +*SystemGroupsApi* | [**GraphSystemGroupTraverseUser**](docs/SystemGroupsApi.md#graphsystemgrouptraverseuser) | **Get** /systemgroups/{group_id}/users | List the Users bound to a System Group +*SystemGroupsApi* | [**GraphSystemGroupTraverseUserGroup**](docs/SystemGroupsApi.md#graphsystemgrouptraverseusergroup) | **Get** /systemgroups/{group_id}/usergroups | List the User Groups bound to a System Group +*SystemGroupsApi* | [**GroupsSystemDelete**](docs/SystemGroupsApi.md#groupssystemdelete) | **Delete** /systemgroups/{id} | Delete a System Group +*SystemGroupsApi* | [**GroupsSystemGet**](docs/SystemGroupsApi.md#groupssystemget) | **Get** /systemgroups/{id} | View an individual System Group details +*SystemGroupsApi* | [**GroupsSystemList**](docs/SystemGroupsApi.md#groupssystemlist) | **Get** /systemgroups | List all System Groups +*SystemGroupsApi* | [**GroupsSystemPost**](docs/SystemGroupsApi.md#groupssystempost) | **Post** /systemgroups | Create a new System Group +*SystemGroupsApi* | [**GroupsSystemPut**](docs/SystemGroupsApi.md#groupssystemput) | **Put** /systemgroups/{id} | Update a System Group +*SystemInsightsApi* | [**SysteminsightsListAlf**](docs/SystemInsightsApi.md#systeminsightslistalf) | **Get** /systeminsights/alf | List System Insights ALF +*SystemInsightsApi* | [**SysteminsightsListAlfExceptions**](docs/SystemInsightsApi.md#systeminsightslistalfexceptions) | **Get** /systeminsights/alf_exceptions | List System Insights ALF Exceptions +*SystemInsightsApi* | [**SysteminsightsListAlfExplicitAuths**](docs/SystemInsightsApi.md#systeminsightslistalfexplicitauths) | **Get** /systeminsights/alf_explicit_auths | List System Insights ALF Explicit Authentications +*SystemInsightsApi* | [**SysteminsightsListAppcompatShims**](docs/SystemInsightsApi.md#systeminsightslistappcompatshims) | **Get** /systeminsights/appcompat_shims | List System Insights Application Compatibility Shims +*SystemInsightsApi* | [**SysteminsightsListApps**](docs/SystemInsightsApi.md#systeminsightslistapps) | **Get** /systeminsights/apps | List System Insights Apps +*SystemInsightsApi* | [**SysteminsightsListAuthorizedKeys**](docs/SystemInsightsApi.md#systeminsightslistauthorizedkeys) | **Get** /systeminsights/authorized_keys | List System Insights Authorized Keys +*SystemInsightsApi* | [**SysteminsightsListAzureInstanceMetadata**](docs/SystemInsightsApi.md#systeminsightslistazureinstancemetadata) | **Get** /systeminsights/azure_instance_metadata | List System Insights Azure Instance Metadata +*SystemInsightsApi* | [**SysteminsightsListAzureInstanceTags**](docs/SystemInsightsApi.md#systeminsightslistazureinstancetags) | **Get** /systeminsights/azure_instance_tags | List System Insights Azure Instance Tags +*SystemInsightsApi* | [**SysteminsightsListBattery**](docs/SystemInsightsApi.md#systeminsightslistbattery) | **Get** /systeminsights/battery | List System Insights Battery +*SystemInsightsApi* | [**SysteminsightsListBitlockerInfo**](docs/SystemInsightsApi.md#systeminsightslistbitlockerinfo) | **Get** /systeminsights/bitlocker_info | List System Insights Bitlocker Info +*SystemInsightsApi* | [**SysteminsightsListBrowserPlugins**](docs/SystemInsightsApi.md#systeminsightslistbrowserplugins) | **Get** /systeminsights/browser_plugins | List System Insights Browser Plugins +*SystemInsightsApi* | [**SysteminsightsListCertificates**](docs/SystemInsightsApi.md#systeminsightslistcertificates) | **Get** /systeminsights/certificates | List System Insights Certificates +*SystemInsightsApi* | [**SysteminsightsListChassisInfo**](docs/SystemInsightsApi.md#systeminsightslistchassisinfo) | **Get** /systeminsights/chassis_info | List System Insights Chassis Info +*SystemInsightsApi* | [**SysteminsightsListChromeExtensions**](docs/SystemInsightsApi.md#systeminsightslistchromeextensions) | **Get** /systeminsights/chrome_extensions | List System Insights Chrome Extensions +*SystemInsightsApi* | [**SysteminsightsListConnectivity**](docs/SystemInsightsApi.md#systeminsightslistconnectivity) | **Get** /systeminsights/connectivity | List System Insights Connectivity +*SystemInsightsApi* | [**SysteminsightsListCrashes**](docs/SystemInsightsApi.md#systeminsightslistcrashes) | **Get** /systeminsights/crashes | List System Insights Crashes +*SystemInsightsApi* | [**SysteminsightsListCupsDestinations**](docs/SystemInsightsApi.md#systeminsightslistcupsdestinations) | **Get** /systeminsights/cups_destinations | List System Insights CUPS Destinations +*SystemInsightsApi* | [**SysteminsightsListDiskEncryption**](docs/SystemInsightsApi.md#systeminsightslistdiskencryption) | **Get** /systeminsights/disk_encryption | List System Insights Disk Encryption +*SystemInsightsApi* | [**SysteminsightsListDiskInfo**](docs/SystemInsightsApi.md#systeminsightslistdiskinfo) | **Get** /systeminsights/disk_info | List System Insights Disk Info +*SystemInsightsApi* | [**SysteminsightsListDnsResolvers**](docs/SystemInsightsApi.md#systeminsightslistdnsresolvers) | **Get** /systeminsights/dns_resolvers | List System Insights DNS Resolvers +*SystemInsightsApi* | [**SysteminsightsListEtcHosts**](docs/SystemInsightsApi.md#systeminsightslistetchosts) | **Get** /systeminsights/etc_hosts | List System Insights Etc Hosts +*SystemInsightsApi* | [**SysteminsightsListFirefoxAddons**](docs/SystemInsightsApi.md#systeminsightslistfirefoxaddons) | **Get** /systeminsights/firefox_addons | List System Insights Firefox Addons +*SystemInsightsApi* | [**SysteminsightsListGroups**](docs/SystemInsightsApi.md#systeminsightslistgroups) | **Get** /systeminsights/groups | List System Insights Groups +*SystemInsightsApi* | [**SysteminsightsListIeExtensions**](docs/SystemInsightsApi.md#systeminsightslistieextensions) | **Get** /systeminsights/ie_extensions | List System Insights IE Extensions +*SystemInsightsApi* | [**SysteminsightsListInterfaceAddresses**](docs/SystemInsightsApi.md#systeminsightslistinterfaceaddresses) | **Get** /systeminsights/interface_addresses | List System Insights Interface Addresses +*SystemInsightsApi* | [**SysteminsightsListInterfaceDetails**](docs/SystemInsightsApi.md#systeminsightslistinterfacedetails) | **Get** /systeminsights/interface_details | List System Insights Interface Details +*SystemInsightsApi* | [**SysteminsightsListKernelInfo**](docs/SystemInsightsApi.md#systeminsightslistkernelinfo) | **Get** /systeminsights/kernel_info | List System Insights Kernel Info +*SystemInsightsApi* | [**SysteminsightsListLaunchd**](docs/SystemInsightsApi.md#systeminsightslistlaunchd) | **Get** /systeminsights/launchd | List System Insights Launchd +*SystemInsightsApi* | [**SysteminsightsListLinuxPackages**](docs/SystemInsightsApi.md#systeminsightslistlinuxpackages) | **Get** /systeminsights/linux_packages | List System Insights Linux Packages +*SystemInsightsApi* | [**SysteminsightsListLoggedInUsers**](docs/SystemInsightsApi.md#systeminsightslistloggedinusers) | **Get** /systeminsights/logged_in_users | List System Insights Logged-In Users +*SystemInsightsApi* | [**SysteminsightsListLogicalDrives**](docs/SystemInsightsApi.md#systeminsightslistlogicaldrives) | **Get** /systeminsights/logical_drives | List System Insights Logical Drives +*SystemInsightsApi* | [**SysteminsightsListManagedPolicies**](docs/SystemInsightsApi.md#systeminsightslistmanagedpolicies) | **Get** /systeminsights/managed_policies | List System Insights Managed Policies +*SystemInsightsApi* | [**SysteminsightsListMounts**](docs/SystemInsightsApi.md#systeminsightslistmounts) | **Get** /systeminsights/mounts | List System Insights Mounts +*SystemInsightsApi* | [**SysteminsightsListOsVersion**](docs/SystemInsightsApi.md#systeminsightslistosversion) | **Get** /systeminsights/os_version | List System Insights OS Version +*SystemInsightsApi* | [**SysteminsightsListPatches**](docs/SystemInsightsApi.md#systeminsightslistpatches) | **Get** /systeminsights/patches | List System Insights Patches +*SystemInsightsApi* | [**SysteminsightsListPrograms**](docs/SystemInsightsApi.md#systeminsightslistprograms) | **Get** /systeminsights/programs | List System Insights Programs +*SystemInsightsApi* | [**SysteminsightsListPythonPackages**](docs/SystemInsightsApi.md#systeminsightslistpythonpackages) | **Get** /systeminsights/python_packages | List System Insights Python Packages +*SystemInsightsApi* | [**SysteminsightsListSafariExtensions**](docs/SystemInsightsApi.md#systeminsightslistsafariextensions) | **Get** /systeminsights/safari_extensions | List System Insights Safari Extensions +*SystemInsightsApi* | [**SysteminsightsListScheduledTasks**](docs/SystemInsightsApi.md#systeminsightslistscheduledtasks) | **Get** /systeminsights/scheduled_tasks | List System Insights Scheduled Tasks +*SystemInsightsApi* | [**SysteminsightsListSecureboot**](docs/SystemInsightsApi.md#systeminsightslistsecureboot) | **Get** /systeminsights/secureboot | List System Insights Secure Boot +*SystemInsightsApi* | [**SysteminsightsListServices**](docs/SystemInsightsApi.md#systeminsightslistservices) | **Get** /systeminsights/services | List System Insights Services +*SystemInsightsApi* | [**SysteminsightsListShadow**](docs/SystemInsightsApi.md#systeminsightslistshadow) | **Get** /systeminsights/shadow | LIst System Insights Shadow +*SystemInsightsApi* | [**SysteminsightsListSharedFolders**](docs/SystemInsightsApi.md#systeminsightslistsharedfolders) | **Get** /systeminsights/shared_folders | List System Insights Shared Folders +*SystemInsightsApi* | [**SysteminsightsListSharedResources**](docs/SystemInsightsApi.md#systeminsightslistsharedresources) | **Get** /systeminsights/shared_resources | List System Insights Shared Resources +*SystemInsightsApi* | [**SysteminsightsListSharingPreferences**](docs/SystemInsightsApi.md#systeminsightslistsharingpreferences) | **Get** /systeminsights/sharing_preferences | List System Insights Sharing Preferences +*SystemInsightsApi* | [**SysteminsightsListSipConfig**](docs/SystemInsightsApi.md#systeminsightslistsipconfig) | **Get** /systeminsights/sip_config | List System Insights SIP Config +*SystemInsightsApi* | [**SysteminsightsListStartupItems**](docs/SystemInsightsApi.md#systeminsightsliststartupitems) | **Get** /systeminsights/startup_items | List System Insights Startup Items +*SystemInsightsApi* | [**SysteminsightsListSystemControls**](docs/SystemInsightsApi.md#systeminsightslistsystemcontrols) | **Get** /systeminsights/system_controls | List System Insights System Control +*SystemInsightsApi* | [**SysteminsightsListSystemInfo**](docs/SystemInsightsApi.md#systeminsightslistsysteminfo) | **Get** /systeminsights/system_info | List System Insights System Info +*SystemInsightsApi* | [**SysteminsightsListTpmInfo**](docs/SystemInsightsApi.md#systeminsightslisttpminfo) | **Get** /systeminsights/tpm_info | List System Insights TPM Info +*SystemInsightsApi* | [**SysteminsightsListUptime**](docs/SystemInsightsApi.md#systeminsightslistuptime) | **Get** /systeminsights/uptime | List System Insights Uptime +*SystemInsightsApi* | [**SysteminsightsListUsbDevices**](docs/SystemInsightsApi.md#systeminsightslistusbdevices) | **Get** /systeminsights/usb_devices | List System Insights USB Devices +*SystemInsightsApi* | [**SysteminsightsListUserGroups**](docs/SystemInsightsApi.md#systeminsightslistusergroups) | **Get** /systeminsights/user_groups | List System Insights User Groups +*SystemInsightsApi* | [**SysteminsightsListUserSshKeys**](docs/SystemInsightsApi.md#systeminsightslistusersshkeys) | **Get** /systeminsights/user_ssh_keys | List System Insights User SSH Keys +*SystemInsightsApi* | [**SysteminsightsListUserassist**](docs/SystemInsightsApi.md#systeminsightslistuserassist) | **Get** /systeminsights/userassist | List System Insights User Assist +*SystemInsightsApi* | [**SysteminsightsListUsers**](docs/SystemInsightsApi.md#systeminsightslistusers) | **Get** /systeminsights/users | List System Insights Users +*SystemInsightsApi* | [**SysteminsightsListWifiNetworks**](docs/SystemInsightsApi.md#systeminsightslistwifinetworks) | **Get** /systeminsights/wifi_networks | List System Insights WiFi Networks +*SystemInsightsApi* | [**SysteminsightsListWifiStatus**](docs/SystemInsightsApi.md#systeminsightslistwifistatus) | **Get** /systeminsights/wifi_status | List System Insights WiFi Status +*SystemInsightsApi* | [**SysteminsightsListWindowsSecurityCenter**](docs/SystemInsightsApi.md#systeminsightslistwindowssecuritycenter) | **Get** /systeminsights/windows_security_center | List System Insights Windows Security Center +*SystemInsightsApi* | [**SysteminsightsListWindowsSecurityProducts**](docs/SystemInsightsApi.md#systeminsightslistwindowssecurityproducts) | **Get** /systeminsights/windows_security_products | List System Insights Windows Security Products +*SystemsApi* | [**GraphSystemAssociationsList**](docs/SystemsApi.md#graphsystemassociationslist) | **Get** /systems/{system_id}/associations | List the associations of a System +*SystemsApi* | [**GraphSystemAssociationsPost**](docs/SystemsApi.md#graphsystemassociationspost) | **Post** /systems/{system_id}/associations | Manage associations of a System +*SystemsApi* | [**GraphSystemMemberOf**](docs/SystemsApi.md#graphsystemmemberof) | **Get** /systems/{system_id}/memberof | List the parent Groups of a System +*SystemsApi* | [**GraphSystemTraverseCommand**](docs/SystemsApi.md#graphsystemtraversecommand) | **Get** /systems/{system_id}/commands | List the Commands bound to a System +*SystemsApi* | [**GraphSystemTraversePolicy**](docs/SystemsApi.md#graphsystemtraversepolicy) | **Get** /systems/{system_id}/policies | List the Policies bound to a System +*SystemsApi* | [**GraphSystemTraversePolicyGroup**](docs/SystemsApi.md#graphsystemtraversepolicygroup) | **Get** /systems/{system_id}/policygroups | List the Policy Groups bound to a System +*SystemsApi* | [**GraphSystemTraverseUser**](docs/SystemsApi.md#graphsystemtraverseuser) | **Get** /systems/{system_id}/users | List the Users bound to a System +*SystemsApi* | [**GraphSystemTraverseUserGroup**](docs/SystemsApi.md#graphsystemtraverseusergroup) | **Get** /systems/{system_id}/usergroups | List the User Groups bound to a System +*SystemsApi* | [**SystemsGetFDEKey**](docs/SystemsApi.md#systemsgetfdekey) | **Get** /systems/{system_id}/fdekey | Get System FDE Key +*SystemsApi* | [**SystemsListSoftwareAppsWithStatuses**](docs/SystemsApi.md#systemslistsoftwareappswithstatuses) | **Get** /systems/{system_id}/softwareappstatuses | List the associated Software Application Statuses of a System +*UserGroupAssociationsApi* | [**GraphUserGroupAssociationsList**](docs/UserGroupAssociationsApi.md#graphusergroupassociationslist) | **Get** /usergroups/{group_id}/associations | List the associations of a User Group. +*UserGroupAssociationsApi* | [**GraphUserGroupAssociationsPost**](docs/UserGroupAssociationsApi.md#graphusergroupassociationspost) | **Post** /usergroups/{group_id}/associations | Manage the associations of a User Group +*UserGroupAssociationsApi* | [**GraphUserGroupTraverseActiveDirectory**](docs/UserGroupAssociationsApi.md#graphusergrouptraverseactivedirectory) | **Get** /usergroups/{group_id}/activedirectories | List the Active Directories bound to a User Group +*UserGroupAssociationsApi* | [**GraphUserGroupTraverseApplication**](docs/UserGroupAssociationsApi.md#graphusergrouptraverseapplication) | **Get** /usergroups/{group_id}/applications | List the Applications bound to a User Group +*UserGroupAssociationsApi* | [**GraphUserGroupTraverseDirectory**](docs/UserGroupAssociationsApi.md#graphusergrouptraversedirectory) | **Get** /usergroups/{group_id}/directories | List the Directories bound to a User Group +*UserGroupAssociationsApi* | [**GraphUserGroupTraverseGSuite**](docs/UserGroupAssociationsApi.md#graphusergrouptraversegsuite) | **Get** /usergroups/{group_id}/gsuites | List the G Suite instances bound to a User Group +*UserGroupAssociationsApi* | [**GraphUserGroupTraverseLdapServer**](docs/UserGroupAssociationsApi.md#graphusergrouptraverseldapserver) | **Get** /usergroups/{group_id}/ldapservers | List the LDAP Servers bound to a User Group +*UserGroupAssociationsApi* | [**GraphUserGroupTraverseOffice365**](docs/UserGroupAssociationsApi.md#graphusergrouptraverseoffice365) | **Get** /usergroups/{group_id}/office365s | List the Office 365 instances bound to a User Group +*UserGroupAssociationsApi* | [**GraphUserGroupTraverseRadiusServer**](docs/UserGroupAssociationsApi.md#graphusergrouptraverseradiusserver) | **Get** /usergroups/{group_id}/radiusservers | List the RADIUS Servers bound to a User Group +*UserGroupAssociationsApi* | [**GraphUserGroupTraverseSystem**](docs/UserGroupAssociationsApi.md#graphusergrouptraversesystem) | **Get** /usergroups/{group_id}/systems | List the Systems bound to a User Group +*UserGroupAssociationsApi* | [**GraphUserGroupTraverseSystemGroup**](docs/UserGroupAssociationsApi.md#graphusergrouptraversesystemgroup) | **Get** /usergroups/{group_id}/systemgroups | List the System Groups bound to User Groups +*UserGroupMembersMembershipApi* | [**GraphUserGroupMembersList**](docs/UserGroupMembersMembershipApi.md#graphusergroupmemberslist) | **Get** /usergroups/{group_id}/members | List the members of a User Group +*UserGroupMembersMembershipApi* | [**GraphUserGroupMembersPost**](docs/UserGroupMembersMembershipApi.md#graphusergroupmemberspost) | **Post** /usergroups/{group_id}/members | Manage the members of a User Group +*UserGroupMembersMembershipApi* | [**GraphUserGroupMembership**](docs/UserGroupMembersMembershipApi.md#graphusergroupmembership) | **Get** /usergroups/{group_id}/membership | List the User Group's membership +*UserGroupsApi* | [**GraphUserGroupAssociationsList**](docs/UserGroupsApi.md#graphusergroupassociationslist) | **Get** /usergroups/{group_id}/associations | List the associations of a User Group. +*UserGroupsApi* | [**GraphUserGroupAssociationsPost**](docs/UserGroupsApi.md#graphusergroupassociationspost) | **Post** /usergroups/{group_id}/associations | Manage the associations of a User Group +*UserGroupsApi* | [**GraphUserGroupMembersList**](docs/UserGroupsApi.md#graphusergroupmemberslist) | **Get** /usergroups/{group_id}/members | List the members of a User Group +*UserGroupsApi* | [**GraphUserGroupMembersPost**](docs/UserGroupsApi.md#graphusergroupmemberspost) | **Post** /usergroups/{group_id}/members | Manage the members of a User Group +*UserGroupsApi* | [**GraphUserGroupMembership**](docs/UserGroupsApi.md#graphusergroupmembership) | **Get** /usergroups/{group_id}/membership | List the User Group's membership +*UserGroupsApi* | [**GraphUserGroupTraverseActiveDirectory**](docs/UserGroupsApi.md#graphusergrouptraverseactivedirectory) | **Get** /usergroups/{group_id}/activedirectories | List the Active Directories bound to a User Group +*UserGroupsApi* | [**GraphUserGroupTraverseApplication**](docs/UserGroupsApi.md#graphusergrouptraverseapplication) | **Get** /usergroups/{group_id}/applications | List the Applications bound to a User Group +*UserGroupsApi* | [**GraphUserGroupTraverseDirectory**](docs/UserGroupsApi.md#graphusergrouptraversedirectory) | **Get** /usergroups/{group_id}/directories | List the Directories bound to a User Group +*UserGroupsApi* | [**GraphUserGroupTraverseGSuite**](docs/UserGroupsApi.md#graphusergrouptraversegsuite) | **Get** /usergroups/{group_id}/gsuites | List the G Suite instances bound to a User Group +*UserGroupsApi* | [**GraphUserGroupTraverseLdapServer**](docs/UserGroupsApi.md#graphusergrouptraverseldapserver) | **Get** /usergroups/{group_id}/ldapservers | List the LDAP Servers bound to a User Group +*UserGroupsApi* | [**GraphUserGroupTraverseOffice365**](docs/UserGroupsApi.md#graphusergrouptraverseoffice365) | **Get** /usergroups/{group_id}/office365s | List the Office 365 instances bound to a User Group +*UserGroupsApi* | [**GraphUserGroupTraverseRadiusServer**](docs/UserGroupsApi.md#graphusergrouptraverseradiusserver) | **Get** /usergroups/{group_id}/radiusservers | List the RADIUS Servers bound to a User Group +*UserGroupsApi* | [**GraphUserGroupTraverseSystem**](docs/UserGroupsApi.md#graphusergrouptraversesystem) | **Get** /usergroups/{group_id}/systems | List the Systems bound to a User Group +*UserGroupsApi* | [**GraphUserGroupTraverseSystemGroup**](docs/UserGroupsApi.md#graphusergrouptraversesystemgroup) | **Get** /usergroups/{group_id}/systemgroups | List the System Groups bound to User Groups +*UserGroupsApi* | [**GroupsSuggestionsGet**](docs/UserGroupsApi.md#groupssuggestionsget) | **Get** /usergroups/{group_id}/suggestions | List Suggestions for a User Group +*UserGroupsApi* | [**GroupsSuggestionsPost**](docs/UserGroupsApi.md#groupssuggestionspost) | **Post** /usergroups/{group_id}/suggestions | List Suggestions for a User Group +*UserGroupsApi* | [**GroupsUserDelete**](docs/UserGroupsApi.md#groupsuserdelete) | **Delete** /usergroups/{id} | Delete a User Group +*UserGroupsApi* | [**GroupsUserGet**](docs/UserGroupsApi.md#groupsuserget) | **Get** /usergroups/{id} | View an individual User Group details +*UserGroupsApi* | [**GroupsUserList**](docs/UserGroupsApi.md#groupsuserlist) | **Get** /usergroups | List all User Groups +*UserGroupsApi* | [**GroupsUserPost**](docs/UserGroupsApi.md#groupsuserpost) | **Post** /usergroups | Create a new User Group +*UserGroupsApi* | [**GroupsUserPut**](docs/UserGroupsApi.md#groupsuserput) | **Put** /usergroups/{id} | Update a User Group +*UsersApi* | [**GraphUserAssociationsList**](docs/UsersApi.md#graphuserassociationslist) | **Get** /users/{user_id}/associations | List the associations of a User +*UsersApi* | [**GraphUserAssociationsPost**](docs/UsersApi.md#graphuserassociationspost) | **Post** /users/{user_id}/associations | Manage the associations of a User +*UsersApi* | [**GraphUserMemberOf**](docs/UsersApi.md#graphusermemberof) | **Get** /users/{user_id}/memberof | List the parent Groups of a User +*UsersApi* | [**GraphUserTraverseActiveDirectory**](docs/UsersApi.md#graphusertraverseactivedirectory) | **Get** /users/{user_id}/activedirectories | List the Active Directory instances bound to a User +*UsersApi* | [**GraphUserTraverseApplication**](docs/UsersApi.md#graphusertraverseapplication) | **Get** /users/{user_id}/applications | List the Applications bound to a User +*UsersApi* | [**GraphUserTraverseDirectory**](docs/UsersApi.md#graphusertraversedirectory) | **Get** /users/{user_id}/directories | List the Directories bound to a User +*UsersApi* | [**GraphUserTraverseGSuite**](docs/UsersApi.md#graphusertraversegsuite) | **Get** /users/{user_id}/gsuites | List the G Suite instances bound to a User +*UsersApi* | [**GraphUserTraverseLdapServer**](docs/UsersApi.md#graphusertraverseldapserver) | **Get** /users/{user_id}/ldapservers | List the LDAP servers bound to a User +*UsersApi* | [**GraphUserTraverseOffice365**](docs/UsersApi.md#graphusertraverseoffice365) | **Get** /users/{user_id}/office365s | List the Office 365 instances bound to a User +*UsersApi* | [**GraphUserTraverseRadiusServer**](docs/UsersApi.md#graphusertraverseradiusserver) | **Get** /users/{user_id}/radiusservers | List the RADIUS Servers bound to a User +*UsersApi* | [**GraphUserTraverseSystem**](docs/UsersApi.md#graphusertraversesystem) | **Get** /users/{user_id}/systems | List the Systems bound to a User +*UsersApi* | [**GraphUserTraverseSystemGroup**](docs/UsersApi.md#graphusertraversesystemgroup) | **Get** /users/{user_id}/systemgroups | List the System Groups bound to a User +*UsersApi* | [**PushEndpointsDelete**](docs/UsersApi.md#pushendpointsdelete) | **Delete** /users/{user_id}/pushendpoints/{push_endpoint_id} | Delete a Push Endpoint associated with a User +*UsersApi* | [**PushEndpointsGet**](docs/UsersApi.md#pushendpointsget) | **Get** /users/{user_id}/pushendpoints/{push_endpoint_id} | Get a push endpoint associated with a User +*UsersApi* | [**PushEndpointsList**](docs/UsersApi.md#pushendpointslist) | **Get** /users/{user_id}/pushendpoints | List Push Endpoints associated with a User +*UsersApi* | [**PushEndpointsPatch**](docs/UsersApi.md#pushendpointspatch) | **Patch** /users/{user_id}/pushendpoints/{push_endpoint_id} | Update a push endpoint associated with a User +*WorkdayImportApi* | [**WorkdaysAuthorize**](docs/WorkdayImportApi.md#workdaysauthorize) | **Post** /workdays/{workday_id}/auth | Authorize Workday +*WorkdayImportApi* | [**WorkdaysDeauthorize**](docs/WorkdayImportApi.md#workdaysdeauthorize) | **Delete** /workdays/{workday_id}/auth | Deauthorize Workday +*WorkdayImportApi* | [**WorkdaysGet**](docs/WorkdayImportApi.md#workdaysget) | **Get** /workdays/{id} | Get Workday +*WorkdayImportApi* | [**WorkdaysImport**](docs/WorkdayImportApi.md#workdaysimport) | **Post** /workdays/{workday_id}/import | Workday Import +*WorkdayImportApi* | [**WorkdaysImportresults**](docs/WorkdayImportApi.md#workdaysimportresults) | **Get** /workdays/{id}/import/{job_id}/results | List Import Results +*WorkdayImportApi* | [**WorkdaysList**](docs/WorkdayImportApi.md#workdayslist) | **Get** /workdays | List Workdays +*WorkdayImportApi* | [**WorkdaysPost**](docs/WorkdayImportApi.md#workdayspost) | **Post** /workdays | Create new Workday +*WorkdayImportApi* | [**WorkdaysPut**](docs/WorkdayImportApi.md#workdaysput) | **Put** /workdays/{id} | Update Workday +*WorkdayImportApi* | [**WorkdaysWorkers**](docs/WorkdayImportApi.md#workdaysworkers) | **Get** /workdays/{workday_id}/workers | List Workday Workers + +## Documentation For Models + + - [ActiveDirectoryAgentGetOutput](docs/ActiveDirectoryAgentGetOutput.md) + - [ActiveDirectoryAgentInput](docs/ActiveDirectoryAgentInput.md) + - [ActiveDirectoryAgentListOutput](docs/ActiveDirectoryAgentListOutput.md) + - [ActiveDirectoryInput](docs/ActiveDirectoryInput.md) + - [ActiveDirectoryOutput](docs/ActiveDirectoryOutput.md) + - [Address](docs/Address.md) + - [Ade](docs/Ade.md) + - [Ades](docs/Ades.md) + - [Administrator](docs/Administrator.md) + - [AdministratorOrganizationLink](docs/AdministratorOrganizationLink.md) + - [AdministratorOrganizationLinkReq](docs/AdministratorOrganizationLinkReq.md) + - [AllOfAutotaskTicketingAlertConfigurationListRecordsItems](docs/AllOfAutotaskTicketingAlertConfigurationListRecordsItems.md) + - [AllOfConnectWiseTicketingAlertConfigurationListRecordsItems](docs/AllOfConnectWiseTicketingAlertConfigurationListRecordsItems.md) + - [AnyValue](docs/AnyValue.md) + - [AppleMdm](docs/AppleMdm.md) + - [AppleMdmDevice](docs/AppleMdmDevice.md) + - [AppleMdmDeviceInfo](docs/AppleMdmDeviceInfo.md) + - [AppleMdmDeviceSecurityInfo](docs/AppleMdmDeviceSecurityInfo.md) + - [AppleMdmPatchInput](docs/AppleMdmPatchInput.md) + - [ApplicationIdLogoBody](docs/ApplicationIdLogoBody.md) + - [AuthInfo](docs/AuthInfo.md) + - [AuthInput](docs/AuthInput.md) + - [AuthInputObject](docs/AuthInputObject.md) + - [AuthinputBasic](docs/AuthinputBasic.md) + - [AuthinputOauth](docs/AuthinputOauth.md) + - [AuthnPolicy](docs/AuthnPolicy.md) + - [AuthnPolicyEffect](docs/AuthnPolicyEffect.md) + - [AuthnPolicyInput](docs/AuthnPolicyInput.md) + - [AuthnPolicyObligations](docs/AuthnPolicyObligations.md) + - [AuthnPolicyObligationsMfa](docs/AuthnPolicyObligationsMfa.md) + - [AuthnPolicyObligationsUserVerification](docs/AuthnPolicyObligationsUserVerification.md) + - [AuthnPolicyResourceTarget](docs/AuthnPolicyResourceTarget.md) + - [AuthnPolicyTargets](docs/AuthnPolicyTargets.md) + - [AuthnPolicyType](docs/AuthnPolicyType.md) + - [AuthnPolicyUserAttributeFilter](docs/AuthnPolicyUserAttributeFilter.md) + - [AuthnPolicyUserAttributeTarget](docs/AuthnPolicyUserAttributeTarget.md) + - [AuthnPolicyUserGroupTarget](docs/AuthnPolicyUserGroupTarget.md) + - [AuthnPolicyUserTarget](docs/AuthnPolicyUserTarget.md) + - [AutotaskCompany](docs/AutotaskCompany.md) + - [AutotaskCompanyResp](docs/AutotaskCompanyResp.md) + - [AutotaskCompanyTypeResp](docs/AutotaskCompanyTypeResp.md) + - [AutotaskContract](docs/AutotaskContract.md) + - [AutotaskContractField](docs/AutotaskContractField.md) + - [AutotaskContractFieldValues](docs/AutotaskContractFieldValues.md) + - [AutotaskIntegration](docs/AutotaskIntegration.md) + - [AutotaskIntegrationPatchReq](docs/AutotaskIntegrationPatchReq.md) + - [AutotaskIntegrationReq](docs/AutotaskIntegrationReq.md) + - [AutotaskMappingRequest](docs/AutotaskMappingRequest.md) + - [AutotaskMappingRequestCompany](docs/AutotaskMappingRequestCompany.md) + - [AutotaskMappingRequestContract](docs/AutotaskMappingRequestContract.md) + - [AutotaskMappingRequestData](docs/AutotaskMappingRequestData.md) + - [AutotaskMappingRequestOrganization](docs/AutotaskMappingRequestOrganization.md) + - [AutotaskMappingRequestService](docs/AutotaskMappingRequestService.md) + - [AutotaskMappingResponse](docs/AutotaskMappingResponse.md) + - [AutotaskMappingResponseCompany](docs/AutotaskMappingResponseCompany.md) + - [AutotaskMappingResponseContract](docs/AutotaskMappingResponseContract.md) + - [AutotaskMappingResponseOrganization](docs/AutotaskMappingResponseOrganization.md) + - [AutotaskMappingResponseService](docs/AutotaskMappingResponseService.md) + - [AutotaskService](docs/AutotaskService.md) + - [AutotaskSettings](docs/AutotaskSettings.md) + - [AutotaskSettingsPatchReq](docs/AutotaskSettingsPatchReq.md) + - [AutotaskTicketingAlertConfiguration](docs/AutotaskTicketingAlertConfiguration.md) + - [AutotaskTicketingAlertConfigurationList](docs/AutotaskTicketingAlertConfigurationList.md) + - [AutotaskTicketingAlertConfigurationOption](docs/AutotaskTicketingAlertConfigurationOption.md) + - [AutotaskTicketingAlertConfigurationOptionValues](docs/AutotaskTicketingAlertConfigurationOptionValues.md) + - [AutotaskTicketingAlertConfigurationOptions](docs/AutotaskTicketingAlertConfigurationOptions.md) + - [AutotaskTicketingAlertConfigurationPriority](docs/AutotaskTicketingAlertConfigurationPriority.md) + - [AutotaskTicketingAlertConfigurationRequest](docs/AutotaskTicketingAlertConfigurationRequest.md) + - [AutotaskTicketingAlertConfigurationResource](docs/AutotaskTicketingAlertConfigurationResource.md) + - [BillingIntegrationCompanyType](docs/BillingIntegrationCompanyType.md) + - [BulkScheduledStatechangeCreate](docs/BulkScheduledStatechangeCreate.md) + - [BulkUserCreate](docs/BulkUserCreate.md) + - [BulkUserUpdate](docs/BulkUserUpdate.md) + - [CommandResultList](docs/CommandResultList.md) + - [CommandResultListResults](docs/CommandResultListResults.md) + - [ConnectWiseMappingRequest](docs/ConnectWiseMappingRequest.md) + - [ConnectWiseMappingRequestCompany](docs/ConnectWiseMappingRequestCompany.md) + - [ConnectWiseMappingRequestData](docs/ConnectWiseMappingRequestData.md) + - [ConnectWiseMappingRequestOrganization](docs/ConnectWiseMappingRequestOrganization.md) + - [ConnectWiseMappingResponse](docs/ConnectWiseMappingResponse.md) + - [ConnectWiseMappingResponseAddition](docs/ConnectWiseMappingResponseAddition.md) + - [ConnectWiseSettings](docs/ConnectWiseSettings.md) + - [ConnectWiseSettingsPatchReq](docs/ConnectWiseSettingsPatchReq.md) + - [ConnectWiseTicketingAlertConfiguration](docs/ConnectWiseTicketingAlertConfiguration.md) + - [ConnectWiseTicketingAlertConfigurationList](docs/ConnectWiseTicketingAlertConfigurationList.md) + - [ConnectWiseTicketingAlertConfigurationOption](docs/ConnectWiseTicketingAlertConfigurationOption.md) + - [ConnectWiseTicketingAlertConfigurationOptions](docs/ConnectWiseTicketingAlertConfigurationOptions.md) + - [ConnectWiseTicketingAlertConfigurationRequest](docs/ConnectWiseTicketingAlertConfigurationRequest.md) + - [ConnectwiseAddition](docs/ConnectwiseAddition.md) + - [ConnectwiseAgreement](docs/ConnectwiseAgreement.md) + - [ConnectwiseCompany](docs/ConnectwiseCompany.md) + - [ConnectwiseCompanyResp](docs/ConnectwiseCompanyResp.md) + - [ConnectwiseCompanyTypeResp](docs/ConnectwiseCompanyTypeResp.md) + - [ConnectwiseIntegration](docs/ConnectwiseIntegration.md) + - [ConnectwiseIntegrationPatchReq](docs/ConnectwiseIntegrationPatchReq.md) + - [ConnectwiseIntegrationReq](docs/ConnectwiseIntegrationReq.md) + - [CustomEmail](docs/CustomEmail.md) + - [CustomEmailTemplate](docs/CustomEmailTemplate.md) + - [CustomEmailTemplateField](docs/CustomEmailTemplateField.md) + - [CustomEmailType](docs/CustomEmailType.md) + - [Dep](docs/Dep.md) + - [DepSetupAssistantOption](docs/DepSetupAssistantOption.md) + - [DepWelcomeScreen](docs/DepWelcomeScreen.md) + - [DeviceIdEraseBody](docs/DeviceIdEraseBody.md) + - [DeviceIdLockBody](docs/DeviceIdLockBody.md) + - [DeviceIdRestartBody](docs/DeviceIdRestartBody.md) + - [Directory](docs/Directory.md) + - [DuoAccount](docs/DuoAccount.md) + - [DuoApplication](docs/DuoApplication.md) + - [DuoApplicationReq](docs/DuoApplicationReq.md) + - [DuoApplicationUpdateReq](docs/DuoApplicationUpdateReq.md) + - [ErrorDetails](docs/ErrorDetails.md) + - [Feature](docs/Feature.md) + - [Filter](docs/Filter.md) + - [FilterQuery](docs/FilterQuery.md) + - [GSuiteBuiltinTranslation](docs/GSuiteBuiltinTranslation.md) + - [GSuiteDirectionTranslation](docs/GSuiteDirectionTranslation.md) + - [GSuiteTranslationRule](docs/GSuiteTranslationRule.md) + - [GSuiteTranslationRuleRequest](docs/GSuiteTranslationRuleRequest.md) + - [GraphAttributeLdapGroups](docs/GraphAttributeLdapGroups.md) + - [GraphAttributePosixGroups](docs/GraphAttributePosixGroups.md) + - [GraphAttributePosixGroupsPosixGroups](docs/GraphAttributePosixGroupsPosixGroups.md) + - [GraphAttributeRadius](docs/GraphAttributeRadius.md) + - [GraphAttributeRadiusRadius](docs/GraphAttributeRadiusRadius.md) + - [GraphAttributeRadiusRadiusReply](docs/GraphAttributeRadiusRadiusReply.md) + - [GraphAttributeSambaEnabled](docs/GraphAttributeSambaEnabled.md) + - [GraphAttributeSudo](docs/GraphAttributeSudo.md) + - [GraphAttributeSudoSudo](docs/GraphAttributeSudoSudo.md) + - [GraphAttributes](docs/GraphAttributes.md) + - [GraphConnection](docs/GraphConnection.md) + - [GraphObject](docs/GraphObject.md) + - [GraphObjectWithPaths](docs/GraphObjectWithPaths.md) + - [GraphOperation](docs/GraphOperation.md) + - [GraphOperationActiveDirectory](docs/GraphOperationActiveDirectory.md) + - [GraphOperationApplication](docs/GraphOperationApplication.md) + - [GraphOperationCommand](docs/GraphOperationCommand.md) + - [GraphOperationGSuite](docs/GraphOperationGSuite.md) + - [GraphOperationLdapServer](docs/GraphOperationLdapServer.md) + - [GraphOperationOffice365](docs/GraphOperationOffice365.md) + - [GraphOperationPolicy](docs/GraphOperationPolicy.md) + - [GraphOperationPolicyGroup](docs/GraphOperationPolicyGroup.md) + - [GraphOperationPolicyGroupMember](docs/GraphOperationPolicyGroupMember.md) + - [GraphOperationRadiusServer](docs/GraphOperationRadiusServer.md) + - [GraphOperationSoftwareApp](docs/GraphOperationSoftwareApp.md) + - [GraphOperationSystem](docs/GraphOperationSystem.md) + - [GraphOperationSystemGroup](docs/GraphOperationSystemGroup.md) + - [GraphOperationSystemGroupMember](docs/GraphOperationSystemGroupMember.md) + - [GraphOperationUser](docs/GraphOperationUser.md) + - [GraphOperationUserGroup](docs/GraphOperationUserGroup.md) + - [GraphOperationUserGroupMember](docs/GraphOperationUserGroupMember.md) + - [GraphType](docs/GraphType.md) + - [Group](docs/Group.md) + - [GroupAttributesUserGroup](docs/GroupAttributesUserGroup.md) + - [GroupIdSuggestionsBody](docs/GroupIdSuggestionsBody.md) + - [GroupType](docs/GroupType.md) + - [GsuiteOutput](docs/GsuiteOutput.md) + - [GsuitePatchInput](docs/GsuitePatchInput.md) + - [ImportUser](docs/ImportUser.md) + - [ImportUserAddress](docs/ImportUserAddress.md) + - [ImportUserPhoneNumber](docs/ImportUserPhoneNumber.md) + - [ImportUsersResponse](docs/ImportUsersResponse.md) + - [InlineResponse200](docs/InlineResponse200.md) + - [InlineResponse2001](docs/InlineResponse2001.md) + - [InlineResponse20010](docs/InlineResponse20010.md) + - [InlineResponse20011](docs/InlineResponse20011.md) + - [InlineResponse20011Users](docs/InlineResponse20011Users.md) + - [InlineResponse20012](docs/InlineResponse20012.md) + - [InlineResponse20013](docs/InlineResponse20013.md) + - [InlineResponse2002](docs/InlineResponse2002.md) + - [InlineResponse2002Users](docs/InlineResponse2002Users.md) + - [InlineResponse2003](docs/InlineResponse2003.md) + - [InlineResponse2004](docs/InlineResponse2004.md) + - [InlineResponse2005](docs/InlineResponse2005.md) + - [InlineResponse2006](docs/InlineResponse2006.md) + - [InlineResponse2007](docs/InlineResponse2007.md) + - [InlineResponse2008](docs/InlineResponse2008.md) + - [InlineResponse2009](docs/InlineResponse2009.md) + - [InlineResponse201](docs/InlineResponse201.md) + - [InlineResponse400](docs/InlineResponse400.md) + - [Integration](docs/Integration.md) + - [IntegrationSyncError](docs/IntegrationSyncError.md) + - [IntegrationSyncErrorResp](docs/IntegrationSyncErrorResp.md) + - [IntegrationType](docs/IntegrationType.md) + - [IntegrationsResponse](docs/IntegrationsResponse.md) + - [IpList](docs/IpList.md) + - [IpListRequest](docs/IpListRequest.md) + - [JobId](docs/JobId.md) + - [JobWorkresult](docs/JobWorkresult.md) + - [LdapGroup](docs/LdapGroup.md) + - [LdapServerAction](docs/LdapServerAction.md) + - [LdapServerInput](docs/LdapServerInput.md) + - [LdapServerOutput](docs/LdapServerOutput.md) + - [LdapserversIdBody](docs/LdapserversIdBody.md) + - [MemberSuggestion](docs/MemberSuggestion.md) + - [MemberSuggestionsPostResult](docs/MemberSuggestionsPostResult.md) + - [ModelError](docs/ModelError.md) + - [Office365BuiltinTranslation](docs/Office365BuiltinTranslation.md) + - [Office365DirectionTranslation](docs/Office365DirectionTranslation.md) + - [Office365Output](docs/Office365Output.md) + - [Office365PatchInput](docs/Office365PatchInput.md) + - [Office365TranslationRule](docs/Office365TranslationRule.md) + - [Office365TranslationRuleRequest](docs/Office365TranslationRuleRequest.md) + - [Organization](docs/Organization.md) + - [OrganizationCase](docs/OrganizationCase.md) + - [OrganizationCasesResponse](docs/OrganizationCasesResponse.md) + - [OsRestriction](docs/OsRestriction.md) + - [OsRestrictionAppleRestrictions](docs/OsRestrictionAppleRestrictions.md) + - [PhoneNumber](docs/PhoneNumber.md) + - [Policy](docs/Policy.md) + - [PolicyGroup](docs/PolicyGroup.md) + - [PolicyGroupData](docs/PolicyGroupData.md) + - [PolicyRequest](docs/PolicyRequest.md) + - [PolicyRequestTemplate](docs/PolicyRequestTemplate.md) + - [PolicyResult](docs/PolicyResult.md) + - [PolicyTemplate](docs/PolicyTemplate.md) + - [PolicyTemplateConfigField](docs/PolicyTemplateConfigField.md) + - [PolicyTemplateConfigFieldTooltip](docs/PolicyTemplateConfigFieldTooltip.md) + - [PolicyTemplateConfigFieldTooltipVariables](docs/PolicyTemplateConfigFieldTooltipVariables.md) + - [PolicyTemplateWithDetails](docs/PolicyTemplateWithDetails.md) + - [PolicyValue](docs/PolicyValue.md) + - [PolicyWithDetails](docs/PolicyWithDetails.md) + - [Provider](docs/Provider.md) + - [ProviderAdminReq](docs/ProviderAdminReq.md) + - [ProviderInvoice](docs/ProviderInvoice.md) + - [ProviderInvoiceResponse](docs/ProviderInvoiceResponse.md) + - [PushEndpointResponse](docs/PushEndpointResponse.md) + - [PushEndpointResponseDevice](docs/PushEndpointResponseDevice.md) + - [PushendpointsPushEndpointIdBody](docs/PushendpointsPushEndpointIdBody.md) + - [PwmAllUsers](docs/PwmAllUsers.md) + - [PwmAllUsersGroups](docs/PwmAllUsersGroups.md) + - [PwmAllUsersResults](docs/PwmAllUsersResults.md) + - [PwmOverviewAppVersions](docs/PwmOverviewAppVersions.md) + - [PwmOverviewAppVersionsResults](docs/PwmOverviewAppVersionsResults.md) + - [PwmOverviewMain](docs/PwmOverviewMain.md) + - [PwmOverviewMainDevices](docs/PwmOverviewMainDevices.md) + - [Query](docs/Query.md) + - [QueuedCommandList](docs/QueuedCommandList.md) + - [QueuedCommandListResults](docs/QueuedCommandListResults.md) + - [SambaDomainInput](docs/SambaDomainInput.md) + - [SambaDomainOutput](docs/SambaDomainOutput.md) + - [ScheduledUserstateResult](docs/ScheduledUserstateResult.md) + - [SetupAssistantOption](docs/SetupAssistantOption.md) + - [SharedFolderAccessLevels](docs/SharedFolderAccessLevels.md) + - [SharedFolderAccessLevelsResults](docs/SharedFolderAccessLevelsResults.md) + - [SharedFolderDetails](docs/SharedFolderDetails.md) + - [SharedFolderUsers](docs/SharedFolderUsers.md) + - [SharedFolderUsersResults](docs/SharedFolderUsersResults.md) + - [SharedFoldersList](docs/SharedFoldersList.md) + - [SharedFoldersListResults](docs/SharedFoldersListResults.md) + - [SoftwareApp](docs/SoftwareApp.md) + - [SoftwareAppAppleVpp](docs/SoftwareAppAppleVpp.md) + - [SoftwareAppReclaimLicenses](docs/SoftwareAppReclaimLicenses.md) + - [SoftwareAppSettings](docs/SoftwareAppSettings.md) + - [SoftwareAppStatus](docs/SoftwareAppStatus.md) + - [SoftwareAppWithStatus](docs/SoftwareAppWithStatus.md) + - [SoftwareAppsRetryInstallationRequest](docs/SoftwareAppsRetryInstallationRequest.md) + - [Subscription](docs/Subscription.md) + - [SuggestionCounts](docs/SuggestionCounts.md) + - [SystemGroup](docs/SystemGroup.md) + - [SystemGroupData](docs/SystemGroupData.md) + - [SystemInsightsAlf](docs/SystemInsightsAlf.md) + - [SystemInsightsAlfExceptions](docs/SystemInsightsAlfExceptions.md) + - [SystemInsightsAlfExplicitAuths](docs/SystemInsightsAlfExplicitAuths.md) + - [SystemInsightsAppcompatShims](docs/SystemInsightsAppcompatShims.md) + - [SystemInsightsApps](docs/SystemInsightsApps.md) + - [SystemInsightsAuthorizedKeys](docs/SystemInsightsAuthorizedKeys.md) + - [SystemInsightsAzureInstanceMetadata](docs/SystemInsightsAzureInstanceMetadata.md) + - [SystemInsightsAzureInstanceTags](docs/SystemInsightsAzureInstanceTags.md) + - [SystemInsightsBattery](docs/SystemInsightsBattery.md) + - [SystemInsightsBitlockerInfo](docs/SystemInsightsBitlockerInfo.md) + - [SystemInsightsBrowserPlugins](docs/SystemInsightsBrowserPlugins.md) + - [SystemInsightsCertificates](docs/SystemInsightsCertificates.md) + - [SystemInsightsChassisInfo](docs/SystemInsightsChassisInfo.md) + - [SystemInsightsChromeExtensions](docs/SystemInsightsChromeExtensions.md) + - [SystemInsightsConnectivity](docs/SystemInsightsConnectivity.md) + - [SystemInsightsCrashes](docs/SystemInsightsCrashes.md) + - [SystemInsightsCupsDestinations](docs/SystemInsightsCupsDestinations.md) + - [SystemInsightsDiskEncryption](docs/SystemInsightsDiskEncryption.md) + - [SystemInsightsDiskInfo](docs/SystemInsightsDiskInfo.md) + - [SystemInsightsDnsResolvers](docs/SystemInsightsDnsResolvers.md) + - [SystemInsightsEtcHosts](docs/SystemInsightsEtcHosts.md) + - [SystemInsightsFirefoxAddons](docs/SystemInsightsFirefoxAddons.md) + - [SystemInsightsGroups](docs/SystemInsightsGroups.md) + - [SystemInsightsIeExtensions](docs/SystemInsightsIeExtensions.md) + - [SystemInsightsInterfaceAddresses](docs/SystemInsightsInterfaceAddresses.md) + - [SystemInsightsInterfaceDetails](docs/SystemInsightsInterfaceDetails.md) + - [SystemInsightsKernelInfo](docs/SystemInsightsKernelInfo.md) + - [SystemInsightsLaunchd](docs/SystemInsightsLaunchd.md) + - [SystemInsightsLinuxPackages](docs/SystemInsightsLinuxPackages.md) + - [SystemInsightsLoggedInUsers](docs/SystemInsightsLoggedInUsers.md) + - [SystemInsightsLogicalDrives](docs/SystemInsightsLogicalDrives.md) + - [SystemInsightsManagedPolicies](docs/SystemInsightsManagedPolicies.md) + - [SystemInsightsMounts](docs/SystemInsightsMounts.md) + - [SystemInsightsOsVersion](docs/SystemInsightsOsVersion.md) + - [SystemInsightsPatches](docs/SystemInsightsPatches.md) + - [SystemInsightsPrograms](docs/SystemInsightsPrograms.md) + - [SystemInsightsPythonPackages](docs/SystemInsightsPythonPackages.md) + - [SystemInsightsSafariExtensions](docs/SystemInsightsSafariExtensions.md) + - [SystemInsightsScheduledTasks](docs/SystemInsightsScheduledTasks.md) + - [SystemInsightsSecureboot](docs/SystemInsightsSecureboot.md) + - [SystemInsightsServices](docs/SystemInsightsServices.md) + - [SystemInsightsShadow](docs/SystemInsightsShadow.md) + - [SystemInsightsSharedFolders](docs/SystemInsightsSharedFolders.md) + - [SystemInsightsSharedResources](docs/SystemInsightsSharedResources.md) + - [SystemInsightsSharingPreferences](docs/SystemInsightsSharingPreferences.md) + - [SystemInsightsSipConfig](docs/SystemInsightsSipConfig.md) + - [SystemInsightsStartupItems](docs/SystemInsightsStartupItems.md) + - [SystemInsightsSystemControls](docs/SystemInsightsSystemControls.md) + - [SystemInsightsSystemInfo](docs/SystemInsightsSystemInfo.md) + - [SystemInsightsTpmInfo](docs/SystemInsightsTpmInfo.md) + - [SystemInsightsUptime](docs/SystemInsightsUptime.md) + - [SystemInsightsUsbDevices](docs/SystemInsightsUsbDevices.md) + - [SystemInsightsUserGroups](docs/SystemInsightsUserGroups.md) + - [SystemInsightsUserSshKeys](docs/SystemInsightsUserSshKeys.md) + - [SystemInsightsUserassist](docs/SystemInsightsUserassist.md) + - [SystemInsightsUsers](docs/SystemInsightsUsers.md) + - [SystemInsightsWifiNetworks](docs/SystemInsightsWifiNetworks.md) + - [SystemInsightsWifiStatus](docs/SystemInsightsWifiStatus.md) + - [SystemInsightsWindowsSecurityCenter](docs/SystemInsightsWindowsSecurityCenter.md) + - [SystemInsightsWindowsSecurityProducts](docs/SystemInsightsWindowsSecurityProducts.md) + - [Systemfdekey](docs/Systemfdekey.md) + - [TicketingIntegrationAlert](docs/TicketingIntegrationAlert.md) + - [TicketingIntegrationAlertsResp](docs/TicketingIntegrationAlertsResp.md) + - [User](docs/User.md) + - [UserGroup](docs/UserGroup.md) + - [UserGroupPost](docs/UserGroupPost.md) + - [UserGroupPut](docs/UserGroupPut.md) + - [WorkdayFields](docs/WorkdayFields.md) + - [WorkdayInput](docs/WorkdayInput.md) + - [WorkdayOutput](docs/WorkdayOutput.md) + - [WorkdayWorker](docs/WorkdayWorker.md) + - [WorkdayoutputAuth](docs/WorkdayoutputAuth.md) + +## Documentation For Authorization + +## x-api-key +- **Type**: API key + +Example +```golang +auth := context.WithValue(context.Background(), sw.ContextAPIKey, sw.APIKey{ + Key: "APIKEY", + Prefix: "Bearer", // Omit if not necessary. +}) +r, err := client.Service.Operation(auth, args) +``` + +## Author + +support@jumpcloud.com diff --git a/jcapiv2/api/swagger.yaml b/jcapiv2/api/swagger.yaml new file mode 100644 index 0000000..3926d18 --- /dev/null +++ b/jcapiv2/api/swagger.yaml @@ -0,0 +1,39122 @@ +openapi: 3.0.1 +info: + title: JumpCloud API + description: "# Overview\n\nJumpCloud's V2 API. This set of endpoints allows JumpCloud\ + \ customers to manage objects, groupings and mappings and interact with the JumpCloud\ + \ Graph.\n\n# Directory Objects\n\nThis API offers the ability to interact with\ + \ some of our core features; otherwise known as Directory Objects. The Directory\ + \ Objects are:\n\n* Commands\n* Policies\n* Policy Groups\n* Applications\n* Systems\n\ + * Users\n* User Groups\n* System Groups\n* Radius Servers\n* Directories: Office\ + \ 365, LDAP,G-Suite, Active Directory\n* Duo accounts and applications.\n\nThe\ + \ Directory Object is an important concept to understand in order to successfully\ + \ use JumpCloud API.\n\n## JumpCloud Graph\n\nWe've also introduced the concept\ + \ of the JumpCloud Graph along with Directory Objects. The Graph is a powerful\ + \ aspect of our platform which will enable you to associate objects with each\ + \ other, or establish membership for certain objects to become members of other\ + \ objects.\n\nSpecific `GET` endpoints will allow you to traverse the JumpCloud\ + \ Graph to return all indirect and directly bound objects in your organization.\n\ + \n| ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png\ + \ \"JumpCloud Graph Model Example\") |\n|:--:|\n| **This diagram highlights our\ + \ association and membership model as it relates to Directory Objects.** |\n\n\ + # API Key\n\n## Access Your API Key\n\nTo locate your API Key:\n\n1. Log into\ + \ the [JumpCloud Admin Console](https://console.jumpcloud.com/).\n2. Go to the\ + \ username drop down located in the top-right of the Console.\n3. Retrieve your\ + \ API key from API Settings.\n\n## API Key Considerations\n\nThis API key is associated\ + \ to the currently logged in administrator. Other admins will have different API\ + \ keys.\n\n**WARNING** Please keep this API key secret, as it grants full access\ + \ to any data accessible via your JumpCloud console account.\n\nYou can also reset\ + \ your API key in the same location in the JumpCloud Admin Console.\n\n## Recycling\ + \ or Resetting Your API Key\n\nIn order to revoke access with the current API\ + \ key, simply reset your API key. This will render all calls using the previous\ + \ API key inaccessible.\n\nYour API key will be passed in as a header with the\ + \ header name \"x-api-key\".\n\n```bash\ncurl -H \"x-api-key: [YOUR_API_KEY_HERE]\"\ + \ \"https://console.jumpcloud.com/api/v2/systemgroups\"\n```\n\n# System Context\n\ + \n* [Introduction](#introduction)\n* [Supported endpoints](#supported-endpoints)\n\ + * [Response codes](#response-codes)\n* [Authentication](#authentication)\n* [Additional\ + \ examples](#additional-examples)\n* [Third party](#third-party)\n\n## Introduction\n\ + \nJumpCloud System Context Authorization is an alternative way to authenticate\ + \ with a subset of JumpCloud's REST APIs. Using this method, a system can manage\ + \ its information and resource associations, allowing modern auto provisioning\ + \ environments to scale as needed.\n\n**Notes:**\n\n * The following documentation\ + \ applies to Linux Operating Systems only.\n * Systems that have been automatically\ + \ enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using\ + \ the User Portal install are not eligible to use the System Context API to prevent\ + \ unauthorized access to system groups and resources. If a script that utilizes\ + \ the System Context API is invoked on a system enrolled in this way, it will\ + \ display an error.\n\n## Supported Endpoints\n\nJumpCloud System Context Authorization\ + \ can be used in conjunction with Systems endpoints found in the V1 API and certain\ + \ System Group endpoints found in the v2 API.\n\n* A system may fetch, alter,\ + \ and delete metadata about itself, including manipulating a system's Group and\ + \ Systemuser associations,\n * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get)\ + \ [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put)\n\ + * A system may delete itself from your JumpCloud organization\n * `/api/systems/{system_id}`\ + \ | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete)\n\ + * A system may fetch its direct resource associations under v2 (Groups)\n * `/api/v2/systems/{system_id}/memberof`\ + \ | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership)\n\ + \ * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList)\n\ + \ * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser)\n\ + * A system may alter its direct resource associations under v2 (Groups)\n * `/api/v2/systems/{system_id}/associations`\ + \ | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost)\n\ + * A system may alter its System Group associations\n * `/api/v2/systemgroups/{group_id}/members`\ + \ | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost)\n\ + \ * _NOTE_ If a system attempts to alter the system group membership of a different\ + \ system the request will be rejected\n\n## Response Codes\n\nIf endpoints other\ + \ than those described above are called using the System Context API, the server\ + \ will return a `401` response.\n\n## Authentication\n\nTo allow for secure access\ + \ to our APIs, you must authenticate each API request.\nJumpCloud System Context\ + \ Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00)\ + \ to authenticate API requests.\nThe HTTP Signatures sent with each request are\ + \ similar to the signatures used by the Amazon Web Services REST API.\nTo help\ + \ with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh).\ + \ This example API request simply requests the entire system record. You must\ + \ be root, or have permissions to access the contents of the `/opt/jc` directory\ + \ to generate a signature.\n\nHere is a breakdown of the example script with explanations.\n\ + \nFirst, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf`\ + \ file.\n\n```bash\n#!/bin/bash\nconf=\"`cat /opt/jc/jcagent.conf`\"\nregex=\"\ + systemKey\\\":\\\"(\\w+)\\\"\"\n\nif [[ $conf =~ $regex ]] ; then\n systemKey=\"\ + ${BASH_REMATCH[1]}\"\nfi\n```\n\nThen, the script retrieves the current date in\ + \ the correct format.\n\n```bash\nnow=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"\ + `;\n```\n\nNext, we build a signing string to demonstrate the expected signature\ + \ format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35)\ + \ and the date header, separated by a newline character.\n\n```bash\nsignstr=\"\ + GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\"\n```\n\nThe next step\ + \ is to calculate and apply the signature. This is a two-step process:\n\n1. Create\ + \ a signature from the signing string using the JumpCloud Agent private key: ``printf\ + \ \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key``\n2. Then Base64-encode\ + \ the signature string and trim off the newline characters: ``| openssl enc -e\ + \ -a | tr -d '\\n'``\n\nThe combined steps above result in:\n\n```bash\nsignature=`printf\ + \ \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e\ + \ -a | tr -d '\\n'` ;\n```\n\nFinally, we make sure the API call sending the signature\ + \ has the same Authorization and Date header values, HTTP method, and URL that\ + \ were used in the signing string.\n\n```bash\ncurl -iq \\\n -H \"Accept: application/json\"\ + \ \\\n -H \"Content-Type: application/json\" \\\n -H \"Date: ${now}\" \\\n \ + \ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"\ + request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\ + \"\" \\\n --url https://console.jumpcloud.com/api/systems/${systemKey}\n```\n\ + \n### Input Data\n\nAll PUT and POST methods should use the HTTP Content-Type\ + \ header with a value of 'application/json'. PUT methods are used for updating\ + \ a record. POST methods are used to create a record.\n\nThe following example\ + \ demonstrates how to update the `displayName` of the system.\n\n```bash\nsignstr=\"\ + PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\"\nsignature=`printf \"\ + $signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a\ + \ | tr -d '\\n'` ;\n\ncurl -iq \\\n -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\ + \"}\" \\\n -X \"PUT\" \\\n -H \"Content-Type: application/json\" \\\n -H \"\ + Accept: application/json\" \\\n -H \"Date: ${now}\" \\\n -H \"Authorization:\ + \ Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\"\ + ,algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\\n --url https://console.jumpcloud.com/api/systems/${systemKey}\n\ + ```\n\n### Output Data\n\nAll results will be formatted as JSON.\n\nHere is an\ + \ abbreviated example of response output:\n\n```json\n{\n \"_id\": \"525ee96f52e144993e000015\"\ + ,\n \"agentServer\": \"lappy386\",\n \"agentVersion\": \"0.9.42\",\n \"arch\"\ + : \"x86_64\",\n \"connectionKey\": \"127.0.0.1_51812\",\n \"displayName\": \"\ + ubuntu-1204\",\n \"firstContact\": \"2013-10-16T19:30:55.611Z\",\n \"hostname\"\ + : \"ubuntu-1204\"\n ...\n```\n\n## Additional Examples\n\n### Signing Authentication\ + \ Example\n\nThis example demonstrates how to make an authenticated request to\ + \ fetch the JumpCloud record for this system.\n\n[SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh)\n\ + \n### Shutdown Hook\n\nThis example demonstrates how to make an authenticated\ + \ request on system shutdown.\nUsing an init.d script registered at run level\ + \ 0, you can call the System Context API as the system is shutting down.\n\n[Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd)\ + \ is an example of an init.d script that only runs at system shutdown.\n\nAfter\ + \ customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd)\ + \ script, you should install it on the system(s) running the JumpCloud agent.\n\ + \n1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd)\ + \ to `/etc/init.d/instance-shutdown`.\n2. On Ubuntu systems, run `update-rc.d\ + \ instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add\ + \ instance-shutdown`.\n\n## Third Party\n\n### Chef Cookbooks\n\n[https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud)\n\ + \n[https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud)\n\ + \n# Multi-Tenant Portal Headers\n\nMulti-Tenant Organization API Headers are available\ + \ for JumpCloud Admins to use when making API requests from Organizations that\ + \ have multiple managed organizations.\n\nThe `x-org-id` is a required header\ + \ for all multi-tenant admins when making API requests to JumpCloud. This header\ + \ will define to which organization you would like to make the request.\n\n**NOTE**\ + \ Single Tenant Admins do not need to provide this header when making an API request.\n\ + \n## Header Value\n\n`x-org-id`\n\n## API Response Codes\n\n* `400` Malformed\ + \ ID.\n* `400` x-org-id and Organization path ID do not match.\n* `401` ID not\ + \ included for multi-tenant admin\n* `403` ID included on unsupported route.\n\ + * `404` Organization ID Not Found.\n\n```bash\ncurl -X GET https://console.jumpcloud.com/api/v2/directories\ + \ \\\n -H 'accept: application/json' \\\n -H 'content-type: application/json'\ + \ \\\n -H 'x-api-key: {API_KEY}' \\\n -H 'x-org-id: {ORG_ID}'\n\n```\n\n## To\ + \ Obtain an Individual Organization ID via the UI\n\nAs a prerequisite, your Primary\ + \ Organization will need to be setup for Multi-Tenancy. This provides access to\ + \ the Multi-Tenant Organization Admin Portal.\n\n1. Log into JumpCloud [Admin\ + \ Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you\ + \ will automatically be routed to the Multi-Tenant Admin Portal.\n2. From the\ + \ Multi-Tenant Portal's primary navigation bar, select the Organization you'd\ + \ like to access.\n3. You will automatically be routed to that Organization's\ + \ Admin Console.\n4. Go to Settings in the sub-tenant's primary navigation.\n\ + 5. You can obtain your Organization ID below your Organization's Contact Information\ + \ on the Settings page.\n\n## To Obtain All Organization IDs via the API\n\n*\ + \ You can make an API request to this endpoint using the API key of your Primary\ + \ Organization. `https://console.jumpcloud.com/api/organizations/` This will\ + \ return all your managed organizations.\n\n```bash\ncurl -X GET \\\n https://console.jumpcloud.com/api/organizations/\ + \ \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\ + \ \\\n -H 'x-api-key: {API_KEY}'\n```\n\n# SDKs\n\nYou can find language specific\ + \ SDKs that can help you kickstart your Integration with JumpCloud in the following\ + \ GitHub repositories:\n\n* [Python](https://github.com/TheJumpCloud/jcapi-python)\n\ + * [Go](https://github.com/TheJumpCloud/jcapi-go)\n* [Ruby](https://github.com/TheJumpCloud/jcapi-ruby)\n\ + * [Java](https://github.com/TheJumpCloud/jcapi-java)\n" + contact: + name: JumpCloud Support + url: https://support.jumpcloud.com/support/s/ + email: support@jumpcloud.com + version: "2.0" +servers: +- url: https://console.jumpcloud.com/api/v2 +tags: +- name: AccountManagerCalendar +- name: AddOn +- name: Active Directory +- name: Administrators +- name: Apple MDM +- name: Apple VPP +- name: Applications +- name: Authentication Policies +- name: Bulk Job Requests +- name: Cloud Insights +- name: Commands +- name: Command Templates +- name: Command Results +- name: Configuration +- name: Countries +- name: Custom Emails +- name: Devices +- name: Directories +- name: Directory Insights +- name: Duo +- name: Entitlement +- name: fde +- name: G Suite +- name: G Suite Import +- name: Graph +- name: Groups +- name: Image +- name: IP Lists +- name: Knowledge +- name: LDAP Servers +- name: Logos +- name: Managed Service Provider +- name: Push +- name: Office 365 +- name: Office 365 Import +- name: Organizations +- name: Partners +- name: Password Manager +- name: Plan +- name: Plan Feature +- name: Trial Feature Insights +- name: Policies +- name: Policy Groups +- name: Policy Group Associations +- name: Policy Group Members & Membership +- name: Policytemplates +- name: Providers +- name: RADIUS Servers +- name: Remote Assist +- name: Recommendations +- name: Samba Domains +- name: Software Catalog +- name: Software Apps +- name: Subscriptions +- name: SubscriptionComponent +- name: SubscriptionData +- name: System Groups +- name: System Group Associations +- name: System Group Members & Membership +- name: System Insights +- name: Systems +- name: SCIM Import +- name: User Group Associations +- name: User Groups +- name: User Group Members & Membership +- name: Users +- name: WebAuthn +- name: Workday Import +paths: + /activedirectories: + get: + tags: + - Active Directory + summary: List Active Directories + description: "This endpoint allows you to list all your Active Directory Instances.\n\ + \n#### Sample Request\n```\ncurl -X GET https://console.jumpcloud.com/api/v2/activedirectories/\ + \ \\\n -H 'accept: application/json' \\\n -H 'content-type: application/json'\ + \ \\\n -H 'x-api-key: {API_KEY}'\n ```" + operationId: activedirectories_list + parameters: + - name: fields + in: query + description: "The comma separated fields included in the returned records.\n\ + If omitted, the default list of fields will be returned.\n" + required: false + style: form + explode: false + schema: + type: array + items: + type: string + - name: filter + in: query + description: "A filter to apply to the query.\n\n**Filter structure**: `::`.\n\ + \n**field** = Populate with a valid field from an endpoint response.\n\n\ + **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between,\ + \ search, in.\n_Note: v1 operators differ from v2 operators._\n\n**value**\ + \ = Populate with the value you want to search for. Is case sensitive. Supports\ + \ wild cards.\n\n**EX:** `GET /api/v2/groups?filter=name:eq:Test+Group`" + required: false + style: form + explode: false + schema: + type: array + items: + type: string + - name: limit + in: query + description: The number of records to return at once. Limited to 100. + required: false + style: form + explode: true + schema: + type: integer + default: 10 + - name: skip + in: query + description: The offset into the records to return. + required: false + style: form + explode: true + schema: + minimum: 0 + type: integer + default: 0 + - name: sort + in: query + description: "The comma separated fields used to sort the collection.\nDefault\ + \ sort is ascending, prefix with `-` to sort descending.\n" + required: false + style: form + explode: false + schema: + type: array + items: + type: string + - name: x-org-id + in: header + description: Organization identifier that can be obtained from console settings. + required: false + style: simple + explode: false + schema: + type: string + responses: + "200": + description: "" + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/active-directory-output' + x-content-type: application/json + security: + - x-api-key: [] + x-scopes: + - directories + - directories.readonly + x-codeSamples: + - lang: Shell + source: "curl --request GET \\\n --url 'https://console.jumpcloud.com/api/v2/activedirectories?limit=10&skip=0'\ + \ \\\n --header 'x-api-key: REPLACE_KEY_VALUE' \\\n --header 'x-org-id:\ + \ SOME_STRING_VALUE'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/activedirectories\"\ + \n\nquerystring = {\"limit\":\"10\",\"skip\":\"0\"}\n\nheaders = {\n \ + \ \"x-org-id\": \"SOME_STRING_VALUE\",\n \"x-api-key\": \"REPLACE_KEY_VALUE\"\ + \n}\n\nresponse = requests.request(\"GET\", url, headers=headers, params=querystring)\n\ + \nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-org-id\", \"SOME_STRING_VALUE\")\n\ + $headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n$response = Invoke-RestMethod\ + \ -Uri 'https://console.jumpcloud.com/api/v2/activedirectories?limit=10&skip=0'\ + \ -Method GET -Headers $headers" + post: + tags: + - Active Directory + summary: Create a new Active Directory + description: "This endpoint allows you to create a new Active Directory.\n\n\ + \n#### Sample Request\n```\ncurl -X POST https://console.jumpcloud.com/api/v2/activedirectories/\ + \ \\\n -H 'accept: application/json' \\\n -H 'content-type: application/json'\ + \ \\\n -H 'x-api-key: {API_KEY}' \\\n -d '{\n \"domain\": \"{DC=AD_domain_name;DC=com}\"\ + \n }'\n```" + operationId: activedirectories_post + parameters: + - name: x-org-id + in: header + description: Organization identifier that can be obtained from console settings. + required: false + style: simple + explode: false + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/active-directory-input' + required: false + responses: + "201": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/active-directory-output' + security: + - x-api-key: [] + x-scopes: + - directories + x-codeSamples: + - lang: Shell + source: "curl --request POST \\\n --url https://console.jumpcloud.com/api/v2/activedirectories\ + \ \\\n --header 'content-type: application/json' \\\n --header 'x-api-key:\ + \ REPLACE_KEY_VALUE' \\\n --header 'x-org-id: SOME_STRING_VALUE' \\\n \ + \ --data '{\"domain\":\"string\"}'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/activedirectories\"\ + \n\npayload = {\"domain\": \"string\"}\nheaders = {\n \"x-org-id\": \"\ + SOME_STRING_VALUE\",\n \"x-api-key\": \"REPLACE_KEY_VALUE\",\n \"\ + content-type\": \"application/json\"\n}\n\nresponse = requests.request(\"\ + POST\", url, json=payload, headers=headers)\n\nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-org-id\", \"SOME_STRING_VALUE\")\n\ + $headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n$headers.Add(\"content-type\"\ + , \"application/json\")\n$response = Invoke-RestMethod -Uri 'https://console.jumpcloud.com/api/v2/activedirectories'\ + \ -Method POST -Headers $headers -ContentType 'application/json' -Body '{\"\ + domain\":\"string\"}'" + x-codegen-request-body-name: body + /activedirectories/{activedirectory_id}/agents: + get: + tags: + - Active Directory + summary: List Active Directory Agents + description: "This endpoint allows you to list all your Active Directory Agents\ + \ for a given Instance.\n\n#### Sample Request\n```\ncurl -X GET https://console.jumpcloud.com/api/v2/activedirectories/{activedirectory_id}/agents\ + \ \\\n -H 'accept: application/json' \\\n -H 'content-type: application/json'\ + \ \\\n -H 'x-api-key: {API_KEY}'\n ```" + operationId: activedirectories_agentsList + parameters: + - name: activedirectory_id + in: path + required: true + style: simple + explode: false + schema: + type: string + - name: limit + in: query + description: The number of records to return at once. Limited to 100. + required: false + style: form + explode: true + schema: + type: integer + default: 10 + - name: skip + in: query + description: The offset into the records to return. + required: false + style: form + explode: true + schema: + minimum: 0 + type: integer + default: 0 + - name: sort + in: query + description: "The comma separated fields used to sort the collection.\nDefault\ + \ sort is ascending, prefix with `-` to sort descending.\n" + required: false + style: form + explode: false + schema: + type: array + items: + type: string + - name: x-org-id + in: header + description: Organization identifier that can be obtained from console settings. + required: false + style: simple + explode: false + schema: + type: string + responses: + "200": + description: "" + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/active-directory-agent-list-output' + x-content-type: application/json + security: + - x-api-key: [] + x-scopes: + - directories + - directories.readonly + x-codeSamples: + - lang: Shell + source: "curl --request GET \\\n --url 'https://console.jumpcloud.com/api/v2/activedirectories/{activedirectory_id}/agents?limit=10&skip=0'\ + \ \\\n --header 'x-api-key: REPLACE_KEY_VALUE' \\\n --header 'x-org-id:\ + \ SOME_STRING_VALUE'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/activedirectories/{activedirectory_id}/agents\"\ + \n\nquerystring = {\"limit\":\"10\",\"skip\":\"0\"}\n\nheaders = {\n \ + \ \"x-org-id\": \"SOME_STRING_VALUE\",\n \"x-api-key\": \"REPLACE_KEY_VALUE\"\ + \n}\n\nresponse = requests.request(\"GET\", url, headers=headers, params=querystring)\n\ + \nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-org-id\", \"SOME_STRING_VALUE\")\n\ + $headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n$response = Invoke-RestMethod\ + \ -Uri 'https://console.jumpcloud.com/api/v2/activedirectories/{activedirectory_id}/agents?limit=10&skip=0'\ + \ -Method GET -Headers $headers" + post: + tags: + - Active Directory + summary: Create a new Active Directory Agent + description: "This endpoint allows you to create a new Active Directory Agent.\n\ + \n\n#### Sample Request\n```\ncurl -X POST https://console.jumpcloud.com/api/v2/activedirectories/{activedirectory_id}/agents\ + \ \\\n -H 'accept: application/json' \\\n -H 'content-type: application/json'\ + \ \\\n -H 'x-api-key: {API_KEY}' \\\n -d '{}'\n```" + operationId: activedirectories_agentsPost + parameters: + - name: activedirectory_id + in: path + required: true + style: simple + explode: false + schema: + type: string + - name: x-org-id + in: header + description: Organization identifier that can be obtained from console settings. + required: false + style: simple + explode: false + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/active-directory-agent-input' + required: false + responses: + "201": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/active-directory-agent-get-output' + security: + - x-api-key: [] + x-scopes: + - directories + x-codeSamples: + - lang: Shell + source: "curl --request POST \\\n --url https://console.jumpcloud.com/api/v2/activedirectories/{activedirectory_id}/agents\ + \ \\\n --header 'content-type: application/json' \\\n --header 'x-api-key:\ + \ REPLACE_KEY_VALUE' \\\n --header 'x-org-id: SOME_STRING_VALUE' \\\n \ + \ --data '{}'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/activedirectories/{activedirectory_id}/agents\"\ + \n\npayload = {}\nheaders = {\n \"x-org-id\": \"SOME_STRING_VALUE\",\n\ + \ \"x-api-key\": \"REPLACE_KEY_VALUE\",\n \"content-type\": \"application/json\"\ + \n}\n\nresponse = requests.request(\"POST\", url, json=payload, headers=headers)\n\ + \nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-org-id\", \"SOME_STRING_VALUE\")\n\ + $headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n$headers.Add(\"content-type\"\ + , \"application/json\")\n$response = Invoke-RestMethod -Uri 'https://console.jumpcloud.com/api/v2/activedirectories/{activedirectory_id}/agents'\ + \ -Method POST -Headers $headers -ContentType 'application/json' -Body '{}'" + x-codegen-request-body-name: body + /activedirectories/{activedirectory_id}/agents/{agent_id}: + get: + tags: + - Active Directory + summary: Get Active Directory Agent + description: "This endpoint returns an Active Directory agent.\n\n#### Sample\ + \ Request\n```\ncurl -X GET https://console.jumpcloud.com/api/v2/activedirectories/{activedirectory_id}/agents/{agent_id}\ + \ \\\n -H 'accept: application/json' \\\n -H 'content-type: application/json'\ + \ \\\n -H 'x-api-key: {API_KEY}'\n```" + operationId: activedirectories_agentsGet + parameters: + - name: activedirectory_id + in: path + required: true + style: simple + explode: false + schema: + type: string + - name: agent_id + in: path + required: true + style: simple + explode: false + schema: + type: string + - name: x-org-id + in: header + description: Organization identifier that can be obtained from console settings. + required: false + style: simple + explode: false + schema: + type: string + responses: + "200": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/active-directory-agent-list-output' + security: + - x-api-key: [] + x-scopes: + - directories + - directories.readonly + x-codeSamples: + - lang: Shell + source: "curl --request GET \\\n --url https://console.jumpcloud.com/api/v2/activedirectories/{activedirectory_id}/agents/{agent_id}\ + \ \\\n --header 'x-api-key: REPLACE_KEY_VALUE' \\\n --header 'x-org-id:\ + \ SOME_STRING_VALUE'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/activedirectories/{activedirectory_id}/agents/{agent_id}\"\ + \n\nheaders = {\n \"x-org-id\": \"SOME_STRING_VALUE\",\n \"x-api-key\"\ + : \"REPLACE_KEY_VALUE\"\n}\n\nresponse = requests.request(\"GET\", url,\ + \ headers=headers)\n\nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-org-id\", \"SOME_STRING_VALUE\")\n\ + $headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n$response = Invoke-RestMethod\ + \ -Uri 'https://console.jumpcloud.com/api/v2/activedirectories/{activedirectory_id}/agents/{agent_id}'\ + \ -Method GET -Headers $headers" + delete: + tags: + - Active Directory + summary: Delete Active Directory Agent + description: "This endpoint deletes an Active Directory agent.\n\n#### Sample\ + \ Request\n```\ncurl -X DELETE https://console.jumpcloud.com/api/v2/activedirectories/{activedirectory_id}/agents/{agent_id}\ + \ \\\n -H 'accept: application/json' \\\n -H 'content-type: application/json'\ + \ \\\n -H 'x-api-key: {API_KEY}'\n```" + operationId: activedirectories_agentsDelete + parameters: + - name: activedirectory_id + in: path + required: true + style: simple + explode: false + schema: + type: string + - name: agent_id + in: path + required: true + style: simple + explode: false + schema: + type: string + - name: x-org-id + in: header + description: Organization identifier that can be obtained from console settings. + required: false + style: simple + explode: false + schema: + type: string + responses: + "204": + description: "" + content: {} + security: + - x-api-key: [] + x-scopes: + - directories + x-codeSamples: + - lang: Shell + source: "curl --request DELETE \\\n --url https://console.jumpcloud.com/api/v2/activedirectories/{activedirectory_id}/agents/{agent_id}\ + \ \\\n --header 'x-api-key: REPLACE_KEY_VALUE' \\\n --header 'x-org-id:\ + \ SOME_STRING_VALUE'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/activedirectories/{activedirectory_id}/agents/{agent_id}\"\ + \n\nheaders = {\n \"x-org-id\": \"SOME_STRING_VALUE\",\n \"x-api-key\"\ + : \"REPLACE_KEY_VALUE\"\n}\n\nresponse = requests.request(\"DELETE\", url,\ + \ headers=headers)\n\nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-org-id\", \"SOME_STRING_VALUE\")\n\ + $headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n$response = Invoke-RestMethod\ + \ -Uri 'https://console.jumpcloud.com/api/v2/activedirectories/{activedirectory_id}/agents/{agent_id}'\ + \ -Method DELETE -Headers $headers" + /activedirectories/{activedirectory_id}/associations: + get: + tags: + - Graph + - Active Directory + summary: List the associations of an Active Directory instance + description: "This endpoint returns the direct associations of this Active Directory\ + \ instance.\n\nA direct association can be a non-homogeneous relationship\ + \ between 2 different objects, for example Active Directory and Users.\n\n\ + \n#### Sample Request\n```\ncurl -X GET 'https://console.jumpcloud.com/api/v2/activedirectories/{ActiveDirectory_ID}/associations?targets=user\ + \ \\\n -H 'accept: application/json' \\\n -H 'content-type: application/json'\ + \ \\\n -H 'x-api-key: {API_KEY}'\n```" + operationId: graph_activeDirectoryAssociationsList + parameters: + - name: activedirectory_id + in: path + required: true + style: simple + explode: false + schema: + type: string + - name: targets + in: query + description: Targets which a "active_directory" can be associated to. + required: true + style: form + explode: false + schema: + type: array + items: + type: string + enum: + - user + - user_group + - name: limit + in: query + description: The number of records to return at once. Limited to 100. + required: false + style: form + explode: true + schema: + type: integer + default: 10 + - name: skip + in: query + description: The offset into the records to return. + required: false + style: form + explode: true + schema: + minimum: 0 + type: integer + default: 0 + - name: x-org-id + in: header + description: Organization identifier that can be obtained from console settings. + required: false + style: simple + explode: false + schema: + type: string + responses: + "200": + description: "" + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/GraphConnection' + x-content-type: application/json + security: + - x-api-key: [] + x-scopes: + - directories + - directories.readonly + x-codeSamples: + - lang: Shell + source: "curl --request GET \\\n --url 'https://console.jumpcloud.com/api/v2/activedirectories/{activedirectory_id}/associations?targets=SOME_ARRAY_VALUE&limit=10&skip=0'\ + \ \\\n --header 'x-api-key: REPLACE_KEY_VALUE' \\\n --header 'x-org-id:\ + \ SOME_STRING_VALUE'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/activedirectories/{activedirectory_id}/associations\"\ + \n\nquerystring = {\"targets\":\"SOME_ARRAY_VALUE\",\"limit\":\"10\",\"\ + skip\":\"0\"}\n\nheaders = {\n \"x-org-id\": \"SOME_STRING_VALUE\",\n\ + \ \"x-api-key\": \"REPLACE_KEY_VALUE\"\n}\n\nresponse = requests.request(\"\ + GET\", url, headers=headers, params=querystring)\n\nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-org-id\", \"SOME_STRING_VALUE\")\n\ + $headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n$response = Invoke-RestMethod\ + \ -Uri 'https://console.jumpcloud.com/api/v2/activedirectories/{activedirectory_id}/associations?targets=SOME_ARRAY_VALUE&limit=10&skip=0'\ + \ -Method GET -Headers $headers" + post: + tags: + - Graph + - Active Directory + summary: Manage the associations of an Active Directory instance + description: "This endpoint allows you to manage the _direct_ associations of\ + \ an Active Directory instance.\n\nA direct association can be a non-homogeneous\ + \ relationship between 2 different objects, for example Active Directory and\ + \ Users.\n\n#### Sample Request\n```\ncurl -X POST https://console.jumpcloud.com/api/v2/activedirectories/{AD_Instance_ID}/associations\ + \ \\\n -H 'accept: application/json' \\\n -H 'content-type: application/json'\ + \ \\\n -H 'x-api-key: {API_KEY}' \\\n -d '{\n \"op\": \"add\",\n \"\ + type\": \"user\",\n \"id\": \"{User_ID}\"\n }'\n```" + operationId: graph_activeDirectoryAssociationsPost + parameters: + - name: activedirectory_id + in: path + required: true + style: simple + explode: false + schema: + type: string + - name: x-org-id + in: header + description: Organization identifier that can be obtained from console settings. + required: false + style: simple + explode: false + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/GraphOperation-ActiveDirectory' + required: false + responses: + "204": + description: "" + content: {} + security: + - x-api-key: [] + x-scopes: + - directories + x-codeSamples: + - lang: Shell + source: "curl --request POST \\\n --url https://console.jumpcloud.com/api/v2/activedirectories/{activedirectory_id}/associations\ + \ \\\n --header 'content-type: application/json' \\\n --header 'x-api-key:\ + \ REPLACE_KEY_VALUE' \\\n --header 'x-org-id: SOME_STRING_VALUE' \\\n \ + \ --data '{\"id\":\"string\",\"op\":\"add\",\"attributes\":{},\"type\":\"\ + user\"}'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/activedirectories/{activedirectory_id}/associations\"\ + \n\npayload = {\n \"id\": \"string\",\n \"op\": \"add\",\n \"attributes\"\ + : {},\n \"type\": \"user\"\n}\nheaders = {\n \"x-org-id\": \"SOME_STRING_VALUE\"\ + ,\n \"x-api-key\": \"REPLACE_KEY_VALUE\",\n \"content-type\": \"application/json\"\ + \n}\n\nresponse = requests.request(\"POST\", url, json=payload, headers=headers)\n\ + \nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-org-id\", \"SOME_STRING_VALUE\")\n\ + $headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n$headers.Add(\"content-type\"\ + , \"application/json\")\n$response = Invoke-RestMethod -Uri 'https://console.jumpcloud.com/api/v2/activedirectories/{activedirectory_id}/associations'\ + \ -Method POST -Headers $headers -ContentType 'application/json' -Body '{\"\ + id\":\"string\",\"op\":\"add\",\"attributes\":{},\"type\":\"user\"}'" + x-codegen-request-body-name: body + /activedirectories/{activedirectory_id}/usergroups: + get: + tags: + - Graph + - Active Directory + summary: List the User Groups bound to an Active Directory instance + description: "This endpoint will return all Users Groups bound to an Active\ + \ Directory instance, either directly or indirectly, essentially traversing\ + \ the JumpCloud Graph for your Organization.\n\nEach element will contain\ + \ the group's type, id, attributes and paths.\n\nThe `attributes` object is\ + \ a key/value hash of compiled graph attributes for all paths followed.\n\n\ + The `paths` array enumerates each path from this Active Directory instance\ + \ to the corresponding User Group; this array represents all grouping and/or\ + \ associations that would have to be removed to deprovision the User Group\ + \ from this Active Directory instance.\n\nSee `/members` and `/associations`\ + \ endpoints to manage those collections.\n\n#### Sample Request\n```\ncurl\ + \ -X GET https://console.jumpcloud.com/api/v2/activedirectories/{ActiveDirectory_ID}/usergroups\ + \ \\\n -H 'accept: application/json' \\\n -H 'content-type: application/json'\ + \ \\\n -H 'x-api-key: {API_KEY}'\n```" + operationId: graph_activeDirectoryTraverseUserGroup + parameters: + - name: activedirectory_id + in: path + description: ObjectID of the Active Directory instance. + required: true + style: simple + explode: false + schema: + type: string + - name: limit + in: query + description: The number of records to return at once. Limited to 100. + required: false + style: form + explode: true + schema: + type: integer + default: 10 + - name: x-org-id + in: header + description: Organization identifier that can be obtained from console settings. + required: false + style: simple + explode: false + schema: + type: string + - name: skip + in: query + description: The offset into the records to return. + required: false + style: form + explode: true + schema: + minimum: 0 + type: integer + default: 0 + - name: filter + in: query + description: "A filter to apply to the query.\n\n**Filter structure**: `::`.\n\ + \n**field** = Populate with a valid field from an endpoint response.\n\n\ + **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between,\ + \ search, in.\n_Note: v1 operators differ from v2 operators._\n\n**value**\ + \ = Populate with the value you want to search for. Is case sensitive. Supports\ + \ wild cards.\n\n**EX:** `GET /api/v2/groups?filter=name:eq:Test+Group`" + required: false + style: form + explode: false + schema: + type: array + items: + type: string + responses: + "200": + description: "" + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/GraphObjectWithPaths' + x-content-type: application/json + security: + - x-api-key: [] + x-scopes: + - groups + - groups.readonly + x-codeSamples: + - lang: Shell + source: "curl --request GET \\\n --url 'https://console.jumpcloud.com/api/v2/activedirectories/{activedirectory_id}/usergroups?limit=10&skip=0'\ + \ \\\n --header 'x-api-key: REPLACE_KEY_VALUE' \\\n --header 'x-org-id:\ + \ SOME_STRING_VALUE'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/activedirectories/{activedirectory_id}/usergroups\"\ + \n\nquerystring = {\"limit\":\"10\",\"skip\":\"0\"}\n\nheaders = {\n \ + \ \"x-org-id\": \"SOME_STRING_VALUE\",\n \"x-api-key\": \"REPLACE_KEY_VALUE\"\ + \n}\n\nresponse = requests.request(\"GET\", url, headers=headers, params=querystring)\n\ + \nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-org-id\", \"SOME_STRING_VALUE\")\n\ + $headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n$response = Invoke-RestMethod\ + \ -Uri 'https://console.jumpcloud.com/api/v2/activedirectories/{activedirectory_id}/usergroups?limit=10&skip=0'\ + \ -Method GET -Headers $headers" + /activedirectories/{activedirectory_id}/users: + get: + tags: + - Graph + - Active Directory + summary: List the Users bound to an Active Directory instance + description: "This endpoint will return all Users bound to an Active Directory\ + \ instance, either directly or indirectly, essentially traversing the JumpCloud\ + \ Graph for your Organization.\n\nEach element will contain the type, id,\ + \ attributes and paths.\n\nThe `attributes` object is a key/value hash of\ + \ compiled graph attributes for all paths followed.\n\nThe `paths` array enumerates\ + \ each path from this Active Directory instance to the corresponding User;\ + \ this array represents all grouping and/or associations that would have to\ + \ be removed to deprovision the User from this Active Directory instance.\n\ + \nSee `/members` and `/associations` endpoints to manage those collections.\n\ + \n#### Sample Request\n```\ncurl -X GET https://console.jumpcloud.com/api/v2/activedirectories/{ActiveDirectory_ID}/users\ + \ \\\n -H 'accept: application/json' \\\n -H 'content-type: application/json'\ + \ \\\n -H 'x-api-key: {API_KEY}'\n```" + operationId: graph_activeDirectoryTraverseUser + parameters: + - name: activedirectory_id + in: path + description: ObjectID of the Active Directory instance. + required: true + style: simple + explode: false + schema: + type: string + - name: filter + in: query + description: "A filter to apply to the query.\n\n**Filter structure**: `::`.\n\ + \n**field** = Populate with a valid field from an endpoint response.\n\n\ + **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between,\ + \ search, in.\n_Note: v1 operators differ from v2 operators._\n\n**value**\ + \ = Populate with the value you want to search for. Is case sensitive. Supports\ + \ wild cards.\n\n**EX:** `GET /api/v2/groups?filter=name:eq:Test+Group`" + required: false + style: form + explode: false + schema: + type: array + items: + type: string + - name: limit + in: query + description: The number of records to return at once. Limited to 100. + required: false + style: form + explode: true + schema: + type: integer + default: 10 + - name: x-org-id + in: header + description: Organization identifier that can be obtained from console settings. + required: false + style: simple + explode: false + schema: + type: string + - name: skip + in: query + description: The offset into the records to return. + required: false + style: form + explode: true + schema: + minimum: 0 + type: integer + default: 0 + responses: + "200": + description: "" + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/GraphObjectWithPaths' + x-content-type: application/json + security: + - x-api-key: [] + x-scopes: + - users + - users.readonly + x-codeSamples: + - lang: Shell + source: "curl --request GET \\\n --url 'https://console.jumpcloud.com/api/v2/activedirectories/{activedirectory_id}/users?limit=10&skip=0'\ + \ \\\n --header 'x-api-key: REPLACE_KEY_VALUE' \\\n --header 'x-org-id:\ + \ SOME_STRING_VALUE'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/activedirectories/{activedirectory_id}/users\"\ + \n\nquerystring = {\"limit\":\"10\",\"skip\":\"0\"}\n\nheaders = {\n \ + \ \"x-org-id\": \"SOME_STRING_VALUE\",\n \"x-api-key\": \"REPLACE_KEY_VALUE\"\ + \n}\n\nresponse = requests.request(\"GET\", url, headers=headers, params=querystring)\n\ + \nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-org-id\", \"SOME_STRING_VALUE\")\n\ + $headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n$response = Invoke-RestMethod\ + \ -Uri 'https://console.jumpcloud.com/api/v2/activedirectories/{activedirectory_id}/users?limit=10&skip=0'\ + \ -Method GET -Headers $headers" + /activedirectories/{id}: + get: + tags: + - Active Directory + summary: Get an Active Directory + description: "This endpoint returns a specific Active Directory.\n\n#### Sample\ + \ Request\n\n```\ncurl -X GET https://console.jumpcloud.com/api/v2/activedirectories/{ActiveDirectory_ID}\ + \ \\\n -H 'accept: application/json' \\\n -H 'content-type: application/json'\ + \ \\\n -H 'x-api-key: {API_KEY}'\n ```" + operationId: activedirectories_get + parameters: + - name: id + in: path + description: ObjectID of this Active Directory instance. + required: true + style: simple + explode: false + schema: + type: string + - name: x-org-id + in: header + description: Organization identifier that can be obtained from console settings. + required: false + style: simple + explode: false + schema: + type: string + responses: + "200": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/active-directory-output' + security: + - x-api-key: [] + x-scopes: + - directories + - directories.readonly + x-codeSamples: + - lang: Shell + source: "curl --request GET \\\n --url https://console.jumpcloud.com/api/v2/activedirectories/{id}\ + \ \\\n --header 'x-api-key: REPLACE_KEY_VALUE' \\\n --header 'x-org-id:\ + \ SOME_STRING_VALUE'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/activedirectories/{id}\"\ + \n\nheaders = {\n \"x-org-id\": \"SOME_STRING_VALUE\",\n \"x-api-key\"\ + : \"REPLACE_KEY_VALUE\"\n}\n\nresponse = requests.request(\"GET\", url,\ + \ headers=headers)\n\nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-org-id\", \"SOME_STRING_VALUE\")\n\ + $headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n$response = Invoke-RestMethod\ + \ -Uri 'https://console.jumpcloud.com/api/v2/activedirectories/{id}' -Method\ + \ GET -Headers $headers" + delete: + tags: + - Active Directory + summary: Delete an Active Directory + description: "This endpoint allows you to delete an Active Directory Instance.\n\ + \n#### Sample Request\n```\ncurl -X DELETE https://console.jumpcloud.com/api/v2/activedirectories/{ActiveDirectory_ID}\ + \ \\\n -H 'accept: application/json' \\\n -H 'content-type: application/json'\ + \ \\\n -H 'x-api-key: {API_KEY}'\n ```" + operationId: activedirectories_delete + parameters: + - name: id + in: path + description: ObjectID of this Active Directory instance. + required: true + style: simple + explode: false + schema: + type: string + - name: x-org-id + in: header + description: Organization identifier that can be obtained from console settings. + required: false + style: simple + explode: false + schema: + type: string + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/active-directory-output' + security: + - x-api-key: [] + x-scopes: + - directories + x-codeSamples: + - lang: Shell + source: "curl --request DELETE \\\n --url https://console.jumpcloud.com/api/v2/activedirectories/{id}\ + \ \\\n --header 'x-api-key: REPLACE_KEY_VALUE' \\\n --header 'x-org-id:\ + \ SOME_STRING_VALUE'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/activedirectories/{id}\"\ + \n\nheaders = {\n \"x-org-id\": \"SOME_STRING_VALUE\",\n \"x-api-key\"\ + : \"REPLACE_KEY_VALUE\"\n}\n\nresponse = requests.request(\"DELETE\", url,\ + \ headers=headers)\n\nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-org-id\", \"SOME_STRING_VALUE\")\n\ + $headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n$response = Invoke-RestMethod\ + \ -Uri 'https://console.jumpcloud.com/api/v2/activedirectories/{id}' -Method\ + \ DELETE -Headers $headers" + /administrators/{administrator_id}/organizationlinks/{id}: + delete: + tags: + - Administrators + - Organizations + - Managed Service Provider + summary: Remove association between an Administrator and an Organization. + description: This endpoint removes the association link between an Administrator + and an Organization. + operationId: administratorOrganizations_removeByAdministrator + parameters: + - name: administrator_id + in: path + required: true + style: simple + explode: false + schema: + type: string + - name: id + in: path + required: true + style: simple + explode: false + schema: + type: string + responses: + "204": + description: No Content + content: {} + "400": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorDetails' + "401": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "403": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "404": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "500": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + security: + - x-api-key: [] + x-scopes: + - administrators + x-codeSamples: + - lang: Shell + source: "curl --request DELETE \\\n --url https://console.jumpcloud.com/api/v2/administrators/{administrator_id}/organizationlinks/{id}\ + \ \\\n --header 'x-api-key: REPLACE_KEY_VALUE'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/administrators/{administrator_id}/organizationlinks/{id}\"\ + \n\nheaders = {\"x-api-key\": \"REPLACE_KEY_VALUE\"}\n\nresponse = requests.request(\"\ + DELETE\", url, headers=headers)\n\nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n\ + $response = Invoke-RestMethod -Uri 'https://console.jumpcloud.com/api/v2/administrators/{administrator_id}/organizationlinks/{id}'\ + \ -Method DELETE -Headers $headers" + /administrators/{id}/organizationlinks: + get: + tags: + - Administrators + - Organizations + - Managed Service Provider + summary: List the association links between an Administrator and Organizations. + description: This endpoint returns the association links between an Administrator + and Organizations. + operationId: administratorOrganizations_listByAdministrator + parameters: + - name: id + in: path + required: true + style: simple + explode: false + schema: + type: string + - name: limit + in: query + description: The number of records to return at once. Limited to 100. + required: false + style: form + explode: true + schema: + type: integer + default: 10 + - name: skip + in: query + description: The offset into the records to return. + required: false + style: form + explode: true + schema: + minimum: 0 + type: integer + default: 0 + responses: + "200": + description: OK + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/AdministratorOrganizationLink' + x-content-type: application/json + "400": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorDetails' + "401": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "403": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "404": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "500": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + security: + - x-api-key: [] + x-scopes: + - administrators + - administrators.readonly + x-codeSamples: + - lang: Shell + source: "curl --request GET \\\n --url 'https://console.jumpcloud.com/api/v2/administrators/{id}/organizationlinks?limit=10&skip=0'\ + \ \\\n --header 'x-api-key: REPLACE_KEY_VALUE'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/administrators/{id}/organizationlinks\"\ + \n\nquerystring = {\"limit\":\"10\",\"skip\":\"0\"}\n\nheaders = {\"x-api-key\"\ + : \"REPLACE_KEY_VALUE\"}\n\nresponse = requests.request(\"GET\", url, headers=headers,\ + \ params=querystring)\n\nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n\ + $response = Invoke-RestMethod -Uri 'https://console.jumpcloud.com/api/v2/administrators/{id}/organizationlinks?limit=10&skip=0'\ + \ -Method GET -Headers $headers" + post: + tags: + - Administrators + - Organizations + - Managed Service Provider + summary: Allow Adminstrator access to an Organization. + description: This endpoint allows you to grant Administrator access to an Organization. + operationId: administratorOrganizations_createByAdministrator + parameters: + - name: id + in: path + required: true + style: simple + explode: false + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AdministratorOrganizationLinkReq' + required: false + responses: + "201": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AdministratorOrganizationLink' + "400": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorDetails' + "401": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "403": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "404": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "500": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + security: + - x-api-key: [] + x-scopes: + - administrators + x-codeSamples: + - lang: Shell + source: "curl --request POST \\\n --url https://console.jumpcloud.com/api/v2/administrators/{id}/organizationlinks\ + \ \\\n --header 'content-type: application/json' \\\n --header 'x-api-key:\ + \ REPLACE_KEY_VALUE' \\\n --data '{\"organization\":\"6230a0d26a4e4bc86c6b36f1\"\ + }'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/administrators/{id}/organizationlinks\"\ + \n\npayload = {\"organization\": \"6230a0d26a4e4bc86c6b36f1\"}\nheaders\ + \ = {\n \"x-api-key\": \"REPLACE_KEY_VALUE\",\n \"content-type\":\ + \ \"application/json\"\n}\n\nresponse = requests.request(\"POST\", url,\ + \ json=payload, headers=headers)\n\nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n\ + $headers.Add(\"content-type\", \"application/json\")\n$response = Invoke-RestMethod\ + \ -Uri 'https://console.jumpcloud.com/api/v2/administrators/{id}/organizationlinks'\ + \ -Method POST -Headers $headers -ContentType 'application/json' -Body '{\"\ + organization\":\"6230a0d26a4e4bc86c6b36f1\"}'" + x-codegen-request-body-name: body + /applemdms: + get: + tags: + - Apple MDM + summary: List Apple MDMs + description: "Get a list of all Apple MDM configurations. An empty topic indicates\ + \ that a signed certificate from Apple has not been provided to the PUT endpoint\ + \ yet.\n\nNote: currently only one MDM configuration per organization is supported.\n\ + \n#### Sample Request\n```\ncurl https://console.jumpcloud.com/api/v2/applemdms\ + \ \\\n -H 'accept: application/json' \\\n -H 'content-type: application/json'\ + \ \\\n -H 'x-api-key: {API_KEY}'\n```" + operationId: applemdms_list + parameters: + - name: x-org-id + in: header + description: Organization identifier that can be obtained from console settings. + required: false + style: simple + explode: false + schema: + type: string + responses: + "200": + description: "" + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/AppleMDM' + x-content-type: application/json + security: + - x-api-key: [] + x-scopes: + - mdm + - mdm.readonly + x-codeSamples: + - lang: Shell + source: "curl --request GET \\\n --url https://console.jumpcloud.com/api/v2/applemdms\ + \ \\\n --header 'x-api-key: REPLACE_KEY_VALUE' \\\n --header 'x-org-id:\ + \ SOME_STRING_VALUE'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/applemdms\"\ + \n\nheaders = {\n \"x-org-id\": \"SOME_STRING_VALUE\",\n \"x-api-key\"\ + : \"REPLACE_KEY_VALUE\"\n}\n\nresponse = requests.request(\"GET\", url,\ + \ headers=headers)\n\nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-org-id\", \"SOME_STRING_VALUE\")\n\ + $headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n$response = Invoke-RestMethod\ + \ -Uri 'https://console.jumpcloud.com/api/v2/applemdms' -Method GET -Headers\ + \ $headers" + /applemdms/{apple_mdm_id}/csr: + get: + tags: + - Apple MDM + summary: Get Apple MDM CSR Plist + description: "Retrieves an Apple MDM signed CSR Plist for an organization. \ + \ The user must supply the returned plist to Apple for signing, and then provide\ + \ the certificate provided by Apple back into the PUT API.\n\n#### Sample\ + \ Request\n```\n curl -X GET https://console.jumpcloud.com/api/v2/applemdms/{APPLE_MDM_ID}/csr\ + \ \\\n -H 'accept: application/json' \\\n -H 'content-type: application/json'\ + \ \\\n -H 'x-api-key: {API_KEY}'\n```" + operationId: applemdms_csrget + parameters: + - name: apple_mdm_id + in: path + required: true + style: simple + explode: false + schema: + type: string + - name: x-org-id + in: header + description: Organization identifier that can be obtained from console settings. + required: false + style: simple + explode: false + schema: + type: string + responses: + "200": + description: "" + content: + application/octet-stream: + schema: + $ref: '#/components/schemas/apple-mdm-signed-csr-plist' + "400": + description: "" + content: + application/octet-stream: + schema: + $ref: '#/components/schemas/ErrorDetails' + "401": + description: "" + content: + application/octet-stream: + schema: + $ref: '#/components/schemas/Error' + "403": + description: "" + content: + application/octet-stream: + schema: + $ref: '#/components/schemas/Error' + "404": + description: "" + content: + application/octet-stream: + schema: + $ref: '#/components/schemas/Error' + "409": + description: "" + content: + application/octet-stream: + schema: + $ref: '#/components/schemas/Error' + "500": + description: "" + content: + application/octet-stream: + schema: + $ref: '#/components/schemas/Error' + security: + - x-api-key: [] + x-scopes: + - mdm + - mdm.readonly + x-codeSamples: + - lang: Shell + source: "curl --request GET \\\n --url https://console.jumpcloud.com/api/v2/applemdms/{apple_mdm_id}/csr\ + \ \\\n --header 'x-api-key: REPLACE_KEY_VALUE' \\\n --header 'x-org-id:\ + \ SOME_STRING_VALUE'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/applemdms/{apple_mdm_id}/csr\"\ + \n\nheaders = {\n \"x-org-id\": \"SOME_STRING_VALUE\",\n \"x-api-key\"\ + : \"REPLACE_KEY_VALUE\"\n}\n\nresponse = requests.request(\"GET\", url,\ + \ headers=headers)\n\nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-org-id\", \"SOME_STRING_VALUE\")\n\ + $headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n$response = Invoke-RestMethod\ + \ -Uri 'https://console.jumpcloud.com/api/v2/applemdms/{apple_mdm_id}/csr'\ + \ -Method GET -Headers $headers" + /applemdms/{apple_mdm_id}/depkey: + get: + tags: + - Apple MDM + summary: Get Apple MDM DEP Public Key + description: Retrieves an Apple MDM DEP Public Key. + operationId: applemdms_depkeyget + parameters: + - name: apple_mdm_id + in: path + required: true + style: simple + explode: false + schema: + type: string + - name: x-org-id + in: header + description: Organization identifier that can be obtained from console settings. + required: false + style: simple + explode: false + schema: + type: string + responses: + "200": + description: "" + content: + application/x-pem-file: + schema: + $ref: '#/components/schemas/apple-mdm-public-key-cert' + "400": + description: "" + content: + application/x-pem-file: + schema: + $ref: '#/components/schemas/ErrorDetails' + "401": + description: "" + content: + application/x-pem-file: + schema: + $ref: '#/components/schemas/Error' + "403": + description: "" + content: + application/x-pem-file: + schema: + $ref: '#/components/schemas/Error' + "404": + description: "" + content: + application/x-pem-file: + schema: + $ref: '#/components/schemas/Error' + "409": + description: "" + content: + application/x-pem-file: + schema: + $ref: '#/components/schemas/Error' + "500": + description: "" + content: + application/x-pem-file: + schema: + $ref: '#/components/schemas/Error' + security: + - x-api-key: [] + x-scopes: + - mdm + - mdm.readonly + x-codeSamples: + - lang: Shell + source: "curl --request GET \\\n --url https://console.jumpcloud.com/api/v2/applemdms/{apple_mdm_id}/depkey\ + \ \\\n --header 'x-api-key: REPLACE_KEY_VALUE' \\\n --header 'x-org-id:\ + \ SOME_STRING_VALUE'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/applemdms/{apple_mdm_id}/depkey\"\ + \n\nheaders = {\n \"x-org-id\": \"SOME_STRING_VALUE\",\n \"x-api-key\"\ + : \"REPLACE_KEY_VALUE\"\n}\n\nresponse = requests.request(\"GET\", url,\ + \ headers=headers)\n\nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-org-id\", \"SOME_STRING_VALUE\")\n\ + $headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n$response = Invoke-RestMethod\ + \ -Uri 'https://console.jumpcloud.com/api/v2/applemdms/{apple_mdm_id}/depkey'\ + \ -Method GET -Headers $headers" + /applemdms/{apple_mdm_id}/devices: + get: + tags: + - Apple MDM + summary: List AppleMDM Devices + description: "Lists all Apple MDM devices.\n\nThe filter and sort queries will\ + \ allow the following fields:\n`createdAt`\n`depRegistered`\n`enrolled`\n\ + `id`\n`osVersion`\n`serialNumber`\n`udid`\n\n#### Sample Request\n```\n curl\ + \ -X GET https://console.jumpcloud.com/api/v2/applemdms/{apple_mdm_id}/devices\ + \ \\\n -H 'accept: application/json' \\\n -H 'x-api-key: {API_KEY}' \\\n\ + \ -d '{}'\n```" + operationId: applemdms_deviceslist + parameters: + - name: apple_mdm_id + in: path + required: true + style: simple + explode: false + schema: + type: string + - name: limit + in: query + description: The number of records to return at once. Limited to 100. + required: false + style: form + explode: true + schema: + type: integer + default: 10 + - name: x-org-id + in: header + description: Organization identifier that can be obtained from console settings. + required: false + style: simple + explode: false + schema: + type: string + - name: skip + in: query + description: The offset into the records to return. + required: false + style: form + explode: true + schema: + minimum: 0 + type: integer + default: 0 + - name: filter + in: query + description: "A filter to apply to the query.\n\n**Filter structure**: `::`.\n\ + \n**field** = Populate with a valid field from an endpoint response.\n\n\ + **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between,\ + \ search, in.\n_Note: v1 operators differ from v2 operators._\n\n**value**\ + \ = Populate with the value you want to search for. Is case sensitive. Supports\ + \ wild cards.\n\n**EX:** `GET /api/v2/groups?filter=name:eq:Test+Group`" + required: false + style: form + explode: false + schema: + type: array + items: + type: string + - name: sort + in: query + description: "The comma separated fields used to sort the collection.\nDefault\ + \ sort is ascending, prefix with `-` to sort descending.\n" + required: false + style: form + explode: false + schema: + type: array + items: + type: string + - name: x-total-count + in: header + required: false + style: simple + explode: false + schema: + type: integer + responses: + "200": + description: OK + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/apple-mdm-device' + x-content-type: application/json + "400": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorDetails' + "401": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "403": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "404": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "409": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "500": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + security: + - x-api-key: [] + x-scopes: + - mdm + - mdm.readonly + x-codeSamples: + - lang: Shell + source: "curl --request GET \\\n --url 'https://console.jumpcloud.com/api/v2/applemdms/{apple_mdm_id}/devices?limit=10&skip=0'\ + \ \\\n --header 'x-api-key: REPLACE_KEY_VALUE' \\\n --header 'x-org-id:\ + \ SOME_STRING_VALUE' \\\n --header 'x-total-count: SOME_INTEGER_VALUE'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/applemdms/{apple_mdm_id}/devices\"\ + \n\nquerystring = {\"limit\":\"10\",\"skip\":\"0\"}\n\nheaders = {\n \ + \ \"x-org-id\": \"SOME_STRING_VALUE\",\n \"x-total-count\": \"SOME_INTEGER_VALUE\"\ + ,\n \"x-api-key\": \"REPLACE_KEY_VALUE\"\n}\n\nresponse = requests.request(\"\ + GET\", url, headers=headers, params=querystring)\n\nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-org-id\", \"SOME_STRING_VALUE\")\n\ + $headers.Add(\"x-total-count\", \"SOME_INTEGER_VALUE\")\n$headers.Add(\"\ + x-api-key\", \"REPLACE_KEY_VALUE\")\n$response = Invoke-RestMethod -Uri\ + \ 'https://console.jumpcloud.com/api/v2/applemdms/{apple_mdm_id}/devices?limit=10&skip=0'\ + \ -Method GET -Headers $headers" + /applemdms/{apple_mdm_id}/devices/{device_id}: + get: + tags: + - Apple MDM + summary: Details of an AppleMDM Device + description: "Gets a single Apple MDM device.\n\n#### Sample Request\n```\n\ + \ curl -X GET https://console.jumpcloud.com/api/v2/applemdms/{apple_mdm_id}/devices/{device_id}\ + \ \\\n -H 'accept: application/json' \\\n -H 'x-api-key: {API_KEY}'\n```" + operationId: applemdms_getdevice + parameters: + - name: x-org-id + in: header + description: Organization identifier that can be obtained from console settings. + required: false + style: simple + explode: false + schema: + type: string + - name: apple_mdm_id + in: path + required: true + style: simple + explode: false + schema: + type: string + - name: device_id + in: path + required: true + style: simple + explode: false + schema: + type: string + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/apple-mdm-device' + "400": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorDetails' + "401": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "403": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "404": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "409": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "500": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + security: + - x-api-key: [] + x-scopes: + - mdm + - mdm.readonly + x-codeSamples: + - lang: Shell + source: "curl --request GET \\\n --url https://console.jumpcloud.com/api/v2/applemdms/{apple_mdm_id}/devices/{device_id}\ + \ \\\n --header 'x-api-key: REPLACE_KEY_VALUE' \\\n --header 'x-org-id:\ + \ SOME_STRING_VALUE'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/applemdms/{apple_mdm_id}/devices/{device_id}\"\ + \n\nheaders = {\n \"x-org-id\": \"SOME_STRING_VALUE\",\n \"x-api-key\"\ + : \"REPLACE_KEY_VALUE\"\n}\n\nresponse = requests.request(\"GET\", url,\ + \ headers=headers)\n\nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-org-id\", \"SOME_STRING_VALUE\")\n\ + $headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n$response = Invoke-RestMethod\ + \ -Uri 'https://console.jumpcloud.com/api/v2/applemdms/{apple_mdm_id}/devices/{device_id}'\ + \ -Method GET -Headers $headers" + delete: + tags: + - Apple MDM + summary: Remove an Apple MDM Device's Enrollment + description: "Remove a single Apple MDM device from MDM enrollment.\n\n####\ + \ Sample Request\n```\n curl -X DELETE https://console.jumpcloud.com/api/v2/applemdms/{apple_mdm_id}/devices/{device_id}\ + \ \\\n -H 'accept: application/json' \\\n -H 'x-api-key: {API_KEY}'\n```" + operationId: applemdms_deletedevice + parameters: + - name: x-org-id + in: header + description: Organization identifier that can be obtained from console settings. + required: false + style: simple + explode: false + schema: + type: string + - name: apple_mdm_id + in: path + required: true + style: simple + explode: false + schema: + type: string + - name: device_id + in: path + required: true + style: simple + explode: false + schema: + type: string + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/apple-mdm-device' + security: + - x-api-key: [] + x-scopes: + - mdm + x-codeSamples: + - lang: Shell + source: "curl --request DELETE \\\n --url https://console.jumpcloud.com/api/v2/applemdms/{apple_mdm_id}/devices/{device_id}\ + \ \\\n --header 'x-api-key: REPLACE_KEY_VALUE' \\\n --header 'x-org-id:\ + \ SOME_STRING_VALUE'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/applemdms/{apple_mdm_id}/devices/{device_id}\"\ + \n\nheaders = {\n \"x-org-id\": \"SOME_STRING_VALUE\",\n \"x-api-key\"\ + : \"REPLACE_KEY_VALUE\"\n}\n\nresponse = requests.request(\"DELETE\", url,\ + \ headers=headers)\n\nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-org-id\", \"SOME_STRING_VALUE\")\n\ + $headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n$response = Invoke-RestMethod\ + \ -Uri 'https://console.jumpcloud.com/api/v2/applemdms/{apple_mdm_id}/devices/{device_id}'\ + \ -Method DELETE -Headers $headers" + /applemdms/{apple_mdm_id}/devices/{device_id}/clearActivationLock: + post: + tags: + - Apple MDM + summary: Clears the Activation Lock for a Device + description: "Clears the activation lock on the specified device.\n\n#### Sample\ + \ Request\n```\n curl -X POST https://console.jumpcloud.com/api/v2/applemdms/{apple_mdm_id}/devices/{device_id}/clearActivationLock\ + \ \\\n -H 'accept: application/json' \\\n -H 'content-type: application/json'\ + \ \\\n -H 'x-api-key: {API_KEY}' \\\n -d '{}'\n```" + operationId: applemdms_devicesClearActivationLock + parameters: + - name: apple_mdm_id + in: path + required: true + style: simple + explode: false + schema: + type: string + - name: device_id + in: path + required: true + style: simple + explode: false + schema: + type: string + - name: x-org-id + in: header + description: Organization identifier that can be obtained from console settings. + required: false + style: simple + explode: false + schema: + type: string + responses: + "204": + description: "" + content: {} + "400": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/inline_response_400' + "401": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "403": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "404": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "409": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "500": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/inline_response_400' + security: + - x-api-key: [] + x-scopes: + - mdm + x-codeSamples: + - lang: Shell + source: "curl --request POST \\\n --url https://console.jumpcloud.com/api/v2/applemdms/{apple_mdm_id}/devices/{device_id}/clearActivationLock\ + \ \\\n --header 'x-api-key: REPLACE_KEY_VALUE' \\\n --header 'x-org-id:\ + \ SOME_STRING_VALUE'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/applemdms/{apple_mdm_id}/devices/{device_id}/clearActivationLock\"\ + \n\nheaders = {\n \"x-org-id\": \"SOME_STRING_VALUE\",\n \"x-api-key\"\ + : \"REPLACE_KEY_VALUE\"\n}\n\nresponse = requests.request(\"POST\", url,\ + \ headers=headers)\n\nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-org-id\", \"SOME_STRING_VALUE\")\n\ + $headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n$response = Invoke-RestMethod\ + \ -Uri 'https://console.jumpcloud.com/api/v2/applemdms/{apple_mdm_id}/devices/{device_id}/clearActivationLock'\ + \ -Method POST -Headers $headers" + /applemdms/{apple_mdm_id}/devices/{device_id}/erase: + post: + tags: + - Apple MDM + summary: Erase Device + description: "Erases a DEP-enrolled device.\n\n#### Sample Request\n```\n curl\ + \ -X POST https://console.jumpcloud.com/api/v2/applemdms/{apple_mdm_id}/devices/{device_id}/erase\ + \ \\\n -H 'accept: application/json' \\\n -H 'content-type: application/json'\ + \ \\\n -H 'x-api-key: {API_KEY}' \\\n -d '{}'\n```" + operationId: applemdms_deviceserase + parameters: + - name: apple_mdm_id + in: path + required: true + style: simple + explode: false + schema: + type: string + - name: device_id + in: path + required: true + style: simple + explode: false + schema: + type: string + - name: x-org-id + in: header + description: Organization identifier that can be obtained from console settings. + required: false + style: simple + explode: false + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/device_id_erase_body' + required: false + responses: + "204": + description: "" + content: {} + "400": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/inline_response_400' + "401": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "403": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "404": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "409": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "500": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/inline_response_400' + security: + - x-api-key: [] + x-scopes: + - mdm + x-codeSamples: + - lang: Shell + source: "curl --request POST \\\n --url https://console.jumpcloud.com/api/v2/applemdms/{apple_mdm_id}/devices/{device_id}/erase\ + \ \\\n --header 'content-type: application/json' \\\n --header 'x-api-key:\ + \ REPLACE_KEY_VALUE' \\\n --header 'x-org-id: SOME_STRING_VALUE' \\\n \ + \ --data '{\"pin\":\"123456\"}'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/applemdms/{apple_mdm_id}/devices/{device_id}/erase\"\ + \n\npayload = {\"pin\": \"123456\"}\nheaders = {\n \"x-org-id\": \"SOME_STRING_VALUE\"\ + ,\n \"x-api-key\": \"REPLACE_KEY_VALUE\",\n \"content-type\": \"application/json\"\ + \n}\n\nresponse = requests.request(\"POST\", url, json=payload, headers=headers)\n\ + \nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-org-id\", \"SOME_STRING_VALUE\")\n\ + $headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n$headers.Add(\"content-type\"\ + , \"application/json\")\n$response = Invoke-RestMethod -Uri 'https://console.jumpcloud.com/api/v2/applemdms/{apple_mdm_id}/devices/{device_id}/erase'\ + \ -Method POST -Headers $headers -ContentType 'application/json' -Body '{\"\ + pin\":\"123456\"}'" + x-codegen-request-body-name: body + /applemdms/{apple_mdm_id}/devices/{device_id}/lock: + post: + tags: + - Apple MDM + summary: Lock Device + description: "Locks a DEP-enrolled device.\n\n#### Sample Request\n```\n curl\ + \ -X POST https://console.jumpcloud.com/api/v2/applemdms/{apple_mdm_id}/devices/{device_id}/lock\ + \ \\\n -H 'accept: application/json' \\\n -H 'content-type: application/json'\ + \ \\\n -H 'x-api-key: {API_KEY}' \\\n -d '{}'\n```" + operationId: applemdms_deviceslock + parameters: + - name: apple_mdm_id + in: path + required: true + style: simple + explode: false + schema: + type: string + - name: device_id + in: path + required: true + style: simple + explode: false + schema: + type: string + - name: x-org-id + in: header + description: Organization identifier that can be obtained from console settings. + required: false + style: simple + explode: false + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/device_id_lock_body' + required: false + responses: + "204": + description: "" + content: {} + "400": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/inline_response_400' + "401": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "403": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "404": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "409": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "500": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/inline_response_400' + security: + - x-api-key: [] + x-scopes: + - mdm + x-codeSamples: + - lang: Shell + source: "curl --request POST \\\n --url https://console.jumpcloud.com/api/v2/applemdms/{apple_mdm_id}/devices/{device_id}/lock\ + \ \\\n --header 'content-type: application/json' \\\n --header 'x-api-key:\ + \ REPLACE_KEY_VALUE' \\\n --header 'x-org-id: SOME_STRING_VALUE' \\\n \ + \ --data '{\"pin\":\"123456\"}'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/applemdms/{apple_mdm_id}/devices/{device_id}/lock\"\ + \n\npayload = {\"pin\": \"123456\"}\nheaders = {\n \"x-org-id\": \"SOME_STRING_VALUE\"\ + ,\n \"x-api-key\": \"REPLACE_KEY_VALUE\",\n \"content-type\": \"application/json\"\ + \n}\n\nresponse = requests.request(\"POST\", url, json=payload, headers=headers)\n\ + \nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-org-id\", \"SOME_STRING_VALUE\")\n\ + $headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n$headers.Add(\"content-type\"\ + , \"application/json\")\n$response = Invoke-RestMethod -Uri 'https://console.jumpcloud.com/api/v2/applemdms/{apple_mdm_id}/devices/{device_id}/lock'\ + \ -Method POST -Headers $headers -ContentType 'application/json' -Body '{\"\ + pin\":\"123456\"}'" + x-codegen-request-body-name: body + /applemdms/{apple_mdm_id}/devices/{device_id}/refreshActivationLockInformation: + post: + tags: + - Apple MDM + summary: Refresh activation lock information for a device + description: "Refreshes the activation lock information for a device\n\n####\ + \ Sample Request\n\n```\ncurl -X POST https://console.jumpcloud.com/api/v2/applemdms/{apple_mdm_id}/devices/{device_id}/refreshActivationLockInformation\ + \ \\\n -H 'accept: application/json' \\\n -H 'content-type: application/json'\ + \ \\\n -H 'x-api-key: {API_KEY}' \\\n -d '{}'\n```" + operationId: applemdms_devicesRefreshActivationLockInformation + parameters: + - name: apple_mdm_id + in: path + required: true + style: simple + explode: false + schema: + type: string + - name: device_id + in: path + required: true + style: simple + explode: false + schema: + type: string + - name: x-org-id + in: header + description: Organization identifier that can be obtained from console settings. + required: false + style: simple + explode: false + schema: + type: string + responses: + "204": + description: "" + content: {} + "400": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/inline_response_400' + "401": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "403": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "404": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "409": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "500": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/inline_response_400' + security: + - x-api-key: [] + x-scopes: + - mdm + - mdm.readonly + x-codeSamples: + - lang: Shell + source: "curl --request POST \\\n --url https://console.jumpcloud.com/api/v2/applemdms/{apple_mdm_id}/devices/{device_id}/refreshActivationLockInformation\ + \ \\\n --header 'x-api-key: REPLACE_KEY_VALUE' \\\n --header 'x-org-id:\ + \ SOME_STRING_VALUE'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/applemdms/{apple_mdm_id}/devices/{device_id}/refreshActivationLockInformation\"\ + \n\nheaders = {\n \"x-org-id\": \"SOME_STRING_VALUE\",\n \"x-api-key\"\ + : \"REPLACE_KEY_VALUE\"\n}\n\nresponse = requests.request(\"POST\", url,\ + \ headers=headers)\n\nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-org-id\", \"SOME_STRING_VALUE\")\n\ + $headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n$response = Invoke-RestMethod\ + \ -Uri 'https://console.jumpcloud.com/api/v2/applemdms/{apple_mdm_id}/devices/{device_id}/refreshActivationLockInformation'\ + \ -Method POST -Headers $headers" + /applemdms/{apple_mdm_id}/devices/{device_id}/restart: + post: + tags: + - Apple MDM + summary: Restart Device + description: "Restarts a DEP-enrolled device.\n\n#### Sample Request\n```\n\ + \ curl -X POST https://console.jumpcloud.com/api/v2/applemdms/{apple_mdm_id}/devices/{device_id}/restart\ + \ \\\n -H 'accept: application/json' \\\n -H 'content-type: application/json'\ + \ \\\n -H 'x-api-key: {API_KEY}' \\\n -d '{\"kextPaths\": [\"Path1\", \"\ + Path2\"]}'\n```" + operationId: applemdms_devicesrestart + parameters: + - name: apple_mdm_id + in: path + required: true + style: simple + explode: false + schema: + type: string + - name: device_id + in: path + required: true + style: simple + explode: false + schema: + type: string + - name: x-org-id + in: header + description: Organization identifier that can be obtained from console settings. + required: false + style: simple + explode: false + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/device_id_restart_body' + required: false + responses: + "204": + description: "" + content: {} + "400": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/inline_response_400' + "401": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "403": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "404": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "409": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "500": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/inline_response_400' + security: + - x-api-key: [] + x-scopes: + - mdm + x-codeSamples: + - lang: Shell + source: "curl --request POST \\\n --url https://console.jumpcloud.com/api/v2/applemdms/{apple_mdm_id}/devices/{device_id}/restart\ + \ \\\n --header 'content-type: application/json' \\\n --header 'x-api-key:\ + \ REPLACE_KEY_VALUE' \\\n --header 'x-org-id: SOME_STRING_VALUE' \\\n \ + \ --data '{\"kextPaths\":[\"string\"]}'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/applemdms/{apple_mdm_id}/devices/{device_id}/restart\"\ + \n\npayload = {\"kextPaths\": [\"string\"]}\nheaders = {\n \"x-org-id\"\ + : \"SOME_STRING_VALUE\",\n \"x-api-key\": \"REPLACE_KEY_VALUE\",\n \ + \ \"content-type\": \"application/json\"\n}\n\nresponse = requests.request(\"\ + POST\", url, json=payload, headers=headers)\n\nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-org-id\", \"SOME_STRING_VALUE\")\n\ + $headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n$headers.Add(\"content-type\"\ + , \"application/json\")\n$response = Invoke-RestMethod -Uri 'https://console.jumpcloud.com/api/v2/applemdms/{apple_mdm_id}/devices/{device_id}/restart'\ + \ -Method POST -Headers $headers -ContentType 'application/json' -Body '{\"\ + kextPaths\":[\"string\"]}'" + x-codegen-request-body-name: body + /applemdms/{apple_mdm_id}/devices/{device_id}/shutdown: + post: + tags: + - Apple MDM + summary: Shut Down Device + description: "Shuts down a DEP-enrolled device.\n\n#### Sample Request\n```\n\ + \ curl -X POST https://console.jumpcloud.com/api/v2/applemdms/{apple_mdm_id}/devices/{device_id}/shutdown\ + \ \\\n -H 'accept: application/json' \\\n -H 'content-type: application/json'\ + \ \\\n -H 'x-api-key: {API_KEY}' \\\n -d '{}'\n```" + operationId: applemdms_devicesshutdown + parameters: + - name: apple_mdm_id + in: path + required: true + style: simple + explode: false + schema: + type: string + - name: device_id + in: path + required: true + style: simple + explode: false + schema: + type: string + - name: x-org-id + in: header + description: Organization identifier that can be obtained from console settings. + required: false + style: simple + explode: false + schema: + type: string + responses: + "204": + description: "" + content: {} + "400": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/inline_response_400' + "401": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "403": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "404": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "409": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "500": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/inline_response_400' + security: + - x-api-key: [] + x-scopes: + - mdm + x-codeSamples: + - lang: Shell + source: "curl --request POST \\\n --url https://console.jumpcloud.com/api/v2/applemdms/{apple_mdm_id}/devices/{device_id}/shutdown\ + \ \\\n --header 'x-api-key: REPLACE_KEY_VALUE' \\\n --header 'x-org-id:\ + \ SOME_STRING_VALUE'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/applemdms/{apple_mdm_id}/devices/{device_id}/shutdown\"\ + \n\nheaders = {\n \"x-org-id\": \"SOME_STRING_VALUE\",\n \"x-api-key\"\ + : \"REPLACE_KEY_VALUE\"\n}\n\nresponse = requests.request(\"POST\", url,\ + \ headers=headers)\n\nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-org-id\", \"SOME_STRING_VALUE\")\n\ + $headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n$response = Invoke-RestMethod\ + \ -Uri 'https://console.jumpcloud.com/api/v2/applemdms/{apple_mdm_id}/devices/{device_id}/shutdown'\ + \ -Method POST -Headers $headers" + /applemdms/{apple_mdm_id}/enrollmentprofiles: + get: + tags: + - Apple MDM + summary: List Apple MDM Enrollment Profiles + description: "Get a list of enrollment profiles for an apple mdm.\n\nNote: currently\ + \ only one enrollment profile is supported.\n\n#### Sample Request\n```\n\ + \ curl https://console.jumpcloud.com/api/v2/applemdms/{APPLE_MDM_ID}/enrollmentprofiles\ + \ \\\n -H 'accept: application/json' \\\n -H 'content-type: application/json'\ + \ \\\n -H 'x-api-key: {API_KEY}'\n```" + operationId: applemdms_enrollmentprofileslist + parameters: + - name: apple_mdm_id + in: path + required: true + style: simple + explode: false + schema: + type: string + - name: x-org-id + in: header + description: Organization identifier that can be obtained from console settings. + required: false + style: simple + explode: false + schema: + type: string + responses: + "200": + description: "" + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/AppleMDM' + x-content-type: application/json + security: + - x-api-key: [] + x-scopes: + - mdm + - mdm.readonly + x-codeSamples: + - lang: Shell + source: "curl --request GET \\\n --url https://console.jumpcloud.com/api/v2/applemdms/{apple_mdm_id}/enrollmentprofiles\ + \ \\\n --header 'x-api-key: REPLACE_KEY_VALUE' \\\n --header 'x-org-id:\ + \ SOME_STRING_VALUE'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/applemdms/{apple_mdm_id}/enrollmentprofiles\"\ + \n\nheaders = {\n \"x-org-id\": \"SOME_STRING_VALUE\",\n \"x-api-key\"\ + : \"REPLACE_KEY_VALUE\"\n}\n\nresponse = requests.request(\"GET\", url,\ + \ headers=headers)\n\nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-org-id\", \"SOME_STRING_VALUE\")\n\ + $headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n$response = Invoke-RestMethod\ + \ -Uri 'https://console.jumpcloud.com/api/v2/applemdms/{apple_mdm_id}/enrollmentprofiles'\ + \ -Method GET -Headers $headers" + /applemdms/{apple_mdm_id}/enrollmentprofiles/{id}: + get: + tags: + - Apple MDM + summary: Get an Apple MDM Enrollment Profile + description: "Get an enrollment profile\n\nCurrently only requesting the mobileconfig\ + \ is supported.\n\n#### Sample Request\n\n```\ncurl https://console.jumpcloud.com/api/v2/applemdms/{APPLE_MDM_ID}/enrollmentprofiles/{ID}\ + \ \\\n -H 'accept: application/x-apple-aspen-config' \\\n -H 'content-type:\ + \ application/json' \\\n -H 'x-api-key: {API_KEY}'\n```" + operationId: applemdms_enrollmentprofilesget + parameters: + - name: apple_mdm_id + in: path + required: true + style: simple + explode: false + schema: + type: string + - name: id + in: path + required: true + style: simple + explode: false + schema: + type: string + - name: x-org-id + in: header + description: Organization identifier that can be obtained from console settings. + required: false + style: simple + explode: false + schema: + type: string + responses: + "200": + description: "" + content: + application/x-apple-aspen-config: + schema: + $ref: '#/components/schemas/mobileconfig' + security: + - x-api-key: [] + x-scopes: + - mdm + - mdm.readonly + x-codeSamples: + - lang: Shell + source: "curl --request GET \\\n --url https://console.jumpcloud.com/api/v2/applemdms/{apple_mdm_id}/enrollmentprofiles/{id}\ + \ \\\n --header 'x-api-key: REPLACE_KEY_VALUE' \\\n --header 'x-org-id:\ + \ SOME_STRING_VALUE'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/applemdms/{apple_mdm_id}/enrollmentprofiles/{id}\"\ + \n\nheaders = {\n \"x-org-id\": \"SOME_STRING_VALUE\",\n \"x-api-key\"\ + : \"REPLACE_KEY_VALUE\"\n}\n\nresponse = requests.request(\"GET\", url,\ + \ headers=headers)\n\nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-org-id\", \"SOME_STRING_VALUE\")\n\ + $headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n$response = Invoke-RestMethod\ + \ -Uri 'https://console.jumpcloud.com/api/v2/applemdms/{apple_mdm_id}/enrollmentprofiles/{id}'\ + \ -Method GET -Headers $headers" + /applemdms/{apple_mdm_id}/refreshdepdevices: + post: + tags: + - Apple MDM + summary: Refresh DEP Devices + description: "Refreshes the list of devices that a JumpCloud admin has added\ + \ to their virtual MDM in Apple Business Manager - ABM so that they can be\ + \ DEP enrolled with JumpCloud.\n\n#### Sample Request\n```\n curl -X POST\ + \ https://console.jumpcloud.com/api/v2/applemdms/{apple_mdm_id}/refreshdepdevices\ + \ \\\n -H 'accept: application/json' \\\n -H 'content-type: application/json'\ + \ \\\n -H 'x-api-key: {API_KEY}' \\\n -d '{}'\n```" + operationId: applemdms_refreshdepdevices + parameters: + - name: apple_mdm_id + in: path + required: true + style: simple + explode: false + schema: + type: string + - name: x-org-id + in: header + description: Organization identifier that can be obtained from console settings. + required: false + style: simple + explode: false + schema: + type: string + responses: + "204": + description: "" + content: {} + "400": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/inline_response_400' + "401": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "403": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "404": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "409": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "500": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/inline_response_400' + security: + - x-api-key: [] + x-scopes: + - mdm + x-codeSamples: + - lang: Shell + source: "curl --request POST \\\n --url https://console.jumpcloud.com/api/v2/applemdms/{apple_mdm_id}/refreshdepdevices\ + \ \\\n --header 'x-api-key: REPLACE_KEY_VALUE' \\\n --header 'x-org-id:\ + \ SOME_STRING_VALUE'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/applemdms/{apple_mdm_id}/refreshdepdevices\"\ + \n\nheaders = {\n \"x-org-id\": \"SOME_STRING_VALUE\",\n \"x-api-key\"\ + : \"REPLACE_KEY_VALUE\"\n}\n\nresponse = requests.request(\"POST\", url,\ + \ headers=headers)\n\nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-org-id\", \"SOME_STRING_VALUE\")\n\ + $headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n$response = Invoke-RestMethod\ + \ -Uri 'https://console.jumpcloud.com/api/v2/applemdms/{apple_mdm_id}/refreshdepdevices'\ + \ -Method POST -Headers $headers" + /applemdms/{id}: + put: + tags: + - Apple MDM + summary: Update an Apple MDM + description: "Updates an Apple MDM configuration. This endpoint is used to\ + \ supply JumpCloud with a signed certificate from Apple in order to finalize\ + \ the setup and allow JumpCloud to manage your devices. It may also be used\ + \ to update the DEP Settings.\n\n#### Sample Request\n```\n curl -X PUT https://console.jumpcloud.com/api/v2/applemdms/{ID}\ + \ \\\n -H 'accept: application/json' \\\n -H 'content-type: application/json'\ + \ \\\n -H 'x-api-key: {API_KEY}' \\\n -d '{\n \"name\": \"MDM name\"\ + ,\n \"appleSignedCert\": \"{CERTIFICATE}\",\n \"encryptedDepServerToken\"\ + : \"{SERVER_TOKEN}\",\n \"dep\": {\n \"welcomeScreen\": {\n \ + \ \"title\": \"Welcome\",\n \"paragraph\": \"In just a few steps,\ + \ you will be working securely from your Mac.\",\n \"button\": \"continue\"\ + ,\n },\n },\n }'\n```" + operationId: applemdms_put + parameters: + - name: id + in: path + required: true + style: simple + explode: false + schema: + type: string + - name: x-org-id + in: header + description: Organization identifier that can be obtained from console settings. + required: false + style: simple + explode: false + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/apple-mdm-patch-input' + required: false + responses: + "200": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/AppleMDM' + "400": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorDetails' + "401": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "403": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "404": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "409": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "500": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + security: + - x-api-key: [] + x-scopes: + - mdm + x-codeSamples: + - lang: Shell + source: "curl --request PUT \\\n --url https://console.jumpcloud.com/api/v2/applemdms/{id}\ + \ \\\n --header 'content-type: application/json' \\\n --header 'x-api-key:\ + \ REPLACE_KEY_VALUE' \\\n --header 'x-org-id: SOME_STRING_VALUE' \\\n \ + \ --data '{\"ades\":{\"ios\":{\"defaultDeviceGroupObjectIds\":[\"string\"\ + ],\"enableZeroTouchEnrollment\":true,\"setupAssistantOptions\":[{\"option\"\ + :\"accessibility\"}],\"welcomeScreen\":{\"button\":\"string\",\"paragraph\"\ + :\"string\",\"title\":\"string\"}},\"macos\":{\"defaultDeviceGroupObjectIds\"\ + :[\"string\"],\"enableZeroTouchEnrollment\":true,\"setupAssistantOptions\"\ + :[{\"option\":\"accessibility\"}],\"welcomeScreen\":{\"button\":\"string\"\ + ,\"paragraph\":\"string\",\"title\":\"string\"}}},\"allowMobileUserEnrollment\"\ + :true,\"appleSignedCert\":\"string\",\"defaultIosUserEnrollmentDeviceGroupID\"\ + :\"string\",\"defaultSystemGroupID\":\"string\",\"dep\":{\"enableZeroTouchEnrollment\"\ + :true,\"setupAssistantOptions\":[{\"option\":\"accessibility\"}],\"welcomeScreen\"\ + :{\"button\":\"string\",\"paragraph\":\"string\",\"title\":\"string\"}},\"\ + encryptedDepServerToken\":\"string\",\"name\":\"string\"}'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/applemdms/{id}\"\ + \n\npayload = {\n \"ades\": {\n \"ios\": {\n \"defaultDeviceGroupObjectIds\"\ + : [\"string\"],\n \"enableZeroTouchEnrollment\": True,\n \ + \ \"setupAssistantOptions\": [{\"option\": \"accessibility\"}],\n\ + \ \"welcomeScreen\": {\n \"button\": \"string\"\ + ,\n \"paragraph\": \"string\",\n \"title\"\ + : \"string\"\n }\n },\n \"macos\": {\n \ + \ \"defaultDeviceGroupObjectIds\": [\"string\"],\n \"enableZeroTouchEnrollment\"\ + : True,\n \"setupAssistantOptions\": [{\"option\": \"accessibility\"\ + }],\n \"welcomeScreen\": {\n \"button\": \"string\"\ + ,\n \"paragraph\": \"string\",\n \"title\"\ + : \"string\"\n }\n }\n },\n \"allowMobileUserEnrollment\"\ + : True,\n \"appleSignedCert\": \"string\",\n \"defaultIosUserEnrollmentDeviceGroupID\"\ + : \"string\",\n \"defaultSystemGroupID\": \"string\",\n \"dep\": {\n\ + \ \"enableZeroTouchEnrollment\": True,\n \"setupAssistantOptions\"\ + : [{\"option\": \"accessibility\"}],\n \"welcomeScreen\": {\n \ + \ \"button\": \"string\",\n \"paragraph\": \"string\"\ + ,\n \"title\": \"string\"\n }\n },\n \"encryptedDepServerToken\"\ + : \"string\",\n \"name\": \"string\"\n}\nheaders = {\n \"x-org-id\"\ + : \"SOME_STRING_VALUE\",\n \"x-api-key\": \"REPLACE_KEY_VALUE\",\n \ + \ \"content-type\": \"application/json\"\n}\n\nresponse = requests.request(\"\ + PUT\", url, json=payload, headers=headers)\n\nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-org-id\", \"SOME_STRING_VALUE\")\n\ + $headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n$headers.Add(\"content-type\"\ + , \"application/json\")\n$response = Invoke-RestMethod -Uri 'https://console.jumpcloud.com/api/v2/applemdms/{id}'\ + \ -Method PUT -Headers $headers -ContentType 'application/json' -Body '{\"\ + ades\":{\"ios\":{\"defaultDeviceGroupObjectIds\":[\"string\"],\"enableZeroTouchEnrollment\"\ + :true,\"setupAssistantOptions\":[{\"option\":\"accessibility\"}],\"welcomeScreen\"\ + :{\"button\":\"string\",\"paragraph\":\"string\",\"title\":\"string\"}},\"\ + macos\":{\"defaultDeviceGroupObjectIds\":[\"string\"],\"enableZeroTouchEnrollment\"\ + :true,\"setupAssistantOptions\":[{\"option\":\"accessibility\"}],\"welcomeScreen\"\ + :{\"button\":\"string\",\"paragraph\":\"string\",\"title\":\"string\"}}},\"\ + allowMobileUserEnrollment\":true,\"appleSignedCert\":\"string\",\"defaultIosUserEnrollmentDeviceGroupID\"\ + :\"string\",\"defaultSystemGroupID\":\"string\",\"dep\":{\"enableZeroTouchEnrollment\"\ + :true,\"setupAssistantOptions\":[{\"option\":\"accessibility\"}],\"welcomeScreen\"\ + :{\"button\":\"string\",\"paragraph\":\"string\",\"title\":\"string\"}},\"\ + encryptedDepServerToken\":\"string\",\"name\":\"string\"}'" + x-codegen-request-body-name: body + delete: + tags: + - Apple MDM + summary: Delete an Apple MDM + description: "Removes an Apple MDM configuration.\n\nWarning: This is a destructive\ + \ operation and will remove your Apple Push Certificates. We will no longer\ + \ be able to manage your devices and the only recovery option is to re-register\ + \ all devices into MDM.\n\n#### Sample Request\n```\ncurl -X DELETE https://console.jumpcloud.com/api/v2/applemdms/{id}\ + \ \\\n -H 'accept: application/json' \\\n -H 'content-type: application/json'\ + \ \\\n -H 'x-api-key: {API_KEY}'\n```" + operationId: applemdms_delete + parameters: + - name: id + in: path + required: true + style: simple + explode: false + schema: + type: string + - name: x-org-id + in: header + description: Organization identifier that can be obtained from console settings. + required: false + style: simple + explode: false + schema: + type: string + responses: + "200": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/AppleMDM' + "400": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorDetails' + "401": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "403": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "404": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "409": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "500": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + security: + - x-api-key: [] + x-scopes: + - mdm + x-codeSamples: + - lang: Shell + source: "curl --request DELETE \\\n --url https://console.jumpcloud.com/api/v2/applemdms/{id}\ + \ \\\n --header 'x-api-key: REPLACE_KEY_VALUE' \\\n --header 'x-org-id:\ + \ SOME_STRING_VALUE'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/applemdms/{id}\"\ + \n\nheaders = {\n \"x-org-id\": \"SOME_STRING_VALUE\",\n \"x-api-key\"\ + : \"REPLACE_KEY_VALUE\"\n}\n\nresponse = requests.request(\"DELETE\", url,\ + \ headers=headers)\n\nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-org-id\", \"SOME_STRING_VALUE\")\n\ + $headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n$response = Invoke-RestMethod\ + \ -Uri 'https://console.jumpcloud.com/api/v2/applemdms/{id}' -Method DELETE\ + \ -Headers $headers" + /applications/{application_id}: + get: + tags: + - Applications + summary: Get an Application + description: The endpoint retrieves an Application. + operationId: applications_get + parameters: + - name: application_id + in: path + description: ObjectID of the Application. + required: true + style: simple + explode: false + schema: + type: string + - name: x-org-id + in: header + description: Organization identifier that can be obtained from console settings. + required: false + style: simple + explode: false + schema: + type: string + responses: + "200": + description: OK + content: + application/json: + schema: + type: object + x-content-type: application/json + security: + - x-api-key: [] + x-scopes: + - applications + - applications.readonly + x-codeSamples: + - lang: Shell + source: "curl --request GET \\\n --url https://console.jumpcloud.com/api/v2/applications/{application_id}\ + \ \\\n --header 'x-api-key: REPLACE_KEY_VALUE' \\\n --header 'x-org-id:\ + \ SOME_STRING_VALUE'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/applications/{application_id}\"\ + \n\nheaders = {\n \"x-org-id\": \"SOME_STRING_VALUE\",\n \"x-api-key\"\ + : \"REPLACE_KEY_VALUE\"\n}\n\nresponse = requests.request(\"GET\", url,\ + \ headers=headers)\n\nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-org-id\", \"SOME_STRING_VALUE\")\n\ + $headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n$response = Invoke-RestMethod\ + \ -Uri 'https://console.jumpcloud.com/api/v2/applications/{application_id}'\ + \ -Method GET -Headers $headers" + /applications/{application_id}/associations: + get: + tags: + - Graph + - Applications + summary: List the associations of an Application + description: "This endpoint will return the _direct_ associations of an Application.\ + \ A direct association can be a non-homogeneous relationship between 2 different\ + \ objects, for example Applications and User Groups.\n\n\n#### Sample Request\n\ + ```\ncurl -X GET 'https://console.jumpcloud.com/api/v2/applications/{Application_ID}/associations?targets=user_group\ + \ \\\n -H 'accept: application/json' \\\n -H 'content-type: application/json'\ + \ \\\n -H 'x-api-key: {API_KEY}'\n```" + operationId: graph_applicationAssociationsList + parameters: + - name: application_id + in: path + description: ObjectID of the Application. + required: true + style: simple + explode: false + schema: + type: string + - name: targets + in: query + description: Targets which a "application" can be associated to. + required: true + style: form + explode: false + schema: + type: array + items: + type: string + enum: + - user + - user_group + - name: limit + in: query + description: The number of records to return at once. Limited to 100. + required: false + style: form + explode: true + schema: + type: integer + default: 10 + - name: skip + in: query + description: The offset into the records to return. + required: false + style: form + explode: true + schema: + minimum: 0 + type: integer + default: 0 + - name: x-org-id + in: header + description: Organization identifier that can be obtained from console settings. + required: false + style: simple + explode: false + schema: + type: string + responses: + "200": + description: OK + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/GraphConnection' + x-content-type: application/json + security: + - x-api-key: [] + x-scopes: + - applications + - applications.readonly + x-codeSamples: + - lang: Shell + source: "curl --request GET \\\n --url 'https://console.jumpcloud.com/api/v2/applications/{application_id}/associations?targets=SOME_ARRAY_VALUE&limit=10&skip=0'\ + \ \\\n --header 'x-api-key: REPLACE_KEY_VALUE' \\\n --header 'x-org-id:\ + \ SOME_STRING_VALUE'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/applications/{application_id}/associations\"\ + \n\nquerystring = {\"targets\":\"SOME_ARRAY_VALUE\",\"limit\":\"10\",\"\ + skip\":\"0\"}\n\nheaders = {\n \"x-org-id\": \"SOME_STRING_VALUE\",\n\ + \ \"x-api-key\": \"REPLACE_KEY_VALUE\"\n}\n\nresponse = requests.request(\"\ + GET\", url, headers=headers, params=querystring)\n\nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-org-id\", \"SOME_STRING_VALUE\")\n\ + $headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n$response = Invoke-RestMethod\ + \ -Uri 'https://console.jumpcloud.com/api/v2/applications/{application_id}/associations?targets=SOME_ARRAY_VALUE&limit=10&skip=0'\ + \ -Method GET -Headers $headers" + post: + tags: + - Graph + - Applications + summary: Manage the associations of an Application + description: "This endpoint allows you to manage the _direct_ associations of\ + \ an Application. A direct association can be a non-homogeneous relationship\ + \ between 2 different objects, for example Application and User Groups.\n\n\ + #### Sample Request\n```\ncurl -X POST 'https://console.jumpcloud.com/api/v2/applications/{Application_ID}/associations'\ + \ \\\n -H 'accept: application/json' \\\n -H 'content-type: application/json'\ + \ \\\n -H 'x-api-key: {API_KEY}' \\\n -d '{\n \"op\": \"add\",\n \"\ + type\": \"user_group\",\n \"id\": \"{Group_ID}\"\n }'\n```" + operationId: graph_applicationAssociationsPost + parameters: + - name: application_id + in: path + description: ObjectID of the Application. + required: true + style: simple + explode: false + schema: + type: string + - name: x-org-id + in: header + description: Organization identifier that can be obtained from console settings. + required: false + style: simple + explode: false + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/GraphOperation-Application' + required: false + responses: + "204": + description: OK + content: {} + security: + - x-api-key: [] + x-scopes: + - applications + x-codeSamples: + - lang: Shell + source: "curl --request POST \\\n --url https://console.jumpcloud.com/api/v2/applications/{application_id}/associations\ + \ \\\n --header 'content-type: application/json' \\\n --header 'x-api-key:\ + \ REPLACE_KEY_VALUE' \\\n --header 'x-org-id: SOME_STRING_VALUE' \\\n \ + \ --data '{\"id\":\"string\",\"op\":\"add\",\"attributes\":{},\"type\":\"\ + user\"}'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/applications/{application_id}/associations\"\ + \n\npayload = {\n \"id\": \"string\",\n \"op\": \"add\",\n \"attributes\"\ + : {},\n \"type\": \"user\"\n}\nheaders = {\n \"x-org-id\": \"SOME_STRING_VALUE\"\ + ,\n \"x-api-key\": \"REPLACE_KEY_VALUE\",\n \"content-type\": \"application/json\"\ + \n}\n\nresponse = requests.request(\"POST\", url, json=payload, headers=headers)\n\ + \nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-org-id\", \"SOME_STRING_VALUE\")\n\ + $headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n$headers.Add(\"content-type\"\ + , \"application/json\")\n$response = Invoke-RestMethod -Uri 'https://console.jumpcloud.com/api/v2/applications/{application_id}/associations'\ + \ -Method POST -Headers $headers -ContentType 'application/json' -Body '{\"\ + id\":\"string\",\"op\":\"add\",\"attributes\":{},\"type\":\"user\"}'" + x-codegen-request-body-name: body + /applications/{application_id}/import/users: + get: + tags: + - Applications + - SCIM Import + summary: Get a list of users to import from an Application IdM service provider + description: Get a list of users to import from an Application IdM service provider. + operationId: import_users + parameters: + - name: application_id + in: path + description: ObjectID of the Application. + required: true + style: simple + explode: false + schema: + type: string + - name: filter + in: query + description: Filter users by a search term + required: false + style: form + explode: true + schema: + type: string + - name: query + in: query + description: URL query to merge with the service provider request + required: false + style: form + explode: true + schema: + type: string + - name: sort + in: query + description: Sort users by supported fields + required: false + style: form + explode: true + schema: + type: string + enum: + - "" + - firstname + - lastname + - email + - name: sortOrder + in: query + required: false + style: form + explode: true + schema: + type: string + default: asc + enum: + - asc + - desc + - name: x-org-id + in: header + description: Organization identifier that can be obtained from console settings. + required: false + style: simple + explode: false + schema: + type: string + - name: limit + in: query + description: The number of records to return at once. Limited to 100. + required: false + style: form + explode: true + schema: + type: integer + default: 10 + - name: skip + in: query + description: The offset into the records to return. + required: false + style: form + explode: true + schema: + minimum: 0 + type: integer + default: 0 + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/importUsersResponse' + security: + - x-api-key: [] + x-scopes: + - applications + x-codeSamples: + - lang: Shell + source: "curl --request GET \\\n --url 'https://console.jumpcloud.com/api/v2/applications/{application_id}/import/users?filter=&query=&sort=&sortOrder=asc&limit=10&skip=0'\ + \ \\\n --header 'x-api-key: REPLACE_KEY_VALUE' \\\n --header 'x-org-id:\ + \ SOME_STRING_VALUE'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/applications/{application_id}/import/users\"\ + \n\nquerystring = {\"filter\":\"\",\"query\":\"\",\"sort\":\"\",\"sortOrder\"\ + :\"asc\",\"limit\":\"10\",\"skip\":\"0\"}\n\nheaders = {\n \"x-org-id\"\ + : \"SOME_STRING_VALUE\",\n \"x-api-key\": \"REPLACE_KEY_VALUE\"\n}\n\n\ + response = requests.request(\"GET\", url, headers=headers, params=querystring)\n\ + \nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-org-id\", \"SOME_STRING_VALUE\")\n\ + $headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n$response = Invoke-RestMethod\ + \ -Uri 'https://console.jumpcloud.com/api/v2/applications/{application_id}/import/users?filter=&query=&sort=&sortOrder=asc&limit=10&skip=0'\ + \ -Method GET -Headers $headers" + /applications/{application_id}/logo: + post: + tags: + - Applications + description: "This endpoint sets the logo for an application.\n\n#### Sample\ + \ Request\n```\ncurl -X POST 'https://console.jumpcloud.com/api/v2/applications/{Application_ID}/logo\ + \ \\\n -H 'accept: application/json' \\\n -H 'content-type: application/json'\ + \ \\\n -H 'x-api-key: {API_KEY}'\n```" + operationId: applications_postLogo + parameters: + - name: application_id + in: path + required: true + style: simple + explode: false + schema: + type: string + - name: x-org-id + in: header + description: Organization identifier that can be obtained from console settings. + required: false + style: simple + explode: false + schema: + type: string + requestBody: + content: + multipart/form-data: + schema: + $ref: '#/components/schemas/application_id_logo_body' + responses: + "204": + description: NO_CONTENT + content: {} + "400": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorDetails' + "401": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "403": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "404": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "409": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "500": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + security: + - x-api-key: [] + x-scopes: + - applications + x-codeSamples: + - lang: Shell + source: "curl --request POST \\\n --url https://console.jumpcloud.com/api/v2/applications/{application_id}/logo\ + \ \\\n --header 'accept: multipart/form-data' \\\n --header 'x-api-key:\ + \ REPLACE_KEY_VALUE' \\\n --header 'x-org-id: SOME_STRING_VALUE'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/applications/{application_id}/logo\"\ + \n\nheaders = {\n \"accept\": \"multipart/form-data\",\n \"x-org-id\"\ + : \"SOME_STRING_VALUE\",\n \"x-api-key\": \"REPLACE_KEY_VALUE\"\n}\n\n\ + response = requests.request(\"POST\", url, headers=headers)\n\nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"accept\", \"multipart/form-data\")\n\ + $headers.Add(\"x-org-id\", \"SOME_STRING_VALUE\")\n$headers.Add(\"x-api-key\"\ + , \"REPLACE_KEY_VALUE\")\n$response = Invoke-RestMethod -Uri 'https://console.jumpcloud.com/api/v2/applications/{application_id}/logo'\ + \ -Method POST -Headers $headers" + delete: + tags: + - Applications + - Image + summary: Delete application image + description: Deletes the specified image from an application + operationId: applications_deleteLogo + parameters: + - name: application_id + in: path + required: true + style: simple + explode: false + schema: + type: string + - name: x-org-id + in: header + description: Organization identifier that can be obtained from console settings. + required: false + style: simple + explode: false + schema: + type: string + responses: + "204": + description: NO_CONTENT + content: {} + "400": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorDetails' + "401": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "403": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "404": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "409": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "500": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + security: + - x-api-key: [] + x-scopes: + - applications + x-codeSamples: + - lang: Shell + source: "curl --request DELETE \\\n --url https://console.jumpcloud.com/api/v2/applications/{application_id}/logo\ + \ \\\n --header 'x-api-key: REPLACE_KEY_VALUE' \\\n --header 'x-org-id:\ + \ SOME_STRING_VALUE'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/applications/{application_id}/logo\"\ + \n\nheaders = {\n \"x-org-id\": \"SOME_STRING_VALUE\",\n \"x-api-key\"\ + : \"REPLACE_KEY_VALUE\"\n}\n\nresponse = requests.request(\"DELETE\", url,\ + \ headers=headers)\n\nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-org-id\", \"SOME_STRING_VALUE\")\n\ + $headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n$response = Invoke-RestMethod\ + \ -Uri 'https://console.jumpcloud.com/api/v2/applications/{application_id}/logo'\ + \ -Method DELETE -Headers $headers" + /applications/{application_id}/usergroups: + get: + tags: + - Graph + - Applications + summary: List the User Groups bound to an Application + description: "This endpoint will return all Users Groups bound to an Application,\ + \ either directly or indirectly, essentially traversing the JumpCloud Graph\ + \ for your Organization.\n\nEach element will contain the group's type, id,\ + \ attributes and paths.\n\nThe `attributes` object is a key/value hash of\ + \ compiled graph attributes for all paths followed.\n\nThe `paths` array enumerates\ + \ each path from this Application to the corresponding User Group; this array\ + \ represents all grouping and/or associations that would have to be removed\ + \ to deprovision the User Group from this Application.\n\nSee `/members` and\ + \ `/associations` endpoints to manage those collections.\n\n#### Sample Request\n\ + ```\ncurl -X GET https://console.jumpcloud.com/api/v2/applications/{Application_ID}/usergroups\ + \ \\\n -H 'accept: application/json' \\\n -H 'content-type: application/json'\ + \ \\\n -H 'x-api-key: {API_KEY}'\n```" + operationId: graph_applicationTraverseUserGroup + parameters: + - name: application_id + in: path + description: ObjectID of the Application. + required: true + style: simple + explode: false + schema: + type: string + - name: limit + in: query + description: The number of records to return at once. Limited to 100. + required: false + style: form + explode: true + schema: + type: integer + default: 10 + - name: x-org-id + in: header + description: Organization identifier that can be obtained from console settings. + required: false + style: simple + explode: false + schema: + type: string + - name: skip + in: query + description: The offset into the records to return. + required: false + style: form + explode: true + schema: + minimum: 0 + type: integer + default: 0 + - name: filter + in: query + description: "A filter to apply to the query.\n\n**Filter structure**: `::`.\n\ + \n**field** = Populate with a valid field from an endpoint response.\n\n\ + **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between,\ + \ search, in.\n_Note: v1 operators differ from v2 operators._\n\n**value**\ + \ = Populate with the value you want to search for. Is case sensitive. Supports\ + \ wild cards.\n\n**EX:** `GET /api/v2/groups?filter=name:eq:Test+Group`" + required: false + style: form + explode: false + schema: + type: array + items: + type: string + responses: + "200": + description: OK + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/GraphObjectWithPaths' + x-content-type: application/json + security: + - x-api-key: [] + x-scopes: + - groups + - groups.readonly + x-codeSamples: + - lang: Shell + source: "curl --request GET \\\n --url 'https://console.jumpcloud.com/api/v2/applications/{application_id}/usergroups?limit=10&skip=0'\ + \ \\\n --header 'x-api-key: REPLACE_KEY_VALUE' \\\n --header 'x-org-id:\ + \ SOME_STRING_VALUE'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/applications/{application_id}/usergroups\"\ + \n\nquerystring = {\"limit\":\"10\",\"skip\":\"0\"}\n\nheaders = {\n \ + \ \"x-org-id\": \"SOME_STRING_VALUE\",\n \"x-api-key\": \"REPLACE_KEY_VALUE\"\ + \n}\n\nresponse = requests.request(\"GET\", url, headers=headers, params=querystring)\n\ + \nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-org-id\", \"SOME_STRING_VALUE\")\n\ + $headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n$response = Invoke-RestMethod\ + \ -Uri 'https://console.jumpcloud.com/api/v2/applications/{application_id}/usergroups?limit=10&skip=0'\ + \ -Method GET -Headers $headers" + /applications/{application_id}/users: + get: + tags: + - Graph + - Applications + summary: List the Users bound to an Application + description: "This endpoint will return all Users bound to an Application, either\ + \ directly or indirectly, essentially traversing the JumpCloud Graph for your\ + \ Organization.\n\nEach element will contain the type, id, attributes and\ + \ paths.\n\nThe `attributes` object is a key/value hash of compiled graph\ + \ attributes for all paths followed.\n\nThe `paths` array enumerates each\ + \ path from this Application to the corresponding User; this array represents\ + \ all grouping and/or associations that would have to be removed to deprovision\ + \ the User from this Application.\n\nSee `/members` and `/associations` endpoints\ + \ to manage those collections.\n\n#### Sample Request\n```\ncurl -X GET https://console.jumpcloud.com/api/v2/applications/{Application_ID}/users\ + \ \\\n -H 'accept: application/json' \\\n -H 'content-type: application/json'\ + \ \\\n -H 'x-api-key: {API_KEY}'\n```" + operationId: graph_applicationTraverseUser + parameters: + - name: application_id + in: path + description: ObjectID of the Application. + required: true + style: simple + explode: false + schema: + type: string + - name: limit + in: query + description: The number of records to return at once. Limited to 100. + required: false + style: form + explode: true + schema: + type: integer + default: 10 + - name: x-org-id + in: header + description: Organization identifier that can be obtained from console settings. + required: false + style: simple + explode: false + schema: + type: string + - name: skip + in: query + description: The offset into the records to return. + required: false + style: form + explode: true + schema: + minimum: 0 + type: integer + default: 0 + - name: filter + in: query + description: "A filter to apply to the query.\n\n**Filter structure**: `::`.\n\ + \n**field** = Populate with a valid field from an endpoint response.\n\n\ + **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between,\ + \ search, in.\n_Note: v1 operators differ from v2 operators._\n\n**value**\ + \ = Populate with the value you want to search for. Is case sensitive. Supports\ + \ wild cards.\n\n**EX:** `GET /api/v2/groups?filter=name:eq:Test+Group`" + required: false + style: form + explode: false + schema: + type: array + items: + type: string + responses: + "200": + description: OK + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/GraphObjectWithPaths' + x-content-type: application/json + security: + - x-api-key: [] + x-scopes: + - users + - users.readonly + x-codeSamples: + - lang: Shell + source: "curl --request GET \\\n --url 'https://console.jumpcloud.com/api/v2/applications/{application_id}/users?limit=10&skip=0'\ + \ \\\n --header 'x-api-key: REPLACE_KEY_VALUE' \\\n --header 'x-org-id:\ + \ SOME_STRING_VALUE'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/applications/{application_id}/users\"\ + \n\nquerystring = {\"limit\":\"10\",\"skip\":\"0\"}\n\nheaders = {\n \ + \ \"x-org-id\": \"SOME_STRING_VALUE\",\n \"x-api-key\": \"REPLACE_KEY_VALUE\"\ + \n}\n\nresponse = requests.request(\"GET\", url, headers=headers, params=querystring)\n\ + \nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-org-id\", \"SOME_STRING_VALUE\")\n\ + $headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n$response = Invoke-RestMethod\ + \ -Uri 'https://console.jumpcloud.com/api/v2/applications/{application_id}/users?limit=10&skip=0'\ + \ -Method GET -Headers $headers" + /authn/policies: + get: + tags: + - Authentication Policies + summary: List Authentication Policies + description: "Get a list of all authentication policies.\n\n#### Sample Request\n\ + ```\ncurl https://console.jumpcloud.com/api/v2/authn/policies \\\n -H 'accept:\ + \ application/json' \\\n -H 'content-type: application/json' \\\n -H 'x-api-key:\ + \ {API_KEY}'\n```" + operationId: authnpolicies_list + parameters: + - name: x-org-id + in: header + description: Organization identifier that can be obtained from console settings. + required: false + style: simple + explode: false + schema: + type: string + - name: x-total-count + in: header + required: false + style: simple + explode: false + schema: + type: integer + - name: limit + in: query + description: The number of records to return at once. Limited to 100. + required: false + style: form + explode: true + schema: + type: integer + default: 10 + - name: skip + in: query + description: The offset into the records to return. + required: false + style: form + explode: true + schema: + minimum: 0 + type: integer + default: 0 + - name: filter + in: query + description: "A filter to apply to the query.\n\n**Filter structure**: `::`.\n\ + \n**field** = Populate with a valid field from an endpoint response.\n\n\ + **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between,\ + \ search, in.\n_Note: v1 operators differ from v2 operators._\n\n**value**\ + \ = Populate with the value you want to search for. Is case sensitive. Supports\ + \ wild cards.\n\n**EX:** `GET /api/v2/groups?filter=name:eq:Test+Group`" + required: false + style: form + explode: false + schema: + type: array + items: + type: string + - name: sort + in: query + description: "The comma separated fields used to sort the collection.\nDefault\ + \ sort is ascending, prefix with `-` to sort descending.\n" + required: false + style: form + explode: false + schema: + type: array + items: + type: string + responses: + "200": + description: OK + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/AuthnPolicy' + x-content-type: application/json + "400": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorDetails' + "401": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "403": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "404": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "409": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "500": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + security: + - x-api-key: [] + x-scopes: + - authn + - authn.readonly + x-codeSamples: + - lang: Shell + source: "curl --request GET \\\n --url 'https://console.jumpcloud.com/api/v2/authn/policies?limit=10&skip=0'\ + \ \\\n --header 'x-api-key: REPLACE_KEY_VALUE' \\\n --header 'x-org-id:\ + \ SOME_STRING_VALUE' \\\n --header 'x-total-count: SOME_INTEGER_VALUE'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/authn/policies\"\ + \n\nquerystring = {\"limit\":\"10\",\"skip\":\"0\"}\n\nheaders = {\n \ + \ \"x-org-id\": \"SOME_STRING_VALUE\",\n \"x-total-count\": \"SOME_INTEGER_VALUE\"\ + ,\n \"x-api-key\": \"REPLACE_KEY_VALUE\"\n}\n\nresponse = requests.request(\"\ + GET\", url, headers=headers, params=querystring)\n\nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-org-id\", \"SOME_STRING_VALUE\")\n\ + $headers.Add(\"x-total-count\", \"SOME_INTEGER_VALUE\")\n$headers.Add(\"\ + x-api-key\", \"REPLACE_KEY_VALUE\")\n$response = Invoke-RestMethod -Uri\ + \ 'https://console.jumpcloud.com/api/v2/authn/policies?limit=10&skip=0'\ + \ -Method GET -Headers $headers" + post: + tags: + - Authentication Policies + summary: Create an Authentication Policy + description: "Create an authentication policy.\n\n#### Sample Request\n```\n\ + curl -X POST https://console.jumpcloud.com/api/v2/authn/policies \\\n -H\ + \ 'accept: application/json' \\\n -H 'content-type: application/json' \\\n\ + \ -H 'x-api-key: {API_KEY}' \\\n -d '{\n \"name\": \"Sample Policy\"\ + ,\n \"disabled\": false,\n \"effect\": {\n \"action\": \"allow\"\ + \n },\n \"targets\": {\n \"users\": {\n \"inclusions\":\ + \ [\"ALL\"]\n },\n \"userGroups\": {\n \"exclusions\": [{USER_GROUP_ID}]\n\ + \ },\n \"resources\": [ {\"type\": \"user_portal\" } ]\n },\n\ + \ \"conditions\":{\n \"ipAddressIn\": [{IP_LIST_ID}]\n }\n }'\n\ + ```" + operationId: authnpolicies_post + parameters: + - name: x-org-id + in: header + description: Organization identifier that can be obtained from console settings. + required: false + style: simple + explode: false + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AuthnPolicyInput' + required: false + responses: + "201": + description: Created + content: + application/json: + schema: + $ref: '#/components/schemas/AuthnPolicy' + "400": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorDetails' + "401": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "403": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "404": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "409": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "500": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + security: + - x-api-key: [] + x-scopes: + - authn + - authn.readonly + x-codeSamples: + - lang: Shell + source: "curl --request POST \\\n --url https://console.jumpcloud.com/api/v2/authn/policies\ + \ \\\n --header 'content-type: application/json' \\\n --header 'x-api-key:\ + \ REPLACE_KEY_VALUE' \\\n --header 'x-org-id: SOME_STRING_VALUE' \\\n \ + \ --data '{\"conditions\":{},\"description\":\"string\",\"disabled\":true,\"\ + effect\":{\"action\":\"allow\",\"obligations\":{\"mfa\":{\"required\":true},\"\ + userVerification\":{\"requirement\":\"none\"}}},\"name\":\"string\",\"targets\"\ + :{\"resources\":[{\"id\":\"string\",\"type\":\"user_portal\"}],\"userAttributes\"\ + :{\"exclusions\":[{\"field\":\"string\",\"operator\":\"EQ\",\"value\":null}],\"\ + inclusions\":[{\"field\":\"string\",\"operator\":\"EQ\",\"value\":null}]},\"\ + userGroups\":{\"exclusions\":[\"string\"],\"inclusions\":[\"string\"]},\"\ + users\":{\"inclusions\":[\"string\"]}},\"type\":\"user_portal\"}'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/authn/policies\"\ + \n\npayload = {\n \"conditions\": {},\n \"description\": \"string\"\ + ,\n \"disabled\": True,\n \"effect\": {\n \"action\": \"allow\"\ + ,\n \"obligations\": {\n \"mfa\": {\"required\": True},\n\ + \ \"userVerification\": {\"requirement\": \"none\"}\n \ + \ }\n },\n \"name\": \"string\",\n \"targets\": {\n \"resources\"\ + : [\n {\n \"id\": \"string\",\n \ + \ \"type\": \"user_portal\"\n }\n ],\n \"userAttributes\"\ + : {\n \"exclusions\": [\n {\n \ + \ \"field\": \"string\",\n \"operator\": \"EQ\",\n\ + \ \"value\": None\n }\n ],\n\ + \ \"inclusions\": [\n {\n \"\ + field\": \"string\",\n \"operator\": \"EQ\",\n \ + \ \"value\": None\n }\n ]\n \ + \ },\n \"userGroups\": {\n \"exclusions\": [\"string\"\ + ],\n \"inclusions\": [\"string\"]\n },\n \"users\"\ + : {\"inclusions\": [\"string\"]}\n },\n \"type\": \"user_portal\"\n\ + }\nheaders = {\n \"x-org-id\": \"SOME_STRING_VALUE\",\n \"x-api-key\"\ + : \"REPLACE_KEY_VALUE\",\n \"content-type\": \"application/json\"\n}\n\ + \nresponse = requests.request(\"POST\", url, json=payload, headers=headers)\n\ + \nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-org-id\", \"SOME_STRING_VALUE\")\n\ + $headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n$headers.Add(\"content-type\"\ + , \"application/json\")\n$response = Invoke-RestMethod -Uri 'https://console.jumpcloud.com/api/v2/authn/policies'\ + \ -Method POST -Headers $headers -ContentType 'application/json' -Body '{\"\ + conditions\":{},\"description\":\"string\",\"disabled\":true,\"effect\"\ + :{\"action\":\"allow\",\"obligations\":{\"mfa\":{\"required\":true},\"userVerification\"\ + :{\"requirement\":\"none\"}}},\"name\":\"string\",\"targets\":{\"resources\"\ + :[{\"id\":\"string\",\"type\":\"user_portal\"}],\"userAttributes\":{\"exclusions\"\ + :[{\"field\":\"string\",\"operator\":\"EQ\",\"value\":null}],\"inclusions\"\ + :[{\"field\":\"string\",\"operator\":\"EQ\",\"value\":null}]},\"userGroups\"\ + :{\"exclusions\":[\"string\"],\"inclusions\":[\"string\"]},\"users\":{\"\ + inclusions\":[\"string\"]}},\"type\":\"user_portal\"}'" + x-codegen-request-body-name: body + /authn/policies/{id}: + get: + tags: + - Authentication Policies + summary: Get an authentication policy + description: "Return a specific authentication policy.\n\n#### Sample Request\n\ + ```\ncurl https://console.jumpcloud.com/api/v2/authn/policies/{id} \\\n -H\ + \ 'accept: application/json' \\\n -H 'content-type: application/json' \\\n\ + \ -H 'x-api-key: {API_KEY}'\n```" + operationId: authnpolicies_get + parameters: + - name: id + in: path + description: Unique identifier of the authentication policy + required: true + style: simple + explode: false + schema: + type: string + - name: x-org-id + in: header + description: Organization identifier that can be obtained from console settings. + required: false + style: simple + explode: false + schema: + type: string + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AuthnPolicy' + "400": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorDetails' + "401": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "403": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "404": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "409": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "500": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + security: + - x-api-key: [] + x-scopes: + - authn + - authn.readonly + x-codeSamples: + - lang: Shell + source: "curl --request GET \\\n --url https://console.jumpcloud.com/api/v2/authn/policies/{id}\ + \ \\\n --header 'x-api-key: REPLACE_KEY_VALUE' \\\n --header 'x-org-id:\ + \ SOME_STRING_VALUE'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/authn/policies/{id}\"\ + \n\nheaders = {\n \"x-org-id\": \"SOME_STRING_VALUE\",\n \"x-api-key\"\ + : \"REPLACE_KEY_VALUE\"\n}\n\nresponse = requests.request(\"GET\", url,\ + \ headers=headers)\n\nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-org-id\", \"SOME_STRING_VALUE\")\n\ + $headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n$response = Invoke-RestMethod\ + \ -Uri 'https://console.jumpcloud.com/api/v2/authn/policies/{id}' -Method\ + \ GET -Headers $headers" + delete: + tags: + - Authentication Policies + summary: Delete Authentication Policy + description: "Delete the specified authentication policy.\n\n#### Sample Request\n\ + ```\ncurl -X DELETE https://console.jumpcloud.com/api/v2/authn/policies/{id}\ + \ \\\n -H 'accept: application/json' \\\n -H 'content-type: application/json'\ + \ \\\n -H 'x-api-key: {API_KEY}'\n```" + operationId: authnpolicies_delete + parameters: + - name: id + in: path + description: Unique identifier of the authentication policy + required: true + style: simple + explode: false + schema: + type: string + - name: x-org-id + in: header + description: Organization identifier that can be obtained from console settings. + required: false + style: simple + explode: false + schema: + type: string + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AuthnPolicy' + "400": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorDetails' + "401": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "403": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "404": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "409": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "500": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + security: + - x-api-key: [] + x-scopes: + - authn + - authn.readonly + x-codeSamples: + - lang: Shell + source: "curl --request DELETE \\\n --url https://console.jumpcloud.com/api/v2/authn/policies/{id}\ + \ \\\n --header 'x-api-key: REPLACE_KEY_VALUE' \\\n --header 'x-org-id:\ + \ SOME_STRING_VALUE'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/authn/policies/{id}\"\ + \n\nheaders = {\n \"x-org-id\": \"SOME_STRING_VALUE\",\n \"x-api-key\"\ + : \"REPLACE_KEY_VALUE\"\n}\n\nresponse = requests.request(\"DELETE\", url,\ + \ headers=headers)\n\nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-org-id\", \"SOME_STRING_VALUE\")\n\ + $headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n$response = Invoke-RestMethod\ + \ -Uri 'https://console.jumpcloud.com/api/v2/authn/policies/{id}' -Method\ + \ DELETE -Headers $headers" + patch: + tags: + - Authentication Policies + summary: Patch Authentication Policy + description: "Patch the specified authentication policy.\n\n#### Sample Request\n\ + ```\ncurl -X PATCH https://console.jumpcloud.com/api/v2/authn/policies/{id}\ + \ \\\n -H 'accept: application/json' \\\n -H 'content-type: application/json'\ + \ \\\n -H 'x-api-key: {API_KEY}' \\\n -d '{ \"disabled\": false }'\n```" + operationId: authnpolicies_patch + parameters: + - name: id + in: path + description: Unique identifier of the authentication policy + required: true + style: simple + explode: false + schema: + type: string + - name: x-org-id + in: header + description: Organization identifier that can be obtained from console settings. + required: false + style: simple + explode: false + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AuthnPolicyInput' + required: false + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AuthnPolicy' + "400": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorDetails' + "401": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "403": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "404": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "409": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "500": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + security: + - x-api-key: [] + x-scopes: + - authn + x-codeSamples: + - lang: Shell + source: "curl --request PATCH \\\n --url https://console.jumpcloud.com/api/v2/authn/policies/{id}\ + \ \\\n --header 'content-type: application/json' \\\n --header 'x-api-key:\ + \ REPLACE_KEY_VALUE' \\\n --header 'x-org-id: SOME_STRING_VALUE' \\\n \ + \ --data '{\"conditions\":{},\"description\":\"string\",\"disabled\":true,\"\ + effect\":{\"action\":\"allow\",\"obligations\":{\"mfa\":{\"required\":true},\"\ + userVerification\":{\"requirement\":\"none\"}}},\"name\":\"string\",\"targets\"\ + :{\"resources\":[{\"id\":\"string\",\"type\":\"user_portal\"}],\"userAttributes\"\ + :{\"exclusions\":[{\"field\":\"string\",\"operator\":\"EQ\",\"value\":null}],\"\ + inclusions\":[{\"field\":\"string\",\"operator\":\"EQ\",\"value\":null}]},\"\ + userGroups\":{\"exclusions\":[\"string\"],\"inclusions\":[\"string\"]},\"\ + users\":{\"inclusions\":[\"string\"]}},\"type\":\"user_portal\"}'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/authn/policies/{id}\"\ + \n\npayload = {\n \"conditions\": {},\n \"description\": \"string\"\ + ,\n \"disabled\": True,\n \"effect\": {\n \"action\": \"allow\"\ + ,\n \"obligations\": {\n \"mfa\": {\"required\": True},\n\ + \ \"userVerification\": {\"requirement\": \"none\"}\n \ + \ }\n },\n \"name\": \"string\",\n \"targets\": {\n \"resources\"\ + : [\n {\n \"id\": \"string\",\n \ + \ \"type\": \"user_portal\"\n }\n ],\n \"userAttributes\"\ + : {\n \"exclusions\": [\n {\n \ + \ \"field\": \"string\",\n \"operator\": \"EQ\",\n\ + \ \"value\": None\n }\n ],\n\ + \ \"inclusions\": [\n {\n \"\ + field\": \"string\",\n \"operator\": \"EQ\",\n \ + \ \"value\": None\n }\n ]\n \ + \ },\n \"userGroups\": {\n \"exclusions\": [\"string\"\ + ],\n \"inclusions\": [\"string\"]\n },\n \"users\"\ + : {\"inclusions\": [\"string\"]}\n },\n \"type\": \"user_portal\"\n\ + }\nheaders = {\n \"x-org-id\": \"SOME_STRING_VALUE\",\n \"x-api-key\"\ + : \"REPLACE_KEY_VALUE\",\n \"content-type\": \"application/json\"\n}\n\ + \nresponse = requests.request(\"PATCH\", url, json=payload, headers=headers)\n\ + \nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-org-id\", \"SOME_STRING_VALUE\")\n\ + $headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n$headers.Add(\"content-type\"\ + , \"application/json\")\n$response = Invoke-RestMethod -Uri 'https://console.jumpcloud.com/api/v2/authn/policies/{id}'\ + \ -Method PATCH -Headers $headers -ContentType 'application/json' -Body\ + \ '{\"conditions\":{},\"description\":\"string\",\"disabled\":true,\"effect\"\ + :{\"action\":\"allow\",\"obligations\":{\"mfa\":{\"required\":true},\"userVerification\"\ + :{\"requirement\":\"none\"}}},\"name\":\"string\",\"targets\":{\"resources\"\ + :[{\"id\":\"string\",\"type\":\"user_portal\"}],\"userAttributes\":{\"exclusions\"\ + :[{\"field\":\"string\",\"operator\":\"EQ\",\"value\":null}],\"inclusions\"\ + :[{\"field\":\"string\",\"operator\":\"EQ\",\"value\":null}]},\"userGroups\"\ + :{\"exclusions\":[\"string\"],\"inclusions\":[\"string\"]},\"users\":{\"\ + inclusions\":[\"string\"]}},\"type\":\"user_portal\"}'" + x-codegen-request-body-name: body + /bulk/users: + post: + tags: + - Bulk Job Requests + summary: Bulk Users Create + description: "The endpoint allows you to create a bulk job to asynchronously\ + \ create users.\nSee [Create a System User](https://docs.jumpcloud.com/api/1.0/index.html#operation/systemusers_post)\n\ + for the full list of attributes.\n\n#### Default User State\nThe `state` of\ + \ each user in the request can be explicitly passed in or\nomitted. If `state`\ + \ is omitted, then the user will get created\nusing the value returned from\ + \ the\n[Get an Organization](https://docs.jumpcloud.com/api/1.0/index.html#operation/organizations_get)\n\ + endpoint. The default user state for bulk created users depends on the\n`creation-source`\ + \ header. For `creation-source:jumpcloud:bulk` the\ndefault state is stored\ + \ in `settings.newSystemUserStateDefaults.csvImport`.\nFor other `creation-source`\ + \ header values, the default state is stored in\n`settings.newSystemUserStateDefaults.applicationImport`\n\ + \nThese default state values can be changed in the admin portal settings\n\ + or by using the\n[Update an Organization](https://docs.jumpcloud.com/api/1.0/index.html#operation/organization_put)\n\ + endpoint.\n\n#### Sample Request\n\n```\ncurl -X POST https://console.jumpcloud.com/api/v2/bulk/users\ + \ \\\n-H 'Accept: application/json' \\\n-H 'Content-Type: application/json'\ + \ \\\n-H 'x-api-key: {API_KEY}' \\\n-d '[\n {\n \"email\":\"{email}\"\ + ,\n \"firstname\":\"{firstname}\",\n \"lastname\":\"{firstname}\",\n\ + \ \"username\":\"{username}\",\n \"attributes\":[\n {\n \ + \ \"name\":\"EmployeeID\",\n \"value\":\"0000\"\n },\n {\n\ + \ \"name\":\"Custom\",\n \"value\":\"attribute\"\n }\n\ + \ ]\n }\n]'\n```" + operationId: bulk_usersCreate + parameters: + - name: x-org-id + in: header + description: Organization identifier that can be obtained from console settings. + required: false + style: simple + explode: false + schema: + type: string + - name: creation-source + in: header + description: "Defines the creation-source header for gapps, o365 and workdays\ + \ requests.\nIf the header isn't sent, the default value is `jumpcloud:bulk`,\ + \ if you send the header with a malformed value you receive a 400 error.\n" + required: false + style: simple + explode: false + schema: + type: string + default: jumpcloud:bulk + enum: + - jumpcloud:gapps + - jumpcloud:o365 + - jumpcloud:workday + - jumpcloud:scim + - jumpcloud:bulk + - jumpcloud:custom_integration + requestBody: + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/bulk-user-create' + required: false + responses: + "201": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/job-id' + security: + - x-api-key: [] + x-scopes: + - users + x-codeSamples: + - lang: Shell + source: "curl --request POST \\\n --url https://console.jumpcloud.com/api/v2/bulk/users\ + \ \\\n --header 'content-type: application/json' \\\n --header 'creation-source:\ + \ jumpcloud:bulk' \\\n --header 'x-api-key: REPLACE_KEY_VALUE' \\\n --header\ + \ 'x-org-id: SOME_STRING_VALUE' \\\n --data '[{\"attributes\":[{}],\"email\"\ + :\"string\",\"firstname\":\"string\",\"lastname\":\"string\",\"username\"\ + :\"string\"}]'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/bulk/users\"\ + \n\npayload = [\n {\n \"attributes\": [{}],\n \"email\"\ + : \"string\",\n \"firstname\": \"string\",\n \"lastname\"\ + : \"string\",\n \"username\": \"string\"\n }\n]\nheaders = {\n\ + \ \"x-org-id\": \"SOME_STRING_VALUE\",\n \"creation-source\": \"jumpcloud:bulk\"\ + ,\n \"x-api-key\": \"REPLACE_KEY_VALUE\",\n \"content-type\": \"application/json\"\ + \n}\n\nresponse = requests.request(\"POST\", url, json=payload, headers=headers)\n\ + \nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-org-id\", \"SOME_STRING_VALUE\")\n\ + $headers.Add(\"creation-source\", \"jumpcloud:bulk\")\n$headers.Add(\"x-api-key\"\ + , \"REPLACE_KEY_VALUE\")\n$headers.Add(\"content-type\", \"application/json\"\ + )\n$response = Invoke-RestMethod -Uri 'https://console.jumpcloud.com/api/v2/bulk/users'\ + \ -Method POST -Headers $headers -ContentType 'application/json' -Body '[{\"\ + attributes\":[{}],\"email\":\"string\",\"firstname\":\"string\",\"lastname\"\ + :\"string\",\"username\":\"string\"}]'" + x-codegen-request-body-name: body + patch: + tags: + - Bulk Job Requests + summary: Bulk Users Update + description: "The endpoint allows you to create a bulk job to asynchronously\ + \ update users. See [Update a System User](https://docs.jumpcloud.com/api/1.0/index.html#operation/systemusers_put)\ + \ for full list of attributes.\n\n#### Sample Request \n```\ncurl -X PATCH\ + \ https://console.jumpcloud.com/api/v2/bulk/users \\\n -H 'Accept: application/json'\ + \ \\\n -H 'Content-Type: application/json' \\\n -H 'x-api-key: {API_KEY}'\ + \ \\\n -d '[\n\t{\n\t \"id\":\"5be9fb4ddb01290001e85109\",\n\t\t\"firstname\"\ + :\"{UPDATED_FIRSTNAME}\",\n\t\t\"department\":\"{UPDATED_DEPARTMENT}\",\n\t\ + \t\"attributes\":[\n\t\t\t{\"name\":\"Custom\",\"value\":\"{ATTRIBUTE_VALUE}\"\ + }\n\t\t]\n\t},\n\t{\n\t \"id\":\"5be9fb4ddb01290001e85109\",\n\t\t\"firstname\"\ + :\"{UPDATED_FIRSTNAME}\",\n\t\t\"costCenter\":\"{UPDATED_COST_CENTER}\",\n\ + \t\t\"phoneNumbers\":[\n\t\t\t{\"type\":\"home\",\"number\":\"{HOME_PHONE_NUMBER}\"\ + },\n\t\t\t{\"type\":\"work\",\"number\":\"{WORK_PHONE_NUMBER}\"}\n\t\t]\n\t\ + }\n]\n```" + operationId: bulk_usersUpdate + parameters: + - name: x-org-id + in: header + description: Organization identifier that can be obtained from console settings. + required: false + style: simple + explode: false + schema: + type: string + requestBody: + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/bulk-user-update' + required: false + responses: + "201": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/job-id' + security: + - x-api-key: [] + x-scopes: + - users + x-codeSamples: + - lang: Shell + source: "curl --request PATCH \\\n --url https://console.jumpcloud.com/api/v2/bulk/users\ + \ \\\n --header 'content-type: application/json' \\\n --header 'x-api-key:\ + \ REPLACE_KEY_VALUE' \\\n --header 'x-org-id: SOME_STRING_VALUE' \\\n \ + \ --data '[{\"attributes\":[{}],\"email\":\"string\",\"firstname\":\"string\"\ + ,\"id\":\"string\",\"lastname\":\"string\",\"username\":\"string\"}]'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/bulk/users\"\ + \n\npayload = [\n {\n \"attributes\": [{}],\n \"email\"\ + : \"string\",\n \"firstname\": \"string\",\n \"id\": \"string\"\ + ,\n \"lastname\": \"string\",\n \"username\": \"string\"\n\ + \ }\n]\nheaders = {\n \"x-org-id\": \"SOME_STRING_VALUE\",\n \"\ + x-api-key\": \"REPLACE_KEY_VALUE\",\n \"content-type\": \"application/json\"\ + \n}\n\nresponse = requests.request(\"PATCH\", url, json=payload, headers=headers)\n\ + \nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-org-id\", \"SOME_STRING_VALUE\")\n\ + $headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n$headers.Add(\"content-type\"\ + , \"application/json\")\n$response = Invoke-RestMethod -Uri 'https://console.jumpcloud.com/api/v2/bulk/users'\ + \ -Method PATCH -Headers $headers -ContentType 'application/json' -Body\ + \ '[{\"attributes\":[{}],\"email\":\"string\",\"firstname\":\"string\",\"\ + id\":\"string\",\"lastname\":\"string\",\"username\":\"string\"}]'" + x-codegen-request-body-name: body + /bulk/users/{job_id}/results: + get: + tags: + - Bulk Job Requests + summary: List Bulk Users Results + description: "This endpoint will return the results of particular user import\ + \ or update job request.\n\n#### Sample Request\n```\ncurl -X GET \\\n https://console.jumpcloud.com/api/v2/bulk/users/{ImportJobID}/results\ + \ \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\ + \ \\\n -H 'x-api-key: {API_KEY}'\n ```" + operationId: bulk_usersCreateResults + parameters: + - name: job_id + in: path + required: true + style: simple + explode: false + schema: + type: string + - name: limit + in: query + description: The number of records to return at once. Limited to 100. + required: false + style: form + explode: true + schema: + type: integer + default: 10 + - name: skip + in: query + description: The offset into the records to return. + required: false + style: form + explode: true + schema: + minimum: 0 + type: integer + default: 0 + - name: x-org-id + in: header + description: Organization identifier that can be obtained from console settings. + required: false + style: simple + explode: false + schema: + type: string + responses: + "200": + description: "" + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/job-workresult' + x-content-type: application/json + security: + - x-api-key: [] + x-scopes: + - users + - users.readonly + x-codeSamples: + - lang: Shell + source: "curl --request GET \\\n --url 'https://console.jumpcloud.com/api/v2/bulk/users/{job_id}/results?limit=10&skip=0'\ + \ \\\n --header 'x-api-key: REPLACE_KEY_VALUE' \\\n --header 'x-org-id:\ + \ SOME_STRING_VALUE'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/bulk/users/{job_id}/results\"\ + \n\nquerystring = {\"limit\":\"10\",\"skip\":\"0\"}\n\nheaders = {\n \ + \ \"x-org-id\": \"SOME_STRING_VALUE\",\n \"x-api-key\": \"REPLACE_KEY_VALUE\"\ + \n}\n\nresponse = requests.request(\"GET\", url, headers=headers, params=querystring)\n\ + \nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-org-id\", \"SOME_STRING_VALUE\")\n\ + $headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n$response = Invoke-RestMethod\ + \ -Uri 'https://console.jumpcloud.com/api/v2/bulk/users/{job_id}/results?limit=10&skip=0'\ + \ -Method GET -Headers $headers" + /bulk/userstates: + get: + tags: + - Bulk Job Requests + summary: List Scheduled Userstate Change Jobs + description: "The endpoint allows you to list scheduled statechange jobs.\n\ + #### Sample Request\n```\ncurl -X GET \"https://console.jumpcloud.com/api/v2/bulk/userstates\"\ + \ \\\n -H 'x-api-key: {API_KEY}' \\\n -H 'Content-Type: application/json'\ + \ \\\n -H 'Accept: application/json'\n```" + operationId: bulk_userStatesList + parameters: + - name: limit + in: query + description: The number of records to return at once. Limited to 100. + required: false + style: form + explode: true + schema: + type: integer + default: 10 + - name: filter + in: query + description: "A filter to apply to the query.\n\n**Filter structure**: `::`.\n\ + \n**field** = Populate with a valid field from an endpoint response.\n\n\ + **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between,\ + \ search, in.\n_Note: v1 operators differ from v2 operators._\n\n**value**\ + \ = Populate with the value you want to search for. Is case sensitive. Supports\ + \ wild cards.\n\n**EX:** `GET /api/v2/groups?filter=name:eq:Test+Group`" + required: false + style: form + explode: false + schema: + type: array + items: + type: string + - name: skip + in: query + description: The offset into the records to return. + required: false + style: form + explode: true + schema: + minimum: 0 + type: integer + default: 0 + - name: x-org-id + in: header + description: Organization identifier that can be obtained from console settings. + required: false + style: simple + explode: false + schema: + type: string + - name: userid + in: query + description: The systemuser id to filter by. + required: false + style: form + explode: true + schema: + type: string + responses: + "200": + description: OK + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/scheduled-userstate-result' + x-content-type: application/json + "400": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorDetails' + "401": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "403": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "404": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "409": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "500": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + security: + - x-api-key: [] + x-scopes: + - users + - users.readonly + x-codeSamples: + - lang: Shell + source: "curl --request GET \\\n --url 'https://console.jumpcloud.com/api/v2/bulk/userstates?limit=10&skip=0&userid=SOME_STRING_VALUE'\ + \ \\\n --header 'x-api-key: REPLACE_KEY_VALUE' \\\n --header 'x-org-id:\ + \ SOME_STRING_VALUE'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/bulk/userstates\"\ + \n\nquerystring = {\"limit\":\"10\",\"skip\":\"0\",\"userid\":\"SOME_STRING_VALUE\"\ + }\n\nheaders = {\n \"x-org-id\": \"SOME_STRING_VALUE\",\n \"x-api-key\"\ + : \"REPLACE_KEY_VALUE\"\n}\n\nresponse = requests.request(\"GET\", url,\ + \ headers=headers, params=querystring)\n\nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-org-id\", \"SOME_STRING_VALUE\")\n\ + $headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n$response = Invoke-RestMethod\ + \ -Uri 'https://console.jumpcloud.com/api/v2/bulk/userstates?limit=10&skip=0&userid=SOME_STRING_VALUE'\ + \ -Method GET -Headers $headers" + post: + tags: + - Bulk Job Requests + summary: Create Scheduled Userstate Job + description: "This endpoint allows you to create scheduled statechange jobs.\n\ + #### Sample Request\n```\ncurl -X POST \"https://console.jumpcloud.com/api/v2/bulk/userstates\"\ + \ \\\n -H 'x-api-key: {API_KEY}' \\\n -H 'Content-Type: application/json'\ + \ \\\n -H 'Accept: application/json' \\\n -d '{\n \"user_ids\": [\"{User_ID_1}\"\ + , \"{User_ID_2}\", \"{User_ID_3}\"],\n \"state\": \"SUSPENDED\",\n \"\ + start_date\": \"2000-01-01T00:00:00.000Z\"\n }'\n```" + operationId: bulk_userStatesCreate + parameters: + - name: x-org-id + in: header + description: Organization identifier that can be obtained from console settings. + required: false + style: simple + explode: false + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/bulk-scheduled-statechange-create' + required: false + responses: + "201": + description: Created + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/scheduled-userstate-result' + x-content-type: application/json + "400": + description: Bad Request + content: + application/json: + schema: + type: object + x-content-type: application/json + "401": + description: Unauthorized + content: + application/json: + schema: + type: object + x-content-type: application/json + "500": + description: Internal Server Error + content: + application/json: + schema: + type: object + x-content-type: application/json + security: + - x-api-key: [] + x-scopes: + - users + x-codeSamples: + - lang: Shell + source: "curl --request POST \\\n --url https://console.jumpcloud.com/api/v2/bulk/userstates\ + \ \\\n --header 'content-type: application/json' \\\n --header 'x-api-key:\ + \ REPLACE_KEY_VALUE' \\\n --header 'x-org-id: SOME_STRING_VALUE' \\\n \ + \ --data '{\"activation_email_override\":\"string\",\"send_activation_emails\"\ + :true,\"start_date\":\"2019-08-24T14:15:22Z\",\"state\":\"ACTIVATED\",\"\ + user_ids\":[\"string\"]}'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/bulk/userstates\"\ + \n\npayload = {\n \"activation_email_override\": \"string\",\n \"\ + send_activation_emails\": True,\n \"start_date\": \"2019-08-24T14:15:22Z\"\ + ,\n \"state\": \"ACTIVATED\",\n \"user_ids\": [\"string\"]\n}\nheaders\ + \ = {\n \"x-org-id\": \"SOME_STRING_VALUE\",\n \"x-api-key\": \"REPLACE_KEY_VALUE\"\ + ,\n \"content-type\": \"application/json\"\n}\n\nresponse = requests.request(\"\ + POST\", url, json=payload, headers=headers)\n\nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-org-id\", \"SOME_STRING_VALUE\")\n\ + $headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n$headers.Add(\"content-type\"\ + , \"application/json\")\n$response = Invoke-RestMethod -Uri 'https://console.jumpcloud.com/api/v2/bulk/userstates'\ + \ -Method POST -Headers $headers -ContentType 'application/json' -Body '{\"\ + activation_email_override\":\"string\",\"send_activation_emails\":true,\"\ + start_date\":\"2019-08-24T14:15:22Z\",\"state\":\"ACTIVATED\",\"user_ids\"\ + :[\"string\"]}'" + x-codegen-request-body-name: body + /bulk/userstates/eventlist/next: + get: + tags: + - Bulk Job Requests + summary: Gets the next scheduled state change for each user in a list of system + users + description: "This endpoint is used to lookup the next upcoming scheduled state\ + \ change for each user in the\ngiven list. The users parameter is limited\ + \ to 100 items per request.\n#### Sample Request\n```\ncurl -X GET \"https://console.jumpcloud.com/api/v2/bulk/userstates/eventlist/next?users={UserID1},{UserID2},{UserID3}\"\ + \ \\\n -H 'x-api-key: {API_KEY}' \\\n -H 'Content-Type: application/json'\ + \ \\\n -H 'Accept: application/json'\n```" + operationId: bulk_userStatesGetNextScheduled + parameters: + - name: users + in: query + description: A list of system user IDs + required: true + style: form + explode: false + schema: + maxItems: 100 + minItems: 0 + type: array + items: + type: string + - name: limit + in: query + description: The number of records to return at once. Limited to 100. + required: false + style: form + explode: true + schema: + type: integer + default: 10 + - name: skip + in: query + description: The offset into the records to return. + required: false + style: form + explode: true + schema: + minimum: 0 + type: integer + default: 0 + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/inline_response_200' + "400": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorDetails' + "401": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "403": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "404": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "500": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + security: + - x-api-key: [] + x-scopes: + - users + x-codeSamples: + - lang: Shell + source: "curl --request GET \\\n --url 'https://console.jumpcloud.com/api/v2/bulk/userstates/eventlist/next?users=SOME_ARRAY_VALUE&limit=10&skip=0'\ + \ \\\n --header 'x-api-key: REPLACE_KEY_VALUE'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/bulk/userstates/eventlist/next\"\ + \n\nquerystring = {\"users\":\"SOME_ARRAY_VALUE\",\"limit\":\"10\",\"skip\"\ + :\"0\"}\n\nheaders = {\"x-api-key\": \"REPLACE_KEY_VALUE\"}\n\nresponse\ + \ = requests.request(\"GET\", url, headers=headers, params=querystring)\n\ + \nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n\ + $response = Invoke-RestMethod -Uri 'https://console.jumpcloud.com/api/v2/bulk/userstates/eventlist/next?users=SOME_ARRAY_VALUE&limit=10&skip=0'\ + \ -Method GET -Headers $headers" + /bulk/userstates/{id}: + delete: + tags: + - Bulk Job Requests + summary: Delete Scheduled Userstate Job + description: "This endpoint deletes a scheduled statechange job.\n#### Sample\ + \ Request\n```\ncurl -X DELETE \"https://console.jumpcloud.com/api/v2/bulk/userstates/{ScheduledJob_ID}\"\ + \ \\\n -H 'x-api-key: {API_KEY}' \\\n -H 'Content-Type: application/json'\ + \ \\\n -H 'Accept: application/json'\n```" + operationId: bulk_userStatesDelete + parameters: + - name: id + in: path + description: Unique identifier of the scheduled statechange job. + required: true + style: simple + explode: false + schema: + type: string + - name: x-org-id + in: header + description: Organization identifier that can be obtained from console settings. + required: false + style: simple + explode: false + schema: + type: string + responses: + "204": + description: No Content + content: {} + "400": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorDetails' + "401": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "403": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "404": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "409": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "500": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + security: + - x-api-key: [] + x-scopes: + - users + x-codeSamples: + - lang: Shell + source: "curl --request DELETE \\\n --url https://console.jumpcloud.com/api/v2/bulk/userstates/{id}\ + \ \\\n --header 'x-api-key: REPLACE_KEY_VALUE' \\\n --header 'x-org-id:\ + \ SOME_STRING_VALUE'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/bulk/userstates/{id}\"\ + \n\nheaders = {\n \"x-org-id\": \"SOME_STRING_VALUE\",\n \"x-api-key\"\ + : \"REPLACE_KEY_VALUE\"\n}\n\nresponse = requests.request(\"DELETE\", url,\ + \ headers=headers)\n\nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-org-id\", \"SOME_STRING_VALUE\")\n\ + $headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n$response = Invoke-RestMethod\ + \ -Uri 'https://console.jumpcloud.com/api/v2/bulk/userstates/{id}' -Method\ + \ DELETE -Headers $headers" + /commandqueue/{workflow_instance_id}: + delete: + tags: + - Commands + summary: Cancel all queued commands for an organization by workflow instance + Id + description: "This endpoint allows all queued commands for one workflow instance\ + \ to be canceled.\n\n#### Sample Request\n```\n curl -X DELETE https://console.jumpcloud.com/api/v2/commandqueue/{workflow_instance_id}\ + \ \\\n -H 'accept: application/json' \\\n -H 'content-type: application/json'\ + \ \\\n -H 'x-api-key: {API_KEY}'\n```" + operationId: commands_cancelQueuedCommandsByWorkflowInstanceId + parameters: + - name: workflow_instance_id + in: path + description: Workflow instance Id of the queued commands to cancel. + required: true + style: simple + explode: false + schema: + type: string + - name: x-org-id + in: header + description: Organization identifier that can be obtained from console settings. + required: false + style: simple + explode: false + schema: + type: string + responses: + "204": + description: OK + content: {} + "400": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorDetails' + "401": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "403": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "404": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "409": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "500": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + security: + - x-api-key: [] + x-scopes: + - systems + - systems.readonly + x-codeSamples: + - lang: Shell + source: "curl --request DELETE \\\n --url https://console.jumpcloud.com/api/v2/commandqueue/{workflow_instance_id}\ + \ \\\n --header 'x-api-key: REPLACE_KEY_VALUE' \\\n --header 'x-org-id:\ + \ SOME_STRING_VALUE'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/commandqueue/{workflow_instance_id}\"\ + \n\nheaders = {\n \"x-org-id\": \"SOME_STRING_VALUE\",\n \"x-api-key\"\ + : \"REPLACE_KEY_VALUE\"\n}\n\nresponse = requests.request(\"DELETE\", url,\ + \ headers=headers)\n\nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-org-id\", \"SOME_STRING_VALUE\")\n\ + $headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n$response = Invoke-RestMethod\ + \ -Uri 'https://console.jumpcloud.com/api/v2/commandqueue/{workflow_instance_id}'\ + \ -Method DELETE -Headers $headers" + /commandresult/workflows: + get: + tags: + - Command Results + summary: List all Command Results by Workflow + description: "This endpoint returns all command results, grouped by workflowInstanceId.\n\ + \n#### Sample Request\n```\ncurl -X GET https://console.jumpcloud.com/api/v2/commandresult/workflows\ + \ \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\ + \ \\\n -H 'x-api-key:{API_KEY}'\n ```" + operationId: commands_listResultsByWorkflow + parameters: + - name: x-org-id + in: header + description: Organization identifier that can be obtained from console settings. + required: false + style: simple + explode: false + schema: + type: string + - name: limit + in: query + required: false + style: form + explode: true + schema: + maximum: 100 + minimum: 0 + type: integer + default: 10 + - name: filter + in: query + description: "A filter to apply to the query.\n\n**Filter structure**: `::`.\n\ + \n**field** = Populate with a valid field from an endpoint response.\n\n\ + **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between,\ + \ search, in.\n_Note: v1 operators differ from v2 operators._\n\n**value**\ + \ = Populate with the value you want to search for. Is case sensitive. Supports\ + \ wild cards.\n\n**EX:** `GET /api/v2/groups?filter=name:eq:Test+Group`" + required: false + style: form + explode: false + schema: + type: array + items: + type: string + - name: skip + in: query + description: The offset into the records to return. + required: false + style: form + explode: true + schema: + minimum: 0 + type: integer + default: 0 + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/CommandResultList' + "401": + description: Unauthorized + content: {} + security: + - x-api-key: [] + x-scopes: + - commands + - commands.readonly + x-codeSamples: + - lang: Shell + source: "curl --request GET \\\n --url 'https://console.jumpcloud.com/api/v2/commandresult/workflows?limit=10&skip=0'\ + \ \\\n --header 'x-api-key: REPLACE_KEY_VALUE' \\\n --header 'x-org-id:\ + \ SOME_STRING_VALUE'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/commandresult/workflows\"\ + \n\nquerystring = {\"limit\":\"10\",\"skip\":\"0\"}\n\nheaders = {\n \ + \ \"x-org-id\": \"SOME_STRING_VALUE\",\n \"x-api-key\": \"REPLACE_KEY_VALUE\"\ + \n}\n\nresponse = requests.request(\"GET\", url, headers=headers, params=querystring)\n\ + \nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-org-id\", \"SOME_STRING_VALUE\")\n\ + $headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n$response = Invoke-RestMethod\ + \ -Uri 'https://console.jumpcloud.com/api/v2/commandresult/workflows?limit=10&skip=0'\ + \ -Method GET -Headers $headers" + /commands/{command_id}/associations: + get: + tags: + - Graph + - Commands + summary: List the associations of a Command + description: "This endpoint will return the _direct_ associations of this Command.\n\ + \nA direct association can be a non-homogeneous relationship between 2 different\ + \ objects, for example Commands and User Groups.\n\n\n#### Sample Request\n\ + ```\ncurl -X GET https://console.jumpcloud.com/api/v2/commands/{Command_ID}/associations?targets=system_group\ + \ \\\n -H 'accept: application/json' \\\n -H 'content-type: application/json'\ + \ \\\n -H 'x-api-key: {API_KEY}'\n```" + operationId: graph_commandAssociationsList + parameters: + - name: command_id + in: path + description: ObjectID of the Command. + required: true + style: simple + explode: false + schema: + type: string + - name: targets + in: query + description: Targets which a "command" can be associated to. + required: true + style: form + explode: false + schema: + type: array + items: + type: string + enum: + - system + - system_group + - name: limit + in: query + description: The number of records to return at once. Limited to 100. + required: false + style: form + explode: true + schema: + type: integer + default: 10 + - name: skip + in: query + description: The offset into the records to return. + required: false + style: form + explode: true + schema: + minimum: 0 + type: integer + default: 0 + - name: x-org-id + in: header + description: Organization identifier that can be obtained from console settings. + required: false + style: simple + explode: false + schema: + type: string + responses: + "200": + description: OK + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/GraphConnection' + x-content-type: application/json + security: + - x-api-key: [] + x-scopes: + - commands + x-codeSamples: + - lang: Shell + source: "curl --request GET \\\n --url 'https://console.jumpcloud.com/api/v2/commands/{command_id}/associations?targets=SOME_ARRAY_VALUE&limit=10&skip=0'\ + \ \\\n --header 'x-api-key: REPLACE_KEY_VALUE' \\\n --header 'x-org-id:\ + \ SOME_STRING_VALUE'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/commands/{command_id}/associations\"\ + \n\nquerystring = {\"targets\":\"SOME_ARRAY_VALUE\",\"limit\":\"10\",\"\ + skip\":\"0\"}\n\nheaders = {\n \"x-org-id\": \"SOME_STRING_VALUE\",\n\ + \ \"x-api-key\": \"REPLACE_KEY_VALUE\"\n}\n\nresponse = requests.request(\"\ + GET\", url, headers=headers, params=querystring)\n\nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-org-id\", \"SOME_STRING_VALUE\")\n\ + $headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n$response = Invoke-RestMethod\ + \ -Uri 'https://console.jumpcloud.com/api/v2/commands/{command_id}/associations?targets=SOME_ARRAY_VALUE&limit=10&skip=0'\ + \ -Method GET -Headers $headers" + post: + tags: + - Graph + - Commands + summary: Manage the associations of a Command + description: "This endpoint will allow you to manage the _direct_ associations\ + \ of this Command.\n\nA direct association can be a non-homogeneous relationship\ + \ between 2 different objects, for example Commands and User Groups.\n\n\n\ + #### Sample Request\n```\n curl -X POST https://console.jumpcloud.com/api/v2/commands/{Command_ID}/associations\ + \ \\\n -H 'accept: application/json' \\\n -H 'content-type: application/json'\ + \ \\\n -H 'x-api-key: {API_KEY}' \\\n -d '{\n \"op\": \"add\",\n \"\ + type\": \"system_group\",\n \"id\": \"Group_ID\"\n }'\n```" + operationId: graph_commandAssociationsPost + parameters: + - name: command_id + in: path + description: ObjectID of the Command. + required: true + style: simple + explode: false + schema: + type: string + - name: x-org-id + in: header + description: Organization identifier that can be obtained from console settings. + required: false + style: simple + explode: false + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/GraphOperation-Command' + required: false + responses: + "204": + description: OK + content: {} + security: + - x-api-key: [] + x-scopes: + - commands + x-codeSamples: + - lang: Shell + source: "curl --request POST \\\n --url https://console.jumpcloud.com/api/v2/commands/{command_id}/associations\ + \ \\\n --header 'content-type: application/json' \\\n --header 'x-api-key:\ + \ REPLACE_KEY_VALUE' \\\n --header 'x-org-id: SOME_STRING_VALUE' \\\n \ + \ --data '{\"id\":\"string\",\"op\":\"add\",\"attributes\":{},\"type\":\"\ + system\"}'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/commands/{command_id}/associations\"\ + \n\npayload = {\n \"id\": \"string\",\n \"op\": \"add\",\n \"attributes\"\ + : {},\n \"type\": \"system\"\n}\nheaders = {\n \"x-org-id\": \"SOME_STRING_VALUE\"\ + ,\n \"x-api-key\": \"REPLACE_KEY_VALUE\",\n \"content-type\": \"application/json\"\ + \n}\n\nresponse = requests.request(\"POST\", url, json=payload, headers=headers)\n\ + \nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-org-id\", \"SOME_STRING_VALUE\")\n\ + $headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n$headers.Add(\"content-type\"\ + , \"application/json\")\n$response = Invoke-RestMethod -Uri 'https://console.jumpcloud.com/api/v2/commands/{command_id}/associations'\ + \ -Method POST -Headers $headers -ContentType 'application/json' -Body '{\"\ + id\":\"string\",\"op\":\"add\",\"attributes\":{},\"type\":\"system\"}'" + x-codegen-request-body-name: body + /commands/{command_id}/systemgroups: + get: + tags: + - Graph + - Commands + summary: List the System Groups bound to a Command + description: "This endpoint will return all System Groups bound to a Command,\ + \ either directly or indirectly, essentially traversing the JumpCloud Graph\ + \ for your Organization.\n\nEach element will contain the group's type, id,\ + \ attributes and paths.\n\nThe `attributes` object is a key/value hash of\ + \ compiled graph attributes for all paths followed.\n\nThe `paths` array enumerates\ + \ each path from this Command to the corresponding System Group; this array\ + \ represents all grouping and/or associations that would have to be removed\ + \ to deprovision the System Group from this Command.\n\nSee `/members` and\ + \ `/associations` endpoints to manage those collections.\n\n#### Sample Request\n\ + ```\ncurl -X GET https://console.jumpcloud.com/api/v2/commands/{Command_ID}/systemgroups\ + \ \\\n -H 'accept: application/json' \\\n -H 'content-type: application/json'\ + \ \\\n -H 'x-api-key: {API_KEY}'\n```" + operationId: graph_commandTraverseSystemGroup + parameters: + - name: command_id + in: path + description: ObjectID of the Command. + required: true + style: simple + explode: false + schema: + type: string + - name: limit + in: query + description: The number of records to return at once. Limited to 100. + required: false + style: form + explode: true + schema: + type: integer + default: 10 + - name: x-org-id + in: header + description: Organization identifier that can be obtained from console settings. + required: false + style: simple + explode: false + schema: + type: string + - name: skip + in: query + description: The offset into the records to return. + required: false + style: form + explode: true + schema: + minimum: 0 + type: integer + default: 0 + - name: filter + in: query + description: "A filter to apply to the query.\n\n**Filter structure**: `::`.\n\ + \n**field** = Populate with a valid field from an endpoint response.\n\n\ + **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between,\ + \ search, in.\n_Note: v1 operators differ from v2 operators._\n\n**value**\ + \ = Populate with the value you want to search for. Is case sensitive. Supports\ + \ wild cards.\n\n**EX:** `GET /api/v2/groups?filter=name:eq:Test+Group`" + required: false + style: form + explode: false + schema: + type: array + items: + type: string + responses: + "200": + description: OK + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/GraphObjectWithPaths' + x-content-type: application/json + security: + - x-api-key: [] + x-scopes: + - groups + - groups.readonly + x-codeSamples: + - lang: Shell + source: "curl --request GET \\\n --url 'https://console.jumpcloud.com/api/v2/commands/{command_id}/systemgroups?limit=10&skip=0'\ + \ \\\n --header 'x-api-key: REPLACE_KEY_VALUE' \\\n --header 'x-org-id:\ + \ SOME_STRING_VALUE'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/commands/{command_id}/systemgroups\"\ + \n\nquerystring = {\"limit\":\"10\",\"skip\":\"0\"}\n\nheaders = {\n \ + \ \"x-org-id\": \"SOME_STRING_VALUE\",\n \"x-api-key\": \"REPLACE_KEY_VALUE\"\ + \n}\n\nresponse = requests.request(\"GET\", url, headers=headers, params=querystring)\n\ + \nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-org-id\", \"SOME_STRING_VALUE\")\n\ + $headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n$response = Invoke-RestMethod\ + \ -Uri 'https://console.jumpcloud.com/api/v2/commands/{command_id}/systemgroups?limit=10&skip=0'\ + \ -Method GET -Headers $headers" + /commands/{command_id}/systems: + get: + tags: + - Graph + - Commands + summary: List the Systems bound to a Command + description: "This endpoint will return all Systems bound to a Command, either\ + \ directly or indirectly, essentially traversing the JumpCloud Graph for your\ + \ Organization.\n\nEach element will contain the type, id, attributes and\ + \ paths.\n\nThe `attributes` object is a key/value hash of compiled graph\ + \ attributes for all paths followed.\n\nThe `paths` array enumerates each\ + \ path from this Command to the corresponding System; this array represents\ + \ all grouping and/or associations that would have to be removed to deprovision\ + \ the System from this Command.\n\nSee `/members` and `/associations` endpoints\ + \ to manage those collections.\n\n#### Sample Request\n```\ncurl -X GET https://console.jumpcloud.com/api/v2/commands/{Command_ID}/systems\ + \ \\\n -H 'accept: application/json' \\\n -H 'content-type: application/json'\ + \ \\\n -H 'x-api-key: {API_KEY}'\n```" + operationId: graph_commandTraverseSystem + parameters: + - name: command_id + in: path + description: ObjectID of the Command. + required: true + style: simple + explode: false + schema: + type: string + - name: limit + in: query + description: The number of records to return at once. Limited to 100. + required: false + style: form + explode: true + schema: + type: integer + default: 10 + - name: x-org-id + in: header + description: Organization identifier that can be obtained from console settings. + required: false + style: simple + explode: false + schema: + type: string + - name: skip + in: query + description: The offset into the records to return. + required: false + style: form + explode: true + schema: + minimum: 0 + type: integer + default: 0 + - name: filter + in: query + description: "A filter to apply to the query.\n\n**Filter structure**: `::`.\n\ + \n**field** = Populate with a valid field from an endpoint response.\n\n\ + **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between,\ + \ search, in.\n_Note: v1 operators differ from v2 operators._\n\n**value**\ + \ = Populate with the value you want to search for. Is case sensitive. Supports\ + \ wild cards.\n\n**EX:** `GET /api/v2/groups?filter=name:eq:Test+Group`" + required: false + style: form + explode: false + schema: + type: array + items: + type: string + responses: + "200": + description: OK + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/GraphObjectWithPaths' + x-content-type: application/json + security: + - x-api-key: [] + x-scopes: + - systems + - systems.readonly + x-codeSamples: + - lang: Shell + source: "curl --request GET \\\n --url 'https://console.jumpcloud.com/api/v2/commands/{command_id}/systems?limit=10&skip=0'\ + \ \\\n --header 'x-api-key: REPLACE_KEY_VALUE' \\\n --header 'x-org-id:\ + \ SOME_STRING_VALUE'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/commands/{command_id}/systems\"\ + \n\nquerystring = {\"limit\":\"10\",\"skip\":\"0\"}\n\nheaders = {\n \ + \ \"x-org-id\": \"SOME_STRING_VALUE\",\n \"x-api-key\": \"REPLACE_KEY_VALUE\"\ + \n}\n\nresponse = requests.request(\"GET\", url, headers=headers, params=querystring)\n\ + \nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-org-id\", \"SOME_STRING_VALUE\")\n\ + $headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n$response = Invoke-RestMethod\ + \ -Uri 'https://console.jumpcloud.com/api/v2/commands/{command_id}/systems?limit=10&skip=0'\ + \ -Method GET -Headers $headers" + /customemail/templates: + get: + tags: + - Custom Emails + summary: List custom email templates + description: Get the list of custom email templates + operationId: customEmails_getTemplates + responses: + "200": + description: OK + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/CustomEmailTemplate' + x-content-type: application/json + "400": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorDetails' + "401": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "403": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "500": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + security: + - x-api-key: [] + x-scopes: + - organizations + x-codeSamples: + - lang: Shell + source: "curl --request GET \\\n --url https://console.jumpcloud.com/api/v2/customemail/templates\ + \ \\\n --header 'x-api-key: REPLACE_KEY_VALUE'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/customemail/templates\"\ + \n\nheaders = {\"x-api-key\": \"REPLACE_KEY_VALUE\"}\n\nresponse = requests.request(\"\ + GET\", url, headers=headers)\n\nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n\ + $response = Invoke-RestMethod -Uri 'https://console.jumpcloud.com/api/v2/customemail/templates'\ + \ -Method GET -Headers $headers" + /customemails: + post: + tags: + - Custom Emails + summary: Create custom email configuration + description: Create the custom email configuration for the specified custom + email type + operationId: customEmails_create + parameters: + - name: x-org-id + in: header + description: Organization identifier that can be obtained from console settings. + required: false + style: simple + explode: false + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/CustomEmail' + required: false + responses: + "201": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/CustomEmail' + "400": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorDetails' + "401": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "403": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "404": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "409": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "500": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + security: + - x-api-key: [] + x-scopes: + - organizations + x-codeSamples: + - lang: Shell + source: "curl --request POST \\\n --url https://console.jumpcloud.com/api/v2/customemails\ + \ \\\n --header 'content-type: application/json' \\\n --header 'x-api-key:\ + \ REPLACE_KEY_VALUE' \\\n --header 'x-org-id: SOME_STRING_VALUE' \\\n \ + \ --data '{\"body\":\"string\",\"button\":\"string\",\"header\":\"string\"\ + ,\"nextStepContactInfo\":\"string\",\"subject\":\"string\",\"title\":\"\ + string\",\"type\":\"activate_gapps_user\"}'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/customemails\"\ + \n\npayload = {\n \"body\": \"string\",\n \"button\": \"string\",\n\ + \ \"header\": \"string\",\n \"nextStepContactInfo\": \"string\",\n\ + \ \"subject\": \"string\",\n \"title\": \"string\",\n \"type\"\ + : \"activate_gapps_user\"\n}\nheaders = {\n \"x-org-id\": \"SOME_STRING_VALUE\"\ + ,\n \"x-api-key\": \"REPLACE_KEY_VALUE\",\n \"content-type\": \"application/json\"\ + \n}\n\nresponse = requests.request(\"POST\", url, json=payload, headers=headers)\n\ + \nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-org-id\", \"SOME_STRING_VALUE\")\n\ + $headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n$headers.Add(\"content-type\"\ + , \"application/json\")\n$response = Invoke-RestMethod -Uri 'https://console.jumpcloud.com/api/v2/customemails'\ + \ -Method POST -Headers $headers -ContentType 'application/json' -Body '{\"\ + body\":\"string\",\"button\":\"string\",\"header\":\"string\",\"nextStepContactInfo\"\ + :\"string\",\"subject\":\"string\",\"title\":\"string\",\"type\":\"activate_gapps_user\"\ + }'" + x-codegen-request-body-name: body + /customemails/{custom_email_type}: + get: + tags: + - Custom Emails + summary: Get custom email configuration + description: Get the custom email configuration for the specified custom email + type + operationId: customEmails_read + parameters: + - name: custom_email_type + in: path + required: true + style: simple + explode: false + schema: + type: string + - name: x-org-id + in: header + description: Organization identifier that can be obtained from console settings. + required: false + style: simple + explode: false + schema: + type: string + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/CustomEmail' + "400": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorDetails' + "401": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "403": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "404": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "409": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "500": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + security: + - x-api-key: [] + x-scopes: + - organizations + - organizations.readonly + x-codeSamples: + - lang: Shell + source: "curl --request GET \\\n --url https://console.jumpcloud.com/api/v2/customemails/{custom_email_type}\ + \ \\\n --header 'x-api-key: REPLACE_KEY_VALUE' \\\n --header 'x-org-id:\ + \ SOME_STRING_VALUE'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/customemails/{custom_email_type}\"\ + \n\nheaders = {\n \"x-org-id\": \"SOME_STRING_VALUE\",\n \"x-api-key\"\ + : \"REPLACE_KEY_VALUE\"\n}\n\nresponse = requests.request(\"GET\", url,\ + \ headers=headers)\n\nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-org-id\", \"SOME_STRING_VALUE\")\n\ + $headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n$response = Invoke-RestMethod\ + \ -Uri 'https://console.jumpcloud.com/api/v2/customemails/{custom_email_type}'\ + \ -Method GET -Headers $headers" + put: + tags: + - Custom Emails + summary: Update custom email configuration + description: Update the custom email configuration for the specified custom + email type + operationId: customEmails_update + parameters: + - name: custom_email_type + in: path + required: true + style: simple + explode: false + schema: + type: string + - name: x-org-id + in: header + description: Organization identifier that can be obtained from console settings. + required: false + style: simple + explode: false + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/CustomEmail' + required: false + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/CustomEmail' + "400": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorDetails' + "401": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "403": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "404": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "409": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "500": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + security: + - x-api-key: [] + x-scopes: + - organizations + x-codeSamples: + - lang: Shell + source: "curl --request PUT \\\n --url https://console.jumpcloud.com/api/v2/customemails/{custom_email_type}\ + \ \\\n --header 'content-type: application/json' \\\n --header 'x-api-key:\ + \ REPLACE_KEY_VALUE' \\\n --header 'x-org-id: SOME_STRING_VALUE' \\\n \ + \ --data '{\"body\":\"string\",\"button\":\"string\",\"header\":\"string\"\ + ,\"nextStepContactInfo\":\"string\",\"subject\":\"string\",\"title\":\"\ + string\",\"type\":\"activate_gapps_user\"}'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/customemails/{custom_email_type}\"\ + \n\npayload = {\n \"body\": \"string\",\n \"button\": \"string\",\n\ + \ \"header\": \"string\",\n \"nextStepContactInfo\": \"string\",\n\ + \ \"subject\": \"string\",\n \"title\": \"string\",\n \"type\"\ + : \"activate_gapps_user\"\n}\nheaders = {\n \"x-org-id\": \"SOME_STRING_VALUE\"\ + ,\n \"x-api-key\": \"REPLACE_KEY_VALUE\",\n \"content-type\": \"application/json\"\ + \n}\n\nresponse = requests.request(\"PUT\", url, json=payload, headers=headers)\n\ + \nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-org-id\", \"SOME_STRING_VALUE\")\n\ + $headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n$headers.Add(\"content-type\"\ + , \"application/json\")\n$response = Invoke-RestMethod -Uri 'https://console.jumpcloud.com/api/v2/customemails/{custom_email_type}'\ + \ -Method PUT -Headers $headers -ContentType 'application/json' -Body '{\"\ + body\":\"string\",\"button\":\"string\",\"header\":\"string\",\"nextStepContactInfo\"\ + :\"string\",\"subject\":\"string\",\"title\":\"string\",\"type\":\"activate_gapps_user\"\ + }'" + x-codegen-request-body-name: body + delete: + tags: + - Custom Emails + summary: Delete custom email configuration + description: Delete the custom email configuration for the specified custom + email type + operationId: customEmails_destroy + parameters: + - name: custom_email_type + in: path + required: true + style: simple + explode: false + schema: + type: string + - name: x-org-id + in: header + description: Organization identifier that can be obtained from console settings. + required: false + style: simple + explode: false + schema: + type: string + responses: + "204": + description: No Content + content: {} + "400": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorDetails' + "401": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "403": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "404": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "409": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "500": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + security: + - x-api-key: [] + x-scopes: + - organizations + x-codeSamples: + - lang: Shell + source: "curl --request DELETE \\\n --url https://console.jumpcloud.com/api/v2/customemails/{custom_email_type}\ + \ \\\n --header 'x-api-key: REPLACE_KEY_VALUE' \\\n --header 'x-org-id:\ + \ SOME_STRING_VALUE'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/customemails/{custom_email_type}\"\ + \n\nheaders = {\n \"x-org-id\": \"SOME_STRING_VALUE\",\n \"x-api-key\"\ + : \"REPLACE_KEY_VALUE\"\n}\n\nresponse = requests.request(\"DELETE\", url,\ + \ headers=headers)\n\nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-org-id\", \"SOME_STRING_VALUE\")\n\ + $headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n$response = Invoke-RestMethod\ + \ -Uri 'https://console.jumpcloud.com/api/v2/customemails/{custom_email_type}'\ + \ -Method DELETE -Headers $headers" + /directories: + get: + tags: + - Directories + summary: List All Directories + description: "This endpoint returns all active directories (LDAP, O365 Suite,\ + \ G-Suite).\n\n#### Sample Request\n```\n curl -X GET https://console.jumpcloud.com/api/v2/directories\ + \ \\\n -H 'accept: application/json' \\\n -H 'content-type: application/json'\ + \ \\\n -H 'x-api-key: {API_KEY}'\n```" + operationId: directories_list + parameters: + - name: fields + in: query + description: "The comma separated fields included in the returned records.\n\ + If omitted, the default list of fields will be returned.\n" + required: false + style: form + explode: false + schema: + type: array + items: + type: string + - name: limit + in: query + description: The number of records to return at once. Limited to 100. + required: false + style: form + explode: true + schema: + type: integer + default: 10 + - name: sort + in: query + description: "The comma separated fields used to sort the collection.\nDefault\ + \ sort is ascending, prefix with `-` to sort descending.\n" + required: false + style: form + explode: false + schema: + type: array + items: + type: string + - name: skip + in: query + description: The offset into the records to return. + required: false + style: form + explode: true + schema: + minimum: 0 + type: integer + default: 0 + - name: x-org-id + in: header + description: Organization identifier that can be obtained from console settings. + required: false + style: simple + explode: false + schema: + type: string + responses: + "200": + description: OK + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/Directory' + x-content-type: application/json + default: + description: Unexpected error + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + security: + - x-api-key: [] + x-scopes: + - directories + - directories.readonly + x-codeSamples: + - lang: Shell + source: "curl --request GET \\\n --url 'https://console.jumpcloud.com/api/v2/directories?limit=10&skip=0'\ + \ \\\n --header 'x-api-key: REPLACE_KEY_VALUE' \\\n --header 'x-org-id:\ + \ SOME_STRING_VALUE'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/directories\"\ + \n\nquerystring = {\"limit\":\"10\",\"skip\":\"0\"}\n\nheaders = {\n \ + \ \"x-org-id\": \"SOME_STRING_VALUE\",\n \"x-api-key\": \"REPLACE_KEY_VALUE\"\ + \n}\n\nresponse = requests.request(\"GET\", url, headers=headers, params=querystring)\n\ + \nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-org-id\", \"SOME_STRING_VALUE\")\n\ + $headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n$response = Invoke-RestMethod\ + \ -Uri 'https://console.jumpcloud.com/api/v2/directories?limit=10&skip=0'\ + \ -Method GET -Headers $headers" + /duo/accounts: + get: + tags: + - Duo + summary: List Duo Accounts + description: "This endpoint returns all the Duo accounts for your organization.\ + \ Note: There can currently only be one Duo account for your organization.\n\ + \n#### Sample Request\n```\ncurl https://console.jumpcloud.com/api/v2/duo/accounts\ + \ \\\n -H 'accept: application/json' \\\n -H 'content-type: application/json'\ + \ \\\n -H 'x-api-key: {API_KEY}'\n```" + operationId: duo_accountList + parameters: + - name: x-org-id + in: header + description: Organization identifier that can be obtained from console settings. + required: false + style: simple + explode: false + schema: + type: string + responses: + "200": + description: "" + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/DuoAccount' + x-content-type: application/json + security: + - x-api-key: [] + x-scopes: + - mfa + - mfa.readonly + x-codeSamples: + - lang: Shell + source: "curl --request GET \\\n --url https://console.jumpcloud.com/api/v2/duo/accounts\ + \ \\\n --header 'x-api-key: REPLACE_KEY_VALUE' \\\n --header 'x-org-id:\ + \ SOME_STRING_VALUE'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/duo/accounts\"\ + \n\nheaders = {\n \"x-org-id\": \"SOME_STRING_VALUE\",\n \"x-api-key\"\ + : \"REPLACE_KEY_VALUE\"\n}\n\nresponse = requests.request(\"GET\", url,\ + \ headers=headers)\n\nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-org-id\", \"SOME_STRING_VALUE\")\n\ + $headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n$response = Invoke-RestMethod\ + \ -Uri 'https://console.jumpcloud.com/api/v2/duo/accounts' -Method GET -Headers\ + \ $headers" + post: + tags: + - Duo + summary: Create Duo Account + description: "Registers a Duo account for an organization. Only one Duo account\ + \ will be allowed,\nin case an organization has a Duo account already a 409\ + \ (Conflict) code will be returned.\n\n#### Sample Request\n```\n curl -X\ + \ POST https://console.jumpcloud.com/api/v2/duo/accounts \\\n -H 'accept:\ + \ application/json' \\\n -H 'content-type: application/json' \\\n -H 'x-api-key:\ + \ {API_KEY}' \\\n -d '{}'\n```" + operationId: duo_accountPost + parameters: + - name: x-org-id + in: header + description: Organization identifier that can be obtained from console settings. + required: false + style: simple + explode: false + schema: + type: string + responses: + "201": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/DuoAccount' + "400": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorDetails' + "401": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "403": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "404": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "409": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "500": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + security: + - x-api-key: [] + x-scopes: + - mfa + x-codeSamples: + - lang: Shell + source: "curl --request POST \\\n --url https://console.jumpcloud.com/api/v2/duo/accounts\ + \ \\\n --header 'x-api-key: REPLACE_KEY_VALUE' \\\n --header 'x-org-id:\ + \ SOME_STRING_VALUE'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/duo/accounts\"\ + \n\nheaders = {\n \"x-org-id\": \"SOME_STRING_VALUE\",\n \"x-api-key\"\ + : \"REPLACE_KEY_VALUE\"\n}\n\nresponse = requests.request(\"POST\", url,\ + \ headers=headers)\n\nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-org-id\", \"SOME_STRING_VALUE\")\n\ + $headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n$response = Invoke-RestMethod\ + \ -Uri 'https://console.jumpcloud.com/api/v2/duo/accounts' -Method POST\ + \ -Headers $headers" + /duo/accounts/{account_id}/applications: + get: + tags: + - Duo + summary: List Duo Applications + description: "This endpoint returns all the Duo applications for the specified\ + \ Duo account. Note: There can currently only be one Duo application for your\ + \ organization.\n\n#### Sample Request\n```\n curl https://console.jumpcloud.com/api/v2/duo/accounts/{ACCOUNT_ID}/applications\ + \ \\\n -H 'accept: application/json' \\\n -H 'content-type: application/json'\ + \ \\\n -H 'x-api-key: {API_KEY}'\n```" + operationId: duo_applicationList + parameters: + - name: account_id + in: path + required: true + style: simple + explode: false + schema: + type: string + - name: x-org-id + in: header + description: Organization identifier that can be obtained from console settings. + required: false + style: simple + explode: false + schema: + type: string + responses: + "200": + description: "" + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/DuoApplication' + x-content-type: application/json + "400": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorDetails' + "401": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "403": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "404": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "409": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "500": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + security: + - x-api-key: [] + x-scopes: + - mfa + - mfa.readonly + x-codeSamples: + - lang: Shell + source: "curl --request GET \\\n --url https://console.jumpcloud.com/api/v2/duo/accounts/{account_id}/applications\ + \ \\\n --header 'x-api-key: REPLACE_KEY_VALUE' \\\n --header 'x-org-id:\ + \ SOME_STRING_VALUE'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/duo/accounts/{account_id}/applications\"\ + \n\nheaders = {\n \"x-org-id\": \"SOME_STRING_VALUE\",\n \"x-api-key\"\ + : \"REPLACE_KEY_VALUE\"\n}\n\nresponse = requests.request(\"GET\", url,\ + \ headers=headers)\n\nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-org-id\", \"SOME_STRING_VALUE\")\n\ + $headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n$response = Invoke-RestMethod\ + \ -Uri 'https://console.jumpcloud.com/api/v2/duo/accounts/{account_id}/applications'\ + \ -Method GET -Headers $headers" + post: + tags: + - Duo + summary: Create Duo Application + description: "Creates a Duo application for your organization and the specified\ + \ account.\n\n#### Sample Request\n```\n curl -X POST https://console.jumpcloud.com/api/v2/duo/accounts/{ACCOUNT_ID}/applications\ + \ \\\n -H 'accept: application/json' \\\n -H 'content-type: application/json'\ + \ \\\n -H 'x-api-key: {API_KEY}' \\\n -d '{\n \"name\": \"Application\ + \ Name\",\n \"apiHost\": \"api-1234.duosecurity.com\",\n \"integrationKey\"\ + : \"1234\",\n \"secretKey\": \"5678\"\n }'\n```" + operationId: duo_applicationPost + parameters: + - name: account_id + in: path + required: true + style: simple + explode: false + schema: + type: string + - name: x-org-id + in: header + description: Organization identifier that can be obtained from console settings. + required: false + style: simple + explode: false + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/DuoApplicationReq' + required: false + responses: + "201": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/DuoApplication' + "400": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorDetails' + "401": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "403": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "404": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "409": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "500": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + security: + - x-api-key: [] + x-scopes: + - mfa + x-codeSamples: + - lang: Shell + source: "curl --request POST \\\n --url https://console.jumpcloud.com/api/v2/duo/accounts/{account_id}/applications\ + \ \\\n --header 'content-type: application/json' \\\n --header 'x-api-key:\ + \ REPLACE_KEY_VALUE' \\\n --header 'x-org-id: SOME_STRING_VALUE' \\\n \ + \ --data '{\"apiHost\":\"string\",\"integrationKey\":\"string\",\"name\"\ + :\"string\",\"secretKey\":\"string\"}'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/duo/accounts/{account_id}/applications\"\ + \n\npayload = {\n \"apiHost\": \"string\",\n \"integrationKey\": \"\ + string\",\n \"name\": \"string\",\n \"secretKey\": \"string\"\n}\n\ + headers = {\n \"x-org-id\": \"SOME_STRING_VALUE\",\n \"x-api-key\"\ + : \"REPLACE_KEY_VALUE\",\n \"content-type\": \"application/json\"\n}\n\ + \nresponse = requests.request(\"POST\", url, json=payload, headers=headers)\n\ + \nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-org-id\", \"SOME_STRING_VALUE\")\n\ + $headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n$headers.Add(\"content-type\"\ + , \"application/json\")\n$response = Invoke-RestMethod -Uri 'https://console.jumpcloud.com/api/v2/duo/accounts/{account_id}/applications'\ + \ -Method POST -Headers $headers -ContentType 'application/json' -Body '{\"\ + apiHost\":\"string\",\"integrationKey\":\"string\",\"name\":\"string\",\"\ + secretKey\":\"string\"}'" + x-codegen-request-body-name: body + /duo/accounts/{account_id}/applications/{application_id}: + get: + tags: + - Duo + summary: Get a Duo application + description: "This endpoint returns a specific Duo application that is associated\ + \ with the specified Duo account.\n\n#### Sample Request\n```\n curl https://console.jumpcloud.com/api/v2/duo/accounts/{ACCOUNT_ID}/applications/{APPLICATION_ID}\ + \ \\\n -H 'accept: application/json' \\\n -H 'content-type: application/json'\ + \ \\\n -H 'x-api-key: {API_KEY}'\n```" + operationId: duo_applicationGet + parameters: + - name: account_id + in: path + required: true + style: simple + explode: false + schema: + type: string + - name: application_id + in: path + required: true + style: simple + explode: false + schema: + type: string + - name: x-org-id + in: header + description: Organization identifier that can be obtained from console settings. + required: false + style: simple + explode: false + schema: + type: string + responses: + "200": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/DuoApplication' + "400": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorDetails' + "401": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "403": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "404": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "409": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "500": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + security: + - x-api-key: [] + x-scopes: + - mfa + - mfa.readonly + x-codeSamples: + - lang: Shell + source: "curl --request GET \\\n --url https://console.jumpcloud.com/api/v2/duo/accounts/{account_id}/applications/{application_id}\ + \ \\\n --header 'x-api-key: REPLACE_KEY_VALUE' \\\n --header 'x-org-id:\ + \ SOME_STRING_VALUE'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/duo/accounts/{account_id}/applications/{application_id}\"\ + \n\nheaders = {\n \"x-org-id\": \"SOME_STRING_VALUE\",\n \"x-api-key\"\ + : \"REPLACE_KEY_VALUE\"\n}\n\nresponse = requests.request(\"GET\", url,\ + \ headers=headers)\n\nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-org-id\", \"SOME_STRING_VALUE\")\n\ + $headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n$response = Invoke-RestMethod\ + \ -Uri 'https://console.jumpcloud.com/api/v2/duo/accounts/{account_id}/applications/{application_id}'\ + \ -Method GET -Headers $headers" + put: + tags: + - Duo + summary: Update Duo Application + description: "Updates the specified Duo application.\n\n#### Sample Request\n\ + ```\n curl -X PUT https://console.jumpcloud.com/api/v2/duo/accounts/{ACCOUNT_ID}/applications/{APPLICATION_ID}\ + \ \\\n -H 'accept: application/json' \\\n -H 'content-type: application/json'\ + \ \\\n -H 'x-api-key: {API_KEY}' \\\n -d '{\n \"name\": \"Application\ + \ Name\",\n \"apiHost\": \"api-1234.duosecurity.com\",\n \"integrationKey\"\ + : \"1234\",\n \"secretKey\": \"5678\"\n }'\n```" + operationId: duo_applicationUpdate + parameters: + - name: account_id + in: path + required: true + style: simple + explode: false + schema: + type: string + - name: application_id + in: path + required: true + style: simple + explode: false + schema: + type: string + - name: x-org-id + in: header + description: Organization identifier that can be obtained from console settings. + required: false + style: simple + explode: false + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/DuoApplicationUpdateReq' + required: false + responses: + "200": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/DuoApplication' + "400": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorDetails' + "401": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "403": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "404": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "409": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "500": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + security: + - x-api-key: [] + x-scopes: + - mfa + x-codeSamples: + - lang: Shell + source: "curl --request PUT \\\n --url https://console.jumpcloud.com/api/v2/duo/accounts/{account_id}/applications/{application_id}\ + \ \\\n --header 'content-type: application/json' \\\n --header 'x-api-key:\ + \ REPLACE_KEY_VALUE' \\\n --header 'x-org-id: SOME_STRING_VALUE' \\\n \ + \ --data '{\"apiHost\":\"string\",\"integrationKey\":\"string\",\"name\"\ + :\"string\",\"secretKey\":\"string\"}'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/duo/accounts/{account_id}/applications/{application_id}\"\ + \n\npayload = {\n \"apiHost\": \"string\",\n \"integrationKey\": \"\ + string\",\n \"name\": \"string\",\n \"secretKey\": \"string\"\n}\n\ + headers = {\n \"x-org-id\": \"SOME_STRING_VALUE\",\n \"x-api-key\"\ + : \"REPLACE_KEY_VALUE\",\n \"content-type\": \"application/json\"\n}\n\ + \nresponse = requests.request(\"PUT\", url, json=payload, headers=headers)\n\ + \nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-org-id\", \"SOME_STRING_VALUE\")\n\ + $headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n$headers.Add(\"content-type\"\ + , \"application/json\")\n$response = Invoke-RestMethod -Uri 'https://console.jumpcloud.com/api/v2/duo/accounts/{account_id}/applications/{application_id}'\ + \ -Method PUT -Headers $headers -ContentType 'application/json' -Body '{\"\ + apiHost\":\"string\",\"integrationKey\":\"string\",\"name\":\"string\",\"\ + secretKey\":\"string\"}'" + x-codegen-request-body-name: body + delete: + tags: + - Duo + summary: Delete a Duo Application + description: "Deletes the specified Duo application, an error will be returned\ + \ if the application is used in a protected resource.\n\n#### Sample Request\n\ + ```\n curl -X DELETE https://console.jumpcloud.com/api/v2/duo/accounts/{ACCOUNT_ID}/applications/{APPLICATION_ID}\ + \ \\\n -H 'accept: application/json' \\\n -H 'content-type: application/json'\ + \ \\\n -H 'x-api-key: {API_KEY}''\n```" + operationId: duo_applicationDelete + parameters: + - name: account_id + in: path + required: true + style: simple + explode: false + schema: + type: string + - name: application_id + in: path + required: true + style: simple + explode: false + schema: + type: string + - name: x-org-id + in: header + description: Organization identifier that can be obtained from console settings. + required: false + style: simple + explode: false + schema: + type: string + responses: + "200": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/DuoApplication' + "400": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorDetails' + "401": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "403": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "404": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "409": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "500": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + security: + - x-api-key: [] + x-scopes: + - mfa + x-codeSamples: + - lang: Shell + source: "curl --request DELETE \\\n --url https://console.jumpcloud.com/api/v2/duo/accounts/{account_id}/applications/{application_id}\ + \ \\\n --header 'x-api-key: REPLACE_KEY_VALUE' \\\n --header 'x-org-id:\ + \ SOME_STRING_VALUE'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/duo/accounts/{account_id}/applications/{application_id}\"\ + \n\nheaders = {\n \"x-org-id\": \"SOME_STRING_VALUE\",\n \"x-api-key\"\ + : \"REPLACE_KEY_VALUE\"\n}\n\nresponse = requests.request(\"DELETE\", url,\ + \ headers=headers)\n\nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-org-id\", \"SOME_STRING_VALUE\")\n\ + $headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n$response = Invoke-RestMethod\ + \ -Uri 'https://console.jumpcloud.com/api/v2/duo/accounts/{account_id}/applications/{application_id}'\ + \ -Method DELETE -Headers $headers" + /duo/accounts/{id}: + get: + tags: + - Duo + summary: Get a Duo Acount + description: "This endpoint returns a specific Duo account.\n\n#### Sample Request\n\ + ```\ncurl https://console.jumpcloud.com/api/v2/duo/accounts/{id} \\\n -H\ + \ 'accept: application/json' \\\n -H 'content-type: application/json' \\\n\ + \ -H 'x-api-key: {API_KEY}'\n```" + operationId: duo_accountGet + parameters: + - name: id + in: path + description: ObjectID of the Duo Account + required: true + style: simple + explode: false + schema: + type: string + - name: x-org-id + in: header + description: Organization identifier that can be obtained from console settings. + required: false + style: simple + explode: false + schema: + type: string + responses: + "200": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/DuoAccount' + security: + - x-api-key: [] + x-scopes: + - mfa + - mfa.readonly + x-codeSamples: + - lang: Shell + source: "curl --request GET \\\n --url https://console.jumpcloud.com/api/v2/duo/accounts/{id}\ + \ \\\n --header 'x-api-key: REPLACE_KEY_VALUE' \\\n --header 'x-org-id:\ + \ SOME_STRING_VALUE'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/duo/accounts/{id}\"\ + \n\nheaders = {\n \"x-org-id\": \"SOME_STRING_VALUE\",\n \"x-api-key\"\ + : \"REPLACE_KEY_VALUE\"\n}\n\nresponse = requests.request(\"GET\", url,\ + \ headers=headers)\n\nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-org-id\", \"SOME_STRING_VALUE\")\n\ + $headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n$response = Invoke-RestMethod\ + \ -Uri 'https://console.jumpcloud.com/api/v2/duo/accounts/{id}' -Method\ + \ GET -Headers $headers" + delete: + tags: + - Duo + summary: Delete a Duo Account + description: "Removes the specified Duo account, an error will be returned if\ + \ the account has some Duo application used in a protected resource.\n\n####\ + \ Sample Request\n```\ncurl -X DELETE https://console.jumpcloud.com/api/v2/duo/accounts/{id}\ + \ \\\n -H 'accept: application/json' \\\n -H 'content-type: application/json'\ + \ \\\n -H 'x-api-key: {API_KEY}'\n```" + operationId: duo_accountDelete + parameters: + - name: id + in: path + description: ObjectID of the Duo Account + required: true + style: simple + explode: false + schema: + type: string + - name: x-org-id + in: header + description: Organization identifier that can be obtained from console settings. + required: false + style: simple + explode: false + schema: + type: string + responses: + "200": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/DuoAccount' + "400": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorDetails' + "401": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "403": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "404": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "409": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "500": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + security: + - x-api-key: [] + x-scopes: + - mfa + x-codeSamples: + - lang: Shell + source: "curl --request DELETE \\\n --url https://console.jumpcloud.com/api/v2/duo/accounts/{id}\ + \ \\\n --header 'x-api-key: REPLACE_KEY_VALUE' \\\n --header 'x-org-id:\ + \ SOME_STRING_VALUE'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/duo/accounts/{id}\"\ + \n\nheaders = {\n \"x-org-id\": \"SOME_STRING_VALUE\",\n \"x-api-key\"\ + : \"REPLACE_KEY_VALUE\"\n}\n\nresponse = requests.request(\"DELETE\", url,\ + \ headers=headers)\n\nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-org-id\", \"SOME_STRING_VALUE\")\n\ + $headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n$response = Invoke-RestMethod\ + \ -Uri 'https://console.jumpcloud.com/api/v2/duo/accounts/{id}' -Method\ + \ DELETE -Headers $headers" + /groups: + get: + tags: + - Groups + summary: List All Groups + description: "This endpoint returns all Groups that exist in your organization.\n\ + \n#### Available filter fields:\n - `name`\n - `disabled`\n - `type`\n\n\ + #### Sample Request\n\n```\n curl -X GET \\\n https://console.jumpcloud.com/api/v2/groups\ + \ \\\n -H 'accept: application/json' \\\n -H 'content-type: application/json'\ + \ \\\n -H 'x-api-key: {API_KEY}'\n```" + operationId: groups_list + parameters: + - name: fields + in: query + description: "The comma separated fields included in the returned records.\n\ + If omitted, the default list of fields will be returned.\n" + required: false + style: form + explode: false + schema: + type: array + items: + type: string + - name: filter + in: query + description: "A filter to apply to the query.\n\n**Filter structure**: `::`.\n\ + \n**field** = Populate with a valid field from an endpoint response.\n\n\ + **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between,\ + \ search, in.\n_Note: v1 operators differ from v2 operators._\n\n**value**\ + \ = Populate with the value you want to search for. Is case sensitive. Supports\ + \ wild cards.\n\n**EX:** `GET /api/v2/groups?filter=name:eq:Test+Group`" + required: false + style: form + explode: false + schema: + type: array + items: + type: string + - name: limit + in: query + description: The number of records to return at once. Limited to 100. + required: false + style: form + explode: true + schema: + type: integer + default: 10 + - name: skip + in: query + description: The offset into the records to return. + required: false + style: form + explode: true + schema: + minimum: 0 + type: integer + default: 0 + - name: sort + in: query + description: "The comma separated fields used to sort the collection.\nDefault\ + \ sort is ascending, prefix with `-` to sort descending.\n" + required: false + style: form + explode: false + schema: + type: array + items: + type: string + - name: x-org-id + in: header + description: Organization identifier that can be obtained from console settings. + required: false + style: simple + explode: false + schema: + type: string + - name: x-unfiltered-total-count + in: header + description: "If provided in the request with any non-empty value, this header\ + \ will be returned on the response populated with the total count of objects\ + \ without filters taken into account" + required: false + style: simple + explode: false + schema: + type: integer + responses: + "200": + description: OK + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/Group' + x-content-type: application/json + default: + description: Unexpected error + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + security: + - x-api-key: [] + x-scopes: + - groups + - groups.readonly + x-codeSamples: + - lang: Shell + source: "curl --request GET \\\n --url 'https://console.jumpcloud.com/api/v2/groups?limit=10&skip=0'\ + \ \\\n --header 'x-api-key: REPLACE_KEY_VALUE' \\\n --header 'x-org-id:\ + \ SOME_STRING_VALUE' \\\n --header 'x-unfiltered-total-count: SOME_INTEGER_VALUE'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/groups\"\ + \n\nquerystring = {\"limit\":\"10\",\"skip\":\"0\"}\n\nheaders = {\n \ + \ \"x-org-id\": \"SOME_STRING_VALUE\",\n \"x-unfiltered-total-count\"\ + : \"SOME_INTEGER_VALUE\",\n \"x-api-key\": \"REPLACE_KEY_VALUE\"\n}\n\ + \nresponse = requests.request(\"GET\", url, headers=headers, params=querystring)\n\ + \nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-org-id\", \"SOME_STRING_VALUE\")\n\ + $headers.Add(\"x-unfiltered-total-count\", \"SOME_INTEGER_VALUE\")\n$headers.Add(\"\ + x-api-key\", \"REPLACE_KEY_VALUE\")\n$response = Invoke-RestMethod -Uri\ + \ 'https://console.jumpcloud.com/api/v2/groups?limit=10&skip=0' -Method\ + \ GET -Headers $headers" + /gsuites/{gsuite_id}/associations: + get: + tags: + - Graph + - G Suite + summary: List the associations of a G Suite instance + description: "This endpoint returns the _direct_ associations of this G Suite\ + \ instance.\n\nA direct association can be a non-homogeneous relationship\ + \ between 2 different objects, for example G Suite and Users.\n\n\n#### Sample\ + \ Request\n```\ncurl -X GET 'https://console.jumpcloud.com/api/v2/gsuites/{Gsuite_ID}/associations?targets=user_group\ + \ \\\n -H 'accept: application/json' \\\n -H 'content-type: application/json'\ + \ \\\n -H 'x-api-key: {API_KEY}'\n```" + operationId: graph_gSuiteAssociationsList + parameters: + - name: gsuite_id + in: path + description: ObjectID of the G Suite instance. + required: true + style: simple + explode: false + schema: + type: string + - name: targets + in: query + description: Targets which a "g_suite" can be associated to. + required: true + style: form + explode: false + schema: + type: array + items: + type: string + enum: + - user + - user_group + - name: limit + in: query + description: The number of records to return at once. Limited to 100. + required: false + style: form + explode: true + schema: + type: integer + default: 10 + - name: skip + in: query + description: The offset into the records to return. + required: false + style: form + explode: true + schema: + minimum: 0 + type: integer + default: 0 + - name: x-org-id + in: header + description: Organization identifier that can be obtained from console settings. + required: false + style: simple + explode: false + schema: + type: string + responses: + "200": + description: OK + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/GraphConnection' + x-content-type: application/json + security: + - x-api-key: [] + x-scopes: + - directories + - directories.readonly + x-codeSamples: + - lang: Shell + source: "curl --request GET \\\n --url 'https://console.jumpcloud.com/api/v2/gsuites/{gsuite_id}/associations?targets=SOME_ARRAY_VALUE&limit=10&skip=0'\ + \ \\\n --header 'x-api-key: REPLACE_KEY_VALUE' \\\n --header 'x-org-id:\ + \ SOME_STRING_VALUE'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/gsuites/{gsuite_id}/associations\"\ + \n\nquerystring = {\"targets\":\"SOME_ARRAY_VALUE\",\"limit\":\"10\",\"\ + skip\":\"0\"}\n\nheaders = {\n \"x-org-id\": \"SOME_STRING_VALUE\",\n\ + \ \"x-api-key\": \"REPLACE_KEY_VALUE\"\n}\n\nresponse = requests.request(\"\ + GET\", url, headers=headers, params=querystring)\n\nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-org-id\", \"SOME_STRING_VALUE\")\n\ + $headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n$response = Invoke-RestMethod\ + \ -Uri 'https://console.jumpcloud.com/api/v2/gsuites/{gsuite_id}/associations?targets=SOME_ARRAY_VALUE&limit=10&skip=0'\ + \ -Method GET -Headers $headers" + post: + tags: + - Graph + - G Suite + summary: Manage the associations of a G Suite instance + description: "This endpoint returns the _direct_ associations of this G Suite\ + \ instance.\n\nA direct association can be a non-homogeneous relationship\ + \ between 2 different objects, for example G Suite and Users.\n\n\n#### Sample\ + \ Request\n```\ncurl -X POST https://console.jumpcloud.com/api/v2/gsuites/{Gsuite_ID}/associations\ + \ \\\n -H 'accept: application/json' \\\n -H 'content-type: application/json'\ + \ \\\n -H 'x-api-key: {API_KEY}' \\\n -d '{\n \"op\": \"add\",\n \"\ + type\": \"user_group\",\n \"id\": \"{Group_ID}\"\n }'\n```" + operationId: graph_gSuiteAssociationsPost + parameters: + - name: gsuite_id + in: path + description: ObjectID of the G Suite instance. + required: true + style: simple + explode: false + schema: + type: string + - name: x-org-id + in: header + description: Organization identifier that can be obtained from console settings. + required: false + style: simple + explode: false + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/GraphOperation-GSuite' + required: false + responses: + "204": + description: OK + content: {} + security: + - x-api-key: [] + x-scopes: + - directories + x-codeSamples: + - lang: Shell + source: "curl --request POST \\\n --url https://console.jumpcloud.com/api/v2/gsuites/{gsuite_id}/associations\ + \ \\\n --header 'content-type: application/json' \\\n --header 'x-api-key:\ + \ REPLACE_KEY_VALUE' \\\n --header 'x-org-id: SOME_STRING_VALUE' \\\n \ + \ --data '{\"id\":\"string\",\"op\":\"add\",\"attributes\":{},\"type\":\"\ + user\"}'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/gsuites/{gsuite_id}/associations\"\ + \n\npayload = {\n \"id\": \"string\",\n \"op\": \"add\",\n \"attributes\"\ + : {},\n \"type\": \"user\"\n}\nheaders = {\n \"x-org-id\": \"SOME_STRING_VALUE\"\ + ,\n \"x-api-key\": \"REPLACE_KEY_VALUE\",\n \"content-type\": \"application/json\"\ + \n}\n\nresponse = requests.request(\"POST\", url, json=payload, headers=headers)\n\ + \nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-org-id\", \"SOME_STRING_VALUE\")\n\ + $headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n$headers.Add(\"content-type\"\ + , \"application/json\")\n$response = Invoke-RestMethod -Uri 'https://console.jumpcloud.com/api/v2/gsuites/{gsuite_id}/associations'\ + \ -Method POST -Headers $headers -ContentType 'application/json' -Body '{\"\ + id\":\"string\",\"op\":\"add\",\"attributes\":{},\"type\":\"user\"}'" + x-codegen-request-body-name: body + /gsuites/{gsuite_id}/import/jumpcloudusers: + get: + tags: + - G Suite + - G Suite Import + summary: Get a list of users in Jumpcloud format to import from a Google Workspace + account. + description: "Lists available G Suite users for import, translated to the Jumpcloud\ + \ user schema." + operationId: gsuites_listImportJumpcloudUsers + parameters: + - name: gsuite_id + in: path + required: true + style: simple + explode: false + schema: + type: string + - name: maxResults + in: query + description: Google Directory API maximum number of results per page. See + https://developers.google.com/admin-sdk/directory/reference/rest/v1/users/list. + required: false + style: form + explode: true + schema: + type: integer + - name: orderBy + in: query + description: Google Directory API sort field parameter. See https://developers.google.com/admin-sdk/directory/reference/rest/v1/users/list. + required: false + style: form + explode: true + schema: + type: string + - name: pageToken + in: query + description: Google Directory API token used to access the next page of results. + See https://developers.google.com/admin-sdk/directory/reference/rest/v1/users/list. + required: false + style: form + explode: true + schema: + type: string + - name: query + in: query + description: Google Directory API search parameter. See https://developers.google.com/admin-sdk/directory/v1/guides/search-users. + required: false + style: form + explode: true + schema: + type: string + - name: sortOrder + in: query + description: Google Directory API sort direction parameter. See https://developers.google.com/admin-sdk/directory/reference/rest/v1/users/list. + required: false + style: form + explode: true + schema: + type: string + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/inline_response_200_1' + security: + - x-api-key: [] + x-scopes: + - directories + - directories.readonly + x-codeSamples: + - lang: Shell + source: "curl --request GET \\\n --url 'https://console.jumpcloud.com/api/v2/gsuites/{gsuite_id}/import/jumpcloudusers?maxResults=SOME_INTEGER_VALUE&orderBy=SOME_STRING_VALUE&pageToken=SOME_STRING_VALUE&query=SOME_STRING_VALUE&sortOrder=SOME_STRING_VALUE'\ + \ \\\n --header 'x-api-key: REPLACE_KEY_VALUE'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/gsuites/{gsuite_id}/import/jumpcloudusers\"\ + \n\nquerystring = {\"maxResults\":\"SOME_INTEGER_VALUE\",\"orderBy\":\"\ + SOME_STRING_VALUE\",\"pageToken\":\"SOME_STRING_VALUE\",\"query\":\"SOME_STRING_VALUE\"\ + ,\"sortOrder\":\"SOME_STRING_VALUE\"}\n\nheaders = {\"x-api-key\": \"REPLACE_KEY_VALUE\"\ + }\n\nresponse = requests.request(\"GET\", url, headers=headers, params=querystring)\n\ + \nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n\ + $response = Invoke-RestMethod -Uri 'https://console.jumpcloud.com/api/v2/gsuites/{gsuite_id}/import/jumpcloudusers?maxResults=SOME_INTEGER_VALUE&orderBy=SOME_STRING_VALUE&pageToken=SOME_STRING_VALUE&query=SOME_STRING_VALUE&sortOrder=SOME_STRING_VALUE'\ + \ -Method GET -Headers $headers" + /gsuites/{gsuite_id}/import/users: + get: + tags: + - G Suite + - G Suite Import + summary: Get a list of users to import from a G Suite instance + description: Lists G Suite users available for import. + operationId: gsuites_listImportUsers + parameters: + - name: gsuite_id + in: path + required: true + style: simple + explode: false + schema: + type: string + - name: limit + in: query + description: The number of records to return at once. Limited to 100. + required: false + style: form + explode: true + schema: + type: integer + default: 10 + - name: maxResults + in: query + description: Google Directory API maximum number of results per page. See + https://developers.google.com/admin-sdk/directory/reference/rest/v1/users/list. + required: false + style: form + explode: true + schema: + type: integer + - name: orderBy + in: query + description: Google Directory API sort field parameter. See https://developers.google.com/admin-sdk/directory/reference/rest/v1/users/list. + required: false + style: form + explode: true + schema: + type: string + - name: pageToken + in: query + description: Google Directory API token used to access the next page of results. + See https://developers.google.com/admin-sdk/directory/reference/rest/v1/users/list. + required: false + style: form + explode: true + schema: + type: string + - name: query + in: query + description: Google Directory API search parameter. See https://developers.google.com/admin-sdk/directory/v1/guides/search-users. + required: false + style: form + explode: true + schema: + type: string + - name: sortOrder + in: query + description: Google Directory API sort direction parameter. See https://developers.google.com/admin-sdk/directory/reference/rest/v1/users/list. + required: false + style: form + explode: true + schema: + type: string + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/inline_response_200_2' + security: + - x-api-key: [] + x-scopes: + - directories + - directories.readonly + x-codeSamples: + - lang: Shell + source: "curl --request GET \\\n --url 'https://console.jumpcloud.com/api/v2/gsuites/{gsuite_id}/import/users?limit=10&maxResults=SOME_INTEGER_VALUE&orderBy=SOME_STRING_VALUE&pageToken=SOME_STRING_VALUE&query=SOME_STRING_VALUE&sortOrder=SOME_STRING_VALUE'\ + \ \\\n --header 'x-api-key: REPLACE_KEY_VALUE'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/gsuites/{gsuite_id}/import/users\"\ + \n\nquerystring = {\"limit\":\"10\",\"maxResults\":\"SOME_INTEGER_VALUE\"\ + ,\"orderBy\":\"SOME_STRING_VALUE\",\"pageToken\":\"SOME_STRING_VALUE\",\"\ + query\":\"SOME_STRING_VALUE\",\"sortOrder\":\"SOME_STRING_VALUE\"}\n\nheaders\ + \ = {\"x-api-key\": \"REPLACE_KEY_VALUE\"}\n\nresponse = requests.request(\"\ + GET\", url, headers=headers, params=querystring)\n\nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n\ + $response = Invoke-RestMethod -Uri 'https://console.jumpcloud.com/api/v2/gsuites/{gsuite_id}/import/users?limit=10&maxResults=SOME_INTEGER_VALUE&orderBy=SOME_STRING_VALUE&pageToken=SOME_STRING_VALUE&query=SOME_STRING_VALUE&sortOrder=SOME_STRING_VALUE'\ + \ -Method GET -Headers $headers" + /gsuites/{gsuite_id}/translationrules: + get: + tags: + - G Suite + summary: List all the G Suite Translation Rules + description: "This endpoint returns all graph translation rules for a specific\ + \ G Suite instance. These rules specify how JumpCloud attributes translate\ + \ to [G Suite Admin SDK](https://developers.google.com/admin-sdk/directory/)\ + \ attributes.\n\n##### Sample Request\n\n```\n curl -X GET https://console.jumpcloud.com/api/v2/gsuites/{gsuite_id}/translationrules\ + \ \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\ + \ \\\n -H 'x-api-key: {API_KEY}'\n ```" + operationId: translationRules_gSuiteList + parameters: + - name: gsuite_id + in: path + required: true + style: simple + explode: false + schema: + type: string + - name: fields + in: query + description: "The comma separated fields included in the returned records.\n\ + If omitted, the default list of fields will be returned.\n" + required: false + style: form + explode: false + schema: + type: array + items: + type: string + - name: filter + in: query + description: "A filter to apply to the query.\n\n**Filter structure**: `::`.\n\ + \n**field** = Populate with a valid field from an endpoint response.\n\n\ + **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between,\ + \ search, in.\n_Note: v1 operators differ from v2 operators._\n\n**value**\ + \ = Populate with the value you want to search for. Is case sensitive. Supports\ + \ wild cards.\n\n**EX:** `GET /api/v2/groups?filter=name:eq:Test+Group`" + required: false + style: form + explode: false + schema: + type: array + items: + type: string + - name: limit + in: query + description: The number of records to return at once. Limited to 100. + required: false + style: form + explode: true + schema: + type: integer + default: 10 + - name: skip + in: query + description: The offset into the records to return. + required: false + style: form + explode: true + schema: + minimum: 0 + type: integer + default: 0 + - name: sort + in: query + description: "The comma separated fields used to sort the collection.\nDefault\ + \ sort is ascending, prefix with `-` to sort descending.\n" + required: false + style: form + explode: false + schema: + type: array + items: + type: string + responses: + "200": + description: "" + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/GSuiteTranslationRule' + x-content-type: application/json + example: + - field: g_suite_work_addresses + id: object_id_1 + source_type: user + security: + - x-api-key: [] + x-scopes: + - directories + - directories.readonly + x-codeSamples: + - lang: Shell + source: "curl --request GET \\\n --url 'https://console.jumpcloud.com/api/v2/gsuites/{gsuite_id}/translationrules?limit=10&skip=0'\ + \ \\\n --header 'x-api-key: REPLACE_KEY_VALUE'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/gsuites/{gsuite_id}/translationrules\"\ + \n\nquerystring = {\"limit\":\"10\",\"skip\":\"0\"}\n\nheaders = {\"x-api-key\"\ + : \"REPLACE_KEY_VALUE\"}\n\nresponse = requests.request(\"GET\", url, headers=headers,\ + \ params=querystring)\n\nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n\ + $response = Invoke-RestMethod -Uri 'https://console.jumpcloud.com/api/v2/gsuites/{gsuite_id}/translationrules?limit=10&skip=0'\ + \ -Method GET -Headers $headers" + post: + tags: + - G Suite + summary: Create a new G Suite Translation Rule + description: "This endpoint allows you to create a translation rule for a specific\ + \ G Suite instance. These rules specify how JumpCloud attributes translate\ + \ to [G Suite Admin SDK](https://developers.google.com/admin-sdk/directory/)\ + \ attributes.\n\n##### Sample Request\n```\ncurl -X POST https://console.jumpcloud.com/api/v2/gsuites/{gsuite_id}/translationrules\ + \ \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\ + \ \\\n -H 'x-api-key: {API_KEY}' \\\n -d '{\n {Translation Rule Parameters}\n\ + \ }'\n```" + operationId: translationRules_gSuitePost + parameters: + - name: gsuite_id + in: path + required: true + style: simple + explode: false + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/GSuiteTranslationRuleRequest' + required: false + responses: + "201": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/GSuiteTranslationRule' + security: + - x-api-key: [] + x-scopes: + - directories + x-codeSamples: + - lang: Shell + source: "curl --request POST \\\n --url https://console.jumpcloud.com/api/v2/gsuites/{gsuite_id}/translationrules\ + \ \\\n --header 'content-type: application/json' \\\n --header 'x-api-key:\ + \ REPLACE_KEY_VALUE' \\\n --data '{\"builtIn\":\"user_home_addresses\"\ + ,\"direction\":\"export\"}'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/gsuites/{gsuite_id}/translationrules\"\ + \n\npayload = {\n \"builtIn\": \"user_home_addresses\",\n \"direction\"\ + : \"export\"\n}\nheaders = {\n \"x-api-key\": \"REPLACE_KEY_VALUE\",\n\ + \ \"content-type\": \"application/json\"\n}\n\nresponse = requests.request(\"\ + POST\", url, json=payload, headers=headers)\n\nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n\ + $headers.Add(\"content-type\", \"application/json\")\n$response = Invoke-RestMethod\ + \ -Uri 'https://console.jumpcloud.com/api/v2/gsuites/{gsuite_id}/translationrules'\ + \ -Method POST -Headers $headers -ContentType 'application/json' -Body '{\"\ + builtIn\":\"user_home_addresses\",\"direction\":\"export\"}'" + x-codegen-request-body-name: body + /gsuites/{gsuite_id}/translationrules/{id}: + get: + tags: + - G Suite + summary: Gets a specific G Suite translation rule + description: "This endpoint returns a specific translation rule for a specific\ + \ G Suite instance. These rules specify how JumpCloud attributes translate\ + \ to [G Suite Admin SDK](https://developers.google.com/admin-sdk/directory/)\ + \ attributes.\n\n###### Sample Request\n\n```\n curl -X GET https://console.jumpcloud.com/api/v2/gsuites/{gsuite_id}/translationrules/{id}\ + \ \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\ + \ \\\n -H 'x-api-key: {API_KEY}'\n ```" + operationId: translationRules_gSuiteGet + parameters: + - name: gsuite_id + in: path + required: true + style: simple + explode: false + schema: + type: string + - name: id + in: path + required: true + style: simple + explode: false + schema: + type: string + responses: + "200": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/GSuiteTranslationRule' + security: + - x-api-key: [] + x-scopes: + - directories + - directories.readonly + x-codeSamples: + - lang: Shell + source: "curl --request GET \\\n --url https://console.jumpcloud.com/api/v2/gsuites/{gsuite_id}/translationrules/{id}\ + \ \\\n --header 'x-api-key: REPLACE_KEY_VALUE'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/gsuites/{gsuite_id}/translationrules/{id}\"\ + \n\nheaders = {\"x-api-key\": \"REPLACE_KEY_VALUE\"}\n\nresponse = requests.request(\"\ + GET\", url, headers=headers)\n\nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n\ + $response = Invoke-RestMethod -Uri 'https://console.jumpcloud.com/api/v2/gsuites/{gsuite_id}/translationrules/{id}'\ + \ -Method GET -Headers $headers" + delete: + tags: + - G Suite + summary: Deletes a G Suite translation rule + description: "This endpoint allows you to delete a translation rule for a specific\ + \ G Suite instance. These rules specify how JumpCloud attributes translate\ + \ to [G Suite Admin SDK](https://developers.google.com/admin-sdk/directory/)\ + \ attributes.\n\n#### Sample Request\n\n```\ncurl -X DELETE https://console.jumpcloud.com/api/v2/gsuites/{gsuite_id}/translationrules/{id}\ + \ \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\ + \ \\\n -H 'x-api-key: {API_KEY}'\n ```" + operationId: translationRules_gSuiteDelete + parameters: + - name: gsuite_id + in: path + required: true + style: simple + explode: false + schema: + type: string + - name: id + in: path + required: true + style: simple + explode: false + schema: + type: string + responses: + "204": + description: "" + content: {} + security: + - x-api-key: [] + x-scopes: + - directories + x-codeSamples: + - lang: Shell + source: "curl --request DELETE \\\n --url https://console.jumpcloud.com/api/v2/gsuites/{gsuite_id}/translationrules/{id}\ + \ \\\n --header 'x-api-key: REPLACE_KEY_VALUE'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/gsuites/{gsuite_id}/translationrules/{id}\"\ + \n\nheaders = {\"x-api-key\": \"REPLACE_KEY_VALUE\"}\n\nresponse = requests.request(\"\ + DELETE\", url, headers=headers)\n\nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n\ + $response = Invoke-RestMethod -Uri 'https://console.jumpcloud.com/api/v2/gsuites/{gsuite_id}/translationrules/{id}'\ + \ -Method DELETE -Headers $headers" + /gsuites/{gsuite_id}/usergroups: + get: + tags: + - Graph + - G Suite + summary: List the User Groups bound to a G Suite instance + description: "This endpoint will return all User Groups bound to an G Suite\ + \ instance, either directly or indirectly, essentially traversing the JumpCloud\ + \ Graph for your Organization.\n\nEach element will contain the group's type,\ + \ id, attributes and paths.\n\nThe `attributes` object is a key/value hash\ + \ of compiled graph attributes for all paths followed.\n\nThe `paths` array\ + \ enumerates each path from this G Suite instance to the corresponding User\ + \ Group; this array represents all grouping and/or associations that would\ + \ have to be removed to deprovision the User Group from this G Suite instance.\n\ + \nSee `/members` and `/associations` endpoints to manage those collections.\n\ + \n#### Sample Request\n```\n curl -X GET https://console.jumpcloud.com/api/v2/gsuites/{GSuite_ID}/usergroups\ + \ \\\n -H 'accept: application/json' \\\n -H 'content-type: application/json'\ + \ \\\n -H 'x-api-key: {API_KEY}'\n```" + operationId: graph_gSuiteTraverseUserGroup + parameters: + - name: gsuite_id + in: path + description: ObjectID of the G Suite instance. + required: true + style: simple + explode: false + schema: + type: string + - name: limit + in: query + description: The number of records to return at once. Limited to 100. + required: false + style: form + explode: true + schema: + type: integer + default: 10 + - name: x-org-id + in: header + description: Organization identifier that can be obtained from console settings. + required: false + style: simple + explode: false + schema: + type: string + - name: skip + in: query + description: The offset into the records to return. + required: false + style: form + explode: true + schema: + minimum: 0 + type: integer + default: 0 + - name: filter + in: query + description: "A filter to apply to the query.\n\n**Filter structure**: `::`.\n\ + \n**field** = Populate with a valid field from an endpoint response.\n\n\ + **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between,\ + \ search, in.\n_Note: v1 operators differ from v2 operators._\n\n**value**\ + \ = Populate with the value you want to search for. Is case sensitive. Supports\ + \ wild cards.\n\n**EX:** `GET /api/v2/groups?filter=name:eq:Test+Group`" + required: false + style: form + explode: false + schema: + type: array + items: + type: string + responses: + "200": + description: OK + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/GraphObjectWithPaths' + x-content-type: application/json + security: + - x-api-key: [] + x-scopes: + - groups + - groups.readonly + x-codeSamples: + - lang: Shell + source: "curl --request GET \\\n --url 'https://console.jumpcloud.com/api/v2/gsuites/{gsuite_id}/usergroups?limit=10&skip=0'\ + \ \\\n --header 'x-api-key: REPLACE_KEY_VALUE' \\\n --header 'x-org-id:\ + \ SOME_STRING_VALUE'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/gsuites/{gsuite_id}/usergroups\"\ + \n\nquerystring = {\"limit\":\"10\",\"skip\":\"0\"}\n\nheaders = {\n \ + \ \"x-org-id\": \"SOME_STRING_VALUE\",\n \"x-api-key\": \"REPLACE_KEY_VALUE\"\ + \n}\n\nresponse = requests.request(\"GET\", url, headers=headers, params=querystring)\n\ + \nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-org-id\", \"SOME_STRING_VALUE\")\n\ + $headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n$response = Invoke-RestMethod\ + \ -Uri 'https://console.jumpcloud.com/api/v2/gsuites/{gsuite_id}/usergroups?limit=10&skip=0'\ + \ -Method GET -Headers $headers" + /gsuites/{gsuite_id}/users: + get: + tags: + - Graph + - G Suite + summary: List the Users bound to a G Suite instance + description: "This endpoint will return all Users bound to a G Suite instance,\ + \ either directly or indirectly, essentially traversing the JumpCloud Graph\ + \ for your Organization.\n\nEach element will contain the type, id, attributes\ + \ and paths.\n\nThe `attributes` object is a key/value hash of compiled graph\ + \ attributes for all paths followed.\n\nThe `paths` array enumerates each\ + \ path from this G Suite instance to the corresponding User; this array represents\ + \ all grouping and/or associations that would have to be removed to deprovision\ + \ the User from this G Suite instance.\n\nSee `/members` and `/associations`\ + \ endpoints to manage those collections.\n\n#### Sample Request\n```\n curl\ + \ -X GET https://console.jumpcloud.com/api/v2/gsuites/{Gsuite_ID}/users \\\ + \n -H 'accept: application/json' \\\n -H 'content-type: application/json'\ + \ \\\n -H 'x-api-key: {API_KEY}'\n```" + operationId: graph_gSuiteTraverseUser + parameters: + - name: gsuite_id + in: path + description: ObjectID of the G Suite instance. + required: true + style: simple + explode: false + schema: + type: string + - name: limit + in: query + description: The number of records to return at once. Limited to 100. + required: false + style: form + explode: true + schema: + type: integer + default: 10 + - name: x-org-id + in: header + description: Organization identifier that can be obtained from console settings. + required: false + style: simple + explode: false + schema: + type: string + - name: skip + in: query + description: The offset into the records to return. + required: false + style: form + explode: true + schema: + minimum: 0 + type: integer + default: 0 + - name: filter + in: query + description: "A filter to apply to the query.\n\n**Filter structure**: `::`.\n\ + \n**field** = Populate with a valid field from an endpoint response.\n\n\ + **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between,\ + \ search, in.\n_Note: v1 operators differ from v2 operators._\n\n**value**\ + \ = Populate with the value you want to search for. Is case sensitive. Supports\ + \ wild cards.\n\n**EX:** `GET /api/v2/groups?filter=name:eq:Test+Group`" + required: false + style: form + explode: false + schema: + type: array + items: + type: string + responses: + "200": + description: OK + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/GraphObjectWithPaths' + x-content-type: application/json + security: + - x-api-key: [] + x-scopes: + - users + - users.readonly + x-codeSamples: + - lang: Shell + source: "curl --request GET \\\n --url 'https://console.jumpcloud.com/api/v2/gsuites/{gsuite_id}/users?limit=10&skip=0'\ + \ \\\n --header 'x-api-key: REPLACE_KEY_VALUE' \\\n --header 'x-org-id:\ + \ SOME_STRING_VALUE'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/gsuites/{gsuite_id}/users\"\ + \n\nquerystring = {\"limit\":\"10\",\"skip\":\"0\"}\n\nheaders = {\n \ + \ \"x-org-id\": \"SOME_STRING_VALUE\",\n \"x-api-key\": \"REPLACE_KEY_VALUE\"\ + \n}\n\nresponse = requests.request(\"GET\", url, headers=headers, params=querystring)\n\ + \nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-org-id\", \"SOME_STRING_VALUE\")\n\ + $headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n$response = Invoke-RestMethod\ + \ -Uri 'https://console.jumpcloud.com/api/v2/gsuites/{gsuite_id}/users?limit=10&skip=0'\ + \ -Method GET -Headers $headers" + /gsuites/{id}: + get: + tags: + - G Suite + summary: Get G Suite + description: "This endpoint returns a specific G Suite.\n\n##### Sample Request\n\ + \n```\n curl -X GET https://console.jumpcloud.com/api/v2/gsuites/{GSUITE_ID}\ + \ \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\ + \ \\\n -H 'x-api-key: {API_KEY}'\n```" + operationId: gsuites_get + parameters: + - name: id + in: path + description: Unique identifier of the GSuite. + required: true + style: simple + explode: false + schema: + type: string + - name: x-org-id + in: header + description: Organization identifier that can be obtained from console settings. + required: false + style: simple + explode: false + schema: + type: string + responses: + "200": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/gsuite-output' + security: + - x-api-key: [] + x-scopes: + - directories + - directories.readonly + x-codeSamples: + - lang: Shell + source: "curl --request GET \\\n --url https://console.jumpcloud.com/api/v2/gsuites/{id}\ + \ \\\n --header 'x-api-key: REPLACE_KEY_VALUE' \\\n --header 'x-org-id:\ + \ SOME_STRING_VALUE'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/gsuites/{id}\"\ + \n\nheaders = {\n \"x-org-id\": \"SOME_STRING_VALUE\",\n \"x-api-key\"\ + : \"REPLACE_KEY_VALUE\"\n}\n\nresponse = requests.request(\"GET\", url,\ + \ headers=headers)\n\nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-org-id\", \"SOME_STRING_VALUE\")\n\ + $headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n$response = Invoke-RestMethod\ + \ -Uri 'https://console.jumpcloud.com/api/v2/gsuites/{id}' -Method GET -Headers\ + \ $headers" + patch: + tags: + - G Suite + summary: Update existing G Suite + description: "This endpoint allows updating some attributes of a G Suite.\n\n\ + ##### Sample Request\n\n```\ncurl -X PATCH https://console.jumpcloud.com/api/v2/gsuites/{GSUITE_ID}\ + \ \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\ + \ \\\n -H 'x-api-key: {API_KEY}' \\\n -d '{\n \"userLockoutAction\":\ + \ \"suspend\",\n \"userPasswordExpirationAction\": \"maintain\"\n }'\n\ + ```" + operationId: gsuites_patch + parameters: + - name: id + in: path + description: Unique identifier of the GSuite. + required: true + style: simple + explode: false + schema: + type: string + - name: x-org-id + in: header + description: Organization identifier that can be obtained from console settings. + required: false + style: simple + explode: false + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/gsuite-patch-input' + required: false + responses: + "200": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/gsuite-output' + x-scopes: + - directories + x-codeSamples: + - lang: Shell + source: "curl --request PATCH \\\n --url https://console.jumpcloud.com/api/v2/gsuites/{id}\ + \ \\\n --header 'content-type: application/json' \\\n --header 'x-org-id:\ + \ SOME_STRING_VALUE' \\\n --data '{\"groupsEnabled\":true,\"name\":\"string\"\ + ,\"userLockoutAction\":\"suspend\",\"userPasswordExpirationAction\":\"suspend\"\ + }'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/gsuites/{id}\"\ + \n\npayload = {\n \"groupsEnabled\": True,\n \"name\": \"string\"\ + ,\n \"userLockoutAction\": \"suspend\",\n \"userPasswordExpirationAction\"\ + : \"suspend\"\n}\nheaders = {\n \"x-org-id\": \"SOME_STRING_VALUE\",\n\ + \ \"content-type\": \"application/json\"\n}\n\nresponse = requests.request(\"\ + PATCH\", url, json=payload, headers=headers)\n\nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-org-id\", \"SOME_STRING_VALUE\")\n\ + $headers.Add(\"content-type\", \"application/json\")\n$response = Invoke-RestMethod\ + \ -Uri 'https://console.jumpcloud.com/api/v2/gsuites/{id}' -Method PATCH\ + \ -Headers $headers -ContentType 'application/json' -Body '{\"groupsEnabled\"\ + :true,\"name\":\"string\",\"userLockoutAction\":\"suspend\",\"userPasswordExpirationAction\"\ + :\"suspend\"}'" + x-codegen-request-body-name: body + /integrations/autotask/{UUID}: + get: + tags: + - Providers + summary: Retrieve Autotask Integration Configuration + description: Retrieves configuration for given Autotask integration id. You + must be associated to the provider the integration is tied to in order to + use this api. + operationId: autotask_getConfiguration + parameters: + - name: UUID + in: path + required: true + style: simple + explode: false + schema: + type: string + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AutotaskIntegration' + "400": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorDetails' + "401": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "403": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "404": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "500": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + security: + - x-api-key: [] + x-scopes: + - providers + x-codeSamples: + - lang: Shell + source: "curl --request GET \\\n --url https://console.jumpcloud.com/api/v2/integrations/autotask/{UUID}\ + \ \\\n --header 'x-api-key: REPLACE_KEY_VALUE'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/integrations/autotask/{UUID}\"\ + \n\nheaders = {\"x-api-key\": \"REPLACE_KEY_VALUE\"}\n\nresponse = requests.request(\"\ + GET\", url, headers=headers)\n\nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n\ + $response = Invoke-RestMethod -Uri 'https://console.jumpcloud.com/api/v2/integrations/autotask/{UUID}'\ + \ -Method GET -Headers $headers" + delete: + tags: + - Providers + summary: Delete Autotask Integration + description: Removes a Autotask integration. + operationId: autotask_deleteConfiguration + parameters: + - name: UUID + in: path + required: true + style: simple + explode: false + schema: + type: string + responses: + "204": + description: No Content + content: {} + "400": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorDetails' + "401": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "403": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "404": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "500": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + security: + - x-api-key: [] + x-scopes: + - providers + x-codeSamples: + - lang: Shell + source: "curl --request DELETE \\\n --url https://console.jumpcloud.com/api/v2/integrations/autotask/{UUID}\ + \ \\\n --header 'x-api-key: REPLACE_KEY_VALUE'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/integrations/autotask/{UUID}\"\ + \n\nheaders = {\"x-api-key\": \"REPLACE_KEY_VALUE\"}\n\nresponse = requests.request(\"\ + DELETE\", url, headers=headers)\n\nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n\ + $response = Invoke-RestMethod -Uri 'https://console.jumpcloud.com/api/v2/integrations/autotask/{UUID}'\ + \ -Method DELETE -Headers $headers" + patch: + tags: + - Providers + summary: Update Autotask Integration configuration + description: Update the Autotask integration configuration. A 422 Unprocessable + Entity response means the server failed to validate with Autotask. + operationId: autotask_updateConfiguration + parameters: + - name: UUID + in: path + required: true + style: simple + explode: false + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AutotaskIntegrationPatchReq' + required: false + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AutotaskIntegration' + "400": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorDetails' + "401": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "403": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "404": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "422": + description: Unprocessable Entity. The server failed to validate credentials + with Autotask. + content: + application/json: + schema: + type: object + x-content-type: application/json + "500": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + security: + - x-api-key: [] + x-scopes: + - providers + x-codeSamples: + - lang: Shell + source: "curl --request PATCH \\\n --url https://console.jumpcloud.com/api/v2/integrations/autotask/{UUID}\ + \ \\\n --header 'content-type: application/json' \\\n --header 'x-api-key:\ + \ REPLACE_KEY_VALUE' \\\n --data '{\"secret\":\"string\",\"username\":\"\ + string\"}'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/integrations/autotask/{UUID}\"\ + \n\npayload = {\n \"secret\": \"string\",\n \"username\": \"string\"\ + \n}\nheaders = {\n \"x-api-key\": \"REPLACE_KEY_VALUE\",\n \"content-type\"\ + : \"application/json\"\n}\n\nresponse = requests.request(\"PATCH\", url,\ + \ json=payload, headers=headers)\n\nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n\ + $headers.Add(\"content-type\", \"application/json\")\n$response = Invoke-RestMethod\ + \ -Uri 'https://console.jumpcloud.com/api/v2/integrations/autotask/{UUID}'\ + \ -Method PATCH -Headers $headers -ContentType 'application/json' -Body\ + \ '{\"secret\":\"string\",\"username\":\"string\"}'" + x-codegen-request-body-name: body + /integrations/autotask/{UUID}/companies: + get: + tags: + - Providers + summary: Retrieve Autotask Companies + description: Retrieves a list of Autotask companies for the given Autotask id. + You must be associated to the same provider as the Autotask integration to + use this endpoint. + operationId: autotask_retrieveCompanies + parameters: + - name: UUID + in: path + required: true + style: simple + explode: false + schema: + type: string + - name: fields + in: query + description: "The comma separated fields included in the returned records.\n\ + If omitted, the default list of fields will be returned.\n" + required: false + style: form + explode: false + schema: + type: array + items: + type: string + - name: filter + in: query + description: "A filter to apply to the query.\n\n**Filter structure**: `::`.\n\ + \n**field** = Populate with a valid field from an endpoint response.\n\n\ + **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between,\ + \ search, in.\n_Note: v1 operators differ from v2 operators._\n\n**value**\ + \ = Populate with the value you want to search for. Is case sensitive. Supports\ + \ wild cards.\n\n**EX:** `GET /api/v2/groups?filter=name:eq:Test+Group`" + required: false + style: form + explode: false + schema: + type: array + items: + type: string + - name: limit + in: query + description: The number of records to return at once. Limited to 100. + required: false + style: form + explode: true + schema: + type: integer + default: 10 + - name: skip + in: query + description: The offset into the records to return. + required: false + style: form + explode: true + schema: + minimum: 0 + type: integer + default: 0 + - name: sort + in: query + description: "The comma separated fields used to sort the collection.\nDefault\ + \ sort is ascending, prefix with `-` to sort descending.\n" + required: false + style: form + explode: false + schema: + type: array + items: + type: string + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AutotaskCompanyResp' + "400": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorDetails' + "401": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "403": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "404": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "500": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + security: + - x-api-key: [] + x-scopes: + - providers + x-codeSamples: + - lang: Shell + source: "curl --request GET \\\n --url 'https://console.jumpcloud.com/api/v2/integrations/autotask/{UUID}/companies?limit=10&skip=0'\ + \ \\\n --header 'x-api-key: REPLACE_KEY_VALUE'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/integrations/autotask/{UUID}/companies\"\ + \n\nquerystring = {\"limit\":\"10\",\"skip\":\"0\"}\n\nheaders = {\"x-api-key\"\ + : \"REPLACE_KEY_VALUE\"}\n\nresponse = requests.request(\"GET\", url, headers=headers,\ + \ params=querystring)\n\nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n\ + $response = Invoke-RestMethod -Uri 'https://console.jumpcloud.com/api/v2/integrations/autotask/{UUID}/companies?limit=10&skip=0'\ + \ -Method GET -Headers $headers" + /integrations/autotask/{UUID}/companytypes: + get: + tags: + - Providers + summary: Retrieve Autotask Company Types + description: Retrieves a list of user defined company types from Autotask for + the given Autotask id. + operationId: autotask_retrieveCompanyTypes + parameters: + - name: UUID + in: path + required: true + style: simple + explode: false + schema: + type: string + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AutotaskCompanyTypeResp' + "400": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorDetails' + "401": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "403": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "404": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "500": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + security: + - x-api-key: [] + x-scopes: + - providers + x-codeSamples: + - lang: Shell + source: "curl --request GET \\\n --url https://console.jumpcloud.com/api/v2/integrations/autotask/{UUID}/companytypes\ + \ \\\n --header 'x-api-key: REPLACE_KEY_VALUE'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/integrations/autotask/{UUID}/companytypes\"\ + \n\nheaders = {\"x-api-key\": \"REPLACE_KEY_VALUE\"}\n\nresponse = requests.request(\"\ + GET\", url, headers=headers)\n\nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n\ + $response = Invoke-RestMethod -Uri 'https://console.jumpcloud.com/api/v2/integrations/autotask/{UUID}/companytypes'\ + \ -Method GET -Headers $headers" + /integrations/autotask/{UUID}/contracts: + get: + tags: + - Providers + summary: Retrieve Autotask Contracts + description: Retrieves a list of Autotask contracts for the given Autotask integration + id. You must be associated to the same provider as the Autotask integration + to use this endpoint. + operationId: autotask_retrieveContracts + parameters: + - name: UUID + in: path + required: true + style: simple + explode: false + schema: + type: string + - name: fields + in: query + description: "The comma separated fields included in the returned records.\n\ + If omitted, the default list of fields will be returned.\n" + required: false + style: form + explode: false + schema: + type: array + items: + type: string + - name: filter + in: query + description: "A filter to apply to the query.\n\n**Filter structure**: `::`.\n\ + \n**field** = Populate with a valid field from an endpoint response.\n\n\ + **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between,\ + \ search, in.\n_Note: v1 operators differ from v2 operators._\n\n**value**\ + \ = Populate with the value you want to search for. Is case sensitive. Supports\ + \ wild cards.\n\n**EX:** `GET /api/v2/groups?filter=name:eq:Test+Group`" + required: false + style: form + explode: false + schema: + type: array + items: + type: string + - name: limit + in: query + description: The number of records to return at once. Limited to 100. + required: false + style: form + explode: true + schema: + type: integer + default: 10 + - name: skip + in: query + description: The offset into the records to return. + required: false + style: form + explode: true + schema: + minimum: 0 + type: integer + default: 0 + - name: sort + in: query + description: "The comma separated fields used to sort the collection.\nDefault\ + \ sort is ascending, prefix with `-` to sort descending.\n" + required: false + style: form + explode: false + schema: + type: array + items: + type: string + responses: + "200": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/inline_response_200_3' + "400": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorDetails' + "401": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "403": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "404": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "500": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + security: + - x-api-key: [] + x-scopes: + - providers + x-codeSamples: + - lang: Shell + source: "curl --request GET \\\n --url 'https://console.jumpcloud.com/api/v2/integrations/autotask/{UUID}/contracts?limit=10&skip=0'\ + \ \\\n --header 'x-api-key: REPLACE_KEY_VALUE'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/integrations/autotask/{UUID}/contracts\"\ + \n\nquerystring = {\"limit\":\"10\",\"skip\":\"0\"}\n\nheaders = {\"x-api-key\"\ + : \"REPLACE_KEY_VALUE\"}\n\nresponse = requests.request(\"GET\", url, headers=headers,\ + \ params=querystring)\n\nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n\ + $response = Invoke-RestMethod -Uri 'https://console.jumpcloud.com/api/v2/integrations/autotask/{UUID}/contracts?limit=10&skip=0'\ + \ -Method GET -Headers $headers" + /integrations/autotask/{UUID}/contracts/fields: + get: + tags: + - Providers + summary: Retrieve Autotask Contract Fields + description: Retrieves a list of Autotask contract fields for the given Autotask + integration id. You must be associated to the same provider as the Autotask + integration to use this endpoint. + operationId: autotask_retrieveContractsFields + parameters: + - name: UUID + in: path + required: true + style: simple + explode: false + schema: + type: string + responses: + "200": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/inline_response_200_4' + "400": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorDetails' + "401": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "403": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "404": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "500": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + security: + - x-api-key: [] + x-scopes: + - providers + x-codeSamples: + - lang: Shell + source: "curl --request GET \\\n --url https://console.jumpcloud.com/api/v2/integrations/autotask/{UUID}/contracts/fields\ + \ \\\n --header 'x-api-key: REPLACE_KEY_VALUE'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/integrations/autotask/{UUID}/contracts/fields\"\ + \n\nheaders = {\"x-api-key\": \"REPLACE_KEY_VALUE\"}\n\nresponse = requests.request(\"\ + GET\", url, headers=headers)\n\nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n\ + $response = Invoke-RestMethod -Uri 'https://console.jumpcloud.com/api/v2/integrations/autotask/{UUID}/contracts/fields'\ + \ -Method GET -Headers $headers" + /integrations/autotask/{UUID}/contracts/services: + get: + tags: + - Providers + summary: Retrieve Autotask Contract Services + description: Retrieves a list of Autotask contract services for the given Autotask + integration id. You must be associated to the same provider as the Autotask + integration to use this endpoint. + operationId: autotask_retrieveServices + parameters: + - name: UUID + in: path + required: true + style: simple + explode: false + schema: + type: string + - name: fields + in: query + description: "The comma separated fields included in the returned records.\n\ + If omitted, the default list of fields will be returned.\n" + required: false + style: form + explode: false + schema: + type: array + items: + type: string + - name: filter + in: query + description: "A filter to apply to the query.\n\n**Filter structure**: `::`.\n\ + \n**field** = Populate with a valid field from an endpoint response.\n\n\ + **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between,\ + \ search, in.\n_Note: v1 operators differ from v2 operators._\n\n**value**\ + \ = Populate with the value you want to search for. Is case sensitive. Supports\ + \ wild cards.\n\n**EX:** `GET /api/v2/groups?filter=name:eq:Test+Group`" + required: false + style: form + explode: false + schema: + type: array + items: + type: string + - name: limit + in: query + description: The number of records to return at once. Limited to 100. + required: false + style: form + explode: true + schema: + type: integer + default: 10 + - name: skip + in: query + description: The offset into the records to return. + required: false + style: form + explode: true + schema: + minimum: 0 + type: integer + default: 0 + - name: sort + in: query + description: "The comma separated fields used to sort the collection.\nDefault\ + \ sort is ascending, prefix with `-` to sort descending.\n" + required: false + style: form + explode: false + schema: + type: array + items: + type: string + responses: + "200": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/inline_response_200_5' + "400": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorDetails' + "401": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "403": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "404": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "500": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + security: + - x-api-key: [] + x-scopes: + - providers + x-codeSamples: + - lang: Shell + source: "curl --request GET \\\n --url 'https://console.jumpcloud.com/api/v2/integrations/autotask/{UUID}/contracts/services?limit=10&skip=0'\ + \ \\\n --header 'x-api-key: REPLACE_KEY_VALUE'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/integrations/autotask/{UUID}/contracts/services\"\ + \n\nquerystring = {\"limit\":\"10\",\"skip\":\"0\"}\n\nheaders = {\"x-api-key\"\ + : \"REPLACE_KEY_VALUE\"}\n\nresponse = requests.request(\"GET\", url, headers=headers,\ + \ params=querystring)\n\nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n\ + $response = Invoke-RestMethod -Uri 'https://console.jumpcloud.com/api/v2/integrations/autotask/{UUID}/contracts/services?limit=10&skip=0'\ + \ -Method GET -Headers $headers" + /integrations/autotask/{UUID}/mappings: + get: + tags: + - Providers + summary: Retrieve Autotask mappings + description: Retrieves the list of mappings for this Autotask integration. You + must be associated to the same provider as the Autotask integration to use + this api. + operationId: autotask_retrieveMappings + parameters: + - name: UUID + in: path + required: true + style: simple + explode: false + schema: + type: string + - name: fields + in: query + description: "The comma separated fields included in the returned records.\n\ + If omitted, the default list of fields will be returned.\n" + required: false + style: form + explode: false + schema: + type: array + items: + type: string + - name: filter + in: query + description: "A filter to apply to the query.\n\n**Filter structure**: `::`.\n\ + \n**field** = Populate with a valid field from an endpoint response.\n\n\ + **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between,\ + \ search, in.\n_Note: v1 operators differ from v2 operators._\n\n**value**\ + \ = Populate with the value you want to search for. Is case sensitive. Supports\ + \ wild cards.\n\n**EX:** `GET /api/v2/groups?filter=name:eq:Test+Group`" + required: false + style: form + explode: false + schema: + type: array + items: + type: string + - name: limit + in: query + description: The number of records to return at once. Limited to 100. + required: false + style: form + explode: true + schema: + type: integer + default: 10 + - name: skip + in: query + description: The offset into the records to return. + required: false + style: form + explode: true + schema: + minimum: 0 + type: integer + default: 0 + - name: sort + in: query + description: "The comma separated fields used to sort the collection.\nDefault\ + \ sort is ascending, prefix with `-` to sort descending.\n" + required: false + style: form + explode: false + schema: + type: array + items: + type: string + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/inline_response_200_6' + "400": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorDetails' + "401": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "403": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "404": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "500": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + security: + - x-api-key: [] + x-scopes: + - providers + x-codeSamples: + - lang: Shell + source: "curl --request GET \\\n --url 'https://console.jumpcloud.com/api/v2/integrations/autotask/{UUID}/mappings?limit=10&skip=0'\ + \ \\\n --header 'x-api-key: REPLACE_KEY_VALUE'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/integrations/autotask/{UUID}/mappings\"\ + \n\nquerystring = {\"limit\":\"10\",\"skip\":\"0\"}\n\nheaders = {\"x-api-key\"\ + : \"REPLACE_KEY_VALUE\"}\n\nresponse = requests.request(\"GET\", url, headers=headers,\ + \ params=querystring)\n\nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n\ + $response = Invoke-RestMethod -Uri 'https://console.jumpcloud.com/api/v2/integrations/autotask/{UUID}/mappings?limit=10&skip=0'\ + \ -Method GET -Headers $headers" + patch: + tags: + - Providers + summary: "Create, edit, and/or delete Autotask Mappings" + description: "Create, edit, and/or delete mappings between Jumpcloud organizations\ + \ and Autotask companies/contracts/services. You must be associated to the\ + \ same provider as the Autotask integration to use this api." + operationId: autotask_patchMappings + parameters: + - name: UUID + in: path + required: true + style: simple + explode: false + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AutotaskMappingRequest' + required: false + responses: + "204": + description: No Content + content: + application/json: + schema: + $ref: '#/components/schemas/AutotaskMappingResponse' + "400": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorDetails' + "401": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "403": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "404": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "500": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + security: + - x-api-key: [] + x-scopes: + - providers + x-codeSamples: + - lang: Shell + source: "curl --request PATCH \\\n --url https://console.jumpcloud.com/api/v2/integrations/autotask/{UUID}/mappings\ + \ \\\n --header 'content-type: application/json' \\\n --header 'x-api-key:\ + \ REPLACE_KEY_VALUE' \\\n --data '{\"data\":[{\"company\":{\"id\":\"string\"\ + ,\"name\":\"string\"},\"contract\":{\"id\":\"string\",\"name\":\"string\"\ + },\"delete\":true,\"organization\":{\"id\":\"string\",\"name\":\"string\"\ + },\"service\":{\"id\":\"string\",\"name\":\"string\",\"nonBillableUsers\"\ + :0}}]}'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/integrations/autotask/{UUID}/mappings\"\ + \n\npayload = {\"data\": [\n {\n \"company\": {\n \ + \ \"id\": \"string\",\n \"name\": \"string\"\n\ + \ },\n \"contract\": {\n \"id\": \"\ + string\",\n \"name\": \"string\"\n },\n \ + \ \"delete\": True,\n \"organization\": {\n \ + \ \"id\": \"string\",\n \"name\": \"string\"\n \ + \ },\n \"service\": {\n \"id\": \"string\"\ + ,\n \"name\": \"string\",\n \"nonBillableUsers\"\ + : 0\n }\n }\n ]}\nheaders = {\n \"x-api-key\": \"\ + REPLACE_KEY_VALUE\",\n \"content-type\": \"application/json\"\n}\n\n\ + response = requests.request(\"PATCH\", url, json=payload, headers=headers)\n\ + \nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n\ + $headers.Add(\"content-type\", \"application/json\")\n$response = Invoke-RestMethod\ + \ -Uri 'https://console.jumpcloud.com/api/v2/integrations/autotask/{UUID}/mappings'\ + \ -Method PATCH -Headers $headers -ContentType 'application/json' -Body\ + \ '{\"data\":[{\"company\":{\"id\":\"string\",\"name\":\"string\"},\"contract\"\ + :{\"id\":\"string\",\"name\":\"string\"},\"delete\":true,\"organization\"\ + :{\"id\":\"string\",\"name\":\"string\"},\"service\":{\"id\":\"string\"\ + ,\"name\":\"string\",\"nonBillableUsers\":0}}]}'" + x-codegen-request-body-name: body + /integrations/autotask/{UUID}/settings: + get: + tags: + - Providers + summary: Retrieve Autotask Integration settings + description: Retrieve the Autotask integration settings. You must be associated + to the same provider as the Autotask integration to use this endpoint. + operationId: autotask_retrieveSettings + parameters: + - name: UUID + in: path + required: true + style: simple + explode: false + schema: + type: string + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AutotaskSettings' + "400": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorDetails' + "401": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "403": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "404": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "500": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + security: + - x-api-key: [] + x-scopes: + - providers + x-codeSamples: + - lang: Shell + source: "curl --request GET \\\n --url https://console.jumpcloud.com/api/v2/integrations/autotask/{UUID}/settings\ + \ \\\n --header 'x-api-key: REPLACE_KEY_VALUE'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/integrations/autotask/{UUID}/settings\"\ + \n\nheaders = {\"x-api-key\": \"REPLACE_KEY_VALUE\"}\n\nresponse = requests.request(\"\ + GET\", url, headers=headers)\n\nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n\ + $response = Invoke-RestMethod -Uri 'https://console.jumpcloud.com/api/v2/integrations/autotask/{UUID}/settings'\ + \ -Method GET -Headers $headers" + patch: + tags: + - Providers + summary: "Create, edit, and/or delete Autotask Integration settings" + description: "Create, edit, and/or delete Autotask settings. You must be associated\ + \ to the same provider as the Autotask integration to use this endpoint." + operationId: autotask_patchSettings + parameters: + - name: UUID + in: path + required: true + style: simple + explode: false + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AutotaskSettingsPatchReq' + required: false + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AutotaskSettings' + "400": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorDetails' + "401": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "403": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "404": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "500": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + security: + - x-api-key: [] + x-scopes: + - providers + x-codeSamples: + - lang: Shell + source: "curl --request PATCH \\\n --url https://console.jumpcloud.com/api/v2/integrations/autotask/{UUID}/settings\ + \ \\\n --header 'content-type: application/json' \\\n --header 'x-api-key:\ + \ REPLACE_KEY_VALUE' \\\n --data '{\"automaticTicketing\":true,\"companyTypeIds\"\ + :[0]}'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/integrations/autotask/{UUID}/settings\"\ + \n\npayload = {\n \"automaticTicketing\": True,\n \"companyTypeIds\"\ + : [0]\n}\nheaders = {\n \"x-api-key\": \"REPLACE_KEY_VALUE\",\n \"\ + content-type\": \"application/json\"\n}\n\nresponse = requests.request(\"\ + PATCH\", url, json=payload, headers=headers)\n\nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n\ + $headers.Add(\"content-type\", \"application/json\")\n$response = Invoke-RestMethod\ + \ -Uri 'https://console.jumpcloud.com/api/v2/integrations/autotask/{UUID}/settings'\ + \ -Method PATCH -Headers $headers -ContentType 'application/json' -Body\ + \ '{\"automaticTicketing\":true,\"companyTypeIds\":[0]}'" + x-codegen-request-body-name: body + /integrations/connectwise/{UUID}: + get: + tags: + - Providers + summary: Retrieve ConnectWise Integration Configuration + description: Retrieves configuration for given ConnectWise integration id. You + must be associated to the provider the integration is tied to in order to + use this api. + operationId: connectwise_getConfiguration + parameters: + - name: UUID + in: path + required: true + style: simple + explode: false + schema: + type: string + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/ConnectwiseIntegration' + "400": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorDetails' + "401": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "403": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "404": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "500": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + security: + - x-api-key: [] + x-scopes: + - providers + x-codeSamples: + - lang: Shell + source: "curl --request GET \\\n --url https://console.jumpcloud.com/api/v2/integrations/connectwise/{UUID}\ + \ \\\n --header 'x-api-key: REPLACE_KEY_VALUE'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/integrations/connectwise/{UUID}\"\ + \n\nheaders = {\"x-api-key\": \"REPLACE_KEY_VALUE\"}\n\nresponse = requests.request(\"\ + GET\", url, headers=headers)\n\nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n\ + $response = Invoke-RestMethod -Uri 'https://console.jumpcloud.com/api/v2/integrations/connectwise/{UUID}'\ + \ -Method GET -Headers $headers" + delete: + tags: + - Providers + summary: Delete ConnectWise Integration + description: Removes a ConnectWise integration. + operationId: connectwise_deleteConfiguration + parameters: + - name: UUID + in: path + required: true + style: simple + explode: false + schema: + type: string + responses: + "204": + description: No Content + content: {} + "400": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorDetails' + "401": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "403": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "404": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "500": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + security: + - x-api-key: [] + x-scopes: + - providers + x-codeSamples: + - lang: Shell + source: "curl --request DELETE \\\n --url https://console.jumpcloud.com/api/v2/integrations/connectwise/{UUID}\ + \ \\\n --header 'x-api-key: REPLACE_KEY_VALUE'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/integrations/connectwise/{UUID}\"\ + \n\nheaders = {\"x-api-key\": \"REPLACE_KEY_VALUE\"}\n\nresponse = requests.request(\"\ + DELETE\", url, headers=headers)\n\nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n\ + $response = Invoke-RestMethod -Uri 'https://console.jumpcloud.com/api/v2/integrations/connectwise/{UUID}'\ + \ -Method DELETE -Headers $headers" + patch: + tags: + - Providers + summary: Update ConnectWise Integration configuration + description: Update the ConnectWise integration configuration. A 422 Unprocessable + Entity response means the server failed to validate with ConnectWise. + operationId: connectwise_updateConfiguration + parameters: + - name: UUID + in: path + required: true + style: simple + explode: false + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/ConnectwiseIntegrationPatchReq' + required: false + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/ConnectwiseIntegration' + "400": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorDetails' + "401": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "403": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "404": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "422": + description: Unprocessable Entity. The server failed to validate credentials + with ConnectWise. + content: + application/json: + schema: + type: object + x-content-type: application/json + "500": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + security: + - x-api-key: [] + x-scopes: + - providers + x-codeSamples: + - lang: Shell + source: "curl --request PATCH \\\n --url https://console.jumpcloud.com/api/v2/integrations/connectwise/{UUID}\ + \ \\\n --header 'content-type: application/json' \\\n --header 'x-api-key:\ + \ REPLACE_KEY_VALUE' \\\n --data '{\"companyId\":\"string\",\"privateKey\"\ + :\"string\",\"publicKey\":\"string\",\"url\":\"string\"}'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/integrations/connectwise/{UUID}\"\ + \n\npayload = {\n \"companyId\": \"string\",\n \"privateKey\": \"\ + string\",\n \"publicKey\": \"string\",\n \"url\": \"string\"\n}\n\ + headers = {\n \"x-api-key\": \"REPLACE_KEY_VALUE\",\n \"content-type\"\ + : \"application/json\"\n}\n\nresponse = requests.request(\"PATCH\", url,\ + \ json=payload, headers=headers)\n\nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n\ + $headers.Add(\"content-type\", \"application/json\")\n$response = Invoke-RestMethod\ + \ -Uri 'https://console.jumpcloud.com/api/v2/integrations/connectwise/{UUID}'\ + \ -Method PATCH -Headers $headers -ContentType 'application/json' -Body\ + \ '{\"companyId\":\"string\",\"privateKey\":\"string\",\"publicKey\":\"\ + string\",\"url\":\"string\"}'" + x-codegen-request-body-name: body + /integrations/connectwise/{UUID}/agreements: + get: + tags: + - Providers + summary: Retrieve ConnectWise Agreements + description: Retrieves a list of ConnectWise agreements for the given ConnectWise + id. You must be associated to the same provider as the ConnectWise integration + to use this endpoint. + operationId: connectwise_retrieveAgreements + parameters: + - name: UUID + in: path + required: true + style: simple + explode: false + schema: + type: string + - name: fields + in: query + description: "The comma separated fields included in the returned records.\n\ + If omitted, the default list of fields will be returned.\n" + required: false + style: form + explode: false + schema: + type: array + items: + type: string + - name: filter + in: query + description: "A filter to apply to the query.\n\n**Filter structure**: `::`.\n\ + \n**field** = Populate with a valid field from an endpoint response.\n\n\ + **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between,\ + \ search, in.\n_Note: v1 operators differ from v2 operators._\n\n**value**\ + \ = Populate with the value you want to search for. Is case sensitive. Supports\ + \ wild cards.\n\n**EX:** `GET /api/v2/groups?filter=name:eq:Test+Group`" + required: false + style: form + explode: false + schema: + type: array + items: + type: string + - name: limit + in: query + description: The number of records to return at once. Limited to 100. + required: false + style: form + explode: true + schema: + type: integer + default: 10 + - name: skip + in: query + description: The offset into the records to return. + required: false + style: form + explode: true + schema: + minimum: 0 + type: integer + default: 0 + - name: sort + in: query + description: "The comma separated fields used to sort the collection.\nDefault\ + \ sort is ascending, prefix with `-` to sort descending.\n" + required: false + style: form + explode: false + schema: + type: array + items: + type: string + responses: + "200": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/inline_response_200_7' + "400": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorDetails' + "401": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "403": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "404": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "500": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + security: + - x-api-key: [] + x-scopes: + - providers + x-codeSamples: + - lang: Shell + source: "curl --request GET \\\n --url 'https://console.jumpcloud.com/api/v2/integrations/connectwise/{UUID}/agreements?limit=10&skip=0'\ + \ \\\n --header 'x-api-key: REPLACE_KEY_VALUE'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/integrations/connectwise/{UUID}/agreements\"\ + \n\nquerystring = {\"limit\":\"10\",\"skip\":\"0\"}\n\nheaders = {\"x-api-key\"\ + : \"REPLACE_KEY_VALUE\"}\n\nresponse = requests.request(\"GET\", url, headers=headers,\ + \ params=querystring)\n\nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n\ + $response = Invoke-RestMethod -Uri 'https://console.jumpcloud.com/api/v2/integrations/connectwise/{UUID}/agreements?limit=10&skip=0'\ + \ -Method GET -Headers $headers" + /integrations/connectwise/{UUID}/agreements/{agreement_ID}/additions: + get: + tags: + - Providers + summary: Retrieve ConnectWise Additions + description: Retrieves a list of ConnectWise additions for the given ConnectWise + id and Agreement id. You must be associated to the same provider as the ConnectWise + integration to use this endpoint. + operationId: connectwise_retrieveAdditions + parameters: + - name: UUID + in: path + required: true + style: simple + explode: false + schema: + type: string + - name: agreement_ID + in: path + required: true + style: simple + explode: false + schema: + type: string + - name: fields + in: query + description: "The comma separated fields included in the returned records.\n\ + If omitted, the default list of fields will be returned.\n" + required: false + style: form + explode: false + schema: + type: array + items: + type: string + - name: filter + in: query + description: "A filter to apply to the query.\n\n**Filter structure**: `::`.\n\ + \n**field** = Populate with a valid field from an endpoint response.\n\n\ + **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between,\ + \ search, in.\n_Note: v1 operators differ from v2 operators._\n\n**value**\ + \ = Populate with the value you want to search for. Is case sensitive. Supports\ + \ wild cards.\n\n**EX:** `GET /api/v2/groups?filter=name:eq:Test+Group`" + required: false + style: form + explode: false + schema: + type: array + items: + type: string + - name: limit + in: query + description: The number of records to return at once. Limited to 100. + required: false + style: form + explode: true + schema: + type: integer + default: 10 + - name: skip + in: query + description: The offset into the records to return. + required: false + style: form + explode: true + schema: + minimum: 0 + type: integer + default: 0 + - name: sort + in: query + description: "The comma separated fields used to sort the collection.\nDefault\ + \ sort is ascending, prefix with `-` to sort descending.\n" + required: false + style: form + explode: false + schema: + type: array + items: + type: string + responses: + "200": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/inline_response_200_8' + "400": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorDetails' + "401": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "403": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "404": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "500": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + security: + - x-api-key: [] + x-scopes: + - providers + x-codeSamples: + - lang: Shell + source: "curl --request GET \\\n --url 'https://console.jumpcloud.com/api/v2/integrations/connectwise/{UUID}/agreements/{agreement_ID}/additions?limit=10&skip=0'\ + \ \\\n --header 'x-api-key: REPLACE_KEY_VALUE'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/integrations/connectwise/{UUID}/agreements/{agreement_ID}/additions\"\ + \n\nquerystring = {\"limit\":\"10\",\"skip\":\"0\"}\n\nheaders = {\"x-api-key\"\ + : \"REPLACE_KEY_VALUE\"}\n\nresponse = requests.request(\"GET\", url, headers=headers,\ + \ params=querystring)\n\nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n\ + $response = Invoke-RestMethod -Uri 'https://console.jumpcloud.com/api/v2/integrations/connectwise/{UUID}/agreements/{agreement_ID}/additions?limit=10&skip=0'\ + \ -Method GET -Headers $headers" + /integrations/connectwise/{UUID}/companies: + get: + tags: + - Providers + summary: Retrieve ConnectWise Companies + description: Retrieves a list of ConnectWise companies for the given ConnectWise + id. You must be associated to the same provider as the ConnectWise integration + to use this endpoint. + operationId: connectwise_retrieveCompanies + parameters: + - name: UUID + in: path + required: true + style: simple + explode: false + schema: + type: string + - name: fields + in: query + description: "The comma separated fields included in the returned records.\n\ + If omitted, the default list of fields will be returned.\n" + required: false + style: form + explode: false + schema: + type: array + items: + type: string + - name: filter + in: query + description: "A filter to apply to the query.\n\n**Filter structure**: `::`.\n\ + \n**field** = Populate with a valid field from an endpoint response.\n\n\ + **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between,\ + \ search, in.\n_Note: v1 operators differ from v2 operators._\n\n**value**\ + \ = Populate with the value you want to search for. Is case sensitive. Supports\ + \ wild cards.\n\n**EX:** `GET /api/v2/groups?filter=name:eq:Test+Group`" + required: false + style: form + explode: false + schema: + type: array + items: + type: string + - name: limit + in: query + description: The number of records to return at once. Limited to 100. + required: false + style: form + explode: true + schema: + type: integer + default: 10 + - name: skip + in: query + description: The offset into the records to return. + required: false + style: form + explode: true + schema: + minimum: 0 + type: integer + default: 0 + - name: sort + in: query + description: "The comma separated fields used to sort the collection.\nDefault\ + \ sort is ascending, prefix with `-` to sort descending.\n" + required: false + style: form + explode: false + schema: + type: array + items: + type: string + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/ConnectwiseCompanyResp' + "400": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorDetails' + "401": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "403": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "404": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "500": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + security: + - x-api-key: [] + x-scopes: + - providers + x-codeSamples: + - lang: Shell + source: "curl --request GET \\\n --url 'https://console.jumpcloud.com/api/v2/integrations/connectwise/{UUID}/companies?limit=10&skip=0'\ + \ \\\n --header 'x-api-key: REPLACE_KEY_VALUE'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/integrations/connectwise/{UUID}/companies\"\ + \n\nquerystring = {\"limit\":\"10\",\"skip\":\"0\"}\n\nheaders = {\"x-api-key\"\ + : \"REPLACE_KEY_VALUE\"}\n\nresponse = requests.request(\"GET\", url, headers=headers,\ + \ params=querystring)\n\nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n\ + $response = Invoke-RestMethod -Uri 'https://console.jumpcloud.com/api/v2/integrations/connectwise/{UUID}/companies?limit=10&skip=0'\ + \ -Method GET -Headers $headers" + /integrations/connectwise/{UUID}/companytypes: + get: + tags: + - Providers + summary: Retrieve ConnectWise Company Types + description: Retrieves a list of user defined company types from ConnectWise + for the given ConnectWise id. + operationId: connectwise_retrieveCompanyTypes + parameters: + - name: UUID + in: path + required: true + style: simple + explode: false + schema: + type: string + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/ConnectwiseCompanyTypeResp' + "400": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorDetails' + "401": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "403": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "404": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "500": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + security: + - x-api-key: [] + x-scopes: + - providers + x-codeSamples: + - lang: Shell + source: "curl --request GET \\\n --url https://console.jumpcloud.com/api/v2/integrations/connectwise/{UUID}/companytypes\ + \ \\\n --header 'x-api-key: REPLACE_KEY_VALUE'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/integrations/connectwise/{UUID}/companytypes\"\ + \n\nheaders = {\"x-api-key\": \"REPLACE_KEY_VALUE\"}\n\nresponse = requests.request(\"\ + GET\", url, headers=headers)\n\nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n\ + $response = Invoke-RestMethod -Uri 'https://console.jumpcloud.com/api/v2/integrations/connectwise/{UUID}/companytypes'\ + \ -Method GET -Headers $headers" + /integrations/connectwise/{UUID}/mappings: + get: + tags: + - Providers + summary: Retrieve ConnectWise mappings + description: Retrieves the list of mappings for this ConnectWise integration. + You must be associated to the same provider as the ConnectWise integration + to use this api. + operationId: connectwise_retrieveMappings + parameters: + - name: UUID + in: path + required: true + style: simple + explode: false + schema: + type: string + - name: fields + in: query + description: "The comma separated fields included in the returned records.\n\ + If omitted, the default list of fields will be returned.\n" + required: false + style: form + explode: false + schema: + type: array + items: + type: string + - name: filter + in: query + description: "A filter to apply to the query.\n\n**Filter structure**: `::`.\n\ + \n**field** = Populate with a valid field from an endpoint response.\n\n\ + **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between,\ + \ search, in.\n_Note: v1 operators differ from v2 operators._\n\n**value**\ + \ = Populate with the value you want to search for. Is case sensitive. Supports\ + \ wild cards.\n\n**EX:** `GET /api/v2/groups?filter=name:eq:Test+Group`" + required: false + style: form + explode: false + schema: + type: array + items: + type: string + - name: limit + in: query + description: The number of records to return at once. Limited to 100. + required: false + style: form + explode: true + schema: + type: integer + default: 10 + - name: skip + in: query + description: The offset into the records to return. + required: false + style: form + explode: true + schema: + minimum: 0 + type: integer + default: 0 + - name: sort + in: query + description: "The comma separated fields used to sort the collection.\nDefault\ + \ sort is ascending, prefix with `-` to sort descending.\n" + required: false + style: form + explode: false + schema: + type: array + items: + type: string + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/inline_response_200_9' + "400": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorDetails' + "401": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "403": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "404": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "500": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + security: + - x-api-key: [] + x-scopes: + - providers + x-codeSamples: + - lang: Shell + source: "curl --request GET \\\n --url 'https://console.jumpcloud.com/api/v2/integrations/connectwise/{UUID}/mappings?limit=10&skip=0'\ + \ \\\n --header 'x-api-key: REPLACE_KEY_VALUE'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/integrations/connectwise/{UUID}/mappings\"\ + \n\nquerystring = {\"limit\":\"10\",\"skip\":\"0\"}\n\nheaders = {\"x-api-key\"\ + : \"REPLACE_KEY_VALUE\"}\n\nresponse = requests.request(\"GET\", url, headers=headers,\ + \ params=querystring)\n\nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n\ + $response = Invoke-RestMethod -Uri 'https://console.jumpcloud.com/api/v2/integrations/connectwise/{UUID}/mappings?limit=10&skip=0'\ + \ -Method GET -Headers $headers" + patch: + tags: + - Providers + summary: "Create, edit, and/or delete ConnectWise Mappings" + description: "Create, edit, and/or delete mappings between Jumpcloud organizations\ + \ and ConnectWise companies/agreements/additions. You must be associated to\ + \ the same provider as the ConnectWise integration to use this api." + operationId: connectwise_patchMappings + parameters: + - name: UUID + in: path + required: true + style: simple + explode: false + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/ConnectWiseMappingRequest' + required: false + responses: + "204": + description: No Content + content: + application/json: + schema: + $ref: '#/components/schemas/ConnectWiseMappingRequest' + "400": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorDetails' + "401": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "403": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "404": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "500": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + security: + - x-api-key: [] + x-scopes: + - providers + x-codeSamples: + - lang: Shell + source: "curl --request PATCH \\\n --url https://console.jumpcloud.com/api/v2/integrations/connectwise/{UUID}/mappings\ + \ \\\n --header 'content-type: application/json' \\\n --header 'x-api-key:\ + \ REPLACE_KEY_VALUE' \\\n --data '{\"data\":[{\"addition\":{\"id\":\"string\"\ + ,\"name\":\"string\"},\"agreement\":{\"id\":\"string\",\"name\":\"string\"\ + },\"company\":{\"id\":\"string\",\"name\":\"string\"},\"delete\":true,\"\ + organization\":{\"id\":\"string\",\"name\":\"string\"}}]}'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/integrations/connectwise/{UUID}/mappings\"\ + \n\npayload = {\"data\": [\n {\n \"addition\": {\n \ + \ \"id\": \"string\",\n \"name\": \"string\"\n\ + \ },\n \"agreement\": {\n \"id\": \"\ + string\",\n \"name\": \"string\"\n },\n \ + \ \"company\": {\n \"id\": \"string\",\n \ + \ \"name\": \"string\"\n },\n \"delete\": True,\n\ + \ \"organization\": {\n \"id\": \"string\",\n\ + \ \"name\": \"string\"\n }\n }\n ]}\n\ + headers = {\n \"x-api-key\": \"REPLACE_KEY_VALUE\",\n \"content-type\"\ + : \"application/json\"\n}\n\nresponse = requests.request(\"PATCH\", url,\ + \ json=payload, headers=headers)\n\nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n\ + $headers.Add(\"content-type\", \"application/json\")\n$response = Invoke-RestMethod\ + \ -Uri 'https://console.jumpcloud.com/api/v2/integrations/connectwise/{UUID}/mappings'\ + \ -Method PATCH -Headers $headers -ContentType 'application/json' -Body\ + \ '{\"data\":[{\"addition\":{\"id\":\"string\",\"name\":\"string\"},\"agreement\"\ + :{\"id\":\"string\",\"name\":\"string\"},\"company\":{\"id\":\"string\"\ + ,\"name\":\"string\"},\"delete\":true,\"organization\":{\"id\":\"string\"\ + ,\"name\":\"string\"}}]}'" + x-codegen-request-body-name: body + /integrations/connectwise/{UUID}/settings: + get: + tags: + - Providers + summary: Retrieve ConnectWise Integration settings + description: Retrieve the ConnectWise integration settings. You must be associated + to the same provider as the ConnectWise integration to use this endpoint. + operationId: connectwise_retrieveSettings + parameters: + - name: UUID + in: path + required: true + style: simple + explode: false + schema: + type: string + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/ConnectWiseSettings' + "400": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorDetails' + "401": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "403": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "404": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "500": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + security: + - x-api-key: [] + x-scopes: + - providers + x-codeSamples: + - lang: Shell + source: "curl --request GET \\\n --url https://console.jumpcloud.com/api/v2/integrations/connectwise/{UUID}/settings\ + \ \\\n --header 'x-api-key: REPLACE_KEY_VALUE'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/integrations/connectwise/{UUID}/settings\"\ + \n\nheaders = {\"x-api-key\": \"REPLACE_KEY_VALUE\"}\n\nresponse = requests.request(\"\ + GET\", url, headers=headers)\n\nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n\ + $response = Invoke-RestMethod -Uri 'https://console.jumpcloud.com/api/v2/integrations/connectwise/{UUID}/settings'\ + \ -Method GET -Headers $headers" + patch: + tags: + - Providers + summary: "Create, edit, and/or delete ConnectWise Integration settings" + description: "Create, edit, and/or delete ConnectWiseIntegration settings. You\ + \ must be associated to the same provider as the ConnectWise integration to\ + \ use this endpoint." + operationId: connectwise_patchSettings + parameters: + - name: UUID + in: path + required: true + style: simple + explode: false + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/ConnectWiseSettingsPatchReq' + required: false + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/ConnectWiseSettings' + "400": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorDetails' + "401": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "403": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "404": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "500": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + security: + - x-api-key: [] + x-scopes: + - providers + x-codeSamples: + - lang: Shell + source: "curl --request PATCH \\\n --url https://console.jumpcloud.com/api/v2/integrations/connectwise/{UUID}/settings\ + \ \\\n --header 'content-type: application/json' \\\n --header 'x-api-key:\ + \ REPLACE_KEY_VALUE' \\\n --data '{\"automaticTicketing\":true,\"companyTypeIds\"\ + :[0]}'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/integrations/connectwise/{UUID}/settings\"\ + \n\npayload = {\n \"automaticTicketing\": True,\n \"companyTypeIds\"\ + : [0]\n}\nheaders = {\n \"x-api-key\": \"REPLACE_KEY_VALUE\",\n \"\ + content-type\": \"application/json\"\n}\n\nresponse = requests.request(\"\ + PATCH\", url, json=payload, headers=headers)\n\nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n\ + $headers.Add(\"content-type\", \"application/json\")\n$response = Invoke-RestMethod\ + \ -Uri 'https://console.jumpcloud.com/api/v2/integrations/connectwise/{UUID}/settings'\ + \ -Method PATCH -Headers $headers -ContentType 'application/json' -Body\ + \ '{\"automaticTicketing\":true,\"companyTypeIds\":[0]}'" + x-codegen-request-body-name: body + /integrations/{integration_type}/{UUID}/errors: + get: + tags: + - Providers + summary: Retrieve Recent Integration Sync Errors + description: Retrieves recent sync errors for given integration type and integration + id. You must be associated to the provider the integration is tied to in order + to use this api. + operationId: mtpIntegration_retrieveSyncErrors + parameters: + - name: UUID + in: path + required: true + style: simple + explode: false + schema: + type: string + - name: integration_type + in: path + required: true + style: simple + explode: false + schema: + type: string + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/IntegrationSyncErrorResp' + "400": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorDetails' + "401": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "403": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "404": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "500": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + security: + - x-api-key: [] + x-scopes: + - providers + x-codeSamples: + - lang: Shell + source: "curl --request GET \\\n --url https://console.jumpcloud.com/api/v2/integrations/{integration_type}/{UUID}/errors\ + \ \\\n --header 'x-api-key: REPLACE_KEY_VALUE'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/integrations/{integration_type}/{UUID}/errors\"\ + \n\nheaders = {\"x-api-key\": \"REPLACE_KEY_VALUE\"}\n\nresponse = requests.request(\"\ + GET\", url, headers=headers)\n\nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n\ + $response = Invoke-RestMethod -Uri 'https://console.jumpcloud.com/api/v2/integrations/{integration_type}/{UUID}/errors'\ + \ -Method GET -Headers $headers" + /iplists: + get: + tags: + - IP Lists + summary: List IP Lists + description: "Retrieve all IP lists.\n\n#### Sample Request\n```\ncurl https://console.jumpcloud.com/api/v2/iplists\ + \ \\\n -H 'accept: application/json' \\\n -H 'content-type: application/json'\ + \ \\\n -H 'x-api-key: {API_KEY}'\n```" + operationId: iplists_list + parameters: + - name: x-org-id + in: header + description: Organization identifier that can be obtained from console settings. + required: false + style: simple + explode: false + schema: + type: string + - name: x-total-count + in: header + required: false + style: simple + explode: false + schema: + type: integer + - name: limit + in: query + description: The number of records to return at once. Limited to 100. + required: false + style: form + explode: true + schema: + type: integer + default: 10 + - name: skip + in: query + description: The offset into the records to return. + required: false + style: form + explode: true + schema: + minimum: 0 + type: integer + default: 0 + - name: filter + in: query + description: "A filter to apply to the query.\n\n**Filter structure**: `::`.\n\ + \n**field** = Populate with a valid field from an endpoint response.\n\n\ + **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between,\ + \ search, in.\n_Note: v1 operators differ from v2 operators._\n\n**value**\ + \ = Populate with the value you want to search for. Is case sensitive. Supports\ + \ wild cards.\n\n**EX:** `GET /api/v2/groups?filter=name:eq:Test+Group`" + required: false + style: form + explode: false + schema: + type: array + items: + type: string + - name: sort + in: query + description: "The comma separated fields used to sort the collection.\nDefault\ + \ sort is ascending, prefix with `-` to sort descending.\n" + required: false + style: form + explode: false + schema: + type: array + items: + type: string + responses: + "200": + description: OK + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/IPList' + x-content-type: application/json + "400": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorDetails' + "401": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "403": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "404": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "409": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "500": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + security: + - x-api-key: [] + x-scopes: + - authn + - authn.readonly + x-codeSamples: + - lang: Shell + source: "curl --request GET \\\n --url 'https://console.jumpcloud.com/api/v2/iplists?limit=10&skip=0'\ + \ \\\n --header 'x-api-key: REPLACE_KEY_VALUE' \\\n --header 'x-org-id:\ + \ SOME_STRING_VALUE' \\\n --header 'x-total-count: SOME_INTEGER_VALUE'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/iplists\"\ + \n\nquerystring = {\"limit\":\"10\",\"skip\":\"0\"}\n\nheaders = {\n \ + \ \"x-org-id\": \"SOME_STRING_VALUE\",\n \"x-total-count\": \"SOME_INTEGER_VALUE\"\ + ,\n \"x-api-key\": \"REPLACE_KEY_VALUE\"\n}\n\nresponse = requests.request(\"\ + GET\", url, headers=headers, params=querystring)\n\nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-org-id\", \"SOME_STRING_VALUE\")\n\ + $headers.Add(\"x-total-count\", \"SOME_INTEGER_VALUE\")\n$headers.Add(\"\ + x-api-key\", \"REPLACE_KEY_VALUE\")\n$response = Invoke-RestMethod -Uri\ + \ 'https://console.jumpcloud.com/api/v2/iplists?limit=10&skip=0' -Method\ + \ GET -Headers $headers" + post: + tags: + - IP Lists + summary: Create IP List + description: "Create an IP list.\n\n#### Sample Request\n```\ncurl -X POST https://console.jumpcloud.com/api/v2/iplists\ + \ \\\n -H 'accept: application/json' \\\n -H 'content-type: application/json'\ + \ \\\n -H 'x-api-key: {API_KEY}' \\\n -d '{\n \"name\": \"Sample IP List\"\ + ,\n \"ips\": [\n \"192.168.10.12\",\n \"192.168.10.20 - 192.168.10.30\"\ + ,\n \"123.225.10.0/32\"\n ]\n }'\n```" + operationId: iplists_post + parameters: + - name: x-org-id + in: header + description: Organization identifier that can be obtained from console settings. + required: false + style: simple + explode: false + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/IPListRequest' + required: false + responses: + "201": + description: Created + content: + application/json: + schema: + $ref: '#/components/schemas/IPList' + "400": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorDetails' + "401": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "403": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "404": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "409": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "500": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + security: + - x-api-key: [] + x-scopes: + - authn + x-codeSamples: + - lang: Shell + source: "curl --request POST \\\n --url https://console.jumpcloud.com/api/v2/iplists\ + \ \\\n --header 'content-type: application/json' \\\n --header 'x-api-key:\ + \ REPLACE_KEY_VALUE' \\\n --header 'x-org-id: SOME_STRING_VALUE' \\\n \ + \ --data '{\"description\":\"string\",\"ips\":[\"string\"],\"name\":\"string\"\ + }'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/iplists\"\ + \n\npayload = {\n \"description\": \"string\",\n \"ips\": [\"string\"\ + ],\n \"name\": \"string\"\n}\nheaders = {\n \"x-org-id\": \"SOME_STRING_VALUE\"\ + ,\n \"x-api-key\": \"REPLACE_KEY_VALUE\",\n \"content-type\": \"application/json\"\ + \n}\n\nresponse = requests.request(\"POST\", url, json=payload, headers=headers)\n\ + \nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-org-id\", \"SOME_STRING_VALUE\")\n\ + $headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n$headers.Add(\"content-type\"\ + , \"application/json\")\n$response = Invoke-RestMethod -Uri 'https://console.jumpcloud.com/api/v2/iplists'\ + \ -Method POST -Headers $headers -ContentType 'application/json' -Body '{\"\ + description\":\"string\",\"ips\":[\"string\"],\"name\":\"string\"}'" + x-codegen-request-body-name: body + /iplists/{id}: + get: + tags: + - IP Lists + summary: Get an IP list + description: "Return a specific IP list.\n\n#### Sample Request\n```\ncurl https://console.jumpcloud.com/api/v2/iplists/{id}\ + \ \\\n -H 'accept: application/json' \\\n -H 'content-type: application/json'\ + \ \\\n -H 'x-api-key: {API_KEY}'\n```" + operationId: iplists_get + parameters: + - name: id + in: path + required: true + style: simple + explode: false + schema: + type: string + - name: x-org-id + in: header + description: Organization identifier that can be obtained from console settings. + required: false + style: simple + explode: false + schema: + type: string + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/IPList' + "400": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorDetails' + "401": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "403": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "404": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "409": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "500": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + security: + - x-api-key: [] + x-scopes: + - authn + - authn.readonly + x-codeSamples: + - lang: Shell + source: "curl --request GET \\\n --url https://console.jumpcloud.com/api/v2/iplists/{id}\ + \ \\\n --header 'x-api-key: REPLACE_KEY_VALUE' \\\n --header 'x-org-id:\ + \ SOME_STRING_VALUE'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/iplists/{id}\"\ + \n\nheaders = {\n \"x-org-id\": \"SOME_STRING_VALUE\",\n \"x-api-key\"\ + : \"REPLACE_KEY_VALUE\"\n}\n\nresponse = requests.request(\"GET\", url,\ + \ headers=headers)\n\nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-org-id\", \"SOME_STRING_VALUE\")\n\ + $headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n$response = Invoke-RestMethod\ + \ -Uri 'https://console.jumpcloud.com/api/v2/iplists/{id}' -Method GET -Headers\ + \ $headers" + put: + tags: + - IP Lists + summary: Replace an IP list + description: "Replace a specific IP list.\n\n#### Sample Request\n```\ncurl\ + \ -X PUT https://console.jumpcloud.com/api/v2/iplists/{id} \\\n -H 'accept:\ + \ application/json' \\\n -H 'content-type: application/json' \\\n -H 'x-api-key:\ + \ {API_KEY}' \\\n -d '{\n \"name\": \"Sample IP List\",\n \"ips\":\ + \ [\n \"192.168.10.10\"\n ]\n }'\n```" + operationId: iplists_put + parameters: + - name: id + in: path + required: true + style: simple + explode: false + schema: + type: string + - name: x-org-id + in: header + description: Organization identifier that can be obtained from console settings. + required: false + style: simple + explode: false + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/IPListRequest' + required: false + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/IPList' + "400": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorDetails' + "401": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "403": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "404": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "409": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "500": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + security: + - x-api-key: [] + x-scopes: + - authn + x-codeSamples: + - lang: Shell + source: "curl --request PUT \\\n --url https://console.jumpcloud.com/api/v2/iplists/{id}\ + \ \\\n --header 'content-type: application/json' \\\n --header 'x-api-key:\ + \ REPLACE_KEY_VALUE' \\\n --header 'x-org-id: SOME_STRING_VALUE' \\\n \ + \ --data '{\"description\":\"string\",\"ips\":[\"string\"],\"name\":\"string\"\ + }'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/iplists/{id}\"\ + \n\npayload = {\n \"description\": \"string\",\n \"ips\": [\"string\"\ + ],\n \"name\": \"string\"\n}\nheaders = {\n \"x-org-id\": \"SOME_STRING_VALUE\"\ + ,\n \"x-api-key\": \"REPLACE_KEY_VALUE\",\n \"content-type\": \"application/json\"\ + \n}\n\nresponse = requests.request(\"PUT\", url, json=payload, headers=headers)\n\ + \nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-org-id\", \"SOME_STRING_VALUE\")\n\ + $headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n$headers.Add(\"content-type\"\ + , \"application/json\")\n$response = Invoke-RestMethod -Uri 'https://console.jumpcloud.com/api/v2/iplists/{id}'\ + \ -Method PUT -Headers $headers -ContentType 'application/json' -Body '{\"\ + description\":\"string\",\"ips\":[\"string\"],\"name\":\"string\"}'" + x-codegen-request-body-name: body + delete: + tags: + - IP Lists + summary: Delete an IP list + description: "Delete a specific IP list.\n\n#### Sample Request\n```\ncurl -X\ + \ DELETE https://console.jumpcloud.com/api/v2/iplists/{id} \\\n -H 'accept:\ + \ application/json' \\\n -H 'content-type: application/json' \\\n -H 'x-api-key:\ + \ {API_KEY}'\n```" + operationId: iplists_delete + parameters: + - name: id + in: path + required: true + style: simple + explode: false + schema: + type: string + - name: x-org-id + in: header + description: Organization identifier that can be obtained from console settings. + required: false + style: simple + explode: false + schema: + type: string + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/IPList' + "400": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorDetails' + "401": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "403": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "404": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "409": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "500": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + security: + - x-api-key: [] + x-scopes: + - authn + x-codeSamples: + - lang: Shell + source: "curl --request DELETE \\\n --url https://console.jumpcloud.com/api/v2/iplists/{id}\ + \ \\\n --header 'x-api-key: REPLACE_KEY_VALUE' \\\n --header 'x-org-id:\ + \ SOME_STRING_VALUE'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/iplists/{id}\"\ + \n\nheaders = {\n \"x-org-id\": \"SOME_STRING_VALUE\",\n \"x-api-key\"\ + : \"REPLACE_KEY_VALUE\"\n}\n\nresponse = requests.request(\"DELETE\", url,\ + \ headers=headers)\n\nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-org-id\", \"SOME_STRING_VALUE\")\n\ + $headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n$response = Invoke-RestMethod\ + \ -Uri 'https://console.jumpcloud.com/api/v2/iplists/{id}' -Method DELETE\ + \ -Headers $headers" + patch: + tags: + - IP Lists + summary: Update an IP list + description: "Update a specific IP list.\n\n#### Sample Request\n```\ncurl -X\ + \ PATCH https://console.jumpcloud.com/api/v2/iplists/{id} \\\n -H 'accept:\ + \ application/json' \\\n -H 'content-type: application/json' \\\n -H 'x-api-key:\ + \ {API_KEY}' \\\n -d '{\"name\": \"New IP List Name\"}'\n```" + operationId: iplists_patch + parameters: + - name: id + in: path + required: true + style: simple + explode: false + schema: + type: string + - name: x-org-id + in: header + description: Organization identifier that can be obtained from console settings. + required: false + style: simple + explode: false + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/IPListRequest' + required: false + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/IPList' + "400": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorDetails' + "401": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "403": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "404": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "409": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "500": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + security: + - x-api-key: [] + x-scopes: + - authn + x-codeSamples: + - lang: Shell + source: "curl --request PATCH \\\n --url https://console.jumpcloud.com/api/v2/iplists/{id}\ + \ \\\n --header 'content-type: application/json' \\\n --header 'x-api-key:\ + \ REPLACE_KEY_VALUE' \\\n --header 'x-org-id: SOME_STRING_VALUE' \\\n \ + \ --data '{\"description\":\"string\",\"ips\":[\"string\"],\"name\":\"string\"\ + }'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/iplists/{id}\"\ + \n\npayload = {\n \"description\": \"string\",\n \"ips\": [\"string\"\ + ],\n \"name\": \"string\"\n}\nheaders = {\n \"x-org-id\": \"SOME_STRING_VALUE\"\ + ,\n \"x-api-key\": \"REPLACE_KEY_VALUE\",\n \"content-type\": \"application/json\"\ + \n}\n\nresponse = requests.request(\"PATCH\", url, json=payload, headers=headers)\n\ + \nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-org-id\", \"SOME_STRING_VALUE\")\n\ + $headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n$headers.Add(\"content-type\"\ + , \"application/json\")\n$response = Invoke-RestMethod -Uri 'https://console.jumpcloud.com/api/v2/iplists/{id}'\ + \ -Method PATCH -Headers $headers -ContentType 'application/json' -Body\ + \ '{\"description\":\"string\",\"ips\":[\"string\"],\"name\":\"string\"\ + }'" + x-codegen-request-body-name: body + /ldapservers: + get: + tags: + - LDAP Servers + summary: List LDAP Servers + description: "This endpoint returns the object IDs of your LDAP servers.\n\n\ + \n##### Sample Request\n\n```\n curl -X GET https://console.jumpcloud.com/api/v2/ldapservers/\ + \ \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\ + \ \\\n -H 'x-api-key: {API_KEY}'" + operationId: ldapservers_list + parameters: + - name: fields + in: query + description: "The comma separated fields included in the returned records.\n\ + If omitted, the default list of fields will be returned.\n" + required: false + style: form + explode: false + schema: + type: array + items: + type: string + - name: filter + in: query + description: "A filter to apply to the query.\n\n**Filter structure**: `::`.\n\ + \n**field** = Populate with a valid field from an endpoint response.\n\n\ + **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between,\ + \ search, in.\n_Note: v1 operators differ from v2 operators._\n\n**value**\ + \ = Populate with the value you want to search for. Is case sensitive. Supports\ + \ wild cards.\n\n**EX:** `GET /api/v2/groups?filter=name:eq:Test+Group`" + required: false + style: form + explode: false + schema: + type: array + items: + type: string + - name: limit + in: query + description: The number of records to return at once. Limited to 100. + required: false + style: form + explode: true + schema: + type: integer + default: 10 + - name: skip + in: query + description: The offset into the records to return. + required: false + style: form + explode: true + schema: + minimum: 0 + type: integer + default: 0 + - name: sort + in: query + description: "The comma separated fields used to sort the collection.\nDefault\ + \ sort is ascending, prefix with `-` to sort descending.\n" + required: false + style: form + explode: false + schema: + type: array + items: + type: string + - name: x-org-id + in: header + description: Organization identifier that can be obtained from console settings. + required: false + style: simple + explode: false + schema: + type: string + responses: + "200": + description: "" + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/ldap-server-output' + x-content-type: application/json + security: + - x-api-key: [] + x-scopes: + - directories + - directories.readonly + x-codeSamples: + - lang: Shell + source: "curl --request GET \\\n --url 'https://console.jumpcloud.com/api/v2/ldapservers?limit=10&skip=0'\ + \ \\\n --header 'x-api-key: REPLACE_KEY_VALUE' \\\n --header 'x-org-id:\ + \ SOME_STRING_VALUE'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/ldapservers\"\ + \n\nquerystring = {\"limit\":\"10\",\"skip\":\"0\"}\n\nheaders = {\n \ + \ \"x-org-id\": \"SOME_STRING_VALUE\",\n \"x-api-key\": \"REPLACE_KEY_VALUE\"\ + \n}\n\nresponse = requests.request(\"GET\", url, headers=headers, params=querystring)\n\ + \nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-org-id\", \"SOME_STRING_VALUE\")\n\ + $headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n$response = Invoke-RestMethod\ + \ -Uri 'https://console.jumpcloud.com/api/v2/ldapservers?limit=10&skip=0'\ + \ -Method GET -Headers $headers" + /ldapservers/{id}: + get: + tags: + - LDAP Servers + summary: Get LDAP Server + description: "This endpoint returns a specific LDAP server.\n\n##### Sample\ + \ Request\n\n```\n curl -X GET https://console.jumpcloud.com/api/v2/ldapservers/{LDAP_ID}\ + \ \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\ + \ \\\n -H 'x-api-key: {API_KEY}'\n```" + operationId: ldapservers_get + parameters: + - name: id + in: path + description: Unique identifier of the LDAP server. + required: true + style: simple + explode: false + schema: + type: string + - name: x-org-id + in: header + description: Organization identifier that can be obtained from console settings. + required: false + style: simple + explode: false + schema: + type: string + responses: + "200": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/ldap-server-output' + security: + - x-api-key: [] + x-scopes: + - directories + - directories.readonly + x-codeSamples: + - lang: Shell + source: "curl --request GET \\\n --url https://console.jumpcloud.com/api/v2/ldapservers/{id}\ + \ \\\n --header 'x-api-key: REPLACE_KEY_VALUE' \\\n --header 'x-org-id:\ + \ SOME_STRING_VALUE'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/ldapservers/{id}\"\ + \n\nheaders = {\n \"x-org-id\": \"SOME_STRING_VALUE\",\n \"x-api-key\"\ + : \"REPLACE_KEY_VALUE\"\n}\n\nresponse = requests.request(\"GET\", url,\ + \ headers=headers)\n\nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-org-id\", \"SOME_STRING_VALUE\")\n\ + $headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n$response = Invoke-RestMethod\ + \ -Uri 'https://console.jumpcloud.com/api/v2/ldapservers/{id}' -Method GET\ + \ -Headers $headers" + patch: + tags: + - LDAP Servers + summary: Update existing LDAP server + description: "This endpoint allows updating some attributes of an LDAP server.\n\ + \nSample Request\n\n```\ncurl -X PATCH https://console.jumpcloud.com/api/v2/ldapservers/{LDAP_ID}\ + \ \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\ + \ \\\n -H 'x-api-key: {API_KEY}' \\\n -d '{\n \"userLockoutAction\":\ + \ \"remove\",\n \"userPasswordExpirationAction\": \"disable\"\n }'\n```" + operationId: ldapservers_patch + parameters: + - name: id + in: path + description: Unique identifier of the LDAP server. + required: true + style: simple + explode: false + schema: + type: string + - name: x-org-id + in: header + description: Organization identifier that can be obtained from console settings. + required: false + style: simple + explode: false + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/ldapservers_id_body' + required: false + responses: + "200": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/inline_response_200_10' + "400": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/inline_response_400' + security: + - x-api-key: [] + x-scopes: + - directories + x-codeSamples: + - lang: Shell + source: "curl --request PATCH \\\n --url https://console.jumpcloud.com/api/v2/ldapservers/{id}\ + \ \\\n --header 'content-type: application/json' \\\n --header 'x-api-key:\ + \ REPLACE_KEY_VALUE' \\\n --header 'x-org-id: SOME_STRING_VALUE' \\\n \ + \ --data '{\"id\":\"string\",\"userLockoutAction\":\"disable\",\"userPasswordExpirationAction\"\ + :\"disable\"}'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/ldapservers/{id}\"\ + \n\npayload = {\n \"id\": \"string\",\n \"userLockoutAction\": \"\ + disable\",\n \"userPasswordExpirationAction\": \"disable\"\n}\nheaders\ + \ = {\n \"x-org-id\": \"SOME_STRING_VALUE\",\n \"x-api-key\": \"REPLACE_KEY_VALUE\"\ + ,\n \"content-type\": \"application/json\"\n}\n\nresponse = requests.request(\"\ + PATCH\", url, json=payload, headers=headers)\n\nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-org-id\", \"SOME_STRING_VALUE\")\n\ + $headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n$headers.Add(\"content-type\"\ + , \"application/json\")\n$response = Invoke-RestMethod -Uri 'https://console.jumpcloud.com/api/v2/ldapservers/{id}'\ + \ -Method PATCH -Headers $headers -ContentType 'application/json' -Body\ + \ '{\"id\":\"string\",\"userLockoutAction\":\"disable\",\"userPasswordExpirationAction\"\ + :\"disable\"}'" + x-codegen-request-body-name: body + /ldapservers/{ldapserver_id}/associations: + get: + tags: + - Graph + - LDAP Servers + summary: List the associations of a LDAP Server + description: "This endpoint returns the _direct_ associations of this LDAP Server.\n\ + \nA direct association can be a non-homogeneous relationship between 2 different\ + \ objects, for example LDAP and Users.\n\n#### Sample Request\n\n```\n curl\ + \ -X GET 'https://console.jumpcloud.com/api/v2/ldapservers/{LDAP_ID}/associations?targets=user_group\ + \ \\\n -H 'accept: application/json' \\\n -H 'content-type: application/json'\ + \ \\\n -H 'x-api-key: {API_KEY}'\n```" + operationId: graph_ldapServerAssociationsList + parameters: + - name: ldapserver_id + in: path + description: ObjectID of the LDAP Server. + required: true + style: simple + explode: false + schema: + type: string + - name: targets + in: query + description: Targets which a "ldap_server" can be associated to. + required: true + style: form + explode: false + schema: + type: array + items: + type: string + enum: + - user + - user_group + - name: limit + in: query + description: The number of records to return at once. Limited to 100. + required: false + style: form + explode: true + schema: + type: integer + default: 10 + - name: skip + in: query + description: The offset into the records to return. + required: false + style: form + explode: true + schema: + minimum: 0 + type: integer + default: 0 + - name: x-org-id + in: header + description: Organization identifier that can be obtained from console settings. + required: false + style: simple + explode: false + schema: + type: string + responses: + "200": + description: OK + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/GraphConnection' + x-content-type: application/json + security: + - x-api-key: [] + x-scopes: + - directories + - directories.readonly + x-codeSamples: + - lang: Shell + source: "curl --request GET \\\n --url 'https://console.jumpcloud.com/api/v2/ldapservers/{ldapserver_id}/associations?targets=SOME_ARRAY_VALUE&limit=10&skip=0'\ + \ \\\n --header 'x-api-key: REPLACE_KEY_VALUE' \\\n --header 'x-org-id:\ + \ SOME_STRING_VALUE'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/ldapservers/{ldapserver_id}/associations\"\ + \n\nquerystring = {\"targets\":\"SOME_ARRAY_VALUE\",\"limit\":\"10\",\"\ + skip\":\"0\"}\n\nheaders = {\n \"x-org-id\": \"SOME_STRING_VALUE\",\n\ + \ \"x-api-key\": \"REPLACE_KEY_VALUE\"\n}\n\nresponse = requests.request(\"\ + GET\", url, headers=headers, params=querystring)\n\nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-org-id\", \"SOME_STRING_VALUE\")\n\ + $headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n$response = Invoke-RestMethod\ + \ -Uri 'https://console.jumpcloud.com/api/v2/ldapservers/{ldapserver_id}/associations?targets=SOME_ARRAY_VALUE&limit=10&skip=0'\ + \ -Method GET -Headers $headers" + post: + tags: + - Graph + - LDAP Servers + summary: Manage the associations of a LDAP Server + description: "This endpoint allows you to manage the _direct_ associations of\ + \ a LDAP Server.\n\nA direct association can be a non-homogeneous relationship\ + \ between 2 different objects, for example LDAP and Users.\n\n#### Sample\ + \ Request\n```\ncurl -X POST https://console.jumpcloud.com/api/v2/ldapservers/{LDAP_ID}/associations\ + \ \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\ + \ \\\n -H 'x-api-key: {API_KEY}' \\\n -d '{\n \"op\": \"add\",\n \"\ + type\": \"user\",\n \"id\": \"{User_ID}\"\n }'\n```" + operationId: graph_ldapServerAssociationsPost + parameters: + - name: ldapserver_id + in: path + description: ObjectID of the LDAP Server. + required: true + style: simple + explode: false + schema: + type: string + - name: x-org-id + in: header + description: Organization identifier that can be obtained from console settings. + required: false + style: simple + explode: false + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/GraphOperation-LdapServer' + required: false + responses: + "204": + description: OK + content: {} + security: + - x-api-key: [] + x-scopes: + - directories + x-codeSamples: + - lang: Shell + source: "curl --request POST \\\n --url https://console.jumpcloud.com/api/v2/ldapservers/{ldapserver_id}/associations\ + \ \\\n --header 'content-type: application/json' \\\n --header 'x-api-key:\ + \ REPLACE_KEY_VALUE' \\\n --header 'x-org-id: SOME_STRING_VALUE' \\\n \ + \ --data '{\"id\":\"string\",\"op\":\"add\",\"attributes\":{},\"type\":\"\ + user\"}'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/ldapservers/{ldapserver_id}/associations\"\ + \n\npayload = {\n \"id\": \"string\",\n \"op\": \"add\",\n \"attributes\"\ + : {},\n \"type\": \"user\"\n}\nheaders = {\n \"x-org-id\": \"SOME_STRING_VALUE\"\ + ,\n \"x-api-key\": \"REPLACE_KEY_VALUE\",\n \"content-type\": \"application/json\"\ + \n}\n\nresponse = requests.request(\"POST\", url, json=payload, headers=headers)\n\ + \nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-org-id\", \"SOME_STRING_VALUE\")\n\ + $headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n$headers.Add(\"content-type\"\ + , \"application/json\")\n$response = Invoke-RestMethod -Uri 'https://console.jumpcloud.com/api/v2/ldapservers/{ldapserver_id}/associations'\ + \ -Method POST -Headers $headers -ContentType 'application/json' -Body '{\"\ + id\":\"string\",\"op\":\"add\",\"attributes\":{},\"type\":\"user\"}'" + x-codegen-request-body-name: body + /ldapservers/{ldapserver_id}/sambadomains: + get: + tags: + - Samba Domains + summary: List Samba Domains + description: "This endpoint returns all samba domains for an LDAP server.\n\n\ + ##### Sample Request\n```\ncurl -X GET https://console.jumpcloud.com/api/v2/ldapservers/{LDAP_ID}/sambadomains\ + \ \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\ + \ \\\n -H 'x-api-key: {API_KEY}'\n ```" + operationId: ldapservers_sambaDomainsList + parameters: + - name: ldapserver_id + in: path + description: Unique identifier of the LDAP server. + required: true + style: simple + explode: false + schema: + type: string + - name: fields + in: query + description: "The comma separated fields included in the returned records.\n\ + If omitted, the default list of fields will be returned.\n" + required: false + style: form + explode: false + schema: + type: array + items: + type: string + - name: filter + in: query + description: "A filter to apply to the query.\n\n**Filter structure**: `::`.\n\ + \n**field** = Populate with a valid field from an endpoint response.\n\n\ + **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between,\ + \ search, in.\n_Note: v1 operators differ from v2 operators._\n\n**value**\ + \ = Populate with the value you want to search for. Is case sensitive. Supports\ + \ wild cards.\n\n**EX:** `GET /api/v2/groups?filter=name:eq:Test+Group`" + required: false + style: form + explode: false + schema: + type: array + items: + type: string + - name: limit + in: query + description: The number of records to return at once. Limited to 100. + required: false + style: form + explode: true + schema: + type: integer + default: 10 + - name: skip + in: query + description: The offset into the records to return. + required: false + style: form + explode: true + schema: + minimum: 0 + type: integer + default: 0 + - name: sort + in: query + description: "The comma separated fields used to sort the collection.\nDefault\ + \ sort is ascending, prefix with `-` to sort descending.\n" + required: false + style: form + explode: false + schema: + type: array + items: + type: string + - name: x-org-id + in: header + description: Organization identifier that can be obtained from console settings. + required: false + style: simple + explode: false + schema: + type: string + responses: + "200": + description: "" + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/samba-domain-output' + x-content-type: application/json + default: + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + security: + - x-api-key: [] + x-scopes: + - directories + - directories.readonly + x-codeSamples: + - lang: Shell + source: "curl --request GET \\\n --url 'https://console.jumpcloud.com/api/v2/ldapservers/{ldapserver_id}/sambadomains?limit=10&skip=0'\ + \ \\\n --header 'x-api-key: REPLACE_KEY_VALUE' \\\n --header 'x-org-id:\ + \ SOME_STRING_VALUE'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/ldapservers/{ldapserver_id}/sambadomains\"\ + \n\nquerystring = {\"limit\":\"10\",\"skip\":\"0\"}\n\nheaders = {\n \ + \ \"x-org-id\": \"SOME_STRING_VALUE\",\n \"x-api-key\": \"REPLACE_KEY_VALUE\"\ + \n}\n\nresponse = requests.request(\"GET\", url, headers=headers, params=querystring)\n\ + \nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-org-id\", \"SOME_STRING_VALUE\")\n\ + $headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n$response = Invoke-RestMethod\ + \ -Uri 'https://console.jumpcloud.com/api/v2/ldapservers/{ldapserver_id}/sambadomains?limit=10&skip=0'\ + \ -Method GET -Headers $headers" + post: + tags: + - Samba Domains + summary: Create Samba Domain + description: "This endpoint allows you to create a samba domain for an LDAP\ + \ server.\n\n##### Sample Request\n```\ncurl -X POST https://console.jumpcloud.com/api/v2/ldapservers/{LDAP_ID}/sambadomains\ + \ \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\ + \ \\\n -H 'x-api-key: {API_KEY}' \\\n -d '{\n \"sid\":\"{SID_ID}\",\n\ + \ \"name\":\"{WORKGROUP_NAME}\"\n }'\n```" + operationId: ldapservers_sambaDomainsPost + parameters: + - name: ldapserver_id + in: path + description: Unique identifier of the LDAP server. + required: true + style: simple + explode: false + schema: + type: string + - name: x-org-id + in: header + description: Organization identifier that can be obtained from console settings. + required: false + style: simple + explode: false + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/samba-domain-input' + required: false + responses: + "201": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/samba-domain-output' + security: + - x-api-key: [] + x-scopes: + - directories + x-codeSamples: + - lang: Shell + source: "curl --request POST \\\n --url https://console.jumpcloud.com/api/v2/ldapservers/{ldapserver_id}/sambadomains\ + \ \\\n --header 'content-type: application/json' \\\n --header 'x-api-key:\ + \ REPLACE_KEY_VALUE' \\\n --header 'x-org-id: SOME_STRING_VALUE' \\\n \ + \ --data '{\"name\":\"string\",\"sid\":\"string\"}'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/ldapservers/{ldapserver_id}/sambadomains\"\ + \n\npayload = {\n \"name\": \"string\",\n \"sid\": \"string\"\n}\n\ + headers = {\n \"x-org-id\": \"SOME_STRING_VALUE\",\n \"x-api-key\"\ + : \"REPLACE_KEY_VALUE\",\n \"content-type\": \"application/json\"\n}\n\ + \nresponse = requests.request(\"POST\", url, json=payload, headers=headers)\n\ + \nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-org-id\", \"SOME_STRING_VALUE\")\n\ + $headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n$headers.Add(\"content-type\"\ + , \"application/json\")\n$response = Invoke-RestMethod -Uri 'https://console.jumpcloud.com/api/v2/ldapservers/{ldapserver_id}/sambadomains'\ + \ -Method POST -Headers $headers -ContentType 'application/json' -Body '{\"\ + name\":\"string\",\"sid\":\"string\"}'" + x-codegen-request-body-name: body + /ldapservers/{ldapserver_id}/sambadomains/{id}: + get: + tags: + - Samba Domains + summary: Get Samba Domain + description: "This endpoint returns a specific samba domain for an LDAP server.\n\ + \n##### Sample Request\n```\ncurl -X GET \\\n https://console.jumpcloud.com/api/v2/ldapservers/ldapservers/{LDAP_ID}/sambadomains/{SAMBA_ID}\ + \ \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\ + \ \\\n -H 'x-api-key: {API_KEY}'\n ```" + operationId: ldapservers_sambaDomainsGet + parameters: + - name: ldapserver_id + in: path + description: Unique identifier of the LDAP server. + required: true + style: simple + explode: false + schema: + type: string + - name: id + in: path + description: Unique identifier of the samba domain. + required: true + style: simple + explode: false + schema: + type: string + - name: x-org-id + in: header + description: Organization identifier that can be obtained from console settings. + required: false + style: simple + explode: false + schema: + type: string + responses: + "200": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/samba-domain-output' + security: + - x-api-key: [] + x-scopes: + - directories + - directories.readonly + x-codeSamples: + - lang: Shell + source: "curl --request GET \\\n --url https://console.jumpcloud.com/api/v2/ldapservers/{ldapserver_id}/sambadomains/{id}\ + \ \\\n --header 'x-api-key: REPLACE_KEY_VALUE' \\\n --header 'x-org-id:\ + \ SOME_STRING_VALUE'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/ldapservers/{ldapserver_id}/sambadomains/{id}\"\ + \n\nheaders = {\n \"x-org-id\": \"SOME_STRING_VALUE\",\n \"x-api-key\"\ + : \"REPLACE_KEY_VALUE\"\n}\n\nresponse = requests.request(\"GET\", url,\ + \ headers=headers)\n\nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-org-id\", \"SOME_STRING_VALUE\")\n\ + $headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n$response = Invoke-RestMethod\ + \ -Uri 'https://console.jumpcloud.com/api/v2/ldapservers/{ldapserver_id}/sambadomains/{id}'\ + \ -Method GET -Headers $headers" + put: + tags: + - Samba Domains + summary: Update Samba Domain + description: "This endpoint allows you to update the samba domain information\ + \ for an LDAP server.\n\n##### Sample Request\n```\ncurl -X PUT https://console.jumpcloud.com/api/v2/ldapservers/{LDAP_ID}/sambadomains/{SAMBA_ID}\ + \ \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\ + \ \\\n -H 'x-api-key: {API_KEY}' \\\n -d '{\n \"sid\":\"{SID_ID}\",\n\ + \ \"name\":\"{WORKGROUP_NAME}\"\n }'\n```" + operationId: ldapservers_sambaDomainsPut + parameters: + - name: ldapserver_id + in: path + description: Unique identifier of the LDAP server. + required: true + style: simple + explode: false + schema: + type: string + - name: id + in: path + description: Unique identifier of the samba domain. + required: true + style: simple + explode: false + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/samba-domain-input' + required: false + responses: + "200": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/samba-domain-output' + security: + - x-api-key: [] + x-scopes: + - directories + x-codeSamples: + - lang: Shell + source: "curl --request PUT \\\n --url https://console.jumpcloud.com/api/v2/ldapservers/{ldapserver_id}/sambadomains/{id}\ + \ \\\n --header 'content-type: application/json' \\\n --header 'x-api-key:\ + \ REPLACE_KEY_VALUE' \\\n --data '{\"name\":\"string\",\"sid\":\"string\"\ + }'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/ldapservers/{ldapserver_id}/sambadomains/{id}\"\ + \n\npayload = {\n \"name\": \"string\",\n \"sid\": \"string\"\n}\n\ + headers = {\n \"x-api-key\": \"REPLACE_KEY_VALUE\",\n \"content-type\"\ + : \"application/json\"\n}\n\nresponse = requests.request(\"PUT\", url, json=payload,\ + \ headers=headers)\n\nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n\ + $headers.Add(\"content-type\", \"application/json\")\n$response = Invoke-RestMethod\ + \ -Uri 'https://console.jumpcloud.com/api/v2/ldapservers/{ldapserver_id}/sambadomains/{id}'\ + \ -Method PUT -Headers $headers -ContentType 'application/json' -Body '{\"\ + name\":\"string\",\"sid\":\"string\"}'" + x-codegen-request-body-name: body + delete: + tags: + - Samba Domains + summary: Delete Samba Domain + description: "This endpoint allows you to delete a samba domain from an LDAP\ + \ server.\n\n##### Sample Request\n```\ncurl -X DELETE https://console.jumpcloud.com/api/v2/ldapservers/{LDAP_ID}/sambadomains/{SAMBA_ID}\ + \ \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\ + \ \\\n -H 'x-api-key: {API_KEY}'\n```" + operationId: ldapservers_sambaDomainsDelete + parameters: + - name: ldapserver_id + in: path + description: Unique identifier of the LDAP server. + required: true + style: simple + explode: false + schema: + type: string + - name: id + in: path + description: Unique identifier of the samba domain. + required: true + style: simple + explode: false + schema: + type: string + - name: x-org-id + in: header + description: Organization identifier that can be obtained from console settings. + required: false + style: simple + explode: false + schema: + type: string + responses: + "200": + description: "" + content: + application/json: + schema: + type: string + x-content-type: application/json + "204": + description: "" + content: {} + security: + - x-api-key: [] + x-scopes: + - directories + x-codeSamples: + - lang: Shell + source: "curl --request DELETE \\\n --url https://console.jumpcloud.com/api/v2/ldapservers/{ldapserver_id}/sambadomains/{id}\ + \ \\\n --header 'x-api-key: REPLACE_KEY_VALUE' \\\n --header 'x-org-id:\ + \ SOME_STRING_VALUE'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/ldapservers/{ldapserver_id}/sambadomains/{id}\"\ + \n\nheaders = {\n \"x-org-id\": \"SOME_STRING_VALUE\",\n \"x-api-key\"\ + : \"REPLACE_KEY_VALUE\"\n}\n\nresponse = requests.request(\"DELETE\", url,\ + \ headers=headers)\n\nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-org-id\", \"SOME_STRING_VALUE\")\n\ + $headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n$response = Invoke-RestMethod\ + \ -Uri 'https://console.jumpcloud.com/api/v2/ldapservers/{ldapserver_id}/sambadomains/{id}'\ + \ -Method DELETE -Headers $headers" + /ldapservers/{ldapserver_id}/usergroups: + get: + tags: + - Graph + - LDAP Servers + summary: List the User Groups bound to a LDAP Server + description: "This endpoint will return all Users Groups bound to a LDAP Server,\ + \ either directly or indirectly, essentially traversing the JumpCloud Graph\ + \ for your Organization.\n\nEach element will contain the group's type, id,\ + \ attributes and paths.\n\nThe `attributes` object is a key/value hash of\ + \ compiled graph attributes for all paths followed.\n\nThe `paths` array enumerates\ + \ each path from this LDAP server instance to the corresponding User Group;\ + \ this array represents all grouping and/or associations that would have to\ + \ be removed to deprovision the User Group from this LDAP server instance.\n\ + \nSee `/members` and `/associations` endpoints to manage those collections.\n\ + \n#### Sample Request\n```\ncurl -X GET https://console.jumpcloud.com/api/v2/ldapservers/{LDAP_ID}/usergroups\ + \ \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\ + \ \\\n -H 'x-api-key: {API_KEY}'\n```" + operationId: graph_ldapServerTraverseUserGroup + parameters: + - name: ldapserver_id + in: path + description: ObjectID of the LDAP Server. + required: true + style: simple + explode: false + schema: + type: string + - name: limit + in: query + description: The number of records to return at once. Limited to 100. + required: false + style: form + explode: true + schema: + type: integer + default: 10 + - name: x-org-id + in: header + description: Organization identifier that can be obtained from console settings. + required: false + style: simple + explode: false + schema: + type: string + - name: skip + in: query + description: The offset into the records to return. + required: false + style: form + explode: true + schema: + minimum: 0 + type: integer + default: 0 + - name: filter + in: query + description: "A filter to apply to the query.\n\n**Filter structure**: `::`.\n\ + \n**field** = Populate with a valid field from an endpoint response.\n\n\ + **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between,\ + \ search, in.\n_Note: v1 operators differ from v2 operators._\n\n**value**\ + \ = Populate with the value you want to search for. Is case sensitive. Supports\ + \ wild cards.\n\n**EX:** `GET /api/v2/groups?filter=name:eq:Test+Group`" + required: false + style: form + explode: false + schema: + type: array + items: + type: string + responses: + "200": + description: OK + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/GraphObjectWithPaths' + x-content-type: application/json + security: + - x-api-key: [] + x-scopes: + - groups + - groups.readonly + x-codeSamples: + - lang: Shell + source: "curl --request GET \\\n --url 'https://console.jumpcloud.com/api/v2/ldapservers/{ldapserver_id}/usergroups?limit=10&skip=0'\ + \ \\\n --header 'x-api-key: REPLACE_KEY_VALUE' \\\n --header 'x-org-id:\ + \ SOME_STRING_VALUE'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/ldapservers/{ldapserver_id}/usergroups\"\ + \n\nquerystring = {\"limit\":\"10\",\"skip\":\"0\"}\n\nheaders = {\n \ + \ \"x-org-id\": \"SOME_STRING_VALUE\",\n \"x-api-key\": \"REPLACE_KEY_VALUE\"\ + \n}\n\nresponse = requests.request(\"GET\", url, headers=headers, params=querystring)\n\ + \nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-org-id\", \"SOME_STRING_VALUE\")\n\ + $headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n$response = Invoke-RestMethod\ + \ -Uri 'https://console.jumpcloud.com/api/v2/ldapservers/{ldapserver_id}/usergroups?limit=10&skip=0'\ + \ -Method GET -Headers $headers" + /ldapservers/{ldapserver_id}/users: + get: + tags: + - Graph + - LDAP Servers + summary: List the Users bound to a LDAP Server + description: "This endpoint will return all Users bound to an LDAP Server, either\ + \ directly or indirectly, essentially traversing the JumpCloud Graph for your\ + \ Organization.\n\nEach element will contain the type, id, attributes and\ + \ paths.\n\nThe `attributes` object is a key/value hash of compiled graph\ + \ attributes for all paths followed.\n\nThe `paths` array enumerates each\ + \ path from this LDAP server instance to the corresponding User; this array\ + \ represents all grouping and/or associations that would have to be removed\ + \ to deprovision the User from this LDAP server instance.\n\nSee `/members`\ + \ and `/associations` endpoints to manage those collections.\n\n#### Sample\ + \ Request\n```\ncurl -X GET https://console.jumpcloud.com/api/v2/ldapservers/{LDAP_ID}/users\ + \ \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\ + \ \\\n -H 'x-api-key: {API_KEY}'\n```" + operationId: graph_ldapServerTraverseUser + parameters: + - name: ldapserver_id + in: path + description: ObjectID of the LDAP Server. + required: true + style: simple + explode: false + schema: + type: string + - name: limit + in: query + description: The number of records to return at once. Limited to 100. + required: false + style: form + explode: true + schema: + type: integer + default: 10 + - name: x-org-id + in: header + description: Organization identifier that can be obtained from console settings. + required: false + style: simple + explode: false + schema: + type: string + - name: skip + in: query + description: The offset into the records to return. + required: false + style: form + explode: true + schema: + minimum: 0 + type: integer + default: 0 + - name: filter + in: query + description: "A filter to apply to the query.\n\n**Filter structure**: `::`.\n\ + \n**field** = Populate with a valid field from an endpoint response.\n\n\ + **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between,\ + \ search, in.\n_Note: v1 operators differ from v2 operators._\n\n**value**\ + \ = Populate with the value you want to search for. Is case sensitive. Supports\ + \ wild cards.\n\n**EX:** `GET /api/v2/groups?filter=name:eq:Test+Group`" + required: false + style: form + explode: false + schema: + type: array + items: + type: string + responses: + "200": + description: OK + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/GraphObjectWithPaths' + x-content-type: application/json + security: + - x-api-key: [] + x-scopes: + - users + - users.readonly + x-codeSamples: + - lang: Shell + source: "curl --request GET \\\n --url 'https://console.jumpcloud.com/api/v2/ldapservers/{ldapserver_id}/users?limit=10&skip=0'\ + \ \\\n --header 'x-api-key: REPLACE_KEY_VALUE' \\\n --header 'x-org-id:\ + \ SOME_STRING_VALUE'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/ldapservers/{ldapserver_id}/users\"\ + \n\nquerystring = {\"limit\":\"10\",\"skip\":\"0\"}\n\nheaders = {\n \ + \ \"x-org-id\": \"SOME_STRING_VALUE\",\n \"x-api-key\": \"REPLACE_KEY_VALUE\"\ + \n}\n\nresponse = requests.request(\"GET\", url, headers=headers, params=querystring)\n\ + \nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-org-id\", \"SOME_STRING_VALUE\")\n\ + $headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n$response = Invoke-RestMethod\ + \ -Uri 'https://console.jumpcloud.com/api/v2/ldapservers/{ldapserver_id}/users?limit=10&skip=0'\ + \ -Method GET -Headers $headers" + /logos/{id}: + get: + tags: + - Logos + summary: Get the logo associated with the specified id + description: Return the logo image associated with the specified id + operationId: logos_get + parameters: + - name: id + in: path + required: true + style: simple + explode: false + schema: + type: string + responses: + "200": + description: OK + content: + image/gif: + schema: + type: string + format: binary + x-content-type: image/gif + image/jpeg: + schema: + type: string + format: binary + image/png: + schema: + type: string + format: binary + "404": + description: "" + content: + image/gif: + schema: + $ref: '#/components/schemas/Error' + image/jpeg: + schema: + $ref: '#/components/schemas/Error' + image/png: + schema: + $ref: '#/components/schemas/Error' + "500": + description: "" + content: + image/gif: + schema: + $ref: '#/components/schemas/Error' + image/jpeg: + schema: + $ref: '#/components/schemas/Error' + image/png: + schema: + $ref: '#/components/schemas/Error' + x-scopes: + - anonymous + x-codeSamples: + - lang: Shell + source: "curl --request GET \\\n --url https://console.jumpcloud.com/api/v2/logos/{id}" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/logos/{id}\"\ + \n\nresponse = requests.request(\"GET\", url)\n\nprint(response.text)" + - lang: Powershell + source: "$response = Invoke-RestMethod -Uri 'https://console.jumpcloud.com/api/v2/logos/{id}'\ + \ -Method GET " + /office365s/{office365_id}: + get: + tags: + - Office 365 + summary: Get Office 365 instance + description: "This endpoint returns a specific Office 365 instance.\n\n#####\n\ + \nSample Request\n\n```\ncurl -X GET https://console.jumpcloud.com/api/v2/office365s/{OFFICE365_ID}\ + \ \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\ + \ \\\n -H 'x-api-key: {API_KEY}'\n\n```" + operationId: office365s_get + parameters: + - name: office365_id + in: path + description: ObjectID of the Office 365 instance. + required: true + style: simple + explode: false + schema: + type: string + - name: x-org-id + in: header + description: Organization identifier that can be obtained from console settings. + required: false + style: simple + explode: false + schema: + type: string + responses: + "200": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/office365-output' + security: + - x-api-key: [] + x-scopes: + - directories + - directories.readonly + x-codeSamples: + - lang: Shell + source: "curl --request GET \\\n --url https://console.jumpcloud.com/api/v2/office365s/{office365_id}\ + \ \\\n --header 'x-api-key: REPLACE_KEY_VALUE' \\\n --header 'x-org-id:\ + \ SOME_STRING_VALUE'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/office365s/{office365_id}\"\ + \n\nheaders = {\n \"x-org-id\": \"SOME_STRING_VALUE\",\n \"x-api-key\"\ + : \"REPLACE_KEY_VALUE\"\n}\n\nresponse = requests.request(\"GET\", url,\ + \ headers=headers)\n\nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-org-id\", \"SOME_STRING_VALUE\")\n\ + $headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n$response = Invoke-RestMethod\ + \ -Uri 'https://console.jumpcloud.com/api/v2/office365s/{office365_id}'\ + \ -Method GET -Headers $headers" + patch: + tags: + - Office 365 + summary: Update existing Office 365 instance. + description: "This endpoint allows updating some attributes of an Office 365\ + \ instance.\n\n#####\n\nSample Request\n\n```\ncurl -X PATCH https://console.jumpcloud.com/api/v2/office365s/{OFFICE365_ID}\ + \ \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\ + \ \\\n -H 'x-api-key: {API_KEY}' \\\n -d '{\n \"userLockoutAction\":\ + \ \"maintain\",\n \"userPasswordExpirationAction\": \"suspend\"\n }'\n\ + ```" + operationId: office365s_patch + parameters: + - name: office365_id + in: path + description: ObjectID of the Office 365 instance. + required: true + style: simple + explode: false + schema: + type: string + - name: x-org-id + in: header + description: Organization identifier that can be obtained from console settings. + required: false + style: simple + explode: false + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/office365-patch-input' + required: false + responses: + "200": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/office365-output' + security: + - x-api-key: [] + x-scopes: + - directories + x-codeSamples: + - lang: Shell + source: "curl --request PATCH \\\n --url https://console.jumpcloud.com/api/v2/office365s/{office365_id}\ + \ \\\n --header 'content-type: application/json' \\\n --header 'x-api-key:\ + \ REPLACE_KEY_VALUE' \\\n --header 'x-org-id: SOME_STRING_VALUE' \\\n \ + \ --data '{\"groupsEnabled\":true,\"name\":\"string\",\"userLockoutAction\"\ + :\"suspend\",\"userPasswordExpirationAction\":\"suspend\"}'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/office365s/{office365_id}\"\ + \n\npayload = {\n \"groupsEnabled\": True,\n \"name\": \"string\"\ + ,\n \"userLockoutAction\": \"suspend\",\n \"userPasswordExpirationAction\"\ + : \"suspend\"\n}\nheaders = {\n \"x-org-id\": \"SOME_STRING_VALUE\",\n\ + \ \"x-api-key\": \"REPLACE_KEY_VALUE\",\n \"content-type\": \"application/json\"\ + \n}\n\nresponse = requests.request(\"PATCH\", url, json=payload, headers=headers)\n\ + \nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-org-id\", \"SOME_STRING_VALUE\")\n\ + $headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n$headers.Add(\"content-type\"\ + , \"application/json\")\n$response = Invoke-RestMethod -Uri 'https://console.jumpcloud.com/api/v2/office365s/{office365_id}'\ + \ -Method PATCH -Headers $headers -ContentType 'application/json' -Body\ + \ '{\"groupsEnabled\":true,\"name\":\"string\",\"userLockoutAction\":\"\ + suspend\",\"userPasswordExpirationAction\":\"suspend\"}'" + x-codegen-request-body-name: body + /office365s/{office365_id}/associations: + get: + tags: + - Graph + - Office 365 + summary: List the associations of an Office 365 instance + description: "This endpoint returns _direct_ associations of an Office 365 instance.\n\ + \n\nA direct association can be a non-homogeneous relationship between 2 different\ + \ objects, for example Office 365 and Users.\n\n#### Sample Request\n```\n\ + curl -X GET 'https://console.jumpcloud.com/api/v2/office365s/{OFFICE365_ID}/associations?targets=user_group'\ + \ \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\ + \ \\\n -H 'x-api-key: {API_KEY}'\n\n```" + operationId: graph_office365AssociationsList + parameters: + - name: office365_id + in: path + description: ObjectID of the Office 365 instance. + required: true + style: simple + explode: false + schema: + type: string + - name: targets + in: query + description: Targets which a "office_365" can be associated to. + required: true + style: form + explode: false + schema: + type: array + items: + type: string + enum: + - user + - user_group + - name: limit + in: query + description: The number of records to return at once. Limited to 100. + required: false + style: form + explode: true + schema: + type: integer + default: 10 + - name: skip + in: query + description: The offset into the records to return. + required: false + style: form + explode: true + schema: + minimum: 0 + type: integer + default: 0 + - name: x-org-id + in: header + description: Organization identifier that can be obtained from console settings. + required: false + style: simple + explode: false + schema: + type: string + responses: + "200": + description: OK + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/GraphConnection' + x-content-type: application/json + security: + - x-api-key: [] + x-scopes: + - directories + - directories.readonly + x-codeSamples: + - lang: Shell + source: "curl --request GET \\\n --url 'https://console.jumpcloud.com/api/v2/office365s/{office365_id}/associations?targets=SOME_ARRAY_VALUE&limit=10&skip=0'\ + \ \\\n --header 'x-api-key: REPLACE_KEY_VALUE' \\\n --header 'x-org-id:\ + \ SOME_STRING_VALUE'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/office365s/{office365_id}/associations\"\ + \n\nquerystring = {\"targets\":\"SOME_ARRAY_VALUE\",\"limit\":\"10\",\"\ + skip\":\"0\"}\n\nheaders = {\n \"x-org-id\": \"SOME_STRING_VALUE\",\n\ + \ \"x-api-key\": \"REPLACE_KEY_VALUE\"\n}\n\nresponse = requests.request(\"\ + GET\", url, headers=headers, params=querystring)\n\nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-org-id\", \"SOME_STRING_VALUE\")\n\ + $headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n$response = Invoke-RestMethod\ + \ -Uri 'https://console.jumpcloud.com/api/v2/office365s/{office365_id}/associations?targets=SOME_ARRAY_VALUE&limit=10&skip=0'\ + \ -Method GET -Headers $headers" + post: + tags: + - Graph + - Office 365 + summary: Manage the associations of an Office 365 instance + description: "This endpoint allows you to manage the _direct_ associations of\ + \ a Office 365 instance.\n\nA direct association can be a non-homogeneous\ + \ relationship between 2 different objects, for example Office 365 and Users.\n\ + \n#### Sample Request\n```\ncurl -X POST https://console.jumpcloud.com/api/v2/office365s/{OFFICE365_ID}/associations\ + \ \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\ + \ \\\n -H 'x-api-key: {API_KEY}' \\\n -d '{\n \"op\": \"add\",\n \"\ + type\": \"user_group\",\n \"id\": \"{Group_ID}\"\n }'\n```" + operationId: graph_office365AssociationsPost + parameters: + - name: office365_id + in: path + description: ObjectID of the Office 365 instance. + required: true + style: simple + explode: false + schema: + type: string + - name: x-org-id + in: header + description: Organization identifier that can be obtained from console settings. + required: false + style: simple + explode: false + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/GraphOperation-Office365' + required: false + responses: + "204": + description: OK + content: {} + security: + - x-api-key: [] + x-scopes: + - directories + x-codeSamples: + - lang: Shell + source: "curl --request POST \\\n --url https://console.jumpcloud.com/api/v2/office365s/{office365_id}/associations\ + \ \\\n --header 'content-type: application/json' \\\n --header 'x-api-key:\ + \ REPLACE_KEY_VALUE' \\\n --header 'x-org-id: SOME_STRING_VALUE' \\\n \ + \ --data '{\"id\":\"string\",\"op\":\"add\",\"attributes\":{},\"type\":\"\ + user\"}'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/office365s/{office365_id}/associations\"\ + \n\npayload = {\n \"id\": \"string\",\n \"op\": \"add\",\n \"attributes\"\ + : {},\n \"type\": \"user\"\n}\nheaders = {\n \"x-org-id\": \"SOME_STRING_VALUE\"\ + ,\n \"x-api-key\": \"REPLACE_KEY_VALUE\",\n \"content-type\": \"application/json\"\ + \n}\n\nresponse = requests.request(\"POST\", url, json=payload, headers=headers)\n\ + \nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-org-id\", \"SOME_STRING_VALUE\")\n\ + $headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n$headers.Add(\"content-type\"\ + , \"application/json\")\n$response = Invoke-RestMethod -Uri 'https://console.jumpcloud.com/api/v2/office365s/{office365_id}/associations'\ + \ -Method POST -Headers $headers -ContentType 'application/json' -Body '{\"\ + id\":\"string\",\"op\":\"add\",\"attributes\":{},\"type\":\"user\"}'" + x-codegen-request-body-name: body + /office365s/{office365_id}/import/users: + get: + tags: + - Office 365 + - Office 365 Import + summary: Get a list of users to import from an Office 365 instance + description: Lists Office 365 users available for import. + operationId: office365s_listImportUsers + parameters: + - name: office365_id + in: path + required: true + style: simple + explode: false + schema: + type: string + - name: ConsistencyLevel + in: header + description: Defines the consistency header for O365 requests. See https://docs.microsoft.com/en-us/graph/api/user-list?view=graph-rest-1.0&tabs=http#request-headers + required: false + style: simple + explode: false + schema: + type: string + - name: top + in: query + description: Office 365 API maximum number of results per page. See https://docs.microsoft.com/en-us/graph/paging. + required: false + style: form + explode: true + schema: + type: integer + - name: skipToken + in: query + description: Office 365 API token used to access the next page of results. + See https://docs.microsoft.com/en-us/graph/paging. + required: false + style: form + explode: true + schema: + type: string + - name: filter + in: query + description: Office 365 API filter parameter. See https://docs.microsoft.com/en-us/graph/api/user-list?view=graph-rest-1.0&tabs=http#optional-query-parameters. + required: false + style: form + explode: true + schema: + type: string + - name: search + in: query + description: Office 365 API search parameter. See https://docs.microsoft.com/en-us/graph/api/user-list?view=graph-rest-1.0&tabs=http#optional-query-parameters. + required: false + style: form + explode: true + schema: + type: string + - name: orderby + in: query + description: Office 365 API orderby parameter. See https://docs.microsoft.com/en-us/graph/api/user-list?view=graph-rest-1.0&tabs=http#optional-query-parameters. + required: false + style: form + explode: true + schema: + type: string + - name: count + in: query + description: Office 365 API count parameter. See https://docs.microsoft.com/en-us/graph/api/user-list?view=graph-rest-1.0&tabs=http#optional-query-parameters. + required: false + style: form + explode: true + schema: + type: boolean + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/inline_response_200_11' + security: + - x-api-key: [] + x-scopes: + - directories + - directories.readonly + x-codeSamples: + - lang: Shell + source: "curl --request GET \\\n --url 'https://console.jumpcloud.com/api/v2/office365s/{office365_id}/import/users?top=SOME_INTEGER_VALUE&skipToken=SOME_STRING_VALUE&filter=SOME_STRING_VALUE&search=SOME_STRING_VALUE&orderby=SOME_STRING_VALUE&count=SOME_BOOLEAN_VALUE'\ + \ \\\n --header 'ConsistencyLevel: SOME_STRING_VALUE' \\\n --header 'x-api-key:\ + \ REPLACE_KEY_VALUE'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/office365s/{office365_id}/import/users\"\ + \n\nquerystring = {\"top\":\"SOME_INTEGER_VALUE\",\"skipToken\":\"SOME_STRING_VALUE\"\ + ,\"filter\":\"SOME_STRING_VALUE\",\"search\":\"SOME_STRING_VALUE\",\"orderby\"\ + :\"SOME_STRING_VALUE\",\"count\":\"SOME_BOOLEAN_VALUE\"}\n\nheaders = {\n\ + \ \"ConsistencyLevel\": \"SOME_STRING_VALUE\",\n \"x-api-key\": \"\ + REPLACE_KEY_VALUE\"\n}\n\nresponse = requests.request(\"GET\", url, headers=headers,\ + \ params=querystring)\n\nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"ConsistencyLevel\", \"SOME_STRING_VALUE\"\ + )\n$headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n$response = Invoke-RestMethod\ + \ -Uri 'https://console.jumpcloud.com/api/v2/office365s/{office365_id}/import/users?top=SOME_INTEGER_VALUE&skipToken=SOME_STRING_VALUE&filter=SOME_STRING_VALUE&search=SOME_STRING_VALUE&orderby=SOME_STRING_VALUE&count=SOME_BOOLEAN_VALUE'\ + \ -Method GET -Headers $headers" + /office365s/{office365_id}/translationrules: + get: + tags: + - Office 365 + summary: List all the Office 365 Translation Rules + description: "This endpoint returns all translation rules for a specific Office\ + \ 365 instance. These rules specify how JumpCloud attributes translate to\ + \ [Microsoft Graph](https://developer.microsoft.com/en-us/graph) attributes.\n\ + \n##### Sample Request\n\n```\n curl -X GET https://console.jumpcloud.com/api/v2/office365s/{office365_id}/translationrules\ + \ \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\ + \ \\\n -H 'x-api-key: {API_KEY}'\n ```" + operationId: translationRules_office365List + parameters: + - name: office365_id + in: path + required: true + style: simple + explode: false + schema: + type: string + - name: fields + in: query + description: "The comma separated fields included in the returned records.\n\ + If omitted, the default list of fields will be returned.\n" + required: false + style: form + explode: false + schema: + type: array + items: + type: string + - name: filter + in: query + description: "A filter to apply to the query.\n\n**Filter structure**: `::`.\n\ + \n**field** = Populate with a valid field from an endpoint response.\n\n\ + **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between,\ + \ search, in.\n_Note: v1 operators differ from v2 operators._\n\n**value**\ + \ = Populate with the value you want to search for. Is case sensitive. Supports\ + \ wild cards.\n\n**EX:** `GET /api/v2/groups?filter=name:eq:Test+Group`" + required: false + style: form + explode: false + schema: + type: array + items: + type: string + - name: limit + in: query + description: The number of records to return at once. Limited to 100. + required: false + style: form + explode: true + schema: + type: integer + default: 10 + - name: skip + in: query + description: The offset into the records to return. + required: false + style: form + explode: true + schema: + minimum: 0 + type: integer + default: 0 + - name: sort + in: query + description: "The comma separated fields used to sort the collection.\nDefault\ + \ sort is ascending, prefix with `-` to sort descending.\n" + required: false + style: form + explode: false + schema: + type: array + items: + type: string + responses: + "200": + description: "" + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/Office365TranslationRule' + x-content-type: application/json + example: + - field: office_365_state + id: object_id_1 + source_type: user + security: + - x-api-key: [] + x-scopes: + - directories + - directories.readonly + x-codeSamples: + - lang: Shell + source: "curl --request GET \\\n --url 'https://console.jumpcloud.com/api/v2/office365s/{office365_id}/translationrules?limit=10&skip=0'\ + \ \\\n --header 'x-api-key: REPLACE_KEY_VALUE'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/office365s/{office365_id}/translationrules\"\ + \n\nquerystring = {\"limit\":\"10\",\"skip\":\"0\"}\n\nheaders = {\"x-api-key\"\ + : \"REPLACE_KEY_VALUE\"}\n\nresponse = requests.request(\"GET\", url, headers=headers,\ + \ params=querystring)\n\nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n\ + $response = Invoke-RestMethod -Uri 'https://console.jumpcloud.com/api/v2/office365s/{office365_id}/translationrules?limit=10&skip=0'\ + \ -Method GET -Headers $headers" + post: + tags: + - Office 365 + summary: Create a new Office 365 Translation Rule + description: "This endpoint allows you to create a translation rule for a specific\ + \ Office 365 instance. These rules specify how JumpCloud attributes translate\ + \ to [Microsoft Graph](https://developer.microsoft.com/en-us/graph) attributes.\n\ + \n##### Sample Request\n```\ncurl -X POST https://console.jumpcloud.com/api/v2/office365s/{office365_id}/translationrules\ + \ \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\ + \ \\\n -H 'x-api-key: {API_KEY}' \\\n -d '{\n {Translation Rule Parameters}\n\ + \ }'\n```" + operationId: translationRules_office365Post + parameters: + - name: office365_id + in: path + required: true + style: simple + explode: false + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Office365TranslationRuleRequest' + required: false + responses: + "201": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Office365TranslationRule' + "400": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorDetails' + security: + - x-api-key: [] + x-scopes: + - directories + x-codeSamples: + - lang: Shell + source: "curl --request POST \\\n --url https://console.jumpcloud.com/api/v2/office365s/{office365_id}/translationrules\ + \ \\\n --header 'content-type: application/json' \\\n --header 'x-api-key:\ + \ REPLACE_KEY_VALUE' \\\n --data '{\"builtIn\":\"user_department\",\"direction\"\ + :\"export\"}'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/office365s/{office365_id}/translationrules\"\ + \n\npayload = {\n \"builtIn\": \"user_department\",\n \"direction\"\ + : \"export\"\n}\nheaders = {\n \"x-api-key\": \"REPLACE_KEY_VALUE\",\n\ + \ \"content-type\": \"application/json\"\n}\n\nresponse = requests.request(\"\ + POST\", url, json=payload, headers=headers)\n\nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n\ + $headers.Add(\"content-type\", \"application/json\")\n$response = Invoke-RestMethod\ + \ -Uri 'https://console.jumpcloud.com/api/v2/office365s/{office365_id}/translationrules'\ + \ -Method POST -Headers $headers -ContentType 'application/json' -Body '{\"\ + builtIn\":\"user_department\",\"direction\":\"export\"}'" + x-codegen-request-body-name: body + /office365s/{office365_id}/translationrules/{id}: + get: + tags: + - Office 365 + summary: Gets a specific Office 365 translation rule + description: "This endpoint returns a specific translation rule for a specific\ + \ Office 365 instance. These rules specify how JumpCloud attributes translate\ + \ to [Microsoft Graph](https://developer.microsoft.com/en-us/graph) attributes.\n\ + \n###### Sample Request\n\n```\n curl -X GET https://console.jumpcloud.com/api/v2/office365s/{office365_id}/translationrules/{id}\ + \ \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\ + \ \\\n -H 'x-api-key: {API_KEY}'\n ```" + operationId: translationRules_office365Get + parameters: + - name: office365_id + in: path + required: true + style: simple + explode: false + schema: + type: string + - name: id + in: path + required: true + style: simple + explode: false + schema: + type: string + responses: + "200": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Office365TranslationRule' + security: + - x-api-key: [] + x-scopes: + - directories + - directories.readonly + x-codeSamples: + - lang: Shell + source: "curl --request GET \\\n --url https://console.jumpcloud.com/api/v2/office365s/{office365_id}/translationrules/{id}\ + \ \\\n --header 'x-api-key: REPLACE_KEY_VALUE'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/office365s/{office365_id}/translationrules/{id}\"\ + \n\nheaders = {\"x-api-key\": \"REPLACE_KEY_VALUE\"}\n\nresponse = requests.request(\"\ + GET\", url, headers=headers)\n\nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n\ + $response = Invoke-RestMethod -Uri 'https://console.jumpcloud.com/api/v2/office365s/{office365_id}/translationrules/{id}'\ + \ -Method GET -Headers $headers" + delete: + tags: + - Office 365 + summary: Deletes a Office 365 translation rule + description: "This endpoint allows you to delete a translation rule for a specific\ + \ Office 365 instance. These rules specify how JumpCloud attributes translate\ + \ to [Microsoft Graph](https://developer.microsoft.com/en-us/graph) attributes.\n\ + \n#### Sample Request\n\n```\ncurl -X DELETE https://console.jumpcloud.com/api/v2/office365s/{office365_id}/translationrules/{id}\ + \ \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\ + \ \\\n -H 'x-api-key: {API_KEY}'\n ```" + operationId: translationRules_office365Delete + parameters: + - name: office365_id + in: path + required: true + style: simple + explode: false + schema: + type: string + - name: id + in: path + required: true + style: simple + explode: false + schema: + type: string + responses: + "204": + description: "" + content: {} + security: + - x-api-key: [] + x-scopes: + - directories + x-codeSamples: + - lang: Shell + source: "curl --request DELETE \\\n --url https://console.jumpcloud.com/api/v2/office365s/{office365_id}/translationrules/{id}\ + \ \\\n --header 'x-api-key: REPLACE_KEY_VALUE'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/office365s/{office365_id}/translationrules/{id}\"\ + \n\nheaders = {\"x-api-key\": \"REPLACE_KEY_VALUE\"}\n\nresponse = requests.request(\"\ + DELETE\", url, headers=headers)\n\nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n\ + $response = Invoke-RestMethod -Uri 'https://console.jumpcloud.com/api/v2/office365s/{office365_id}/translationrules/{id}'\ + \ -Method DELETE -Headers $headers" + /office365s/{office365_id}/usergroups: + get: + tags: + - Graph + - Office 365 + summary: List the User Groups bound to an Office 365 instance + description: "This endpoint will return all Users Groups bound to an Office\ + \ 365 instance, either directly or indirectly, essentially traversing the\ + \ JumpCloud Graph for your Organization.\n\nEach element will contain the\ + \ group's type, id, attributes and paths.\n\nThe `attributes` object is a\ + \ key/value hash of compiled graph attributes for all paths followed.\n\n\ + The `paths` array enumerates each path from this Office 365 instance to the\ + \ corresponding User Group; this array represents all grouping and/or associations\ + \ that would have to be removed to deprovision the User Group from this Office\ + \ 365 instance.\n\nSee `/members` and `/associations` endpoints to manage\ + \ those collections.\n\n#### Sample Request\n```\n curl -X GET https://console.jumpcloud.com/api/v2/office365s/{OFFICE365_ID/usergroups\ + \ \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\ + \ \\\n -H 'x-api-key: {API_KEY}'\n```" + operationId: graph_office365TraverseUserGroup + parameters: + - name: office365_id + in: path + description: ObjectID of the Office 365 suite. + required: true + style: simple + explode: false + schema: + type: string + - name: limit + in: query + description: The number of records to return at once. Limited to 100. + required: false + style: form + explode: true + schema: + type: integer + default: 10 + - name: x-org-id + in: header + description: Organization identifier that can be obtained from console settings. + required: false + style: simple + explode: false + schema: + type: string + - name: skip + in: query + description: The offset into the records to return. + required: false + style: form + explode: true + schema: + minimum: 0 + type: integer + default: 0 + - name: filter + in: query + description: "A filter to apply to the query.\n\n**Filter structure**: `::`.\n\ + \n**field** = Populate with a valid field from an endpoint response.\n\n\ + **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between,\ + \ search, in.\n_Note: v1 operators differ from v2 operators._\n\n**value**\ + \ = Populate with the value you want to search for. Is case sensitive. Supports\ + \ wild cards.\n\n**EX:** `GET /api/v2/groups?filter=name:eq:Test+Group`" + required: false + style: form + explode: false + schema: + type: array + items: + type: string + responses: + "200": + description: OK + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/GraphObjectWithPaths' + x-content-type: application/json + security: + - x-api-key: [] + x-scopes: + - groups + - groups.readonly + x-codeSamples: + - lang: Shell + source: "curl --request GET \\\n --url 'https://console.jumpcloud.com/api/v2/office365s/{office365_id}/usergroups?limit=10&skip=0'\ + \ \\\n --header 'x-api-key: REPLACE_KEY_VALUE' \\\n --header 'x-org-id:\ + \ SOME_STRING_VALUE'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/office365s/{office365_id}/usergroups\"\ + \n\nquerystring = {\"limit\":\"10\",\"skip\":\"0\"}\n\nheaders = {\n \ + \ \"x-org-id\": \"SOME_STRING_VALUE\",\n \"x-api-key\": \"REPLACE_KEY_VALUE\"\ + \n}\n\nresponse = requests.request(\"GET\", url, headers=headers, params=querystring)\n\ + \nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-org-id\", \"SOME_STRING_VALUE\")\n\ + $headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n$response = Invoke-RestMethod\ + \ -Uri 'https://console.jumpcloud.com/api/v2/office365s/{office365_id}/usergroups?limit=10&skip=0'\ + \ -Method GET -Headers $headers" + /office365s/{office365_id}/users: + get: + tags: + - Graph + - Office 365 + summary: List the Users bound to an Office 365 instance + description: "This endpoint will return all Users bound to an Office 365 instance,\ + \ either directly or indirectly, essentially traversing the JumpCloud Graph\ + \ for your Organization.\n\nEach element will contain the type, id, attributes\ + \ and paths.\n\nThe `attributes` object is a key/value hash of compiled graph\ + \ attributes for all paths followed.\n\nThe `paths` array enumerates each\ + \ path from this Office 365 instance to the corresponding User; this array\ + \ represents all grouping and/or associations that would have to be removed\ + \ to deprovision the User from this Office 365 instance.\n\nSee `/members`\ + \ and `/associations` endpoints to manage those collections.\n\n#### Sample\ + \ Request\n```\ncurl -X GET https://console.jumpcloud.com/api/v2/office365s/{OFFICE365_ID}/users\ + \ \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\ + \ \\\n -H 'x-api-key: {API_KEY}'\n```" + operationId: graph_office365TraverseUser + parameters: + - name: office365_id + in: path + description: ObjectID of the Office 365 suite. + required: true + style: simple + explode: false + schema: + type: string + - name: limit + in: query + description: The number of records to return at once. Limited to 100. + required: false + style: form + explode: true + schema: + type: integer + default: 10 + - name: x-org-id + in: header + description: Organization identifier that can be obtained from console settings. + required: false + style: simple + explode: false + schema: + type: string + - name: skip + in: query + description: The offset into the records to return. + required: false + style: form + explode: true + schema: + minimum: 0 + type: integer + default: 0 + - name: filter + in: query + description: "A filter to apply to the query.\n\n**Filter structure**: `::`.\n\ + \n**field** = Populate with a valid field from an endpoint response.\n\n\ + **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between,\ + \ search, in.\n_Note: v1 operators differ from v2 operators._\n\n**value**\ + \ = Populate with the value you want to search for. Is case sensitive. Supports\ + \ wild cards.\n\n**EX:** `GET /api/v2/groups?filter=name:eq:Test+Group`" + required: false + style: form + explode: false + schema: + type: array + items: + type: string + responses: + "200": + description: OK + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/GraphObjectWithPaths' + x-content-type: application/json + security: + - x-api-key: [] + x-scopes: + - users + - users.readonly + x-codeSamples: + - lang: Shell + source: "curl --request GET \\\n --url 'https://console.jumpcloud.com/api/v2/office365s/{office365_id}/users?limit=10&skip=0'\ + \ \\\n --header 'x-api-key: REPLACE_KEY_VALUE' \\\n --header 'x-org-id:\ + \ SOME_STRING_VALUE'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/office365s/{office365_id}/users\"\ + \n\nquerystring = {\"limit\":\"10\",\"skip\":\"0\"}\n\nheaders = {\n \ + \ \"x-org-id\": \"SOME_STRING_VALUE\",\n \"x-api-key\": \"REPLACE_KEY_VALUE\"\ + \n}\n\nresponse = requests.request(\"GET\", url, headers=headers, params=querystring)\n\ + \nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-org-id\", \"SOME_STRING_VALUE\")\n\ + $headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n$response = Invoke-RestMethod\ + \ -Uri 'https://console.jumpcloud.com/api/v2/office365s/{office365_id}/users?limit=10&skip=0'\ + \ -Method GET -Headers $headers" + /organizations/cases: + get: + tags: + - Organizations + summary: Get all cases (Support/Feature requests) for organization + description: This endpoint returns the cases (Support/Feature requests) for + the organization + operationId: organizations_listCases + parameters: + - name: skip + in: query + description: The offset into the records to return. + required: false + style: form + explode: true + schema: + minimum: 0 + type: integer + default: 0 + - name: sort + in: query + description: "The comma separated fields used to sort the collection.\nDefault\ + \ sort is ascending, prefix with `-` to sort descending.\n" + required: false + style: form + explode: false + schema: + type: array + items: + type: string + - name: limit + in: query + description: The number of records to return at once. Limited to 100. + required: false + style: form + explode: true + schema: + type: integer + default: 10 + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/OrganizationCasesResponse' + security: + - x-api-key: [] + x-scopes: + - organizations + x-codeSamples: + - lang: Shell + source: "curl --request GET \\\n --url 'https://console.jumpcloud.com/api/v2/organizations/cases?skip=0&limit=10'\ + \ \\\n --header 'x-api-key: REPLACE_KEY_VALUE'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/organizations/cases\"\ + \n\nquerystring = {\"skip\":\"0\",\"limit\":\"10\"}\n\nheaders = {\"x-api-key\"\ + : \"REPLACE_KEY_VALUE\"}\n\nresponse = requests.request(\"GET\", url, headers=headers,\ + \ params=querystring)\n\nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n\ + $response = Invoke-RestMethod -Uri 'https://console.jumpcloud.com/api/v2/organizations/cases?skip=0&limit=10'\ + \ -Method GET -Headers $headers" + /organizations/{id}/administratorlinks: + get: + tags: + - Administrators + - Organizations + - Managed Service Provider + summary: List the association links between an Organization and Administrators. + description: This endpoint returns the association links between an Organization + and Administrators. + operationId: administratorOrganizations_listByOrganization + parameters: + - name: id + in: path + required: true + style: simple + explode: false + schema: + type: string + - name: limit + in: query + description: The number of records to return at once. Limited to 100. + required: false + style: form + explode: true + schema: + type: integer + default: 10 + - name: skip + in: query + description: The offset into the records to return. + required: false + style: form + explode: true + schema: + minimum: 0 + type: integer + default: 0 + responses: + "200": + description: "" + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/AdministratorOrganizationLink' + x-content-type: application/json + "400": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorDetails' + "401": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "403": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "404": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "500": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + security: + - x-api-key: [] + x-scopes: + - organizations + - organizations.readonly + x-codeSamples: + - lang: Shell + source: "curl --request GET \\\n --url 'https://console.jumpcloud.com/api/v2/organizations/{id}/administratorlinks?limit=10&skip=0'\ + \ \\\n --header 'x-api-key: REPLACE_KEY_VALUE'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/organizations/{id}/administratorlinks\"\ + \n\nquerystring = {\"limit\":\"10\",\"skip\":\"0\"}\n\nheaders = {\"x-api-key\"\ + : \"REPLACE_KEY_VALUE\"}\n\nresponse = requests.request(\"GET\", url, headers=headers,\ + \ params=querystring)\n\nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n\ + $response = Invoke-RestMethod -Uri 'https://console.jumpcloud.com/api/v2/organizations/{id}/administratorlinks?limit=10&skip=0'\ + \ -Method GET -Headers $headers" + /policies: + get: + tags: + - Policies + summary: Lists all the Policies + description: "This endpoint returns all policies.\n\n##### Sample Request\n\n\ + ```\n curl -X GET https://console.jumpcloud.com/api/v2/policies \\\n -H\ + \ 'Accept: application/json' \\\n -H 'Content-Type: application/json' \\\n\ + \ -H 'x-api-key: {API_KEY}'\n ```" + operationId: policies_list + parameters: + - name: fields + in: query + description: "The comma separated fields included in the returned records.\n\ + If omitted, the default list of fields will be returned.\n" + required: false + style: form + explode: false + schema: + type: array + items: + type: string + - name: filter + in: query + description: "A filter to apply to the query.\n\n**Filter structure**: `::`.\n\ + \n**field** = Populate with a valid field from an endpoint response.\n\n\ + **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between,\ + \ search, in.\n_Note: v1 operators differ from v2 operators._\n\n**value**\ + \ = Populate with the value you want to search for. Is case sensitive. Supports\ + \ wild cards.\n\n**EX:** `GET /api/v2/groups?filter=name:eq:Test+Group`" + required: false + style: form + explode: false + schema: + type: array + items: + type: string + - name: limit + in: query + description: The number of records to return at once. Limited to 100. + required: false + style: form + explode: true + schema: + type: integer + default: 10 + - name: skip + in: query + description: The offset into the records to return. + required: false + style: form + explode: true + schema: + minimum: 0 + type: integer + default: 0 + - name: sort + in: query + description: "The comma separated fields used to sort the collection.\nDefault\ + \ sort is ascending, prefix with `-` to sort descending.\n" + required: false + style: form + explode: false + schema: + type: array + items: + type: string + - name: x-org-id + in: header + description: Organization identifier that can be obtained from console settings. + required: false + style: simple + explode: false + schema: + type: string + responses: + "200": + description: OK + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/Policy' + x-content-type: application/json + "500": + description: Unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + security: + - x-api-key: [] + x-scopes: + - systems + - systems.readonly + x-codeSamples: + - lang: Shell + source: "curl --request GET \\\n --url 'https://console.jumpcloud.com/api/v2/policies?limit=10&skip=0'\ + \ \\\n --header 'x-api-key: REPLACE_KEY_VALUE' \\\n --header 'x-org-id:\ + \ SOME_STRING_VALUE'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/policies\"\ + \n\nquerystring = {\"limit\":\"10\",\"skip\":\"0\"}\n\nheaders = {\n \ + \ \"x-org-id\": \"SOME_STRING_VALUE\",\n \"x-api-key\": \"REPLACE_KEY_VALUE\"\ + \n}\n\nresponse = requests.request(\"GET\", url, headers=headers, params=querystring)\n\ + \nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-org-id\", \"SOME_STRING_VALUE\")\n\ + $headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n$response = Invoke-RestMethod\ + \ -Uri 'https://console.jumpcloud.com/api/v2/policies?limit=10&skip=0' -Method\ + \ GET -Headers $headers" + post: + tags: + - Policies + summary: Create a new Policy + description: "This endpoint allows you to create a policy. Given the amount\ + \ of configurable parameters required to create a Policy, we suggest you use\ + \ the JumpCloud Admin Console to create new policies.\n\n##### Sample Request\n\ + ```\ncurl -X POST https://console.jumpcloud.com/api/v2/policies \\\n -H 'Accept:\ + \ application/json' \\\n -H 'Content-Type: application/json' \\\n -H 'x-api-key:\ + \ {API_KEY}' \\\n -d '{\n {Policy_Parameters}\n }'\n```" + operationId: policies_post + parameters: + - name: x-org-id + in: header + description: Organization identifier that can be obtained from console settings. + required: false + style: simple + explode: false + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/PolicyRequest' + required: false + responses: + "201": + description: Created + content: + application/json: + schema: + $ref: '#/components/schemas/PolicyWithDetails' + security: + - x-api-key: [] + x-scopes: + - systems + x-codeSamples: + - lang: Shell + source: "curl --request POST \\\n --url https://console.jumpcloud.com/api/v2/policies\ + \ \\\n --header 'content-type: application/json' \\\n --header 'x-api-key:\ + \ REPLACE_KEY_VALUE' \\\n --header 'x-org-id: SOME_STRING_VALUE' \\\n \ + \ --data '{\"name\":\"string\",\"template\":{\"id\":\"string\"},\"values\"\ + :[{\"configFieldID\":\"string\",\"sensitive\":true,\"value\":\"string\"\ + }]}'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/policies\"\ + \n\npayload = {\n \"name\": \"string\",\n \"template\": {\"id\": \"\ + string\"},\n \"values\": [\n {\n \"configFieldID\"\ + : \"string\",\n \"sensitive\": True,\n \"value\":\ + \ \"string\"\n }\n ]\n}\nheaders = {\n \"x-org-id\": \"SOME_STRING_VALUE\"\ + ,\n \"x-api-key\": \"REPLACE_KEY_VALUE\",\n \"content-type\": \"application/json\"\ + \n}\n\nresponse = requests.request(\"POST\", url, json=payload, headers=headers)\n\ + \nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-org-id\", \"SOME_STRING_VALUE\")\n\ + $headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n$headers.Add(\"content-type\"\ + , \"application/json\")\n$response = Invoke-RestMethod -Uri 'https://console.jumpcloud.com/api/v2/policies'\ + \ -Method POST -Headers $headers -ContentType 'application/json' -Body '{\"\ + name\":\"string\",\"template\":{\"id\":\"string\"},\"values\":[{\"configFieldID\"\ + :\"string\",\"sensitive\":true,\"value\":\"string\"}]}'" + x-codegen-request-body-name: body + /policies/{id}: + get: + tags: + - Policies + summary: Gets a specific Policy. + description: "This endpoint returns a specific policy.\n\n###### Sample Request\n\ + \n```\n curl -X GET https://console.jumpcloud.com/api/v2/policies/{PolicyID}\ + \ \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\ + \ \\\n -H 'x-api-key: {API_KEY}'\n ```" + operationId: policies_get + parameters: + - name: id + in: path + description: ObjectID of the Policy object. + required: true + style: simple + explode: false + schema: + type: string + - name: x-org-id + in: header + description: Organization identifier that can be obtained from console settings. + required: false + style: simple + explode: false + schema: + type: string + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/PolicyWithDetails' + security: + - x-api-key: [] + x-scopes: + - systems + - systems.readonly + x-codeSamples: + - lang: Shell + source: "curl --request GET \\\n --url https://console.jumpcloud.com/api/v2/policies/{id}\ + \ \\\n --header 'x-api-key: REPLACE_KEY_VALUE' \\\n --header 'x-org-id:\ + \ SOME_STRING_VALUE'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/policies/{id}\"\ + \n\nheaders = {\n \"x-org-id\": \"SOME_STRING_VALUE\",\n \"x-api-key\"\ + : \"REPLACE_KEY_VALUE\"\n}\n\nresponse = requests.request(\"GET\", url,\ + \ headers=headers)\n\nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-org-id\", \"SOME_STRING_VALUE\")\n\ + $headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n$response = Invoke-RestMethod\ + \ -Uri 'https://console.jumpcloud.com/api/v2/policies/{id}' -Method GET\ + \ -Headers $headers" + put: + tags: + - Policies + summary: Update an existing Policy + description: "This endpoint allows you to update a policy. Given the amount\ + \ of configurable parameters required to update a Policy, we suggest you use\ + \ the JumpCloud Admin Console to create new policies.\n\n\n##### Sample Request\n\ + ```\ncurl -X PUT https://console.jumpcloud.com/api/v2/policies/59fced45c9118022172547ff\ + \ \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\ + \ \\\n -H 'x-api-key: {API_KEY}' \\\n -d '{\n {Policy_Parameters}\n \ + \ }'\n```" + operationId: policies_put + parameters: + - name: id + in: path + description: ObjectID of the Policy object. + required: true + style: simple + explode: false + schema: + type: string + - name: x-org-id + in: header + description: Organization identifier that can be obtained from console settings. + required: false + style: simple + explode: false + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/PolicyRequest' + required: false + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/Policy' + security: + - x-api-key: [] + x-scopes: + - systems + x-codeSamples: + - lang: Shell + source: "curl --request PUT \\\n --url https://console.jumpcloud.com/api/v2/policies/{id}\ + \ \\\n --header 'content-type: application/json' \\\n --header 'x-api-key:\ + \ REPLACE_KEY_VALUE' \\\n --header 'x-org-id: SOME_STRING_VALUE' \\\n \ + \ --data '{\"name\":\"string\",\"template\":{\"id\":\"string\"},\"values\"\ + :[{\"configFieldID\":\"string\",\"sensitive\":true,\"value\":\"string\"\ + }]}'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/policies/{id}\"\ + \n\npayload = {\n \"name\": \"string\",\n \"template\": {\"id\": \"\ + string\"},\n \"values\": [\n {\n \"configFieldID\"\ + : \"string\",\n \"sensitive\": True,\n \"value\":\ + \ \"string\"\n }\n ]\n}\nheaders = {\n \"x-org-id\": \"SOME_STRING_VALUE\"\ + ,\n \"x-api-key\": \"REPLACE_KEY_VALUE\",\n \"content-type\": \"application/json\"\ + \n}\n\nresponse = requests.request(\"PUT\", url, json=payload, headers=headers)\n\ + \nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-org-id\", \"SOME_STRING_VALUE\")\n\ + $headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n$headers.Add(\"content-type\"\ + , \"application/json\")\n$response = Invoke-RestMethod -Uri 'https://console.jumpcloud.com/api/v2/policies/{id}'\ + \ -Method PUT -Headers $headers -ContentType 'application/json' -Body '{\"\ + name\":\"string\",\"template\":{\"id\":\"string\"},\"values\":[{\"configFieldID\"\ + :\"string\",\"sensitive\":true,\"value\":\"string\"}]}'" + x-codegen-request-body-name: body + delete: + tags: + - Policies + summary: Deletes a Policy + description: "This endpoint allows you to delete a policy.\n\n#### Sample Request\n\ + \n```\ncurl -X DELETE https://console.jumpcloud.com/api/v2/policies/5a837ecd232e110d4291e6b9\ + \ \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\ + \ \\\n -H 'x-api-key: {API_KEY}'\n ```" + operationId: policies_delete + parameters: + - name: id + in: path + description: ObjectID of the Policy object. + required: true + style: simple + explode: false + schema: + type: string + - name: x-org-id + in: header + description: Organization identifier that can be obtained from console settings. + required: false + style: simple + explode: false + schema: + type: string + responses: + "204": + description: No Content + content: {} + security: + - x-api-key: [] + x-scopes: + - systems + x-codeSamples: + - lang: Shell + source: "curl --request DELETE \\\n --url https://console.jumpcloud.com/api/v2/policies/{id}\ + \ \\\n --header 'x-api-key: REPLACE_KEY_VALUE' \\\n --header 'x-org-id:\ + \ SOME_STRING_VALUE'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/policies/{id}\"\ + \n\nheaders = {\n \"x-org-id\": \"SOME_STRING_VALUE\",\n \"x-api-key\"\ + : \"REPLACE_KEY_VALUE\"\n}\n\nresponse = requests.request(\"DELETE\", url,\ + \ headers=headers)\n\nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-org-id\", \"SOME_STRING_VALUE\")\n\ + $headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n$response = Invoke-RestMethod\ + \ -Uri 'https://console.jumpcloud.com/api/v2/policies/{id}' -Method DELETE\ + \ -Headers $headers" + /policies/{policy_id}/associations: + get: + tags: + - Graph + - Policies + summary: List the associations of a Policy + description: "This endpoint returns the _direct_ associations of a Policy.\n\ + \nA direct association can be a non-homogeneous relationship between 2 different\ + \ objects, for example Policies and Systems.\n\n#### Sample Request\n```\n\ + curl -X GET 'https://console.jumpcloud.com/api/v2/policies/{Policy_ID}/associations?targets=system_group\ + \ \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\ + \ \\\n -H 'x-api-key: {API_KEY}'\n```" + operationId: graph_policyAssociationsList + parameters: + - name: policy_id + in: path + description: ObjectID of the Policy. + required: true + style: simple + explode: false + schema: + type: string + - name: targets + in: query + description: Targets which a "policy" can be associated to. + required: true + style: form + explode: false + schema: + type: array + items: + type: string + enum: + - system + - system_group + - name: limit + in: query + description: The number of records to return at once. Limited to 100. + required: false + style: form + explode: true + schema: + type: integer + default: 10 + - name: skip + in: query + description: The offset into the records to return. + required: false + style: form + explode: true + schema: + minimum: 0 + type: integer + default: 0 + - name: x-org-id + in: header + description: Organization identifier that can be obtained from console settings. + required: false + style: simple + explode: false + schema: + type: string + responses: + "200": + description: OK + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/GraphConnection' + x-content-type: application/json + security: + - x-api-key: [] + x-scopes: + - systems + - systems.readonly + x-codeSamples: + - lang: Shell + source: "curl --request GET \\\n --url 'https://console.jumpcloud.com/api/v2/policies/{policy_id}/associations?targets=SOME_ARRAY_VALUE&limit=10&skip=0'\ + \ \\\n --header 'x-api-key: REPLACE_KEY_VALUE' \\\n --header 'x-org-id:\ + \ SOME_STRING_VALUE'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/policies/{policy_id}/associations\"\ + \n\nquerystring = {\"targets\":\"SOME_ARRAY_VALUE\",\"limit\":\"10\",\"\ + skip\":\"0\"}\n\nheaders = {\n \"x-org-id\": \"SOME_STRING_VALUE\",\n\ + \ \"x-api-key\": \"REPLACE_KEY_VALUE\"\n}\n\nresponse = requests.request(\"\ + GET\", url, headers=headers, params=querystring)\n\nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-org-id\", \"SOME_STRING_VALUE\")\n\ + $headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n$response = Invoke-RestMethod\ + \ -Uri 'https://console.jumpcloud.com/api/v2/policies/{policy_id}/associations?targets=SOME_ARRAY_VALUE&limit=10&skip=0'\ + \ -Method GET -Headers $headers" + post: + tags: + - Graph + - Policies + summary: Manage the associations of a Policy + description: "This endpoint allows you to manage the _direct_ associations of\ + \ a Policy.\n\nA direct association can be a non-homogeneous relationship\ + \ between 2 different objects, for example Policies and Systems.\n\n#### Sample\ + \ Request\n```\ncurl -X POST https://console.jumpcloud.com/api/v2/policies/{Policy_ID}/associations/\ + \ \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\ + \ \\\n -H 'x-api-key: {API_KEY}' \\\n -d '{\n \"op\": \"add\",\n \"\ + type\": \"system_group\",\n \"id\": \"{Group_ID}\"\n }'\n```" + operationId: graph_policyAssociationsPost + parameters: + - name: policy_id + in: path + description: ObjectID of the Policy. + required: true + style: simple + explode: false + schema: + type: string + - name: x-org-id + in: header + description: Organization identifier that can be obtained from console settings. + required: false + style: simple + explode: false + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/GraphOperation-Policy' + required: false + responses: + "204": + description: "" + content: {} + security: + - x-api-key: [] + x-scopes: + - systems + x-codeSamples: + - lang: Shell + source: "curl --request POST \\\n --url https://console.jumpcloud.com/api/v2/policies/{policy_id}/associations\ + \ \\\n --header 'content-type: application/json' \\\n --header 'x-api-key:\ + \ REPLACE_KEY_VALUE' \\\n --header 'x-org-id: SOME_STRING_VALUE' \\\n \ + \ --data '{\"id\":\"string\",\"op\":\"add\",\"attributes\":{},\"type\":\"\ + system\"}'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/policies/{policy_id}/associations\"\ + \n\npayload = {\n \"id\": \"string\",\n \"op\": \"add\",\n \"attributes\"\ + : {},\n \"type\": \"system\"\n}\nheaders = {\n \"x-org-id\": \"SOME_STRING_VALUE\"\ + ,\n \"x-api-key\": \"REPLACE_KEY_VALUE\",\n \"content-type\": \"application/json\"\ + \n}\n\nresponse = requests.request(\"POST\", url, json=payload, headers=headers)\n\ + \nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-org-id\", \"SOME_STRING_VALUE\")\n\ + $headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n$headers.Add(\"content-type\"\ + , \"application/json\")\n$response = Invoke-RestMethod -Uri 'https://console.jumpcloud.com/api/v2/policies/{policy_id}/associations'\ + \ -Method POST -Headers $headers -ContentType 'application/json' -Body '{\"\ + id\":\"string\",\"op\":\"add\",\"attributes\":{},\"type\":\"system\"}'" + x-codegen-request-body-name: body + /policies/{policy_id}/memberof: + get: + tags: + - Graph + - Policies + summary: List the parent Groups of a Policy + description: "This endpoint returns all the Policy Groups a Policy is a member\ + \ of.\n\n#### Sample Request\n```\ncurl -X GET https://console.jumpcloud.com/api/v2/policies/{Policy_ID}/memberof\ + \ \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\ + \ \\\n -H 'x-api-key: {API_KEY}'\n\n```" + operationId: graph_policyMemberOf + parameters: + - name: policy_id + in: path + description: ObjectID of the Policy. + required: true + style: simple + explode: false + schema: + type: string + - name: filter + in: query + description: "A filter to apply to the query.\n\n**Filter structure**: `::`.\n\ + \n**field** = Populate with a valid field from an endpoint response.\n\n\ + **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between,\ + \ search, in.\n_Note: v1 operators differ from v2 operators._\n\n**value**\ + \ = Populate with the value you want to search for. Is case sensitive. Supports\ + \ wild cards.\n\n**EX:** `GET /api/v2/groups?filter=name:eq:Test+Group`" + required: false + style: form + explode: false + schema: + type: array + items: + type: string + - name: limit + in: query + description: The number of records to return at once. Limited to 100. + required: false + style: form + explode: true + schema: + type: integer + default: 10 + - name: skip + in: query + description: The offset into the records to return. + required: false + style: form + explode: true + schema: + minimum: 0 + type: integer + default: 0 + - name: Date + in: header + description: Current date header for the System Context API + required: false + style: simple + explode: false + schema: + type: string + - name: Authorization + in: header + description: Authorization header for the System Context API + required: false + style: simple + explode: false + schema: + type: string + - name: sort + in: query + description: "The comma separated fields used to sort the collection.\nDefault\ + \ sort is ascending, prefix with `-` to sort descending.\n" + required: false + style: form + explode: false + schema: + type: array + items: + type: string + - name: x-org-id + in: header + description: Organization identifier that can be obtained from console settings. + required: false + style: simple + explode: false + schema: + type: string + responses: + "200": + description: OK + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/GraphObjectWithPaths' + x-content-type: application/json + security: + - x-api-key: [] + x-scopes: + - groups + - groups.readonly + - groups.self + x-codeSamples: + - lang: Shell + source: "curl --request GET \\\n --url 'https://console.jumpcloud.com/api/v2/policies/{policy_id}/memberof?limit=10&skip=0'\ + \ \\\n --header 'Authorization: SOME_STRING_VALUE' \\\n --header 'Date:\ + \ SOME_STRING_VALUE' \\\n --header 'x-api-key: REPLACE_KEY_VALUE' \\\n\ + \ --header 'x-org-id: SOME_STRING_VALUE'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/policies/{policy_id}/memberof\"\ + \n\nquerystring = {\"limit\":\"10\",\"skip\":\"0\"}\n\nheaders = {\n \ + \ \"Date\": \"SOME_STRING_VALUE\",\n \"Authorization\": \"SOME_STRING_VALUE\"\ + ,\n \"x-org-id\": \"SOME_STRING_VALUE\",\n \"x-api-key\": \"REPLACE_KEY_VALUE\"\ + \n}\n\nresponse = requests.request(\"GET\", url, headers=headers, params=querystring)\n\ + \nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"Date\", \"SOME_STRING_VALUE\")\n$headers.Add(\"\ + Authorization\", \"SOME_STRING_VALUE\")\n$headers.Add(\"x-org-id\", \"SOME_STRING_VALUE\"\ + )\n$headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n$response = Invoke-RestMethod\ + \ -Uri 'https://console.jumpcloud.com/api/v2/policies/{policy_id}/memberof?limit=10&skip=0'\ + \ -Method GET -Headers $headers" + /policies/{policy_id}/policyresults: + get: + tags: + - Policies + summary: Lists all the policy results of a policy. + description: "This endpoint returns all policies results for a specific policy.\n\ + \n##### Sample Request\n\n```\n curl -X GET https://console.jumpcloud.com/api/v2/policies/{Policy_ID}/policyresults\ + \ \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\ + \ \\\n -H 'x-api-key: {API_KEY}'\n ```" + operationId: policyresults_list + parameters: + - name: policy_id + in: path + required: true + style: simple + explode: false + schema: + type: string + - name: fields + in: query + description: "The comma separated fields included in the returned records.\n\ + If omitted, the default list of fields will be returned.\n" + required: false + style: form + explode: false + schema: + type: array + items: + type: string + - name: filter + in: query + description: "A filter to apply to the query.\n\n**Filter structure**: `::`.\n\ + \n**field** = Populate with a valid field from an endpoint response.\n\n\ + **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between,\ + \ search, in.\n_Note: v1 operators differ from v2 operators._\n\n**value**\ + \ = Populate with the value you want to search for. Is case sensitive. Supports\ + \ wild cards.\n\n**EX:** `GET /api/v2/groups?filter=name:eq:Test+Group`" + required: false + style: form + explode: false + schema: + type: array + items: + type: string + - name: limit + in: query + description: The number of records to return at once. Limited to 100. + required: false + style: form + explode: true + schema: + type: integer + default: 10 + - name: x-org-id + in: header + description: Organization identifier that can be obtained from console settings. + required: false + style: simple + explode: false + schema: + type: string + - name: skip + in: query + description: The offset into the records to return. + required: false + style: form + explode: true + schema: + minimum: 0 + type: integer + default: 0 + - name: sort + in: query + description: "The comma separated fields used to sort the collection.\nDefault\ + \ sort is ascending, prefix with `-` to sort descending.\n" + required: false + style: form + explode: false + schema: + type: array + items: + type: string + responses: + "200": + description: "" + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/PolicyResult' + x-content-type: application/json + security: + - x-api-key: [] + x-scopes: + - systems + - systems.readonly + x-codeSamples: + - lang: Shell + source: "curl --request GET \\\n --url 'https://console.jumpcloud.com/api/v2/policies/{policy_id}/policyresults?limit=10&skip=0'\ + \ \\\n --header 'x-api-key: REPLACE_KEY_VALUE' \\\n --header 'x-org-id:\ + \ SOME_STRING_VALUE'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/policies/{policy_id}/policyresults\"\ + \n\nquerystring = {\"limit\":\"10\",\"skip\":\"0\"}\n\nheaders = {\n \ + \ \"x-org-id\": \"SOME_STRING_VALUE\",\n \"x-api-key\": \"REPLACE_KEY_VALUE\"\ + \n}\n\nresponse = requests.request(\"GET\", url, headers=headers, params=querystring)\n\ + \nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-org-id\", \"SOME_STRING_VALUE\")\n\ + $headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n$response = Invoke-RestMethod\ + \ -Uri 'https://console.jumpcloud.com/api/v2/policies/{policy_id}/policyresults?limit=10&skip=0'\ + \ -Method GET -Headers $headers" + /policies/{policy_id}/policystatuses: + get: + tags: + - Policies + summary: Lists the latest policy results of a policy. + description: "This endpoint returns the latest policy results for a specific\ + \ policy.\n\n##### Sample Request\n\n```\n curl -X GET https://console.jumpcloud.com/api/v2/policies/{Policy_ID}/policystatuses\ + \ \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\ + \ \\\n -H 'x-api-key: {API_KEY}'\n ```" + operationId: policystatuses_policiesList + parameters: + - name: policy_id + in: path + required: true + style: simple + explode: false + schema: + type: string + - name: fields + in: query + description: "The comma separated fields included in the returned records.\n\ + If omitted, the default list of fields will be returned.\n" + required: false + style: form + explode: false + schema: + type: array + items: + type: string + - name: filter + in: query + description: "A filter to apply to the query.\n\n**Filter structure**: `::`.\n\ + \n**field** = Populate with a valid field from an endpoint response.\n\n\ + **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between,\ + \ search, in.\n_Note: v1 operators differ from v2 operators._\n\n**value**\ + \ = Populate with the value you want to search for. Is case sensitive. Supports\ + \ wild cards.\n\n**EX:** `GET /api/v2/groups?filter=name:eq:Test+Group`" + required: false + style: form + explode: false + schema: + type: array + items: + type: string + - name: limit + in: query + description: The number of records to return at once. Limited to 100. + required: false + style: form + explode: true + schema: + type: integer + default: 10 + - name: skip + in: query + description: The offset into the records to return. + required: false + style: form + explode: true + schema: + minimum: 0 + type: integer + default: 0 + - name: sort + in: query + description: "The comma separated fields used to sort the collection.\nDefault\ + \ sort is ascending, prefix with `-` to sort descending.\n" + required: false + style: form + explode: false + schema: + type: array + items: + type: string + - name: x-org-id + in: header + description: Organization identifier that can be obtained from console settings. + required: false + style: simple + explode: false + schema: + type: string + responses: + "200": + description: "" + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/PolicyResult' + x-content-type: application/json + security: + - x-api-key: [] + x-scopes: + - systems + - systems.readonly + x-codeSamples: + - lang: Shell + source: "curl --request GET \\\n --url 'https://console.jumpcloud.com/api/v2/policies/{policy_id}/policystatuses?limit=10&skip=0'\ + \ \\\n --header 'x-api-key: REPLACE_KEY_VALUE' \\\n --header 'x-org-id:\ + \ SOME_STRING_VALUE'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/policies/{policy_id}/policystatuses\"\ + \n\nquerystring = {\"limit\":\"10\",\"skip\":\"0\"}\n\nheaders = {\n \ + \ \"x-org-id\": \"SOME_STRING_VALUE\",\n \"x-api-key\": \"REPLACE_KEY_VALUE\"\ + \n}\n\nresponse = requests.request(\"GET\", url, headers=headers, params=querystring)\n\ + \nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-org-id\", \"SOME_STRING_VALUE\")\n\ + $headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n$response = Invoke-RestMethod\ + \ -Uri 'https://console.jumpcloud.com/api/v2/policies/{policy_id}/policystatuses?limit=10&skip=0'\ + \ -Method GET -Headers $headers" + /policies/{policy_id}/systemgroups: + get: + tags: + - Graph + - Policies + summary: List the System Groups bound to a Policy + description: "This endpoint will return all Systems Groups bound to a Policy,\ + \ either directly or indirectly, essentially traversing the JumpCloud Graph\ + \ for your Organization.\n\nEach element will contain the group's type, id,\ + \ attributes and paths.\n\nThe `attributes` object is a key/value hash of\ + \ compiled graph attributes for all paths followed.\n\nThe `paths` array enumerates\ + \ each path from this Policy to the corresponding System Group; this array\ + \ represents all grouping and/or associations that would have to be removed\ + \ to deprovision the System Group from this Policy.\n\nSee `/members` and\ + \ `/associations` endpoints to manage those collections.\n\n#### Sample Request\n\ + ```\ncurl -X GET https://console.jumpcloud.com/api/v2/policies/{Policy_ID}/systemgroups\ + \ \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\ + \ \\\n -H 'x-api-key: {API_KEY}'\n```" + operationId: graph_policyTraverseSystemGroup + parameters: + - name: policy_id + in: path + description: ObjectID of the Command. + required: true + style: simple + explode: false + schema: + type: string + - name: limit + in: query + description: The number of records to return at once. Limited to 100. + required: false + style: form + explode: true + schema: + type: integer + default: 10 + - name: x-org-id + in: header + description: Organization identifier that can be obtained from console settings. + required: false + style: simple + explode: false + schema: + type: string + - name: skip + in: query + description: The offset into the records to return. + required: false + style: form + explode: true + schema: + minimum: 0 + type: integer + default: 0 + - name: filter + in: query + description: "A filter to apply to the query.\n\n**Filter structure**: `::`.\n\ + \n**field** = Populate with a valid field from an endpoint response.\n\n\ + **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between,\ + \ search, in.\n_Note: v1 operators differ from v2 operators._\n\n**value**\ + \ = Populate with the value you want to search for. Is case sensitive. Supports\ + \ wild cards.\n\n**EX:** `GET /api/v2/groups?filter=name:eq:Test+Group`" + required: false + style: form + explode: false + schema: + type: array + items: + type: string + responses: + "200": + description: OK + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/GraphObjectWithPaths' + x-content-type: application/json + security: + - x-api-key: [] + x-scopes: + - groups + - groups.readonly + x-codeSamples: + - lang: Shell + source: "curl --request GET \\\n --url 'https://console.jumpcloud.com/api/v2/policies/{policy_id}/systemgroups?limit=10&skip=0'\ + \ \\\n --header 'x-api-key: REPLACE_KEY_VALUE' \\\n --header 'x-org-id:\ + \ SOME_STRING_VALUE'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/policies/{policy_id}/systemgroups\"\ + \n\nquerystring = {\"limit\":\"10\",\"skip\":\"0\"}\n\nheaders = {\n \ + \ \"x-org-id\": \"SOME_STRING_VALUE\",\n \"x-api-key\": \"REPLACE_KEY_VALUE\"\ + \n}\n\nresponse = requests.request(\"GET\", url, headers=headers, params=querystring)\n\ + \nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-org-id\", \"SOME_STRING_VALUE\")\n\ + $headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n$response = Invoke-RestMethod\ + \ -Uri 'https://console.jumpcloud.com/api/v2/policies/{policy_id}/systemgroups?limit=10&skip=0'\ + \ -Method GET -Headers $headers" + /policies/{policy_id}/systems: + get: + tags: + - Graph + - Policies + summary: List the Systems bound to a Policy + description: "This endpoint will return all Systems bound to a Policy, either\ + \ directly or indirectly, essentially traversing the JumpCloud Graph for your\ + \ Organization.\n\nEach element will contain the type, id, attributes and\ + \ paths.\n\nThe `attributes` object is a key/value hash of compiled graph\ + \ attributes for all paths followed.\n\nThe `paths` array enumerates each\ + \ path from this Policy to the corresponding System; this array represents\ + \ all grouping and/or associations that would have to be removed to deprovision\ + \ the System from this Policy.\n\nSee `/members` and `/associations` endpoints\ + \ to manage those collections.\n\n#### Sample Request\n```\ncurl -X GET https://console.jumpcloud.com/api/v2/policies/{Policy_ID}/systems\ + \ \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\ + \ \\\n -H 'x-api-key: {API_KEY}'\n```" + operationId: graph_policyTraverseSystem + parameters: + - name: policy_id + in: path + description: ObjectID of the Command. + required: true + style: simple + explode: false + schema: + type: string + - name: limit + in: query + description: The number of records to return at once. Limited to 100. + required: false + style: form + explode: true + schema: + type: integer + default: 10 + - name: x-org-id + in: header + description: Organization identifier that can be obtained from console settings. + required: false + style: simple + explode: false + schema: + type: string + - name: skip + in: query + description: The offset into the records to return. + required: false + style: form + explode: true + schema: + minimum: 0 + type: integer + default: 0 + - name: filter + in: query + description: "A filter to apply to the query.\n\n**Filter structure**: `::`.\n\ + \n**field** = Populate with a valid field from an endpoint response.\n\n\ + **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between,\ + \ search, in.\n_Note: v1 operators differ from v2 operators._\n\n**value**\ + \ = Populate with the value you want to search for. Is case sensitive. Supports\ + \ wild cards.\n\n**EX:** `GET /api/v2/groups?filter=name:eq:Test+Group`" + required: false + style: form + explode: false + schema: + type: array + items: + type: string + responses: + "200": + description: OK + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/GraphObjectWithPaths' + x-content-type: application/json + security: + - x-api-key: [] + x-scopes: + - systems + - systems.readonly + x-codeSamples: + - lang: Shell + source: "curl --request GET \\\n --url 'https://console.jumpcloud.com/api/v2/policies/{policy_id}/systems?limit=10&skip=0'\ + \ \\\n --header 'x-api-key: REPLACE_KEY_VALUE' \\\n --header 'x-org-id:\ + \ SOME_STRING_VALUE'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/policies/{policy_id}/systems\"\ + \n\nquerystring = {\"limit\":\"10\",\"skip\":\"0\"}\n\nheaders = {\n \ + \ \"x-org-id\": \"SOME_STRING_VALUE\",\n \"x-api-key\": \"REPLACE_KEY_VALUE\"\ + \n}\n\nresponse = requests.request(\"GET\", url, headers=headers, params=querystring)\n\ + \nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-org-id\", \"SOME_STRING_VALUE\")\n\ + $headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n$response = Invoke-RestMethod\ + \ -Uri 'https://console.jumpcloud.com/api/v2/policies/{policy_id}/systems?limit=10&skip=0'\ + \ -Method GET -Headers $headers" + /policygroups: + get: + tags: + - Policy Groups + summary: List all Policy Groups + description: "This endpoint returns all Policy Groups.\n\nAvailable filter fields:\n\ + \ - `name`\n - `disabled`\n - `type`\n\n#### Sample Request\n```\ncurl\ + \ -X GET https://console.jumpcloud.com/api/v2/policygroups \\\n -H 'Accept:\ + \ application/json' \\\n -H 'Content-Type: application/json' \\\n -H 'x-api-key:\ + \ {API_KEY}'\n```" + operationId: groups_policy_list + parameters: + - name: fields + in: query + description: "The comma separated fields included in the returned records.\n\ + If omitted, the default list of fields will be returned.\n" + required: false + style: form + explode: false + schema: + type: array + items: + type: string + - name: filter + in: query + description: "A filter to apply to the query.\n\n**Filter structure**: `::`.\n\ + \n**field** = Populate with a valid field from an endpoint response.\n\n\ + **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between,\ + \ search, in.\n_Note: v1 operators differ from v2 operators._\n\n**value**\ + \ = Populate with the value you want to search for. Is case sensitive. Supports\ + \ wild cards.\n\n**EX:** `GET /api/v2/groups?filter=name:eq:Test+Group`" + required: false + style: form + explode: false + schema: + type: array + items: + type: string + - name: limit + in: query + description: The number of records to return at once. Limited to 100. + required: false + style: form + explode: true + schema: + type: integer + default: 10 + - name: skip + in: query + description: The offset into the records to return. + required: false + style: form + explode: true + schema: + minimum: 0 + type: integer + default: 0 + - name: sort + in: query + description: "The comma separated fields used to sort the collection.\nDefault\ + \ sort is ascending, prefix with `-` to sort descending.\n" + required: false + style: form + explode: false + schema: + type: array + items: + type: string + - name: x-org-id + in: header + description: Organization identifier that can be obtained from console settings. + required: false + style: simple + explode: false + schema: + type: string + responses: + "200": + description: OK + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/PolicyGroup' + x-content-type: application/json + default: + description: Unexpected error + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + security: + - x-api-key: [] + x-scopes: + - groups + - groups.readonly + x-codeSamples: + - lang: Shell + source: "curl --request GET \\\n --url 'https://console.jumpcloud.com/api/v2/policygroups?limit=10&skip=0'\ + \ \\\n --header 'x-api-key: REPLACE_KEY_VALUE' \\\n --header 'x-org-id:\ + \ SOME_STRING_VALUE'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/policygroups\"\ + \n\nquerystring = {\"limit\":\"10\",\"skip\":\"0\"}\n\nheaders = {\n \ + \ \"x-org-id\": \"SOME_STRING_VALUE\",\n \"x-api-key\": \"REPLACE_KEY_VALUE\"\ + \n}\n\nresponse = requests.request(\"GET\", url, headers=headers, params=querystring)\n\ + \nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-org-id\", \"SOME_STRING_VALUE\")\n\ + $headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n$response = Invoke-RestMethod\ + \ -Uri 'https://console.jumpcloud.com/api/v2/policygroups?limit=10&skip=0'\ + \ -Method GET -Headers $headers" + post: + tags: + - Policy Groups + summary: Create a new Policy Group + description: "This endpoint allows you to create a new Policy Group.\n\n####\ + \ Sample Request\n```\ncurl -X POST https://console.jumpcloud.com/api/v2/policygroups\ + \ \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\ + \ \\\n -H 'x-api-key: {API_KEY}' \\\n -d '{\n \"name\": \"{Group_Name}\"\ + \n }'\n```" + operationId: groups_policy_post + parameters: + - name: x-org-id + in: header + description: Organization identifier that can be obtained from console settings. + required: false + style: simple + explode: false + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/PolicyGroupData' + required: false + responses: + "201": + description: Created + content: + application/json: + schema: + $ref: '#/components/schemas/PolicyGroup' + security: + - x-api-key: [] + x-scopes: + - groups + x-codeSamples: + - lang: Shell + source: "curl --request POST \\\n --url https://console.jumpcloud.com/api/v2/policygroups\ + \ \\\n --header 'content-type: application/json' \\\n --header 'x-api-key:\ + \ REPLACE_KEY_VALUE' \\\n --header 'x-org-id: SOME_STRING_VALUE' \\\n \ + \ --data '{\"name\":\"string\"}'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/policygroups\"\ + \n\npayload = {\"name\": \"string\"}\nheaders = {\n \"x-org-id\": \"\ + SOME_STRING_VALUE\",\n \"x-api-key\": \"REPLACE_KEY_VALUE\",\n \"\ + content-type\": \"application/json\"\n}\n\nresponse = requests.request(\"\ + POST\", url, json=payload, headers=headers)\n\nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-org-id\", \"SOME_STRING_VALUE\")\n\ + $headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n$headers.Add(\"content-type\"\ + , \"application/json\")\n$response = Invoke-RestMethod -Uri 'https://console.jumpcloud.com/api/v2/policygroups'\ + \ -Method POST -Headers $headers -ContentType 'application/json' -Body '{\"\ + name\":\"string\"}'" + x-codegen-request-body-name: body + /policygroups/{group_id}/associations: + get: + tags: + - Graph + - Policy Group Associations + - Policy Groups + summary: List the associations of a Policy Group. + description: "This endpoint returns the _direct_ associations of this Policy\ + \ Group.\n\nA direct association can be a non-homogeneous relationship between\ + \ 2 different objects, for example Policy Groups and Policies.\n\n\n#### Sample\ + \ Request\n```\ncurl -X GET https://console.jumpcloud.com/api/v2/policygroups/{GroupID}/associations?targets=system\ + \ \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\ + \ \\\n -H 'x-api-key: {API_KEY}'\n```" + operationId: graph_policyGroupAssociationsList + parameters: + - name: group_id + in: path + description: ObjectID of the Policy Group. + required: true + style: simple + explode: false + schema: + type: string + - name: targets + in: query + description: Targets which a "policy_group" can be associated to. + required: true + style: form + explode: false + schema: + type: array + items: + type: string + enum: + - system + - system_group + - name: limit + in: query + description: The number of records to return at once. Limited to 100. + required: false + style: form + explode: true + schema: + type: integer + default: 10 + - name: skip + in: query + description: The offset into the records to return. + required: false + style: form + explode: true + schema: + minimum: 0 + type: integer + default: 0 + - name: x-org-id + in: header + description: Organization identifier that can be obtained from console settings. + required: false + style: simple + explode: false + schema: + type: string + responses: + "200": + description: OK + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/GraphConnection' + x-content-type: application/json + security: + - x-api-key: [] + x-scopes: + - groups + - groups.readonly + x-codeSamples: + - lang: Shell + source: "curl --request GET \\\n --url 'https://console.jumpcloud.com/api/v2/policygroups/{group_id}/associations?targets=SOME_ARRAY_VALUE&limit=10&skip=0'\ + \ \\\n --header 'x-api-key: REPLACE_KEY_VALUE' \\\n --header 'x-org-id:\ + \ SOME_STRING_VALUE'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/policygroups/{group_id}/associations\"\ + \n\nquerystring = {\"targets\":\"SOME_ARRAY_VALUE\",\"limit\":\"10\",\"\ + skip\":\"0\"}\n\nheaders = {\n \"x-org-id\": \"SOME_STRING_VALUE\",\n\ + \ \"x-api-key\": \"REPLACE_KEY_VALUE\"\n}\n\nresponse = requests.request(\"\ + GET\", url, headers=headers, params=querystring)\n\nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-org-id\", \"SOME_STRING_VALUE\")\n\ + $headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n$response = Invoke-RestMethod\ + \ -Uri 'https://console.jumpcloud.com/api/v2/policygroups/{group_id}/associations?targets=SOME_ARRAY_VALUE&limit=10&skip=0'\ + \ -Method GET -Headers $headers" + post: + tags: + - Graph + - Policy Group Associations + - Policy Groups + summary: Manage the associations of a Policy Group + description: "This endpoint manages the _direct_ associations of this Policy\ + \ Group.\n\nA direct association can be a non-homogeneous relationship between\ + \ 2 different objects, for example Policy Groups and Policies.\n\n\n#### Sample\ + \ Request\n```\ncurl -X POST https://console.jumpcloud.com/api/v2/policygroups/{GroupID}/associations\ + \ \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\ + \ \\\n -H 'x-api-key: {API_KEY}' \\\n -d '{\n \"op\": \"add\",\n \"\ + type\": \"system\",\n \"id\": \"{SystemID}\"\n }'\n```" + operationId: graph_policyGroupAssociationsPost + parameters: + - name: group_id + in: path + description: ObjectID of the Policy Group. + required: true + style: simple + explode: false + schema: + type: string + - name: x-org-id + in: header + description: Organization identifier that can be obtained from console settings. + required: false + style: simple + explode: false + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/GraphOperation-PolicyGroup' + required: false + responses: + "204": + description: OK + content: {} + security: + - x-api-key: [] + x-scopes: + - groups + x-codeSamples: + - lang: Shell + source: "curl --request POST \\\n --url https://console.jumpcloud.com/api/v2/policygroups/{group_id}/associations\ + \ \\\n --header 'content-type: application/json' \\\n --header 'x-api-key:\ + \ REPLACE_KEY_VALUE' \\\n --header 'x-org-id: SOME_STRING_VALUE' \\\n \ + \ --data '{\"id\":\"string\",\"op\":\"add\",\"attributes\":{},\"type\":\"\ + system\"}'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/policygroups/{group_id}/associations\"\ + \n\npayload = {\n \"id\": \"string\",\n \"op\": \"add\",\n \"attributes\"\ + : {},\n \"type\": \"system\"\n}\nheaders = {\n \"x-org-id\": \"SOME_STRING_VALUE\"\ + ,\n \"x-api-key\": \"REPLACE_KEY_VALUE\",\n \"content-type\": \"application/json\"\ + \n}\n\nresponse = requests.request(\"POST\", url, json=payload, headers=headers)\n\ + \nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-org-id\", \"SOME_STRING_VALUE\")\n\ + $headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n$headers.Add(\"content-type\"\ + , \"application/json\")\n$response = Invoke-RestMethod -Uri 'https://console.jumpcloud.com/api/v2/policygroups/{group_id}/associations'\ + \ -Method POST -Headers $headers -ContentType 'application/json' -Body '{\"\ + id\":\"string\",\"op\":\"add\",\"attributes\":{},\"type\":\"system\"}'" + x-codegen-request-body-name: body + /policygroups/{group_id}/members: + get: + tags: + - Graph + - Policy Group Members & Membership + - Policy Groups + summary: List the members of a Policy Group + description: "This endpoint returns the Policy members of a Policy Group.\n\n\ + #### Sample Request\n```\ncurl -X GET https://console.jumpcloud.com/api/v2/policygroups/{GroupID}/members\ + \ \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\ + \ \\\n -H 'x-api-key: {API_KEY}'\n```" + operationId: graph_policyGroupMembersList + parameters: + - name: group_id + in: path + description: ObjectID of the Policy Group. + required: true + style: simple + explode: false + schema: + type: string + - name: limit + in: query + description: The number of records to return at once. Limited to 100. + required: false + style: form + explode: true + schema: + type: integer + default: 10 + - name: skip + in: query + description: The offset into the records to return. + required: false + style: form + explode: true + schema: + minimum: 0 + type: integer + default: 0 + - name: x-org-id + in: header + description: Organization identifier that can be obtained from console settings. + required: false + style: simple + explode: false + schema: + type: string + responses: + "200": + description: OK + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/GraphConnection' + x-content-type: application/json + security: + - x-api-key: [] + x-scopes: + - systems + - systems.readonly + x-codeSamples: + - lang: Shell + source: "curl --request GET \\\n --url 'https://console.jumpcloud.com/api/v2/policygroups/{group_id}/members?limit=10&skip=0'\ + \ \\\n --header 'x-api-key: REPLACE_KEY_VALUE' \\\n --header 'x-org-id:\ + \ SOME_STRING_VALUE'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/policygroups/{group_id}/members\"\ + \n\nquerystring = {\"limit\":\"10\",\"skip\":\"0\"}\n\nheaders = {\n \ + \ \"x-org-id\": \"SOME_STRING_VALUE\",\n \"x-api-key\": \"REPLACE_KEY_VALUE\"\ + \n}\n\nresponse = requests.request(\"GET\", url, headers=headers, params=querystring)\n\ + \nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-org-id\", \"SOME_STRING_VALUE\")\n\ + $headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n$response = Invoke-RestMethod\ + \ -Uri 'https://console.jumpcloud.com/api/v2/policygroups/{group_id}/members?limit=10&skip=0'\ + \ -Method GET -Headers $headers" + post: + tags: + - Graph + - Policy Group Members & Membership + - Policy Groups + summary: Manage the members of a Policy Group + description: "This endpoint allows you to manage the Policy members of a Policy\ + \ Group.\n\n#### Sample Request\n```\ncurl -X POST https://console.jumpcloud.com/api/v2/policygroups/{GroupID}/members\ + \ \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\ + \ \\\n -H 'x-api-key: {API_KEY}' \\\n -d '{\n \"op\": \"add\",\n \"\ + type\": \"policy\",\n \"id\": \"{Policy_ID}\"\n }'\n```" + operationId: graph_policyGroupMembersPost + parameters: + - name: group_id + in: path + description: ObjectID of the Policy Group. + required: true + style: simple + explode: false + schema: + type: string + - name: x-org-id + in: header + description: Organization identifier that can be obtained from console settings. + required: false + style: simple + explode: false + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/GraphOperation-PolicyGroup-Member' + required: false + responses: + "204": + description: OK + content: {} + security: + - x-api-key: [] + x-scopes: + - groups + x-codeSamples: + - lang: Shell + source: "curl --request POST \\\n --url https://console.jumpcloud.com/api/v2/policygroups/{group_id}/members\ + \ \\\n --header 'content-type: application/json' \\\n --header 'x-api-key:\ + \ REPLACE_KEY_VALUE' \\\n --header 'x-org-id: SOME_STRING_VALUE' \\\n \ + \ --data '{\"id\":\"string\",\"op\":\"add\",\"attributes\":{},\"type\":\"\ + policy\"}'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/policygroups/{group_id}/members\"\ + \n\npayload = {\n \"id\": \"string\",\n \"op\": \"add\",\n \"attributes\"\ + : {},\n \"type\": \"policy\"\n}\nheaders = {\n \"x-org-id\": \"SOME_STRING_VALUE\"\ + ,\n \"x-api-key\": \"REPLACE_KEY_VALUE\",\n \"content-type\": \"application/json\"\ + \n}\n\nresponse = requests.request(\"POST\", url, json=payload, headers=headers)\n\ + \nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-org-id\", \"SOME_STRING_VALUE\")\n\ + $headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n$headers.Add(\"content-type\"\ + , \"application/json\")\n$response = Invoke-RestMethod -Uri 'https://console.jumpcloud.com/api/v2/policygroups/{group_id}/members'\ + \ -Method POST -Headers $headers -ContentType 'application/json' -Body '{\"\ + id\":\"string\",\"op\":\"add\",\"attributes\":{},\"type\":\"policy\"}'" + x-codegen-request-body-name: body + /policygroups/{group_id}/membership: + get: + tags: + - Graph + - Policy Group Members & Membership + - Policy Groups + summary: List the Policy Group's membership + description: "This endpoint returns all Policy members that are a member of\ + \ this Policy Group.\n\n#### Sample Request\n```\ncurl -X GET https://console.jumpcloud.com/api/v2/policygroups/{GroupID}/membership\ + \ \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\ + \ \\\n -H 'x-api-key: {API_KEY}'\n```" + operationId: graph_policyGroupMembership + parameters: + - name: group_id + in: path + description: ObjectID of the Policy Group. + required: true + style: simple + explode: false + schema: + type: string + - name: filter + in: query + description: "A filter to apply to the query.\n\n**Filter structure**: `::`.\n\ + \n**field** = Populate with a valid field from an endpoint response.\n\n\ + **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between,\ + \ search, in.\n_Note: v1 operators differ from v2 operators._\n\n**value**\ + \ = Populate with the value you want to search for. Is case sensitive. Supports\ + \ wild cards.\n\n**EX:** `GET /api/v2/groups?filter=name:eq:Test+Group`" + required: false + style: form + explode: false + schema: + type: array + items: + type: string + - name: limit + in: query + description: The number of records to return at once. Limited to 100. + required: false + style: form + explode: true + schema: + type: integer + default: 10 + - name: skip + in: query + description: The offset into the records to return. + required: false + style: form + explode: true + schema: + minimum: 0 + type: integer + default: 0 + - name: sort + in: query + description: "The comma separated fields used to sort the collection.\nDefault\ + \ sort is ascending, prefix with `-` to sort descending.\n" + required: false + style: form + explode: false + schema: + type: array + items: + type: string + - name: x-org-id + in: header + description: Organization identifier that can be obtained from console settings. + required: false + style: simple + explode: false + schema: + type: string + responses: + "200": + description: OK + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/GraphObjectWithPaths' + x-content-type: application/json + security: + - x-api-key: [] + x-scopes: + - systems + - systems.readonly + x-codeSamples: + - lang: Shell + source: "curl --request GET \\\n --url 'https://console.jumpcloud.com/api/v2/policygroups/{group_id}/membership?limit=10&skip=0'\ + \ \\\n --header 'x-api-key: REPLACE_KEY_VALUE' \\\n --header 'x-org-id:\ + \ SOME_STRING_VALUE'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/policygroups/{group_id}/membership\"\ + \n\nquerystring = {\"limit\":\"10\",\"skip\":\"0\"}\n\nheaders = {\n \ + \ \"x-org-id\": \"SOME_STRING_VALUE\",\n \"x-api-key\": \"REPLACE_KEY_VALUE\"\ + \n}\n\nresponse = requests.request(\"GET\", url, headers=headers, params=querystring)\n\ + \nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-org-id\", \"SOME_STRING_VALUE\")\n\ + $headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n$response = Invoke-RestMethod\ + \ -Uri 'https://console.jumpcloud.com/api/v2/policygroups/{group_id}/membership?limit=10&skip=0'\ + \ -Method GET -Headers $headers" + /policygroups/{group_id}/systemgroups: + get: + tags: + - Graph + - Policy Group Associations + - Policy Groups + summary: List the System Groups bound to Policy Groups + description: "This endpoint will return all System Groups bound to a Policy\ + \ Group, either directly or indirectly, essentially traversing the JumpCloud\ + \ Graph for your Organization.\n\nEach element will contain the type, id,\ + \ attributes and paths.\n\nThe `attributes` object is a key/value hash of\ + \ compiled graph attributes for all paths followed.\n\nThe `paths` array enumerates\ + \ each path from this Policy Group to the corresponding System Group; this\ + \ array represents all grouping and/or associations that would have to be\ + \ removed to deprovision the System Group from this Policy Group.\n\nSee `/members`\ + \ and `/associations` endpoints to manage those collections.\n\n#### Sample\ + \ Request\n```\ncurl -X GET https://console.jumpcloud.com/api/v2/policygroups/{GroupID}/systemgroups\ + \ \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\ + \ \\\n -H 'x-api-key: {API_KEY}'\n```" + operationId: graph_policyGroupTraverseSystemGroup + parameters: + - name: group_id + in: path + description: ObjectID of the Policy Group. + required: true + style: simple + explode: false + schema: + type: string + - name: limit + in: query + description: The number of records to return at once. Limited to 100. + required: false + style: form + explode: true + schema: + type: integer + default: 10 + - name: x-org-id + in: header + description: Organization identifier that can be obtained from console settings. + required: false + style: simple + explode: false + schema: + type: string + - name: skip + in: query + description: The offset into the records to return. + required: false + style: form + explode: true + schema: + minimum: 0 + type: integer + default: 0 + - name: filter + in: query + description: "A filter to apply to the query.\n\n**Filter structure**: `::`.\n\ + \n**field** = Populate with a valid field from an endpoint response.\n\n\ + **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between,\ + \ search, in.\n_Note: v1 operators differ from v2 operators._\n\n**value**\ + \ = Populate with the value you want to search for. Is case sensitive. Supports\ + \ wild cards.\n\n**EX:** `GET /api/v2/groups?filter=name:eq:Test+Group`" + required: false + style: form + explode: false + schema: + type: array + items: + type: string + responses: + "200": + description: OK + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/GraphObjectWithPaths' + x-content-type: application/json + security: + - x-api-key: [] + x-scopes: + - groups + - groups.readonly + x-codeSamples: + - lang: Shell + source: "curl --request GET \\\n --url 'https://console.jumpcloud.com/api/v2/policygroups/{group_id}/systemgroups?limit=10&skip=0'\ + \ \\\n --header 'x-api-key: REPLACE_KEY_VALUE' \\\n --header 'x-org-id:\ + \ SOME_STRING_VALUE'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/policygroups/{group_id}/systemgroups\"\ + \n\nquerystring = {\"limit\":\"10\",\"skip\":\"0\"}\n\nheaders = {\n \ + \ \"x-org-id\": \"SOME_STRING_VALUE\",\n \"x-api-key\": \"REPLACE_KEY_VALUE\"\ + \n}\n\nresponse = requests.request(\"GET\", url, headers=headers, params=querystring)\n\ + \nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-org-id\", \"SOME_STRING_VALUE\")\n\ + $headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n$response = Invoke-RestMethod\ + \ -Uri 'https://console.jumpcloud.com/api/v2/policygroups/{group_id}/systemgroups?limit=10&skip=0'\ + \ -Method GET -Headers $headers" + /policygroups/{group_id}/systems: + get: + tags: + - Graph + - Policy Group Associations + - Policy Groups + summary: List the Systems bound to a Policy Group + description: "This endpoint will return all Systems bound to a Policy Group,\ + \ either directly or indirectly, essentially traversing the JumpCloud Graph\ + \ for your Organization.\n\nEach element will contain the type, id, attributes\ + \ and paths\n\nThe `attributes` object is a key/value hash of compiled graph\ + \ attributes for all paths followed.\n\nThe `paths` array enumerates each\ + \ path from this Policy Group to the corresponding System; this array represents\ + \ all grouping and/or associations that would have to be removed to deprovision\ + \ the System from this Policy Group.\n\nSee `/members` and `/associations`\ + \ endpoints to manage those collections.\n\n#### Sample Request\n```\ncurl\ + \ -X GET https://console.jumpcloud.com/api/v2/policygroups/{GroupID}/systems\ + \ \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\ + \ \\\n -H 'x-api-key: {API_KEY}'\n```" + operationId: graph_policyGroupTraverseSystem + parameters: + - name: group_id + in: path + description: ObjectID of the Policy Group. + required: true + style: simple + explode: false + schema: + type: string + - name: limit + in: query + description: The number of records to return at once. Limited to 100. + required: false + style: form + explode: true + schema: + type: integer + default: 10 + - name: x-org-id + in: header + description: Organization identifier that can be obtained from console settings. + required: false + style: simple + explode: false + schema: + type: string + - name: skip + in: query + description: The offset into the records to return. + required: false + style: form + explode: true + schema: + minimum: 0 + type: integer + default: 0 + - name: filter + in: query + description: "A filter to apply to the query.\n\n**Filter structure**: `::`.\n\ + \n**field** = Populate with a valid field from an endpoint response.\n\n\ + **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between,\ + \ search, in.\n_Note: v1 operators differ from v2 operators._\n\n**value**\ + \ = Populate with the value you want to search for. Is case sensitive. Supports\ + \ wild cards.\n\n**EX:** `GET /api/v2/groups?filter=name:eq:Test+Group`" + required: false + style: form + explode: false + schema: + type: array + items: + type: string + responses: + "200": + description: OK + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/GraphObjectWithPaths' + x-content-type: application/json + security: + - x-api-key: [] + x-scopes: + - systems + - systems.readonly + x-codeSamples: + - lang: Shell + source: "curl --request GET \\\n --url 'https://console.jumpcloud.com/api/v2/policygroups/{group_id}/systems?limit=10&skip=0'\ + \ \\\n --header 'x-api-key: REPLACE_KEY_VALUE' \\\n --header 'x-org-id:\ + \ SOME_STRING_VALUE'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/policygroups/{group_id}/systems\"\ + \n\nquerystring = {\"limit\":\"10\",\"skip\":\"0\"}\n\nheaders = {\n \ + \ \"x-org-id\": \"SOME_STRING_VALUE\",\n \"x-api-key\": \"REPLACE_KEY_VALUE\"\ + \n}\n\nresponse = requests.request(\"GET\", url, headers=headers, params=querystring)\n\ + \nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-org-id\", \"SOME_STRING_VALUE\")\n\ + $headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n$response = Invoke-RestMethod\ + \ -Uri 'https://console.jumpcloud.com/api/v2/policygroups/{group_id}/systems?limit=10&skip=0'\ + \ -Method GET -Headers $headers" + /policygroups/{id}: + get: + tags: + - Policy Groups + summary: View an individual Policy Group details + description: "This endpoint returns the details of a Policy Group.\n\n#### Sample\ + \ Request\n```\ncurl -X GET https://console.jumpcloud.com/api/v2/policygroups/{GroupID}\ + \ \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\ + \ \\\n -H 'x-api-key: {API_KEY}'\n```" + operationId: groups_policy_get + parameters: + - name: id + in: path + description: ObjectID of the Policy Group. + required: true + style: simple + explode: false + schema: + type: string + - name: x-org-id + in: header + description: Organization identifier that can be obtained from console settings. + required: false + style: simple + explode: false + schema: + type: string + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/PolicyGroup' + security: + - x-api-key: [] + x-scopes: + - groups + - groups.readonly + x-codeSamples: + - lang: Shell + source: "curl --request GET \\\n --url https://console.jumpcloud.com/api/v2/policygroups/{id}\ + \ \\\n --header 'x-api-key: REPLACE_KEY_VALUE' \\\n --header 'x-org-id:\ + \ SOME_STRING_VALUE'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/policygroups/{id}\"\ + \n\nheaders = {\n \"x-org-id\": \"SOME_STRING_VALUE\",\n \"x-api-key\"\ + : \"REPLACE_KEY_VALUE\"\n}\n\nresponse = requests.request(\"GET\", url,\ + \ headers=headers)\n\nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-org-id\", \"SOME_STRING_VALUE\")\n\ + $headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n$response = Invoke-RestMethod\ + \ -Uri 'https://console.jumpcloud.com/api/v2/policygroups/{id}' -Method\ + \ GET -Headers $headers" + put: + tags: + - Policy Groups + summary: Update a Policy Group + description: "This endpoint allows you to do a full update of the Policy Group.\n\ + \n#### Sample Request\n```\ncurl -X PUT https://console.jumpcloud.com/api/v2/policygroups/{Group_ID}\ + \ \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\ + \ \\\n -H 'x-api-key: {API_KEY}' \\\n -d '{\n \"name\": \"group_update\"\ + \n }'\n```" + operationId: groups_policy_put + parameters: + - name: id + in: path + description: ObjectID of the Policy Group. + required: true + style: simple + explode: false + schema: + type: string + - name: x-org-id + in: header + description: Organization identifier that can be obtained from console settings. + required: false + style: simple + explode: false + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/PolicyGroupData' + required: false + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/PolicyGroup' + security: + - x-api-key: [] + x-scopes: + - groups + x-codeSamples: + - lang: Shell + source: "curl --request PUT \\\n --url https://console.jumpcloud.com/api/v2/policygroups/{id}\ + \ \\\n --header 'content-type: application/json' \\\n --header 'x-api-key:\ + \ REPLACE_KEY_VALUE' \\\n --header 'x-org-id: SOME_STRING_VALUE' \\\n \ + \ --data '{\"name\":\"string\"}'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/policygroups/{id}\"\ + \n\npayload = {\"name\": \"string\"}\nheaders = {\n \"x-org-id\": \"\ + SOME_STRING_VALUE\",\n \"x-api-key\": \"REPLACE_KEY_VALUE\",\n \"\ + content-type\": \"application/json\"\n}\n\nresponse = requests.request(\"\ + PUT\", url, json=payload, headers=headers)\n\nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-org-id\", \"SOME_STRING_VALUE\")\n\ + $headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n$headers.Add(\"content-type\"\ + , \"application/json\")\n$response = Invoke-RestMethod -Uri 'https://console.jumpcloud.com/api/v2/policygroups/{id}'\ + \ -Method PUT -Headers $headers -ContentType 'application/json' -Body '{\"\ + name\":\"string\"}'" + x-codegen-request-body-name: body + delete: + tags: + - Policy Groups + summary: Delete a Policy Group + description: "This endpoint allows you to delete a Policy Group.\n\n#### Sample\ + \ Request\n```\ncurl -X DELETE https://console.jumpcloud.com/api/v2/policygroups/{GroupID}\ + \ \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\ + \ \\\n -H 'x-api-key: {API_KEY}'\n\n```" + operationId: groups_policy_delete + parameters: + - name: id + in: path + description: ObjectID of the Policy Group. + required: true + style: simple + explode: false + schema: + type: string + - name: x-org-id + in: header + description: Organization identifier that can be obtained from console settings. + required: false + style: simple + explode: false + schema: + type: string + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/PolicyGroup' + "204": + description: No Content + content: {} + security: + - x-api-key: [] + x-scopes: + - groups + x-codeSamples: + - lang: Shell + source: "curl --request DELETE \\\n --url https://console.jumpcloud.com/api/v2/policygroups/{id}\ + \ \\\n --header 'x-api-key: REPLACE_KEY_VALUE' \\\n --header 'x-org-id:\ + \ SOME_STRING_VALUE'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/policygroups/{id}\"\ + \n\nheaders = {\n \"x-org-id\": \"SOME_STRING_VALUE\",\n \"x-api-key\"\ + : \"REPLACE_KEY_VALUE\"\n}\n\nresponse = requests.request(\"DELETE\", url,\ + \ headers=headers)\n\nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-org-id\", \"SOME_STRING_VALUE\")\n\ + $headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n$response = Invoke-RestMethod\ + \ -Uri 'https://console.jumpcloud.com/api/v2/policygroups/{id}' -Method\ + \ DELETE -Headers $headers" + /policyresults: + get: + tags: + - Policies + summary: Lists all of the policy results for an organization. + description: "This endpoint returns all policy results for an organization.\n\ + \n##### Sample Request\n\n```\n curl -X GET https://console.jumpcloud.com/api/v2/policyresults\ + \ \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\ + \ \\\n -H 'x-api-key: {API_KEY}'\n ```" + operationId: policyresults_org_list + parameters: + - name: fields + in: query + description: "The comma separated fields included in the returned records.\n\ + If omitted, the default list of fields will be returned.\n" + required: false + style: form + explode: false + schema: + type: array + items: + type: string + - name: filter + in: query + description: "A filter to apply to the query.\n\n**Filter structure**: `::`.\n\ + \n**field** = Populate with a valid field from an endpoint response.\n\n\ + **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between,\ + \ search, in.\n_Note: v1 operators differ from v2 operators._\n\n**value**\ + \ = Populate with the value you want to search for. Is case sensitive. Supports\ + \ wild cards.\n\n**EX:** `GET /api/v2/groups?filter=name:eq:Test+Group`" + required: false + style: form + explode: false + schema: + type: array + items: + type: string + - name: limit + in: query + description: The number of records to return at once. Limited to 100. + required: false + style: form + explode: true + schema: + type: integer + default: 10 + - name: x-org-id + in: header + description: Organization identifier that can be obtained from console settings. + required: false + style: simple + explode: false + schema: + type: string + - name: skip + in: query + description: The offset into the records to return. + required: false + style: form + explode: true + schema: + minimum: 0 + type: integer + default: 0 + - name: sort + in: query + description: "The comma separated fields used to sort the collection.\nDefault\ + \ sort is ascending, prefix with `-` to sort descending.\n" + required: false + style: form + explode: false + schema: + type: array + items: + type: string + responses: + "200": + description: "" + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/PolicyResult' + x-content-type: application/json + security: + - x-api-key: [] + x-scopes: + - systems + - systems.readonly + x-codeSamples: + - lang: Shell + source: "curl --request GET \\\n --url 'https://console.jumpcloud.com/api/v2/policyresults?limit=10&skip=0'\ + \ \\\n --header 'x-api-key: REPLACE_KEY_VALUE' \\\n --header 'x-org-id:\ + \ SOME_STRING_VALUE'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/policyresults\"\ + \n\nquerystring = {\"limit\":\"10\",\"skip\":\"0\"}\n\nheaders = {\n \ + \ \"x-org-id\": \"SOME_STRING_VALUE\",\n \"x-api-key\": \"REPLACE_KEY_VALUE\"\ + \n}\n\nresponse = requests.request(\"GET\", url, headers=headers, params=querystring)\n\ + \nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-org-id\", \"SOME_STRING_VALUE\")\n\ + $headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n$response = Invoke-RestMethod\ + \ -Uri 'https://console.jumpcloud.com/api/v2/policyresults?limit=10&skip=0'\ + \ -Method GET -Headers $headers" + /policyresults/{id}: + get: + tags: + - Policies + summary: Get a specific Policy Result. + description: "This endpoint will return the policy results for a specific policy.\n\ + \n##### Sample Request\n```\ncurl -X GET https://console.jumpcloud.com/api/v2/policyresults/{Policy_ID}\ + \ \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\ + \ \\\n -H 'x-api-key: {API_KEY}'\n ```" + operationId: policyresults_get + parameters: + - name: id + in: path + description: ObjectID of the Policy Result. + required: true + style: simple + explode: false + schema: + type: string + - name: x-org-id + in: header + description: Organization identifier that can be obtained from console settings. + required: false + style: simple + explode: false + schema: + type: string + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/PolicyResult' + security: + - x-api-key: [] + x-scopes: + - systems + - systems.readonly + x-codeSamples: + - lang: Shell + source: "curl --request GET \\\n --url https://console.jumpcloud.com/api/v2/policyresults/{id}\ + \ \\\n --header 'x-api-key: REPLACE_KEY_VALUE' \\\n --header 'x-org-id:\ + \ SOME_STRING_VALUE'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/policyresults/{id}\"\ + \n\nheaders = {\n \"x-org-id\": \"SOME_STRING_VALUE\",\n \"x-api-key\"\ + : \"REPLACE_KEY_VALUE\"\n}\n\nresponse = requests.request(\"GET\", url,\ + \ headers=headers)\n\nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-org-id\", \"SOME_STRING_VALUE\")\n\ + $headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n$response = Invoke-RestMethod\ + \ -Uri 'https://console.jumpcloud.com/api/v2/policyresults/{id}' -Method\ + \ GET -Headers $headers" + /policytemplates: + get: + tags: + - Policytemplates + - Policies + summary: Lists all of the Policy Templates + description: "This endpoint returns all policy templates.\n\n#### Sample Request\n\ + ```\ncurl -X GET https://console.jumpcloud.com/api/v2/policytemplates \\\n\ + \ -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\ + \ \\\n -H 'x-api-key: {API_KEY}'\n ```" + operationId: policytemplates_list + parameters: + - name: fields + in: query + description: "The comma separated fields included in the returned records.\n\ + If omitted, the default list of fields will be returned.\n" + required: false + style: form + explode: false + schema: + type: array + items: + type: string + - name: filter + in: query + description: "A filter to apply to the query.\n\n**Filter structure**: `::`.\n\ + \n**field** = Populate with a valid field from an endpoint response.\n\n\ + **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between,\ + \ search, in.\n_Note: v1 operators differ from v2 operators._\n\n**value**\ + \ = Populate with the value you want to search for. Is case sensitive. Supports\ + \ wild cards.\n\n**EX:** `GET /api/v2/groups?filter=name:eq:Test+Group`" + required: false + style: form + explode: false + schema: + type: array + items: + type: string + - name: limit + in: query + description: The number of records to return at once. Limited to 100. + required: false + style: form + explode: true + schema: + type: integer + default: 10 + - name: skip + in: query + description: The offset into the records to return. + required: false + style: form + explode: true + schema: + minimum: 0 + type: integer + default: 0 + - name: sort + in: query + description: "The comma separated fields used to sort the collection.\nDefault\ + \ sort is ascending, prefix with `-` to sort descending.\n" + required: false + style: form + explode: false + schema: + type: array + items: + type: string + - name: x-org-id + in: header + description: Organization identifier that can be obtained from console settings. + required: false + style: simple + explode: false + schema: + type: string + responses: + "200": + description: OK + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/PolicyTemplate' + x-content-type: application/json + "500": + description: Unexpected error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + security: + - x-api-key: [] + x-scopes: + - systems + - systems.readonly + x-codeSamples: + - lang: Shell + source: "curl --request GET \\\n --url 'https://console.jumpcloud.com/api/v2/policytemplates?limit=10&skip=0'\ + \ \\\n --header 'x-api-key: REPLACE_KEY_VALUE' \\\n --header 'x-org-id:\ + \ SOME_STRING_VALUE'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/policytemplates\"\ + \n\nquerystring = {\"limit\":\"10\",\"skip\":\"0\"}\n\nheaders = {\n \ + \ \"x-org-id\": \"SOME_STRING_VALUE\",\n \"x-api-key\": \"REPLACE_KEY_VALUE\"\ + \n}\n\nresponse = requests.request(\"GET\", url, headers=headers, params=querystring)\n\ + \nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-org-id\", \"SOME_STRING_VALUE\")\n\ + $headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n$response = Invoke-RestMethod\ + \ -Uri 'https://console.jumpcloud.com/api/v2/policytemplates?limit=10&skip=0'\ + \ -Method GET -Headers $headers" + /policytemplates/{id}: + get: + tags: + - Policytemplates + - Policies + summary: Get a specific Policy Template + description: "This endpoint returns a specific policy template.\n\n#### Sample\ + \ Request\n```\n curl -X GET https://console.jumpcloud.com/api/v2/policytemplates/{Policy_Template_ID}\\\ + \n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\ + \ \\\n -H 'x-api-key: {API_KEY}'\n```" + operationId: policytemplates_get + parameters: + - name: id + in: path + description: ObjectID of the Policy Template. + required: true + style: simple + explode: false + schema: + type: string + - name: x-org-id + in: header + description: Organization identifier that can be obtained from console settings. + required: false + style: simple + explode: false + schema: + type: string + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/PolicyTemplateWithDetails' + security: + - x-api-key: [] + x-scopes: + - systems + - systems.readonly + x-codeSamples: + - lang: Shell + source: "curl --request GET \\\n --url https://console.jumpcloud.com/api/v2/policytemplates/{id}\ + \ \\\n --header 'x-api-key: REPLACE_KEY_VALUE' \\\n --header 'x-org-id:\ + \ SOME_STRING_VALUE'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/policytemplates/{id}\"\ + \n\nheaders = {\n \"x-org-id\": \"SOME_STRING_VALUE\",\n \"x-api-key\"\ + : \"REPLACE_KEY_VALUE\"\n}\n\nresponse = requests.request(\"GET\", url,\ + \ headers=headers)\n\nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-org-id\", \"SOME_STRING_VALUE\")\n\ + $headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n$response = Invoke-RestMethod\ + \ -Uri 'https://console.jumpcloud.com/api/v2/policytemplates/{id}' -Method\ + \ GET -Headers $headers" + /providers/{provider_id}: + get: + tags: + - Providers + - Managed Service Provider + summary: Retrieve Provider + description: This endpoint returns details about a provider + operationId: providers_getProvider + parameters: + - name: provider_id + in: path + required: true + style: simple + explode: false + schema: + type: string + - name: fields + in: query + description: "The comma separated fields included in the returned records.\n\ + If omitted, the default list of fields will be returned.\n" + required: false + style: form + explode: false + schema: + type: array + items: + type: string + responses: + "200": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Provider' + "400": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorDetails' + "401": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "403": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "404": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "500": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + security: + - x-api-key: [] + x-scopes: + - providers.readonly + x-codeSamples: + - lang: Shell + source: "curl --request GET \\\n --url https://console.jumpcloud.com/api/v2/providers/{provider_id}\ + \ \\\n --header 'x-api-key: REPLACE_KEY_VALUE'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/providers/{provider_id}\"\ + \n\nheaders = {\"x-api-key\": \"REPLACE_KEY_VALUE\"}\n\nresponse = requests.request(\"\ + GET\", url, headers=headers)\n\nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n\ + $response = Invoke-RestMethod -Uri 'https://console.jumpcloud.com/api/v2/providers/{provider_id}'\ + \ -Method GET -Headers $headers" + /providers/{provider_id}/administrators: + get: + tags: + - Providers + - Managed Service Provider + summary: List Provider Administrators + description: This endpoint returns a list of the Administrators associated with + the Provider. You must be associated with the provider to use this route. + operationId: providers_listAdministrators + parameters: + - name: provider_id + in: path + required: true + style: simple + explode: false + schema: + type: string + - name: fields + in: query + description: "The comma separated fields included in the returned records.\n\ + If omitted, the default list of fields will be returned.\n" + required: false + style: form + explode: false + schema: + type: array + items: + type: string + - name: filter + in: query + description: "A filter to apply to the query.\n\n**Filter structure**: `::`.\n\ + \n**field** = Populate with a valid field from an endpoint response.\n\n\ + **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between,\ + \ search, in.\n_Note: v1 operators differ from v2 operators._\n\n**value**\ + \ = Populate with the value you want to search for. Is case sensitive. Supports\ + \ wild cards.\n\n**EX:** `GET /api/v2/groups?filter=name:eq:Test+Group`" + required: false + style: form + explode: false + schema: + type: array + items: + type: string + - name: limit + in: query + description: The number of records to return at once. Limited to 100. + required: false + style: form + explode: true + schema: + type: integer + default: 10 + - name: skip + in: query + description: The offset into the records to return. + required: false + style: form + explode: true + schema: + minimum: 0 + type: integer + default: 0 + - name: sort + in: query + description: "The comma separated fields used to sort the collection.\nDefault\ + \ sort is ascending, prefix with `-` to sort descending.\n" + required: false + style: form + explode: false + schema: + type: array + items: + type: string + responses: + "200": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/inline_response_200_12' + example: + results: + - _id: 5c3536e9e0a6840001872782 + email: joe@example.com + enableMultiFactor: false + firstname: "" + lastname: "" + organizationAccessTotal: 10 + registered: true + role: 5c3536e9e0a6840001872788 + roleName: Help Desk + - _id: 5c35370ae0a6840001872784 + email: mildred@example.com + enableMultiFactor: false + firstname: "" + lastname: "" + organizationAccessTotal: 1 + registered: true + role: 5c3536e9e0a6840001872799 + roleName: Administrator + totalCount: 2 + "401": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/inline_response_400' + example: + message: Unauthorized + security: + - x-api-key: [] + x-scopes: + - commandrunner.legacy + - providers + - providers.readonly + x-codeSamples: + - lang: Shell + source: "curl --request GET \\\n --url 'https://console.jumpcloud.com/api/v2/providers/{provider_id}/administrators?limit=10&skip=0'\ + \ \\\n --header 'x-api-key: REPLACE_KEY_VALUE'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/providers/{provider_id}/administrators\"\ + \n\nquerystring = {\"limit\":\"10\",\"skip\":\"0\"}\n\nheaders = {\"x-api-key\"\ + : \"REPLACE_KEY_VALUE\"}\n\nresponse = requests.request(\"GET\", url, headers=headers,\ + \ params=querystring)\n\nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n\ + $response = Invoke-RestMethod -Uri 'https://console.jumpcloud.com/api/v2/providers/{provider_id}/administrators?limit=10&skip=0'\ + \ -Method GET -Headers $headers" + post: + tags: + - Providers + - Managed Service Provider + summary: Create a new Provider Administrator + description: This endpoint allows you to create a provider administrator. You + must be associated with the provider to use this route. You must provide either + `role` or `roleName`. + operationId: providers_postAdmins + parameters: + - name: provider_id + in: path + required: true + style: simple + explode: false + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/ProviderAdminReq' + required: false + responses: + "200": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Administrator' + "401": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/inline_response_400' + security: + - x-api-key: [] + x-scopes: + - commandrunner.legacy + - providers + x-codeSamples: + - lang: Shell + source: "curl --request POST \\\n --url https://console.jumpcloud.com/api/v2/providers/{provider_id}/administrators\ + \ \\\n --header 'content-type: application/json' \\\n --header 'x-api-key:\ + \ REPLACE_KEY_VALUE' \\\n --data '{\"bindNoOrgs\":false,\"email\":\"joe@example.com\"\ + ,\"enableMultiFactor\":true,\"firstname\":\"Joe\",\"lastname\":\"Blough\"\ + ,\"role\":\"5c3536e9e0a6840001872799\",\"roleName\":\"Administrator\"}'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/providers/{provider_id}/administrators\"\ + \n\npayload = {\n \"bindNoOrgs\": False,\n \"email\": \"joe@example.com\"\ + ,\n \"enableMultiFactor\": True,\n \"firstname\": \"Joe\",\n \"\ + lastname\": \"Blough\",\n \"role\": \"5c3536e9e0a6840001872799\",\n \ + \ \"roleName\": \"Administrator\"\n}\nheaders = {\n \"x-api-key\":\ + \ \"REPLACE_KEY_VALUE\",\n \"content-type\": \"application/json\"\n}\n\ + \nresponse = requests.request(\"POST\", url, json=payload, headers=headers)\n\ + \nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n\ + $headers.Add(\"content-type\", \"application/json\")\n$response = Invoke-RestMethod\ + \ -Uri 'https://console.jumpcloud.com/api/v2/providers/{provider_id}/administrators'\ + \ -Method POST -Headers $headers -ContentType 'application/json' -Body '{\"\ + bindNoOrgs\":false,\"email\":\"joe@example.com\",\"enableMultiFactor\":true,\"\ + firstname\":\"Joe\",\"lastname\":\"Blough\",\"role\":\"5c3536e9e0a6840001872799\"\ + ,\"roleName\":\"Administrator\"}'" + x-codegen-request-body-name: body + /providers/{provider_id}/administrators/{id}: + delete: + tags: + - Providers + summary: Delete Provider Administrator + description: This endpoint removes an Administrator associated with the Provider. + You must be associated with the provider to use this route. + operationId: providers_removeAdministrator + parameters: + - name: provider_id + in: path + required: true + style: simple + explode: false + schema: + type: string + - name: id + in: path + required: true + style: simple + explode: false + schema: + type: string + responses: + "204": + description: No Content + content: {} + "400": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorDetails' + "401": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "403": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "404": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "500": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + security: + - x-api-key: [] + x-scopes: + - providers + x-codeSamples: + - lang: Shell + source: "curl --request DELETE \\\n --url https://console.jumpcloud.com/api/v2/providers/{provider_id}/administrators/{id}\ + \ \\\n --header 'x-api-key: REPLACE_KEY_VALUE'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/providers/{provider_id}/administrators/{id}\"\ + \n\nheaders = {\"x-api-key\": \"REPLACE_KEY_VALUE\"}\n\nresponse = requests.request(\"\ + DELETE\", url, headers=headers)\n\nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n\ + $response = Invoke-RestMethod -Uri 'https://console.jumpcloud.com/api/v2/providers/{provider_id}/administrators/{id}'\ + \ -Method DELETE -Headers $headers" + /providers/{provider_id}/integrations: + get: + tags: + - Providers + summary: Retrieve Integrations for Provider + description: Retrieves a list of integrations this provider has configured. + You must be associated to the provider to use this endpoint. + operationId: providers_retrieveIntegrations + parameters: + - name: provider_id + in: path + required: true + style: simple + explode: false + schema: + type: string + - name: filter + in: query + description: "A filter to apply to the query.\n\n**Filter structure**: `::`.\n\ + \n**field** = Populate with a valid field from an endpoint response.\n\n\ + **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between,\ + \ search, in.\n_Note: v1 operators differ from v2 operators._\n\n**value**\ + \ = Populate with the value you want to search for. Is case sensitive. Supports\ + \ wild cards.\n\n**EX:** `GET /api/v2/groups?filter=name:eq:Test+Group`" + required: false + style: form + explode: false + schema: + type: array + items: + type: string + - name: limit + in: query + description: The number of records to return at once. Limited to 100. + required: false + style: form + explode: true + schema: + type: integer + default: 10 + - name: skip + in: query + description: The offset into the records to return. + required: false + style: form + explode: true + schema: + minimum: 0 + type: integer + default: 0 + - name: sort + in: query + description: "The comma separated fields used to sort the collection.\nDefault\ + \ sort is ascending, prefix with `-` to sort descending.\n" + required: false + style: form + explode: false + schema: + type: array + items: + type: string + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/IntegrationsResponse' + "400": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorDetails' + "401": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "403": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "404": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "500": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + security: + - x-api-key: [] + x-scopes: + - providers + x-codeSamples: + - lang: Shell + source: "curl --request GET \\\n --url 'https://console.jumpcloud.com/api/v2/providers/{provider_id}/integrations?limit=10&skip=0'\ + \ \\\n --header 'x-api-key: REPLACE_KEY_VALUE'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/providers/{provider_id}/integrations\"\ + \n\nquerystring = {\"limit\":\"10\",\"skip\":\"0\"}\n\nheaders = {\"x-api-key\"\ + : \"REPLACE_KEY_VALUE\"}\n\nresponse = requests.request(\"GET\", url, headers=headers,\ + \ params=querystring)\n\nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n\ + $response = Invoke-RestMethod -Uri 'https://console.jumpcloud.com/api/v2/providers/{provider_id}/integrations?limit=10&skip=0'\ + \ -Method GET -Headers $headers" + /providers/{provider_id}/integrations/autotask: + post: + tags: + - Providers + summary: Creates a new Autotask integration for the provider + description: Creates a new Autotask integration for the provider. You must be + associated with the provider to use this route. A 422 Unprocessable Entity + response means the server failed to validate with Autotask. + operationId: autotask_createConfiguration + parameters: + - name: provider_id + in: path + required: true + style: simple + explode: false + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AutotaskIntegrationReq' + required: false + responses: + "201": + description: Created + content: + application/json: + schema: + $ref: '#/components/schemas/inline_response_201' + "400": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorDetails' + "401": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "403": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "404": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "409": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "422": + description: Unprocessable Entity. The server failed to validate credentials + with ConnectWise. + content: + application/json: + schema: + type: object + x-content-type: application/json + "500": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + security: + - x-api-key: [] + x-scopes: + - providers + x-codeSamples: + - lang: Shell + source: "curl --request POST \\\n --url https://console.jumpcloud.com/api/v2/providers/{provider_id}/integrations/autotask\ + \ \\\n --header 'content-type: application/json' \\\n --header 'x-api-key:\ + \ REPLACE_KEY_VALUE' \\\n --data '{\"secret\":\"string\",\"username\":\"\ + string\"}'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/providers/{provider_id}/integrations/autotask\"\ + \n\npayload = {\n \"secret\": \"string\",\n \"username\": \"string\"\ + \n}\nheaders = {\n \"x-api-key\": \"REPLACE_KEY_VALUE\",\n \"content-type\"\ + : \"application/json\"\n}\n\nresponse = requests.request(\"POST\", url,\ + \ json=payload, headers=headers)\n\nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n\ + $headers.Add(\"content-type\", \"application/json\")\n$response = Invoke-RestMethod\ + \ -Uri 'https://console.jumpcloud.com/api/v2/providers/{provider_id}/integrations/autotask'\ + \ -Method POST -Headers $headers -ContentType 'application/json' -Body '{\"\ + secret\":\"string\",\"username\":\"string\"}'" + x-codegen-request-body-name: body + /providers/{provider_id}/integrations/autotask/alerts/configuration: + get: + tags: + - Providers + summary: Get all Autotask ticketing alert configurations for a provider + description: Get all Autotask ticketing alert configurations for a provider. + operationId: autotask_retrieveAllAlertConfigurations + parameters: + - name: provider_id + in: path + required: true + style: simple + explode: false + schema: + type: string + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AutotaskTicketingAlertConfigurationList' + "400": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorDetails' + "401": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "403": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "404": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "500": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + security: + - x-api-key: [] + x-scopes: + - providers + x-codeSamples: + - lang: Shell + source: "curl --request GET \\\n --url https://console.jumpcloud.com/api/v2/providers/{provider_id}/integrations/autotask/alerts/configuration\ + \ \\\n --header 'x-api-key: REPLACE_KEY_VALUE'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/providers/{provider_id}/integrations/autotask/alerts/configuration\"\ + \n\nheaders = {\"x-api-key\": \"REPLACE_KEY_VALUE\"}\n\nresponse = requests.request(\"\ + GET\", url, headers=headers)\n\nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n\ + $response = Invoke-RestMethod -Uri 'https://console.jumpcloud.com/api/v2/providers/{provider_id}/integrations/autotask/alerts/configuration'\ + \ -Method GET -Headers $headers" + /providers/{provider_id}/integrations/autotask/alerts/configuration/options: + get: + tags: + - Providers + summary: Get all Autotask ticketing alert configuration options for a provider + description: Get all Autotask ticketing alert configuration options for a provider. + operationId: autotask_retrieveAllAlertConfigurationOptions + parameters: + - name: provider_id + in: path + required: true + style: simple + explode: false + schema: + type: string + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AutotaskTicketingAlertConfigurationOptions' + "400": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorDetails' + "401": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "403": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "404": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "500": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + security: + - x-api-key: [] + x-scopes: + - providers + x-codeSamples: + - lang: Shell + source: "curl --request GET \\\n --url https://console.jumpcloud.com/api/v2/providers/{provider_id}/integrations/autotask/alerts/configuration/options\ + \ \\\n --header 'x-api-key: REPLACE_KEY_VALUE'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/providers/{provider_id}/integrations/autotask/alerts/configuration/options\"\ + \n\nheaders = {\"x-api-key\": \"REPLACE_KEY_VALUE\"}\n\nresponse = requests.request(\"\ + GET\", url, headers=headers)\n\nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n\ + $response = Invoke-RestMethod -Uri 'https://console.jumpcloud.com/api/v2/providers/{provider_id}/integrations/autotask/alerts/configuration/options'\ + \ -Method GET -Headers $headers" + /providers/{provider_id}/integrations/autotask/alerts/{alert_UUID}/configuration: + put: + tags: + - Providers + summary: Update an Autotask ticketing alert's configuration + description: Update an Autotask ticketing alert's configuration + operationId: autotask_updateAlertConfiguration + parameters: + - name: provider_id + in: path + required: true + style: simple + explode: false + schema: + type: string + - name: alert_UUID + in: path + required: true + style: simple + explode: false + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/AutotaskTicketingAlertConfigurationRequest' + required: false + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/AutotaskTicketingAlertConfiguration' + "400": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorDetails' + "401": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "403": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "404": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "500": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + security: + - x-api-key: [] + x-scopes: + - providers + x-codeSamples: + - lang: Shell + source: "curl --request PUT \\\n --url https://console.jumpcloud.com/api/v2/providers/{provider_id}/integrations/autotask/alerts/{alert_UUID}/configuration\ + \ \\\n --header 'content-type: application/json' \\\n --header 'x-api-key:\ + \ REPLACE_KEY_VALUE' \\\n --data '{\"destination\":\"queue\",\"dueDays\"\ + :0,\"priority\":{\"id\":0,\"name\":\"string\"},\"queue\":{\"id\":0,\"name\"\ + :\"string\"},\"resource\":{\"id\":0,\"name\":\"string\",\"role\":{\"id\"\ + :0,\"name\":\"string\"}},\"shouldCreateTickets\":true,\"source\":{\"id\"\ + :0,\"name\":\"string\"},\"status\":{\"id\":0,\"name\":\"string\"}}'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/providers/{provider_id}/integrations/autotask/alerts/{alert_UUID}/configuration\"\ + \n\npayload = {\n \"destination\": \"queue\",\n \"dueDays\": 0,\n\ + \ \"priority\": {\n \"id\": 0,\n \"name\": \"string\"\n\ + \ },\n \"queue\": {\n \"id\": 0,\n \"name\": \"string\"\ + \n },\n \"resource\": {\n \"id\": 0,\n \"name\": \"\ + string\",\n \"role\": {\n \"id\": 0,\n \"name\"\ + : \"string\"\n }\n },\n \"shouldCreateTickets\": True,\n \ + \ \"source\": {\n \"id\": 0,\n \"name\": \"string\"\n \ + \ },\n \"status\": {\n \"id\": 0,\n \"name\": \"string\"\ + \n }\n}\nheaders = {\n \"x-api-key\": \"REPLACE_KEY_VALUE\",\n \ + \ \"content-type\": \"application/json\"\n}\n\nresponse = requests.request(\"\ + PUT\", url, json=payload, headers=headers)\n\nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n\ + $headers.Add(\"content-type\", \"application/json\")\n$response = Invoke-RestMethod\ + \ -Uri 'https://console.jumpcloud.com/api/v2/providers/{provider_id}/integrations/autotask/alerts/{alert_UUID}/configuration'\ + \ -Method PUT -Headers $headers -ContentType 'application/json' -Body '{\"\ + destination\":\"queue\",\"dueDays\":0,\"priority\":{\"id\":0,\"name\":\"\ + string\"},\"queue\":{\"id\":0,\"name\":\"string\"},\"resource\":{\"id\"\ + :0,\"name\":\"string\",\"role\":{\"id\":0,\"name\":\"string\"}},\"shouldCreateTickets\"\ + :true,\"source\":{\"id\":0,\"name\":\"string\"},\"status\":{\"id\":0,\"\ + name\":\"string\"}}'" + x-codegen-request-body-name: body + /providers/{provider_id}/integrations/connectwise: + post: + tags: + - Providers + summary: Creates a new ConnectWise integration for the provider + description: Creates a new ConnectWise integration for the provider. You must + be associated with the provider to use this route. A 422 Unprocessable Entity + response means the server failed to validate with ConnectWise. + operationId: connectwise_createConfiguration + parameters: + - name: provider_id + in: path + required: true + style: simple + explode: false + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/ConnectwiseIntegrationReq' + required: false + responses: + "201": + description: Created + content: + application/json: + schema: + $ref: '#/components/schemas/inline_response_201' + "400": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorDetails' + "401": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "403": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "404": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "409": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "422": + description: Unprocessable Entity. The server failed to validate credentials + with ConnectWise. + content: + application/json: + schema: + type: object + x-content-type: application/json + "500": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + security: + - x-api-key: [] + x-scopes: + - providers + x-codeSamples: + - lang: Shell + source: "curl --request POST \\\n --url https://console.jumpcloud.com/api/v2/providers/{provider_id}/integrations/connectwise\ + \ \\\n --header 'content-type: application/json' \\\n --header 'x-api-key:\ + \ REPLACE_KEY_VALUE' \\\n --data '{\"companyId\":\"string\",\"privateKey\"\ + :\"string\",\"publicKey\":\"string\",\"url\":\"string\"}'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/providers/{provider_id}/integrations/connectwise\"\ + \n\npayload = {\n \"companyId\": \"string\",\n \"privateKey\": \"\ + string\",\n \"publicKey\": \"string\",\n \"url\": \"string\"\n}\n\ + headers = {\n \"x-api-key\": \"REPLACE_KEY_VALUE\",\n \"content-type\"\ + : \"application/json\"\n}\n\nresponse = requests.request(\"POST\", url,\ + \ json=payload, headers=headers)\n\nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n\ + $headers.Add(\"content-type\", \"application/json\")\n$response = Invoke-RestMethod\ + \ -Uri 'https://console.jumpcloud.com/api/v2/providers/{provider_id}/integrations/connectwise'\ + \ -Method POST -Headers $headers -ContentType 'application/json' -Body '{\"\ + companyId\":\"string\",\"privateKey\":\"string\",\"publicKey\":\"string\"\ + ,\"url\":\"string\"}'" + x-codegen-request-body-name: body + /providers/{provider_id}/integrations/connectwise/alerts/configuration: + get: + tags: + - Providers + summary: Get all ConnectWise ticketing alert configurations for a provider + description: Get all ConnectWise ticketing alert configurations for a provider. + operationId: connectwise_retrieveAllAlertConfigurations + parameters: + - name: provider_id + in: path + required: true + style: simple + explode: false + schema: + type: string + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/ConnectWiseTicketingAlertConfigurationList' + "400": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorDetails' + "401": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "403": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "404": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "500": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + security: + - x-api-key: [] + x-scopes: + - providers + x-codeSamples: + - lang: Shell + source: "curl --request GET \\\n --url https://console.jumpcloud.com/api/v2/providers/{provider_id}/integrations/connectwise/alerts/configuration\ + \ \\\n --header 'x-api-key: REPLACE_KEY_VALUE'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/providers/{provider_id}/integrations/connectwise/alerts/configuration\"\ + \n\nheaders = {\"x-api-key\": \"REPLACE_KEY_VALUE\"}\n\nresponse = requests.request(\"\ + GET\", url, headers=headers)\n\nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n\ + $response = Invoke-RestMethod -Uri 'https://console.jumpcloud.com/api/v2/providers/{provider_id}/integrations/connectwise/alerts/configuration'\ + \ -Method GET -Headers $headers" + /providers/{provider_id}/integrations/connectwise/alerts/configuration/options: + get: + tags: + - Providers + summary: Get all ConnectWise ticketing alert configuration options for a provider + description: Get all ConnectWise ticketing alert configuration options for a + provider. + operationId: connectwise_retrieveAllAlertConfigurationOptions + parameters: + - name: provider_id + in: path + required: true + style: simple + explode: false + schema: + type: string + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/ConnectWiseTicketingAlertConfigurationOptions' + "400": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorDetails' + "401": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "403": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "404": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "500": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + security: + - x-api-key: [] + x-scopes: + - providers + x-codeSamples: + - lang: Shell + source: "curl --request GET \\\n --url https://console.jumpcloud.com/api/v2/providers/{provider_id}/integrations/connectwise/alerts/configuration/options\ + \ \\\n --header 'x-api-key: REPLACE_KEY_VALUE'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/providers/{provider_id}/integrations/connectwise/alerts/configuration/options\"\ + \n\nheaders = {\"x-api-key\": \"REPLACE_KEY_VALUE\"}\n\nresponse = requests.request(\"\ + GET\", url, headers=headers)\n\nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n\ + $response = Invoke-RestMethod -Uri 'https://console.jumpcloud.com/api/v2/providers/{provider_id}/integrations/connectwise/alerts/configuration/options'\ + \ -Method GET -Headers $headers" + /providers/{provider_id}/integrations/connectwise/alerts/{alert_UUID}/configuration: + put: + tags: + - Providers + summary: Update a ConnectWise ticketing alert's configuration + description: Update a ConnectWise ticketing alert's configuration. + operationId: connectwise_updateAlertConfiguration + parameters: + - name: provider_id + in: path + required: true + style: simple + explode: false + schema: + type: string + - name: alert_UUID + in: path + required: true + style: simple + explode: false + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/ConnectWiseTicketingAlertConfigurationRequest' + required: false + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/ConnectWiseTicketingAlertConfiguration' + "400": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorDetails' + "401": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "403": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "404": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "500": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + security: + - x-api-key: [] + x-scopes: + - providers + x-codeSamples: + - lang: Shell + source: "curl --request PUT \\\n --url https://console.jumpcloud.com/api/v2/providers/{provider_id}/integrations/connectwise/alerts/{alert_UUID}/configuration\ + \ \\\n --header 'content-type: application/json' \\\n --header 'x-api-key:\ + \ REPLACE_KEY_VALUE' \\\n --data '{\"dueDays\":0,\"priority\":{\"id\":0,\"\ + name\":\"string\"},\"shouldCreateTickets\":true,\"source\":{\"id\":0,\"\ + name\":\"string\"}}'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/providers/{provider_id}/integrations/connectwise/alerts/{alert_UUID}/configuration\"\ + \n\npayload = {\n \"dueDays\": 0,\n \"priority\": {\n \"id\"\ + : 0,\n \"name\": \"string\"\n },\n \"shouldCreateTickets\"\ + : True,\n \"source\": {\n \"id\": 0,\n \"name\": \"string\"\ + \n }\n}\nheaders = {\n \"x-api-key\": \"REPLACE_KEY_VALUE\",\n \ + \ \"content-type\": \"application/json\"\n}\n\nresponse = requests.request(\"\ + PUT\", url, json=payload, headers=headers)\n\nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n\ + $headers.Add(\"content-type\", \"application/json\")\n$response = Invoke-RestMethod\ + \ -Uri 'https://console.jumpcloud.com/api/v2/providers/{provider_id}/integrations/connectwise/alerts/{alert_UUID}/configuration'\ + \ -Method PUT -Headers $headers -ContentType 'application/json' -Body '{\"\ + dueDays\":0,\"priority\":{\"id\":0,\"name\":\"string\"},\"shouldCreateTickets\"\ + :true,\"source\":{\"id\":0,\"name\":\"string\"}}'" + x-codegen-request-body-name: body + /providers/{provider_id}/integrations/ticketing/alerts: + get: + tags: + - Providers + summary: Get all ticketing alerts available for a provider's ticketing integration. + description: Get all ticketing alerts available for a provider's ticketing integration. + operationId: mtpIntegration_retrieveAlerts + parameters: + - name: provider_id + in: path + required: true + style: simple + explode: false + schema: + type: string + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/TicketingIntegrationAlertsResp' + "400": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorDetails' + "401": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "403": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "404": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "500": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + security: + - x-api-key: [] + x-scopes: + - providers + x-codeSamples: + - lang: Shell + source: "curl --request GET \\\n --url https://console.jumpcloud.com/api/v2/providers/{provider_id}/integrations/ticketing/alerts\ + \ \\\n --header 'x-api-key: REPLACE_KEY_VALUE'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/providers/{provider_id}/integrations/ticketing/alerts\"\ + \n\nheaders = {\"x-api-key\": \"REPLACE_KEY_VALUE\"}\n\nresponse = requests.request(\"\ + GET\", url, headers=headers)\n\nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n\ + $response = Invoke-RestMethod -Uri 'https://console.jumpcloud.com/api/v2/providers/{provider_id}/integrations/ticketing/alerts'\ + \ -Method GET -Headers $headers" + /providers/{provider_id}/invoices: + get: + tags: + - Providers + - Managed Service Provider + summary: List a provider's invoices. + description: Retrieves a list of invoices for this provider. You must be associated + to the provider to use this endpoint. + operationId: providers_retrieveInvoices + parameters: + - name: provider_id + in: path + required: true + style: simple + explode: false + schema: + type: string + - name: skip + in: query + description: The offset into the records to return. + required: false + style: form + explode: true + schema: + minimum: 0 + type: integer + default: 0 + - name: sort + in: query + description: "The comma separated fields used to sort the collection.\nDefault\ + \ sort is ascending, prefix with `-` to sort descending.\n" + required: false + style: form + explode: false + schema: + type: array + items: + type: string + - name: limit + in: query + description: The number of records to return at once. Limited to 100. + required: false + style: form + explode: true + schema: + type: integer + default: 10 + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/ProviderInvoiceResponse' + "400": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorDetails' + "401": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "403": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "404": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "500": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + security: + - x-api-key: [] + x-scopes: + - providers + x-codeSamples: + - lang: Shell + source: "curl --request GET \\\n --url 'https://console.jumpcloud.com/api/v2/providers/{provider_id}/invoices?skip=0&limit=10'\ + \ \\\n --header 'x-api-key: REPLACE_KEY_VALUE'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/providers/{provider_id}/invoices\"\ + \n\nquerystring = {\"skip\":\"0\",\"limit\":\"10\"}\n\nheaders = {\"x-api-key\"\ + : \"REPLACE_KEY_VALUE\"}\n\nresponse = requests.request(\"GET\", url, headers=headers,\ + \ params=querystring)\n\nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n\ + $response = Invoke-RestMethod -Uri 'https://console.jumpcloud.com/api/v2/providers/{provider_id}/invoices?skip=0&limit=10'\ + \ -Method GET -Headers $headers" + /providers/{provider_id}/invoices/{ID}: + get: + tags: + - Providers + - Managed Service Provider + summary: Download a provider's invoice. + description: Retrieves an invoice for this provider. You must be associated + to the provider to use this endpoint. + operationId: providers_retrieveInvoice + parameters: + - name: provider_id + in: path + required: true + style: simple + explode: false + schema: + type: string + - name: ID + in: path + required: true + style: simple + explode: false + schema: + type: string + responses: + "200": + description: OK + content: + application/pdf: + schema: + type: string + format: binary + x-content-type: application/pdf + "400": + description: "" + content: + application/pdf: + schema: + $ref: '#/components/schemas/ErrorDetails' + "401": + description: "" + content: + application/pdf: + schema: + $ref: '#/components/schemas/Error' + "403": + description: "" + content: + application/pdf: + schema: + $ref: '#/components/schemas/Error' + "404": + description: "" + content: + application/pdf: + schema: + $ref: '#/components/schemas/Error' + "500": + description: "" + content: + application/pdf: + schema: + $ref: '#/components/schemas/Error' + security: + - x-api-key: [] + x-scopes: + - providers + x-codeSamples: + - lang: Shell + source: "curl --request GET \\\n --url https://console.jumpcloud.com/api/v2/providers/{provider_id}/invoices/{ID}\ + \ \\\n --header 'x-api-key: REPLACE_KEY_VALUE'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/providers/{provider_id}/invoices/{ID}\"\ + \n\nheaders = {\"x-api-key\": \"REPLACE_KEY_VALUE\"}\n\nresponse = requests.request(\"\ + GET\", url, headers=headers)\n\nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n\ + $response = Invoke-RestMethod -Uri 'https://console.jumpcloud.com/api/v2/providers/{provider_id}/invoices/{ID}'\ + \ -Method GET -Headers $headers" + /providers/{provider_id}/organizations: + get: + tags: + - Providers + - Managed Service Provider + summary: List Provider Organizations + description: This endpoint returns a list of the Organizations associated with + the Provider. You must be associated with the provider to use this route. + operationId: providers_listOrganizations + parameters: + - name: provider_id + in: path + required: true + style: simple + explode: false + schema: + type: string + - name: fields + in: query + description: "The comma separated fields included in the returned records.\n\ + If omitted, the default list of fields will be returned.\n" + required: false + style: form + explode: false + schema: + type: array + items: + type: string + - name: filter + in: query + description: "A filter to apply to the query.\n\n**Filter structure**: `::`.\n\ + \n**field** = Populate with a valid field from an endpoint response.\n\n\ + **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between,\ + \ search, in.\n_Note: v1 operators differ from v2 operators._\n\n**value**\ + \ = Populate with the value you want to search for. Is case sensitive. Supports\ + \ wild cards.\n\n**EX:** `GET /api/v2/groups?filter=name:eq:Test+Group`" + required: false + style: form + explode: false + schema: + type: array + items: + type: string + - name: limit + in: query + description: The number of records to return at once. Limited to 100. + required: false + style: form + explode: true + schema: + type: integer + default: 10 + - name: skip + in: query + description: The offset into the records to return. + required: false + style: form + explode: true + schema: + minimum: 0 + type: integer + default: 0 + - name: sort + in: query + description: "The comma separated fields used to sort the collection.\nDefault\ + \ sort is ascending, prefix with `-` to sort descending.\n" + required: false + style: form + explode: false + schema: + type: array + items: + type: string + responses: + "200": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/inline_response_200_13' + "400": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorDetails' + "401": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "403": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "404": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "500": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + security: + - x-api-key: [] + x-scopes: + - providers + x-codeSamples: + - lang: Shell + source: "curl --request GET \\\n --url 'https://console.jumpcloud.com/api/v2/providers/{provider_id}/organizations?limit=10&skip=0'\ + \ \\\n --header 'x-api-key: REPLACE_KEY_VALUE'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/providers/{provider_id}/organizations\"\ + \n\nquerystring = {\"limit\":\"10\",\"skip\":\"0\"}\n\nheaders = {\"x-api-key\"\ + : \"REPLACE_KEY_VALUE\"}\n\nresponse = requests.request(\"GET\", url, headers=headers,\ + \ params=querystring)\n\nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n\ + $response = Invoke-RestMethod -Uri 'https://console.jumpcloud.com/api/v2/providers/{provider_id}/organizations?limit=10&skip=0'\ + \ -Method GET -Headers $headers" + /providers/{provider_id}/organizations/{id}: + put: + tags: + - Providers + - Managed Service Provider + summary: Update Provider Organization + description: This endpoint updates a provider's organization + operationId: providerOrganizations_updateOrg + parameters: + - name: provider_id + in: path + required: true + style: simple + explode: false + schema: + type: string + - name: id + in: path + required: true + style: simple + explode: false + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Organization' + required: false + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/Organization' + security: + - x-api-key: [] + x-scopes: + - organizations + - organizations.billing + x-codeSamples: + - lang: Shell + source: "curl --request PUT \\\n --url https://console.jumpcloud.com/api/v2/providers/{provider_id}/organizations/{id}\ + \ \\\n --header 'content-type: application/json' \\\n --header 'x-api-key:\ + \ REPLACE_KEY_VALUE' \\\n --data '{\"id\":\"624d9eae6849cf3b3f93dc56\"\ + ,\"name\":\"Acme Inc\"}'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/providers/{provider_id}/organizations/{id}\"\ + \n\npayload = {\n \"id\": \"624d9eae6849cf3b3f93dc56\",\n \"name\"\ + : \"Acme Inc\"\n}\nheaders = {\n \"x-api-key\": \"REPLACE_KEY_VALUE\"\ + ,\n \"content-type\": \"application/json\"\n}\n\nresponse = requests.request(\"\ + PUT\", url, json=payload, headers=headers)\n\nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n\ + $headers.Add(\"content-type\", \"application/json\")\n$response = Invoke-RestMethod\ + \ -Uri 'https://console.jumpcloud.com/api/v2/providers/{provider_id}/organizations/{id}'\ + \ -Method PUT -Headers $headers -ContentType 'application/json' -Body '{\"\ + id\":\"624d9eae6849cf3b3f93dc56\",\"name\":\"Acme Inc\"}'" + x-codegen-request-body-name: body + /queuedcommand/workflows: + get: + tags: + - Commands + summary: Fetch the queued Commands for an Organization + description: "This endpoint will return all queued Commands for an Organization.\n\ + \nEach element will contain the workflow ID, the command name, the launch\ + \ type (e.g. manual, triggered, or scheduled), the target OS, the number of\ + \ assigned devices, and the number of pending devices that have not yet ran\ + \ the command.\n\n#### Sample Request\n```\ncurl -X GET https://console.jumpcloud.com/api/v2/queuedcommand/workflows\ + \ \\\n -H 'accept: application/json' \\\n -H 'content-type: application/json'\ + \ \\\n -H 'x-api-key: {API_KEY}'\n```" + operationId: commands_getQueuedCommandsByWorkflow + parameters: + - name: x-org-id + in: header + description: Organization identifier that can be obtained from console settings. + required: false + style: simple + explode: false + schema: + type: string + - name: limit + in: query + required: false + style: form + explode: true + schema: + maximum: 100 + minimum: 0 + type: integer + default: 10 + - name: filter + in: query + description: "A filter to apply to the query.\n\n**Filter structure**: `::`.\n\ + \n**field** = Populate with a valid field from an endpoint response.\n\n\ + **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between,\ + \ search, in.\n_Note: v1 operators differ from v2 operators._\n\n**value**\ + \ = Populate with the value you want to search for. Is case sensitive. Supports\ + \ wild cards.\n\n**EX:** `GET /api/v2/groups?filter=name:eq:Test+Group`" + required: false + style: form + explode: false + schema: + type: array + items: + type: string + - name: skip + in: query + description: The offset into the records to return. + required: false + style: form + explode: true + schema: + minimum: 0 + type: integer + default: 0 + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/QueuedCommandList' + "401": + description: Unauthorized + content: {} + security: + - x-api-key: [] + x-scopes: + - commands + - commands.readonly + x-codeSamples: + - lang: Shell + source: "curl --request GET \\\n --url 'https://console.jumpcloud.com/api/v2/queuedcommand/workflows?limit=10&skip=0'\ + \ \\\n --header 'x-api-key: REPLACE_KEY_VALUE' \\\n --header 'x-org-id:\ + \ SOME_STRING_VALUE'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/queuedcommand/workflows\"\ + \n\nquerystring = {\"limit\":\"10\",\"skip\":\"0\"}\n\nheaders = {\n \ + \ \"x-org-id\": \"SOME_STRING_VALUE\",\n \"x-api-key\": \"REPLACE_KEY_VALUE\"\ + \n}\n\nresponse = requests.request(\"GET\", url, headers=headers, params=querystring)\n\ + \nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-org-id\", \"SOME_STRING_VALUE\")\n\ + $headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n$response = Invoke-RestMethod\ + \ -Uri 'https://console.jumpcloud.com/api/v2/queuedcommand/workflows?limit=10&skip=0'\ + \ -Method GET -Headers $headers" + /radiusservers/{radiusserver_id}/associations: + get: + tags: + - Graph + - RADIUS Servers + summary: List the associations of a RADIUS Server + description: "This endpoint returns the _direct_ associations of a Radius Server.\n\ + \nA direct association can be a non-homogeneous relationship between 2 different\ + \ objects, for example Radius Servers and Users.\n\n#### Sample Request\n\ + ```\ncurl -X GET https://console.jumpcloud.com/api/v2/radiusservers/{RADIUS_ID}/associations?targets=user_group\ + \ \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\ + \ \\\n -H 'x-api-key: {API_KEY}'\n```" + operationId: graph_radiusServerAssociationsList + parameters: + - name: radiusserver_id + in: path + description: ObjectID of the Radius Server. + required: true + style: simple + explode: false + schema: + type: string + - name: targets + in: query + description: Targets which a "radius_server" can be associated to. + required: true + style: form + explode: false + schema: + type: array + items: + type: string + enum: + - user + - user_group + - name: limit + in: query + description: The number of records to return at once. Limited to 100. + required: false + style: form + explode: true + schema: + type: integer + default: 10 + - name: skip + in: query + description: The offset into the records to return. + required: false + style: form + explode: true + schema: + minimum: 0 + type: integer + default: 0 + - name: x-org-id + in: header + description: Organization identifier that can be obtained from console settings. + required: false + style: simple + explode: false + schema: + type: string + responses: + "200": + description: OK + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/GraphConnection' + x-content-type: application/json + security: + - x-api-key: [] + x-scopes: + - radius + - radius.readonly + x-codeSamples: + - lang: Shell + source: "curl --request GET \\\n --url 'https://console.jumpcloud.com/api/v2/radiusservers/{radiusserver_id}/associations?targets=SOME_ARRAY_VALUE&limit=10&skip=0'\ + \ \\\n --header 'x-api-key: REPLACE_KEY_VALUE' \\\n --header 'x-org-id:\ + \ SOME_STRING_VALUE'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/radiusservers/{radiusserver_id}/associations\"\ + \n\nquerystring = {\"targets\":\"SOME_ARRAY_VALUE\",\"limit\":\"10\",\"\ + skip\":\"0\"}\n\nheaders = {\n \"x-org-id\": \"SOME_STRING_VALUE\",\n\ + \ \"x-api-key\": \"REPLACE_KEY_VALUE\"\n}\n\nresponse = requests.request(\"\ + GET\", url, headers=headers, params=querystring)\n\nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-org-id\", \"SOME_STRING_VALUE\")\n\ + $headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n$response = Invoke-RestMethod\ + \ -Uri 'https://console.jumpcloud.com/api/v2/radiusservers/{radiusserver_id}/associations?targets=SOME_ARRAY_VALUE&limit=10&skip=0'\ + \ -Method GET -Headers $headers" + post: + tags: + - Graph + - RADIUS Servers + summary: Manage the associations of a RADIUS Server + description: "This endpoint allows you to manage the _direct_ associations of\ + \ a Radius Server.\n\nA direct association can be a non-homogeneous relationship\ + \ between 2 different objects, for example Radius Servers and Users.\n\n####\ + \ Sample Request\n```\ncurl -X POST https://console.jumpcloud.com/api/v2/radiusservers/{RADIUS_ID}/associations\ + \ \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\ + \ \\\n -H 'x-api-key: {API_KEY}' \\\n -d '{\n\t\n\"type\":\"user\", \n\"\ + id\":\"{USER_ID}\", \n\"op\":\"add\"\n\t\n}'\n```" + operationId: graph_radiusServerAssociationsPost + parameters: + - name: radiusserver_id + in: path + description: ObjectID of the Radius Server. + required: true + style: simple + explode: false + schema: + type: string + - name: x-org-id + in: header + description: Organization identifier that can be obtained from console settings. + required: false + style: simple + explode: false + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/GraphOperation-RadiusServer' + required: false + responses: + "204": + description: OK + content: {} + security: + - x-api-key: [] + x-scopes: + - radius + x-codeSamples: + - lang: Shell + source: "curl --request POST \\\n --url https://console.jumpcloud.com/api/v2/radiusservers/{radiusserver_id}/associations\ + \ \\\n --header 'content-type: application/json' \\\n --header 'x-api-key:\ + \ REPLACE_KEY_VALUE' \\\n --header 'x-org-id: SOME_STRING_VALUE' \\\n \ + \ --data '{\"id\":\"string\",\"op\":\"add\",\"attributes\":{},\"type\":\"\ + user\"}'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/radiusservers/{radiusserver_id}/associations\"\ + \n\npayload = {\n \"id\": \"string\",\n \"op\": \"add\",\n \"attributes\"\ + : {},\n \"type\": \"user\"\n}\nheaders = {\n \"x-org-id\": \"SOME_STRING_VALUE\"\ + ,\n \"x-api-key\": \"REPLACE_KEY_VALUE\",\n \"content-type\": \"application/json\"\ + \n}\n\nresponse = requests.request(\"POST\", url, json=payload, headers=headers)\n\ + \nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-org-id\", \"SOME_STRING_VALUE\")\n\ + $headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n$headers.Add(\"content-type\"\ + , \"application/json\")\n$response = Invoke-RestMethod -Uri 'https://console.jumpcloud.com/api/v2/radiusservers/{radiusserver_id}/associations'\ + \ -Method POST -Headers $headers -ContentType 'application/json' -Body '{\"\ + id\":\"string\",\"op\":\"add\",\"attributes\":{},\"type\":\"user\"}'" + x-codegen-request-body-name: body + /radiusservers/{radiusserver_id}/usergroups: + get: + tags: + - Graph + - RADIUS Servers + summary: List the User Groups bound to a RADIUS Server + description: "This endpoint will return all Users Groups bound to a RADIUS Server,\ + \ either directly or indirectly, essentially traversing the JumpCloud Graph\ + \ for your Organization.\n\nEach element will contain the group's type, id,\ + \ attributes and paths.\n\nThe `attributes` object is a key/value hash of\ + \ compiled graph attributes for all paths followed.\n\nThe `paths` array enumerates\ + \ each path from this RADIUS server instance to the corresponding User Group;\ + \ this array represents all grouping and/or associations that would have to\ + \ be removed to deprovision the User Group from this RADIUS server instance.\n\ + \nSee `/members` and `/associations` endpoints to manage those collections.\n\ + \n#### Sample Request\n```\ncurl -X GET https://console.jumpcloud.com/api/v2/radiusservers/{RADIUS_ID}/usergroups\ + \ \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\ + \ \\\n -H 'x-api-key: {API_KEY}'\n```" + operationId: graph_radiusServerTraverseUserGroup + parameters: + - name: radiusserver_id + in: path + description: ObjectID of the Radius Server. + required: true + style: simple + explode: false + schema: + type: string + - name: limit + in: query + description: The number of records to return at once. Limited to 100. + required: false + style: form + explode: true + schema: + type: integer + default: 10 + - name: x-org-id + in: header + description: Organization identifier that can be obtained from console settings. + required: false + style: simple + explode: false + schema: + type: string + - name: skip + in: query + description: The offset into the records to return. + required: false + style: form + explode: true + schema: + minimum: 0 + type: integer + default: 0 + - name: filter + in: query + description: "A filter to apply to the query.\n\n**Filter structure**: `::`.\n\ + \n**field** = Populate with a valid field from an endpoint response.\n\n\ + **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between,\ + \ search, in.\n_Note: v1 operators differ from v2 operators._\n\n**value**\ + \ = Populate with the value you want to search for. Is case sensitive. Supports\ + \ wild cards.\n\n**EX:** `GET /api/v2/groups?filter=name:eq:Test+Group`" + required: false + style: form + explode: false + schema: + type: array + items: + type: string + responses: + "200": + description: OK + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/GraphObjectWithPaths' + x-content-type: application/json + security: + - x-api-key: [] + x-scopes: + - groups + - groups.readonly + x-codeSamples: + - lang: Shell + source: "curl --request GET \\\n --url 'https://console.jumpcloud.com/api/v2/radiusservers/{radiusserver_id}/usergroups?limit=10&skip=0'\ + \ \\\n --header 'x-api-key: REPLACE_KEY_VALUE' \\\n --header 'x-org-id:\ + \ SOME_STRING_VALUE'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/radiusservers/{radiusserver_id}/usergroups\"\ + \n\nquerystring = {\"limit\":\"10\",\"skip\":\"0\"}\n\nheaders = {\n \ + \ \"x-org-id\": \"SOME_STRING_VALUE\",\n \"x-api-key\": \"REPLACE_KEY_VALUE\"\ + \n}\n\nresponse = requests.request(\"GET\", url, headers=headers, params=querystring)\n\ + \nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-org-id\", \"SOME_STRING_VALUE\")\n\ + $headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n$response = Invoke-RestMethod\ + \ -Uri 'https://console.jumpcloud.com/api/v2/radiusservers/{radiusserver_id}/usergroups?limit=10&skip=0'\ + \ -Method GET -Headers $headers" + /radiusservers/{radiusserver_id}/users: + get: + tags: + - Graph + - RADIUS Servers + summary: List the Users bound to a RADIUS Server + description: "This endpoint will return all Users bound to a RADIUS Server,\ + \ either directly or indirectly, essentially traversing the JumpCloud Graph\ + \ for your Organization.\n\nEach element will contain the type, id, attributes\ + \ and paths.\n\nThe `attributes` object is a key/value hash of compiled graph\ + \ attributes for all paths followed.\n\nThe `paths` array enumerates each\ + \ path from this RADIUS server instance to the corresponding User; this array\ + \ represents all grouping and/or associations that would have to be removed\ + \ to deprovision the User from this RADIUS server instance.\n\nSee `/members`\ + \ and `/associations` endpoints to manage those collections.\n\n\n#### Sample\ + \ Request\n```\ncurl -X GET https://console.jumpcloud.com/api/v2/ldapservers/{LDAP_ID}/users\ + \ \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\ + \ \\\n -H 'x-api-key: {API_KEY}'\n ```" + operationId: graph_radiusServerTraverseUser + parameters: + - name: radiusserver_id + in: path + description: ObjectID of the Radius Server. + required: true + style: simple + explode: false + schema: + type: string + - name: limit + in: query + description: The number of records to return at once. Limited to 100. + required: false + style: form + explode: true + schema: + type: integer + default: 10 + - name: x-org-id + in: header + description: Organization identifier that can be obtained from console settings. + required: false + style: simple + explode: false + schema: + type: string + - name: skip + in: query + description: The offset into the records to return. + required: false + style: form + explode: true + schema: + minimum: 0 + type: integer + default: 0 + - name: filter + in: query + description: "A filter to apply to the query.\n\n**Filter structure**: `::`.\n\ + \n**field** = Populate with a valid field from an endpoint response.\n\n\ + **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between,\ + \ search, in.\n_Note: v1 operators differ from v2 operators._\n\n**value**\ + \ = Populate with the value you want to search for. Is case sensitive. Supports\ + \ wild cards.\n\n**EX:** `GET /api/v2/groups?filter=name:eq:Test+Group`" + required: false + style: form + explode: false + schema: + type: array + items: + type: string + responses: + "200": + description: OK + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/GraphObjectWithPaths' + x-content-type: application/json + security: + - x-api-key: [] + x-scopes: + - users + - users.readonly + x-codeSamples: + - lang: Shell + source: "curl --request GET \\\n --url 'https://console.jumpcloud.com/api/v2/radiusservers/{radiusserver_id}/users?limit=10&skip=0'\ + \ \\\n --header 'x-api-key: REPLACE_KEY_VALUE' \\\n --header 'x-org-id:\ + \ SOME_STRING_VALUE'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/radiusservers/{radiusserver_id}/users\"\ + \n\nquerystring = {\"limit\":\"10\",\"skip\":\"0\"}\n\nheaders = {\n \ + \ \"x-org-id\": \"SOME_STRING_VALUE\",\n \"x-api-key\": \"REPLACE_KEY_VALUE\"\ + \n}\n\nresponse = requests.request(\"GET\", url, headers=headers, params=querystring)\n\ + \nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-org-id\", \"SOME_STRING_VALUE\")\n\ + $headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n$response = Invoke-RestMethod\ + \ -Uri 'https://console.jumpcloud.com/api/v2/radiusservers/{radiusserver_id}/users?limit=10&skip=0'\ + \ -Method GET -Headers $headers" + /softwareapps: + get: + tags: + - Software Apps + summary: Get all configured Software Applications. + description: "This endpoint allows you to get all configured Software Applications\ + \ that will be managed by JumpCloud on associated JumpCloud systems.\nThe\ + \ optional isConfigEnabled and appConfiguration apple_vpp attributes are not\ + \ included in the response.\n\n#### Sample Request\n```\n$ curl -X GET https://console.jumpcloud.com/api/v2/softwareapps\ + \ \\\n-H 'Accept: application/json' \\\n-H 'Content-Type: application/json'\ + \ \\\n-H 'x-api-key: {API_KEY}' \\\n```" + operationId: softwareApps_list + parameters: + - name: x-org-id + in: header + description: Organization identifier that can be obtained from console settings. + required: false + style: simple + explode: false + schema: + type: string + - name: filter + in: query + description: "A filter to apply to the query.\n\n**Filter structure**: `::`.\n\ + \n**field** = Populate with a valid field from an endpoint response.\n\n\ + **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between,\ + \ search, in.\n_Note: v1 operators differ from v2 operators._\n\n**value**\ + \ = Populate with the value you want to search for. Is case sensitive. Supports\ + \ wild cards.\n\n**EX:** `GET /api/v2/groups?filter=name:eq:Test+Group`" + required: false + style: form + explode: false + schema: + type: array + items: + type: string + - name: limit + in: query + description: The number of records to return at once. Limited to 100. + required: false + style: form + explode: true + schema: + type: integer + default: 10 + - name: skip + in: query + description: The offset into the records to return. + required: false + style: form + explode: true + schema: + minimum: 0 + type: integer + default: 0 + - name: sort + in: query + description: "The comma separated fields used to sort the collection.\nDefault\ + \ sort is ascending, prefix with `-` to sort descending.\n" + required: false + style: form + explode: false + schema: + type: array + items: + type: string + responses: + "200": + description: OK + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/software-app' + x-content-type: application/json + security: + - x-api-key: [] + x-scopes: + - systems + - systems.readonly + x-codeSamples: + - lang: Shell + source: "curl --request GET \\\n --url 'https://console.jumpcloud.com/api/v2/softwareapps?limit=10&skip=0'\ + \ \\\n --header 'x-api-key: REPLACE_KEY_VALUE' \\\n --header 'x-org-id:\ + \ SOME_STRING_VALUE'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/softwareapps\"\ + \n\nquerystring = {\"limit\":\"10\",\"skip\":\"0\"}\n\nheaders = {\n \ + \ \"x-org-id\": \"SOME_STRING_VALUE\",\n \"x-api-key\": \"REPLACE_KEY_VALUE\"\ + \n}\n\nresponse = requests.request(\"GET\", url, headers=headers, params=querystring)\n\ + \nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-org-id\", \"SOME_STRING_VALUE\")\n\ + $headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n$response = Invoke-RestMethod\ + \ -Uri 'https://console.jumpcloud.com/api/v2/softwareapps?limit=10&skip=0'\ + \ -Method GET -Headers $headers" + post: + tags: + - Software Apps + summary: Create a Software Application that will be managed by JumpCloud. + description: "This endpoint allows you to create a Software Application that\ + \ will be managed by JumpCloud on associated JumpCloud systems.\nThe optional\ + \ isConfigEnabled and appConfiguration apple_vpp attributes are not included\ + \ in the response.\n\n#### Sample Request\n```\n$ curl -X POST https://console.jumpcloud.com/api/v2/softwareapps\ + \ \\\n-H 'Accept: application/json' \\\n-H 'Content-Type: application/json'\ + \ \\\n-H 'x-api-key: {API_KEY}' \\\n-d '{\n \"displayName\": \"Adobe Reader\"\ + ,\n \"settings\": [{\"packageId\": \"adobereader\"}]\n}'\n```" + operationId: softwareApps_post + parameters: + - name: x-org-id + in: header + description: Organization identifier that can be obtained from console settings. + required: false + style: simple + explode: false + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/software-app' + required: false + responses: + "201": + description: Created + content: + application/json: + schema: + $ref: '#/components/schemas/software-app' + security: + - x-api-key: [] + x-scopes: + - systems + x-codeSamples: + - lang: Shell + source: "curl --request POST \\\n --url https://console.jumpcloud.com/api/v2/softwareapps\ + \ \\\n --header 'content-type: application/json' \\\n --header 'x-api-key:\ + \ REPLACE_KEY_VALUE' \\\n --header 'x-org-id: SOME_STRING_VALUE' \\\n \ + \ --data '{\"displayName\":\"string\",\"id\":\"string\",\"settings\":[{\"\ + allowUpdateDelay\":false,\"appleVpp\":{\"appConfiguration\":\"string\",\"\ + assignedLicenses\":0,\"availableLicenses\":0,\"details\":{},\"isConfigEnabled\"\ + :true,\"supportedDeviceFamilies\":[\"IPAD\"],\"totalLicenses\":0},\"assetKind\"\ + :\"string\",\"assetSha256Size\":0,\"assetSha256Strings\":[\"string\"],\"\ + autoUpdate\":false,\"description\":\"string\",\"desiredState\":\"string\"\ + ,\"location\":\"string\",\"locationObjectId\":\"string\",\"packageId\":\"\ + string\",\"packageKind\":\"string\",\"packageManager\":\"string\",\"packageSubtitle\"\ + :\"string\",\"packageVersion\":\"string\"}]}'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/softwareapps\"\ + \n\npayload = {\n \"displayName\": \"string\",\n \"id\": \"string\"\ + ,\n \"settings\": [\n {\n \"allowUpdateDelay\": False,\n\ + \ \"appleVpp\": {\n \"appConfiguration\": \"string\"\ + ,\n \"assignedLicenses\": 0,\n \"availableLicenses\"\ + : 0,\n \"details\": {},\n \"isConfigEnabled\"\ + : True,\n \"supportedDeviceFamilies\": [\"IPAD\"],\n \ + \ \"totalLicenses\": 0\n },\n \"assetKind\"\ + : \"string\",\n \"assetSha256Size\": 0,\n \"assetSha256Strings\"\ + : [\"string\"],\n \"autoUpdate\": False,\n \"description\"\ + : \"string\",\n \"desiredState\": \"string\",\n \"\ + location\": \"string\",\n \"locationObjectId\": \"string\",\n\ + \ \"packageId\": \"string\",\n \"packageKind\": \"\ + string\",\n \"packageManager\": \"string\",\n \"packageSubtitle\"\ + : \"string\",\n \"packageVersion\": \"string\"\n }\n \ + \ ]\n}\nheaders = {\n \"x-org-id\": \"SOME_STRING_VALUE\",\n \"\ + x-api-key\": \"REPLACE_KEY_VALUE\",\n \"content-type\": \"application/json\"\ + \n}\n\nresponse = requests.request(\"POST\", url, json=payload, headers=headers)\n\ + \nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-org-id\", \"SOME_STRING_VALUE\")\n\ + $headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n$headers.Add(\"content-type\"\ + , \"application/json\")\n$response = Invoke-RestMethod -Uri 'https://console.jumpcloud.com/api/v2/softwareapps'\ + \ -Method POST -Headers $headers -ContentType 'application/json' -Body '{\"\ + displayName\":\"string\",\"id\":\"string\",\"settings\":[{\"allowUpdateDelay\"\ + :false,\"appleVpp\":{\"appConfiguration\":\"string\",\"assignedLicenses\"\ + :0,\"availableLicenses\":0,\"details\":{},\"isConfigEnabled\":true,\"supportedDeviceFamilies\"\ + :[\"IPAD\"],\"totalLicenses\":0},\"assetKind\":\"string\",\"assetSha256Size\"\ + :0,\"assetSha256Strings\":[\"string\"],\"autoUpdate\":false,\"description\"\ + :\"string\",\"desiredState\":\"string\",\"location\":\"string\",\"locationObjectId\"\ + :\"string\",\"packageId\":\"string\",\"packageKind\":\"string\",\"packageManager\"\ + :\"string\",\"packageSubtitle\":\"string\",\"packageVersion\":\"string\"\ + }]}'" + x-codegen-request-body-name: body + /softwareapps/{id}: + get: + tags: + - Software Apps + summary: Retrieve a configured Software Application. + description: "Retrieves a Software Application.\nThe optional isConfigEnabled\ + \ and appConfiguration apple_vpp attributes are populated in this response.\n\ + \n#### Sample Request\n```\ncurl -X GET https://console.jumpcloud.com/api/v2/softwareapps/{id}\ + \ \\\n -H 'accept: application/json' \\\n -H 'content-type: application/json'\ + \ \\\n -H 'x-api-key: {API_KEY}'\n```" + operationId: softwareApps_get + parameters: + - name: id + in: path + required: true + style: simple + explode: false + schema: + type: string + - name: x-org-id + in: header + description: Organization identifier that can be obtained from console settings. + required: false + style: simple + explode: false + schema: + type: string + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/software-app' + "400": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorDetails' + "401": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "403": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "404": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "409": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "500": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + security: + - x-api-key: [] + x-scopes: + - systems + - systems.readonly + x-codeSamples: + - lang: Shell + source: "curl --request GET \\\n --url https://console.jumpcloud.com/api/v2/softwareapps/{id}\ + \ \\\n --header 'x-api-key: REPLACE_KEY_VALUE' \\\n --header 'x-org-id:\ + \ SOME_STRING_VALUE'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/softwareapps/{id}\"\ + \n\nheaders = {\n \"x-org-id\": \"SOME_STRING_VALUE\",\n \"x-api-key\"\ + : \"REPLACE_KEY_VALUE\"\n}\n\nresponse = requests.request(\"GET\", url,\ + \ headers=headers)\n\nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-org-id\", \"SOME_STRING_VALUE\")\n\ + $headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n$response = Invoke-RestMethod\ + \ -Uri 'https://console.jumpcloud.com/api/v2/softwareapps/{id}' -Method\ + \ GET -Headers $headers" + put: + tags: + - Software Apps + summary: Update a Software Application Configuration. + description: "This endpoint updates a specific Software Application configuration\ + \ for the organization.\ndisplayName can be changed alone if no settings are\ + \ provided.\nIf a setting is provided, it should include all its information\ + \ since this endpoint will update all the settings' fields.\nThe optional\ + \ isConfigEnabled and appConfiguration apple_vpp attributes are not included\ + \ in the response.\n\n#### Sample Request - displayName only\n```\n curl -X\ + \ PUT https://console.jumpcloud.com/api/v2/softwareapps/{id} \\\n -H 'accept:\ + \ application/json' \\\n -H 'content-type: application/json' \\\n -H 'x-api-key:\ + \ {API_KEY}' \\\n -d '{\n \"displayName\": \"My Software App\"\n }'\n\ + ```\n\n#### Sample Request - all attributes\n```\n curl -X PUT https://console.jumpcloud.com/api/v2/softwareapps/{id}\ + \ \\\n -H 'accept: application/json' \\\n -H 'content-type: application/json'\ + \ \\\n -H 'x-api-key: {API_KEY}' \\\n -d '{\n \"displayName\": \"My Software\ + \ App\",\n \"settings\": [\n {\n \"packageId\": \"123456\"\ + ,\n \"autoUpdate\": false,\n \"allowUpdateDelay\": false,\n\ + \ \"packageManager\": \"APPLE_VPP\",\n \"locationObjectId\"\ + : \"123456789012123456789012\",\n \"location\": \"123456\",\n \ + \ \"desiredState\": \"Install\",\n \"appleVpp\": {\n \"\ + appConfiguration\": \"MyKeyMy String\"\ + ,\n \"assignedLicenses\": 20,\n \"availableLicenses\": 10,\n\ + \ \"details\": {},\n \"isConfigEnabled\": true,\n \ + \ \"supportedDeviceFamilies\": [\n \"IPAD\",\n \"\ + MAC\"\n ],\n \"totalLicenses\": 30\n },\n \ + \ \"packageSubtitle\": \"My package subtitle\",\n \"packageVersion\"\ + : \"1.2.3\",\n \"packageKind\": \"software-package\",\n \"assetKind\"\ + : \"software\",\n \"assetSha256Size\": 256,\n \"assetSha256Strings\"\ + : [\n \"a123b123c123d123\"\n ],\n \"description\":\ + \ \"My app description\"\n }\n ]\n }'\n```" + operationId: softwareApps_update + parameters: + - name: id + in: path + required: true + style: simple + explode: false + schema: + type: string + - name: x-org-id + in: header + description: Organization identifier that can be obtained from console settings. + required: false + style: simple + explode: false + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/software-app' + required: false + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/software-app' + "400": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorDetails' + "401": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "403": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "404": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "500": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + security: + - x-api-key: [] + x-scopes: + - systems + x-codeSamples: + - lang: Shell + source: "curl --request PUT \\\n --url https://console.jumpcloud.com/api/v2/softwareapps/{id}\ + \ \\\n --header 'content-type: application/json' \\\n --header 'x-api-key:\ + \ REPLACE_KEY_VALUE' \\\n --header 'x-org-id: SOME_STRING_VALUE' \\\n \ + \ --data '{\"displayName\":\"string\",\"id\":\"string\",\"settings\":[{\"\ + allowUpdateDelay\":false,\"appleVpp\":{\"appConfiguration\":\"string\",\"\ + assignedLicenses\":0,\"availableLicenses\":0,\"details\":{},\"isConfigEnabled\"\ + :true,\"supportedDeviceFamilies\":[\"IPAD\"],\"totalLicenses\":0},\"assetKind\"\ + :\"string\",\"assetSha256Size\":0,\"assetSha256Strings\":[\"string\"],\"\ + autoUpdate\":false,\"description\":\"string\",\"desiredState\":\"string\"\ + ,\"location\":\"string\",\"locationObjectId\":\"string\",\"packageId\":\"\ + string\",\"packageKind\":\"string\",\"packageManager\":\"string\",\"packageSubtitle\"\ + :\"string\",\"packageVersion\":\"string\"}]}'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/softwareapps/{id}\"\ + \n\npayload = {\n \"displayName\": \"string\",\n \"id\": \"string\"\ + ,\n \"settings\": [\n {\n \"allowUpdateDelay\": False,\n\ + \ \"appleVpp\": {\n \"appConfiguration\": \"string\"\ + ,\n \"assignedLicenses\": 0,\n \"availableLicenses\"\ + : 0,\n \"details\": {},\n \"isConfigEnabled\"\ + : True,\n \"supportedDeviceFamilies\": [\"IPAD\"],\n \ + \ \"totalLicenses\": 0\n },\n \"assetKind\"\ + : \"string\",\n \"assetSha256Size\": 0,\n \"assetSha256Strings\"\ + : [\"string\"],\n \"autoUpdate\": False,\n \"description\"\ + : \"string\",\n \"desiredState\": \"string\",\n \"\ + location\": \"string\",\n \"locationObjectId\": \"string\",\n\ + \ \"packageId\": \"string\",\n \"packageKind\": \"\ + string\",\n \"packageManager\": \"string\",\n \"packageSubtitle\"\ + : \"string\",\n \"packageVersion\": \"string\"\n }\n \ + \ ]\n}\nheaders = {\n \"x-org-id\": \"SOME_STRING_VALUE\",\n \"\ + x-api-key\": \"REPLACE_KEY_VALUE\",\n \"content-type\": \"application/json\"\ + \n}\n\nresponse = requests.request(\"PUT\", url, json=payload, headers=headers)\n\ + \nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-org-id\", \"SOME_STRING_VALUE\")\n\ + $headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n$headers.Add(\"content-type\"\ + , \"application/json\")\n$response = Invoke-RestMethod -Uri 'https://console.jumpcloud.com/api/v2/softwareapps/{id}'\ + \ -Method PUT -Headers $headers -ContentType 'application/json' -Body '{\"\ + displayName\":\"string\",\"id\":\"string\",\"settings\":[{\"allowUpdateDelay\"\ + :false,\"appleVpp\":{\"appConfiguration\":\"string\",\"assignedLicenses\"\ + :0,\"availableLicenses\":0,\"details\":{},\"isConfigEnabled\":true,\"supportedDeviceFamilies\"\ + :[\"IPAD\"],\"totalLicenses\":0},\"assetKind\":\"string\",\"assetSha256Size\"\ + :0,\"assetSha256Strings\":[\"string\"],\"autoUpdate\":false,\"description\"\ + :\"string\",\"desiredState\":\"string\",\"location\":\"string\",\"locationObjectId\"\ + :\"string\",\"packageId\":\"string\",\"packageKind\":\"string\",\"packageManager\"\ + :\"string\",\"packageSubtitle\":\"string\",\"packageVersion\":\"string\"\ + }]}'" + x-codegen-request-body-name: body + delete: + tags: + - Software Apps + summary: Delete a configured Software Application + description: "Removes a Software Application configuration.\n\nWarning: This\ + \ is a destructive operation and will unmanage the application on all affected\ + \ systems.\n\n#### Sample Request\n```\ncurl -X DELETE https://console.jumpcloud.com/api/v2/softwareapps/{id}\ + \ \\\n -H 'accept: application/json' \\\n -H 'content-type: application/json'\ + \ \\\n -H 'x-api-key: {API_KEY}'\n```" + operationId: softwareApps_delete + parameters: + - name: id + in: path + required: true + style: simple + explode: false + schema: + type: string + - name: x-org-id + in: header + description: Organization identifier that can be obtained from console settings. + required: false + style: simple + explode: false + schema: + type: string + responses: + "204": + description: "" + content: {} + "400": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorDetails' + "401": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "403": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "404": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "409": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "500": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + security: + - x-api-key: [] + x-scopes: + - systems + x-codeSamples: + - lang: Shell + source: "curl --request DELETE \\\n --url https://console.jumpcloud.com/api/v2/softwareapps/{id}\ + \ \\\n --header 'x-api-key: REPLACE_KEY_VALUE' \\\n --header 'x-org-id:\ + \ SOME_STRING_VALUE'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/softwareapps/{id}\"\ + \n\nheaders = {\n \"x-org-id\": \"SOME_STRING_VALUE\",\n \"x-api-key\"\ + : \"REPLACE_KEY_VALUE\"\n}\n\nresponse = requests.request(\"DELETE\", url,\ + \ headers=headers)\n\nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-org-id\", \"SOME_STRING_VALUE\")\n\ + $headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n$response = Invoke-RestMethod\ + \ -Uri 'https://console.jumpcloud.com/api/v2/softwareapps/{id}' -Method\ + \ DELETE -Headers $headers" + /softwareapps/{software_app_id}/associations: + get: + tags: + - Graph + - Software Apps + summary: List the associations of a Software Application + description: "This endpoint will return the _direct_ associations of a Software\ + \ Application. A direct association can be a non-homogeneous relationship\ + \ between 2 different objects, for example Software Application and System\ + \ Groups.\n\n\n#### Sample Request\n```\ncurl -X GET https://console.jumpcloud.com/api/v2/softwareapps/{software_app_id}/associations?targets=system_group\ + \ \\\n -H 'accept: application/json' \\\n -H 'content-type: application/json'\ + \ \\\n -H 'x-api-key: {API_KEY}'\n```" + operationId: graph_softwareappsAssociationsList + parameters: + - name: software_app_id + in: path + description: ObjectID of the Software App. + required: true + style: simple + explode: false + schema: + type: string + - name: targets + in: query + description: Targets which a "software_app" can be associated to. + required: true + style: form + explode: false + schema: + type: array + items: + type: string + enum: + - system + - system_group + - name: limit + in: query + description: The number of records to return at once. Limited to 100. + required: false + style: form + explode: true + schema: + type: integer + default: 10 + - name: skip + in: query + description: The offset into the records to return. + required: false + style: form + explode: true + schema: + minimum: 0 + type: integer + default: 0 + - name: x-org-id + in: header + description: Organization identifier that can be obtained from console settings. + required: false + style: simple + explode: false + schema: + type: string + responses: + "200": + description: OK + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/GraphConnection' + x-content-type: application/json + security: + - x-api-key: [] + x-scopes: + - systems + x-codeSamples: + - lang: Shell + source: "curl --request GET \\\n --url 'https://console.jumpcloud.com/api/v2/softwareapps/{software_app_id}/associations?targets=SOME_ARRAY_VALUE&limit=10&skip=0'\ + \ \\\n --header 'x-api-key: REPLACE_KEY_VALUE' \\\n --header 'x-org-id:\ + \ SOME_STRING_VALUE'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/softwareapps/{software_app_id}/associations\"\ + \n\nquerystring = {\"targets\":\"SOME_ARRAY_VALUE\",\"limit\":\"10\",\"\ + skip\":\"0\"}\n\nheaders = {\n \"x-org-id\": \"SOME_STRING_VALUE\",\n\ + \ \"x-api-key\": \"REPLACE_KEY_VALUE\"\n}\n\nresponse = requests.request(\"\ + GET\", url, headers=headers, params=querystring)\n\nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-org-id\", \"SOME_STRING_VALUE\")\n\ + $headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n$response = Invoke-RestMethod\ + \ -Uri 'https://console.jumpcloud.com/api/v2/softwareapps/{software_app_id}/associations?targets=SOME_ARRAY_VALUE&limit=10&skip=0'\ + \ -Method GET -Headers $headers" + post: + tags: + - Graph + - Software Apps + summary: Manage the associations of a software application. + description: "This endpoint allows you to associate or disassociate a software\ + \ application to a system or system group.\n\n#### Sample Request\n```\n$\ + \ curl -X POST https://console.jumpcloud.com/api/v2/softwareapps/{software_app_id}/associations\ + \ \\\n-H 'Accept: application/json' \\\n-H 'Content-Type: application/json'\ + \ \\\n-H 'x-api-key: {API_KEY}' \\\n-d '{\n \"id\": \"\",\n \"\ + op\": \"add\",\n \"type\": \"system\"\n }'\n```" + operationId: graph_softwareappsAssociationsPost + parameters: + - name: software_app_id + in: path + description: ObjectID of the Software App. + required: true + style: simple + explode: false + schema: + type: string + - name: x-org-id + in: header + description: Organization identifier that can be obtained from console settings. + required: false + style: simple + explode: false + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/GraphOperation-SoftwareApp' + required: false + responses: + "204": + description: "" + content: {} + security: + - x-api-key: [] + x-scopes: + - systems + x-codeSamples: + - lang: Shell + source: "curl --request POST \\\n --url https://console.jumpcloud.com/api/v2/softwareapps/{software_app_id}/associations\ + \ \\\n --header 'content-type: application/json' \\\n --header 'x-api-key:\ + \ REPLACE_KEY_VALUE' \\\n --header 'x-org-id: SOME_STRING_VALUE' \\\n \ + \ --data '{\"id\":\"string\",\"op\":\"add\",\"attributes\":{},\"type\":\"\ + system\"}'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/softwareapps/{software_app_id}/associations\"\ + \n\npayload = {\n \"id\": \"string\",\n \"op\": \"add\",\n \"attributes\"\ + : {},\n \"type\": \"system\"\n}\nheaders = {\n \"x-org-id\": \"SOME_STRING_VALUE\"\ + ,\n \"x-api-key\": \"REPLACE_KEY_VALUE\",\n \"content-type\": \"application/json\"\ + \n}\n\nresponse = requests.request(\"POST\", url, json=payload, headers=headers)\n\ + \nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-org-id\", \"SOME_STRING_VALUE\")\n\ + $headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n$headers.Add(\"content-type\"\ + , \"application/json\")\n$response = Invoke-RestMethod -Uri 'https://console.jumpcloud.com/api/v2/softwareapps/{software_app_id}/associations'\ + \ -Method POST -Headers $headers -ContentType 'application/json' -Body '{\"\ + id\":\"string\",\"op\":\"add\",\"attributes\":{},\"type\":\"system\"}'" + x-codegen-request-body-name: body + /softwareapps/{software_app_id}/reclaim-licenses: + post: + tags: + - Software Apps + summary: Reclaim Licenses for a Software Application. + description: "This endpoint allows you to reclaim the licenses from a software\ + \ app associated with devices that are deleted.\n#### Sample Request\n```\n\ + $ curl -X POST https://console.jumpcloud.com/api/v2/softwareapps/{software_app_id}/reclaim-licenses\ + \ \\\n-H 'Accept: application/json' \\\n-H 'Content-Type: application/json'\ + \ \\\n-H 'x-api-key: {API_KEY}' \\\n-d '{}'\n```" + operationId: softwareApps_reclaimLicenses + parameters: + - name: software_app_id + in: path + required: true + style: simple + explode: false + schema: + type: string + responses: + "200": + description: Reclaim Licenses Response + content: + application/json: + schema: + $ref: '#/components/schemas/software-app-reclaim-licenses' + security: + - x-api-key: [] + x-scopes: + - systems + x-codeSamples: + - lang: Shell + source: "curl --request POST \\\n --url https://console.jumpcloud.com/api/v2/softwareapps/{software_app_id}/reclaim-licenses\ + \ \\\n --header 'x-api-key: REPLACE_KEY_VALUE'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/softwareapps/{software_app_id}/reclaim-licenses\"\ + \n\nheaders = {\"x-api-key\": \"REPLACE_KEY_VALUE\"}\n\nresponse = requests.request(\"\ + POST\", url, headers=headers)\n\nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n\ + $response = Invoke-RestMethod -Uri 'https://console.jumpcloud.com/api/v2/softwareapps/{software_app_id}/reclaim-licenses'\ + \ -Method POST -Headers $headers" + /softwareapps/{software_app_id}/retry-installation: + post: + tags: + - Software Apps + summary: Retry Installation for a Software Application + description: "This endpoints initiates an installation retry of an Apple VPP\ + \ App for the provided system IDs\n#### Sample Request\n```\n$ curl -X POST\ + \ https://console.jumpcloud.com/api/v2/softwareapps/{software_app_id}/retry-installation\ + \ \\\n-H 'Accept: application/json' \\\n-H 'Content-Type: application/json'\ + \ \\\n-H 'x-api-key: {API_KEY}' \\\n-d '{\"system_ids\": \"{,\ + \ , ...}\"}'\n```" + operationId: softwareApps_retryInstallation + parameters: + - name: software_app_id + in: path + required: true + style: simple + explode: false + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/SoftwareAppsRetryInstallationRequest' + required: true + responses: + "204": + description: No Content + content: {} + "400": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorDetails' + security: + - x-api-key: [] + x-scopes: + - systems + x-codeSamples: + - lang: Shell + source: "curl --request POST \\\n --url https://console.jumpcloud.com/api/v2/softwareapps/{software_app_id}/retry-installation\ + \ \\\n --header 'x-api-key: REPLACE_KEY_VALUE'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/softwareapps/{software_app_id}/retry-installation\"\ + \n\nheaders = {\"x-api-key\": \"REPLACE_KEY_VALUE\"}\n\nresponse = requests.request(\"\ + POST\", url, headers=headers)\n\nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n\ + $response = Invoke-RestMethod -Uri 'https://console.jumpcloud.com/api/v2/softwareapps/{software_app_id}/retry-installation'\ + \ -Method POST -Headers $headers" + x-codegen-request-body-name: body + /softwareapps/{software_app_id}/statuses: + get: + tags: + - Software Apps + summary: Get the status of the provided Software Application + description: "This endpoint allows you to get the status of the provided Software\ + \ Application on associated JumpCloud systems.\n\n#### Sample Request\n```\n\ + $ curl -X GET https://console.jumpcloud.com/api/v2/softwareapps/{software_app_id}/statuses\ + \ \\\n-H 'Accept: application/json' \\\n-H 'Content-Type: application/json'\ + \ \\\n-H 'x-api-key: {API_KEY}' \\\n```" + operationId: softwareAppStatuses_list + parameters: + - name: software_app_id + in: path + description: ObjectID of the Software App. + required: true + style: simple + explode: false + schema: + type: string + - name: x-org-id + in: header + description: Organization identifier that can be obtained from console settings. + required: false + style: simple + explode: false + schema: + type: string + - name: filter + in: query + description: "A filter to apply to the query.\n\n**Filter structure**: `::`.\n\ + \n**field** = Populate with a valid field from an endpoint response.\n\n\ + **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between,\ + \ search, in.\n_Note: v1 operators differ from v2 operators._\n\n**value**\ + \ = Populate with the value you want to search for. Is case sensitive. Supports\ + \ wild cards.\n\n**EX:** `GET /api/v2/groups?filter=name:eq:Test+Group`" + required: false + style: form + explode: false + schema: + type: array + items: + type: string + - name: limit + in: query + description: The number of records to return at once. Limited to 100. + required: false + style: form + explode: true + schema: + type: integer + default: 10 + - name: skip + in: query + description: The offset into the records to return. + required: false + style: form + explode: true + schema: + minimum: 0 + type: integer + default: 0 + - name: sort + in: query + description: "The comma separated fields used to sort the collection.\nDefault\ + \ sort is ascending, prefix with `-` to sort descending.\n" + required: false + style: form + explode: false + schema: + type: array + items: + type: string + responses: + "200": + description: OK + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/software-app-status' + x-content-type: application/json + security: + - x-api-key: [] + x-scopes: + - systems + - systems.readonly + x-codeSamples: + - lang: Shell + source: "curl --request GET \\\n --url 'https://console.jumpcloud.com/api/v2/softwareapps/{software_app_id}/statuses?limit=10&skip=0'\ + \ \\\n --header 'x-api-key: REPLACE_KEY_VALUE' \\\n --header 'x-org-id:\ + \ SOME_STRING_VALUE'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/softwareapps/{software_app_id}/statuses\"\ + \n\nquerystring = {\"limit\":\"10\",\"skip\":\"0\"}\n\nheaders = {\n \ + \ \"x-org-id\": \"SOME_STRING_VALUE\",\n \"x-api-key\": \"REPLACE_KEY_VALUE\"\ + \n}\n\nresponse = requests.request(\"GET\", url, headers=headers, params=querystring)\n\ + \nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-org-id\", \"SOME_STRING_VALUE\")\n\ + $headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n$response = Invoke-RestMethod\ + \ -Uri 'https://console.jumpcloud.com/api/v2/softwareapps/{software_app_id}/statuses?limit=10&skip=0'\ + \ -Method GET -Headers $headers" + /softwareapps/{software_app_id}/systemgroups: + get: + tags: + - Graph + - Software Apps + summary: List the System Groups bound to a Software App. + description: "This endpoint will return all Systems Groups bound to a Software\ + \ App, either directly or indirectly, essentially traversing the JumpCloud\ + \ Graph for your Organization.\n\nEach element will contain the group's type,\ + \ id, attributes and paths.\n\nThe `attributes` object is a key/value hash\ + \ of compiled graph attributes for all paths followed.\n\nThe `paths` array\ + \ enumerates each path from this Software App to the corresponding System\ + \ Group; this array represents all grouping and/or associations that would\ + \ have to be removed to deprovision the System Group from this Software App.\n\ + \nSee `/associations` endpoint to manage those collections.\n\n#### Sample\ + \ Request\n```\ncurl -X GET https://console.jumpcloud.com/api/v2/softwareapps/{software_app_id}/systemgroups\ + \ \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\ + \ \\\n -H 'x-api-key: {API_KEY}'\n```" + operationId: graph_softwareappsTraverseSystemGroup + parameters: + - name: software_app_id + in: path + description: ObjectID of the Software App. + required: true + style: simple + explode: false + schema: + type: string + - name: limit + in: query + description: The number of records to return at once. Limited to 100. + required: false + style: form + explode: true + schema: + type: integer + default: 10 + - name: x-org-id + in: header + description: Organization identifier that can be obtained from console settings. + required: false + style: simple + explode: false + schema: + type: string + - name: skip + in: query + description: The offset into the records to return. + required: false + style: form + explode: true + schema: + minimum: 0 + type: integer + default: 0 + - name: filter + in: query + description: "A filter to apply to the query.\n\n**Filter structure**: `::`.\n\ + \n**field** = Populate with a valid field from an endpoint response.\n\n\ + **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between,\ + \ search, in.\n_Note: v1 operators differ from v2 operators._\n\n**value**\ + \ = Populate with the value you want to search for. Is case sensitive. Supports\ + \ wild cards.\n\n**EX:** `GET /api/v2/groups?filter=name:eq:Test+Group`" + required: false + style: form + explode: false + schema: + type: array + items: + type: string + responses: + "200": + description: OK + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/GraphObjectWithPaths' + x-content-type: application/json + security: + - x-api-key: [] + x-scopes: + - groups + - groups.readonly + x-codeSamples: + - lang: Shell + source: "curl --request GET \\\n --url 'https://console.jumpcloud.com/api/v2/softwareapps/{software_app_id}/systemgroups?limit=10&skip=0'\ + \ \\\n --header 'x-api-key: REPLACE_KEY_VALUE' \\\n --header 'x-org-id:\ + \ SOME_STRING_VALUE'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/softwareapps/{software_app_id}/systemgroups\"\ + \n\nquerystring = {\"limit\":\"10\",\"skip\":\"0\"}\n\nheaders = {\n \ + \ \"x-org-id\": \"SOME_STRING_VALUE\",\n \"x-api-key\": \"REPLACE_KEY_VALUE\"\ + \n}\n\nresponse = requests.request(\"GET\", url, headers=headers, params=querystring)\n\ + \nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-org-id\", \"SOME_STRING_VALUE\")\n\ + $headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n$response = Invoke-RestMethod\ + \ -Uri 'https://console.jumpcloud.com/api/v2/softwareapps/{software_app_id}/systemgroups?limit=10&skip=0'\ + \ -Method GET -Headers $headers" + /softwareapps/{software_app_id}/systems: + get: + tags: + - Graph + - Software Apps + summary: List the Systems bound to a Software App. + description: "This endpoint will return all Systems bound to a Software App,\ + \ either directly or indirectly, essentially traversing the JumpCloud Graph\ + \ for your Organization.\n\nEach element will contain the type, id, attributes\ + \ and paths.\n\nThe `attributes` object is a key/value hash of compiled graph\ + \ attributes for all paths followed.\n\nThe `paths` array enumerates each\ + \ path from this Software App to the corresponding System; this array represents\ + \ all grouping and/or associations that would have to be removed to deprovision\ + \ the System from this Software App.\n\nSee `/associations` endpoint to manage\ + \ those collections.\n\n#### Sample Request\n```\ncurl -X GET https://console.jumpcloud.com/api/v2/softwareapps/{software_app_id}/systems\ + \ \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\ + \ \\\n -H 'x-api-key: {API_KEY}'\n```" + operationId: graph_softwareappsTraverseSystem + parameters: + - name: software_app_id + in: path + description: ObjectID of the Software App. + required: true + style: simple + explode: false + schema: + type: string + - name: limit + in: query + description: The number of records to return at once. Limited to 100. + required: false + style: form + explode: true + schema: + type: integer + default: 10 + - name: x-org-id + in: header + description: Organization identifier that can be obtained from console settings. + required: false + style: simple + explode: false + schema: + type: string + - name: skip + in: query + description: The offset into the records to return. + required: false + style: form + explode: true + schema: + minimum: 0 + type: integer + default: 0 + - name: filter + in: query + description: "A filter to apply to the query.\n\n**Filter structure**: `::`.\n\ + \n**field** = Populate with a valid field from an endpoint response.\n\n\ + **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between,\ + \ search, in.\n_Note: v1 operators differ from v2 operators._\n\n**value**\ + \ = Populate with the value you want to search for. Is case sensitive. Supports\ + \ wild cards.\n\n**EX:** `GET /api/v2/groups?filter=name:eq:Test+Group`" + required: false + style: form + explode: false + schema: + type: array + items: + type: string + responses: + "200": + description: OK + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/GraphObjectWithPaths' + x-content-type: application/json + security: + - x-api-key: [] + x-scopes: + - systems + - systems.readonly + x-codeSamples: + - lang: Shell + source: "curl --request GET \\\n --url 'https://console.jumpcloud.com/api/v2/softwareapps/{software_app_id}/systems?limit=10&skip=0'\ + \ \\\n --header 'x-api-key: REPLACE_KEY_VALUE' \\\n --header 'x-org-id:\ + \ SOME_STRING_VALUE'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/softwareapps/{software_app_id}/systems\"\ + \n\nquerystring = {\"limit\":\"10\",\"skip\":\"0\"}\n\nheaders = {\n \ + \ \"x-org-id\": \"SOME_STRING_VALUE\",\n \"x-api-key\": \"REPLACE_KEY_VALUE\"\ + \n}\n\nresponse = requests.request(\"GET\", url, headers=headers, params=querystring)\n\ + \nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-org-id\", \"SOME_STRING_VALUE\")\n\ + $headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n$response = Invoke-RestMethod\ + \ -Uri 'https://console.jumpcloud.com/api/v2/softwareapps/{software_app_id}/systems?limit=10&skip=0'\ + \ -Method GET -Headers $headers" + /subscriptions: + get: + tags: + - Subscriptions + summary: Lists all the Pricing & Packaging Subscriptions + description: "This endpoint returns all pricing & packaging subscriptions.\n\ + \n##### Sample Request\n\n```\n curl -X GET https://console.jumpcloud.com/api/v2/subscriptions\ + \ \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\ + \ \\\n -H 'x-api-key: {API_KEY}'\n ```" + operationId: subscriptions_get + responses: + "200": + description: OK + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/subscription' + x-content-type: application/json + x-scopes: + - subscriptions.readonly + x-codeSamples: + - lang: Shell + source: |- + curl --request GET \ + --url https://console.jumpcloud.com/api/v2/subscriptions + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/subscriptions\"\ + \n\nresponse = requests.request(\"GET\", url)\n\nprint(response.text)" + - lang: Powershell + source: '$response = Invoke-RestMethod -Uri ''https://console.jumpcloud.com/api/v2/subscriptions'' + -Method GET ' + /systemgroups: + get: + tags: + - System Groups + summary: List all System Groups + description: "This endpoint returns all System Groups.\n\nAvailable filter fields:\n\ + \ - `name`\n - `disabled`\n - `type`\n\n#### Sample Request\n\n```\ncurl\ + \ -X GET https://console.jumpcloud.com/api/v2/systemgroups \\\n -H 'Accept:\ + \ application/json' \\\n -H 'Content-Type: application/json' \\\n -H 'x-api-key:\ + \ {API_KEY}'\n```" + operationId: groups_system_list + parameters: + - name: fields + in: query + description: "The comma separated fields included in the returned records.\n\ + If omitted, the default list of fields will be returned.\n" + required: false + style: form + explode: false + schema: + type: array + items: + type: string + - name: filter + in: query + description: "A filter to apply to the query.\n\n**Filter structure**: `::`.\n\ + \n**field** = Populate with a valid field from an endpoint response.\n\n\ + **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between,\ + \ search, in.\n_Note: v1 operators differ from v2 operators._\n\n**value**\ + \ = Populate with the value you want to search for. Is case sensitive. Supports\ + \ wild cards.\n\n**EX:** `GET /api/v2/groups?filter=name:eq:Test+Group`" + required: false + style: form + explode: false + schema: + type: array + items: + type: string + - name: limit + in: query + description: The number of records to return at once. Limited to 100. + required: false + style: form + explode: true + schema: + type: integer + default: 10 + - name: skip + in: query + description: The offset into the records to return. + required: false + style: form + explode: true + schema: + minimum: 0 + type: integer + default: 0 + - name: sort + in: query + description: "The comma separated fields used to sort the collection.\nDefault\ + \ sort is ascending, prefix with `-` to sort descending.\n" + required: false + style: form + explode: false + schema: + type: array + items: + type: string + - name: x-org-id + in: header + description: Organization identifier that can be obtained from console settings. + required: false + style: simple + explode: false + schema: + type: string + responses: + "200": + description: OK + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/SystemGroup' + x-content-type: application/json + example: + - id: "000000" + - type: system_group + - id: "000000" + name: group1 + default: + description: Unexpected error + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + security: + - x-api-key: [] + x-scopes: + - groups + - groups.readonly + x-codeSamples: + - lang: Shell + source: "curl --request GET \\\n --url 'https://console.jumpcloud.com/api/v2/systemgroups?limit=10&skip=0'\ + \ \\\n --header 'x-api-key: REPLACE_KEY_VALUE' \\\n --header 'x-org-id:\ + \ SOME_STRING_VALUE'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/systemgroups\"\ + \n\nquerystring = {\"limit\":\"10\",\"skip\":\"0\"}\n\nheaders = {\n \ + \ \"x-org-id\": \"SOME_STRING_VALUE\",\n \"x-api-key\": \"REPLACE_KEY_VALUE\"\ + \n}\n\nresponse = requests.request(\"GET\", url, headers=headers, params=querystring)\n\ + \nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-org-id\", \"SOME_STRING_VALUE\")\n\ + $headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n$response = Invoke-RestMethod\ + \ -Uri 'https://console.jumpcloud.com/api/v2/systemgroups?limit=10&skip=0'\ + \ -Method GET -Headers $headers" + post: + tags: + - System Groups + summary: Create a new System Group + description: "This endpoint allows you to create a new System Group.\n\n####\ + \ Sample Request\n\n```\ncurl -X POST https://console.jumpcloud.com/api/v2/systemgroups\ + \ \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\ + \ \\\n -H 'x-api-key: {API_KEY}' \\\n -d '{\n \"name\": \"{Group_Name}\"\ + \n }'\n```" + operationId: groups_system_post + parameters: + - name: x-org-id + in: header + description: Organization identifier that can be obtained from console settings. + required: false + style: simple + explode: false + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/SystemGroupData' + required: false + responses: + "201": + description: Created + content: + application/json: + schema: + $ref: '#/components/schemas/SystemGroup' + security: + - x-api-key: [] + x-scopes: + - groups + x-codeSamples: + - lang: Shell + source: "curl --request POST \\\n --url https://console.jumpcloud.com/api/v2/systemgroups\ + \ \\\n --header 'content-type: application/json' \\\n --header 'x-api-key:\ + \ REPLACE_KEY_VALUE' \\\n --header 'x-org-id: SOME_STRING_VALUE' \\\n \ + \ --data '{\"name\":\"string\"}'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/systemgroups\"\ + \n\npayload = {\"name\": \"string\"}\nheaders = {\n \"x-org-id\": \"\ + SOME_STRING_VALUE\",\n \"x-api-key\": \"REPLACE_KEY_VALUE\",\n \"\ + content-type\": \"application/json\"\n}\n\nresponse = requests.request(\"\ + POST\", url, json=payload, headers=headers)\n\nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-org-id\", \"SOME_STRING_VALUE\")\n\ + $headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n$headers.Add(\"content-type\"\ + , \"application/json\")\n$response = Invoke-RestMethod -Uri 'https://console.jumpcloud.com/api/v2/systemgroups'\ + \ -Method POST -Headers $headers -ContentType 'application/json' -Body '{\"\ + name\":\"string\"}'" + x-codegen-request-body-name: body + /systemgroups/{group_id}/associations: + get: + tags: + - Graph + - System Group Associations + - System Groups + summary: List the associations of a System Group + description: "This endpoint returns the _direct_ associations of a System Group.\n\ + \nA direct association can be a non-homogeneous relationship between 2 different\ + \ objects, for example System Groups and Users.\n\n\n#### Sample Request\n\ + ```\ncurl -X GET https://console.jumpcloud.com/api/v2/systemgroups/{GroupID}/associations?targets=user\ + \ \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\ + \ \\\n -H 'x-api-key: {API_KEY}'\n```" + operationId: graph_systemGroupAssociationsList + parameters: + - name: group_id + in: path + description: ObjectID of the System Group. + required: true + style: simple + explode: false + schema: + type: string + - name: targets + in: query + description: Targets which a "system_group" can be associated to. + required: true + style: form + explode: false + schema: + type: array + items: + type: string + enum: + - command + - policy + - policy_group + - user + - user_group + - name: limit + in: query + description: The number of records to return at once. Limited to 100. + required: false + style: form + explode: true + schema: + type: integer + default: 10 + - name: skip + in: query + description: The offset into the records to return. + required: false + style: form + explode: true + schema: + minimum: 0 + type: integer + default: 0 + - name: x-org-id + in: header + description: Organization identifier that can be obtained from console settings. + required: false + style: simple + explode: false + schema: + type: string + responses: + "200": + description: OK + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/GraphConnection' + x-content-type: application/json + security: + - x-api-key: [] + x-scopes: + - groups + - groups.readonly + - groups.self + x-codeSamples: + - lang: Shell + source: "curl --request GET \\\n --url 'https://console.jumpcloud.com/api/v2/systemgroups/{group_id}/associations?targets=SOME_ARRAY_VALUE&limit=10&skip=0'\ + \ \\\n --header 'x-api-key: REPLACE_KEY_VALUE' \\\n --header 'x-org-id:\ + \ SOME_STRING_VALUE'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/systemgroups/{group_id}/associations\"\ + \n\nquerystring = {\"targets\":\"SOME_ARRAY_VALUE\",\"limit\":\"10\",\"\ + skip\":\"0\"}\n\nheaders = {\n \"x-org-id\": \"SOME_STRING_VALUE\",\n\ + \ \"x-api-key\": \"REPLACE_KEY_VALUE\"\n}\n\nresponse = requests.request(\"\ + GET\", url, headers=headers, params=querystring)\n\nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-org-id\", \"SOME_STRING_VALUE\")\n\ + $headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n$response = Invoke-RestMethod\ + \ -Uri 'https://console.jumpcloud.com/api/v2/systemgroups/{group_id}/associations?targets=SOME_ARRAY_VALUE&limit=10&skip=0'\ + \ -Method GET -Headers $headers" + post: + tags: + - Graph + - System Group Associations + - System Groups + summary: Manage the associations of a System Group + description: "This endpoint allows you to manage the _direct_ associations of\ + \ a System Group.\n\nA direct association can be a non-homogeneous relationship\ + \ between 2 different objects, for example System Groups and Users.\n\n\n\ + #### Sample Request\n```\ncurl -X POST https://console.jumpcloud.com/api/v2/systemgroups/{GroupID}/associations\ + \ \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\ + \ \\\n -H 'x-api-key: {API_KEY}' \\\n -d '{\n \"op\": \"add\",\n \"\ + type\": \"user\",\n \"id\": \"{UserID}\"\n }'\n```" + operationId: graph_systemGroupAssociationsPost + parameters: + - name: group_id + in: path + description: ObjectID of the System Group. + required: true + style: simple + explode: false + schema: + type: string + - name: x-org-id + in: header + description: Organization identifier that can be obtained from console settings. + required: false + style: simple + explode: false + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/GraphOperation-SystemGroup' + required: false + responses: + "204": + description: OK + content: {} + security: + - x-api-key: [] + x-scopes: + - groups + - groups.self + x-codeSamples: + - lang: Shell + source: "curl --request POST \\\n --url https://console.jumpcloud.com/api/v2/systemgroups/{group_id}/associations\ + \ \\\n --header 'content-type: application/json' \\\n --header 'x-api-key:\ + \ REPLACE_KEY_VALUE' \\\n --header 'x-org-id: SOME_STRING_VALUE' \\\n \ + \ --data '{\"id\":\"string\",\"op\":\"add\",\"attributes\":{},\"type\":\"\ + command\"}'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/systemgroups/{group_id}/associations\"\ + \n\npayload = {\n \"id\": \"string\",\n \"op\": \"add\",\n \"attributes\"\ + : {},\n \"type\": \"command\"\n}\nheaders = {\n \"x-org-id\": \"SOME_STRING_VALUE\"\ + ,\n \"x-api-key\": \"REPLACE_KEY_VALUE\",\n \"content-type\": \"application/json\"\ + \n}\n\nresponse = requests.request(\"POST\", url, json=payload, headers=headers)\n\ + \nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-org-id\", \"SOME_STRING_VALUE\")\n\ + $headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n$headers.Add(\"content-type\"\ + , \"application/json\")\n$response = Invoke-RestMethod -Uri 'https://console.jumpcloud.com/api/v2/systemgroups/{group_id}/associations'\ + \ -Method POST -Headers $headers -ContentType 'application/json' -Body '{\"\ + id\":\"string\",\"op\":\"add\",\"attributes\":{},\"type\":\"command\"}'" + x-codegen-request-body-name: body + /systemgroups/{group_id}/commands: + get: + tags: + - Graph + - System Group Associations + summary: List the Commands bound to a System Group + description: "This endpoint will return all Commands bound to a System Group,\ + \ either directly or indirectly, essentially traversing the JumpCloud Graph\ + \ for your Organization.\n\nEach element will contain the group's type, id,\ + \ attributes and paths.\n\nThe `attributes` object is a key/value hash of\ + \ compiled graph attributes for all paths followed.\n\nThe `paths` array enumerates\ + \ each path from this System Group to the corresponding Command; this array\ + \ represents all grouping and/or associations that would have to be removed\ + \ to deprovision the Command from this System Group.\n\nSee `/members` and\ + \ `/associations` endpoints to manage those collections.\n\n#### Sample Request\n\ + ```\ncurl -X GET https://console.jumpcloud.com/api/v2/systemgroups/{GroupID}/commands\ + \ \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\ + \ \\\n -H 'x-api-key: {API_KEY}'\n```" + operationId: graph_systemGroupTraverseCommand + parameters: + - name: group_id + in: path + description: ObjectID of the System Group. + required: true + style: simple + explode: false + schema: + type: string + - name: limit + in: query + description: The number of records to return at once. Limited to 100. + required: false + style: form + explode: true + schema: + type: integer + default: 10 + - name: x-org-id + in: header + description: Organization identifier that can be obtained from console settings. + required: false + style: simple + explode: false + schema: + type: string + - name: skip + in: query + description: The offset into the records to return. + required: false + style: form + explode: true + schema: + minimum: 0 + type: integer + default: 0 + - name: filter + in: query + description: "A filter to apply to the query.\n\n**Filter structure**: `::`.\n\ + \n**field** = Populate with a valid field from an endpoint response.\n\n\ + **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between,\ + \ search, in.\n_Note: v1 operators differ from v2 operators._\n\n**value**\ + \ = Populate with the value you want to search for. Is case sensitive. Supports\ + \ wild cards.\n\n**EX:** `GET /api/v2/groups?filter=name:eq:Test+Group`" + required: false + style: form + explode: false + schema: + type: array + items: + type: string + responses: + "200": + description: OK + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/GraphObjectWithPaths' + x-content-type: application/json + security: + - x-api-key: [] + x-scopes: + - commands + x-codeSamples: + - lang: Shell + source: "curl --request GET \\\n --url 'https://console.jumpcloud.com/api/v2/systemgroups/{group_id}/commands?limit=10&skip=0'\ + \ \\\n --header 'x-api-key: REPLACE_KEY_VALUE' \\\n --header 'x-org-id:\ + \ SOME_STRING_VALUE'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/systemgroups/{group_id}/commands\"\ + \n\nquerystring = {\"limit\":\"10\",\"skip\":\"0\"}\n\nheaders = {\n \ + \ \"x-org-id\": \"SOME_STRING_VALUE\",\n \"x-api-key\": \"REPLACE_KEY_VALUE\"\ + \n}\n\nresponse = requests.request(\"GET\", url, headers=headers, params=querystring)\n\ + \nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-org-id\", \"SOME_STRING_VALUE\")\n\ + $headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n$response = Invoke-RestMethod\ + \ -Uri 'https://console.jumpcloud.com/api/v2/systemgroups/{group_id}/commands?limit=10&skip=0'\ + \ -Method GET -Headers $headers" + /systemgroups/{group_id}/members: + get: + tags: + - Graph + - System Group Members & Membership + - System Groups + summary: List the members of a System Group + description: "This endpoint returns the system members of a System Group.\n\n\ + #### Sample Request\n```\ncurl -X GET https://console.jumpcloud.com/api/v2/systemgroups/{Group_ID}/members\ + \ \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\ + \ \\\n -H 'x-api-key: {API_KEY}'\n\n```" + operationId: graph_systemGroupMembersList + parameters: + - name: group_id + in: path + description: ObjectID of the System Group. + required: true + style: simple + explode: false + schema: + type: string + - name: limit + in: query + description: The number of records to return at once. Limited to 100. + required: false + style: form + explode: true + schema: + type: integer + default: 10 + - name: skip + in: query + description: The offset into the records to return. + required: false + style: form + explode: true + schema: + minimum: 0 + type: integer + default: 0 + - name: x-org-id + in: header + description: Organization identifier that can be obtained from console settings. + required: false + style: simple + explode: false + schema: + type: string + responses: + "200": + description: OK + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/GraphConnection' + x-content-type: application/json + security: + - x-api-key: [] + x-scopes: + - systems + - systems.readonly + x-codeSamples: + - lang: Shell + source: "curl --request GET \\\n --url 'https://console.jumpcloud.com/api/v2/systemgroups/{group_id}/members?limit=10&skip=0'\ + \ \\\n --header 'x-api-key: REPLACE_KEY_VALUE' \\\n --header 'x-org-id:\ + \ SOME_STRING_VALUE'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/systemgroups/{group_id}/members\"\ + \n\nquerystring = {\"limit\":\"10\",\"skip\":\"0\"}\n\nheaders = {\n \ + \ \"x-org-id\": \"SOME_STRING_VALUE\",\n \"x-api-key\": \"REPLACE_KEY_VALUE\"\ + \n}\n\nresponse = requests.request(\"GET\", url, headers=headers, params=querystring)\n\ + \nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-org-id\", \"SOME_STRING_VALUE\")\n\ + $headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n$response = Invoke-RestMethod\ + \ -Uri 'https://console.jumpcloud.com/api/v2/systemgroups/{group_id}/members?limit=10&skip=0'\ + \ -Method GET -Headers $headers" + post: + tags: + - Graph + - System Group Members & Membership + - System Groups + summary: Manage the members of a System Group + description: "This endpoint allows you to manage the system members of a System\ + \ Group.\n\n#### Sample Request\n```\ncurl -X POST https://console.jumpcloud.com/api/v2/systemgroups/{Group_ID}/members\ + \ \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\ + \ \\\n -H 'x-api-key: {API_KEY}' \\\n -d '{\n \"op\": \"add\",\n \"\ + type\": \"system\",\n \"id\": \"{System_ID}\"\n }'\n```" + operationId: graph_systemGroupMembersPost + parameters: + - name: group_id + in: path + description: ObjectID of the System Group. + required: true + style: simple + explode: false + schema: + type: string + - name: Date + in: header + description: Current date header for the System Context API + required: false + style: simple + explode: false + schema: + type: string + - name: Authorization + in: header + description: Authorization header for the System Context API + required: false + style: simple + explode: false + schema: + type: string + - name: x-org-id + in: header + description: Organization identifier that can be obtained from console settings. + required: false + style: simple + explode: false + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/GraphOperation-SystemGroup-Member' + required: false + responses: + "204": + description: OK + content: {} + security: + - x-api-key: [] + x-scopes: + - groups + - groups.self + x-codeSamples: + - lang: Shell + source: "curl --request POST \\\n --url https://console.jumpcloud.com/api/v2/systemgroups/{group_id}/members\ + \ \\\n --header 'Authorization: SOME_STRING_VALUE' \\\n --header 'Date:\ + \ SOME_STRING_VALUE' \\\n --header 'content-type: application/json' \\\n\ + \ --header 'x-api-key: REPLACE_KEY_VALUE' \\\n --header 'x-org-id: SOME_STRING_VALUE'\ + \ \\\n --data '{\"id\":\"string\",\"op\":\"add\",\"attributes\":{},\"type\"\ + :\"system\"}'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/systemgroups/{group_id}/members\"\ + \n\npayload = {\n \"id\": \"string\",\n \"op\": \"add\",\n \"attributes\"\ + : {},\n \"type\": \"system\"\n}\nheaders = {\n \"Date\": \"SOME_STRING_VALUE\"\ + ,\n \"Authorization\": \"SOME_STRING_VALUE\",\n \"x-org-id\": \"SOME_STRING_VALUE\"\ + ,\n \"x-api-key\": \"REPLACE_KEY_VALUE\",\n \"content-type\": \"application/json\"\ + \n}\n\nresponse = requests.request(\"POST\", url, json=payload, headers=headers)\n\ + \nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"Date\", \"SOME_STRING_VALUE\")\n$headers.Add(\"\ + Authorization\", \"SOME_STRING_VALUE\")\n$headers.Add(\"x-org-id\", \"SOME_STRING_VALUE\"\ + )\n$headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n$headers.Add(\"content-type\"\ + , \"application/json\")\n$response = Invoke-RestMethod -Uri 'https://console.jumpcloud.com/api/v2/systemgroups/{group_id}/members'\ + \ -Method POST -Headers $headers -ContentType 'application/json' -Body '{\"\ + id\":\"string\",\"op\":\"add\",\"attributes\":{},\"type\":\"system\"}'" + x-codegen-request-body-name: body + /systemgroups/{group_id}/membership: + get: + tags: + - Graph + - System Group Members & Membership + - System Groups + summary: List the System Group's membership + description: "This endpoint returns all Systems that are a member of this System\ + \ Group.\n\n#### Sample Request\n```\ncurl -X GET https://console.jumpcloud.com/api/v2/systemgroups/{Group_ID/membership\ + \ \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\ + \ \\\n -H 'x-api-key: {API_KEY}'\n\n```" + operationId: graph_systemGroupMembership + parameters: + - name: group_id + in: path + description: ObjectID of the System Group. + required: true + style: simple + explode: false + schema: + type: string + - name: limit + in: query + description: The number of records to return at once. Limited to 100. + required: false + style: form + explode: true + schema: + type: integer + default: 10 + - name: skip + in: query + description: The offset into the records to return. + required: false + style: form + explode: true + schema: + minimum: 0 + type: integer + default: 0 + - name: sort + in: query + description: "The comma separated fields used to sort the collection.\nDefault\ + \ sort is ascending, prefix with `-` to sort descending.\n" + required: false + style: form + explode: false + schema: + type: array + items: + type: string + - name: filter + in: query + description: "A filter to apply to the query.\n\n**Filter structure**: `::`.\n\ + \n**field** = Populate with a valid field from an endpoint response.\n\n\ + **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between,\ + \ search, in.\n_Note: v1 operators differ from v2 operators._\n\n**value**\ + \ = Populate with the value you want to search for. Is case sensitive. Supports\ + \ wild cards.\n\n**EX:** `GET /api/v2/groups?filter=name:eq:Test+Group`" + required: false + style: form + explode: false + schema: + type: array + items: + type: string + - name: x-org-id + in: header + description: Organization identifier that can be obtained from console settings. + required: false + style: simple + explode: false + schema: + type: string + responses: + "200": + description: OK + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/GraphObjectWithPaths' + x-content-type: application/json + security: + - x-api-key: [] + x-scopes: + - systems + - systems.readonly + x-codeSamples: + - lang: Shell + source: "curl --request GET \\\n --url 'https://console.jumpcloud.com/api/v2/systemgroups/{group_id}/membership?limit=10&skip=0'\ + \ \\\n --header 'x-api-key: REPLACE_KEY_VALUE' \\\n --header 'x-org-id:\ + \ SOME_STRING_VALUE'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/systemgroups/{group_id}/membership\"\ + \n\nquerystring = {\"limit\":\"10\",\"skip\":\"0\"}\n\nheaders = {\n \ + \ \"x-org-id\": \"SOME_STRING_VALUE\",\n \"x-api-key\": \"REPLACE_KEY_VALUE\"\ + \n}\n\nresponse = requests.request(\"GET\", url, headers=headers, params=querystring)\n\ + \nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-org-id\", \"SOME_STRING_VALUE\")\n\ + $headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n$response = Invoke-RestMethod\ + \ -Uri 'https://console.jumpcloud.com/api/v2/systemgroups/{group_id}/membership?limit=10&skip=0'\ + \ -Method GET -Headers $headers" + /systemgroups/{group_id}/policies: + get: + tags: + - Graph + - System Group Associations + - System Groups + summary: List the Policies bound to a System Group + description: "This endpoint will return all Policies bound to a System Group,\ + \ either directly or indirectly, essentially traversing the JumpCloud Graph\ + \ for your Organization.\n\nEach element will contain the type, id, attributes\ + \ and paths.\n\nThe `attributes` object is a key/value hash of compiled graph\ + \ attributes for all paths followed.\n\nThe `paths` array enumerates each\ + \ path from this System Group to the corresponding Policy; this array represents\ + \ all grouping and/or associations that would have to be removed to deprovision\ + \ the Policy from this System Group.\n\nSee `/members` and `/associations`\ + \ endpoints to manage those collections.\n\nThis endpoint is not public yet\ + \ as we haven't finished the code.\n\n##### Sample Request\n```\ncurl -X GET\ + \ https://console.jumpcloud.com/api/v2/systemgroups/{GroupID}/policies \\\n\ + \ -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\ + \ \\\n -H 'x-api-key: {API_KEY}'\n```" + operationId: graph_systemGroupTraversePolicy + parameters: + - name: group_id + in: path + description: ObjectID of the System Group. + required: true + style: simple + explode: false + schema: + type: string + - name: limit + in: query + description: The number of records to return at once. Limited to 100. + required: false + style: form + explode: true + schema: + type: integer + default: 10 + - name: x-org-id + in: header + description: Organization identifier that can be obtained from console settings. + required: false + style: simple + explode: false + schema: + type: string + - name: skip + in: query + description: The offset into the records to return. + required: false + style: form + explode: true + schema: + minimum: 0 + type: integer + default: 0 + - name: filter + in: query + description: "A filter to apply to the query.\n\n**Filter structure**: `::`.\n\ + \n**field** = Populate with a valid field from an endpoint response.\n\n\ + **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between,\ + \ search, in.\n_Note: v1 operators differ from v2 operators._\n\n**value**\ + \ = Populate with the value you want to search for. Is case sensitive. Supports\ + \ wild cards.\n\n**EX:** `GET /api/v2/groups?filter=name:eq:Test+Group`" + required: false + style: form + explode: false + schema: + type: array + items: + type: string + responses: + "200": + description: OK + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/GraphObjectWithPaths' + x-content-type: application/json + security: + - x-api-key: [] + x-scopes: + - systems + - systems.readonly + x-codeSamples: + - lang: Shell + source: "curl --request GET \\\n --url 'https://console.jumpcloud.com/api/v2/systemgroups/{group_id}/policies?limit=10&skip=0'\ + \ \\\n --header 'x-api-key: REPLACE_KEY_VALUE' \\\n --header 'x-org-id:\ + \ SOME_STRING_VALUE'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/systemgroups/{group_id}/policies\"\ + \n\nquerystring = {\"limit\":\"10\",\"skip\":\"0\"}\n\nheaders = {\n \ + \ \"x-org-id\": \"SOME_STRING_VALUE\",\n \"x-api-key\": \"REPLACE_KEY_VALUE\"\ + \n}\n\nresponse = requests.request(\"GET\", url, headers=headers, params=querystring)\n\ + \nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-org-id\", \"SOME_STRING_VALUE\")\n\ + $headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n$response = Invoke-RestMethod\ + \ -Uri 'https://console.jumpcloud.com/api/v2/systemgroups/{group_id}/policies?limit=10&skip=0'\ + \ -Method GET -Headers $headers" + /systemgroups/{group_id}/policygroups: + get: + tags: + - Graph + - System Group Associations + - System Groups + summary: List the Policy Groups bound to a System Group + description: "This endpoint will return all Policy Groups bound to a System\ + \ Group, either directly or indirectly, essentially traversing the JumpCloud\ + \ Graph for your Organization.\n\nEach element will contain the type, id,\ + \ attributes and paths.\n\nThe `attributes` object is a key/value hash of\ + \ compiled graph attributes for all paths followed.\n\nThe `paths` array enumerates\ + \ each path from this System Group to the corresponding Policy Group; this\ + \ array represents all grouping and/or associations that would have to be\ + \ removed to deprovision the Policy Group from this System Group.\n\nSee `/members`\ + \ and `/associations` endpoints to manage those collections.\n\n#### Sample\ + \ Request\n```\ncurl -X GET https://console.jumpcloud.com/api/v2/systemgroups/{GroupID}/policygroups\ + \ \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\ + \ \\\n -H 'x-api-key: {API_KEY}'\n\n```" + operationId: graph_systemGroupTraversePolicyGroup + parameters: + - name: group_id + in: path + description: ObjectID of the System Group. + required: true + style: simple + explode: false + schema: + type: string + - name: limit + in: query + description: The number of records to return at once. Limited to 100. + required: false + style: form + explode: true + schema: + type: integer + default: 10 + - name: x-org-id + in: header + description: Organization identifier that can be obtained from console settings. + required: false + style: simple + explode: false + schema: + type: string + - name: skip + in: query + description: The offset into the records to return. + required: false + style: form + explode: true + schema: + minimum: 0 + type: integer + default: 0 + - name: filter + in: query + description: "A filter to apply to the query.\n\n**Filter structure**: `::`.\n\ + \n**field** = Populate with a valid field from an endpoint response.\n\n\ + **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between,\ + \ search, in.\n_Note: v1 operators differ from v2 operators._\n\n**value**\ + \ = Populate with the value you want to search for. Is case sensitive. Supports\ + \ wild cards.\n\n**EX:** `GET /api/v2/groups?filter=name:eq:Test+Group`" + required: false + style: form + explode: false + schema: + type: array + items: + type: string + responses: + "200": + description: OK + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/GraphObjectWithPaths' + x-content-type: application/json + security: + - x-api-key: [] + x-scopes: + - groups + - groups.readonly + x-codeSamples: + - lang: Shell + source: "curl --request GET \\\n --url 'https://console.jumpcloud.com/api/v2/systemgroups/{group_id}/policygroups?limit=10&skip=0'\ + \ \\\n --header 'x-api-key: REPLACE_KEY_VALUE' \\\n --header 'x-org-id:\ + \ SOME_STRING_VALUE'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/systemgroups/{group_id}/policygroups\"\ + \n\nquerystring = {\"limit\":\"10\",\"skip\":\"0\"}\n\nheaders = {\n \ + \ \"x-org-id\": \"SOME_STRING_VALUE\",\n \"x-api-key\": \"REPLACE_KEY_VALUE\"\ + \n}\n\nresponse = requests.request(\"GET\", url, headers=headers, params=querystring)\n\ + \nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-org-id\", \"SOME_STRING_VALUE\")\n\ + $headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n$response = Invoke-RestMethod\ + \ -Uri 'https://console.jumpcloud.com/api/v2/systemgroups/{group_id}/policygroups?limit=10&skip=0'\ + \ -Method GET -Headers $headers" + /systemgroups/{group_id}/usergroups: + get: + tags: + - Graph + - System Group Associations + - System Groups + summary: List the User Groups bound to a System Group + description: "This endpoint will return all User Groups bound to a System Group,\ + \ either directly or indirectly, essentially traversing the JumpCloud Graph\ + \ for your Organization.\n\nEach element will contain the type, id, attributes\ + \ and paths.\n\nThe `attributes` object is a key/value hash of compiled graph\ + \ attributes for all paths followed.\n\nThe `paths` array enumerates each\ + \ path from this System Group to the corresponding User Group; this array\ + \ represents all grouping and/or associations that would have to be removed\ + \ to deprovision the User Group from this System Group.\n\nSee `/members`\ + \ and `/associations` endpoints to manage those collections.\n\n#### Sample\ + \ Request\n```\ncurl -X GET https://console.jumpcloud.com/api/v2/systemgroups/{GroupID}/usergroups\ + \ \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\ + \ \\\n -H 'x-api-key: {API_KEY}'\n\n```" + operationId: graph_systemGroupTraverseUserGroup + parameters: + - name: group_id + in: path + description: ObjectID of the System Group. + required: true + style: simple + explode: false + schema: + type: string + - name: limit + in: query + description: The number of records to return at once. Limited to 100. + required: false + style: form + explode: true + schema: + type: integer + default: 10 + - name: x-org-id + in: header + description: Organization identifier that can be obtained from console settings. + required: false + style: simple + explode: false + schema: + type: string + - name: skip + in: query + description: The offset into the records to return. + required: false + style: form + explode: true + schema: + minimum: 0 + type: integer + default: 0 + - name: filter + in: query + description: "A filter to apply to the query.\n\n**Filter structure**: `::`.\n\ + \n**field** = Populate with a valid field from an endpoint response.\n\n\ + **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between,\ + \ search, in.\n_Note: v1 operators differ from v2 operators._\n\n**value**\ + \ = Populate with the value you want to search for. Is case sensitive. Supports\ + \ wild cards.\n\n**EX:** `GET /api/v2/groups?filter=name:eq:Test+Group`" + required: false + style: form + explode: false + schema: + type: array + items: + type: string + responses: + "200": + description: OK + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/GraphObjectWithPaths' + x-content-type: application/json + security: + - x-api-key: [] + x-scopes: + - groups + - groups.readonly + x-codeSamples: + - lang: Shell + source: "curl --request GET \\\n --url 'https://console.jumpcloud.com/api/v2/systemgroups/{group_id}/usergroups?limit=10&skip=0'\ + \ \\\n --header 'x-api-key: REPLACE_KEY_VALUE' \\\n --header 'x-org-id:\ + \ SOME_STRING_VALUE'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/systemgroups/{group_id}/usergroups\"\ + \n\nquerystring = {\"limit\":\"10\",\"skip\":\"0\"}\n\nheaders = {\n \ + \ \"x-org-id\": \"SOME_STRING_VALUE\",\n \"x-api-key\": \"REPLACE_KEY_VALUE\"\ + \n}\n\nresponse = requests.request(\"GET\", url, headers=headers, params=querystring)\n\ + \nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-org-id\", \"SOME_STRING_VALUE\")\n\ + $headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n$response = Invoke-RestMethod\ + \ -Uri 'https://console.jumpcloud.com/api/v2/systemgroups/{group_id}/usergroups?limit=10&skip=0'\ + \ -Method GET -Headers $headers" + /systemgroups/{group_id}/users: + get: + tags: + - Graph + - System Group Associations + - System Groups + summary: List the Users bound to a System Group + description: "This endpoint will return all Users bound to a System Group, either\ + \ directly or indirectly, essentially traversing the JumpCloud Graph for your\ + \ Organization.\n\nEach element will contain the type, id, attributes and\ + \ paths.\n\nThe `attributes` object is a key/value hash of compiled graph\ + \ attributes for all paths followed.\n\nThe `paths` array enumerates each\ + \ path from this System Group to the corresponding User; this array represents\ + \ all grouping and/or associations that would have to be removed to deprovision\ + \ the User from this System Group.\n\nSee `/members` and `/associations` endpoints\ + \ to manage those collections.\n\n#### Sample Request\n```\ncurl -X GET https://console.jumpcloud.com/api/v2/systemgroups/{GroupID}/users\ + \ \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\ + \ \\\n -H 'x-api-key: {API_KEY}'\n```" + operationId: graph_systemGroupTraverseUser + parameters: + - name: group_id + in: path + description: ObjectID of the System Group. + required: true + style: simple + explode: false + schema: + type: string + - name: limit + in: query + description: The number of records to return at once. Limited to 100. + required: false + style: form + explode: true + schema: + type: integer + default: 10 + - name: x-org-id + in: header + description: Organization identifier that can be obtained from console settings. + required: false + style: simple + explode: false + schema: + type: string + - name: skip + in: query + description: The offset into the records to return. + required: false + style: form + explode: true + schema: + minimum: 0 + type: integer + default: 0 + - name: filter + in: query + description: "A filter to apply to the query.\n\n**Filter structure**: `::`.\n\ + \n**field** = Populate with a valid field from an endpoint response.\n\n\ + **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between,\ + \ search, in.\n_Note: v1 operators differ from v2 operators._\n\n**value**\ + \ = Populate with the value you want to search for. Is case sensitive. Supports\ + \ wild cards.\n\n**EX:** `GET /api/v2/groups?filter=name:eq:Test+Group`" + required: false + style: form + explode: false + schema: + type: array + items: + type: string + responses: + "200": + description: OK + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/GraphObjectWithPaths' + x-content-type: application/json + security: + - x-api-key: [] + x-scopes: + - users + - users.readonly + x-codeSamples: + - lang: Shell + source: "curl --request GET \\\n --url 'https://console.jumpcloud.com/api/v2/systemgroups/{group_id}/users?limit=10&skip=0'\ + \ \\\n --header 'x-api-key: REPLACE_KEY_VALUE' \\\n --header 'x-org-id:\ + \ SOME_STRING_VALUE'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/systemgroups/{group_id}/users\"\ + \n\nquerystring = {\"limit\":\"10\",\"skip\":\"0\"}\n\nheaders = {\n \ + \ \"x-org-id\": \"SOME_STRING_VALUE\",\n \"x-api-key\": \"REPLACE_KEY_VALUE\"\ + \n}\n\nresponse = requests.request(\"GET\", url, headers=headers, params=querystring)\n\ + \nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-org-id\", \"SOME_STRING_VALUE\")\n\ + $headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n$response = Invoke-RestMethod\ + \ -Uri 'https://console.jumpcloud.com/api/v2/systemgroups/{group_id}/users?limit=10&skip=0'\ + \ -Method GET -Headers $headers" + /systemgroups/{id}: + get: + tags: + - System Groups + summary: View an individual System Group details + description: "This endpoint returns the details of a System Group.\n\n#### Sample\ + \ Request\n```\ncurl -X GET https://console.jumpcloud.com/api/v2/systemgroups/{Group_ID}\ + \ \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\ + \ \\\n -H 'x-api-key: {API_KEY}'\n```" + operationId: groups_system_get + parameters: + - name: id + in: path + description: ObjectID of the System Group. + required: true + style: simple + explode: false + schema: + type: string + - name: x-org-id + in: header + description: Organization identifier that can be obtained from console settings. + required: false + style: simple + explode: false + schema: + type: string + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/SystemGroup' + example: + id: "000000" + name: group1 + type: system_group + security: + - x-api-key: [] + x-scopes: + - groups + - groups.readonly + x-codeSamples: + - lang: Shell + source: "curl --request GET \\\n --url https://console.jumpcloud.com/api/v2/systemgroups/{id}\ + \ \\\n --header 'x-api-key: REPLACE_KEY_VALUE' \\\n --header 'x-org-id:\ + \ SOME_STRING_VALUE'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/systemgroups/{id}\"\ + \n\nheaders = {\n \"x-org-id\": \"SOME_STRING_VALUE\",\n \"x-api-key\"\ + : \"REPLACE_KEY_VALUE\"\n}\n\nresponse = requests.request(\"GET\", url,\ + \ headers=headers)\n\nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-org-id\", \"SOME_STRING_VALUE\")\n\ + $headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n$response = Invoke-RestMethod\ + \ -Uri 'https://console.jumpcloud.com/api/v2/systemgroups/{id}' -Method\ + \ GET -Headers $headers" + put: + tags: + - System Groups + summary: Update a System Group + description: "This endpoint allows you to do a full update of the System Group.\n\ + \n#### Sample Request\n```\ncurl -X PUT https://console.jumpcloud.com/api/v2/systemgroups/{Group_ID}\ + \ \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\ + \ \\\n -H 'x-api-key: {API_KEY}' \\\n -d '{\n \"name\": \"Name_Update\"\ + \n }'\n```" + operationId: groups_system_put + parameters: + - name: id + in: path + description: ObjectID of the System Group. + required: true + style: simple + explode: false + schema: + type: string + - name: x-org-id + in: header + description: Organization identifier that can be obtained from console settings. + required: false + style: simple + explode: false + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/SystemGroupData' + required: false + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/SystemGroup' + example: + id: "00000" + name: group1 + type: system_group + security: + - x-api-key: [] + x-scopes: + - groups + x-codeSamples: + - lang: Shell + source: "curl --request PUT \\\n --url https://console.jumpcloud.com/api/v2/systemgroups/{id}\ + \ \\\n --header 'content-type: application/json' \\\n --header 'x-api-key:\ + \ REPLACE_KEY_VALUE' \\\n --header 'x-org-id: SOME_STRING_VALUE' \\\n \ + \ --data '{\"name\":\"string\"}'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/systemgroups/{id}\"\ + \n\npayload = {\"name\": \"string\"}\nheaders = {\n \"x-org-id\": \"\ + SOME_STRING_VALUE\",\n \"x-api-key\": \"REPLACE_KEY_VALUE\",\n \"\ + content-type\": \"application/json\"\n}\n\nresponse = requests.request(\"\ + PUT\", url, json=payload, headers=headers)\n\nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-org-id\", \"SOME_STRING_VALUE\")\n\ + $headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n$headers.Add(\"content-type\"\ + , \"application/json\")\n$response = Invoke-RestMethod -Uri 'https://console.jumpcloud.com/api/v2/systemgroups/{id}'\ + \ -Method PUT -Headers $headers -ContentType 'application/json' -Body '{\"\ + name\":\"string\"}'" + x-codegen-request-body-name: body + delete: + tags: + - System Groups + summary: Delete a System Group + description: "This endpoint allows you to delete a System Group.\n\n#### Sample\ + \ Request\n```\ncurl -X DELETE https://console.jumpcloud.com/api/v2/systemgroups/{Group_ID}\ + \ \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\ + \ \\\n -H 'x-api-key: {API_KEY}'\n\n```" + operationId: groups_system_delete + parameters: + - name: id + in: path + description: ObjectID of the System Group. + required: true + style: simple + explode: false + schema: + type: string + - name: x-org-id + in: header + description: Organization identifier that can be obtained from console settings. + required: false + style: simple + explode: false + schema: + type: string + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/SystemGroup' + "204": + description: No Content + content: {} + security: + - x-api-key: [] + x-scopes: + - groups + x-codeSamples: + - lang: Shell + source: "curl --request DELETE \\\n --url https://console.jumpcloud.com/api/v2/systemgroups/{id}\ + \ \\\n --header 'x-api-key: REPLACE_KEY_VALUE' \\\n --header 'x-org-id:\ + \ SOME_STRING_VALUE'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/systemgroups/{id}\"\ + \n\nheaders = {\n \"x-org-id\": \"SOME_STRING_VALUE\",\n \"x-api-key\"\ + : \"REPLACE_KEY_VALUE\"\n}\n\nresponse = requests.request(\"DELETE\", url,\ + \ headers=headers)\n\nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-org-id\", \"SOME_STRING_VALUE\")\n\ + $headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n$response = Invoke-RestMethod\ + \ -Uri 'https://console.jumpcloud.com/api/v2/systemgroups/{id}' -Method\ + \ DELETE -Headers $headers" + /systeminsights/alf: + get: + tags: + - System Insights + summary: List System Insights ALF + description: Valid filter fields are `system_id` and `global_state`. + operationId: systeminsights_list_alf + parameters: + - name: x-org-id + in: header + description: Organization identifier that can be obtained from console settings. + required: false + style: simple + explode: false + schema: + type: string + - name: filter + in: query + description: "Supported operators are: eq, in. e.g:\nFilter for single value:\n\ + `filter=field:eq:value`\nFilter for any value in a list: (note \"pipe\"\ + \ character: `|` separating values)\n`filter=field:in:value1|value2|value3`\n" + required: false + style: form + explode: false + schema: + type: array + items: + type: string + - name: skip + in: query + description: The offset into the records to return. + required: false + style: form + explode: true + schema: + minimum: 0 + type: integer + default: 0 + - name: sort + in: query + description: "The comma separated fields used to sort the collection.\nDefault\ + \ sort is ascending, prefix with `-` to sort descending. e.g:\nSort by single\ + \ field:\n`sort=field`\nSort descending by single field:\n`sort=-field`\n\ + Sort by multiple fields:\n`sort=field1,-field2,field3`\n" + required: false + style: form + explode: false + schema: + type: array + items: + type: string + - name: limit + in: query + required: false + style: form + explode: true + schema: + maximum: 10000 + minimum: 0 + type: integer + default: 10 + responses: + "200": + description: "" + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/system-insights-alf' + x-content-type: application/json + security: + - x-api-key: [] + x-scopes: + - systeminsights.readonly + x-codeSamples: + - lang: Shell + source: "curl --request GET \\\n --url 'https://console.jumpcloud.com/api/v2/systeminsights/alf?skip=0&limit=10'\ + \ \\\n --header 'x-api-key: REPLACE_KEY_VALUE' \\\n --header 'x-org-id:\ + \ SOME_STRING_VALUE'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/systeminsights/alf\"\ + \n\nquerystring = {\"skip\":\"0\",\"limit\":\"10\"}\n\nheaders = {\n \ + \ \"x-org-id\": \"SOME_STRING_VALUE\",\n \"x-api-key\": \"REPLACE_KEY_VALUE\"\ + \n}\n\nresponse = requests.request(\"GET\", url, headers=headers, params=querystring)\n\ + \nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-org-id\", \"SOME_STRING_VALUE\")\n\ + $headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n$response = Invoke-RestMethod\ + \ -Uri 'https://console.jumpcloud.com/api/v2/systeminsights/alf?skip=0&limit=10'\ + \ -Method GET -Headers $headers" + /systeminsights/alf_exceptions: + get: + tags: + - System Insights + summary: List System Insights ALF Exceptions + description: Valid filter fields are `system_id` and `state`. + operationId: systeminsights_list_alf_exceptions + parameters: + - name: x-org-id + in: header + description: Organization identifier that can be obtained from console settings. + required: false + style: simple + explode: false + schema: + type: string + - name: filter + in: query + description: "Supported operators are: eq, in. e.g:\nFilter for single value:\n\ + `filter=field:eq:value`\nFilter for any value in a list: (note \"pipe\"\ + \ character: `|` separating values)\n`filter=field:in:value1|value2|value3`\n" + required: false + style: form + explode: false + schema: + type: array + items: + type: string + - name: skip + in: query + description: The offset into the records to return. + required: false + style: form + explode: true + schema: + minimum: 0 + type: integer + default: 0 + - name: sort + in: query + description: "The comma separated fields used to sort the collection.\nDefault\ + \ sort is ascending, prefix with `-` to sort descending. e.g:\nSort by single\ + \ field:\n`sort=field`\nSort descending by single field:\n`sort=-field`\n\ + Sort by multiple fields:\n`sort=field1,-field2,field3`\n" + required: false + style: form + explode: false + schema: + type: array + items: + type: string + - name: limit + in: query + required: false + style: form + explode: true + schema: + maximum: 10000 + minimum: 0 + type: integer + default: 10 + responses: + "200": + description: "" + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/system-insights-alf-exceptions' + x-content-type: application/json + security: + - x-api-key: [] + x-scopes: + - systeminsights.readonly + x-codeSamples: + - lang: Shell + source: "curl --request GET \\\n --url 'https://console.jumpcloud.com/api/v2/systeminsights/alf_exceptions?skip=0&limit=10'\ + \ \\\n --header 'x-api-key: REPLACE_KEY_VALUE' \\\n --header 'x-org-id:\ + \ SOME_STRING_VALUE'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/systeminsights/alf_exceptions\"\ + \n\nquerystring = {\"skip\":\"0\",\"limit\":\"10\"}\n\nheaders = {\n \ + \ \"x-org-id\": \"SOME_STRING_VALUE\",\n \"x-api-key\": \"REPLACE_KEY_VALUE\"\ + \n}\n\nresponse = requests.request(\"GET\", url, headers=headers, params=querystring)\n\ + \nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-org-id\", \"SOME_STRING_VALUE\")\n\ + $headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n$response = Invoke-RestMethod\ + \ -Uri 'https://console.jumpcloud.com/api/v2/systeminsights/alf_exceptions?skip=0&limit=10'\ + \ -Method GET -Headers $headers" + /systeminsights/alf_explicit_auths: + get: + tags: + - System Insights + summary: List System Insights ALF Explicit Authentications + description: Valid filter fields are `system_id` and `process`. + operationId: systeminsights_list_alf_explicit_auths + parameters: + - name: x-org-id + in: header + description: Organization identifier that can be obtained from console settings. + required: false + style: simple + explode: false + schema: + type: string + - name: filter + in: query + description: "Supported operators are: eq, in. e.g:\nFilter for single value:\n\ + `filter=field:eq:value`\nFilter for any value in a list: (note \"pipe\"\ + \ character: `|` separating values)\n`filter=field:in:value1|value2|value3`\n" + required: false + style: form + explode: false + schema: + type: array + items: + type: string + - name: skip + in: query + description: The offset into the records to return. + required: false + style: form + explode: true + schema: + minimum: 0 + type: integer + default: 0 + - name: sort + in: query + description: "The comma separated fields used to sort the collection.\nDefault\ + \ sort is ascending, prefix with `-` to sort descending. e.g:\nSort by single\ + \ field:\n`sort=field`\nSort descending by single field:\n`sort=-field`\n\ + Sort by multiple fields:\n`sort=field1,-field2,field3`\n" + required: false + style: form + explode: false + schema: + type: array + items: + type: string + - name: limit + in: query + required: false + style: form + explode: true + schema: + maximum: 10000 + minimum: 0 + type: integer + default: 10 + responses: + "200": + description: "" + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/system-insights-alf-explicit-auths' + x-content-type: application/json + security: + - x-api-key: [] + x-scopes: + - systeminsights.readonly + x-codeSamples: + - lang: Shell + source: "curl --request GET \\\n --url 'https://console.jumpcloud.com/api/v2/systeminsights/alf_explicit_auths?skip=0&limit=10'\ + \ \\\n --header 'x-api-key: REPLACE_KEY_VALUE' \\\n --header 'x-org-id:\ + \ SOME_STRING_VALUE'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/systeminsights/alf_explicit_auths\"\ + \n\nquerystring = {\"skip\":\"0\",\"limit\":\"10\"}\n\nheaders = {\n \ + \ \"x-org-id\": \"SOME_STRING_VALUE\",\n \"x-api-key\": \"REPLACE_KEY_VALUE\"\ + \n}\n\nresponse = requests.request(\"GET\", url, headers=headers, params=querystring)\n\ + \nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-org-id\", \"SOME_STRING_VALUE\")\n\ + $headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n$response = Invoke-RestMethod\ + \ -Uri 'https://console.jumpcloud.com/api/v2/systeminsights/alf_explicit_auths?skip=0&limit=10'\ + \ -Method GET -Headers $headers" + /systeminsights/appcompat_shims: + get: + tags: + - System Insights + summary: List System Insights Application Compatibility Shims + description: Valid filter fields are `system_id` and `enabled`. + operationId: systeminsights_list_appcompat_shims + parameters: + - name: x-org-id + in: header + description: Organization identifier that can be obtained from console settings. + required: false + style: simple + explode: false + schema: + type: string + - name: skip + in: query + description: The offset into the records to return. + required: false + style: form + explode: true + schema: + minimum: 0 + type: integer + default: 0 + - name: sort + in: query + description: "The comma separated fields used to sort the collection.\nDefault\ + \ sort is ascending, prefix with `-` to sort descending. e.g:\nSort by single\ + \ field:\n`sort=field`\nSort descending by single field:\n`sort=-field`\n\ + Sort by multiple fields:\n`sort=field1,-field2,field3`\n" + required: false + style: form + explode: false + schema: + type: array + items: + type: string + - name: filter + in: query + description: "Supported operators are: eq, in. e.g:\nFilter for single value:\n\ + `filter=field:eq:value`\nFilter for any value in a list: (note \"pipe\"\ + \ character: `|` separating values)\n`filter=field:in:value1|value2|value3`\n" + required: false + style: form + explode: false + schema: + type: array + items: + type: string + - name: limit + in: query + required: false + style: form + explode: true + schema: + maximum: 10000 + minimum: 0 + type: integer + default: 10 + responses: + "200": + description: "" + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/system-insights-appcompat-shims' + x-content-type: application/json + security: + - x-api-key: [] + x-scopes: + - systeminsights.readonly + x-codeSamples: + - lang: Shell + source: "curl --request GET \\\n --url 'https://console.jumpcloud.com/api/v2/systeminsights/appcompat_shims?skip=0&limit=10'\ + \ \\\n --header 'x-api-key: REPLACE_KEY_VALUE' \\\n --header 'x-org-id:\ + \ SOME_STRING_VALUE'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/systeminsights/appcompat_shims\"\ + \n\nquerystring = {\"skip\":\"0\",\"limit\":\"10\"}\n\nheaders = {\n \ + \ \"x-org-id\": \"SOME_STRING_VALUE\",\n \"x-api-key\": \"REPLACE_KEY_VALUE\"\ + \n}\n\nresponse = requests.request(\"GET\", url, headers=headers, params=querystring)\n\ + \nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-org-id\", \"SOME_STRING_VALUE\")\n\ + $headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n$response = Invoke-RestMethod\ + \ -Uri 'https://console.jumpcloud.com/api/v2/systeminsights/appcompat_shims?skip=0&limit=10'\ + \ -Method GET -Headers $headers" + /systeminsights/apps: + get: + tags: + - System Insights + summary: List System Insights Apps + description: "Lists all apps for macOS devices. For Windows devices, use [List\ + \ System Insights Programs](#operation/systeminsights_list_programs).\n\n\ + Valid filter fields are `system_id` and `bundle_name`." + operationId: systeminsights_list_apps + parameters: + - name: x-org-id + in: header + description: Organization identifier that can be obtained from console settings. + required: false + style: simple + explode: false + schema: + type: string + - name: skip + in: query + description: The offset into the records to return. + required: false + style: form + explode: true + schema: + minimum: 0 + type: integer + default: 0 + - name: sort + in: query + description: "The comma separated fields used to sort the collection.\nDefault\ + \ sort is ascending, prefix with `-` to sort descending. e.g:\nSort by single\ + \ field:\n`sort=field`\nSort descending by single field:\n`sort=-field`\n\ + Sort by multiple fields:\n`sort=field1,-field2,field3`\n" + required: false + style: form + explode: false + schema: + type: array + items: + type: string + - name: filter + in: query + description: "Supported operators are: eq, in. e.g:\nFilter for single value:\n\ + `filter=field:eq:value`\nFilter for any value in a list: (note \"pipe\"\ + \ character: `|` separating values)\n`filter=field:in:value1|value2|value3`\n" + required: false + style: form + explode: false + schema: + type: array + items: + type: string + - name: limit + in: query + required: false + style: form + explode: true + schema: + maximum: 10000 + minimum: 0 + type: integer + default: 10 + responses: + "200": + description: "" + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/system-insights-apps' + x-content-type: application/json + security: + - x-api-key: [] + x-scopes: + - systeminsights.readonly + x-codeSamples: + - lang: Shell + source: "curl --request GET \\\n --url 'https://console.jumpcloud.com/api/v2/systeminsights/apps?skip=0&limit=10'\ + \ \\\n --header 'x-api-key: REPLACE_KEY_VALUE' \\\n --header 'x-org-id:\ + \ SOME_STRING_VALUE'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/systeminsights/apps\"\ + \n\nquerystring = {\"skip\":\"0\",\"limit\":\"10\"}\n\nheaders = {\n \ + \ \"x-org-id\": \"SOME_STRING_VALUE\",\n \"x-api-key\": \"REPLACE_KEY_VALUE\"\ + \n}\n\nresponse = requests.request(\"GET\", url, headers=headers, params=querystring)\n\ + \nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-org-id\", \"SOME_STRING_VALUE\")\n\ + $headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n$response = Invoke-RestMethod\ + \ -Uri 'https://console.jumpcloud.com/api/v2/systeminsights/apps?skip=0&limit=10'\ + \ -Method GET -Headers $headers" + /systeminsights/authorized_keys: + get: + tags: + - System Insights + summary: List System Insights Authorized Keys + description: Valid filter fields are `system_id` and `uid`. + operationId: systeminsights_list_authorized_keys + parameters: + - name: x-org-id + in: header + description: Organization identifier that can be obtained from console settings. + required: false + style: simple + explode: false + schema: + type: string + - name: skip + in: query + description: The offset into the records to return. + required: false + style: form + explode: true + schema: + minimum: 0 + type: integer + default: 0 + - name: sort + in: query + description: "The comma separated fields used to sort the collection.\nDefault\ + \ sort is ascending, prefix with `-` to sort descending. e.g:\nSort by single\ + \ field:\n`sort=field`\nSort descending by single field:\n`sort=-field`\n\ + Sort by multiple fields:\n`sort=field1,-field2,field3`\n" + required: false + style: form + explode: false + schema: + type: array + items: + type: string + - name: filter + in: query + description: "Supported operators are: eq, in. e.g:\nFilter for single value:\n\ + `filter=field:eq:value`\nFilter for any value in a list: (note \"pipe\"\ + \ character: `|` separating values)\n`filter=field:in:value1|value2|value3`\n" + required: false + style: form + explode: false + schema: + type: array + items: + type: string + - name: limit + in: query + required: false + style: form + explode: true + schema: + maximum: 10000 + minimum: 0 + type: integer + default: 10 + responses: + "200": + description: "" + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/system-insights-authorized-keys' + x-content-type: application/json + security: + - x-api-key: [] + x-scopes: + - systeminsights.readonly + x-codeSamples: + - lang: Shell + source: "curl --request GET \\\n --url 'https://console.jumpcloud.com/api/v2/systeminsights/authorized_keys?skip=0&limit=10'\ + \ \\\n --header 'x-api-key: REPLACE_KEY_VALUE' \\\n --header 'x-org-id:\ + \ SOME_STRING_VALUE'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/systeminsights/authorized_keys\"\ + \n\nquerystring = {\"skip\":\"0\",\"limit\":\"10\"}\n\nheaders = {\n \ + \ \"x-org-id\": \"SOME_STRING_VALUE\",\n \"x-api-key\": \"REPLACE_KEY_VALUE\"\ + \n}\n\nresponse = requests.request(\"GET\", url, headers=headers, params=querystring)\n\ + \nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-org-id\", \"SOME_STRING_VALUE\")\n\ + $headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n$response = Invoke-RestMethod\ + \ -Uri 'https://console.jumpcloud.com/api/v2/systeminsights/authorized_keys?skip=0&limit=10'\ + \ -Method GET -Headers $headers" + /systeminsights/azure_instance_metadata: + get: + tags: + - System Insights + summary: List System Insights Azure Instance Metadata + description: Valid filter fields are `system_id`. + operationId: systeminsights_list_azure_instance_metadata + parameters: + - name: skip + in: query + description: The offset into the records to return. + required: false + style: form + explode: true + schema: + minimum: 0 + type: integer + default: 0 + - name: sort + in: query + description: "The comma separated fields used to sort the collection.\nDefault\ + \ sort is ascending, prefix with `-` to sort descending. e.g:\nSort by single\ + \ field:\n`sort=field`\nSort descending by single field:\n`sort=-field`\n\ + Sort by multiple fields:\n`sort=field1,-field2,field3`\n" + required: false + style: form + explode: false + schema: + type: array + items: + type: string + - name: filter + in: query + description: "Supported operators are: eq, in. e.g:\nFilter for single value:\n\ + `filter=field:eq:value`\nFilter for any value in a list: (note \"pipe\"\ + \ character: `|` separating values)\n`filter=field:in:value1|value2|value3`\n" + required: false + style: form + explode: false + schema: + type: array + items: + type: string + - name: x-org-id + in: header + description: Organization identifier that can be obtained from console settings. + required: false + style: simple + explode: false + schema: + type: string + - name: limit + in: query + required: false + style: form + explode: true + schema: + maximum: 10000 + minimum: 0 + type: integer + default: 10 + responses: + "200": + description: "" + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/system-insights-azure-instance-metadata' + x-content-type: application/json + "400": + description: "" + content: + application/json: + schema: + type: string + x-content-type: application/json + x-scopes: + - systeminsights.readonly + x-codeSamples: + - lang: Shell + source: "curl --request GET \\\n --url 'https://console.jumpcloud.com/api/v2/systeminsights/azure_instance_metadata?skip=0&limit=10'\ + \ \\\n --header 'x-org-id: SOME_STRING_VALUE'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/systeminsights/azure_instance_metadata\"\ + \n\nquerystring = {\"skip\":\"0\",\"limit\":\"10\"}\n\nheaders = {\"x-org-id\"\ + : \"SOME_STRING_VALUE\"}\n\nresponse = requests.request(\"GET\", url, headers=headers,\ + \ params=querystring)\n\nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-org-id\", \"SOME_STRING_VALUE\")\n\ + $response = Invoke-RestMethod -Uri 'https://console.jumpcloud.com/api/v2/systeminsights/azure_instance_metadata?skip=0&limit=10'\ + \ -Method GET -Headers $headers" + /systeminsights/azure_instance_tags: + get: + tags: + - System Insights + summary: List System Insights Azure Instance Tags + description: Valid filter fields are `system_id`. + operationId: systeminsights_list_azure_instance_tags + parameters: + - name: skip + in: query + description: The offset into the records to return. + required: false + style: form + explode: true + schema: + minimum: 0 + type: integer + default: 0 + - name: sort + in: query + description: "The comma separated fields used to sort the collection.\nDefault\ + \ sort is ascending, prefix with `-` to sort descending. e.g:\nSort by single\ + \ field:\n`sort=field`\nSort descending by single field:\n`sort=-field`\n\ + Sort by multiple fields:\n`sort=field1,-field2,field3`\n" + required: false + style: form + explode: false + schema: + type: array + items: + type: string + - name: filter + in: query + description: "Supported operators are: eq, in. e.g:\nFilter for single value:\n\ + `filter=field:eq:value`\nFilter for any value in a list: (note \"pipe\"\ + \ character: `|` separating values)\n`filter=field:in:value1|value2|value3`\n" + required: false + style: form + explode: false + schema: + type: array + items: + type: string + - name: x-org-id + in: header + description: Organization identifier that can be obtained from console settings. + required: false + style: simple + explode: false + schema: + type: string + - name: limit + in: query + required: false + style: form + explode: true + schema: + maximum: 10000 + minimum: 0 + type: integer + default: 10 + responses: + "200": + description: "" + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/system-insights-azure-instance-tags' + x-content-type: application/json + "400": + description: "" + content: + application/json: + schema: + type: string + x-content-type: application/json + x-scopes: + - systeminsights.readonly + x-codeSamples: + - lang: Shell + source: "curl --request GET \\\n --url 'https://console.jumpcloud.com/api/v2/systeminsights/azure_instance_tags?skip=0&limit=10'\ + \ \\\n --header 'x-org-id: SOME_STRING_VALUE'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/systeminsights/azure_instance_tags\"\ + \n\nquerystring = {\"skip\":\"0\",\"limit\":\"10\"}\n\nheaders = {\"x-org-id\"\ + : \"SOME_STRING_VALUE\"}\n\nresponse = requests.request(\"GET\", url, headers=headers,\ + \ params=querystring)\n\nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-org-id\", \"SOME_STRING_VALUE\")\n\ + $response = Invoke-RestMethod -Uri 'https://console.jumpcloud.com/api/v2/systeminsights/azure_instance_tags?skip=0&limit=10'\ + \ -Method GET -Headers $headers" + /systeminsights/battery: + get: + tags: + - System Insights + summary: List System Insights Battery + description: Valid filter fields are `system_id` and `health`. + operationId: systeminsights_list_battery + parameters: + - name: x-org-id + in: header + description: Organization identifier that can be obtained from console settings. + required: false + style: simple + explode: false + schema: + type: string + - name: skip + in: query + description: The offset into the records to return. + required: false + style: form + explode: true + schema: + minimum: 0 + type: integer + default: 0 + - name: sort + in: query + description: "The comma separated fields used to sort the collection.\nDefault\ + \ sort is ascending, prefix with `-` to sort descending. e.g:\nSort by single\ + \ field:\n`sort=field`\nSort descending by single field:\n`sort=-field`\n\ + Sort by multiple fields:\n`sort=field1,-field2,field3`\n" + required: false + style: form + explode: false + schema: + type: array + items: + type: string + - name: filter + in: query + description: "Supported operators are: eq, in. e.g:\nFilter for single value:\n\ + `filter=field:eq:value`\nFilter for any value in a list: (note \"pipe\"\ + \ character: `|` separating values)\n`filter=field:in:value1|value2|value3`\n" + required: false + style: form + explode: false + schema: + type: array + items: + type: string + - name: limit + in: query + required: false + style: form + explode: true + schema: + maximum: 10000 + minimum: 0 + type: integer + default: 10 + responses: + "200": + description: "" + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/system-insights-battery' + x-content-type: application/json + security: + - x-api-key: [] + x-scopes: + - systeminsights.readonly + x-codeSamples: + - lang: Shell + source: "curl --request GET \\\n --url 'https://console.jumpcloud.com/api/v2/systeminsights/battery?skip=0&limit=10'\ + \ \\\n --header 'x-api-key: REPLACE_KEY_VALUE' \\\n --header 'x-org-id:\ + \ SOME_STRING_VALUE'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/systeminsights/battery\"\ + \n\nquerystring = {\"skip\":\"0\",\"limit\":\"10\"}\n\nheaders = {\n \ + \ \"x-org-id\": \"SOME_STRING_VALUE\",\n \"x-api-key\": \"REPLACE_KEY_VALUE\"\ + \n}\n\nresponse = requests.request(\"GET\", url, headers=headers, params=querystring)\n\ + \nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-org-id\", \"SOME_STRING_VALUE\")\n\ + $headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n$response = Invoke-RestMethod\ + \ -Uri 'https://console.jumpcloud.com/api/v2/systeminsights/battery?skip=0&limit=10'\ + \ -Method GET -Headers $headers" + /systeminsights/bitlocker_info: + get: + tags: + - System Insights + summary: List System Insights Bitlocker Info + description: Valid filter fields are `system_id` and `protection_status`. + operationId: systeminsights_list_bitlocker_info + parameters: + - name: skip + in: query + description: The offset into the records to return. + required: false + style: form + explode: true + schema: + minimum: 0 + type: integer + default: 0 + - name: sort + in: query + description: "The comma separated fields used to sort the collection.\nDefault\ + \ sort is ascending, prefix with `-` to sort descending. e.g:\nSort by single\ + \ field:\n`sort=field`\nSort descending by single field:\n`sort=-field`\n\ + Sort by multiple fields:\n`sort=field1,-field2,field3`\n" + required: false + style: form + explode: false + schema: + type: array + items: + type: string + - name: filter + in: query + description: "Supported operators are: eq, in. e.g:\nFilter for single value:\n\ + `filter=field:eq:value`\nFilter for any value in a list: (note \"pipe\"\ + \ character: `|` separating values)\n`filter=field:in:value1|value2|value3`\n" + required: false + style: form + explode: false + schema: + type: array + items: + type: string + - name: x-org-id + in: header + description: Organization identifier that can be obtained from console settings. + required: false + style: simple + explode: false + schema: + type: string + - name: limit + in: query + required: false + style: form + explode: true + schema: + maximum: 10000 + minimum: 0 + type: integer + default: 10 + responses: + "200": + description: "" + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/system-insights-bitlocker-info' + x-content-type: application/json + security: + - x-api-key: [] + x-scopes: + - systeminsights.readonly + x-codeSamples: + - lang: Shell + source: "curl --request GET \\\n --url 'https://console.jumpcloud.com/api/v2/systeminsights/bitlocker_info?skip=0&limit=10'\ + \ \\\n --header 'x-api-key: REPLACE_KEY_VALUE' \\\n --header 'x-org-id:\ + \ SOME_STRING_VALUE'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/systeminsights/bitlocker_info\"\ + \n\nquerystring = {\"skip\":\"0\",\"limit\":\"10\"}\n\nheaders = {\n \ + \ \"x-org-id\": \"SOME_STRING_VALUE\",\n \"x-api-key\": \"REPLACE_KEY_VALUE\"\ + \n}\n\nresponse = requests.request(\"GET\", url, headers=headers, params=querystring)\n\ + \nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-org-id\", \"SOME_STRING_VALUE\")\n\ + $headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n$response = Invoke-RestMethod\ + \ -Uri 'https://console.jumpcloud.com/api/v2/systeminsights/bitlocker_info?skip=0&limit=10'\ + \ -Method GET -Headers $headers" + /systeminsights/browser_plugins: + get: + tags: + - System Insights + summary: List System Insights Browser Plugins + description: Valid filter fields are `system_id` and `name`. + operationId: systeminsights_list_browser_plugins + parameters: + - name: skip + in: query + description: The offset into the records to return. + required: false + style: form + explode: true + schema: + minimum: 0 + type: integer + default: 0 + - name: sort + in: query + description: "The comma separated fields used to sort the collection.\nDefault\ + \ sort is ascending, prefix with `-` to sort descending. e.g:\nSort by single\ + \ field:\n`sort=field`\nSort descending by single field:\n`sort=-field`\n\ + Sort by multiple fields:\n`sort=field1,-field2,field3`\n" + required: false + style: form + explode: false + schema: + type: array + items: + type: string + - name: filter + in: query + description: "Supported operators are: eq, in. e.g:\nFilter for single value:\n\ + `filter=field:eq:value`\nFilter for any value in a list: (note \"pipe\"\ + \ character: `|` separating values)\n`filter=field:in:value1|value2|value3`\n" + required: false + style: form + explode: false + schema: + type: array + items: + type: string + - name: x-org-id + in: header + description: Organization identifier that can be obtained from console settings. + required: false + style: simple + explode: false + schema: + type: string + - name: limit + in: query + required: false + style: form + explode: true + schema: + maximum: 10000 + minimum: 0 + type: integer + default: 10 + responses: + "200": + description: "" + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/system-insights-browser-plugins' + x-content-type: application/json + security: + - x-api-key: [] + x-scopes: + - systeminsights.readonly + x-codeSamples: + - lang: Shell + source: "curl --request GET \\\n --url 'https://console.jumpcloud.com/api/v2/systeminsights/browser_plugins?skip=0&limit=10'\ + \ \\\n --header 'x-api-key: REPLACE_KEY_VALUE' \\\n --header 'x-org-id:\ + \ SOME_STRING_VALUE'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/systeminsights/browser_plugins\"\ + \n\nquerystring = {\"skip\":\"0\",\"limit\":\"10\"}\n\nheaders = {\n \ + \ \"x-org-id\": \"SOME_STRING_VALUE\",\n \"x-api-key\": \"REPLACE_KEY_VALUE\"\ + \n}\n\nresponse = requests.request(\"GET\", url, headers=headers, params=querystring)\n\ + \nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-org-id\", \"SOME_STRING_VALUE\")\n\ + $headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n$response = Invoke-RestMethod\ + \ -Uri 'https://console.jumpcloud.com/api/v2/systeminsights/browser_plugins?skip=0&limit=10'\ + \ -Method GET -Headers $headers" + /systeminsights/certificates: + get: + tags: + - System Insights + summary: List System Insights Certificates + description: Valid filter fields are `system_id` and `common_name`. + operationId: systeminsights_list_certificates + parameters: + - name: skip + in: query + description: The offset into the records to return. + required: false + style: form + explode: true + schema: + minimum: 0 + type: integer + default: 0 + - name: sort + in: query + description: "The comma separated fields used to sort the collection.\nDefault\ + \ sort is ascending, prefix with `-` to sort descending. e.g:\nSort by single\ + \ field:\n`sort=field`\nSort descending by single field:\n`sort=-field`\n\ + Sort by multiple fields:\n`sort=field1,-field2,field3`\n" + required: false + style: form + explode: false + schema: + type: array + items: + type: string + - name: filter + in: query + description: "Supported operators are: eq, in. e.g:\nFilter for single value:\n\ + `filter=field:eq:value`\nFilter value in a list: (note \"pipe\" character:\ + \ `|` separating values)\n`filter=field:in:value1|value2|value3`\nNote:\ + \ You can only filter by `system_id` and `common_name`\n" + required: false + style: form + explode: false + schema: + type: array + items: + type: string + - name: x-org-id + in: header + description: Organization identifier that can be obtained from console settings. + required: false + style: simple + explode: false + schema: + type: string + - name: limit + in: query + required: false + style: form + explode: true + schema: + maximum: 10000 + minimum: 0 + type: integer + default: 10 + responses: + "200": + description: "" + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/system-insights-certificates' + x-content-type: application/json + security: + - x-api-key: [] + x-scopes: + - systeminsights.readonly + x-codeSamples: + - lang: Shell + source: "curl --request GET \\\n --url 'https://console.jumpcloud.com/api/v2/systeminsights/certificates?skip=0&limit=10'\ + \ \\\n --header 'x-api-key: REPLACE_KEY_VALUE' \\\n --header 'x-org-id:\ + \ SOME_STRING_VALUE'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/systeminsights/certificates\"\ + \n\nquerystring = {\"skip\":\"0\",\"limit\":\"10\"}\n\nheaders = {\n \ + \ \"x-org-id\": \"SOME_STRING_VALUE\",\n \"x-api-key\": \"REPLACE_KEY_VALUE\"\ + \n}\n\nresponse = requests.request(\"GET\", url, headers=headers, params=querystring)\n\ + \nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-org-id\", \"SOME_STRING_VALUE\")\n\ + $headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n$response = Invoke-RestMethod\ + \ -Uri 'https://console.jumpcloud.com/api/v2/systeminsights/certificates?skip=0&limit=10'\ + \ -Method GET -Headers $headers" + /systeminsights/chassis_info: + get: + tags: + - System Insights + summary: List System Insights Chassis Info + description: Valid filter fields are `system_id`. + operationId: systeminsights_list_chassis_info + parameters: + - name: skip + in: query + description: The offset into the records to return. + required: false + style: form + explode: true + schema: + minimum: 0 + type: integer + default: 0 + - name: sort + in: query + description: "The comma separated fields used to sort the collection.\nDefault\ + \ sort is ascending, prefix with `-` to sort descending. e.g:\nSort by single\ + \ field:\n`sort=field`\nSort descending by single field:\n`sort=-field`\n\ + Sort by multiple fields:\n`sort=field1,-field2,field3`\n" + required: false + style: form + explode: false + schema: + type: array + items: + type: string + - name: filter + in: query + description: "Supported operators are: eq, in. e.g:\nFilter for single value:\n\ + `filter=field:eq:value`\nFilter for any value in a list: (note \"pipe\"\ + \ character: `|` separating values)\n`filter=field:in:value1|value2|value3`\n" + required: false + style: form + explode: false + schema: + type: array + items: + type: string + - name: x-org-id + in: header + description: Organization identifier that can be obtained from console settings. + required: false + style: simple + explode: false + schema: + type: string + - name: limit + in: query + required: false + style: form + explode: true + schema: + maximum: 10000 + minimum: 0 + type: integer + default: 10 + responses: + "200": + description: "" + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/system-insights-chassis-info' + x-content-type: application/json + "400": + description: "" + content: + application/json: + schema: + type: string + x-content-type: application/json + x-scopes: + - systeminsights.readonly + x-codeSamples: + - lang: Shell + source: "curl --request GET \\\n --url 'https://console.jumpcloud.com/api/v2/systeminsights/chassis_info?skip=0&limit=10'\ + \ \\\n --header 'x-org-id: SOME_STRING_VALUE'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/systeminsights/chassis_info\"\ + \n\nquerystring = {\"skip\":\"0\",\"limit\":\"10\"}\n\nheaders = {\"x-org-id\"\ + : \"SOME_STRING_VALUE\"}\n\nresponse = requests.request(\"GET\", url, headers=headers,\ + \ params=querystring)\n\nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-org-id\", \"SOME_STRING_VALUE\")\n\ + $response = Invoke-RestMethod -Uri 'https://console.jumpcloud.com/api/v2/systeminsights/chassis_info?skip=0&limit=10'\ + \ -Method GET -Headers $headers" + /systeminsights/chrome_extensions: + get: + tags: + - System Insights + summary: List System Insights Chrome Extensions + description: Valid filter fields are `system_id` and `name`. + operationId: systeminsights_list_chrome_extensions + parameters: + - name: x-org-id + in: header + description: Organization identifier that can be obtained from console settings. + required: false + style: simple + explode: false + schema: + type: string + - name: skip + in: query + description: The offset into the records to return. + required: false + style: form + explode: true + schema: + minimum: 0 + type: integer + default: 0 + - name: sort + in: query + description: "The comma separated fields used to sort the collection.\nDefault\ + \ sort is ascending, prefix with `-` to sort descending. e.g:\nSort by single\ + \ field:\n`sort=field`\nSort descending by single field:\n`sort=-field`\n\ + Sort by multiple fields:\n`sort=field1,-field2,field3`\n" + required: false + style: form + explode: false + schema: + type: array + items: + type: string + - name: filter + in: query + description: "Supported operators are: eq, in. e.g:\nFilter for single value:\n\ + `filter=field:eq:value`\nFilter for any value in a list: (note \"pipe\"\ + \ character: `|` separating values)\n`filter=field:in:value1|value2|value3`\n" + required: false + style: form + explode: false + schema: + type: array + items: + type: string + - name: limit + in: query + required: false + style: form + explode: true + schema: + maximum: 10000 + minimum: 0 + type: integer + default: 10 + responses: + "200": + description: "" + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/system-insights-chrome-extensions' + x-content-type: application/json + security: + - x-api-key: [] + x-scopes: + - systeminsights.readonly + x-codeSamples: + - lang: Shell + source: "curl --request GET \\\n --url 'https://console.jumpcloud.com/api/v2/systeminsights/chrome_extensions?skip=0&limit=10'\ + \ \\\n --header 'x-api-key: REPLACE_KEY_VALUE' \\\n --header 'x-org-id:\ + \ SOME_STRING_VALUE'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/systeminsights/chrome_extensions\"\ + \n\nquerystring = {\"skip\":\"0\",\"limit\":\"10\"}\n\nheaders = {\n \ + \ \"x-org-id\": \"SOME_STRING_VALUE\",\n \"x-api-key\": \"REPLACE_KEY_VALUE\"\ + \n}\n\nresponse = requests.request(\"GET\", url, headers=headers, params=querystring)\n\ + \nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-org-id\", \"SOME_STRING_VALUE\")\n\ + $headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n$response = Invoke-RestMethod\ + \ -Uri 'https://console.jumpcloud.com/api/v2/systeminsights/chrome_extensions?skip=0&limit=10'\ + \ -Method GET -Headers $headers" + /systeminsights/connectivity: + get: + tags: + - System Insights + summary: List System Insights Connectivity + description: The only valid filter field is `system_id`. + operationId: systeminsights_list_connectivity + parameters: + - name: x-org-id + in: header + description: Organization identifier that can be obtained from console settings. + required: false + style: simple + explode: false + schema: + type: string + - name: skip + in: query + description: The offset into the records to return. + required: false + style: form + explode: true + schema: + minimum: 0 + type: integer + default: 0 + - name: sort + in: query + description: "The comma separated fields used to sort the collection.\nDefault\ + \ sort is ascending, prefix with `-` to sort descending. e.g:\nSort by single\ + \ field:\n`sort=field`\nSort descending by single field:\n`sort=-field`\n\ + Sort by multiple fields:\n`sort=field1,-field2,field3`\n" + required: false + style: form + explode: false + schema: + type: array + items: + type: string + - name: filter + in: query + description: "Supported operators are: eq, in. e.g:\nFilter for single value:\n\ + `filter=field:eq:value`\nFilter for any value in a list: (note \"pipe\"\ + \ character: `|` separating values)\n`filter=field:in:value1|value2|value3`\n" + required: false + style: form + explode: false + schema: + type: array + items: + type: string + - name: limit + in: query + required: false + style: form + explode: true + schema: + maximum: 10000 + minimum: 0 + type: integer + default: 10 + responses: + "200": + description: "" + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/system-insights-connectivity' + x-content-type: application/json + security: + - x-api-key: [] + x-scopes: + - systeminsights.readonly + x-codeSamples: + - lang: Shell + source: "curl --request GET \\\n --url 'https://console.jumpcloud.com/api/v2/systeminsights/connectivity?skip=0&limit=10'\ + \ \\\n --header 'x-api-key: REPLACE_KEY_VALUE' \\\n --header 'x-org-id:\ + \ SOME_STRING_VALUE'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/systeminsights/connectivity\"\ + \n\nquerystring = {\"skip\":\"0\",\"limit\":\"10\"}\n\nheaders = {\n \ + \ \"x-org-id\": \"SOME_STRING_VALUE\",\n \"x-api-key\": \"REPLACE_KEY_VALUE\"\ + \n}\n\nresponse = requests.request(\"GET\", url, headers=headers, params=querystring)\n\ + \nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-org-id\", \"SOME_STRING_VALUE\")\n\ + $headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n$response = Invoke-RestMethod\ + \ -Uri 'https://console.jumpcloud.com/api/v2/systeminsights/connectivity?skip=0&limit=10'\ + \ -Method GET -Headers $headers" + /systeminsights/crashes: + get: + tags: + - System Insights + summary: List System Insights Crashes + description: Valid filter fields are `system_id` and `identifier`. + operationId: systeminsights_list_crashes + parameters: + - name: x-org-id + in: header + description: Organization identifier that can be obtained from console settings. + required: false + style: simple + explode: false + schema: + type: string + - name: skip + in: query + description: The offset into the records to return. + required: false + style: form + explode: true + schema: + minimum: 0 + type: integer + default: 0 + - name: sort + in: query + description: "The comma separated fields used to sort the collection.\nDefault\ + \ sort is ascending, prefix with `-` to sort descending. e.g:\nSort by single\ + \ field:\n`sort=field`\nSort descending by single field:\n`sort=-field`\n\ + Sort by multiple fields:\n`sort=field1,-field2,field3`\n" + required: false + style: form + explode: false + schema: + type: array + items: + type: string + - name: filter + in: query + description: "Supported operators are: eq, in. e.g:\nFilter for single value:\n\ + `filter=field:eq:value`\nFilter for any value in a list: (note \"pipe\"\ + \ character: `|` separating values)\n`filter=field:in:value1|value2|value3`\n" + required: false + style: form + explode: false + schema: + type: array + items: + type: string + - name: limit + in: query + required: false + style: form + explode: true + schema: + maximum: 10000 + minimum: 0 + type: integer + default: 10 + responses: + "200": + description: "" + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/system-insights-crashes' + x-content-type: application/json + security: + - x-api-key: [] + x-scopes: + - systeminsights.readonly + x-codeSamples: + - lang: Shell + source: "curl --request GET \\\n --url 'https://console.jumpcloud.com/api/v2/systeminsights/crashes?skip=0&limit=10'\ + \ \\\n --header 'x-api-key: REPLACE_KEY_VALUE' \\\n --header 'x-org-id:\ + \ SOME_STRING_VALUE'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/systeminsights/crashes\"\ + \n\nquerystring = {\"skip\":\"0\",\"limit\":\"10\"}\n\nheaders = {\n \ + \ \"x-org-id\": \"SOME_STRING_VALUE\",\n \"x-api-key\": \"REPLACE_KEY_VALUE\"\ + \n}\n\nresponse = requests.request(\"GET\", url, headers=headers, params=querystring)\n\ + \nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-org-id\", \"SOME_STRING_VALUE\")\n\ + $headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n$response = Invoke-RestMethod\ + \ -Uri 'https://console.jumpcloud.com/api/v2/systeminsights/crashes?skip=0&limit=10'\ + \ -Method GET -Headers $headers" + /systeminsights/cups_destinations: + get: + tags: + - System Insights + summary: List System Insights CUPS Destinations + description: Valid filter fields are `system_id` and `name`. + operationId: systeminsights_list_cups_destinations + parameters: + - name: skip + in: query + description: The offset into the records to return. + required: false + style: form + explode: true + schema: + minimum: 0 + type: integer + default: 0 + - name: sort + in: query + description: "The comma separated fields used to sort the collection.\nDefault\ + \ sort is ascending, prefix with `-` to sort descending. e.g:\nSort by single\ + \ field:\n`sort=field`\nSort descending by single field:\n`sort=-field`\n\ + Sort by multiple fields:\n`sort=field1,-field2,field3`\n" + required: false + style: form + explode: false + schema: + type: array + items: + type: string + - name: filter + in: query + description: "Supported operators are: eq, in. e.g:\nFilter for single value:\n\ + `filter=field:eq:value`\nFilter for any value in a list: (note \"pipe\"\ + \ character: `|` separating values)\n`filter=field:in:value1|value2|value3`\n" + required: false + style: form + explode: false + schema: + type: array + items: + type: string + - name: x-org-id + in: header + description: Organization identifier that can be obtained from console settings. + required: false + style: simple + explode: false + schema: + type: string + - name: limit + in: query + required: false + style: form + explode: true + schema: + maximum: 10000 + minimum: 0 + type: integer + default: 10 + responses: + "200": + description: "" + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/system-insights-cups-destinations' + x-content-type: application/json + security: + - x-api-key: [] + x-scopes: + - systeminsights.readonly + x-codeSamples: + - lang: Shell + source: "curl --request GET \\\n --url 'https://console.jumpcloud.com/api/v2/systeminsights/cups_destinations?skip=0&limit=10'\ + \ \\\n --header 'x-api-key: REPLACE_KEY_VALUE' \\\n --header 'x-org-id:\ + \ SOME_STRING_VALUE'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/systeminsights/cups_destinations\"\ + \n\nquerystring = {\"skip\":\"0\",\"limit\":\"10\"}\n\nheaders = {\n \ + \ \"x-org-id\": \"SOME_STRING_VALUE\",\n \"x-api-key\": \"REPLACE_KEY_VALUE\"\ + \n}\n\nresponse = requests.request(\"GET\", url, headers=headers, params=querystring)\n\ + \nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-org-id\", \"SOME_STRING_VALUE\")\n\ + $headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n$response = Invoke-RestMethod\ + \ -Uri 'https://console.jumpcloud.com/api/v2/systeminsights/cups_destinations?skip=0&limit=10'\ + \ -Method GET -Headers $headers" + /systeminsights/disk_encryption: + get: + tags: + - System Insights + summary: List System Insights Disk Encryption + description: Valid filter fields are `system_id` and `encryption_status`. + operationId: systeminsights_list_disk_encryption + parameters: + - name: skip + in: query + description: The offset into the records to return. + required: false + style: form + explode: true + schema: + minimum: 0 + type: integer + default: 0 + - name: sort + in: query + description: "The comma separated fields used to sort the collection.\nDefault\ + \ sort is ascending, prefix with `-` to sort descending. e.g:\nSort by single\ + \ field:\n`sort=field`\nSort descending by single field:\n`sort=-field`\n\ + Sort by multiple fields:\n`sort=field1,-field2,field3`\n" + required: false + style: form + explode: false + schema: + type: array + items: + type: string + - name: filter + in: query + description: "Supported operators are: eq, in. e.g:\nFilter for single value:\n\ + `filter=field:eq:value`\nFilter for any value in a list: (note \"pipe\"\ + \ character: `|` separating values)\n`filter=field:in:value1|value2|value3`\n" + required: false + style: form + explode: false + schema: + type: array + items: + type: string + - name: x-org-id + in: header + description: Organization identifier that can be obtained from console settings. + required: false + style: simple + explode: false + schema: + type: string + - name: limit + in: query + required: false + style: form + explode: true + schema: + maximum: 10000 + minimum: 0 + type: integer + default: 10 + responses: + "200": + description: "" + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/system-insights-disk-encryption' + x-content-type: application/json + security: + - x-api-key: [] + x-scopes: + - systeminsights.readonly + x-codeSamples: + - lang: Shell + source: "curl --request GET \\\n --url 'https://console.jumpcloud.com/api/v2/systeminsights/disk_encryption?skip=0&limit=10'\ + \ \\\n --header 'x-api-key: REPLACE_KEY_VALUE' \\\n --header 'x-org-id:\ + \ SOME_STRING_VALUE'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/systeminsights/disk_encryption\"\ + \n\nquerystring = {\"skip\":\"0\",\"limit\":\"10\"}\n\nheaders = {\n \ + \ \"x-org-id\": \"SOME_STRING_VALUE\",\n \"x-api-key\": \"REPLACE_KEY_VALUE\"\ + \n}\n\nresponse = requests.request(\"GET\", url, headers=headers, params=querystring)\n\ + \nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-org-id\", \"SOME_STRING_VALUE\")\n\ + $headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n$response = Invoke-RestMethod\ + \ -Uri 'https://console.jumpcloud.com/api/v2/systeminsights/disk_encryption?skip=0&limit=10'\ + \ -Method GET -Headers $headers" + /systeminsights/disk_info: + get: + tags: + - System Insights + summary: List System Insights Disk Info + description: Valid filter fields are `system_id` and `disk_index`. + operationId: systeminsights_list_disk_info + parameters: + - name: skip + in: query + description: The offset into the records to return. + required: false + style: form + explode: true + schema: + minimum: 0 + type: integer + default: 0 + - name: sort + in: query + description: "The comma separated fields used to sort the collection.\nDefault\ + \ sort is ascending, prefix with `-` to sort descending. e.g:\nSort by single\ + \ field:\n`sort=field`\nSort descending by single field:\n`sort=-field`\n\ + Sort by multiple fields:\n`sort=field1,-field2,field3`\n" + required: false + style: form + explode: false + schema: + type: array + items: + type: string + - name: filter + in: query + description: "Supported operators are: eq, in. e.g:\nFilter for single value:\n\ + `filter=field:eq:value`\nFilter for any value in a list: (note \"pipe\"\ + \ character: `|` separating values)\n`filter=field:in:value1|value2|value3`\n" + required: false + style: form + explode: false + schema: + type: array + items: + type: string + - name: x-org-id + in: header + description: Organization identifier that can be obtained from console settings. + required: false + style: simple + explode: false + schema: + type: string + - name: limit + in: query + required: false + style: form + explode: true + schema: + maximum: 10000 + minimum: 0 + type: integer + default: 10 + responses: + "200": + description: "" + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/system-insights-disk-info' + x-content-type: application/json + security: + - x-api-key: [] + x-scopes: + - systeminsights.readonly + x-codeSamples: + - lang: Shell + source: "curl --request GET \\\n --url 'https://console.jumpcloud.com/api/v2/systeminsights/disk_info?skip=0&limit=10'\ + \ \\\n --header 'x-api-key: REPLACE_KEY_VALUE' \\\n --header 'x-org-id:\ + \ SOME_STRING_VALUE'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/systeminsights/disk_info\"\ + \n\nquerystring = {\"skip\":\"0\",\"limit\":\"10\"}\n\nheaders = {\n \ + \ \"x-org-id\": \"SOME_STRING_VALUE\",\n \"x-api-key\": \"REPLACE_KEY_VALUE\"\ + \n}\n\nresponse = requests.request(\"GET\", url, headers=headers, params=querystring)\n\ + \nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-org-id\", \"SOME_STRING_VALUE\")\n\ + $headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n$response = Invoke-RestMethod\ + \ -Uri 'https://console.jumpcloud.com/api/v2/systeminsights/disk_info?skip=0&limit=10'\ + \ -Method GET -Headers $headers" + /systeminsights/dns_resolvers: + get: + tags: + - System Insights + summary: List System Insights DNS Resolvers + description: Valid filter fields are `system_id` and `type`. + operationId: systeminsights_list_dns_resolvers + parameters: + - name: skip + in: query + description: The offset into the records to return. + required: false + style: form + explode: true + schema: + minimum: 0 + type: integer + default: 0 + - name: sort + in: query + description: "The comma separated fields used to sort the collection.\nDefault\ + \ sort is ascending, prefix with `-` to sort descending. e.g:\nSort by single\ + \ field:\n`sort=field`\nSort descending by single field:\n`sort=-field`\n\ + Sort by multiple fields:\n`sort=field1,-field2,field3`\n" + required: false + style: form + explode: false + schema: + type: array + items: + type: string + - name: filter + in: query + description: "Supported operators are: eq, in. e.g:\nFilter for single value:\n\ + `filter=field:eq:value`\nFilter for any value in a list: (note \"pipe\"\ + \ character: `|` separating values)\n`filter=field:in:value1|value2|value3`\n" + required: false + style: form + explode: false + schema: + type: array + items: + type: string + - name: x-org-id + in: header + description: Organization identifier that can be obtained from console settings. + required: false + style: simple + explode: false + schema: + type: string + - name: limit + in: query + required: false + style: form + explode: true + schema: + maximum: 10000 + minimum: 0 + type: integer + default: 10 + responses: + "200": + description: "" + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/system-insights-dns-resolvers' + x-content-type: application/json + security: + - x-api-key: [] + x-scopes: + - systeminsights.readonly + x-codeSamples: + - lang: Shell + source: "curl --request GET \\\n --url 'https://console.jumpcloud.com/api/v2/systeminsights/dns_resolvers?skip=0&limit=10'\ + \ \\\n --header 'x-api-key: REPLACE_KEY_VALUE' \\\n --header 'x-org-id:\ + \ SOME_STRING_VALUE'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/systeminsights/dns_resolvers\"\ + \n\nquerystring = {\"skip\":\"0\",\"limit\":\"10\"}\n\nheaders = {\n \ + \ \"x-org-id\": \"SOME_STRING_VALUE\",\n \"x-api-key\": \"REPLACE_KEY_VALUE\"\ + \n}\n\nresponse = requests.request(\"GET\", url, headers=headers, params=querystring)\n\ + \nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-org-id\", \"SOME_STRING_VALUE\")\n\ + $headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n$response = Invoke-RestMethod\ + \ -Uri 'https://console.jumpcloud.com/api/v2/systeminsights/dns_resolvers?skip=0&limit=10'\ + \ -Method GET -Headers $headers" + /systeminsights/etc_hosts: + get: + tags: + - System Insights + summary: List System Insights Etc Hosts + description: Valid filter fields are `system_id` and `address`. + operationId: systeminsights_list_etc_hosts + parameters: + - name: skip + in: query + description: The offset into the records to return. + required: false + style: form + explode: true + schema: + minimum: 0 + type: integer + default: 0 + - name: sort + in: query + description: "The comma separated fields used to sort the collection.\nDefault\ + \ sort is ascending, prefix with `-` to sort descending. e.g:\nSort by single\ + \ field:\n`sort=field`\nSort descending by single field:\n`sort=-field`\n\ + Sort by multiple fields:\n`sort=field1,-field2,field3`\n" + required: false + style: form + explode: false + schema: + type: array + items: + type: string + - name: filter + in: query + description: "Supported operators are: eq, in. e.g:\nFilter for single value:\n\ + `filter=field:eq:value`\nFilter for any value in a list: (note \"pipe\"\ + \ character: `|` separating values)\n`filter=field:in:value1|value2|value3`\n" + required: false + style: form + explode: false + schema: + type: array + items: + type: string + - name: x-org-id + in: header + description: Organization identifier that can be obtained from console settings. + required: false + style: simple + explode: false + schema: + type: string + - name: limit + in: query + required: false + style: form + explode: true + schema: + maximum: 10000 + minimum: 0 + type: integer + default: 10 + responses: + "200": + description: "" + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/system-insights-etc-hosts' + x-content-type: application/json + security: + - x-api-key: [] + x-scopes: + - systeminsights.readonly + x-codeSamples: + - lang: Shell + source: "curl --request GET \\\n --url 'https://console.jumpcloud.com/api/v2/systeminsights/etc_hosts?skip=0&limit=10'\ + \ \\\n --header 'x-api-key: REPLACE_KEY_VALUE' \\\n --header 'x-org-id:\ + \ SOME_STRING_VALUE'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/systeminsights/etc_hosts\"\ + \n\nquerystring = {\"skip\":\"0\",\"limit\":\"10\"}\n\nheaders = {\n \ + \ \"x-org-id\": \"SOME_STRING_VALUE\",\n \"x-api-key\": \"REPLACE_KEY_VALUE\"\ + \n}\n\nresponse = requests.request(\"GET\", url, headers=headers, params=querystring)\n\ + \nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-org-id\", \"SOME_STRING_VALUE\")\n\ + $headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n$response = Invoke-RestMethod\ + \ -Uri 'https://console.jumpcloud.com/api/v2/systeminsights/etc_hosts?skip=0&limit=10'\ + \ -Method GET -Headers $headers" + /systeminsights/firefox_addons: + get: + tags: + - System Insights + summary: List System Insights Firefox Addons + description: Valid filter fields are `system_id` and `name`. + operationId: systeminsights_list_firefox_addons + parameters: + - name: skip + in: query + description: The offset into the records to return. + required: false + style: form + explode: true + schema: + minimum: 0 + type: integer + default: 0 + - name: sort + in: query + description: "The comma separated fields used to sort the collection.\nDefault\ + \ sort is ascending, prefix with `-` to sort descending. e.g:\nSort by single\ + \ field:\n`sort=field`\nSort descending by single field:\n`sort=-field`\n\ + Sort by multiple fields:\n`sort=field1,-field2,field3`\n" + required: false + style: form + explode: false + schema: + type: array + items: + type: string + - name: filter + in: query + description: "Supported operators are: eq, in. e.g:\nFilter for single value:\n\ + `filter=field:eq:value`\nFilter for any value in a list: (note \"pipe\"\ + \ character: `|` separating values)\n`filter=field:in:value1|value2|value3`\n" + required: false + style: form + explode: false + schema: + type: array + items: + type: string + - name: x-org-id + in: header + description: Organization identifier that can be obtained from console settings. + required: false + style: simple + explode: false + schema: + type: string + - name: limit + in: query + required: false + style: form + explode: true + schema: + maximum: 10000 + minimum: 0 + type: integer + default: 10 + responses: + "200": + description: "" + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/system-insights-firefox-addons' + x-content-type: application/json + security: + - x-api-key: [] + x-scopes: + - systeminsights.readonly + x-codeSamples: + - lang: Shell + source: "curl --request GET \\\n --url 'https://console.jumpcloud.com/api/v2/systeminsights/firefox_addons?skip=0&limit=10'\ + \ \\\n --header 'x-api-key: REPLACE_KEY_VALUE' \\\n --header 'x-org-id:\ + \ SOME_STRING_VALUE'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/systeminsights/firefox_addons\"\ + \n\nquerystring = {\"skip\":\"0\",\"limit\":\"10\"}\n\nheaders = {\n \ + \ \"x-org-id\": \"SOME_STRING_VALUE\",\n \"x-api-key\": \"REPLACE_KEY_VALUE\"\ + \n}\n\nresponse = requests.request(\"GET\", url, headers=headers, params=querystring)\n\ + \nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-org-id\", \"SOME_STRING_VALUE\")\n\ + $headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n$response = Invoke-RestMethod\ + \ -Uri 'https://console.jumpcloud.com/api/v2/systeminsights/firefox_addons?skip=0&limit=10'\ + \ -Method GET -Headers $headers" + /systeminsights/groups: + get: + tags: + - System Insights + summary: List System Insights Groups + description: Valid filter fields are `system_id` and `groupname`. + operationId: systeminsights_list_groups + parameters: + - name: skip + in: query + description: The offset into the records to return. + required: false + style: form + explode: true + schema: + minimum: 0 + type: integer + default: 0 + - name: sort + in: query + description: "The comma separated fields used to sort the collection.\nDefault\ + \ sort is ascending, prefix with `-` to sort descending. e.g:\nSort by single\ + \ field:\n`sort=field`\nSort descending by single field:\n`sort=-field`\n\ + Sort by multiple fields:\n`sort=field1,-field2,field3`\n" + required: false + style: form + explode: false + schema: + type: array + items: + type: string + - name: filter + in: query + description: "Supported operators are: eq, in. e.g:\nFilter for single value:\n\ + `filter=field:eq:value`\nFilter for any value in a list: (note \"pipe\"\ + \ character: `|` separating values)\n`filter=field:in:value1|value2|value3`\n" + required: false + style: form + explode: false + schema: + type: array + items: + type: string + - name: x-org-id + in: header + description: Organization identifier that can be obtained from console settings. + required: false + style: simple + explode: false + schema: + type: string + - name: limit + in: query + required: false + style: form + explode: true + schema: + maximum: 10000 + minimum: 0 + type: integer + default: 10 + responses: + "200": + description: "" + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/system-insights-groups' + x-content-type: application/json + security: + - x-api-key: [] + x-scopes: + - systeminsights.readonly + x-codeSamples: + - lang: Shell + source: "curl --request GET \\\n --url 'https://console.jumpcloud.com/api/v2/systeminsights/groups?skip=0&limit=10'\ + \ \\\n --header 'x-api-key: REPLACE_KEY_VALUE' \\\n --header 'x-org-id:\ + \ SOME_STRING_VALUE'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/systeminsights/groups\"\ + \n\nquerystring = {\"skip\":\"0\",\"limit\":\"10\"}\n\nheaders = {\n \ + \ \"x-org-id\": \"SOME_STRING_VALUE\",\n \"x-api-key\": \"REPLACE_KEY_VALUE\"\ + \n}\n\nresponse = requests.request(\"GET\", url, headers=headers, params=querystring)\n\ + \nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-org-id\", \"SOME_STRING_VALUE\")\n\ + $headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n$response = Invoke-RestMethod\ + \ -Uri 'https://console.jumpcloud.com/api/v2/systeminsights/groups?skip=0&limit=10'\ + \ -Method GET -Headers $headers" + /systeminsights/ie_extensions: + get: + tags: + - System Insights + summary: List System Insights IE Extensions + description: Valid filter fields are `system_id` and `name`. + operationId: systeminsights_list_ie_extensions + parameters: + - name: x-org-id + in: header + description: Organization identifier that can be obtained from console settings. + required: false + style: simple + explode: false + schema: + type: string + - name: skip + in: query + description: The offset into the records to return. + required: false + style: form + explode: true + schema: + minimum: 0 + type: integer + default: 0 + - name: sort + in: query + description: "The comma separated fields used to sort the collection.\nDefault\ + \ sort is ascending, prefix with `-` to sort descending. e.g:\nSort by single\ + \ field:\n`sort=field`\nSort descending by single field:\n`sort=-field`\n\ + Sort by multiple fields:\n`sort=field1,-field2,field3`\n" + required: false + style: form + explode: false + schema: + type: array + items: + type: string + - name: filter + in: query + description: "Supported operators are: eq, in. e.g:\nFilter for single value:\n\ + `filter=field:eq:value`\nFilter for any value in a list: (note \"pipe\"\ + \ character: `|` separating values)\n`filter=field:in:value1|value2|value3`\n" + required: false + style: form + explode: false + schema: + type: array + items: + type: string + - name: limit + in: query + required: false + style: form + explode: true + schema: + maximum: 10000 + minimum: 0 + type: integer + default: 10 + responses: + "200": + description: "" + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/system-insights-ie-extensions' + x-content-type: application/json + security: + - x-api-key: [] + x-scopes: + - systeminsights.readonly + x-codeSamples: + - lang: Shell + source: "curl --request GET \\\n --url 'https://console.jumpcloud.com/api/v2/systeminsights/ie_extensions?skip=0&limit=10'\ + \ \\\n --header 'x-api-key: REPLACE_KEY_VALUE' \\\n --header 'x-org-id:\ + \ SOME_STRING_VALUE'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/systeminsights/ie_extensions\"\ + \n\nquerystring = {\"skip\":\"0\",\"limit\":\"10\"}\n\nheaders = {\n \ + \ \"x-org-id\": \"SOME_STRING_VALUE\",\n \"x-api-key\": \"REPLACE_KEY_VALUE\"\ + \n}\n\nresponse = requests.request(\"GET\", url, headers=headers, params=querystring)\n\ + \nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-org-id\", \"SOME_STRING_VALUE\")\n\ + $headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n$response = Invoke-RestMethod\ + \ -Uri 'https://console.jumpcloud.com/api/v2/systeminsights/ie_extensions?skip=0&limit=10'\ + \ -Method GET -Headers $headers" + /systeminsights/interface_addresses: + get: + tags: + - System Insights + summary: List System Insights Interface Addresses + description: Valid filter fields are `system_id` and `address`. + operationId: systeminsights_list_interface_addresses + parameters: + - name: skip + in: query + description: The offset into the records to return. + required: false + style: form + explode: true + schema: + minimum: 0 + type: integer + default: 0 + - name: sort + in: query + description: "The comma separated fields used to sort the collection.\nDefault\ + \ sort is ascending, prefix with `-` to sort descending. e.g:\nSort by single\ + \ field:\n`sort=field`\nSort descending by single field:\n`sort=-field`\n\ + Sort by multiple fields:\n`sort=field1,-field2,field3`\n" + required: false + style: form + explode: false + schema: + type: array + items: + type: string + - name: filter + in: query + description: "Supported operators are: eq, in. e.g:\nFilter for single value:\n\ + `filter=field:eq:value`\nFilter for any value in a list: (note \"pipe\"\ + \ character: `|` separating values)\n`filter=field:in:value1|value2|value3`\n" + required: false + style: form + explode: false + schema: + type: array + items: + type: string + - name: x-org-id + in: header + description: Organization identifier that can be obtained from console settings. + required: false + style: simple + explode: false + schema: + type: string + - name: limit + in: query + required: false + style: form + explode: true + schema: + maximum: 10000 + minimum: 0 + type: integer + default: 10 + responses: + "200": + description: "" + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/system-insights-interface-addresses' + x-content-type: application/json + security: + - x-api-key: [] + x-scopes: + - systeminsights.readonly + x-codeSamples: + - lang: Shell + source: "curl --request GET \\\n --url 'https://console.jumpcloud.com/api/v2/systeminsights/interface_addresses?skip=0&limit=10'\ + \ \\\n --header 'x-api-key: REPLACE_KEY_VALUE' \\\n --header 'x-org-id:\ + \ SOME_STRING_VALUE'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/systeminsights/interface_addresses\"\ + \n\nquerystring = {\"skip\":\"0\",\"limit\":\"10\"}\n\nheaders = {\n \ + \ \"x-org-id\": \"SOME_STRING_VALUE\",\n \"x-api-key\": \"REPLACE_KEY_VALUE\"\ + \n}\n\nresponse = requests.request(\"GET\", url, headers=headers, params=querystring)\n\ + \nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-org-id\", \"SOME_STRING_VALUE\")\n\ + $headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n$response = Invoke-RestMethod\ + \ -Uri 'https://console.jumpcloud.com/api/v2/systeminsights/interface_addresses?skip=0&limit=10'\ + \ -Method GET -Headers $headers" + /systeminsights/interface_details: + get: + tags: + - System Insights + summary: List System Insights Interface Details + description: Valid filter fields are `system_id` and `interface`. + operationId: systeminsights_list_interface_details + parameters: + - name: skip + in: query + description: The offset into the records to return. + required: false + style: form + explode: true + schema: + minimum: 0 + type: integer + default: 0 + - name: sort + in: query + description: "The comma separated fields used to sort the collection.\nDefault\ + \ sort is ascending, prefix with `-` to sort descending. e.g:\nSort by single\ + \ field:\n`sort=field`\nSort descending by single field:\n`sort=-field`\n\ + Sort by multiple fields:\n`sort=field1,-field2,field3`\n" + required: false + style: form + explode: false + schema: + type: array + items: + type: string + - name: filter + in: query + description: "Supported operators are: eq, in. e.g:\nFilter for single value:\n\ + `filter=field:eq:value`\nFilter for any value in a list: (note \"pipe\"\ + \ character: `|` separating values)\n`filter=field:in:value1|value2|value3`\n" + required: false + style: form + explode: false + schema: + type: array + items: + type: string + - name: x-org-id + in: header + description: Organization identifier that can be obtained from console settings. + required: false + style: simple + explode: false + schema: + type: string + - name: limit + in: query + required: false + style: form + explode: true + schema: + maximum: 10000 + minimum: 0 + type: integer + default: 10 + responses: + "200": + description: "" + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/system-insights-interface-details' + x-content-type: application/json + security: + - x-api-key: [] + x-scopes: + - systeminsights.readonly + x-codeSamples: + - lang: Shell + source: "curl --request GET \\\n --url 'https://console.jumpcloud.com/api/v2/systeminsights/interface_details?skip=0&limit=10'\ + \ \\\n --header 'x-api-key: REPLACE_KEY_VALUE' \\\n --header 'x-org-id:\ + \ SOME_STRING_VALUE'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/systeminsights/interface_details\"\ + \n\nquerystring = {\"skip\":\"0\",\"limit\":\"10\"}\n\nheaders = {\n \ + \ \"x-org-id\": \"SOME_STRING_VALUE\",\n \"x-api-key\": \"REPLACE_KEY_VALUE\"\ + \n}\n\nresponse = requests.request(\"GET\", url, headers=headers, params=querystring)\n\ + \nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-org-id\", \"SOME_STRING_VALUE\")\n\ + $headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n$response = Invoke-RestMethod\ + \ -Uri 'https://console.jumpcloud.com/api/v2/systeminsights/interface_details?skip=0&limit=10'\ + \ -Method GET -Headers $headers" + /systeminsights/kernel_info: + get: + tags: + - System Insights + summary: List System Insights Kernel Info + description: Valid filter fields are `system_id` and `version`. + operationId: systeminsights_list_kernel_info + parameters: + - name: skip + in: query + description: The offset into the records to return. + required: false + style: form + explode: true + schema: + minimum: 0 + type: integer + default: 0 + - name: sort + in: query + description: "The comma separated fields used to sort the collection.\nDefault\ + \ sort is ascending, prefix with `-` to sort descending. e.g:\nSort by single\ + \ field:\n`sort=field`\nSort descending by single field:\n`sort=-field`\n\ + Sort by multiple fields:\n`sort=field1,-field2,field3`\n" + required: false + style: form + explode: false + schema: + type: array + items: + type: string + - name: filter + in: query + description: "Supported operators are: eq, in. e.g:\nFilter for single value:\n\ + `filter=field:eq:value`\nFilter for any value in a list: (note \"pipe\"\ + \ character: `|` separating values)\n`filter=field:in:value1|value2|value3`\n" + required: false + style: form + explode: false + schema: + type: array + items: + type: string + - name: x-org-id + in: header + description: Organization identifier that can be obtained from console settings. + required: false + style: simple + explode: false + schema: + type: string + - name: limit + in: query + required: false + style: form + explode: true + schema: + maximum: 10000 + minimum: 0 + type: integer + default: 10 + responses: + "200": + description: "" + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/system-insights-kernel-info' + x-content-type: application/json + security: + - x-api-key: [] + x-scopes: + - systeminsights.readonly + x-codeSamples: + - lang: Shell + source: "curl --request GET \\\n --url 'https://console.jumpcloud.com/api/v2/systeminsights/kernel_info?skip=0&limit=10'\ + \ \\\n --header 'x-api-key: REPLACE_KEY_VALUE' \\\n --header 'x-org-id:\ + \ SOME_STRING_VALUE'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/systeminsights/kernel_info\"\ + \n\nquerystring = {\"skip\":\"0\",\"limit\":\"10\"}\n\nheaders = {\n \ + \ \"x-org-id\": \"SOME_STRING_VALUE\",\n \"x-api-key\": \"REPLACE_KEY_VALUE\"\ + \n}\n\nresponse = requests.request(\"GET\", url, headers=headers, params=querystring)\n\ + \nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-org-id\", \"SOME_STRING_VALUE\")\n\ + $headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n$response = Invoke-RestMethod\ + \ -Uri 'https://console.jumpcloud.com/api/v2/systeminsights/kernel_info?skip=0&limit=10'\ + \ -Method GET -Headers $headers" + /systeminsights/launchd: + get: + tags: + - System Insights + summary: List System Insights Launchd + description: Valid filter fields are `system_id` and `name`. + operationId: systeminsights_list_launchd + parameters: + - name: x-org-id + in: header + description: Organization identifier that can be obtained from console settings. + required: false + style: simple + explode: false + schema: + type: string + - name: skip + in: query + description: The offset into the records to return. + required: false + style: form + explode: true + schema: + minimum: 0 + type: integer + default: 0 + - name: sort + in: query + description: "The comma separated fields used to sort the collection.\nDefault\ + \ sort is ascending, prefix with `-` to sort descending. e.g:\nSort by single\ + \ field:\n`sort=field`\nSort descending by single field:\n`sort=-field`\n\ + Sort by multiple fields:\n`sort=field1,-field2,field3`\n" + required: false + style: form + explode: false + schema: + type: array + items: + type: string + - name: filter + in: query + description: "Supported operators are: eq, in. e.g:\nFilter for single value:\n\ + `filter=field:eq:value`\nFilter for any value in a list: (note \"pipe\"\ + \ character: `|` separating values)\n`filter=field:in:value1|value2|value3`\n" + required: false + style: form + explode: false + schema: + type: array + items: + type: string + - name: limit + in: query + required: false + style: form + explode: true + schema: + maximum: 10000 + minimum: 0 + type: integer + default: 10 + responses: + "200": + description: "" + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/system-insights-launchd' + x-content-type: application/json + security: + - x-api-key: [] + x-scopes: + - systeminsights.readonly + x-codeSamples: + - lang: Shell + source: "curl --request GET \\\n --url 'https://console.jumpcloud.com/api/v2/systeminsights/launchd?skip=0&limit=10'\ + \ \\\n --header 'x-api-key: REPLACE_KEY_VALUE' \\\n --header 'x-org-id:\ + \ SOME_STRING_VALUE'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/systeminsights/launchd\"\ + \n\nquerystring = {\"skip\":\"0\",\"limit\":\"10\"}\n\nheaders = {\n \ + \ \"x-org-id\": \"SOME_STRING_VALUE\",\n \"x-api-key\": \"REPLACE_KEY_VALUE\"\ + \n}\n\nresponse = requests.request(\"GET\", url, headers=headers, params=querystring)\n\ + \nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-org-id\", \"SOME_STRING_VALUE\")\n\ + $headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n$response = Invoke-RestMethod\ + \ -Uri 'https://console.jumpcloud.com/api/v2/systeminsights/launchd?skip=0&limit=10'\ + \ -Method GET -Headers $headers" + /systeminsights/linux_packages: + get: + tags: + - System Insights + summary: List System Insights Linux Packages + description: "Lists all programs for Linux devices. For macOS devices, use [List\ + \ System Insights System Apps](#operation/systeminsights_list_apps). For windows\ + \ devices, use [List System Insights System Apps](#operation/systeminsights_list_programs).\n\ + \nValid filter fields are `name` and `package_format`." + operationId: systeminsights_list_linux_packages + parameters: + - name: skip + in: query + description: The offset into the records to return. + required: false + style: form + explode: true + schema: + minimum: 0 + type: integer + default: 0 + - name: sort + in: query + description: "The comma separated fields used to sort the collection.\nDefault\ + \ sort is ascending, prefix with `-` to sort descending. e.g:\nSort by single\ + \ field:\n`sort=field`\nSort descending by single field:\n`sort=-field`\n\ + Sort by multiple fields:\n`sort=field1,-field2,field3`\n" + required: false + style: form + explode: false + schema: + type: array + items: + type: string + - name: filter + in: query + description: "Supported operators are: eq, in. e.g:\nFilter for single value:\n\ + `filter=field:eq:value`\nFilter for any value in a list: (note \"pipe\"\ + \ character: `|` separating values)\n`filter=field:in:value1|value2|value3`\n" + required: false + style: form + explode: false + schema: + type: array + items: + type: string + - name: x-org-id + in: header + description: Organization identifier that can be obtained from console settings. + required: false + style: simple + explode: false + schema: + type: string + - name: limit + in: query + required: false + style: form + explode: true + schema: + maximum: 10000 + minimum: 0 + type: integer + default: 10 + responses: + "200": + description: "" + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/system-insights-linux-packages' + x-content-type: application/json + security: + - x-api-key: [] + x-scopes: + - systeminsights.readonly + x-codeSamples: + - lang: Shell + source: "curl --request GET \\\n --url 'https://console.jumpcloud.com/api/v2/systeminsights/linux_packages?skip=0&limit=10'\ + \ \\\n --header 'x-api-key: REPLACE_KEY_VALUE' \\\n --header 'x-org-id:\ + \ SOME_STRING_VALUE'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/systeminsights/linux_packages\"\ + \n\nquerystring = {\"skip\":\"0\",\"limit\":\"10\"}\n\nheaders = {\n \ + \ \"x-org-id\": \"SOME_STRING_VALUE\",\n \"x-api-key\": \"REPLACE_KEY_VALUE\"\ + \n}\n\nresponse = requests.request(\"GET\", url, headers=headers, params=querystring)\n\ + \nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-org-id\", \"SOME_STRING_VALUE\")\n\ + $headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n$response = Invoke-RestMethod\ + \ -Uri 'https://console.jumpcloud.com/api/v2/systeminsights/linux_packages?skip=0&limit=10'\ + \ -Method GET -Headers $headers" + /systeminsights/logged_in_users: + get: + tags: + - System Insights + summary: List System Insights Logged-In Users + description: Valid filter fields are `system_id` and `user`. + operationId: systeminsights_list_logged_in_users + parameters: + - name: x-org-id + in: header + description: Organization identifier that can be obtained from console settings. + required: false + style: simple + explode: false + schema: + type: string + - name: skip + in: query + description: The offset into the records to return. + required: false + style: form + explode: true + schema: + minimum: 0 + type: integer + default: 0 + - name: sort + in: query + description: "The comma separated fields used to sort the collection.\nDefault\ + \ sort is ascending, prefix with `-` to sort descending. e.g:\nSort by single\ + \ field:\n`sort=field`\nSort descending by single field:\n`sort=-field`\n\ + Sort by multiple fields:\n`sort=field1,-field2,field3`\n" + required: false + style: form + explode: false + schema: + type: array + items: + type: string + - name: filter + in: query + description: "Supported operators are: eq, in. e.g:\nFilter for single value:\n\ + `filter=field:eq:value`\nFilter for any value in a list: (note \"pipe\"\ + \ character: `|` separating values)\n`filter=field:in:value1|value2|value3`\n" + required: false + style: form + explode: false + schema: + type: array + items: + type: string + - name: limit + in: query + required: false + style: form + explode: true + schema: + maximum: 10000 + minimum: 0 + type: integer + default: 10 + responses: + "200": + description: "" + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/system-insights-logged-in-users' + x-content-type: application/json + security: + - x-api-key: [] + x-scopes: + - systeminsights.readonly + x-codeSamples: + - lang: Shell + source: "curl --request GET \\\n --url 'https://console.jumpcloud.com/api/v2/systeminsights/logged_in_users?skip=0&limit=10'\ + \ \\\n --header 'x-api-key: REPLACE_KEY_VALUE' \\\n --header 'x-org-id:\ + \ SOME_STRING_VALUE'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/systeminsights/logged_in_users\"\ + \n\nquerystring = {\"skip\":\"0\",\"limit\":\"10\"}\n\nheaders = {\n \ + \ \"x-org-id\": \"SOME_STRING_VALUE\",\n \"x-api-key\": \"REPLACE_KEY_VALUE\"\ + \n}\n\nresponse = requests.request(\"GET\", url, headers=headers, params=querystring)\n\ + \nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-org-id\", \"SOME_STRING_VALUE\")\n\ + $headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n$response = Invoke-RestMethod\ + \ -Uri 'https://console.jumpcloud.com/api/v2/systeminsights/logged_in_users?skip=0&limit=10'\ + \ -Method GET -Headers $headers" + /systeminsights/logical_drives: + get: + tags: + - System Insights + summary: List System Insights Logical Drives + description: Valid filter fields are `system_id` and `device_id`. + operationId: systeminsights_list_logical_drives + parameters: + - name: skip + in: query + description: The offset into the records to return. + required: false + style: form + explode: true + schema: + minimum: 0 + type: integer + default: 0 + - name: sort + in: query + description: "The comma separated fields used to sort the collection.\nDefault\ + \ sort is ascending, prefix with `-` to sort descending. e.g:\nSort by single\ + \ field:\n`sort=field`\nSort descending by single field:\n`sort=-field`\n\ + Sort by multiple fields:\n`sort=field1,-field2,field3`\n" + required: false + style: form + explode: false + schema: + type: array + items: + type: string + - name: filter + in: query + description: "Supported operators are: eq, in. e.g:\nFilter for single value:\n\ + `filter=field:eq:value`\nFilter for any value in a list: (note \"pipe\"\ + \ character: `|` separating values)\n`filter=field:in:value1|value2|value3`\n" + required: false + style: form + explode: false + schema: + type: array + items: + type: string + - name: x-org-id + in: header + description: Organization identifier that can be obtained from console settings. + required: false + style: simple + explode: false + schema: + type: string + - name: limit + in: query + required: false + style: form + explode: true + schema: + maximum: 10000 + minimum: 0 + type: integer + default: 10 + responses: + "200": + description: "" + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/system-insights-logical-drives' + x-content-type: application/json + security: + - x-api-key: [] + x-scopes: + - systeminsights.readonly + x-codeSamples: + - lang: Shell + source: "curl --request GET \\\n --url 'https://console.jumpcloud.com/api/v2/systeminsights/logical_drives?skip=0&limit=10'\ + \ \\\n --header 'x-api-key: REPLACE_KEY_VALUE' \\\n --header 'x-org-id:\ + \ SOME_STRING_VALUE'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/systeminsights/logical_drives\"\ + \n\nquerystring = {\"skip\":\"0\",\"limit\":\"10\"}\n\nheaders = {\n \ + \ \"x-org-id\": \"SOME_STRING_VALUE\",\n \"x-api-key\": \"REPLACE_KEY_VALUE\"\ + \n}\n\nresponse = requests.request(\"GET\", url, headers=headers, params=querystring)\n\ + \nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-org-id\", \"SOME_STRING_VALUE\")\n\ + $headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n$response = Invoke-RestMethod\ + \ -Uri 'https://console.jumpcloud.com/api/v2/systeminsights/logical_drives?skip=0&limit=10'\ + \ -Method GET -Headers $headers" + /systeminsights/managed_policies: + get: + tags: + - System Insights + summary: List System Insights Managed Policies + description: Valid filter fields are `system_id` and `domain`. + operationId: systeminsights_list_managed_policies + parameters: + - name: x-org-id + in: header + description: Organization identifier that can be obtained from console settings. + required: false + style: simple + explode: false + schema: + type: string + - name: skip + in: query + description: The offset into the records to return. + required: false + style: form + explode: true + schema: + minimum: 0 + type: integer + default: 0 + - name: sort + in: query + description: "The comma separated fields used to sort the collection.\nDefault\ + \ sort is ascending, prefix with `-` to sort descending. e.g:\nSort by single\ + \ field:\n`sort=field`\nSort descending by single field:\n`sort=-field`\n\ + Sort by multiple fields:\n`sort=field1,-field2,field3`\n" + required: false + style: form + explode: false + schema: + type: array + items: + type: string + - name: filter + in: query + description: "Supported operators are: eq, in. e.g:\nFilter for single value:\n\ + `filter=field:eq:value`\nFilter for any value in a list: (note \"pipe\"\ + \ character: `|` separating values)\n`filter=field:in:value1|value2|value3`\n" + required: false + style: form + explode: false + schema: + type: array + items: + type: string + - name: limit + in: query + required: false + style: form + explode: true + schema: + maximum: 10000 + minimum: 0 + type: integer + default: 10 + responses: + "200": + description: "" + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/system-insights-managed-policies' + x-content-type: application/json + security: + - x-api-key: [] + x-scopes: + - systeminsights.readonly + x-codeSamples: + - lang: Shell + source: "curl --request GET \\\n --url 'https://console.jumpcloud.com/api/v2/systeminsights/managed_policies?skip=0&limit=10'\ + \ \\\n --header 'x-api-key: REPLACE_KEY_VALUE' \\\n --header 'x-org-id:\ + \ SOME_STRING_VALUE'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/systeminsights/managed_policies\"\ + \n\nquerystring = {\"skip\":\"0\",\"limit\":\"10\"}\n\nheaders = {\n \ + \ \"x-org-id\": \"SOME_STRING_VALUE\",\n \"x-api-key\": \"REPLACE_KEY_VALUE\"\ + \n}\n\nresponse = requests.request(\"GET\", url, headers=headers, params=querystring)\n\ + \nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-org-id\", \"SOME_STRING_VALUE\")\n\ + $headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n$response = Invoke-RestMethod\ + \ -Uri 'https://console.jumpcloud.com/api/v2/systeminsights/managed_policies?skip=0&limit=10'\ + \ -Method GET -Headers $headers" + /systeminsights/mounts: + get: + tags: + - System Insights + summary: List System Insights Mounts + description: Valid filter fields are `system_id` and `path`. + operationId: systeminsights_list_mounts + parameters: + - name: skip + in: query + description: The offset into the records to return. + required: false + style: form + explode: true + schema: + minimum: 0 + type: integer + default: 0 + - name: sort + in: query + description: "The comma separated fields used to sort the collection.\nDefault\ + \ sort is ascending, prefix with `-` to sort descending. e.g:\nSort by single\ + \ field:\n`sort=field`\nSort descending by single field:\n`sort=-field`\n\ + Sort by multiple fields:\n`sort=field1,-field2,field3`\n" + required: false + style: form + explode: false + schema: + type: array + items: + type: string + - name: filter + in: query + description: "Supported operators are: eq, in. e.g:\nFilter for single value:\n\ + `filter=field:eq:value`\nFilter for any value in a list: (note \"pipe\"\ + \ character: `|` separating values)\n`filter=field:in:value1|value2|value3`\n" + required: false + style: form + explode: false + schema: + type: array + items: + type: string + - name: x-org-id + in: header + description: Organization identifier that can be obtained from console settings. + required: false + style: simple + explode: false + schema: + type: string + - name: limit + in: query + required: false + style: form + explode: true + schema: + maximum: 10000 + minimum: 0 + type: integer + default: 10 + responses: + "200": + description: "" + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/system-insights-mounts' + x-content-type: application/json + security: + - x-api-key: [] + x-scopes: + - systeminsights.readonly + x-codeSamples: + - lang: Shell + source: "curl --request GET \\\n --url 'https://console.jumpcloud.com/api/v2/systeminsights/mounts?skip=0&limit=10'\ + \ \\\n --header 'x-api-key: REPLACE_KEY_VALUE' \\\n --header 'x-org-id:\ + \ SOME_STRING_VALUE'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/systeminsights/mounts\"\ + \n\nquerystring = {\"skip\":\"0\",\"limit\":\"10\"}\n\nheaders = {\n \ + \ \"x-org-id\": \"SOME_STRING_VALUE\",\n \"x-api-key\": \"REPLACE_KEY_VALUE\"\ + \n}\n\nresponse = requests.request(\"GET\", url, headers=headers, params=querystring)\n\ + \nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-org-id\", \"SOME_STRING_VALUE\")\n\ + $headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n$response = Invoke-RestMethod\ + \ -Uri 'https://console.jumpcloud.com/api/v2/systeminsights/mounts?skip=0&limit=10'\ + \ -Method GET -Headers $headers" + /systeminsights/os_version: + get: + tags: + - System Insights + summary: List System Insights OS Version + description: Valid filter fields are `system_id` and `version`. + operationId: systeminsights_list_os_version + parameters: + - name: skip + in: query + description: The offset into the records to return. + required: false + style: form + explode: true + schema: + minimum: 0 + type: integer + default: 0 + - name: sort + in: query + description: "The comma separated fields used to sort the collection.\nDefault\ + \ sort is ascending, prefix with `-` to sort descending. e.g:\nSort by single\ + \ field:\n`sort=field`\nSort descending by single field:\n`sort=-field`\n\ + Sort by multiple fields:\n`sort=field1,-field2,field3`\n" + required: false + style: form + explode: false + schema: + type: array + items: + type: string + - name: filter + in: query + description: "Supported operators are: eq, in. e.g:\nFilter for single value:\n\ + `filter=field:eq:value`\nFilter for any value in a list: (note \"pipe\"\ + \ character: `|` separating values)\n`filter=field:in:value1|value2|value3`\n" + required: false + style: form + explode: false + schema: + type: array + items: + type: string + - name: x-org-id + in: header + description: Organization identifier that can be obtained from console settings. + required: false + style: simple + explode: false + schema: + type: string + - name: limit + in: query + required: false + style: form + explode: true + schema: + maximum: 10000 + minimum: 0 + type: integer + default: 10 + responses: + "200": + description: "" + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/system-insights-os-version' + x-content-type: application/json + security: + - x-api-key: [] + x-scopes: + - systeminsights.readonly + x-codeSamples: + - lang: Shell + source: "curl --request GET \\\n --url 'https://console.jumpcloud.com/api/v2/systeminsights/os_version?skip=0&limit=10'\ + \ \\\n --header 'x-api-key: REPLACE_KEY_VALUE' \\\n --header 'x-org-id:\ + \ SOME_STRING_VALUE'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/systeminsights/os_version\"\ + \n\nquerystring = {\"skip\":\"0\",\"limit\":\"10\"}\n\nheaders = {\n \ + \ \"x-org-id\": \"SOME_STRING_VALUE\",\n \"x-api-key\": \"REPLACE_KEY_VALUE\"\ + \n}\n\nresponse = requests.request(\"GET\", url, headers=headers, params=querystring)\n\ + \nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-org-id\", \"SOME_STRING_VALUE\")\n\ + $headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n$response = Invoke-RestMethod\ + \ -Uri 'https://console.jumpcloud.com/api/v2/systeminsights/os_version?skip=0&limit=10'\ + \ -Method GET -Headers $headers" + /systeminsights/patches: + get: + tags: + - System Insights + summary: List System Insights Patches + description: Valid filter fields are `system_id` and `hotfix_id`. + operationId: systeminsights_list_patches + parameters: + - name: skip + in: query + description: The offset into the records to return. + required: false + style: form + explode: true + schema: + minimum: 0 + type: integer + default: 0 + - name: sort + in: query + description: "The comma separated fields used to sort the collection.\nDefault\ + \ sort is ascending, prefix with `-` to sort descending. e.g:\nSort by single\ + \ field:\n`sort=field`\nSort descending by single field:\n`sort=-field`\n\ + Sort by multiple fields:\n`sort=field1,-field2,field3`\n" + required: false + style: form + explode: false + schema: + type: array + items: + type: string + - name: filter + in: query + description: "Supported operators are: eq, in. e.g:\nFilter for single value:\n\ + `filter=field:eq:value`\nFilter for any value in a list: (note \"pipe\"\ + \ character: `|` separating values)\n`filter=field:in:value1|value2|value3`\n" + required: false + style: form + explode: false + schema: + type: array + items: + type: string + - name: x-org-id + in: header + description: Organization identifier that can be obtained from console settings. + required: false + style: simple + explode: false + schema: + type: string + - name: limit + in: query + required: false + style: form + explode: true + schema: + maximum: 10000 + minimum: 0 + type: integer + default: 10 + responses: + "200": + description: "" + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/system-insights-patches' + x-content-type: application/json + security: + - x-api-key: [] + x-scopes: + - systeminsights.readonly + x-codeSamples: + - lang: Shell + source: "curl --request GET \\\n --url 'https://console.jumpcloud.com/api/v2/systeminsights/patches?skip=0&limit=10'\ + \ \\\n --header 'x-api-key: REPLACE_KEY_VALUE' \\\n --header 'x-org-id:\ + \ SOME_STRING_VALUE'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/systeminsights/patches\"\ + \n\nquerystring = {\"skip\":\"0\",\"limit\":\"10\"}\n\nheaders = {\n \ + \ \"x-org-id\": \"SOME_STRING_VALUE\",\n \"x-api-key\": \"REPLACE_KEY_VALUE\"\ + \n}\n\nresponse = requests.request(\"GET\", url, headers=headers, params=querystring)\n\ + \nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-org-id\", \"SOME_STRING_VALUE\")\n\ + $headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n$response = Invoke-RestMethod\ + \ -Uri 'https://console.jumpcloud.com/api/v2/systeminsights/patches?skip=0&limit=10'\ + \ -Method GET -Headers $headers" + /systeminsights/programs: + get: + tags: + - System Insights + summary: List System Insights Programs + description: "Lists all programs for Windows devices. For macOS devices, use\ + \ [List System Insights Apps](#operation/systeminsights_list_apps).\n\nValid\ + \ filter fields are `system_id` and `name`." + operationId: systeminsights_list_programs + parameters: + - name: skip + in: query + description: The offset into the records to return. + required: false + style: form + explode: true + schema: + minimum: 0 + type: integer + default: 0 + - name: sort + in: query + description: "The comma separated fields used to sort the collection.\nDefault\ + \ sort is ascending, prefix with `-` to sort descending. e.g:\nSort by single\ + \ field:\n`sort=field`\nSort descending by single field:\n`sort=-field`\n\ + Sort by multiple fields:\n`sort=field1,-field2,field3`\n" + required: false + style: form + explode: false + schema: + type: array + items: + type: string + - name: filter + in: query + description: "Supported operators are: eq, in. e.g:\nFilter for single value:\n\ + `filter=field:eq:value`\nFilter for any value in a list: (note \"pipe\"\ + \ character: `|` separating values)\n`filter=field:in:value1|value2|value3`\n" + required: false + style: form + explode: false + schema: + type: array + items: + type: string + - name: x-org-id + in: header + description: Organization identifier that can be obtained from console settings. + required: false + style: simple + explode: false + schema: + type: string + - name: limit + in: query + required: false + style: form + explode: true + schema: + maximum: 10000 + minimum: 0 + type: integer + default: 10 + responses: + "200": + description: "" + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/system-insights-programs' + x-content-type: application/json + security: + - x-api-key: [] + x-scopes: + - systeminsights.readonly + x-codeSamples: + - lang: Shell + source: "curl --request GET \\\n --url 'https://console.jumpcloud.com/api/v2/systeminsights/programs?skip=0&limit=10'\ + \ \\\n --header 'x-api-key: REPLACE_KEY_VALUE' \\\n --header 'x-org-id:\ + \ SOME_STRING_VALUE'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/systeminsights/programs\"\ + \n\nquerystring = {\"skip\":\"0\",\"limit\":\"10\"}\n\nheaders = {\n \ + \ \"x-org-id\": \"SOME_STRING_VALUE\",\n \"x-api-key\": \"REPLACE_KEY_VALUE\"\ + \n}\n\nresponse = requests.request(\"GET\", url, headers=headers, params=querystring)\n\ + \nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-org-id\", \"SOME_STRING_VALUE\")\n\ + $headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n$response = Invoke-RestMethod\ + \ -Uri 'https://console.jumpcloud.com/api/v2/systeminsights/programs?skip=0&limit=10'\ + \ -Method GET -Headers $headers" + /systeminsights/python_packages: + get: + tags: + - System Insights + summary: List System Insights Python Packages + description: Valid filter fields are `system_id` and `name`. + operationId: systeminsights_list_python_packages + parameters: + - name: skip + in: query + description: The offset into the records to return. + required: false + style: form + explode: true + schema: + minimum: 0 + type: integer + default: 0 + - name: sort + in: query + description: "The comma separated fields used to sort the collection.\nDefault\ + \ sort is ascending, prefix with `-` to sort descending. e.g:\nSort by single\ + \ field:\n`sort=field`\nSort descending by single field:\n`sort=-field`\n\ + Sort by multiple fields:\n`sort=field1,-field2,field3`\n" + required: false + style: form + explode: false + schema: + type: array + items: + type: string + - name: filter + in: query + description: "Supported operators are: eq, in. e.g:\nFilter for single value:\n\ + `filter=field:eq:value`\nFilter for any value in a list: (note \"pipe\"\ + \ character: `|` separating values)\n`filter=field:in:value1|value2|value3`\n" + required: false + style: form + explode: false + schema: + type: array + items: + type: string + - name: x-org-id + in: header + description: Organization identifier that can be obtained from console settings. + required: false + style: simple + explode: false + schema: + type: string + - name: limit + in: query + required: false + style: form + explode: true + schema: + maximum: 10000 + minimum: 0 + type: integer + default: 10 + responses: + "200": + description: "" + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/system-insights-python-packages' + x-content-type: application/json + security: + - x-api-key: [] + x-scopes: + - systeminsights.readonly + x-codeSamples: + - lang: Shell + source: "curl --request GET \\\n --url 'https://console.jumpcloud.com/api/v2/systeminsights/python_packages?skip=0&limit=10'\ + \ \\\n --header 'x-api-key: REPLACE_KEY_VALUE' \\\n --header 'x-org-id:\ + \ SOME_STRING_VALUE'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/systeminsights/python_packages\"\ + \n\nquerystring = {\"skip\":\"0\",\"limit\":\"10\"}\n\nheaders = {\n \ + \ \"x-org-id\": \"SOME_STRING_VALUE\",\n \"x-api-key\": \"REPLACE_KEY_VALUE\"\ + \n}\n\nresponse = requests.request(\"GET\", url, headers=headers, params=querystring)\n\ + \nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-org-id\", \"SOME_STRING_VALUE\")\n\ + $headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n$response = Invoke-RestMethod\ + \ -Uri 'https://console.jumpcloud.com/api/v2/systeminsights/python_packages?skip=0&limit=10'\ + \ -Method GET -Headers $headers" + /systeminsights/safari_extensions: + get: + tags: + - System Insights + summary: List System Insights Safari Extensions + description: Valid filter fields are `system_id` and `name`. + operationId: systeminsights_list_safari_extensions + parameters: + - name: skip + in: query + description: The offset into the records to return. + required: false + style: form + explode: true + schema: + minimum: 0 + type: integer + default: 0 + - name: sort + in: query + description: "The comma separated fields used to sort the collection.\nDefault\ + \ sort is ascending, prefix with `-` to sort descending. e.g:\nSort by single\ + \ field:\n`sort=field`\nSort descending by single field:\n`sort=-field`\n\ + Sort by multiple fields:\n`sort=field1,-field2,field3`\n" + required: false + style: form + explode: false + schema: + type: array + items: + type: string + - name: filter + in: query + description: "Supported operators are: eq, in. e.g:\nFilter for single value:\n\ + `filter=field:eq:value`\nFilter for any value in a list: (note \"pipe\"\ + \ character: `|` separating values)\n`filter=field:in:value1|value2|value3`\n" + required: false + style: form + explode: false + schema: + type: array + items: + type: string + - name: x-org-id + in: header + description: Organization identifier that can be obtained from console settings. + required: false + style: simple + explode: false + schema: + type: string + - name: limit + in: query + required: false + style: form + explode: true + schema: + maximum: 10000 + minimum: 0 + type: integer + default: 10 + responses: + "200": + description: "" + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/system-insights-safari-extensions' + x-content-type: application/json + security: + - x-api-key: [] + x-scopes: + - systeminsights.readonly + x-codeSamples: + - lang: Shell + source: "curl --request GET \\\n --url 'https://console.jumpcloud.com/api/v2/systeminsights/safari_extensions?skip=0&limit=10'\ + \ \\\n --header 'x-api-key: REPLACE_KEY_VALUE' \\\n --header 'x-org-id:\ + \ SOME_STRING_VALUE'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/systeminsights/safari_extensions\"\ + \n\nquerystring = {\"skip\":\"0\",\"limit\":\"10\"}\n\nheaders = {\n \ + \ \"x-org-id\": \"SOME_STRING_VALUE\",\n \"x-api-key\": \"REPLACE_KEY_VALUE\"\ + \n}\n\nresponse = requests.request(\"GET\", url, headers=headers, params=querystring)\n\ + \nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-org-id\", \"SOME_STRING_VALUE\")\n\ + $headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n$response = Invoke-RestMethod\ + \ -Uri 'https://console.jumpcloud.com/api/v2/systeminsights/safari_extensions?skip=0&limit=10'\ + \ -Method GET -Headers $headers" + /systeminsights/scheduled_tasks: + get: + tags: + - System Insights + summary: List System Insights Scheduled Tasks + description: Valid filter fields are `system_id` and `enabled`. + operationId: systeminsights_list_scheduled_tasks + parameters: + - name: skip + in: query + description: The offset into the records to return. + required: false + style: form + explode: true + schema: + minimum: 0 + type: integer + default: 0 + - name: sort + in: query + description: "The comma separated fields used to sort the collection.\nDefault\ + \ sort is ascending, prefix with `-` to sort descending. e.g:\nSort by single\ + \ field:\n`sort=field`\nSort descending by single field:\n`sort=-field`\n\ + Sort by multiple fields:\n`sort=field1,-field2,field3`\n" + required: false + style: form + explode: false + schema: + type: array + items: + type: string + - name: filter + in: query + description: "Supported operators are: eq, in. e.g:\nFilter for single value:\n\ + `filter=field:eq:value`\nFilter for any value in a list: (note \"pipe\"\ + \ character: `|` separating values)\n`filter=field:in:value1|value2|value3`\n" + required: false + style: form + explode: false + schema: + type: array + items: + type: string + - name: x-org-id + in: header + description: Organization identifier that can be obtained from console settings. + required: false + style: simple + explode: false + schema: + type: string + - name: limit + in: query + required: false + style: form + explode: true + schema: + maximum: 10000 + minimum: 0 + type: integer + default: 10 + responses: + "200": + description: "" + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/system-insights-scheduled-tasks' + x-content-type: application/json + security: + - x-api-key: [] + x-scopes: + - systeminsights.readonly + x-codeSamples: + - lang: Shell + source: "curl --request GET \\\n --url 'https://console.jumpcloud.com/api/v2/systeminsights/scheduled_tasks?skip=0&limit=10'\ + \ \\\n --header 'x-api-key: REPLACE_KEY_VALUE' \\\n --header 'x-org-id:\ + \ SOME_STRING_VALUE'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/systeminsights/scheduled_tasks\"\ + \n\nquerystring = {\"skip\":\"0\",\"limit\":\"10\"}\n\nheaders = {\n \ + \ \"x-org-id\": \"SOME_STRING_VALUE\",\n \"x-api-key\": \"REPLACE_KEY_VALUE\"\ + \n}\n\nresponse = requests.request(\"GET\", url, headers=headers, params=querystring)\n\ + \nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-org-id\", \"SOME_STRING_VALUE\")\n\ + $headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n$response = Invoke-RestMethod\ + \ -Uri 'https://console.jumpcloud.com/api/v2/systeminsights/scheduled_tasks?skip=0&limit=10'\ + \ -Method GET -Headers $headers" + /systeminsights/secureboot: + get: + tags: + - System Insights + summary: List System Insights Secure Boot + description: Valid filter fields are `system_id`. + operationId: systeminsights_list_secureboot + parameters: + - name: skip + in: query + description: The offset into the records to return. + required: false + style: form + explode: true + schema: + minimum: 0 + type: integer + default: 0 + - name: sort + in: query + description: "The comma separated fields used to sort the collection.\nDefault\ + \ sort is ascending, prefix with `-` to sort descending. e.g:\nSort by single\ + \ field:\n`sort=field`\nSort descending by single field:\n`sort=-field`\n\ + Sort by multiple fields:\n`sort=field1,-field2,field3`\n" + required: false + style: form + explode: false + schema: + type: array + items: + type: string + - name: filter + in: query + description: "Supported operators are: eq, in. e.g:\nFilter for single value:\n\ + `filter=field:eq:value`\nFilter for any value in a list: (note \"pipe\"\ + \ character: `|` separating values)\n`filter=field:in:value1|value2|value3`\n" + required: false + style: form + explode: false + schema: + type: array + items: + type: string + - name: x-org-id + in: header + description: Organization identifier that can be obtained from console settings. + required: false + style: simple + explode: false + schema: + type: string + - name: limit + in: query + required: false + style: form + explode: true + schema: + maximum: 10000 + minimum: 0 + type: integer + default: 10 + responses: + "200": + description: "" + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/system-insights-secureboot' + x-content-type: application/json + "400": + description: "" + content: + application/json: + schema: + type: string + x-content-type: application/json + x-scopes: + - systeminsights.readonly + x-codeSamples: + - lang: Shell + source: "curl --request GET \\\n --url 'https://console.jumpcloud.com/api/v2/systeminsights/secureboot?skip=0&limit=10'\ + \ \\\n --header 'x-org-id: SOME_STRING_VALUE'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/systeminsights/secureboot\"\ + \n\nquerystring = {\"skip\":\"0\",\"limit\":\"10\"}\n\nheaders = {\"x-org-id\"\ + : \"SOME_STRING_VALUE\"}\n\nresponse = requests.request(\"GET\", url, headers=headers,\ + \ params=querystring)\n\nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-org-id\", \"SOME_STRING_VALUE\")\n\ + $response = Invoke-RestMethod -Uri 'https://console.jumpcloud.com/api/v2/systeminsights/secureboot?skip=0&limit=10'\ + \ -Method GET -Headers $headers" + /systeminsights/services: + get: + tags: + - System Insights + summary: List System Insights Services + description: Valid filter fields are `system_id` and `name`. + operationId: systeminsights_list_services + parameters: + - name: skip + in: query + description: The offset into the records to return. + required: false + style: form + explode: true + schema: + minimum: 0 + type: integer + default: 0 + - name: sort + in: query + description: "The comma separated fields used to sort the collection.\nDefault\ + \ sort is ascending, prefix with `-` to sort descending. e.g:\nSort by single\ + \ field:\n`sort=field`\nSort descending by single field:\n`sort=-field`\n\ + Sort by multiple fields:\n`sort=field1,-field2,field3`\n" + required: false + style: form + explode: false + schema: + type: array + items: + type: string + - name: filter + in: query + description: "Supported operators are: eq, in. e.g:\nFilter for single value:\n\ + `filter=field:eq:value`\nFilter for any value in a list: (note \"pipe\"\ + \ character: `|` separating values)\n`filter=field:in:value1|value2|value3`\n" + required: false + style: form + explode: false + schema: + type: array + items: + type: string + - name: x-org-id + in: header + description: Organization identifier that can be obtained from console settings. + required: false + style: simple + explode: false + schema: + type: string + - name: limit + in: query + required: false + style: form + explode: true + schema: + maximum: 10000 + minimum: 0 + type: integer + default: 10 + responses: + "200": + description: "" + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/system-insights-services' + x-content-type: application/json + security: + - x-api-key: [] + x-scopes: + - systeminsights.readonly + x-codeSamples: + - lang: Shell + source: "curl --request GET \\\n --url 'https://console.jumpcloud.com/api/v2/systeminsights/services?skip=0&limit=10'\ + \ \\\n --header 'x-api-key: REPLACE_KEY_VALUE' \\\n --header 'x-org-id:\ + \ SOME_STRING_VALUE'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/systeminsights/services\"\ + \n\nquerystring = {\"skip\":\"0\",\"limit\":\"10\"}\n\nheaders = {\n \ + \ \"x-org-id\": \"SOME_STRING_VALUE\",\n \"x-api-key\": \"REPLACE_KEY_VALUE\"\ + \n}\n\nresponse = requests.request(\"GET\", url, headers=headers, params=querystring)\n\ + \nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-org-id\", \"SOME_STRING_VALUE\")\n\ + $headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n$response = Invoke-RestMethod\ + \ -Uri 'https://console.jumpcloud.com/api/v2/systeminsights/services?skip=0&limit=10'\ + \ -Method GET -Headers $headers" + /systeminsights/shadow: + get: + tags: + - System Insights + summary: LIst System Insights Shadow + description: Valid filter fields are `system_id` and `username`. + operationId: systeminsights_list_shadow + parameters: + - name: x-org-id + in: header + description: Organization identifier that can be obtained from console settings. + required: false + style: simple + explode: false + schema: + type: string + - name: skip + in: query + description: The offset into the records to return. + required: false + style: form + explode: true + schema: + minimum: 0 + type: integer + default: 0 + - name: sort + in: query + description: "The comma separated fields used to sort the collection.\nDefault\ + \ sort is ascending, prefix with `-` to sort descending. e.g:\nSort by single\ + \ field:\n`sort=field`\nSort descending by single field:\n`sort=-field`\n\ + Sort by multiple fields:\n`sort=field1,-field2,field3`\n" + required: false + style: form + explode: false + schema: + type: array + items: + type: string + - name: filter + in: query + description: "Supported operators are: eq, in. e.g:\nFilter for single value:\n\ + `filter=field:eq:value`\nFilter for any value in a list: (note \"pipe\"\ + \ character: `|` separating values)\n`filter=field:in:value1|value2|value3`\n" + required: false + style: form + explode: false + schema: + type: array + items: + type: string + - name: limit + in: query + required: false + style: form + explode: true + schema: + maximum: 10000 + minimum: 0 + type: integer + default: 10 + responses: + "200": + description: "" + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/system-insights-shadow' + x-content-type: application/json + security: + - x-api-key: [] + x-scopes: + - systeminsights.readonly + x-codeSamples: + - lang: Shell + source: "curl --request GET \\\n --url 'https://console.jumpcloud.com/api/v2/systeminsights/shadow?skip=0&limit=10'\ + \ \\\n --header 'x-api-key: REPLACE_KEY_VALUE' \\\n --header 'x-org-id:\ + \ SOME_STRING_VALUE'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/systeminsights/shadow\"\ + \n\nquerystring = {\"skip\":\"0\",\"limit\":\"10\"}\n\nheaders = {\n \ + \ \"x-org-id\": \"SOME_STRING_VALUE\",\n \"x-api-key\": \"REPLACE_KEY_VALUE\"\ + \n}\n\nresponse = requests.request(\"GET\", url, headers=headers, params=querystring)\n\ + \nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-org-id\", \"SOME_STRING_VALUE\")\n\ + $headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n$response = Invoke-RestMethod\ + \ -Uri 'https://console.jumpcloud.com/api/v2/systeminsights/shadow?skip=0&limit=10'\ + \ -Method GET -Headers $headers" + /systeminsights/shared_folders: + get: + tags: + - System Insights + summary: List System Insights Shared Folders + description: Valid filter fields are `system_id` and `name`. + operationId: systeminsights_list_shared_folders + parameters: + - name: x-org-id + in: header + description: Organization identifier that can be obtained from console settings. + required: false + style: simple + explode: false + schema: + type: string + - name: skip + in: query + description: The offset into the records to return. + required: false + style: form + explode: true + schema: + minimum: 0 + type: integer + default: 0 + - name: sort + in: query + description: "The comma separated fields used to sort the collection.\nDefault\ + \ sort is ascending, prefix with `-` to sort descending. e.g:\nSort by single\ + \ field:\n`sort=field`\nSort descending by single field:\n`sort=-field`\n\ + Sort by multiple fields:\n`sort=field1,-field2,field3`\n" + required: false + style: form + explode: false + schema: + type: array + items: + type: string + - name: filter + in: query + description: "Supported operators are: eq, in. e.g:\nFilter for single value:\n\ + `filter=field:eq:value`\nFilter for any value in a list: (note \"pipe\"\ + \ character: `|` separating values)\n`filter=field:in:value1|value2|value3`\n" + required: false + style: form + explode: false + schema: + type: array + items: + type: string + - name: limit + in: query + required: false + style: form + explode: true + schema: + maximum: 10000 + minimum: 0 + type: integer + default: 10 + responses: + "200": + description: "" + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/system-insights-shared-folders' + x-content-type: application/json + security: + - x-api-key: [] + x-scopes: + - systeminsights.readonly + x-codeSamples: + - lang: Shell + source: "curl --request GET \\\n --url 'https://console.jumpcloud.com/api/v2/systeminsights/shared_folders?skip=0&limit=10'\ + \ \\\n --header 'x-api-key: REPLACE_KEY_VALUE' \\\n --header 'x-org-id:\ + \ SOME_STRING_VALUE'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/systeminsights/shared_folders\"\ + \n\nquerystring = {\"skip\":\"0\",\"limit\":\"10\"}\n\nheaders = {\n \ + \ \"x-org-id\": \"SOME_STRING_VALUE\",\n \"x-api-key\": \"REPLACE_KEY_VALUE\"\ + \n}\n\nresponse = requests.request(\"GET\", url, headers=headers, params=querystring)\n\ + \nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-org-id\", \"SOME_STRING_VALUE\")\n\ + $headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n$response = Invoke-RestMethod\ + \ -Uri 'https://console.jumpcloud.com/api/v2/systeminsights/shared_folders?skip=0&limit=10'\ + \ -Method GET -Headers $headers" + /systeminsights/shared_resources: + get: + tags: + - System Insights + summary: List System Insights Shared Resources + description: Valid filter fields are `system_id` and `type`. + operationId: systeminsights_list_shared_resources + parameters: + - name: x-org-id + in: header + description: Organization identifier that can be obtained from console settings. + required: false + style: simple + explode: false + schema: + type: string + - name: skip + in: query + description: The offset into the records to return. + required: false + style: form + explode: true + schema: + minimum: 0 + type: integer + default: 0 + - name: sort + in: query + description: "The comma separated fields used to sort the collection.\nDefault\ + \ sort is ascending, prefix with `-` to sort descending. e.g:\nSort by single\ + \ field:\n`sort=field`\nSort descending by single field:\n`sort=-field`\n\ + Sort by multiple fields:\n`sort=field1,-field2,field3`\n" + required: false + style: form + explode: false + schema: + type: array + items: + type: string + - name: filter + in: query + description: "Supported operators are: eq, in. e.g:\nFilter for single value:\n\ + `filter=field:eq:value`\nFilter for any value in a list: (note \"pipe\"\ + \ character: `|` separating values)\n`filter=field:in:value1|value2|value3`\n" + required: false + style: form + explode: false + schema: + type: array + items: + type: string + - name: limit + in: query + required: false + style: form + explode: true + schema: + maximum: 10000 + minimum: 0 + type: integer + default: 10 + responses: + "200": + description: "" + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/system-insights-shared-resources' + x-content-type: application/json + x-scopes: + - systeminsights.readonly + x-codeSamples: + - lang: Shell + source: "curl --request GET \\\n --url 'https://console.jumpcloud.com/api/v2/systeminsights/shared_resources?skip=0&limit=10'\ + \ \\\n --header 'x-org-id: SOME_STRING_VALUE'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/systeminsights/shared_resources\"\ + \n\nquerystring = {\"skip\":\"0\",\"limit\":\"10\"}\n\nheaders = {\"x-org-id\"\ + : \"SOME_STRING_VALUE\"}\n\nresponse = requests.request(\"GET\", url, headers=headers,\ + \ params=querystring)\n\nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-org-id\", \"SOME_STRING_VALUE\")\n\ + $response = Invoke-RestMethod -Uri 'https://console.jumpcloud.com/api/v2/systeminsights/shared_resources?skip=0&limit=10'\ + \ -Method GET -Headers $headers" + /systeminsights/sharing_preferences: + get: + tags: + - System Insights + summary: List System Insights Sharing Preferences + description: Only valid filed field is `system_id`. + operationId: systeminsights_list_sharing_preferences + parameters: + - name: x-org-id + in: header + description: Organization identifier that can be obtained from console settings. + required: false + style: simple + explode: false + schema: + type: string + - name: skip + in: query + description: The offset into the records to return. + required: false + style: form + explode: true + schema: + minimum: 0 + type: integer + default: 0 + - name: sort + in: query + description: "The comma separated fields used to sort the collection.\nDefault\ + \ sort is ascending, prefix with `-` to sort descending. e.g:\nSort by single\ + \ field:\n`sort=field`\nSort descending by single field:\n`sort=-field`\n\ + Sort by multiple fields:\n`sort=field1,-field2,field3`\n" + required: false + style: form + explode: false + schema: + type: array + items: + type: string + - name: filter + in: query + description: "Supported operators are: eq, in. e.g:\nFilter for single value:\n\ + `filter=field:eq:value`\nFilter for any value in a list: (note \"pipe\"\ + \ character: `|` separating values)\n`filter=field:in:value1|value2|value3`\n" + required: false + style: form + explode: false + schema: + type: array + items: + type: string + - name: limit + in: query + required: false + style: form + explode: true + schema: + maximum: 10000 + minimum: 0 + type: integer + default: 10 + responses: + "200": + description: "" + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/system-insights-sharing-preferences' + x-content-type: application/json + security: + - x-api-key: [] + x-scopes: + - systeminsights.readonly + x-codeSamples: + - lang: Shell + source: "curl --request GET \\\n --url 'https://console.jumpcloud.com/api/v2/systeminsights/sharing_preferences?skip=0&limit=10'\ + \ \\\n --header 'x-api-key: REPLACE_KEY_VALUE' \\\n --header 'x-org-id:\ + \ SOME_STRING_VALUE'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/systeminsights/sharing_preferences\"\ + \n\nquerystring = {\"skip\":\"0\",\"limit\":\"10\"}\n\nheaders = {\n \ + \ \"x-org-id\": \"SOME_STRING_VALUE\",\n \"x-api-key\": \"REPLACE_KEY_VALUE\"\ + \n}\n\nresponse = requests.request(\"GET\", url, headers=headers, params=querystring)\n\ + \nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-org-id\", \"SOME_STRING_VALUE\")\n\ + $headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n$response = Invoke-RestMethod\ + \ -Uri 'https://console.jumpcloud.com/api/v2/systeminsights/sharing_preferences?skip=0&limit=10'\ + \ -Method GET -Headers $headers" + /systeminsights/sip_config: + get: + tags: + - System Insights + summary: List System Insights SIP Config + description: Valid filter fields are `system_id` and `enabled`. + operationId: systeminsights_list_sip_config + parameters: + - name: x-org-id + in: header + description: Organization identifier that can be obtained from console settings. + required: false + style: simple + explode: false + schema: + type: string + - name: skip + in: query + description: The offset into the records to return. + required: false + style: form + explode: true + schema: + minimum: 0 + type: integer + default: 0 + - name: sort + in: query + description: "The comma separated fields used to sort the collection.\nDefault\ + \ sort is ascending, prefix with `-` to sort descending. e.g:\nSort by single\ + \ field:\n`sort=field`\nSort descending by single field:\n`sort=-field`\n\ + Sort by multiple fields:\n`sort=field1,-field2,field3`\n" + required: false + style: form + explode: false + schema: + type: array + items: + type: string + - name: filter + in: query + description: "Supported operators are: eq, in. e.g:\nFilter for single value:\n\ + `filter=field:eq:value`\nFilter for any value in a list: (note \"pipe\"\ + \ character: `|` separating values)\n`filter=field:in:value1|value2|value3`\n" + required: false + style: form + explode: false + schema: + type: array + items: + type: string + - name: limit + in: query + required: false + style: form + explode: true + schema: + maximum: 10000 + minimum: 0 + type: integer + default: 10 + responses: + "200": + description: "" + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/system-insights-sip-config' + x-content-type: application/json + security: + - x-api-key: [] + x-scopes: + - systeminsights.readonly + x-codeSamples: + - lang: Shell + source: "curl --request GET \\\n --url 'https://console.jumpcloud.com/api/v2/systeminsights/sip_config?skip=0&limit=10'\ + \ \\\n --header 'x-api-key: REPLACE_KEY_VALUE' \\\n --header 'x-org-id:\ + \ SOME_STRING_VALUE'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/systeminsights/sip_config\"\ + \n\nquerystring = {\"skip\":\"0\",\"limit\":\"10\"}\n\nheaders = {\n \ + \ \"x-org-id\": \"SOME_STRING_VALUE\",\n \"x-api-key\": \"REPLACE_KEY_VALUE\"\ + \n}\n\nresponse = requests.request(\"GET\", url, headers=headers, params=querystring)\n\ + \nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-org-id\", \"SOME_STRING_VALUE\")\n\ + $headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n$response = Invoke-RestMethod\ + \ -Uri 'https://console.jumpcloud.com/api/v2/systeminsights/sip_config?skip=0&limit=10'\ + \ -Method GET -Headers $headers" + /systeminsights/startup_items: + get: + tags: + - System Insights + summary: List System Insights Startup Items + description: Valid filter fields are `system_id` and `name`. + operationId: systeminsights_list_startup_items + parameters: + - name: skip + in: query + description: The offset into the records to return. + required: false + style: form + explode: true + schema: + minimum: 0 + type: integer + default: 0 + - name: sort + in: query + description: "The comma separated fields used to sort the collection.\nDefault\ + \ sort is ascending, prefix with `-` to sort descending. e.g:\nSort by single\ + \ field:\n`sort=field`\nSort descending by single field:\n`sort=-field`\n\ + Sort by multiple fields:\n`sort=field1,-field2,field3`\n" + required: false + style: form + explode: false + schema: + type: array + items: + type: string + - name: filter + in: query + description: "Supported operators are: eq, in. e.g:\nFilter for single value:\n\ + `filter=field:eq:value`\nFilter for any value in a list: (note \"pipe\"\ + \ character: `|` separating values)\n`filter=field:in:value1|value2|value3`\n" + required: false + style: form + explode: false + schema: + type: array + items: + type: string + - name: x-org-id + in: header + description: Organization identifier that can be obtained from console settings. + required: false + style: simple + explode: false + schema: + type: string + - name: limit + in: query + required: false + style: form + explode: true + schema: + maximum: 10000 + minimum: 0 + type: integer + default: 10 + responses: + "200": + description: "" + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/system-insights-startup-items' + x-content-type: application/json + security: + - x-api-key: [] + x-scopes: + - systeminsights.readonly + x-codeSamples: + - lang: Shell + source: "curl --request GET \\\n --url 'https://console.jumpcloud.com/api/v2/systeminsights/startup_items?skip=0&limit=10'\ + \ \\\n --header 'x-api-key: REPLACE_KEY_VALUE' \\\n --header 'x-org-id:\ + \ SOME_STRING_VALUE'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/systeminsights/startup_items\"\ + \n\nquerystring = {\"skip\":\"0\",\"limit\":\"10\"}\n\nheaders = {\n \ + \ \"x-org-id\": \"SOME_STRING_VALUE\",\n \"x-api-key\": \"REPLACE_KEY_VALUE\"\ + \n}\n\nresponse = requests.request(\"GET\", url, headers=headers, params=querystring)\n\ + \nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-org-id\", \"SOME_STRING_VALUE\")\n\ + $headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n$response = Invoke-RestMethod\ + \ -Uri 'https://console.jumpcloud.com/api/v2/systeminsights/startup_items?skip=0&limit=10'\ + \ -Method GET -Headers $headers" + /systeminsights/system_controls: + get: + tags: + - System Insights + summary: List System Insights System Control + description: Valid filter fields are `system_id` and `name`. + operationId: systeminsights_list_system_controls + parameters: + - name: skip + in: query + description: The offset into the records to return. + required: false + style: form + explode: true + schema: + minimum: 0 + type: integer + default: 0 + - name: sort + in: query + description: "The comma separated fields used to sort the collection.\nDefault\ + \ sort is ascending, prefix with `-` to sort descending. e.g:\nSort by single\ + \ field:\n`sort=field`\nSort descending by single field:\n`sort=-field`\n\ + Sort by multiple fields:\n`sort=field1,-field2,field3`\n" + required: false + style: form + explode: false + schema: + type: array + items: + type: string + - name: filter + in: query + description: "Supported operators are: eq, in. e.g:\nFilter for single value:\n\ + `filter=field:eq:value`\nFilter value in a list: (note \"pipe\" character:\ + \ `|` separating values)\n`filter=field:in:value1|value2|value3`\nNote:\ + \ You can only filter by `system_id` and `name`\n" + required: false + style: form + explode: false + schema: + type: array + items: + type: string + - name: x-org-id + in: header + description: Organization identifier that can be obtained from console settings. + required: false + style: simple + explode: false + schema: + type: string + - name: limit + in: query + required: false + style: form + explode: true + schema: + maximum: 10000 + minimum: 0 + type: integer + default: 10 + responses: + "200": + description: "" + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/system-insights-system-controls' + x-content-type: application/json + security: + - x-api-key: [] + x-scopes: + - systeminsights.readonly + x-codeSamples: + - lang: Shell + source: "curl --request GET \\\n --url 'https://console.jumpcloud.com/api/v2/systeminsights/system_controls?skip=0&limit=10'\ + \ \\\n --header 'x-api-key: REPLACE_KEY_VALUE' \\\n --header 'x-org-id:\ + \ SOME_STRING_VALUE'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/systeminsights/system_controls\"\ + \n\nquerystring = {\"skip\":\"0\",\"limit\":\"10\"}\n\nheaders = {\n \ + \ \"x-org-id\": \"SOME_STRING_VALUE\",\n \"x-api-key\": \"REPLACE_KEY_VALUE\"\ + \n}\n\nresponse = requests.request(\"GET\", url, headers=headers, params=querystring)\n\ + \nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-org-id\", \"SOME_STRING_VALUE\")\n\ + $headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n$response = Invoke-RestMethod\ + \ -Uri 'https://console.jumpcloud.com/api/v2/systeminsights/system_controls?skip=0&limit=10'\ + \ -Method GET -Headers $headers" + /systeminsights/system_info: + get: + tags: + - System Insights + summary: List System Insights System Info + description: Valid filter fields are `system_id` and `cpu_subtype`. + operationId: systeminsights_list_system_info + parameters: + - name: skip + in: query + description: The offset into the records to return. + required: false + style: form + explode: true + schema: + minimum: 0 + type: integer + default: 0 + - name: sort + in: query + description: "The comma separated fields used to sort the collection.\nDefault\ + \ sort is ascending, prefix with `-` to sort descending. e.g:\nSort by single\ + \ field:\n`sort=field`\nSort descending by single field:\n`sort=-field`\n\ + Sort by multiple fields:\n`sort=field1,-field2,field3`\n" + required: false + style: form + explode: false + schema: + type: array + items: + type: string + - name: filter + in: query + description: "Supported operators are: eq, in. e.g:\nFilter for single value:\n\ + `filter=field:eq:value`\nFilter for any value in a list: (note \"pipe\"\ + \ character: `|` separating values)\n`filter=field:in:value1|value2|value3`\n" + required: false + style: form + explode: false + schema: + type: array + items: + type: string + - name: x-org-id + in: header + description: Organization identifier that can be obtained from console settings. + required: false + style: simple + explode: false + schema: + type: string + - name: limit + in: query + required: false + style: form + explode: true + schema: + maximum: 10000 + minimum: 0 + type: integer + default: 10 + responses: + "200": + description: "" + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/system-insights-system-info' + x-content-type: application/json + security: + - x-api-key: [] + x-scopes: + - systeminsights.readonly + x-codeSamples: + - lang: Shell + source: "curl --request GET \\\n --url 'https://console.jumpcloud.com/api/v2/systeminsights/system_info?skip=0&limit=10'\ + \ \\\n --header 'x-api-key: REPLACE_KEY_VALUE' \\\n --header 'x-org-id:\ + \ SOME_STRING_VALUE'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/systeminsights/system_info\"\ + \n\nquerystring = {\"skip\":\"0\",\"limit\":\"10\"}\n\nheaders = {\n \ + \ \"x-org-id\": \"SOME_STRING_VALUE\",\n \"x-api-key\": \"REPLACE_KEY_VALUE\"\ + \n}\n\nresponse = requests.request(\"GET\", url, headers=headers, params=querystring)\n\ + \nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-org-id\", \"SOME_STRING_VALUE\")\n\ + $headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n$response = Invoke-RestMethod\ + \ -Uri 'https://console.jumpcloud.com/api/v2/systeminsights/system_info?skip=0&limit=10'\ + \ -Method GET -Headers $headers" + /systeminsights/tpm_info: + get: + tags: + - System Insights + summary: List System Insights TPM Info + description: Valid filter fields are `system_id`. + operationId: systeminsights_list_tpm_info + parameters: + - name: skip + in: query + description: The offset into the records to return. + required: false + style: form + explode: true + schema: + minimum: 0 + type: integer + default: 0 + - name: sort + in: query + description: "The comma separated fields used to sort the collection.\nDefault\ + \ sort is ascending, prefix with `-` to sort descending. e.g:\nSort by single\ + \ field:\n`sort=field`\nSort descending by single field:\n`sort=-field`\n\ + Sort by multiple fields:\n`sort=field1,-field2,field3`\n" + required: false + style: form + explode: false + schema: + type: array + items: + type: string + - name: filter + in: query + description: "Supported operators are: eq, in. e.g:\nFilter for single value:\n\ + `filter=field:eq:value`\nFilter for any value in a list: (note \"pipe\"\ + \ character: `|` separating values)\n`filter=field:in:value1|value2|value3`\n" + required: false + style: form + explode: false + schema: + type: array + items: + type: string + - name: x-org-id + in: header + description: Organization identifier that can be obtained from console settings. + required: false + style: simple + explode: false + schema: + type: string + - name: limit + in: query + required: false + style: form + explode: true + schema: + maximum: 10000 + minimum: 0 + type: integer + default: 10 + responses: + "200": + description: "" + content: + text/html: + schema: + type: array + items: + $ref: '#/components/schemas/system-insights-tpm-info' + x-content-type: text/html + "400": + description: "" + content: + text/html: + schema: + type: string + x-content-type: text/html + x-scopes: + - systeminsights.readonly + x-codeSamples: + - lang: Shell + source: "curl --request GET \\\n --url 'https://console.jumpcloud.com/api/v2/systeminsights/tpm_info?skip=0&limit=10'\ + \ \\\n --header 'x-org-id: SOME_STRING_VALUE'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/systeminsights/tpm_info\"\ + \n\nquerystring = {\"skip\":\"0\",\"limit\":\"10\"}\n\nheaders = {\"x-org-id\"\ + : \"SOME_STRING_VALUE\"}\n\nresponse = requests.request(\"GET\", url, headers=headers,\ + \ params=querystring)\n\nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-org-id\", \"SOME_STRING_VALUE\")\n\ + $response = Invoke-RestMethod -Uri 'https://console.jumpcloud.com/api/v2/systeminsights/tpm_info?skip=0&limit=10'\ + \ -Method GET -Headers $headers" + /systeminsights/uptime: + get: + tags: + - System Insights + summary: List System Insights Uptime + description: Valid filter fields are `system_id` and `days`. + operationId: systeminsights_list_uptime + parameters: + - name: skip + in: query + description: The offset into the records to return. + required: false + style: form + explode: true + schema: + minimum: 0 + type: integer + default: 0 + - name: sort + in: query + description: "The comma separated fields used to sort the collection.\nDefault\ + \ sort is ascending, prefix with `-` to sort descending. e.g:\nSort by single\ + \ field:\n`sort=field`\nSort descending by single field:\n`sort=-field`\n\ + Sort by multiple fields:\n`sort=field1,-field2,field3`\n" + required: false + style: form + explode: false + schema: + type: array + items: + type: string + - name: filter + in: query + description: "Supported operators are: eq, gte, in. e.g:\nFilter for single\ + \ value:\n`filter=field:gte:value`\nFilter for any value in a list: (note\ + \ \"pipe\" character: `|` separating values)\n`filter=field:in:value1|value2|value3`\n" + required: false + style: form + explode: false + schema: + type: array + items: + type: string + - name: x-org-id + in: header + description: Organization identifier that can be obtained from console settings. + required: false + style: simple + explode: false + schema: + type: string + - name: limit + in: query + required: false + style: form + explode: true + schema: + maximum: 10000 + minimum: 0 + type: integer + default: 10 + responses: + "200": + description: "" + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/system-insights-uptime' + x-content-type: application/json + security: + - x-api-key: [] + x-scopes: + - systeminsights.readonly + x-codeSamples: + - lang: Shell + source: "curl --request GET \\\n --url 'https://console.jumpcloud.com/api/v2/systeminsights/uptime?skip=0&limit=10'\ + \ \\\n --header 'x-api-key: REPLACE_KEY_VALUE' \\\n --header 'x-org-id:\ + \ SOME_STRING_VALUE'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/systeminsights/uptime\"\ + \n\nquerystring = {\"skip\":\"0\",\"limit\":\"10\"}\n\nheaders = {\n \ + \ \"x-org-id\": \"SOME_STRING_VALUE\",\n \"x-api-key\": \"REPLACE_KEY_VALUE\"\ + \n}\n\nresponse = requests.request(\"GET\", url, headers=headers, params=querystring)\n\ + \nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-org-id\", \"SOME_STRING_VALUE\")\n\ + $headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n$response = Invoke-RestMethod\ + \ -Uri 'https://console.jumpcloud.com/api/v2/systeminsights/uptime?skip=0&limit=10'\ + \ -Method GET -Headers $headers" + /systeminsights/usb_devices: + get: + tags: + - System Insights + summary: List System Insights USB Devices + description: Valid filter fields are `system_id` and `model`. + operationId: systeminsights_list_usb_devices + parameters: + - name: x-org-id + in: header + description: Organization identifier that can be obtained from console settings. + required: false + style: simple + explode: false + schema: + type: string + - name: skip + in: query + description: The offset into the records to return. + required: false + style: form + explode: true + schema: + minimum: 0 + type: integer + default: 0 + - name: sort + in: query + description: "The comma separated fields used to sort the collection.\nDefault\ + \ sort is ascending, prefix with `-` to sort descending. e.g:\nSort by single\ + \ field:\n`sort=field`\nSort descending by single field:\n`sort=-field`\n\ + Sort by multiple fields:\n`sort=field1,-field2,field3`\n" + required: false + style: form + explode: false + schema: + type: array + items: + type: string + - name: filter + in: query + description: "Supported operators are: eq, in. e.g:\nFilter for single value:\n\ + `filter=field:eq:value`\nFilter for any value in a list: (note \"pipe\"\ + \ character: `|` separating values)\n`filter=field:in:value1|value2|value3`\n" + required: false + style: form + explode: false + schema: + type: array + items: + type: string + - name: limit + in: query + required: false + style: form + explode: true + schema: + maximum: 10000 + minimum: 0 + type: integer + default: 10 + responses: + "200": + description: "" + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/system-insights-usb-devices' + x-content-type: application/json + security: + - x-api-key: [] + x-scopes: + - systeminsights.readonly + x-codeSamples: + - lang: Shell + source: "curl --request GET \\\n --url 'https://console.jumpcloud.com/api/v2/systeminsights/usb_devices?skip=0&limit=10'\ + \ \\\n --header 'x-api-key: REPLACE_KEY_VALUE' \\\n --header 'x-org-id:\ + \ SOME_STRING_VALUE'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/systeminsights/usb_devices\"\ + \n\nquerystring = {\"skip\":\"0\",\"limit\":\"10\"}\n\nheaders = {\n \ + \ \"x-org-id\": \"SOME_STRING_VALUE\",\n \"x-api-key\": \"REPLACE_KEY_VALUE\"\ + \n}\n\nresponse = requests.request(\"GET\", url, headers=headers, params=querystring)\n\ + \nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-org-id\", \"SOME_STRING_VALUE\")\n\ + $headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n$response = Invoke-RestMethod\ + \ -Uri 'https://console.jumpcloud.com/api/v2/systeminsights/usb_devices?skip=0&limit=10'\ + \ -Method GET -Headers $headers" + /systeminsights/user_groups: + get: + tags: + - System Insights + summary: List System Insights User Groups + description: Only valid filter field is `system_id`. + operationId: systeminsights_list_user_groups + parameters: + - name: x-org-id + in: header + description: Organization identifier that can be obtained from console settings. + required: false + style: simple + explode: false + schema: + type: string + - name: skip + in: query + description: The offset into the records to return. + required: false + style: form + explode: true + schema: + minimum: 0 + type: integer + default: 0 + - name: sort + in: query + description: "The comma separated fields used to sort the collection.\nDefault\ + \ sort is ascending, prefix with `-` to sort descending. e.g:\nSort by single\ + \ field:\n`sort=field`\nSort descending by single field:\n`sort=-field`\n\ + Sort by multiple fields:\n`sort=field1,-field2,field3`\n" + required: false + style: form + explode: false + schema: + type: array + items: + type: string + - name: filter + in: query + description: "Supported operators are: eq, in. e.g:\nFilter for single value:\n\ + `filter=field:eq:value`\nFilter for any value in a list: (note \"pipe\"\ + \ character: `|` separating values)\n`filter=field:in:value1|value2|value3`\n" + required: false + style: form + explode: false + schema: + type: array + items: + type: string + - name: limit + in: query + required: false + style: form + explode: true + schema: + maximum: 10000 + minimum: 0 + type: integer + default: 10 + responses: + "200": + description: "" + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/system-insights-user-groups' + x-content-type: application/json + security: + - x-api-key: [] + x-scopes: + - systeminsights.readonly + x-codeSamples: + - lang: Shell + source: "curl --request GET \\\n --url 'https://console.jumpcloud.com/api/v2/systeminsights/user_groups?skip=0&limit=10'\ + \ \\\n --header 'x-api-key: REPLACE_KEY_VALUE' \\\n --header 'x-org-id:\ + \ SOME_STRING_VALUE'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/systeminsights/user_groups\"\ + \n\nquerystring = {\"skip\":\"0\",\"limit\":\"10\"}\n\nheaders = {\n \ + \ \"x-org-id\": \"SOME_STRING_VALUE\",\n \"x-api-key\": \"REPLACE_KEY_VALUE\"\ + \n}\n\nresponse = requests.request(\"GET\", url, headers=headers, params=querystring)\n\ + \nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-org-id\", \"SOME_STRING_VALUE\")\n\ + $headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n$response = Invoke-RestMethod\ + \ -Uri 'https://console.jumpcloud.com/api/v2/systeminsights/user_groups?skip=0&limit=10'\ + \ -Method GET -Headers $headers" + /systeminsights/user_ssh_keys: + get: + tags: + - System Insights + summary: List System Insights User SSH Keys + description: Valid filter fields are `system_id` and `uid`. + operationId: systeminsights_list_user_ssh_keys + parameters: + - name: x-org-id + in: header + description: Organization identifier that can be obtained from console settings. + required: false + style: simple + explode: false + schema: + type: string + - name: skip + in: query + description: The offset into the records to return. + required: false + style: form + explode: true + schema: + minimum: 0 + type: integer + default: 0 + - name: sort + in: query + description: "The comma separated fields used to sort the collection.\nDefault\ + \ sort is ascending, prefix with `-` to sort descending. e.g:\nSort by single\ + \ field:\n`sort=field`\nSort descending by single field:\n`sort=-field`\n\ + Sort by multiple fields:\n`sort=field1,-field2,field3`\n" + required: false + style: form + explode: false + schema: + type: array + items: + type: string + - name: filter + in: query + description: "Supported operators are: eq, in. e.g:\nFilter for single value:\n\ + `filter=field:eq:value`\nFilter for any value in a list: (note \"pipe\"\ + \ character: `|` separating values)\n`filter=field:in:value1|value2|value3`\n" + required: false + style: form + explode: false + schema: + type: array + items: + type: string + - name: limit + in: query + required: false + style: form + explode: true + schema: + maximum: 10000 + minimum: 0 + type: integer + default: 10 + responses: + "200": + description: "" + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/system-insights-user-ssh-keys' + x-content-type: application/json + security: + - x-api-key: [] + x-scopes: + - systeminsights.readonly + x-codeSamples: + - lang: Shell + source: "curl --request GET \\\n --url 'https://console.jumpcloud.com/api/v2/systeminsights/user_ssh_keys?skip=0&limit=10'\ + \ \\\n --header 'x-api-key: REPLACE_KEY_VALUE' \\\n --header 'x-org-id:\ + \ SOME_STRING_VALUE'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/systeminsights/user_ssh_keys\"\ + \n\nquerystring = {\"skip\":\"0\",\"limit\":\"10\"}\n\nheaders = {\n \ + \ \"x-org-id\": \"SOME_STRING_VALUE\",\n \"x-api-key\": \"REPLACE_KEY_VALUE\"\ + \n}\n\nresponse = requests.request(\"GET\", url, headers=headers, params=querystring)\n\ + \nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-org-id\", \"SOME_STRING_VALUE\")\n\ + $headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n$response = Invoke-RestMethod\ + \ -Uri 'https://console.jumpcloud.com/api/v2/systeminsights/user_ssh_keys?skip=0&limit=10'\ + \ -Method GET -Headers $headers" + /systeminsights/userassist: + get: + tags: + - System Insights + summary: List System Insights User Assist + description: Valid filter fields are `system_id`. + operationId: systeminsights_list_userassist + parameters: + - name: skip + in: query + description: The offset into the records to return. + required: false + style: form + explode: true + schema: + minimum: 0 + type: integer + default: 0 + - name: sort + in: query + description: "The comma separated fields used to sort the collection.\nDefault\ + \ sort is ascending, prefix with `-` to sort descending. e.g:\nSort by single\ + \ field:\n`sort=field`\nSort descending by single field:\n`sort=-field`\n\ + Sort by multiple fields:\n`sort=field1,-field2,field3`\n" + required: false + style: form + explode: false + schema: + type: array + items: + type: string + - name: filter + in: query + description: "Supported operators are: eq, in. e.g:\nFilter for single value:\n\ + `filter=field:eq:value`\nFilter for any value in a list: (note \"pipe\"\ + \ character: `|` separating values)\n`filter=field:in:value1|value2|value3`\n" + required: false + style: form + explode: false + schema: + type: array + items: + type: string + - name: x-org-id + in: header + description: Organization identifier that can be obtained from console settings. + required: false + style: simple + explode: false + schema: + type: string + - name: limit + in: query + required: false + style: form + explode: true + schema: + maximum: 10000 + minimum: 0 + type: integer + default: 10 + responses: + "200": + description: "" + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/system-insights-userassist' + x-content-type: application/json + "400": + description: "" + content: + application/json: + schema: + type: string + x-content-type: application/json + x-scopes: + - systeminsights.readonly + x-codeSamples: + - lang: Shell + source: "curl --request GET \\\n --url 'https://console.jumpcloud.com/api/v2/systeminsights/userassist?skip=0&limit=10'\ + \ \\\n --header 'x-org-id: SOME_STRING_VALUE'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/systeminsights/userassist\"\ + \n\nquerystring = {\"skip\":\"0\",\"limit\":\"10\"}\n\nheaders = {\"x-org-id\"\ + : \"SOME_STRING_VALUE\"}\n\nresponse = requests.request(\"GET\", url, headers=headers,\ + \ params=querystring)\n\nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-org-id\", \"SOME_STRING_VALUE\")\n\ + $response = Invoke-RestMethod -Uri 'https://console.jumpcloud.com/api/v2/systeminsights/userassist?skip=0&limit=10'\ + \ -Method GET -Headers $headers" + /systeminsights/users: + get: + tags: + - System Insights + summary: List System Insights Users + description: Valid filter fields are `system_id` and `username`. + operationId: systeminsights_list_users + parameters: + - name: skip + in: query + description: The offset into the records to return. + required: false + style: form + explode: true + schema: + minimum: 0 + type: integer + default: 0 + - name: sort + in: query + description: "The comma separated fields used to sort the collection.\nDefault\ + \ sort is ascending, prefix with `-` to sort descending. e.g:\nSort by single\ + \ field:\n`sort=field`\nSort descending by single field:\n`sort=-field`\n\ + Sort by multiple fields:\n`sort=field1,-field2,field3`\n" + required: false + style: form + explode: false + schema: + type: array + items: + type: string + - name: filter + in: query + description: "Supported operators are: eq, in. e.g:\nFilter for single value:\n\ + `filter=field:eq:value`\nFilter for any value in a list: (note \"pipe\"\ + \ character: `|` separating values)\n`filter=field:in:value1|value2|value3`\n" + required: false + style: form + explode: false + schema: + type: array + items: + type: string + - name: x-org-id + in: header + description: Organization identifier that can be obtained from console settings. + required: false + style: simple + explode: false + schema: + type: string + - name: limit + in: query + required: false + style: form + explode: true + schema: + maximum: 10000 + minimum: 0 + type: integer + default: 10 + responses: + "200": + description: "" + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/system-insights-users' + x-content-type: application/json + security: + - x-api-key: [] + x-scopes: + - systeminsights.readonly + x-codeSamples: + - lang: Shell + source: "curl --request GET \\\n --url 'https://console.jumpcloud.com/api/v2/systeminsights/users?skip=0&limit=10'\ + \ \\\n --header 'x-api-key: REPLACE_KEY_VALUE' \\\n --header 'x-org-id:\ + \ SOME_STRING_VALUE'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/systeminsights/users\"\ + \n\nquerystring = {\"skip\":\"0\",\"limit\":\"10\"}\n\nheaders = {\n \ + \ \"x-org-id\": \"SOME_STRING_VALUE\",\n \"x-api-key\": \"REPLACE_KEY_VALUE\"\ + \n}\n\nresponse = requests.request(\"GET\", url, headers=headers, params=querystring)\n\ + \nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-org-id\", \"SOME_STRING_VALUE\")\n\ + $headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n$response = Invoke-RestMethod\ + \ -Uri 'https://console.jumpcloud.com/api/v2/systeminsights/users?skip=0&limit=10'\ + \ -Method GET -Headers $headers" + /systeminsights/wifi_networks: + get: + tags: + - System Insights + summary: List System Insights WiFi Networks + description: Valid filter fields are `system_id` and `security_type`. + operationId: systeminsights_list_wifi_networks + parameters: + - name: skip + in: query + description: The offset into the records to return. + required: false + style: form + explode: true + schema: + minimum: 0 + type: integer + default: 0 + - name: sort + in: query + description: "The comma separated fields used to sort the collection.\nDefault\ + \ sort is ascending, prefix with `-` to sort descending. e.g:\nSort by single\ + \ field:\n`sort=field`\nSort descending by single field:\n`sort=-field`\n\ + Sort by multiple fields:\n`sort=field1,-field2,field3`\n" + required: false + style: form + explode: false + schema: + type: array + items: + type: string + - name: filter + in: query + description: "Supported operators are: eq, in. e.g:\nFilter for single value:\n\ + `filter=field:eq:value`\nFilter for any value in a list: (note \"pipe\"\ + \ character: `|` separating values)\n`filter=field:in:value1|value2|value3`\n" + required: false + style: form + explode: false + schema: + type: array + items: + type: string + - name: x-org-id + in: header + description: Organization identifier that can be obtained from console settings. + required: false + style: simple + explode: false + schema: + type: string + - name: limit + in: query + required: false + style: form + explode: true + schema: + maximum: 10000 + minimum: 0 + type: integer + default: 10 + responses: + "200": + description: "" + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/system-insights-wifi-networks' + x-content-type: application/json + security: + - x-api-key: [] + x-scopes: + - systeminsights.readonly + x-codeSamples: + - lang: Shell + source: "curl --request GET \\\n --url 'https://console.jumpcloud.com/api/v2/systeminsights/wifi_networks?skip=0&limit=10'\ + \ \\\n --header 'x-api-key: REPLACE_KEY_VALUE' \\\n --header 'x-org-id:\ + \ SOME_STRING_VALUE'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/systeminsights/wifi_networks\"\ + \n\nquerystring = {\"skip\":\"0\",\"limit\":\"10\"}\n\nheaders = {\n \ + \ \"x-org-id\": \"SOME_STRING_VALUE\",\n \"x-api-key\": \"REPLACE_KEY_VALUE\"\ + \n}\n\nresponse = requests.request(\"GET\", url, headers=headers, params=querystring)\n\ + \nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-org-id\", \"SOME_STRING_VALUE\")\n\ + $headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n$response = Invoke-RestMethod\ + \ -Uri 'https://console.jumpcloud.com/api/v2/systeminsights/wifi_networks?skip=0&limit=10'\ + \ -Method GET -Headers $headers" + /systeminsights/wifi_status: + get: + tags: + - System Insights + summary: List System Insights WiFi Status + description: Valid filter fields are `system_id` and `security_type`. + operationId: systeminsights_list_wifi_status + parameters: + - name: skip + in: query + description: The offset into the records to return. + required: false + style: form + explode: true + schema: + minimum: 0 + type: integer + default: 0 + - name: sort + in: query + description: "The comma separated fields used to sort the collection.\nDefault\ + \ sort is ascending, prefix with `-` to sort descending. e.g:\nSort by single\ + \ field:\n`sort=field`\nSort descending by single field:\n`sort=-field`\n\ + Sort by multiple fields:\n`sort=field1,-field2,field3`\n" + required: false + style: form + explode: false + schema: + type: array + items: + type: string + - name: filter + in: query + description: "Supported operators are: eq, in. e.g:\nFilter for single value:\n\ + `filter=field:eq:value`\nFilter for any value in a list: (note \"pipe\"\ + \ character: `|` separating values)\n`filter=field:in:value1|value2|value3`\n" + required: false + style: form + explode: false + schema: + type: array + items: + type: string + - name: x-org-id + in: header + description: Organization identifier that can be obtained from console settings. + required: false + style: simple + explode: false + schema: + type: string + - name: limit + in: query + required: false + style: form + explode: true + schema: + maximum: 10000 + minimum: 0 + type: integer + default: 10 + responses: + "200": + description: "" + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/system-insights-wifi-status' + x-content-type: application/json + security: + - x-api-key: [] + x-scopes: + - systeminsights.readonly + x-codeSamples: + - lang: Shell + source: "curl --request GET \\\n --url 'https://console.jumpcloud.com/api/v2/systeminsights/wifi_status?skip=0&limit=10'\ + \ \\\n --header 'x-api-key: REPLACE_KEY_VALUE' \\\n --header 'x-org-id:\ + \ SOME_STRING_VALUE'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/systeminsights/wifi_status\"\ + \n\nquerystring = {\"skip\":\"0\",\"limit\":\"10\"}\n\nheaders = {\n \ + \ \"x-org-id\": \"SOME_STRING_VALUE\",\n \"x-api-key\": \"REPLACE_KEY_VALUE\"\ + \n}\n\nresponse = requests.request(\"GET\", url, headers=headers, params=querystring)\n\ + \nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-org-id\", \"SOME_STRING_VALUE\")\n\ + $headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n$response = Invoke-RestMethod\ + \ -Uri 'https://console.jumpcloud.com/api/v2/systeminsights/wifi_status?skip=0&limit=10'\ + \ -Method GET -Headers $headers" + /systeminsights/windows_security_center: + get: + tags: + - System Insights + summary: List System Insights Windows Security Center + description: Valid filter fields are `system_id`. + operationId: systeminsights_list_windows_security_center + parameters: + - name: skip + in: query + description: The offset into the records to return. + required: false + style: form + explode: true + schema: + minimum: 0 + type: integer + default: 0 + - name: sort + in: query + description: "The comma separated fields used to sort the collection.\nDefault\ + \ sort is ascending, prefix with `-` to sort descending. e.g:\nSort by single\ + \ field:\n`sort=field`\nSort descending by single field:\n`sort=-field`\n\ + Sort by multiple fields:\n`sort=field1,-field2,field3`\n" + required: false + style: form + explode: false + schema: + type: array + items: + type: string + - name: filter + in: query + description: "Supported operators are: eq, in. e.g:\nFilter for single value:\n\ + `filter=field:eq:value`\nFilter for any value in a list: (note \"pipe\"\ + \ character: `|` separating values)\n`filter=field:in:value1|value2|value3`\n" + required: false + style: form + explode: false + schema: + type: array + items: + type: string + - name: x-org-id + in: header + description: Organization identifier that can be obtained from console settings. + required: false + style: simple + explode: false + schema: + type: string + - name: limit + in: query + required: false + style: form + explode: true + schema: + maximum: 10000 + minimum: 0 + type: integer + default: 10 + responses: + "200": + description: "" + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/system-insights-windows-security-center' + x-content-type: application/json + "400": + description: "" + content: + application/json: + schema: + type: string + x-content-type: application/json + x-scopes: + - systeminsights.readonly + x-codeSamples: + - lang: Shell + source: "curl --request GET \\\n --url 'https://console.jumpcloud.com/api/v2/systeminsights/windows_security_center?skip=0&limit=10'\ + \ \\\n --header 'x-org-id: SOME_STRING_VALUE'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/systeminsights/windows_security_center\"\ + \n\nquerystring = {\"skip\":\"0\",\"limit\":\"10\"}\n\nheaders = {\"x-org-id\"\ + : \"SOME_STRING_VALUE\"}\n\nresponse = requests.request(\"GET\", url, headers=headers,\ + \ params=querystring)\n\nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-org-id\", \"SOME_STRING_VALUE\")\n\ + $response = Invoke-RestMethod -Uri 'https://console.jumpcloud.com/api/v2/systeminsights/windows_security_center?skip=0&limit=10'\ + \ -Method GET -Headers $headers" + /systeminsights/windows_security_products: + get: + tags: + - System Insights + summary: List System Insights Windows Security Products + description: Valid filter fields are `system_id` and `state`. + operationId: systeminsights_list_windows_security_products + parameters: + - name: skip + in: query + description: The offset into the records to return. + required: false + style: form + explode: true + schema: + minimum: 0 + type: integer + default: 0 + - name: sort + in: query + description: "The comma separated fields used to sort the collection.\nDefault\ + \ sort is ascending, prefix with `-` to sort descending. e.g:\nSort by single\ + \ field:\n`sort=field`\nSort descending by single field:\n`sort=-field`\n\ + Sort by multiple fields:\n`sort=field1,-field2,field3`\n" + required: false + style: form + explode: false + schema: + type: array + items: + type: string + - name: filter + in: query + description: "Supported operators are: eq, in. e.g:\nFilter for single value:\n\ + `filter=field:eq:value`\nFilter for any value in a list: (note \"pipe\"\ + \ character: `|` separating values)\n`filter=field:in:value1|value2|value3`\n" + required: false + style: form + explode: false + schema: + type: array + items: + type: string + - name: x-org-id + in: header + description: Organization identifier that can be obtained from console settings. + required: false + style: simple + explode: false + schema: + type: string + - name: limit + in: query + required: false + style: form + explode: true + schema: + maximum: 10000 + minimum: 0 + type: integer + default: 10 + responses: + "200": + description: "" + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/system-insights-windows-security-products' + x-content-type: application/json + security: + - x-api-key: [] + x-scopes: + - systeminsights.readonly + x-codeSamples: + - lang: Shell + source: "curl --request GET \\\n --url 'https://console.jumpcloud.com/api/v2/systeminsights/windows_security_products?skip=0&limit=10'\ + \ \\\n --header 'x-api-key: REPLACE_KEY_VALUE' \\\n --header 'x-org-id:\ + \ SOME_STRING_VALUE'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/systeminsights/windows_security_products\"\ + \n\nquerystring = {\"skip\":\"0\",\"limit\":\"10\"}\n\nheaders = {\n \ + \ \"x-org-id\": \"SOME_STRING_VALUE\",\n \"x-api-key\": \"REPLACE_KEY_VALUE\"\ + \n}\n\nresponse = requests.request(\"GET\", url, headers=headers, params=querystring)\n\ + \nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-org-id\", \"SOME_STRING_VALUE\")\n\ + $headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n$response = Invoke-RestMethod\ + \ -Uri 'https://console.jumpcloud.com/api/v2/systeminsights/windows_security_products?skip=0&limit=10'\ + \ -Method GET -Headers $headers" + /systems/{system_id}/associations: + get: + tags: + - Graph + - Systems + summary: List the associations of a System + description: "This endpoint returns the _direct_ associations of a System.\n\ + \nA direct association can be a non-homogeneous relationship between 2 different\ + \ objects, for example Systems and Users.\n\n\n#### Sample Request\n```\n\ + curl -X GET https://console.jumpcloud.com/api/v2/systems/{System_ID}/associations?targets=user\ + \ \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\ + \ \\\n -H 'x-api-key: {API_KEY}'\n\n```" + operationId: graph_systemAssociationsList + parameters: + - name: system_id + in: path + description: ObjectID of the System. + required: true + style: simple + explode: false + schema: + type: string + - name: targets + in: query + description: Targets which a "system" can be associated to. + required: true + style: form + explode: false + schema: + type: array + items: + type: string + enum: + - command + - policy + - policy_group + - user + - user_group + - name: limit + in: query + description: The number of records to return at once. Limited to 100. + required: false + style: form + explode: true + schema: + type: integer + default: 10 + - name: skip + in: query + description: The offset into the records to return. + required: false + style: form + explode: true + schema: + minimum: 0 + type: integer + default: 0 + - name: Date + in: header + description: Current date header for the System Context API + required: false + style: simple + explode: false + schema: + type: string + - name: Authorization + in: header + description: Authorization header for the System Context API + required: false + style: simple + explode: false + schema: + type: string + - name: x-org-id + in: header + description: Organization identifier that can be obtained from console settings. + required: false + style: simple + explode: false + schema: + type: string + responses: + "200": + description: OK + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/GraphConnection' + x-content-type: application/json + security: + - x-api-key: [] + x-scopes: + - systems + - systems.readonly + - systems.self + x-codeSamples: + - lang: Shell + source: "curl --request GET \\\n --url 'https://console.jumpcloud.com/api/v2/systems/{system_id}/associations?targets=SOME_ARRAY_VALUE&limit=10&skip=0'\ + \ \\\n --header 'Authorization: SOME_STRING_VALUE' \\\n --header 'Date:\ + \ SOME_STRING_VALUE' \\\n --header 'x-api-key: REPLACE_KEY_VALUE' \\\n\ + \ --header 'x-org-id: SOME_STRING_VALUE'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/systems/{system_id}/associations\"\ + \n\nquerystring = {\"targets\":\"SOME_ARRAY_VALUE\",\"limit\":\"10\",\"\ + skip\":\"0\"}\n\nheaders = {\n \"Date\": \"SOME_STRING_VALUE\",\n \ + \ \"Authorization\": \"SOME_STRING_VALUE\",\n \"x-org-id\": \"SOME_STRING_VALUE\"\ + ,\n \"x-api-key\": \"REPLACE_KEY_VALUE\"\n}\n\nresponse = requests.request(\"\ + GET\", url, headers=headers, params=querystring)\n\nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"Date\", \"SOME_STRING_VALUE\")\n$headers.Add(\"\ + Authorization\", \"SOME_STRING_VALUE\")\n$headers.Add(\"x-org-id\", \"SOME_STRING_VALUE\"\ + )\n$headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n$response = Invoke-RestMethod\ + \ -Uri 'https://console.jumpcloud.com/api/v2/systems/{system_id}/associations?targets=SOME_ARRAY_VALUE&limit=10&skip=0'\ + \ -Method GET -Headers $headers" + post: + tags: + - Graph + - Systems + summary: Manage associations of a System + description: "This endpoint allows you to manage the _direct_ associations of\ + \ a System.\n\nA direct association can be a non-homogeneous relationship\ + \ between 2 different objects, for example Systems and Users.\n\n\n#### Sample\ + \ Request\n```\ncurl -X POST https://console.jumpcloud.com/api/v2/systems/{System_ID}/associations\ + \ \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\ + \ \\\n -H 'x-api-key: {API_KEY}' \\\n -d '{\n \"attributes\": {\n \ + \ \"sudo\": {\n \"enabled\": true,\n \"withoutPassword\":\ + \ false\n }\n },\n \"op\": \"add\",\n \"type\": \"user\",\n\ + \ \"id\": \"UserID\"\n }'\n```" + operationId: graph_systemAssociationsPost + parameters: + - name: system_id + in: path + description: ObjectID of the System. + required: true + style: simple + explode: false + schema: + type: string + - name: Date + in: header + description: Current date header for the System Context API + required: false + style: simple + explode: false + schema: + type: string + - name: Authorization + in: header + description: Authorization header for the System Context API + required: false + style: simple + explode: false + schema: + type: string + - name: x-org-id + in: header + description: Organization identifier that can be obtained from console settings. + required: false + style: simple + explode: false + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/GraphOperation-System' + required: false + responses: + "204": + description: OK + content: {} + security: + - x-api-key: [] + x-scopes: + - systems + - systems.self + x-codeSamples: + - lang: Shell + source: "curl --request POST \\\n --url https://console.jumpcloud.com/api/v2/systems/{system_id}/associations\ + \ \\\n --header 'Authorization: SOME_STRING_VALUE' \\\n --header 'Date:\ + \ SOME_STRING_VALUE' \\\n --header 'content-type: application/json' \\\n\ + \ --header 'x-api-key: REPLACE_KEY_VALUE' \\\n --header 'x-org-id: SOME_STRING_VALUE'\ + \ \\\n --data '{\"id\":\"string\",\"op\":\"add\",\"attributes\":{\"sudo\"\ + :{\"enabled\":true,\"withoutPassword\":true}},\"type\":\"command\"}'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/systems/{system_id}/associations\"\ + \n\npayload = {\n \"id\": \"string\",\n \"op\": \"add\",\n \"attributes\"\ + : {\"sudo\": {\n \"enabled\": True,\n \"withoutPassword\"\ + : True\n }},\n \"type\": \"command\"\n}\nheaders = {\n \"Date\"\ + : \"SOME_STRING_VALUE\",\n \"Authorization\": \"SOME_STRING_VALUE\",\n\ + \ \"x-org-id\": \"SOME_STRING_VALUE\",\n \"x-api-key\": \"REPLACE_KEY_VALUE\"\ + ,\n \"content-type\": \"application/json\"\n}\n\nresponse = requests.request(\"\ + POST\", url, json=payload, headers=headers)\n\nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"Date\", \"SOME_STRING_VALUE\")\n$headers.Add(\"\ + Authorization\", \"SOME_STRING_VALUE\")\n$headers.Add(\"x-org-id\", \"SOME_STRING_VALUE\"\ + )\n$headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n$headers.Add(\"content-type\"\ + , \"application/json\")\n$response = Invoke-RestMethod -Uri 'https://console.jumpcloud.com/api/v2/systems/{system_id}/associations'\ + \ -Method POST -Headers $headers -ContentType 'application/json' -Body '{\"\ + id\":\"string\",\"op\":\"add\",\"attributes\":{\"sudo\":{\"enabled\":true,\"\ + withoutPassword\":true}},\"type\":\"command\"}'" + x-codegen-request-body-name: body + /systems/{system_id}/commands: + get: + tags: + - Graph + - Systems + summary: List the Commands bound to a System + description: "This endpoint will return all Commands bound to a System, either\ + \ directly or indirectly, essentially traversing the JumpCloud Graph for your\ + \ Organization.\n\nEach element will contain the type, id, attributes and\ + \ paths.\n\nThe `attributes` object is a key/value hash of compiled graph\ + \ attributes for all paths followed.\n\nThe `paths` array enumerates each\ + \ path from this System to the corresponding Command; this array represents\ + \ all grouping and/or associations that would have to be removed to deprovision\ + \ the Command from this System.\n\nSee `/members` and `/associations` endpoints\ + \ to manage those collections.\n\n#### Sample Request\n```\ncurl -X GET https://console.jumpcloud.com/api/v2/systems/{System_ID}/commands\ + \ \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\ + \ \\\n -H 'x-api-key: {API_KEY}'\n\n```" + operationId: graph_systemTraverseCommand + parameters: + - name: system_id + in: path + description: ObjectID of the System. + required: true + style: simple + explode: false + schema: + type: string + - name: limit + in: query + description: The number of records to return at once. Limited to 100. + required: false + style: form + explode: true + schema: + type: integer + default: 10 + - name: x-org-id + in: header + description: Organization identifier that can be obtained from console settings. + required: false + style: simple + explode: false + schema: + type: string + - name: skip + in: query + description: The offset into the records to return. + required: false + style: form + explode: true + schema: + minimum: 0 + type: integer + default: 0 + - name: filter + in: query + description: "A filter to apply to the query.\n\n**Filter structure**: `::`.\n\ + \n**field** = Populate with a valid field from an endpoint response.\n\n\ + **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between,\ + \ search, in.\n_Note: v1 operators differ from v2 operators._\n\n**value**\ + \ = Populate with the value you want to search for. Is case sensitive. Supports\ + \ wild cards.\n\n**EX:** `GET /api/v2/groups?filter=name:eq:Test+Group`" + required: false + style: form + explode: false + schema: + type: array + items: + type: string + responses: + "200": + description: OK + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/GraphObjectWithPaths' + x-content-type: application/json + security: + - x-api-key: [] + x-scopes: + - commands + x-codeSamples: + - lang: Shell + source: "curl --request GET \\\n --url 'https://console.jumpcloud.com/api/v2/systems/{system_id}/commands?limit=10&skip=0'\ + \ \\\n --header 'x-api-key: REPLACE_KEY_VALUE' \\\n --header 'x-org-id:\ + \ SOME_STRING_VALUE'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/systems/{system_id}/commands\"\ + \n\nquerystring = {\"limit\":\"10\",\"skip\":\"0\"}\n\nheaders = {\n \ + \ \"x-org-id\": \"SOME_STRING_VALUE\",\n \"x-api-key\": \"REPLACE_KEY_VALUE\"\ + \n}\n\nresponse = requests.request(\"GET\", url, headers=headers, params=querystring)\n\ + \nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-org-id\", \"SOME_STRING_VALUE\")\n\ + $headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n$response = Invoke-RestMethod\ + \ -Uri 'https://console.jumpcloud.com/api/v2/systems/{system_id}/commands?limit=10&skip=0'\ + \ -Method GET -Headers $headers" + /systems/{system_id}/fdekey: + get: + tags: + - Systems + - fde + summary: Get System FDE Key + description: This endpoint will return the current (latest) fde key saved for + a system. + operationId: systems_getFDEKey + parameters: + - name: system_id + in: path + required: true + style: simple + explode: false + schema: + type: string + - name: x-org-id + in: header + description: Organization identifier that can be obtained from console settings. + required: false + style: simple + explode: false + schema: + type: string + responses: + "200": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/systemfdekey' + example: + key: cupidatat consequat occaecat proident + "400": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorDetails' + "401": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "403": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "404": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "409": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "500": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + security: + - x-api-key: [] + x-scopes: + - systems + - systems.readonly + x-codeSamples: + - lang: Shell + source: "curl --request GET \\\n --url https://console.jumpcloud.com/api/v2/systems/{system_id}/fdekey\ + \ \\\n --header 'x-api-key: REPLACE_KEY_VALUE' \\\n --header 'x-org-id:\ + \ SOME_STRING_VALUE'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/systems/{system_id}/fdekey\"\ + \n\nheaders = {\n \"x-org-id\": \"SOME_STRING_VALUE\",\n \"x-api-key\"\ + : \"REPLACE_KEY_VALUE\"\n}\n\nresponse = requests.request(\"GET\", url,\ + \ headers=headers)\n\nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-org-id\", \"SOME_STRING_VALUE\")\n\ + $headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n$response = Invoke-RestMethod\ + \ -Uri 'https://console.jumpcloud.com/api/v2/systems/{system_id}/fdekey'\ + \ -Method GET -Headers $headers" + /systems/{system_id}/memberof: + get: + tags: + - Graph + - Systems + summary: List the parent Groups of a System + description: "This endpoint returns all the System Groups a System is a member\ + \ of.\n\n#### Sample Request\n```\ncurl -X GET https://console.jumpcloud.com/api/v2/systems/{System_ID}/memberof\ + \ \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\ + \ \\\n -H 'x-api-key: {API_KEY}'\n\n```" + operationId: graph_systemMemberOf + parameters: + - name: system_id + in: path + description: ObjectID of the System. + required: true + style: simple + explode: false + schema: + type: string + - name: filter + in: query + description: "A filter to apply to the query.\n\n**Filter structure**: `::`.\n\ + \n**field** = Populate with a valid field from an endpoint response.\n\n\ + **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between,\ + \ search, in.\n_Note: v1 operators differ from v2 operators._\n\n**value**\ + \ = Populate with the value you want to search for. Is case sensitive. Supports\ + \ wild cards.\n\n**EX:** `GET /api/v2/groups?filter=name:eq:Test+Group`" + required: false + style: form + explode: false + schema: + type: array + items: + type: string + - name: limit + in: query + description: The number of records to return at once. Limited to 100. + required: false + style: form + explode: true + schema: + type: integer + default: 10 + - name: skip + in: query + description: The offset into the records to return. + required: false + style: form + explode: true + schema: + minimum: 0 + type: integer + default: 0 + - name: Date + in: header + description: Current date header for the System Context API + required: false + style: simple + explode: false + schema: + type: string + - name: Authorization + in: header + description: Authorization header for the System Context API + required: false + style: simple + explode: false + schema: + type: string + - name: sort + in: query + description: "The comma separated fields used to sort the collection.\nDefault\ + \ sort is ascending, prefix with `-` to sort descending.\n" + required: false + style: form + explode: false + schema: + type: array + items: + type: string + - name: x-org-id + in: header + description: Organization identifier that can be obtained from console settings. + required: false + style: simple + explode: false + schema: + type: string + responses: + "200": + description: OK + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/GraphObjectWithPaths' + x-content-type: application/json + security: + - x-api-key: [] + x-scopes: + - groups + - groups.readonly + - groups.self + x-codeSamples: + - lang: Shell + source: "curl --request GET \\\n --url 'https://console.jumpcloud.com/api/v2/systems/{system_id}/memberof?limit=10&skip=0'\ + \ \\\n --header 'Authorization: SOME_STRING_VALUE' \\\n --header 'Date:\ + \ SOME_STRING_VALUE' \\\n --header 'x-api-key: REPLACE_KEY_VALUE' \\\n\ + \ --header 'x-org-id: SOME_STRING_VALUE'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/systems/{system_id}/memberof\"\ + \n\nquerystring = {\"limit\":\"10\",\"skip\":\"0\"}\n\nheaders = {\n \ + \ \"Date\": \"SOME_STRING_VALUE\",\n \"Authorization\": \"SOME_STRING_VALUE\"\ + ,\n \"x-org-id\": \"SOME_STRING_VALUE\",\n \"x-api-key\": \"REPLACE_KEY_VALUE\"\ + \n}\n\nresponse = requests.request(\"GET\", url, headers=headers, params=querystring)\n\ + \nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"Date\", \"SOME_STRING_VALUE\")\n$headers.Add(\"\ + Authorization\", \"SOME_STRING_VALUE\")\n$headers.Add(\"x-org-id\", \"SOME_STRING_VALUE\"\ + )\n$headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n$response = Invoke-RestMethod\ + \ -Uri 'https://console.jumpcloud.com/api/v2/systems/{system_id}/memberof?limit=10&skip=0'\ + \ -Method GET -Headers $headers" + /systems/{system_id}/policies: + get: + tags: + - Graph + - Systems + summary: List the Policies bound to a System + description: "This endpoint will return all Policies bound to a System, either\ + \ directly or indirectly, essentially traversing the JumpCloud Graph for your\ + \ Organization.\n\nEach element will contain the type, id, attributes and\ + \ paths.\n\nThe `attributes` object is a key/value hash of compiled graph\ + \ attributes for all paths followed.\n\nThe `paths` array enumerates each\ + \ path from this System to the corresponding Policy; this array represents\ + \ all grouping and/or associations that would have to be removed to deprovision\ + \ the Policy from this System.\n\nSee `/members` and `/associations` endpoints\ + \ to manage those collections.\n\nThis endpoint is not yet public as we have\ + \ finish the code.\n\n##### Sample Request\n\n```\ncurl -X GET https://console.jumpcloud.com/api/v2/{System_ID}/policies\ + \ \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\ + \ \\\n -H 'x-api-key: {API_KEY}'\n\n```" + operationId: graph_systemTraversePolicy + parameters: + - name: system_id + in: path + description: ObjectID of the System. + required: true + style: simple + explode: false + schema: + type: string + - name: limit + in: query + description: The number of records to return at once. Limited to 100. + required: false + style: form + explode: true + schema: + type: integer + default: 10 + - name: x-org-id + in: header + description: Organization identifier that can be obtained from console settings. + required: false + style: simple + explode: false + schema: + type: string + - name: skip + in: query + description: The offset into the records to return. + required: false + style: form + explode: true + schema: + minimum: 0 + type: integer + default: 0 + - name: filter + in: query + description: "A filter to apply to the query.\n\n**Filter structure**: `::`.\n\ + \n**field** = Populate with a valid field from an endpoint response.\n\n\ + **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between,\ + \ search, in.\n_Note: v1 operators differ from v2 operators._\n\n**value**\ + \ = Populate with the value you want to search for. Is case sensitive. Supports\ + \ wild cards.\n\n**EX:** `GET /api/v2/groups?filter=name:eq:Test+Group`" + required: false + style: form + explode: false + schema: + type: array + items: + type: string + responses: + "200": + description: OK + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/GraphObjectWithPaths' + x-content-type: application/json + security: + - x-api-key: [] + x-scopes: + - systems + - systems.readonly + x-codeSamples: + - lang: Shell + source: "curl --request GET \\\n --url 'https://console.jumpcloud.com/api/v2/systems/{system_id}/policies?limit=10&skip=0'\ + \ \\\n --header 'x-api-key: REPLACE_KEY_VALUE' \\\n --header 'x-org-id:\ + \ SOME_STRING_VALUE'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/systems/{system_id}/policies\"\ + \n\nquerystring = {\"limit\":\"10\",\"skip\":\"0\"}\n\nheaders = {\n \ + \ \"x-org-id\": \"SOME_STRING_VALUE\",\n \"x-api-key\": \"REPLACE_KEY_VALUE\"\ + \n}\n\nresponse = requests.request(\"GET\", url, headers=headers, params=querystring)\n\ + \nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-org-id\", \"SOME_STRING_VALUE\")\n\ + $headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n$response = Invoke-RestMethod\ + \ -Uri 'https://console.jumpcloud.com/api/v2/systems/{system_id}/policies?limit=10&skip=0'\ + \ -Method GET -Headers $headers" + /systems/{system_id}/policygroups: + get: + tags: + - Graph + - Systems + summary: List the Policy Groups bound to a System + description: "This endpoint will return all Policy Groups bound to a System,\ + \ either directly or indirectly essentially traversing the JumpCloud Graph\ + \ for your Organization.\n\nEach element will contain the type, id, attributes\ + \ and paths.\n\nThe `attributes` object is a key/value hash of compiled graph\ + \ attributes for all paths followed.\n\nThe `paths` array enumerates each\ + \ path from this System to the corresponding Policy Group; this array represents\ + \ all grouping and/or associations that would have to be removed to deprovision\ + \ the Policy Group from this System.\n\nSee `/members` and `/associations`\ + \ endpoints to manage those collections.\n\n#### Sample Request\n```\ncurl\ + \ -X GET https://console.jumpcloud.com/api/v2/systems/{System_ID}/policygroups\ + \ \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\ + \ \\\n -H 'x-api-key: {API_KEY}'\n\n```" + operationId: graph_systemTraversePolicyGroup + parameters: + - name: system_id + in: path + description: ObjectID of the System. + required: true + style: simple + explode: false + schema: + type: string + - name: limit + in: query + description: The number of records to return at once. Limited to 100. + required: false + style: form + explode: true + schema: + type: integer + default: 10 + - name: x-org-id + in: header + description: Organization identifier that can be obtained from console settings. + required: false + style: simple + explode: false + schema: + type: string + - name: skip + in: query + description: The offset into the records to return. + required: false + style: form + explode: true + schema: + minimum: 0 + type: integer + default: 0 + - name: Date + in: header + description: Current date header for the System Context API + required: false + style: simple + explode: false + schema: + type: string + - name: Authorization + in: header + description: Authorization header for the System Context API + required: false + style: simple + explode: false + schema: + type: string + - name: filter + in: query + description: "A filter to apply to the query.\n\n**Filter structure**: `::`.\n\ + \n**field** = Populate with a valid field from an endpoint response.\n\n\ + **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between,\ + \ search, in.\n_Note: v1 operators differ from v2 operators._\n\n**value**\ + \ = Populate with the value you want to search for. Is case sensitive. Supports\ + \ wild cards.\n\n**EX:** `GET /api/v2/groups?filter=name:eq:Test+Group`" + required: false + style: form + explode: false + schema: + type: array + items: + type: string + responses: + "200": + description: OK + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/GraphObjectWithPaths' + x-content-type: application/json + security: + - x-api-key: [] + x-scopes: + - groups + - groups.readonly + x-codeSamples: + - lang: Shell + source: "curl --request GET \\\n --url 'https://console.jumpcloud.com/api/v2/systems/{system_id}/policygroups?limit=10&skip=0'\ + \ \\\n --header 'Authorization: SOME_STRING_VALUE' \\\n --header 'Date:\ + \ SOME_STRING_VALUE' \\\n --header 'x-api-key: REPLACE_KEY_VALUE' \\\n\ + \ --header 'x-org-id: SOME_STRING_VALUE'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/systems/{system_id}/policygroups\"\ + \n\nquerystring = {\"limit\":\"10\",\"skip\":\"0\"}\n\nheaders = {\n \ + \ \"x-org-id\": \"SOME_STRING_VALUE\",\n \"Date\": \"SOME_STRING_VALUE\"\ + ,\n \"Authorization\": \"SOME_STRING_VALUE\",\n \"x-api-key\": \"\ + REPLACE_KEY_VALUE\"\n}\n\nresponse = requests.request(\"GET\", url, headers=headers,\ + \ params=querystring)\n\nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-org-id\", \"SOME_STRING_VALUE\")\n\ + $headers.Add(\"Date\", \"SOME_STRING_VALUE\")\n$headers.Add(\"Authorization\"\ + , \"SOME_STRING_VALUE\")\n$headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\"\ + )\n$response = Invoke-RestMethod -Uri 'https://console.jumpcloud.com/api/v2/systems/{system_id}/policygroups?limit=10&skip=0'\ + \ -Method GET -Headers $headers" + /systems/{system_id}/policystatuses: + get: + tags: + - Graph + - Policies + summary: List the policy statuses for a system + description: "This endpoint returns the policy results for a particular system.\n\ + \n##### Sample Request\n\n```\ncurl -X GET https://console.jumpcloud.com/api/v2/systems/{System_ID}/policystatuses\ + \ \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\ + \ \\\n -H 'x-api-key: {API_KEY}'\n\n```" + operationId: policystatuses_systemsList + parameters: + - name: system_id + in: path + description: ObjectID of the System. + required: true + style: simple + explode: false + schema: + type: string + - name: fields + in: query + description: "The comma separated fields included in the returned records.\n\ + If omitted, the default list of fields will be returned.\n" + required: false + style: form + explode: false + schema: + type: array + items: + type: string + - name: filter + in: query + description: "A filter to apply to the query.\n\n**Filter structure**: `::`.\n\ + \n**field** = Populate with a valid field from an endpoint response.\n\n\ + **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between,\ + \ search, in.\n_Note: v1 operators differ from v2 operators._\n\n**value**\ + \ = Populate with the value you want to search for. Is case sensitive. Supports\ + \ wild cards.\n\n**EX:** `GET /api/v2/groups?filter=name:eq:Test+Group`" + required: false + style: form + explode: false + schema: + type: array + items: + type: string + - name: limit + in: query + description: The number of records to return at once. Limited to 100. + required: false + style: form + explode: true + schema: + type: integer + default: 10 + - name: skip + in: query + description: The offset into the records to return. + required: false + style: form + explode: true + schema: + minimum: 0 + type: integer + default: 0 + - name: sort + in: query + description: "The comma separated fields used to sort the collection.\nDefault\ + \ sort is ascending, prefix with `-` to sort descending.\n" + required: false + style: form + explode: false + schema: + type: array + items: + type: string + - name: x-org-id + in: header + description: Organization identifier that can be obtained from console settings. + required: false + style: simple + explode: false + schema: + type: string + responses: + "200": + description: OK + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/PolicyResult' + x-content-type: application/json + security: + - x-api-key: [] + x-scopes: + - systems + - systems.readonly + x-codeSamples: + - lang: Shell + source: "curl --request GET \\\n --url 'https://console.jumpcloud.com/api/v2/systems/{system_id}/policystatuses?limit=10&skip=0'\ + \ \\\n --header 'x-api-key: REPLACE_KEY_VALUE' \\\n --header 'x-org-id:\ + \ SOME_STRING_VALUE'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/systems/{system_id}/policystatuses\"\ + \n\nquerystring = {\"limit\":\"10\",\"skip\":\"0\"}\n\nheaders = {\n \ + \ \"x-org-id\": \"SOME_STRING_VALUE\",\n \"x-api-key\": \"REPLACE_KEY_VALUE\"\ + \n}\n\nresponse = requests.request(\"GET\", url, headers=headers, params=querystring)\n\ + \nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-org-id\", \"SOME_STRING_VALUE\")\n\ + $headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n$response = Invoke-RestMethod\ + \ -Uri 'https://console.jumpcloud.com/api/v2/systems/{system_id}/policystatuses?limit=10&skip=0'\ + \ -Method GET -Headers $headers" + /systems/{system_id}/softwareappstatuses: + get: + tags: + - Systems + summary: List the associated Software Application Statuses of a System + description: "This endpoint returns all the statuses of the associated Software\ + \ Applications from the provided JumpCloud system ID.\n\n#### Sample Request\n\ + ```\ncurl -X GET https://console.jumpcloud.com/api/v2/systems/{system_id}/softwareappstatuses\ + \ \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\ + \ \\\n -H 'x-api-key: {API_KEY}'\n\n```" + operationId: systems_ListSoftwareAppsWithStatuses + parameters: + - name: system_id + in: path + description: ObjectID of the System. + required: true + style: simple + explode: false + schema: + type: string + - name: x-org-id + in: header + description: Organization identifier that can be obtained from console settings. + required: false + style: simple + explode: false + schema: + type: string + - name: filter + in: query + description: "A filter to apply to the query.\n\n**Filter structure**: `::`.\n\ + \n**field** = Populate with a valid field from an endpoint response.\n\n\ + **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between,\ + \ search, in.\n_Note: v1 operators differ from v2 operators._\n\n**value**\ + \ = Populate with the value you want to search for. Is case sensitive. Supports\ + \ wild cards.\n\n**EX:** `GET /api/v2/groups?filter=name:eq:Test+Group`" + required: false + style: form + explode: false + schema: + type: array + items: + type: string + - name: limit + in: query + description: The number of records to return at once. Limited to 100. + required: false + style: form + explode: true + schema: + type: integer + default: 10 + - name: skip + in: query + description: The offset into the records to return. + required: false + style: form + explode: true + schema: + minimum: 0 + type: integer + default: 0 + - name: sort + in: query + description: "The comma separated fields used to sort the collection.\nDefault\ + \ sort is ascending, prefix with `-` to sort descending.\n" + required: false + style: form + explode: false + schema: + type: array + items: + type: string + responses: + "200": + description: OK + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/software-app-with-status' + x-content-type: application/json + security: + - x-api-key: [] + x-scopes: + - systems + - systems.readonly + x-codeSamples: + - lang: Shell + source: "curl --request GET \\\n --url 'https://console.jumpcloud.com/api/v2/systems/{system_id}/softwareappstatuses?limit=10&skip=0'\ + \ \\\n --header 'x-api-key: REPLACE_KEY_VALUE' \\\n --header 'x-org-id:\ + \ SOME_STRING_VALUE'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/systems/{system_id}/softwareappstatuses\"\ + \n\nquerystring = {\"limit\":\"10\",\"skip\":\"0\"}\n\nheaders = {\n \ + \ \"x-org-id\": \"SOME_STRING_VALUE\",\n \"x-api-key\": \"REPLACE_KEY_VALUE\"\ + \n}\n\nresponse = requests.request(\"GET\", url, headers=headers, params=querystring)\n\ + \nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-org-id\", \"SOME_STRING_VALUE\")\n\ + $headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n$response = Invoke-RestMethod\ + \ -Uri 'https://console.jumpcloud.com/api/v2/systems/{system_id}/softwareappstatuses?limit=10&skip=0'\ + \ -Method GET -Headers $headers" + /systems/{system_id}/usergroups: + get: + tags: + - Graph + - Systems + summary: List the User Groups bound to a System + description: "This endpoint will return all User Groups bound to a System, either\ + \ directly or indirectly essentially traversing the JumpCloud Graph for your\ + \ Organization.\n\nEach element will contain the type, id, attributes and\ + \ paths.\n\nThe `attributes` object is a key/value hash of compiled graph\ + \ attributes for all paths followed.\n\nThe `paths` array enumerates each\ + \ path from this System to the corresponding User Group; this array represents\ + \ all grouping and/or associations that would have to be removed to deprovision\ + \ the User Group from this System.\n\nSee `/members` and `/associations` endpoints\ + \ to manage those collections.\n\n#### Sample Request\n```\ncurl -X GET https://console.jumpcloud.com/api/v2/systems/{System_ID}/usergroups\ + \ \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\ + \ \\\n -H 'x-api-key: {API_KEY}'\n\n```" + operationId: graph_systemTraverseUserGroup + parameters: + - name: system_id + in: path + description: ObjectID of the System. + required: true + style: simple + explode: false + schema: + type: string + - name: limit + in: query + description: The number of records to return at once. Limited to 100. + required: false + style: form + explode: true + schema: + type: integer + default: 10 + - name: x-org-id + in: header + description: Organization identifier that can be obtained from console settings. + required: false + style: simple + explode: false + schema: + type: string + - name: skip + in: query + description: The offset into the records to return. + required: false + style: form + explode: true + schema: + minimum: 0 + type: integer + default: 0 + - name: Date + in: header + description: Current date header for the System Context API + required: false + style: simple + explode: false + schema: + type: string + - name: Authorization + in: header + description: Authorization header for the System Context API + required: false + style: simple + explode: false + schema: + type: string + - name: filter + in: query + description: "A filter to apply to the query.\n\n**Filter structure**: `::`.\n\ + \n**field** = Populate with a valid field from an endpoint response.\n\n\ + **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between,\ + \ search, in.\n_Note: v1 operators differ from v2 operators._\n\n**value**\ + \ = Populate with the value you want to search for. Is case sensitive. Supports\ + \ wild cards.\n\n**EX:** `GET /api/v2/groups?filter=name:eq:Test+Group`" + required: false + style: form + explode: false + schema: + type: array + items: + type: string + responses: + "200": + description: OK + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/GraphObjectWithPaths' + x-content-type: application/json + security: + - x-api-key: [] + x-scopes: + - groups + - groups.readonly + x-codeSamples: + - lang: Shell + source: "curl --request GET \\\n --url 'https://console.jumpcloud.com/api/v2/systems/{system_id}/usergroups?limit=10&skip=0'\ + \ \\\n --header 'Authorization: SOME_STRING_VALUE' \\\n --header 'Date:\ + \ SOME_STRING_VALUE' \\\n --header 'x-api-key: REPLACE_KEY_VALUE' \\\n\ + \ --header 'x-org-id: SOME_STRING_VALUE'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/systems/{system_id}/usergroups\"\ + \n\nquerystring = {\"limit\":\"10\",\"skip\":\"0\"}\n\nheaders = {\n \ + \ \"x-org-id\": \"SOME_STRING_VALUE\",\n \"Date\": \"SOME_STRING_VALUE\"\ + ,\n \"Authorization\": \"SOME_STRING_VALUE\",\n \"x-api-key\": \"\ + REPLACE_KEY_VALUE\"\n}\n\nresponse = requests.request(\"GET\", url, headers=headers,\ + \ params=querystring)\n\nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-org-id\", \"SOME_STRING_VALUE\")\n\ + $headers.Add(\"Date\", \"SOME_STRING_VALUE\")\n$headers.Add(\"Authorization\"\ + , \"SOME_STRING_VALUE\")\n$headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\"\ + )\n$response = Invoke-RestMethod -Uri 'https://console.jumpcloud.com/api/v2/systems/{system_id}/usergroups?limit=10&skip=0'\ + \ -Method GET -Headers $headers" + /systems/{system_id}/users: + get: + tags: + - Graph + - Systems + summary: List the Users bound to a System + description: "This endpoint will return all Users bound to a System, either\ + \ directly or indirectly essentially traversing the JumpCloud Graph for your\ + \ Organization.\n\nEach element will contain the type, id, attributes and\ + \ paths.\n\nThe `attributes` object is a key/value hash of compiled graph\ + \ attributes for all paths followed.\n\nThe `paths` array enumerates each\ + \ path from this System to the corresponding User; this array represents all\ + \ grouping and/or associations that would have to be removed to deprovision\ + \ the User from this System.\n\nSee `/members` and `/associations` endpoints\ + \ to manage those collections.\n\n#### Sample Request\n```\ncurl -X GET https://console.jumpcloud.com/api/v2/systems/{System_ID}/users\ + \ \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\ + \ \\\n -H 'x-api-key: {API_KEY}'\n\n```" + operationId: graph_systemTraverseUser + parameters: + - name: system_id + in: path + description: ObjectID of the System. + required: true + style: simple + explode: false + schema: + type: string + - name: limit + in: query + description: The number of records to return at once. Limited to 100. + required: false + style: form + explode: true + schema: + type: integer + default: 10 + - name: x-org-id + in: header + description: Organization identifier that can be obtained from console settings. + required: false + style: simple + explode: false + schema: + type: string + - name: skip + in: query + description: The offset into the records to return. + required: false + style: form + explode: true + schema: + minimum: 0 + type: integer + default: 0 + - name: Date + in: header + description: Current date header for the System Context API + required: false + style: simple + explode: false + schema: + type: string + - name: Authorization + in: header + description: Authorization header for the System Context API + required: false + style: simple + explode: false + schema: + type: string + - name: filter + in: query + description: "A filter to apply to the query.\n\n**Filter structure**: `::`.\n\ + \n**field** = Populate with a valid field from an endpoint response.\n\n\ + **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between,\ + \ search, in.\n_Note: v1 operators differ from v2 operators._\n\n**value**\ + \ = Populate with the value you want to search for. Is case sensitive. Supports\ + \ wild cards.\n\n**EX:** `GET /api/v2/groups?filter=name:eq:Test+Group`" + required: false + style: form + explode: false + schema: + type: array + items: + type: string + responses: + "200": + description: OK + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/GraphObjectWithPaths' + x-content-type: application/json + security: + - x-api-key: [] + x-scopes: + - users + - users.readonly + - users.self + x-codeSamples: + - lang: Shell + source: "curl --request GET \\\n --url 'https://console.jumpcloud.com/api/v2/systems/{system_id}/users?limit=10&skip=0'\ + \ \\\n --header 'Authorization: SOME_STRING_VALUE' \\\n --header 'Date:\ + \ SOME_STRING_VALUE' \\\n --header 'x-api-key: REPLACE_KEY_VALUE' \\\n\ + \ --header 'x-org-id: SOME_STRING_VALUE'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/systems/{system_id}/users\"\ + \n\nquerystring = {\"limit\":\"10\",\"skip\":\"0\"}\n\nheaders = {\n \ + \ \"x-org-id\": \"SOME_STRING_VALUE\",\n \"Date\": \"SOME_STRING_VALUE\"\ + ,\n \"Authorization\": \"SOME_STRING_VALUE\",\n \"x-api-key\": \"\ + REPLACE_KEY_VALUE\"\n}\n\nresponse = requests.request(\"GET\", url, headers=headers,\ + \ params=querystring)\n\nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-org-id\", \"SOME_STRING_VALUE\")\n\ + $headers.Add(\"Date\", \"SOME_STRING_VALUE\")\n$headers.Add(\"Authorization\"\ + , \"SOME_STRING_VALUE\")\n$headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\"\ + )\n$response = Invoke-RestMethod -Uri 'https://console.jumpcloud.com/api/v2/systems/{system_id}/users?limit=10&skip=0'\ + \ -Method GET -Headers $headers" + /usergroups: + get: + tags: + - User Groups + summary: List all User Groups + description: "This endpoint returns all User Groups.\n\nAvailable filter fields:\n\ + \ - `name`\n - `disabled`\n - `type`\n - `suggestionCounts.add`\n - `suggestionCounts.remove`\n\ + \ - `suggestionCounts.total`\n - `attributes.sudo.enabled`\n - `attributes.sudo.withoutPassword`\n\ + \n#### Sample Request\n```\ncurl -X GET https://console.jumpcloud.com/api/v2/usergroups\ + \ \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\ + \ \\\n -H 'x-api-key: {API_KEY}'\n```" + operationId: groups_user_list + parameters: + - name: fields + in: query + description: "The comma separated fields included in the returned records.\n\ + If omitted, the default list of fields will be returned.\n" + required: false + style: form + explode: false + schema: + type: array + items: + type: string + - name: filter + in: query + description: "A filter to apply to the query.\n\n**Filter structure**: `::`.\n\ + \n**field** = Populate with a valid field from an endpoint response.\n\n\ + **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between,\ + \ search, in.\n_Note: v1 operators differ from v2 operators._\n\n**value**\ + \ = Populate with the value you want to search for. Is case sensitive. Supports\ + \ wild cards.\n\n**EX:** `GET /api/v2/groups?filter=name:eq:Test+Group`" + required: false + style: form + explode: false + schema: + type: array + items: + type: string + - name: limit + in: query + description: The number of records to return at once. Limited to 100. + required: false + style: form + explode: true + schema: + type: integer + default: 10 + - name: skip + in: query + description: The offset into the records to return. + required: false + style: form + explode: true + schema: + minimum: 0 + type: integer + default: 0 + - name: sort + in: query + description: "The comma separated fields used to sort the collection.\nDefault\ + \ sort is ascending, prefix with `-` to sort descending.\n" + required: false + style: form + explode: false + schema: + type: array + items: + type: string + - name: x-org-id + in: header + description: Organization identifier that can be obtained from console settings. + required: false + style: simple + explode: false + schema: + type: string + responses: + "200": + description: OK + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/UserGroup' + x-content-type: application/json + default: + description: Unexpected error + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + security: + - x-api-key: [] + x-scopes: + - groups + - groups.readonly + x-codeSamples: + - lang: Shell + source: "curl --request GET \\\n --url 'https://console.jumpcloud.com/api/v2/usergroups?limit=10&skip=0'\ + \ \\\n --header 'x-api-key: REPLACE_KEY_VALUE' \\\n --header 'x-org-id:\ + \ SOME_STRING_VALUE'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/usergroups\"\ + \n\nquerystring = {\"limit\":\"10\",\"skip\":\"0\"}\n\nheaders = {\n \ + \ \"x-org-id\": \"SOME_STRING_VALUE\",\n \"x-api-key\": \"REPLACE_KEY_VALUE\"\ + \n}\n\nresponse = requests.request(\"GET\", url, headers=headers, params=querystring)\n\ + \nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-org-id\", \"SOME_STRING_VALUE\")\n\ + $headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n$response = Invoke-RestMethod\ + \ -Uri 'https://console.jumpcloud.com/api/v2/usergroups?limit=10&skip=0'\ + \ -Method GET -Headers $headers" + post: + tags: + - User Groups + summary: Create a new User Group + description: "This endpoint allows you to create a new User Group.\n\n#### Sample\ + \ Request\n```\ncurl -X POST https://console.jumpcloud.com/api/v2/usergroups\ + \ \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\ + \ \\\n -H 'x-api-key: {API_KEY}' \\\n -d '{\n \"name\": \"{Group_Name}\"\ + \n }'\n```" + operationId: groups_user_post + parameters: + - name: x-org-id + in: header + description: Organization identifier that can be obtained from console settings. + required: false + style: simple + explode: false + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/UserGroupPost' + required: false + responses: + "201": + description: Created + content: + application/json: + schema: + $ref: '#/components/schemas/UserGroup' + security: + - x-api-key: [] + x-scopes: + - groups + x-codeSamples: + - lang: Shell + source: "curl --request POST \\\n --url https://console.jumpcloud.com/api/v2/usergroups\ + \ \\\n --header 'content-type: application/json' \\\n --header 'x-api-key:\ + \ REPLACE_KEY_VALUE' \\\n --header 'x-org-id: SOME_STRING_VALUE' \\\n \ + \ --data '{\"attributes\":{\"sudo\":{\"enabled\":true,\"withoutPassword\"\ + :true},\"ldapGroups\":[{\"name\":\"string\"}],\"posixGroups\":[{\"id\":0,\"\ + name\":\"string\"}],\"radius\":{\"reply\":[{\"name\":\"string\",\"value\"\ + :\"string\"}]},\"sambaEnabled\":true},\"description\":\"string\",\"email\"\ + :\"string\",\"memberQuery\":{\"queryType\":\"FilterQuery\",\"filters\":[{\"\ + field\":\"string\",\"operator\":\"eq\",\"value\":\"string\"}]},\"memberQueryExemptions\"\ + :[{\"attributes\":{},\"id\":\"string\",\"type\":\"string\"}],\"memberSuggestionsNotify\"\ + :true,\"membershipAutomated\":true,\"name\":\"string\"}'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/usergroups\"\ + \n\npayload = {\n \"attributes\": {\n \"sudo\": {\n \ + \ \"enabled\": True,\n \"withoutPassword\": True\n },\n\ + \ \"ldapGroups\": [{\"name\": \"string\"}],\n \"posixGroups\"\ + : [\n {\n \"id\": 0,\n \"name\"\ + : \"string\"\n }\n ],\n \"radius\": {\"reply\"\ + : [\n {\n \"name\": \"string\",\n \ + \ \"value\": \"string\"\n }\n ]},\n\ + \ \"sambaEnabled\": True\n },\n \"description\": \"string\"\ + ,\n \"email\": \"string\",\n \"memberQuery\": {\n \"queryType\"\ + : \"FilterQuery\",\n \"filters\": [\n {\n \ + \ \"field\": \"string\",\n \"operator\": \"eq\",\n \ + \ \"value\": \"string\"\n }\n ]\n },\n\ + \ \"memberQueryExemptions\": [\n {\n \"attributes\"\ + : {},\n \"id\": \"string\",\n \"type\": \"string\"\ + \n }\n ],\n \"memberSuggestionsNotify\": True,\n \"membershipAutomated\"\ + : True,\n \"name\": \"string\"\n}\nheaders = {\n \"x-org-id\": \"\ + SOME_STRING_VALUE\",\n \"x-api-key\": \"REPLACE_KEY_VALUE\",\n \"\ + content-type\": \"application/json\"\n}\n\nresponse = requests.request(\"\ + POST\", url, json=payload, headers=headers)\n\nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-org-id\", \"SOME_STRING_VALUE\")\n\ + $headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n$headers.Add(\"content-type\"\ + , \"application/json\")\n$response = Invoke-RestMethod -Uri 'https://console.jumpcloud.com/api/v2/usergroups'\ + \ -Method POST -Headers $headers -ContentType 'application/json' -Body '{\"\ + attributes\":{\"sudo\":{\"enabled\":true,\"withoutPassword\":true},\"ldapGroups\"\ + :[{\"name\":\"string\"}],\"posixGroups\":[{\"id\":0,\"name\":\"string\"\ + }],\"radius\":{\"reply\":[{\"name\":\"string\",\"value\":\"string\"}]},\"\ + sambaEnabled\":true},\"description\":\"string\",\"email\":\"string\",\"\ + memberQuery\":{\"queryType\":\"FilterQuery\",\"filters\":[{\"field\":\"\ + string\",\"operator\":\"eq\",\"value\":\"string\"}]},\"memberQueryExemptions\"\ + :[{\"attributes\":{},\"id\":\"string\",\"type\":\"string\"}],\"memberSuggestionsNotify\"\ + :true,\"membershipAutomated\":true,\"name\":\"string\"}'" + x-codegen-request-body-name: body + /usergroups/{group_id}/activedirectories: + get: + tags: + - Graph + - User Group Associations + - User Groups + summary: List the Active Directories bound to a User Group + description: "This endpoint will return all Active Directory Instances bound\ + \ to a User Group, either directly or indirectly, essentially traversing the\ + \ JumpCloud Graph for your Organization.\n\nThe `attributes` object is a key/value\ + \ hash of compiled graph attributes for all paths followed.\n\nThe `paths`\ + \ array enumerates each path from this User Group to the corresponding Active\ + \ Directory; this array represents all grouping and/or associations that would\ + \ have to be removed to deprovision the Active Directory from this User Group.\n\ + \nSee `/members` and `/associations` endpoints to manage those collections.\n\ + \n#### Sample Request\n```\ncurl -X GET https://console.jumpcloud.com/api/v2/usergroups/{GroupID}/activedirectories\ + \ \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\ + \ \\\n -H 'x-api-key: {API_KEY}'\n```" + operationId: graph_userGroupTraverseActiveDirectory + parameters: + - name: group_id + in: path + description: ObjectID of the User Group. + required: true + style: simple + explode: false + schema: + type: string + - name: limit + in: query + description: The number of records to return at once. Limited to 100. + required: false + style: form + explode: true + schema: + type: integer + default: 10 + - name: x-org-id + in: header + description: Organization identifier that can be obtained from console settings. + required: false + style: simple + explode: false + schema: + type: string + - name: skip + in: query + description: The offset into the records to return. + required: false + style: form + explode: true + schema: + minimum: 0 + type: integer + default: 0 + - name: filter + in: query + description: "A filter to apply to the query.\n\n**Filter structure**: `::`.\n\ + \n**field** = Populate with a valid field from an endpoint response.\n\n\ + **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between,\ + \ search, in.\n_Note: v1 operators differ from v2 operators._\n\n**value**\ + \ = Populate with the value you want to search for. Is case sensitive. Supports\ + \ wild cards.\n\n**EX:** `GET /api/v2/groups?filter=name:eq:Test+Group`" + required: false + style: form + explode: false + schema: + type: array + items: + type: string + responses: + "200": + description: "" + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/GraphObjectWithPaths' + x-content-type: application/json + security: + - x-api-key: [] + x-scopes: + - directories + - directories.readonly + x-codeSamples: + - lang: Shell + source: "curl --request GET \\\n --url 'https://console.jumpcloud.com/api/v2/usergroups/{group_id}/activedirectories?limit=10&skip=0'\ + \ \\\n --header 'x-api-key: REPLACE_KEY_VALUE' \\\n --header 'x-org-id:\ + \ SOME_STRING_VALUE'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/usergroups/{group_id}/activedirectories\"\ + \n\nquerystring = {\"limit\":\"10\",\"skip\":\"0\"}\n\nheaders = {\n \ + \ \"x-org-id\": \"SOME_STRING_VALUE\",\n \"x-api-key\": \"REPLACE_KEY_VALUE\"\ + \n}\n\nresponse = requests.request(\"GET\", url, headers=headers, params=querystring)\n\ + \nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-org-id\", \"SOME_STRING_VALUE\")\n\ + $headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n$response = Invoke-RestMethod\ + \ -Uri 'https://console.jumpcloud.com/api/v2/usergroups/{group_id}/activedirectories?limit=10&skip=0'\ + \ -Method GET -Headers $headers" + /usergroups/{group_id}/applications: + get: + tags: + - Graph + - User Group Associations + - User Groups + summary: List the Applications bound to a User Group + description: "This endpoint will return all Applications bound to a User Group,\ + \ either directly or indirectly, essentially traversing the JumpCloud Graph\ + \ for your Organization.\n\nEach element will contain the type, id, attributes\ + \ and paths\n\nThe `attributes` object is a key/value hash of compiled graph\ + \ attributes for all paths followed.\n\nThe `paths` array enumerates each\ + \ path from this User Group to the corresponding Application; this array represents\ + \ all grouping and/or associations that would have to be removed to deprovision\ + \ the Application from this User Group.\n\nSee `/members` and `/associations`\ + \ endpoints to manage those collections.\n\n#### Sample Request\n```\ncurl\ + \ -X GET https://console.jumpcloud.com/api/v2/usergroups/{GroupID}/applications\ + \ \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\ + \ \\\n -H 'x-api-key: {API_KEY}'\n```" + operationId: graph_userGroupTraverseApplication + parameters: + - name: group_id + in: path + description: ObjectID of the User Group. + required: true + style: simple + explode: false + schema: + type: string + - name: limit + in: query + description: The number of records to return at once. Limited to 100. + required: false + style: form + explode: true + schema: + type: integer + default: 10 + - name: x-org-id + in: header + description: Organization identifier that can be obtained from console settings. + required: false + style: simple + explode: false + schema: + type: string + - name: skip + in: query + description: The offset into the records to return. + required: false + style: form + explode: true + schema: + minimum: 0 + type: integer + default: 0 + - name: filter + in: query + description: "A filter to apply to the query.\n\n**Filter structure**: `::`.\n\ + \n**field** = Populate with a valid field from an endpoint response.\n\n\ + **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between,\ + \ search, in.\n_Note: v1 operators differ from v2 operators._\n\n**value**\ + \ = Populate with the value you want to search for. Is case sensitive. Supports\ + \ wild cards.\n\n**EX:** `GET /api/v2/groups?filter=name:eq:Test+Group`" + required: false + style: form + explode: false + schema: + type: array + items: + type: string + responses: + "200": + description: OK + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/GraphObjectWithPaths' + x-content-type: application/json + security: + - x-api-key: [] + x-scopes: + - applications + - applications.readonly + x-codeSamples: + - lang: Shell + source: "curl --request GET \\\n --url 'https://console.jumpcloud.com/api/v2/usergroups/{group_id}/applications?limit=10&skip=0'\ + \ \\\n --header 'x-api-key: REPLACE_KEY_VALUE' \\\n --header 'x-org-id:\ + \ SOME_STRING_VALUE'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/usergroups/{group_id}/applications\"\ + \n\nquerystring = {\"limit\":\"10\",\"skip\":\"0\"}\n\nheaders = {\n \ + \ \"x-org-id\": \"SOME_STRING_VALUE\",\n \"x-api-key\": \"REPLACE_KEY_VALUE\"\ + \n}\n\nresponse = requests.request(\"GET\", url, headers=headers, params=querystring)\n\ + \nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-org-id\", \"SOME_STRING_VALUE\")\n\ + $headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n$response = Invoke-RestMethod\ + \ -Uri 'https://console.jumpcloud.com/api/v2/usergroups/{group_id}/applications?limit=10&skip=0'\ + \ -Method GET -Headers $headers" + /usergroups/{group_id}/associations: + get: + tags: + - Graph + - User Group Associations + - User Groups + summary: List the associations of a User Group. + description: "This endpoint returns the _direct_ associations of this User Group.\n\ + \nA direct association can be a non-homogeneous relationship between 2 different\ + \ objects, for example User Groups and Users.\n\n\n#### Sample Request\n```\n\ + curl -X GET https://console.jumpcloud.com/api/v2/usergroups/{GroupID}/associations?targets=system\ + \ \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\ + \ \\\n -H 'x-api-key: {API_KEY}'\n```" + operationId: graph_userGroupAssociationsList + parameters: + - name: group_id + in: path + description: ObjectID of the User Group. + required: true + style: simple + explode: false + schema: + type: string + - name: targets + in: query + description: Targets which a "user_group" can be associated to. + required: true + style: form + explode: false + schema: + type: array + items: + type: string + enum: + - active_directory + - application + - g_suite + - ldap_server + - office_365 + - radius_server + - system + - system_group + - name: limit + in: query + description: The number of records to return at once. Limited to 100. + required: false + style: form + explode: true + schema: + type: integer + default: 10 + - name: skip + in: query + description: The offset into the records to return. + required: false + style: form + explode: true + schema: + minimum: 0 + type: integer + default: 0 + - name: x-org-id + in: header + description: Organization identifier that can be obtained from console settings. + required: false + style: simple + explode: false + schema: + type: string + responses: + "200": + description: OK + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/GraphConnection' + x-content-type: application/json + security: + - x-api-key: [] + x-scopes: + - groups + - groups.readonly + x-codeSamples: + - lang: Shell + source: "curl --request GET \\\n --url 'https://console.jumpcloud.com/api/v2/usergroups/{group_id}/associations?targets=SOME_ARRAY_VALUE&limit=10&skip=0'\ + \ \\\n --header 'x-api-key: REPLACE_KEY_VALUE' \\\n --header 'x-org-id:\ + \ SOME_STRING_VALUE'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/usergroups/{group_id}/associations\"\ + \n\nquerystring = {\"targets\":\"SOME_ARRAY_VALUE\",\"limit\":\"10\",\"\ + skip\":\"0\"}\n\nheaders = {\n \"x-org-id\": \"SOME_STRING_VALUE\",\n\ + \ \"x-api-key\": \"REPLACE_KEY_VALUE\"\n}\n\nresponse = requests.request(\"\ + GET\", url, headers=headers, params=querystring)\n\nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-org-id\", \"SOME_STRING_VALUE\")\n\ + $headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n$response = Invoke-RestMethod\ + \ -Uri 'https://console.jumpcloud.com/api/v2/usergroups/{group_id}/associations?targets=SOME_ARRAY_VALUE&limit=10&skip=0'\ + \ -Method GET -Headers $headers" + post: + tags: + - Graph + - User Group Associations + - User Groups + summary: Manage the associations of a User Group + description: "This endpoint manages the _direct_ associations of this User Group.\n\ + \nA direct association can be a non-homogeneous relationship between 2 different\ + \ objects, for example User Groups and Users.\n\n\n#### Sample Request\n```\n\ + curl -X POST https://console.jumpcloud.com/api/v2/usergroups/{GroupID}/associations\ + \ \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\ + \ \\\n -H 'x-api-key: {API_KEY}' \\\n -d '{\n \"op\": \"add\",\n \"\ + type\": \"system\",\n \"id\": \"{SystemID}\"\n }'\n```" + operationId: graph_userGroupAssociationsPost + parameters: + - name: group_id + in: path + description: ObjectID of the User Group. + required: true + style: simple + explode: false + schema: + type: string + - name: x-org-id + in: header + description: Organization identifier that can be obtained from console settings. + required: false + style: simple + explode: false + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/GraphOperation-UserGroup' + required: false + responses: + "204": + description: OK + content: {} + security: + - x-api-key: [] + x-scopes: + - groups + x-codeSamples: + - lang: Shell + source: "curl --request POST \\\n --url https://console.jumpcloud.com/api/v2/usergroups/{group_id}/associations\ + \ \\\n --header 'content-type: application/json' \\\n --header 'x-api-key:\ + \ REPLACE_KEY_VALUE' \\\n --header 'x-org-id: SOME_STRING_VALUE' \\\n \ + \ --data '{\"id\":\"string\",\"op\":\"add\",\"attributes\":{},\"type\":\"\ + active_directory\"}'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/usergroups/{group_id}/associations\"\ + \n\npayload = {\n \"id\": \"string\",\n \"op\": \"add\",\n \"attributes\"\ + : {},\n \"type\": \"active_directory\"\n}\nheaders = {\n \"x-org-id\"\ + : \"SOME_STRING_VALUE\",\n \"x-api-key\": \"REPLACE_KEY_VALUE\",\n \ + \ \"content-type\": \"application/json\"\n}\n\nresponse = requests.request(\"\ + POST\", url, json=payload, headers=headers)\n\nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-org-id\", \"SOME_STRING_VALUE\")\n\ + $headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n$headers.Add(\"content-type\"\ + , \"application/json\")\n$response = Invoke-RestMethod -Uri 'https://console.jumpcloud.com/api/v2/usergroups/{group_id}/associations'\ + \ -Method POST -Headers $headers -ContentType 'application/json' -Body '{\"\ + id\":\"string\",\"op\":\"add\",\"attributes\":{},\"type\":\"active_directory\"\ + }'" + x-codegen-request-body-name: body + /usergroups/{group_id}/directories: + get: + tags: + - Graph + - User Group Associations + - User Groups + summary: List the Directories bound to a User Group + description: "This endpoint will return all Directories bound to a User Group,\ + \ either directly or indirectly, essentially traversing the JumpCloud Graph\ + \ for your Organization.\n\nEach element will contain the type, id, attributes\ + \ and paths\n\nThe `attributes` object is a key/value hash of compiled graph\ + \ attributes for all paths followed.\n\nThe `paths` array enumerates each\ + \ path from this User Group to the corresponding Directory; this array represents\ + \ all grouping and/or associations that would have to be removed to deprovision\ + \ the Directories from this User Group.\n\nSee `/members` and `/associations`\ + \ endpoints to manage those collections.\n\n#### Sample Request\n```\ncurl\ + \ -X GET https://console.jumpcloud.com/api/v2/usergroups/{GroupID}/directories\ + \ \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\ + \ \\\n -H 'x-api-key: {API_KEY}'\n\n```" + operationId: graph_userGroupTraverseDirectory + parameters: + - name: group_id + in: path + description: ObjectID of the User Group. + required: true + style: simple + explode: false + schema: + type: string + - name: limit + in: query + description: The number of records to return at once. Limited to 100. + required: false + style: form + explode: true + schema: + type: integer + default: 10 + - name: x-org-id + in: header + description: Organization identifier that can be obtained from console settings. + required: false + style: simple + explode: false + schema: + type: string + - name: skip + in: query + description: The offset into the records to return. + required: false + style: form + explode: true + schema: + minimum: 0 + type: integer + default: 0 + - name: filter + in: query + description: "A filter to apply to the query.\n\n**Filter structure**: `::`.\n\ + \n**field** = Populate with a valid field from an endpoint response.\n\n\ + **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between,\ + \ search, in.\n_Note: v1 operators differ from v2 operators._\n\n**value**\ + \ = Populate with the value you want to search for. Is case sensitive. Supports\ + \ wild cards.\n\n**EX:** `GET /api/v2/groups?filter=name:eq:Test+Group`" + required: false + style: form + explode: false + schema: + type: array + items: + type: string + responses: + "200": + description: OK + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/GraphObjectWithPaths' + x-content-type: application/json + security: + - x-api-key: [] + x-scopes: + - directories + - directories.readonly + x-codeSamples: + - lang: Shell + source: "curl --request GET \\\n --url 'https://console.jumpcloud.com/api/v2/usergroups/{group_id}/directories?limit=10&skip=0'\ + \ \\\n --header 'x-api-key: REPLACE_KEY_VALUE' \\\n --header 'x-org-id:\ + \ SOME_STRING_VALUE'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/usergroups/{group_id}/directories\"\ + \n\nquerystring = {\"limit\":\"10\",\"skip\":\"0\"}\n\nheaders = {\n \ + \ \"x-org-id\": \"SOME_STRING_VALUE\",\n \"x-api-key\": \"REPLACE_KEY_VALUE\"\ + \n}\n\nresponse = requests.request(\"GET\", url, headers=headers, params=querystring)\n\ + \nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-org-id\", \"SOME_STRING_VALUE\")\n\ + $headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n$response = Invoke-RestMethod\ + \ -Uri 'https://console.jumpcloud.com/api/v2/usergroups/{group_id}/directories?limit=10&skip=0'\ + \ -Method GET -Headers $headers" + /usergroups/{group_id}/gsuites: + get: + tags: + - Graph + - User Group Associations + - User Groups + summary: List the G Suite instances bound to a User Group + description: "This endpoint will return all G Suite Instances bound to a User\ + \ Group, either directly or indirectly, essentially traversing the JumpCloud\ + \ Graph for your Organization.\n\nEach element will contain the type, id,\ + \ attributes and paths\n\nThe `attributes` object is a key/value hash of compiled\ + \ graph attributes for all paths followed.\n\nThe `paths` array enumerates\ + \ each path from this User Group to the corresponding G Suite instance; this\ + \ array represents all grouping and/or associations that would have to be\ + \ removed to deprovision the G Suite instance from this User Group.\n\nSee\ + \ `/members` and `/associations` endpoints to manage those collections.\n\n\ + #### Sample Request\n```\ncurl -X GET https://console.jumpcloud.com/api/v2/usergroups/{GroupID/gsuites\ + \ \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\ + \ \\\n -H 'x-api-key: {API_KEY}'\n\n```" + operationId: graph_userGroupTraverseGSuite + parameters: + - name: group_id + in: path + description: ObjectID of the User Group. + required: true + style: simple + explode: false + schema: + type: string + - name: limit + in: query + description: The number of records to return at once. Limited to 100. + required: false + style: form + explode: true + schema: + type: integer + default: 10 + - name: x-org-id + in: header + description: Organization identifier that can be obtained from console settings. + required: false + style: simple + explode: false + schema: + type: string + - name: skip + in: query + description: The offset into the records to return. + required: false + style: form + explode: true + schema: + minimum: 0 + type: integer + default: 0 + - name: filter + in: query + description: "A filter to apply to the query.\n\n**Filter structure**: `::`.\n\ + \n**field** = Populate with a valid field from an endpoint response.\n\n\ + **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between,\ + \ search, in.\n_Note: v1 operators differ from v2 operators._\n\n**value**\ + \ = Populate with the value you want to search for. Is case sensitive. Supports\ + \ wild cards.\n\n**EX:** `GET /api/v2/groups?filter=name:eq:Test+Group`" + required: false + style: form + explode: false + schema: + type: array + items: + type: string + responses: + "200": + description: OK + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/GraphObjectWithPaths' + x-content-type: application/json + security: + - x-api-key: [] + x-scopes: + - directories + - directories.readonly + x-codeSamples: + - lang: Shell + source: "curl --request GET \\\n --url 'https://console.jumpcloud.com/api/v2/usergroups/{group_id}/gsuites?limit=10&skip=0'\ + \ \\\n --header 'x-api-key: REPLACE_KEY_VALUE' \\\n --header 'x-org-id:\ + \ SOME_STRING_VALUE'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/usergroups/{group_id}/gsuites\"\ + \n\nquerystring = {\"limit\":\"10\",\"skip\":\"0\"}\n\nheaders = {\n \ + \ \"x-org-id\": \"SOME_STRING_VALUE\",\n \"x-api-key\": \"REPLACE_KEY_VALUE\"\ + \n}\n\nresponse = requests.request(\"GET\", url, headers=headers, params=querystring)\n\ + \nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-org-id\", \"SOME_STRING_VALUE\")\n\ + $headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n$response = Invoke-RestMethod\ + \ -Uri 'https://console.jumpcloud.com/api/v2/usergroups/{group_id}/gsuites?limit=10&skip=0'\ + \ -Method GET -Headers $headers" + /usergroups/{group_id}/ldapservers: + get: + tags: + - Graph + - User Group Associations + - User Groups + summary: List the LDAP Servers bound to a User Group + description: "This endpoint will return all LDAP Servers bound to a User Group,\ + \ either directly or indirectly, essentially traversing the JumpCloud Graph\ + \ for your Organization.\n\nEach element will contain the type, id, attributes\ + \ and paths\n\nThe `attributes` object is a key/value hash of compiled graph\ + \ attributes for all paths followed.\n\nThe `paths` array enumerates each\ + \ path from this User Group to the corresponding LDAP Server; this array represents\ + \ all grouping and/or associations that would have to be removed to deprovision\ + \ the LDAP Server from this User Group.\n\nSee `/members` and `/associations`\ + \ endpoints to manage those collections.\n\n#### Sample Request\n```\ncurl\ + \ -X GET https://console.jumpcloud.com/api/v2/usergroups/{GroupID}/ldapservers\ + \ \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\ + \ \\\n -H 'x-api-key: {API_KEY}'\n```" + operationId: graph_userGroupTraverseLdapServer + parameters: + - name: group_id + in: path + description: ObjectID of the User Group. + required: true + style: simple + explode: false + schema: + type: string + - name: limit + in: query + description: The number of records to return at once. Limited to 100. + required: false + style: form + explode: true + schema: + type: integer + default: 10 + - name: x-org-id + in: header + description: Organization identifier that can be obtained from console settings. + required: false + style: simple + explode: false + schema: + type: string + - name: skip + in: query + description: The offset into the records to return. + required: false + style: form + explode: true + schema: + minimum: 0 + type: integer + default: 0 + - name: filter + in: query + description: "A filter to apply to the query.\n\n**Filter structure**: `::`.\n\ + \n**field** = Populate with a valid field from an endpoint response.\n\n\ + **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between,\ + \ search, in.\n_Note: v1 operators differ from v2 operators._\n\n**value**\ + \ = Populate with the value you want to search for. Is case sensitive. Supports\ + \ wild cards.\n\n**EX:** `GET /api/v2/groups?filter=name:eq:Test+Group`" + required: false + style: form + explode: false + schema: + type: array + items: + type: string + responses: + "200": + description: OK + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/GraphObjectWithPaths' + x-content-type: application/json + security: + - x-api-key: [] + x-scopes: + - directories + - directories.readonly + x-codeSamples: + - lang: Shell + source: "curl --request GET \\\n --url 'https://console.jumpcloud.com/api/v2/usergroups/{group_id}/ldapservers?limit=10&skip=0'\ + \ \\\n --header 'x-api-key: REPLACE_KEY_VALUE' \\\n --header 'x-org-id:\ + \ SOME_STRING_VALUE'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/usergroups/{group_id}/ldapservers\"\ + \n\nquerystring = {\"limit\":\"10\",\"skip\":\"0\"}\n\nheaders = {\n \ + \ \"x-org-id\": \"SOME_STRING_VALUE\",\n \"x-api-key\": \"REPLACE_KEY_VALUE\"\ + \n}\n\nresponse = requests.request(\"GET\", url, headers=headers, params=querystring)\n\ + \nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-org-id\", \"SOME_STRING_VALUE\")\n\ + $headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n$response = Invoke-RestMethod\ + \ -Uri 'https://console.jumpcloud.com/api/v2/usergroups/{group_id}/ldapservers?limit=10&skip=0'\ + \ -Method GET -Headers $headers" + /usergroups/{group_id}/members: + get: + tags: + - Graph + - User Group Members & Membership + - User Groups + summary: List the members of a User Group + description: "This endpoint returns the user members of a User Group.\n\n####\ + \ Sample Request\n```\ncurl -X GET https://console.jumpcloud.com/api/v2/usergroups/{GroupID}/members\ + \ \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\ + \ \\\n -H 'x-api-key: {API_KEY}'\n```" + operationId: graph_userGroupMembersList + parameters: + - name: group_id + in: path + description: ObjectID of the User Group. + required: true + style: simple + explode: false + schema: + type: string + - name: limit + in: query + description: The number of records to return at once. Limited to 100. + required: false + style: form + explode: true + schema: + type: integer + default: 10 + - name: skip + in: query + description: The offset into the records to return. + required: false + style: form + explode: true + schema: + minimum: 0 + type: integer + default: 0 + - name: x-org-id + in: header + description: Organization identifier that can be obtained from console settings. + required: false + style: simple + explode: false + schema: + type: string + responses: + "200": + description: OK + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/GraphConnection' + x-content-type: application/json + security: + - x-api-key: [] + x-scopes: + - users + - users.readonly + x-codeSamples: + - lang: Shell + source: "curl --request GET \\\n --url 'https://console.jumpcloud.com/api/v2/usergroups/{group_id}/members?limit=10&skip=0'\ + \ \\\n --header 'x-api-key: REPLACE_KEY_VALUE' \\\n --header 'x-org-id:\ + \ SOME_STRING_VALUE'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/usergroups/{group_id}/members\"\ + \n\nquerystring = {\"limit\":\"10\",\"skip\":\"0\"}\n\nheaders = {\n \ + \ \"x-org-id\": \"SOME_STRING_VALUE\",\n \"x-api-key\": \"REPLACE_KEY_VALUE\"\ + \n}\n\nresponse = requests.request(\"GET\", url, headers=headers, params=querystring)\n\ + \nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-org-id\", \"SOME_STRING_VALUE\")\n\ + $headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n$response = Invoke-RestMethod\ + \ -Uri 'https://console.jumpcloud.com/api/v2/usergroups/{group_id}/members?limit=10&skip=0'\ + \ -Method GET -Headers $headers" + post: + tags: + - Graph + - User Group Members & Membership + - User Groups + summary: Manage the members of a User Group + description: "This endpoint allows you to manage the user members of a User\ + \ Group.\n\n#### Sample Request\n```\ncurl -X POST https://console.jumpcloud.com/api/v2/usergroups/{GroupID}/members\ + \ \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\ + \ \\\n -H 'x-api-key: {API_KEY}' \\\n -d '{\n \"op\": \"add\",\n \"\ + type\": \"user\",\n \"id\": \"{User_ID}\"\n }'\n```" + operationId: graph_userGroupMembersPost + parameters: + - name: group_id + in: path + description: ObjectID of the User Group. + required: true + style: simple + explode: false + schema: + type: string + - name: x-org-id + in: header + description: Organization identifier that can be obtained from console settings. + required: false + style: simple + explode: false + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/GraphOperation-UserGroup-Member' + required: false + responses: + "204": + description: OK + content: {} + security: + - x-api-key: [] + x-scopes: + - groups + x-codeSamples: + - lang: Shell + source: "curl --request POST \\\n --url https://console.jumpcloud.com/api/v2/usergroups/{group_id}/members\ + \ \\\n --header 'content-type: application/json' \\\n --header 'x-api-key:\ + \ REPLACE_KEY_VALUE' \\\n --header 'x-org-id: SOME_STRING_VALUE' \\\n \ + \ --data '{\"id\":\"string\",\"op\":\"add\",\"attributes\":{},\"type\":\"\ + user\"}'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/usergroups/{group_id}/members\"\ + \n\npayload = {\n \"id\": \"string\",\n \"op\": \"add\",\n \"attributes\"\ + : {},\n \"type\": \"user\"\n}\nheaders = {\n \"x-org-id\": \"SOME_STRING_VALUE\"\ + ,\n \"x-api-key\": \"REPLACE_KEY_VALUE\",\n \"content-type\": \"application/json\"\ + \n}\n\nresponse = requests.request(\"POST\", url, json=payload, headers=headers)\n\ + \nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-org-id\", \"SOME_STRING_VALUE\")\n\ + $headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n$headers.Add(\"content-type\"\ + , \"application/json\")\n$response = Invoke-RestMethod -Uri 'https://console.jumpcloud.com/api/v2/usergroups/{group_id}/members'\ + \ -Method POST -Headers $headers -ContentType 'application/json' -Body '{\"\ + id\":\"string\",\"op\":\"add\",\"attributes\":{},\"type\":\"user\"}'" + x-codegen-request-body-name: body + /usergroups/{group_id}/membership: + get: + tags: + - Graph + - User Group Members & Membership + - User Groups + summary: List the User Group's membership + description: "This endpoint returns all users members that are a member of this\ + \ User Group.\n\n#### Sample Request\n```\ncurl -X GET https://console.jumpcloud.com/api/v2/usergroups/{GroupID}/membership\ + \ \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\ + \ \\\n -H 'x-api-key: {API_KEY}'\n```" + operationId: graph_userGroupMembership + parameters: + - name: group_id + in: path + description: ObjectID of the User Group. + required: true + style: simple + explode: false + schema: + type: string + - name: filter + in: query + description: "A filter to apply to the query.\n\n**Filter structure**: `::`.\n\ + \n**field** = Populate with a valid field from an endpoint response.\n\n\ + **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between,\ + \ search, in.\n_Note: v1 operators differ from v2 operators._\n\n**value**\ + \ = Populate with the value you want to search for. Is case sensitive. Supports\ + \ wild cards.\n\n**EX:** `GET /api/v2/groups?filter=name:eq:Test+Group`" + required: false + style: form + explode: false + schema: + type: array + items: + type: string + - name: limit + in: query + description: The number of records to return at once. Limited to 100. + required: false + style: form + explode: true + schema: + type: integer + default: 10 + - name: skip + in: query + description: The offset into the records to return. + required: false + style: form + explode: true + schema: + minimum: 0 + type: integer + default: 0 + - name: sort + in: query + description: "The comma separated fields used to sort the collection.\nDefault\ + \ sort is ascending, prefix with `-` to sort descending.\n" + required: false + style: form + explode: false + schema: + type: array + items: + type: string + - name: x-org-id + in: header + description: Organization identifier that can be obtained from console settings. + required: false + style: simple + explode: false + schema: + type: string + responses: + "200": + description: OK + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/GraphObjectWithPaths' + x-content-type: application/json + security: + - x-api-key: [] + x-scopes: + - users + - users.readonly + x-codeSamples: + - lang: Shell + source: "curl --request GET \\\n --url 'https://console.jumpcloud.com/api/v2/usergroups/{group_id}/membership?limit=10&skip=0'\ + \ \\\n --header 'x-api-key: REPLACE_KEY_VALUE' \\\n --header 'x-org-id:\ + \ SOME_STRING_VALUE'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/usergroups/{group_id}/membership\"\ + \n\nquerystring = {\"limit\":\"10\",\"skip\":\"0\"}\n\nheaders = {\n \ + \ \"x-org-id\": \"SOME_STRING_VALUE\",\n \"x-api-key\": \"REPLACE_KEY_VALUE\"\ + \n}\n\nresponse = requests.request(\"GET\", url, headers=headers, params=querystring)\n\ + \nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-org-id\", \"SOME_STRING_VALUE\")\n\ + $headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n$response = Invoke-RestMethod\ + \ -Uri 'https://console.jumpcloud.com/api/v2/usergroups/{group_id}/membership?limit=10&skip=0'\ + \ -Method GET -Headers $headers" + /usergroups/{group_id}/office365s: + get: + tags: + - Graph + - User Group Associations + - User Groups + summary: List the Office 365 instances bound to a User Group + description: "This endpoint will return all Office 365 instances bound to a\ + \ User Group, either directly or indirectly, essentially traversing the JumpCloud\ + \ Graph for your Organization.\n\nEach element will contain the type, id,\ + \ attributes and paths\n\nThe `attributes` object is a key/value hash of compiled\ + \ graph attributes for all paths followed.\n\nThe `paths` array enumerates\ + \ each path from this User Group to the corresponding Office 365 instance;\ + \ this array represents all grouping and/or associations that would have to\ + \ be removed to deprovision the Office 365 instance from this User Group.\n\ + \nSee `/members` and `/associations` endpoints to manage those collections.\n\ + \n#### Sample Request\n```\ncurl -X GET https://console.jumpcloud.com/api/v2/usergroups/{GroupID}/office365s\ + \ \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\ + \ \\\n -H 'x-api-key: {API_KEY}'\n```" + operationId: graph_userGroupTraverseOffice365 + parameters: + - name: group_id + in: path + description: ObjectID of the User Group. + required: true + style: simple + explode: false + schema: + type: string + - name: limit + in: query + description: The number of records to return at once. Limited to 100. + required: false + style: form + explode: true + schema: + type: integer + default: 10 + - name: x-org-id + in: header + description: Organization identifier that can be obtained from console settings. + required: false + style: simple + explode: false + schema: + type: string + - name: skip + in: query + description: The offset into the records to return. + required: false + style: form + explode: true + schema: + minimum: 0 + type: integer + default: 0 + - name: filter + in: query + description: "A filter to apply to the query.\n\n**Filter structure**: `::`.\n\ + \n**field** = Populate with a valid field from an endpoint response.\n\n\ + **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between,\ + \ search, in.\n_Note: v1 operators differ from v2 operators._\n\n**value**\ + \ = Populate with the value you want to search for. Is case sensitive. Supports\ + \ wild cards.\n\n**EX:** `GET /api/v2/groups?filter=name:eq:Test+Group`" + required: false + style: form + explode: false + schema: + type: array + items: + type: string + responses: + "200": + description: OK + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/GraphObjectWithPaths' + x-content-type: application/json + security: + - x-api-key: [] + x-scopes: + - directories + - directories.readonly + x-codeSamples: + - lang: Shell + source: "curl --request GET \\\n --url 'https://console.jumpcloud.com/api/v2/usergroups/{group_id}/office365s?limit=10&skip=0'\ + \ \\\n --header 'x-api-key: REPLACE_KEY_VALUE' \\\n --header 'x-org-id:\ + \ SOME_STRING_VALUE'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/usergroups/{group_id}/office365s\"\ + \n\nquerystring = {\"limit\":\"10\",\"skip\":\"0\"}\n\nheaders = {\n \ + \ \"x-org-id\": \"SOME_STRING_VALUE\",\n \"x-api-key\": \"REPLACE_KEY_VALUE\"\ + \n}\n\nresponse = requests.request(\"GET\", url, headers=headers, params=querystring)\n\ + \nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-org-id\", \"SOME_STRING_VALUE\")\n\ + $headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n$response = Invoke-RestMethod\ + \ -Uri 'https://console.jumpcloud.com/api/v2/usergroups/{group_id}/office365s?limit=10&skip=0'\ + \ -Method GET -Headers $headers" + /usergroups/{group_id}/radiusservers: + get: + tags: + - Graph + - User Group Associations + - User Groups + summary: List the RADIUS Servers bound to a User Group + description: "This endpoint will return all RADIUS servers bound to a User Group,\ + \ either directly or indirectly, essentially traversing the JumpCloud Graph\ + \ for your Organization.\n\nEach element will contain the type, id, attributes\ + \ and paths\n\nThe `attributes` object is a key/value hash of compiled graph\ + \ attributes for all paths followed.\n\nThe `paths` array enumerates each\ + \ path from this User Group to the corresponding RADIUS Server; this array\ + \ represents all grouping and/or associations that would have to be removed\ + \ to deprovision the RADIUS Server from this User Group.\n\nSee `/members`\ + \ and `/associations` endpoints to manage those collections.\n\n#### Sample\ + \ Request\n```\ncurl -X GET https://console.jumpcloud.com/api/v2/usergroups/{GroupID}/radiusservers\ + \ \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\ + \ \\\n -H 'x-api-key: {API_KEY}'\n\n```" + operationId: graph_userGroupTraverseRadiusServer + parameters: + - name: group_id + in: path + description: ObjectID of the User Group. + required: true + style: simple + explode: false + schema: + type: string + - name: limit + in: query + description: The number of records to return at once. Limited to 100. + required: false + style: form + explode: true + schema: + type: integer + default: 10 + - name: x-org-id + in: header + description: Organization identifier that can be obtained from console settings. + required: false + style: simple + explode: false + schema: + type: string + - name: skip + in: query + description: The offset into the records to return. + required: false + style: form + explode: true + schema: + minimum: 0 + type: integer + default: 0 + - name: filter + in: query + description: "A filter to apply to the query.\n\n**Filter structure**: `::`.\n\ + \n**field** = Populate with a valid field from an endpoint response.\n\n\ + **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between,\ + \ search, in.\n_Note: v1 operators differ from v2 operators._\n\n**value**\ + \ = Populate with the value you want to search for. Is case sensitive. Supports\ + \ wild cards.\n\n**EX:** `GET /api/v2/groups?filter=name:eq:Test+Group`" + required: false + style: form + explode: false + schema: + type: array + items: + type: string + responses: + "200": + description: OK + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/GraphObjectWithPaths' + x-content-type: application/json + security: + - x-api-key: [] + x-scopes: + - radius + - radius.readonly + x-codeSamples: + - lang: Shell + source: "curl --request GET \\\n --url 'https://console.jumpcloud.com/api/v2/usergroups/{group_id}/radiusservers?limit=10&skip=0'\ + \ \\\n --header 'x-api-key: REPLACE_KEY_VALUE' \\\n --header 'x-org-id:\ + \ SOME_STRING_VALUE'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/usergroups/{group_id}/radiusservers\"\ + \n\nquerystring = {\"limit\":\"10\",\"skip\":\"0\"}\n\nheaders = {\n \ + \ \"x-org-id\": \"SOME_STRING_VALUE\",\n \"x-api-key\": \"REPLACE_KEY_VALUE\"\ + \n}\n\nresponse = requests.request(\"GET\", url, headers=headers, params=querystring)\n\ + \nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-org-id\", \"SOME_STRING_VALUE\")\n\ + $headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n$response = Invoke-RestMethod\ + \ -Uri 'https://console.jumpcloud.com/api/v2/usergroups/{group_id}/radiusservers?limit=10&skip=0'\ + \ -Method GET -Headers $headers" + /usergroups/{group_id}/suggestions: + get: + tags: + - User Groups + summary: List Suggestions for a User Group + description: "This endpoint returns available suggestions for a given group\n\ + #### Sample Request\n```\ncurl -X GET https://console.jumpcloud.com/api/v2/usergroups/{GroupID}/suggestions\ + \ \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\ + \ \\\n -H 'x-api-key: {API_KEY}'\n\n```" + operationId: groups_suggestions_get + parameters: + - name: x-org-id + in: header + description: Organization identifier that can be obtained from console settings. + required: false + style: simple + explode: false + schema: + type: string + - name: limit + in: query + description: The number of records to return at once. Limited to 100. + required: false + style: form + explode: true + schema: + type: integer + default: 10 + - name: skip + in: query + description: The offset into the records to return. + required: false + style: form + explode: true + schema: + minimum: 0 + type: integer + default: 0 + - name: group_id + in: path + description: ID of the group + required: true + style: simple + explode: false + schema: + type: string + responses: + "200": + description: OK + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/MemberSuggestion' + x-content-type: application/json + security: + - x-api-key: [] + x-scopes: + - groups + x-codeSamples: + - lang: Shell + source: "curl --request GET \\\n --url 'https://console.jumpcloud.com/api/v2/usergroups/{group_id}/suggestions?limit=10&skip=0'\ + \ \\\n --header 'x-api-key: REPLACE_KEY_VALUE' \\\n --header 'x-org-id:\ + \ SOME_STRING_VALUE'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/usergroups/{group_id}/suggestions\"\ + \n\nquerystring = {\"limit\":\"10\",\"skip\":\"0\"}\n\nheaders = {\n \ + \ \"x-org-id\": \"SOME_STRING_VALUE\",\n \"x-api-key\": \"REPLACE_KEY_VALUE\"\ + \n}\n\nresponse = requests.request(\"GET\", url, headers=headers, params=querystring)\n\ + \nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-org-id\", \"SOME_STRING_VALUE\")\n\ + $headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n$response = Invoke-RestMethod\ + \ -Uri 'https://console.jumpcloud.com/api/v2/usergroups/{group_id}/suggestions?limit=10&skip=0'\ + \ -Method GET -Headers $headers" + post: + tags: + - User Groups + summary: List Suggestions for a User Group + description: "This endpoint applies the suggestions for the specified user group.\n\ + #### Sample Request\n```\ncurl -X PUT https://console.jumpcloud.com/api/v2/usergroups/{GroupID}/suggestions\ + \ \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\ + \ \\\n -H 'x-api-key: {API_KEY}' \\\n -d '{\n \"user_ids\": [\"\ + 212345678901234567890123\",\n \"123456789012345678901234\"\ + ]\n }'\n```" + operationId: groups_suggestions_post + parameters: + - name: x-org-id + in: header + description: Organization identifier that can be obtained from console settings. + required: false + style: simple + explode: false + schema: + type: string + - name: group_id + in: path + description: ID of the group + required: true + style: simple + explode: false + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/group_id_suggestions_body' + required: true + responses: + "200": + description: OK + content: + application/json: + schema: + type: object + x-content-type: application/json + security: + - x-api-key: [] + x-scopes: + - groups + x-codeSamples: + - lang: Shell + source: "curl --request POST \\\n --url https://console.jumpcloud.com/api/v2/usergroups/{group_id}/suggestions\ + \ \\\n --header 'content-type: application/json' \\\n --header 'x-api-key:\ + \ REPLACE_KEY_VALUE' \\\n --header 'x-org-id: SOME_STRING_VALUE' \\\n \ + \ --data '{\"user_ids\":[\"string\"]}'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/usergroups/{group_id}/suggestions\"\ + \n\npayload = {\"user_ids\": [\"string\"]}\nheaders = {\n \"x-org-id\"\ + : \"SOME_STRING_VALUE\",\n \"x-api-key\": \"REPLACE_KEY_VALUE\",\n \ + \ \"content-type\": \"application/json\"\n}\n\nresponse = requests.request(\"\ + POST\", url, json=payload, headers=headers)\n\nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-org-id\", \"SOME_STRING_VALUE\")\n\ + $headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n$headers.Add(\"content-type\"\ + , \"application/json\")\n$response = Invoke-RestMethod -Uri 'https://console.jumpcloud.com/api/v2/usergroups/{group_id}/suggestions'\ + \ -Method POST -Headers $headers -ContentType 'application/json' -Body '{\"\ + user_ids\":[\"string\"]}'" + x-codegen-request-body-name: body + /usergroups/{group_id}/systemgroups: + get: + tags: + - Graph + - User Group Associations + - User Groups + summary: List the System Groups bound to User Groups + description: "This endpoint will return all System Groups bound to a User Group,\ + \ either directly or indirectly, essentially traversing the JumpCloud Graph\ + \ for your Organization.\n\nEach element will contain the type, id, attributes\ + \ and paths.\n\nThe `attributes` object is a key/value hash of compiled graph\ + \ attributes for all paths followed.\n\nThe `paths` array enumerates each\ + \ path from this User Group to the corresponding System Group; this array\ + \ represents all grouping and/or associations that would have to be removed\ + \ to deprovision the System Group from this User Group.\n\nSee `/members`\ + \ and `/associations` endpoints to manage those collections.\n\n#### Sample\ + \ Request\n```\ncurl -X GET https://console.jumpcloud.com/api/v2/usergroups/{GroupID}/systemgroups\ + \ \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\ + \ \\\n -H 'x-api-key: {API_KEY}'\n```" + operationId: graph_userGroupTraverseSystemGroup + parameters: + - name: group_id + in: path + description: ObjectID of the User Group. + required: true + style: simple + explode: false + schema: + type: string + - name: limit + in: query + description: The number of records to return at once. Limited to 100. + required: false + style: form + explode: true + schema: + type: integer + default: 10 + - name: x-org-id + in: header + description: Organization identifier that can be obtained from console settings. + required: false + style: simple + explode: false + schema: + type: string + - name: skip + in: query + description: The offset into the records to return. + required: false + style: form + explode: true + schema: + minimum: 0 + type: integer + default: 0 + - name: filter + in: query + description: "A filter to apply to the query.\n\n**Filter structure**: `::`.\n\ + \n**field** = Populate with a valid field from an endpoint response.\n\n\ + **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between,\ + \ search, in.\n_Note: v1 operators differ from v2 operators._\n\n**value**\ + \ = Populate with the value you want to search for. Is case sensitive. Supports\ + \ wild cards.\n\n**EX:** `GET /api/v2/groups?filter=name:eq:Test+Group`" + required: false + style: form + explode: false + schema: + type: array + items: + type: string + responses: + "200": + description: OK + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/GraphObjectWithPaths' + x-content-type: application/json + security: + - x-api-key: [] + x-scopes: + - groups + - groups.readonly + x-codeSamples: + - lang: Shell + source: "curl --request GET \\\n --url 'https://console.jumpcloud.com/api/v2/usergroups/{group_id}/systemgroups?limit=10&skip=0'\ + \ \\\n --header 'x-api-key: REPLACE_KEY_VALUE' \\\n --header 'x-org-id:\ + \ SOME_STRING_VALUE'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/usergroups/{group_id}/systemgroups\"\ + \n\nquerystring = {\"limit\":\"10\",\"skip\":\"0\"}\n\nheaders = {\n \ + \ \"x-org-id\": \"SOME_STRING_VALUE\",\n \"x-api-key\": \"REPLACE_KEY_VALUE\"\ + \n}\n\nresponse = requests.request(\"GET\", url, headers=headers, params=querystring)\n\ + \nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-org-id\", \"SOME_STRING_VALUE\")\n\ + $headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n$response = Invoke-RestMethod\ + \ -Uri 'https://console.jumpcloud.com/api/v2/usergroups/{group_id}/systemgroups?limit=10&skip=0'\ + \ -Method GET -Headers $headers" + /usergroups/{group_id}/systems: + get: + tags: + - Graph + - User Group Associations + - User Groups + summary: List the Systems bound to a User Group + description: "This endpoint will return all Systems bound to a User Group, either\ + \ directly or indirectly, essentially traversing the JumpCloud Graph for your\ + \ Organization.\n\nEach element will contain the type, id, attributes and\ + \ paths\n\nThe `attributes` object is a key/value hash of compiled graph attributes\ + \ for all paths followed.\n\nThe `paths` array enumerates each path from this\ + \ User Group to the corresponding System; this array represents all grouping\ + \ and/or associations that would have to be removed to deprovision the System\ + \ from this User Group.\n\nSee `/members` and `/associations` endpoints to\ + \ manage those collections.\n\n#### Sample Request\n```\ncurl -X GET https://console.jumpcloud.com/api/v2/usergroups/{GroupID}/systems\ + \ \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\ + \ \\\n -H 'x-api-key: {API_KEY}'\n```" + operationId: graph_userGroupTraverseSystem + parameters: + - name: group_id + in: path + description: ObjectID of the User Group. + required: true + style: simple + explode: false + schema: + type: string + - name: limit + in: query + description: The number of records to return at once. Limited to 100. + required: false + style: form + explode: true + schema: + type: integer + default: 10 + - name: x-org-id + in: header + description: Organization identifier that can be obtained from console settings. + required: false + style: simple + explode: false + schema: + type: string + - name: skip + in: query + description: The offset into the records to return. + required: false + style: form + explode: true + schema: + minimum: 0 + type: integer + default: 0 + - name: filter + in: query + description: "A filter to apply to the query.\n\n**Filter structure**: `::`.\n\ + \n**field** = Populate with a valid field from an endpoint response.\n\n\ + **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between,\ + \ search, in.\n_Note: v1 operators differ from v2 operators._\n\n**value**\ + \ = Populate with the value you want to search for. Is case sensitive. Supports\ + \ wild cards.\n\n**EX:** `GET /api/v2/groups?filter=name:eq:Test+Group`" + required: false + style: form + explode: false + schema: + type: array + items: + type: string + responses: + "200": + description: OK + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/GraphObjectWithPaths' + x-content-type: application/json + security: + - x-api-key: [] + x-scopes: + - systems + - systems.readonly + x-codeSamples: + - lang: Shell + source: "curl --request GET \\\n --url 'https://console.jumpcloud.com/api/v2/usergroups/{group_id}/systems?limit=10&skip=0'\ + \ \\\n --header 'x-api-key: REPLACE_KEY_VALUE' \\\n --header 'x-org-id:\ + \ SOME_STRING_VALUE'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/usergroups/{group_id}/systems\"\ + \n\nquerystring = {\"limit\":\"10\",\"skip\":\"0\"}\n\nheaders = {\n \ + \ \"x-org-id\": \"SOME_STRING_VALUE\",\n \"x-api-key\": \"REPLACE_KEY_VALUE\"\ + \n}\n\nresponse = requests.request(\"GET\", url, headers=headers, params=querystring)\n\ + \nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-org-id\", \"SOME_STRING_VALUE\")\n\ + $headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n$response = Invoke-RestMethod\ + \ -Uri 'https://console.jumpcloud.com/api/v2/usergroups/{group_id}/systems?limit=10&skip=0'\ + \ -Method GET -Headers $headers" + /usergroups/{id}: + get: + tags: + - User Groups + summary: View an individual User Group details + description: "This endpoint returns the details of a User Group.\n\n#### Sample\ + \ Request\n```\ncurl -X GET https://console.jumpcloud.com/api/v2/usergroups/{GroupID}\ + \ \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\ + \ \\\n -H 'x-api-key: {API_KEY}'\n```" + operationId: groups_user_get + parameters: + - name: id + in: path + description: ObjectID of the User Group. + required: true + style: simple + explode: false + schema: + type: string + - name: x-org-id + in: header + description: Organization identifier that can be obtained from console settings. + required: false + style: simple + explode: false + schema: + type: string + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/UserGroup' + security: + - x-api-key: [] + x-scopes: + - groups + - groups.readonly + x-codeSamples: + - lang: Shell + source: "curl --request GET \\\n --url https://console.jumpcloud.com/api/v2/usergroups/{id}\ + \ \\\n --header 'x-api-key: REPLACE_KEY_VALUE' \\\n --header 'x-org-id:\ + \ SOME_STRING_VALUE'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/usergroups/{id}\"\ + \n\nheaders = {\n \"x-org-id\": \"SOME_STRING_VALUE\",\n \"x-api-key\"\ + : \"REPLACE_KEY_VALUE\"\n}\n\nresponse = requests.request(\"GET\", url,\ + \ headers=headers)\n\nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-org-id\", \"SOME_STRING_VALUE\")\n\ + $headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n$response = Invoke-RestMethod\ + \ -Uri 'https://console.jumpcloud.com/api/v2/usergroups/{id}' -Method GET\ + \ -Headers $headers" + put: + tags: + - User Groups + summary: Update a User Group + description: "This endpoint allows you to do a full update of the User Group.\n\ + \n#### Sample Request\n```\ncurl -X PUT https://console.jumpcloud.com/api/v2/usergroups/{Group_ID}\ + \ \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\ + \ \\\n -H 'x-api-key: {API_KEY}' \\\n -d '{\n \"name\": \"group_update\"\ + \n }'\n```" + operationId: groups_user_put + parameters: + - name: id + in: path + description: ObjectID of the User Group. + required: true + style: simple + explode: false + schema: + type: string + - name: x-org-id + in: header + description: Organization identifier that can be obtained from console settings. + required: false + style: simple + explode: false + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/UserGroupPut' + required: false + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/UserGroup' + security: + - x-api-key: [] + x-scopes: + - groups + x-codeSamples: + - lang: Shell + source: "curl --request PUT \\\n --url https://console.jumpcloud.com/api/v2/usergroups/{id}\ + \ \\\n --header 'content-type: application/json' \\\n --header 'x-api-key:\ + \ REPLACE_KEY_VALUE' \\\n --header 'x-org-id: SOME_STRING_VALUE' \\\n \ + \ --data '{\"attributes\":{\"sudo\":{\"enabled\":true,\"withoutPassword\"\ + :true},\"ldapGroups\":[{\"name\":\"string\"}],\"posixGroups\":[{\"id\":0,\"\ + name\":\"string\"}],\"radius\":{\"reply\":[{\"name\":\"string\",\"value\"\ + :\"string\"}]},\"sambaEnabled\":true},\"description\":\"string\",\"email\"\ + :\"string\",\"memberQuery\":{\"queryType\":\"FilterQuery\",\"filters\":[{\"\ + field\":\"string\",\"operator\":\"eq\",\"value\":\"string\"}]},\"memberQueryExemptions\"\ + :[{\"attributes\":{},\"id\":\"string\",\"type\":\"string\"}],\"memberSuggestionsNotify\"\ + :true,\"membershipAutomated\":true,\"name\":\"string\"}'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/usergroups/{id}\"\ + \n\npayload = {\n \"attributes\": {\n \"sudo\": {\n \ + \ \"enabled\": True,\n \"withoutPassword\": True\n },\n\ + \ \"ldapGroups\": [{\"name\": \"string\"}],\n \"posixGroups\"\ + : [\n {\n \"id\": 0,\n \"name\"\ + : \"string\"\n }\n ],\n \"radius\": {\"reply\"\ + : [\n {\n \"name\": \"string\",\n \ + \ \"value\": \"string\"\n }\n ]},\n\ + \ \"sambaEnabled\": True\n },\n \"description\": \"string\"\ + ,\n \"email\": \"string\",\n \"memberQuery\": {\n \"queryType\"\ + : \"FilterQuery\",\n \"filters\": [\n {\n \ + \ \"field\": \"string\",\n \"operator\": \"eq\",\n \ + \ \"value\": \"string\"\n }\n ]\n },\n\ + \ \"memberQueryExemptions\": [\n {\n \"attributes\"\ + : {},\n \"id\": \"string\",\n \"type\": \"string\"\ + \n }\n ],\n \"memberSuggestionsNotify\": True,\n \"membershipAutomated\"\ + : True,\n \"name\": \"string\"\n}\nheaders = {\n \"x-org-id\": \"\ + SOME_STRING_VALUE\",\n \"x-api-key\": \"REPLACE_KEY_VALUE\",\n \"\ + content-type\": \"application/json\"\n}\n\nresponse = requests.request(\"\ + PUT\", url, json=payload, headers=headers)\n\nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-org-id\", \"SOME_STRING_VALUE\")\n\ + $headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n$headers.Add(\"content-type\"\ + , \"application/json\")\n$response = Invoke-RestMethod -Uri 'https://console.jumpcloud.com/api/v2/usergroups/{id}'\ + \ -Method PUT -Headers $headers -ContentType 'application/json' -Body '{\"\ + attributes\":{\"sudo\":{\"enabled\":true,\"withoutPassword\":true},\"ldapGroups\"\ + :[{\"name\":\"string\"}],\"posixGroups\":[{\"id\":0,\"name\":\"string\"\ + }],\"radius\":{\"reply\":[{\"name\":\"string\",\"value\":\"string\"}]},\"\ + sambaEnabled\":true},\"description\":\"string\",\"email\":\"string\",\"\ + memberQuery\":{\"queryType\":\"FilterQuery\",\"filters\":[{\"field\":\"\ + string\",\"operator\":\"eq\",\"value\":\"string\"}]},\"memberQueryExemptions\"\ + :[{\"attributes\":{},\"id\":\"string\",\"type\":\"string\"}],\"memberSuggestionsNotify\"\ + :true,\"membershipAutomated\":true,\"name\":\"string\"}'" + x-codegen-request-body-name: body + delete: + tags: + - User Groups + summary: Delete a User Group + description: "This endpoint allows you to delete a User Group.\n\n#### Sample\ + \ Request\n```\ncurl -X DELETE https://console.jumpcloud.com/api/v2/usergroups/{GroupID}\ + \ \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\ + \ \\\n -H 'x-api-key: {API_KEY}'\n\n```" + operationId: groups_user_delete + parameters: + - name: id + in: path + description: ObjectID of the User Group. + required: true + style: simple + explode: false + schema: + type: string + - name: x-org-id + in: header + description: Organization identifier that can be obtained from console settings. + required: false + style: simple + explode: false + schema: + type: string + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/UserGroup' + "204": + description: No Content + content: {} + security: + - x-api-key: [] + x-scopes: + - groups + x-codeSamples: + - lang: Shell + source: "curl --request DELETE \\\n --url https://console.jumpcloud.com/api/v2/usergroups/{id}\ + \ \\\n --header 'x-api-key: REPLACE_KEY_VALUE' \\\n --header 'x-org-id:\ + \ SOME_STRING_VALUE'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/usergroups/{id}\"\ + \n\nheaders = {\n \"x-org-id\": \"SOME_STRING_VALUE\",\n \"x-api-key\"\ + : \"REPLACE_KEY_VALUE\"\n}\n\nresponse = requests.request(\"DELETE\", url,\ + \ headers=headers)\n\nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-org-id\", \"SOME_STRING_VALUE\")\n\ + $headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n$response = Invoke-RestMethod\ + \ -Uri 'https://console.jumpcloud.com/api/v2/usergroups/{id}' -Method DELETE\ + \ -Headers $headers" + /users/{user_id}/activedirectories: + get: + tags: + - Graph + - Users + summary: List the Active Directory instances bound to a User + description: "This endpoint will return all Active Directory Instances bound\ + \ to a User, either directly or indirectly, essentially traversing the JumpCloud\ + \ Graph for your Organization.\n\nEach element will contain the type, id,\ + \ attributes and paths.\n\nThe `attributes` object is a key/value hash of\ + \ compiled graph attributes for all paths followed.\n\nThe `paths` array enumerates\ + \ each path from this User to the corresponding Active Directory instance;\ + \ this array represents all grouping and/or associations that would have to\ + \ be removed to deprovision the Active Directory instance from this User.\n\ + \nSee `/members` and `/associations` endpoints to manage those collections.\n\ + \n#### Sample Request\n```\ncurl -X GET https://console.jumpcloud.com/api/v2/users/{UserID}/activedirectories\ + \ \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\ + \ \\\n -H 'x-api-key: {API_KEY}'\n```" + operationId: graph_userTraverseActiveDirectory + parameters: + - name: user_id + in: path + description: ObjectID of the User. + required: true + style: simple + explode: false + schema: + type: string + - name: filter + in: query + description: "A filter to apply to the query.\n\n**Filter structure**: `::`.\n\ + \n**field** = Populate with a valid field from an endpoint response.\n\n\ + **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between,\ + \ search, in.\n_Note: v1 operators differ from v2 operators._\n\n**value**\ + \ = Populate with the value you want to search for. Is case sensitive. Supports\ + \ wild cards.\n\n**EX:** `GET /api/v2/groups?filter=name:eq:Test+Group`" + required: false + style: form + explode: false + schema: + type: array + items: + type: string + - name: limit + in: query + description: The number of records to return at once. Limited to 100. + required: false + style: form + explode: true + schema: + type: integer + default: 10 + - name: x-org-id + in: header + description: Organization identifier that can be obtained from console settings. + required: false + style: simple + explode: false + schema: + type: string + - name: skip + in: query + description: The offset into the records to return. + required: false + style: form + explode: true + schema: + minimum: 0 + type: integer + default: 0 + responses: + "200": + description: "" + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/GraphObjectWithPaths' + x-content-type: application/json + security: + - x-api-key: [] + x-scopes: + - directories + - directories.readonly + x-codeSamples: + - lang: Shell + source: "curl --request GET \\\n --url 'https://console.jumpcloud.com/api/v2/users/{user_id}/activedirectories?limit=10&skip=0'\ + \ \\\n --header 'x-api-key: REPLACE_KEY_VALUE' \\\n --header 'x-org-id:\ + \ SOME_STRING_VALUE'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/users/{user_id}/activedirectories\"\ + \n\nquerystring = {\"limit\":\"10\",\"skip\":\"0\"}\n\nheaders = {\n \ + \ \"x-org-id\": \"SOME_STRING_VALUE\",\n \"x-api-key\": \"REPLACE_KEY_VALUE\"\ + \n}\n\nresponse = requests.request(\"GET\", url, headers=headers, params=querystring)\n\ + \nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-org-id\", \"SOME_STRING_VALUE\")\n\ + $headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n$response = Invoke-RestMethod\ + \ -Uri 'https://console.jumpcloud.com/api/v2/users/{user_id}/activedirectories?limit=10&skip=0'\ + \ -Method GET -Headers $headers" + /users/{user_id}/applications: + get: + tags: + - Graph + - Users + summary: List the Applications bound to a User + description: "This endpoint will return all Applications bound to a User, either\ + \ directly or indirectly, essentially traversing the JumpCloud Graph for your\ + \ Organization.\n\nEach element will contain the type, id, attributes and\ + \ paths.\n\nThe `attributes` object is a key/value hash of compiled graph\ + \ attributes for all paths followed.\n\nThe `paths` array enumerates each\ + \ path from this User to the corresponding Application; this array represents\ + \ all grouping and/or associations that would have to be removed to deprovision\ + \ the Application from this User.\n\nSee `/members` and `/associations` endpoints\ + \ to manage those collections.\n\n#### Sample Request\n```\ncurl -X GET https://console.jumpcloud.com/api/v2/users/{UserID}/applications\ + \ \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\ + \ \\\n -H 'x-api-key: {API_KEY}'\n```" + operationId: graph_userTraverseApplication + parameters: + - name: user_id + in: path + description: ObjectID of the User. + required: true + style: simple + explode: false + schema: + type: string + - name: limit + in: query + description: The number of records to return at once. Limited to 100. + required: false + style: form + explode: true + schema: + type: integer + default: 10 + - name: x-org-id + in: header + description: Organization identifier that can be obtained from console settings. + required: false + style: simple + explode: false + schema: + type: string + - name: skip + in: query + description: The offset into the records to return. + required: false + style: form + explode: true + schema: + minimum: 0 + type: integer + default: 0 + - name: filter + in: query + description: "A filter to apply to the query.\n\n**Filter structure**: `::`.\n\ + \n**field** = Populate with a valid field from an endpoint response.\n\n\ + **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between,\ + \ search, in.\n_Note: v1 operators differ from v2 operators._\n\n**value**\ + \ = Populate with the value you want to search for. Is case sensitive. Supports\ + \ wild cards.\n\n**EX:** `GET /api/v2/groups?filter=name:eq:Test+Group`" + required: false + style: form + explode: false + schema: + type: array + items: + type: string + responses: + "200": + description: OK + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/GraphObjectWithPaths' + x-content-type: application/json + security: + - x-api-key: [] + x-scopes: + - applications + - applications.readonly + x-codeSamples: + - lang: Shell + source: "curl --request GET \\\n --url 'https://console.jumpcloud.com/api/v2/users/{user_id}/applications?limit=10&skip=0'\ + \ \\\n --header 'x-api-key: REPLACE_KEY_VALUE' \\\n --header 'x-org-id:\ + \ SOME_STRING_VALUE'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/users/{user_id}/applications\"\ + \n\nquerystring = {\"limit\":\"10\",\"skip\":\"0\"}\n\nheaders = {\n \ + \ \"x-org-id\": \"SOME_STRING_VALUE\",\n \"x-api-key\": \"REPLACE_KEY_VALUE\"\ + \n}\n\nresponse = requests.request(\"GET\", url, headers=headers, params=querystring)\n\ + \nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-org-id\", \"SOME_STRING_VALUE\")\n\ + $headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n$response = Invoke-RestMethod\ + \ -Uri 'https://console.jumpcloud.com/api/v2/users/{user_id}/applications?limit=10&skip=0'\ + \ -Method GET -Headers $headers" + /users/{user_id}/associations: + get: + tags: + - Graph + - Users + summary: List the associations of a User + description: "This endpoint returns the _direct_ associations of a User.\n\n\ + A direct association can be a non-homogeneous relationship between 2 different\ + \ objects, for example Users and Systems.\n\n\n#### Sample Request\n```\n\ + curl -X GET https://console.jumpcloud.com/api/v2/users/{UserID}/associations?targets=system_group\ + \ \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\ + \ \\\n -H 'x-api-key: {API_KEY}'\n\n```" + operationId: graph_userAssociationsList + parameters: + - name: user_id + in: path + description: ObjectID of the User. + required: true + style: simple + explode: false + schema: + type: string + - name: targets + in: query + description: Targets which a "user" can be associated to. + required: true + style: form + explode: false + schema: + type: array + items: + type: string + enum: + - active_directory + - application + - g_suite + - ldap_server + - office_365 + - radius_server + - system + - system_group + - name: limit + in: query + description: The number of records to return at once. Limited to 100. + required: false + style: form + explode: true + schema: + type: integer + default: 10 + - name: skip + in: query + description: The offset into the records to return. + required: false + style: form + explode: true + schema: + minimum: 0 + type: integer + default: 0 + - name: x-org-id + in: header + description: Organization identifier that can be obtained from console settings. + required: false + style: simple + explode: false + schema: + type: string + responses: + "200": + description: OK + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/GraphConnection' + x-content-type: application/json + security: + - x-api-key: [] + x-scopes: + - users + - users.readonly + x-codeSamples: + - lang: Shell + source: "curl --request GET \\\n --url 'https://console.jumpcloud.com/api/v2/users/{user_id}/associations?targets=SOME_ARRAY_VALUE&limit=10&skip=0'\ + \ \\\n --header 'x-api-key: REPLACE_KEY_VALUE' \\\n --header 'x-org-id:\ + \ SOME_STRING_VALUE'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/users/{user_id}/associations\"\ + \n\nquerystring = {\"targets\":\"SOME_ARRAY_VALUE\",\"limit\":\"10\",\"\ + skip\":\"0\"}\n\nheaders = {\n \"x-org-id\": \"SOME_STRING_VALUE\",\n\ + \ \"x-api-key\": \"REPLACE_KEY_VALUE\"\n}\n\nresponse = requests.request(\"\ + GET\", url, headers=headers, params=querystring)\n\nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-org-id\", \"SOME_STRING_VALUE\")\n\ + $headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n$response = Invoke-RestMethod\ + \ -Uri 'https://console.jumpcloud.com/api/v2/users/{user_id}/associations?targets=SOME_ARRAY_VALUE&limit=10&skip=0'\ + \ -Method GET -Headers $headers" + post: + tags: + - Graph + - Users + summary: Manage the associations of a User + description: "This endpoint allows you to manage the _direct_ associations of\ + \ a User.\n\nA direct association can be a non-homogeneous relationship between\ + \ 2 different objects, for example Users and Systems.\n\n\n#### Sample Request\n\ + ```\ncurl -X POST https://console.jumpcloud.com/api/v2/users/{UserID}/associations\ + \ \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\ + \ \\\n -H 'x-api-key: {API_KEY}' \\\n -d '{\n \"attributes\": {\n \ + \ \"sudo\": {\n \"enabled\": true,\n \"withoutPassword\": false\n\ + \ }\n },\n \"op\": \"add\",\n \"type\": \"system_group\",\n\ + \ \"id\": \"{GroupID}\"\n }'\n```" + operationId: graph_userAssociationsPost + parameters: + - name: user_id + in: path + description: ObjectID of the User. + required: true + style: simple + explode: false + schema: + type: string + - name: x-org-id + in: header + description: Organization identifier that can be obtained from console settings. + required: false + style: simple + explode: false + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/GraphOperation-User' + required: false + responses: + "204": + description: OK + content: {} + security: + - x-api-key: [] + x-scopes: + - users + x-codeSamples: + - lang: Shell + source: "curl --request POST \\\n --url https://console.jumpcloud.com/api/v2/users/{user_id}/associations\ + \ \\\n --header 'content-type: application/json' \\\n --header 'x-api-key:\ + \ REPLACE_KEY_VALUE' \\\n --header 'x-org-id: SOME_STRING_VALUE' \\\n \ + \ --data '{\"id\":\"string\",\"op\":\"add\",\"attributes\":{\"sudo\":{\"\ + enabled\":true,\"withoutPassword\":true}},\"type\":\"active_directory\"\ + }'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/users/{user_id}/associations\"\ + \n\npayload = {\n \"id\": \"string\",\n \"op\": \"add\",\n \"attributes\"\ + : {\"sudo\": {\n \"enabled\": True,\n \"withoutPassword\"\ + : True\n }},\n \"type\": \"active_directory\"\n}\nheaders = {\n\ + \ \"x-org-id\": \"SOME_STRING_VALUE\",\n \"x-api-key\": \"REPLACE_KEY_VALUE\"\ + ,\n \"content-type\": \"application/json\"\n}\n\nresponse = requests.request(\"\ + POST\", url, json=payload, headers=headers)\n\nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-org-id\", \"SOME_STRING_VALUE\")\n\ + $headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n$headers.Add(\"content-type\"\ + , \"application/json\")\n$response = Invoke-RestMethod -Uri 'https://console.jumpcloud.com/api/v2/users/{user_id}/associations'\ + \ -Method POST -Headers $headers -ContentType 'application/json' -Body '{\"\ + id\":\"string\",\"op\":\"add\",\"attributes\":{\"sudo\":{\"enabled\":true,\"\ + withoutPassword\":true}},\"type\":\"active_directory\"}'" + x-codegen-request-body-name: body + /users/{user_id}/directories: + get: + tags: + - Graph + - Users + summary: List the Directories bound to a User + description: "This endpoint will return all Directories bound to a User, either\ + \ directly or indirectly, essentially traversing the JumpCloud Graph for your\ + \ Organization.\n\nEach element will contain the type, id, attributes and\ + \ paths.\n\nThe `attributes` object is a key/value hash of compiled graph\ + \ attributes for all paths followed.\n\nThe `paths` array enumerates each\ + \ path from this User to the corresponding Directory; this array represents\ + \ all grouping and/or associations that would have to be removed to deprovision\ + \ the Directory from this User.\n\nSee `/members` and `/associations` endpoints\ + \ to manage those collections.\n\n#### Sample Request\n```\ncurl -X GET https://console.jumpcloud.com/api/v2/users/{UserID}/directories\ + \ \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\ + \ \\\n -H 'x-api-key: {API_KEY}'\n```" + operationId: graph_userTraverseDirectory + parameters: + - name: user_id + in: path + description: ObjectID of the User. + required: true + style: simple + explode: false + schema: + type: string + - name: limit + in: query + description: The number of records to return at once. Limited to 100. + required: false + style: form + explode: true + schema: + type: integer + default: 10 + - name: x-org-id + in: header + description: Organization identifier that can be obtained from console settings. + required: false + style: simple + explode: false + schema: + type: string + - name: skip + in: query + description: The offset into the records to return. + required: false + style: form + explode: true + schema: + minimum: 0 + type: integer + default: 0 + - name: filter + in: query + description: "A filter to apply to the query.\n\n**Filter structure**: `::`.\n\ + \n**field** = Populate with a valid field from an endpoint response.\n\n\ + **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between,\ + \ search, in.\n_Note: v1 operators differ from v2 operators._\n\n**value**\ + \ = Populate with the value you want to search for. Is case sensitive. Supports\ + \ wild cards.\n\n**EX:** `GET /api/v2/groups?filter=name:eq:Test+Group`" + required: false + style: form + explode: false + schema: + type: array + items: + type: string + responses: + "200": + description: OK + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/GraphObjectWithPaths' + x-content-type: application/json + security: + - x-api-key: [] + x-scopes: + - directories + - directories.readonly + x-codeSamples: + - lang: Shell + source: "curl --request GET \\\n --url 'https://console.jumpcloud.com/api/v2/users/{user_id}/directories?limit=10&skip=0'\ + \ \\\n --header 'x-api-key: REPLACE_KEY_VALUE' \\\n --header 'x-org-id:\ + \ SOME_STRING_VALUE'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/users/{user_id}/directories\"\ + \n\nquerystring = {\"limit\":\"10\",\"skip\":\"0\"}\n\nheaders = {\n \ + \ \"x-org-id\": \"SOME_STRING_VALUE\",\n \"x-api-key\": \"REPLACE_KEY_VALUE\"\ + \n}\n\nresponse = requests.request(\"GET\", url, headers=headers, params=querystring)\n\ + \nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-org-id\", \"SOME_STRING_VALUE\")\n\ + $headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n$response = Invoke-RestMethod\ + \ -Uri 'https://console.jumpcloud.com/api/v2/users/{user_id}/directories?limit=10&skip=0'\ + \ -Method GET -Headers $headers" + /users/{user_id}/gsuites: + get: + tags: + - Graph + - Users + summary: List the G Suite instances bound to a User + description: "This endpoint will return all G-Suite Instances bound to a User,\ + \ either directly or indirectly, essentially traversing the JumpCloud Graph\ + \ for your Organization.\n\nEach element will contain the type, id, attributes\ + \ and paths.\n\nThe `attributes` object is a key/value hash of compiled graph\ + \ attributes for all paths followed.\n\nThe `paths` array enumerates each\ + \ path from this User to the corresponding G Suite instance; this array represents\ + \ all grouping and/or associations that would have to be removed to deprovision\ + \ the G Suite instance from this User.\n\nSee `/members` and `/associations`\ + \ endpoints to manage those collections.\n\n#### Sample Request\n```\ncurl\ + \ -X GET https://console.jumpcloud.com/api/v2/users/{UserID}/gsuites \\\n\ + \ -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\ + \ \\\n -H 'x-api-key: {API_KEY}'\n```" + operationId: graph_userTraverseGSuite + parameters: + - name: user_id + in: path + description: ObjectID of the User. + required: true + style: simple + explode: false + schema: + type: string + - name: limit + in: query + description: The number of records to return at once. Limited to 100. + required: false + style: form + explode: true + schema: + type: integer + default: 10 + - name: x-org-id + in: header + description: Organization identifier that can be obtained from console settings. + required: false + style: simple + explode: false + schema: + type: string + - name: skip + in: query + description: The offset into the records to return. + required: false + style: form + explode: true + schema: + minimum: 0 + type: integer + default: 0 + - name: filter + in: query + description: "A filter to apply to the query.\n\n**Filter structure**: `::`.\n\ + \n**field** = Populate with a valid field from an endpoint response.\n\n\ + **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between,\ + \ search, in.\n_Note: v1 operators differ from v2 operators._\n\n**value**\ + \ = Populate with the value you want to search for. Is case sensitive. Supports\ + \ wild cards.\n\n**EX:** `GET /api/v2/groups?filter=name:eq:Test+Group`" + required: false + style: form + explode: false + schema: + type: array + items: + type: string + responses: + "200": + description: OK + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/GraphObjectWithPaths' + x-content-type: application/json + security: + - x-api-key: [] + x-scopes: + - directories + - directories.readonly + x-codeSamples: + - lang: Shell + source: "curl --request GET \\\n --url 'https://console.jumpcloud.com/api/v2/users/{user_id}/gsuites?limit=10&skip=0'\ + \ \\\n --header 'x-api-key: REPLACE_KEY_VALUE' \\\n --header 'x-org-id:\ + \ SOME_STRING_VALUE'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/users/{user_id}/gsuites\"\ + \n\nquerystring = {\"limit\":\"10\",\"skip\":\"0\"}\n\nheaders = {\n \ + \ \"x-org-id\": \"SOME_STRING_VALUE\",\n \"x-api-key\": \"REPLACE_KEY_VALUE\"\ + \n}\n\nresponse = requests.request(\"GET\", url, headers=headers, params=querystring)\n\ + \nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-org-id\", \"SOME_STRING_VALUE\")\n\ + $headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n$response = Invoke-RestMethod\ + \ -Uri 'https://console.jumpcloud.com/api/v2/users/{user_id}/gsuites?limit=10&skip=0'\ + \ -Method GET -Headers $headers" + /users/{user_id}/ldapservers: + get: + tags: + - Graph + - Users + summary: List the LDAP servers bound to a User + description: "This endpoint will return all LDAP Servers bound to a User, either\ + \ directly or indirectly, essentially traversing the JumpCloud Graph for your\ + \ Organization.\n\nEach element will contain the type, id, attributes and\ + \ paths.\n\nThe `attributes` object is a key/value hash of compiled graph\ + \ attributes for all paths followed.\n\nThe `paths` array enumerates each\ + \ path from this User to the corresponding LDAP Server; this array represents\ + \ all grouping and/or associations that would have to be removed to deprovision\ + \ the LDAP Server from this User.\n\nSee `/members` and `/associations` endpoints\ + \ to manage those collections.\n\n#### Sample Request\n```\ncurl -X GET https://console.jumpcloud.com/api/v2/users/{UserID}/ldapservers\ + \ \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\ + \ \\\n -H 'x-api-key: {API_KEY}'\n```" + operationId: graph_userTraverseLdapServer + parameters: + - name: user_id + in: path + description: ObjectID of the User. + required: true + style: simple + explode: false + schema: + type: string + - name: limit + in: query + description: The number of records to return at once. Limited to 100. + required: false + style: form + explode: true + schema: + type: integer + default: 10 + - name: x-org-id + in: header + description: Organization identifier that can be obtained from console settings. + required: false + style: simple + explode: false + schema: + type: string + - name: skip + in: query + description: The offset into the records to return. + required: false + style: form + explode: true + schema: + minimum: 0 + type: integer + default: 0 + - name: filter + in: query + description: "A filter to apply to the query.\n\n**Filter structure**: `::`.\n\ + \n**field** = Populate with a valid field from an endpoint response.\n\n\ + **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between,\ + \ search, in.\n_Note: v1 operators differ from v2 operators._\n\n**value**\ + \ = Populate with the value you want to search for. Is case sensitive. Supports\ + \ wild cards.\n\n**EX:** `GET /api/v2/groups?filter=name:eq:Test+Group`" + required: false + style: form + explode: false + schema: + type: array + items: + type: string + responses: + "200": + description: OK + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/GraphObjectWithPaths' + x-content-type: application/json + security: + - x-api-key: [] + x-scopes: + - directories + - directories.readonly + x-codeSamples: + - lang: Shell + source: "curl --request GET \\\n --url 'https://console.jumpcloud.com/api/v2/users/{user_id}/ldapservers?limit=10&skip=0'\ + \ \\\n --header 'x-api-key: REPLACE_KEY_VALUE' \\\n --header 'x-org-id:\ + \ SOME_STRING_VALUE'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/users/{user_id}/ldapservers\"\ + \n\nquerystring = {\"limit\":\"10\",\"skip\":\"0\"}\n\nheaders = {\n \ + \ \"x-org-id\": \"SOME_STRING_VALUE\",\n \"x-api-key\": \"REPLACE_KEY_VALUE\"\ + \n}\n\nresponse = requests.request(\"GET\", url, headers=headers, params=querystring)\n\ + \nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-org-id\", \"SOME_STRING_VALUE\")\n\ + $headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n$response = Invoke-RestMethod\ + \ -Uri 'https://console.jumpcloud.com/api/v2/users/{user_id}/ldapservers?limit=10&skip=0'\ + \ -Method GET -Headers $headers" + /users/{user_id}/memberof: + get: + tags: + - Graph + - Users + summary: List the parent Groups of a User + description: "This endpoint returns all the User Groups a User is a member of.\n\ + \n#### Sample Request\n```\ncurl -X GET https://console.jumpcloud.com/api/v2/users/{UserID}/memberof\ + \ \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\ + \ \\\n -H 'x-api-key: {API_KEY}'\n```" + operationId: graph_userMemberOf + parameters: + - name: user_id + in: path + description: ObjectID of the User. + required: true + style: simple + explode: false + schema: + type: string + - name: filter + in: query + description: "A filter to apply to the query.\n\n**Filter structure**: `::`.\n\ + \n**field** = Populate with a valid field from an endpoint response.\n\n\ + **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between,\ + \ search, in.\n_Note: v1 operators differ from v2 operators._\n\n**value**\ + \ = Populate with the value you want to search for. Is case sensitive. Supports\ + \ wild cards.\n\n**EX:** `GET /api/v2/groups?filter=name:eq:Test+Group`" + required: false + style: form + explode: false + schema: + type: array + items: + type: string + - name: limit + in: query + description: The number of records to return at once. Limited to 100. + required: false + style: form + explode: true + schema: + type: integer + default: 10 + - name: skip + in: query + description: The offset into the records to return. + required: false + style: form + explode: true + schema: + minimum: 0 + type: integer + default: 0 + - name: sort + in: query + description: "The comma separated fields used to sort the collection.\nDefault\ + \ sort is ascending, prefix with `-` to sort descending.\n" + required: false + style: form + explode: false + schema: + type: array + items: + type: string + - name: x-org-id + in: header + description: Organization identifier that can be obtained from console settings. + required: false + style: simple + explode: false + schema: + type: string + responses: + "200": + description: OK + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/GraphObjectWithPaths' + x-content-type: application/json + security: + - x-api-key: [] + x-scopes: + - groups + - groups.readonly + x-codeSamples: + - lang: Shell + source: "curl --request GET \\\n --url 'https://console.jumpcloud.com/api/v2/users/{user_id}/memberof?limit=10&skip=0'\ + \ \\\n --header 'x-api-key: REPLACE_KEY_VALUE' \\\n --header 'x-org-id:\ + \ SOME_STRING_VALUE'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/users/{user_id}/memberof\"\ + \n\nquerystring = {\"limit\":\"10\",\"skip\":\"0\"}\n\nheaders = {\n \ + \ \"x-org-id\": \"SOME_STRING_VALUE\",\n \"x-api-key\": \"REPLACE_KEY_VALUE\"\ + \n}\n\nresponse = requests.request(\"GET\", url, headers=headers, params=querystring)\n\ + \nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-org-id\", \"SOME_STRING_VALUE\")\n\ + $headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n$response = Invoke-RestMethod\ + \ -Uri 'https://console.jumpcloud.com/api/v2/users/{user_id}/memberof?limit=10&skip=0'\ + \ -Method GET -Headers $headers" + /users/{user_id}/office365s: + get: + tags: + - Graph + - Users + summary: List the Office 365 instances bound to a User + description: "This endpoint will return all Office 365 Instances bound to a\ + \ User, either directly or indirectly, essentially traversing the JumpCloud\ + \ Graph for your Organization.\n\nEach element will contain the type, id,\ + \ attributes and paths.\n\nThe `attributes` object is a key/value hash of\ + \ compiled graph attributes for all paths followed.\n\nThe `paths` array enumerates\ + \ each path from this User to the corresponding Office 365 instance; this\ + \ array represents all grouping and/or associations that would have to be\ + \ removed to deprovision the Office 365 instance from this User.\n\nSee `/members`\ + \ and `/associations` endpoints to manage those collections.\n\n#### Sample\ + \ Request\n```\ncurl -X GET https://console.jumpcloud.com/api/v2/users/{UserID}/office365s\ + \ \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\ + \ \\\n -H 'x-api-key: {API_KEY}'\n```" + operationId: graph_userTraverseOffice365 + parameters: + - name: user_id + in: path + description: ObjectID of the User. + required: true + style: simple + explode: false + schema: + type: string + - name: limit + in: query + description: The number of records to return at once. Limited to 100. + required: false + style: form + explode: true + schema: + type: integer + default: 10 + - name: x-org-id + in: header + description: Organization identifier that can be obtained from console settings. + required: false + style: simple + explode: false + schema: + type: string + - name: skip + in: query + description: The offset into the records to return. + required: false + style: form + explode: true + schema: + minimum: 0 + type: integer + default: 0 + - name: filter + in: query + description: "A filter to apply to the query.\n\n**Filter structure**: `::`.\n\ + \n**field** = Populate with a valid field from an endpoint response.\n\n\ + **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between,\ + \ search, in.\n_Note: v1 operators differ from v2 operators._\n\n**value**\ + \ = Populate with the value you want to search for. Is case sensitive. Supports\ + \ wild cards.\n\n**EX:** `GET /api/v2/groups?filter=name:eq:Test+Group`" + required: false + style: form + explode: false + schema: + type: array + items: + type: string + responses: + "200": + description: OK + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/GraphObjectWithPaths' + x-content-type: application/json + security: + - x-api-key: [] + x-scopes: + - directories + - directories.readonly + x-codeSamples: + - lang: Shell + source: "curl --request GET \\\n --url 'https://console.jumpcloud.com/api/v2/users/{user_id}/office365s?limit=10&skip=0'\ + \ \\\n --header 'x-api-key: REPLACE_KEY_VALUE' \\\n --header 'x-org-id:\ + \ SOME_STRING_VALUE'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/users/{user_id}/office365s\"\ + \n\nquerystring = {\"limit\":\"10\",\"skip\":\"0\"}\n\nheaders = {\n \ + \ \"x-org-id\": \"SOME_STRING_VALUE\",\n \"x-api-key\": \"REPLACE_KEY_VALUE\"\ + \n}\n\nresponse = requests.request(\"GET\", url, headers=headers, params=querystring)\n\ + \nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-org-id\", \"SOME_STRING_VALUE\")\n\ + $headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n$response = Invoke-RestMethod\ + \ -Uri 'https://console.jumpcloud.com/api/v2/users/{user_id}/office365s?limit=10&skip=0'\ + \ -Method GET -Headers $headers" + /users/{user_id}/pushendpoints: + get: + tags: + - Users + summary: List Push Endpoints associated with a User + description: "This endpoint returns the list of push endpoints associated with\ + \ a user.\n\n#### Sample Request\n\n```\ncurl -X GET https://console.jumpcloud.com/api/v2/users/{UserID}/pushendpoints\ + \ \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\ + \ \\\n -H 'x-api-key: ${API_KEY}'\n```" + operationId: pushEndpoints_list + parameters: + - name: user_id + in: path + required: true + style: simple + explode: false + schema: + type: string + - name: x-org-id + in: header + description: Organization identifier that can be obtained from console settings. + required: false + style: simple + explode: false + schema: + type: string + responses: + "200": + description: OK + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/PushEndpointResponse' + x-content-type: application/json + "400": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorDetails' + "401": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "403": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "404": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "409": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "500": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + security: + - x-api-key: [] + x-scopes: + - users + - users.readonly + x-codeSamples: + - lang: Shell + source: "curl --request GET \\\n --url https://console.jumpcloud.com/api/v2/users/{user_id}/pushendpoints\ + \ \\\n --header 'x-api-key: REPLACE_KEY_VALUE' \\\n --header 'x-org-id:\ + \ SOME_STRING_VALUE'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/users/{user_id}/pushendpoints\"\ + \n\nheaders = {\n \"x-org-id\": \"SOME_STRING_VALUE\",\n \"x-api-key\"\ + : \"REPLACE_KEY_VALUE\"\n}\n\nresponse = requests.request(\"GET\", url,\ + \ headers=headers)\n\nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-org-id\", \"SOME_STRING_VALUE\")\n\ + $headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n$response = Invoke-RestMethod\ + \ -Uri 'https://console.jumpcloud.com/api/v2/users/{user_id}/pushendpoints'\ + \ -Method GET -Headers $headers" + /users/{user_id}/pushendpoints/{push_endpoint_id}: + get: + tags: + - Users + summary: Get a push endpoint associated with a User + description: This endpoint will retrieve a push endpoint associated with a user. + operationId: pushEndpoints_get + parameters: + - name: user_id + in: path + required: true + style: simple + explode: false + schema: + type: string + - name: push_endpoint_id + in: path + required: true + style: simple + explode: false + schema: + type: string + - name: x-org-id + in: header + description: Organization identifier that can be obtained from console settings. + required: false + style: simple + explode: false + schema: + type: string + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/PushEndpointResponse' + "400": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorDetails' + "401": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "403": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "404": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "409": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "500": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + security: + - x-api-key: [] + x-scopes: + - users + - users.readonly + x-codeSamples: + - lang: Shell + source: "curl --request GET \\\n --url https://console.jumpcloud.com/api/v2/users/{user_id}/pushendpoints/{push_endpoint_id}\ + \ \\\n --header 'x-api-key: REPLACE_KEY_VALUE' \\\n --header 'x-org-id:\ + \ SOME_STRING_VALUE'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/users/{user_id}/pushendpoints/{push_endpoint_id}\"\ + \n\nheaders = {\n \"x-org-id\": \"SOME_STRING_VALUE\",\n \"x-api-key\"\ + : \"REPLACE_KEY_VALUE\"\n}\n\nresponse = requests.request(\"GET\", url,\ + \ headers=headers)\n\nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-org-id\", \"SOME_STRING_VALUE\")\n\ + $headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n$response = Invoke-RestMethod\ + \ -Uri 'https://console.jumpcloud.com/api/v2/users/{user_id}/pushendpoints/{push_endpoint_id}'\ + \ -Method GET -Headers $headers" + delete: + tags: + - Users + summary: Delete a Push Endpoint associated with a User + description: This endpoint will delete a push endpoint associated with a user. + operationId: pushEndpoints_delete + parameters: + - name: user_id + in: path + required: true + style: simple + explode: false + schema: + type: string + - name: push_endpoint_id + in: path + required: true + style: simple + explode: false + schema: + type: string + - name: x-org-id + in: header + description: Organization identifier that can be obtained from console settings. + required: false + style: simple + explode: false + schema: + type: string + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/PushEndpointResponse' + "400": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorDetails' + "401": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "403": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "404": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "409": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "500": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + security: + - x-api-key: [] + x-scopes: + - users + x-codeSamples: + - lang: Shell + source: "curl --request DELETE \\\n --url https://console.jumpcloud.com/api/v2/users/{user_id}/pushendpoints/{push_endpoint_id}\ + \ \\\n --header 'x-api-key: REPLACE_KEY_VALUE' \\\n --header 'x-org-id:\ + \ SOME_STRING_VALUE'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/users/{user_id}/pushendpoints/{push_endpoint_id}\"\ + \n\nheaders = {\n \"x-org-id\": \"SOME_STRING_VALUE\",\n \"x-api-key\"\ + : \"REPLACE_KEY_VALUE\"\n}\n\nresponse = requests.request(\"DELETE\", url,\ + \ headers=headers)\n\nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-org-id\", \"SOME_STRING_VALUE\")\n\ + $headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n$response = Invoke-RestMethod\ + \ -Uri 'https://console.jumpcloud.com/api/v2/users/{user_id}/pushendpoints/{push_endpoint_id}'\ + \ -Method DELETE -Headers $headers" + patch: + tags: + - Users + summary: Update a push endpoint associated with a User + description: This endpoint will update a push endpoint associated with a user. + operationId: pushEndpoints_patch + parameters: + - name: user_id + in: path + required: true + style: simple + explode: false + schema: + type: string + - name: push_endpoint_id + in: path + required: true + style: simple + explode: false + schema: + type: string + - name: x-org-id + in: header + description: Organization identifier that can be obtained from console settings. + required: false + style: simple + explode: false + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/pushendpoints_push_endpoint_id_body' + required: false + responses: + "200": + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/PushEndpointResponse' + "400": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorDetails' + "401": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "403": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "404": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "409": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + "500": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + security: + - x-api-key: [] + x-scopes: + - users + x-codeSamples: + - lang: Shell + source: "curl --request PATCH \\\n --url https://console.jumpcloud.com/api/v2/users/{user_id}/pushendpoints/{push_endpoint_id}\ + \ \\\n --header 'content-type: application/json' \\\n --header 'x-api-key:\ + \ REPLACE_KEY_VALUE' \\\n --header 'x-org-id: SOME_STRING_VALUE' \\\n \ + \ --data '{\"name\":\"string\",\"state\":\"active\"}'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/users/{user_id}/pushendpoints/{push_endpoint_id}\"\ + \n\npayload = {\n \"name\": \"string\",\n \"state\": \"active\"\n\ + }\nheaders = {\n \"x-org-id\": \"SOME_STRING_VALUE\",\n \"x-api-key\"\ + : \"REPLACE_KEY_VALUE\",\n \"content-type\": \"application/json\"\n}\n\ + \nresponse = requests.request(\"PATCH\", url, json=payload, headers=headers)\n\ + \nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-org-id\", \"SOME_STRING_VALUE\")\n\ + $headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n$headers.Add(\"content-type\"\ + , \"application/json\")\n$response = Invoke-RestMethod -Uri 'https://console.jumpcloud.com/api/v2/users/{user_id}/pushendpoints/{push_endpoint_id}'\ + \ -Method PATCH -Headers $headers -ContentType 'application/json' -Body\ + \ '{\"name\":\"string\",\"state\":\"active\"}'" + x-codegen-request-body-name: body + /users/{user_id}/radiusservers: + get: + tags: + - Graph + - Users + summary: List the RADIUS Servers bound to a User + description: "This endpoint will return all RADIUS Servers bound to a User,\ + \ either directly or indirectly, essentially traversing the JumpCloud Graph\ + \ for your Organization.\n\nEach element will contain the type, id, attributes\ + \ and paths.\n\nThe `attributes` object is a key/value hash of compiled graph\ + \ attributes for all paths followed.\n\nThe `paths` array enumerates each\ + \ path from this User to the corresponding RADIUS Server; this array represents\ + \ all grouping and/or associations that would have to be removed to deprovision\ + \ the RADIUS Server from this User.\n\nSee `/members` and `/associations`\ + \ endpoints to manage those collections.\n\n#### Sample Request\n```\ncurl\ + \ -X GET https://console.jumpcloud.com/api/v2/users/{UserID}/radiusservers\ + \ \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\ + \ \\\n -H 'x-api-key: {API_KEY}'\n```" + operationId: graph_userTraverseRadiusServer + parameters: + - name: user_id + in: path + description: ObjectID of the User. + required: true + style: simple + explode: false + schema: + type: string + - name: limit + in: query + description: The number of records to return at once. Limited to 100. + required: false + style: form + explode: true + schema: + type: integer + default: 10 + - name: x-org-id + in: header + description: Organization identifier that can be obtained from console settings. + required: false + style: simple + explode: false + schema: + type: string + - name: skip + in: query + description: The offset into the records to return. + required: false + style: form + explode: true + schema: + minimum: 0 + type: integer + default: 0 + - name: filter + in: query + description: "A filter to apply to the query.\n\n**Filter structure**: `::`.\n\ + \n**field** = Populate with a valid field from an endpoint response.\n\n\ + **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between,\ + \ search, in.\n_Note: v1 operators differ from v2 operators._\n\n**value**\ + \ = Populate with the value you want to search for. Is case sensitive. Supports\ + \ wild cards.\n\n**EX:** `GET /api/v2/groups?filter=name:eq:Test+Group`" + required: false + style: form + explode: false + schema: + type: array + items: + type: string + responses: + "200": + description: OK + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/GraphObjectWithPaths' + x-content-type: application/json + security: + - x-api-key: [] + x-scopes: + - radius + - radius.readonly + x-codeSamples: + - lang: Shell + source: "curl --request GET \\\n --url 'https://console.jumpcloud.com/api/v2/users/{user_id}/radiusservers?limit=10&skip=0'\ + \ \\\n --header 'x-api-key: REPLACE_KEY_VALUE' \\\n --header 'x-org-id:\ + \ SOME_STRING_VALUE'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/users/{user_id}/radiusservers\"\ + \n\nquerystring = {\"limit\":\"10\",\"skip\":\"0\"}\n\nheaders = {\n \ + \ \"x-org-id\": \"SOME_STRING_VALUE\",\n \"x-api-key\": \"REPLACE_KEY_VALUE\"\ + \n}\n\nresponse = requests.request(\"GET\", url, headers=headers, params=querystring)\n\ + \nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-org-id\", \"SOME_STRING_VALUE\")\n\ + $headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n$response = Invoke-RestMethod\ + \ -Uri 'https://console.jumpcloud.com/api/v2/users/{user_id}/radiusservers?limit=10&skip=0'\ + \ -Method GET -Headers $headers" + /users/{user_id}/systemgroups: + get: + tags: + - Graph + - Users + summary: List the System Groups bound to a User + description: "This endpoint will return all System Groups bound to a User, either\ + \ directly or indirectly, essentially traversing the JumpCloud Graph for your\ + \ Organization.\n\nEach element will contain the type, id, attributes and\ + \ paths.\n\nThe `attributes` object is a key/value hash of compiled graph\ + \ attributes for all paths followed.\n\nThe `paths` array enumerates each\ + \ path from this User to the corresponding System Group; this array represents\ + \ all grouping and/or associations that would have to be removed to deprovision\ + \ the System Group from this User.\n\nSee `/members` and `/associations` endpoints\ + \ to manage those collections.\n\n#### Sample Request\n```\ncurl -X GET https://console.jumpcloud.com/api/v2/users/{UserID}/systemgroups\\\ + \n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\ + \ \\\n -H 'x-api-key: {API_KEY}'\n```" + operationId: graph_userTraverseSystemGroup + parameters: + - name: user_id + in: path + description: ObjectID of the User. + required: true + style: simple + explode: false + schema: + type: string + - name: limit + in: query + description: The number of records to return at once. Limited to 100. + required: false + style: form + explode: true + schema: + type: integer + default: 10 + - name: x-org-id + in: header + description: Organization identifier that can be obtained from console settings. + required: false + style: simple + explode: false + schema: + type: string + - name: skip + in: query + description: The offset into the records to return. + required: false + style: form + explode: true + schema: + minimum: 0 + type: integer + default: 0 + - name: filter + in: query + description: "A filter to apply to the query.\n\n**Filter structure**: `::`.\n\ + \n**field** = Populate with a valid field from an endpoint response.\n\n\ + **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between,\ + \ search, in.\n_Note: v1 operators differ from v2 operators._\n\n**value**\ + \ = Populate with the value you want to search for. Is case sensitive. Supports\ + \ wild cards.\n\n**EX:** `GET /api/v2/groups?filter=name:eq:Test+Group`" + required: false + style: form + explode: false + schema: + type: array + items: + type: string + responses: + "200": + description: OK + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/GraphObjectWithPaths' + x-content-type: application/json + security: + - x-api-key: [] + x-scopes: + - groups + - groups.readonly + x-codeSamples: + - lang: Shell + source: "curl --request GET \\\n --url 'https://console.jumpcloud.com/api/v2/users/{user_id}/systemgroups?limit=10&skip=0'\ + \ \\\n --header 'x-api-key: REPLACE_KEY_VALUE' \\\n --header 'x-org-id:\ + \ SOME_STRING_VALUE'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/users/{user_id}/systemgroups\"\ + \n\nquerystring = {\"limit\":\"10\",\"skip\":\"0\"}\n\nheaders = {\n \ + \ \"x-org-id\": \"SOME_STRING_VALUE\",\n \"x-api-key\": \"REPLACE_KEY_VALUE\"\ + \n}\n\nresponse = requests.request(\"GET\", url, headers=headers, params=querystring)\n\ + \nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-org-id\", \"SOME_STRING_VALUE\")\n\ + $headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n$response = Invoke-RestMethod\ + \ -Uri 'https://console.jumpcloud.com/api/v2/users/{user_id}/systemgroups?limit=10&skip=0'\ + \ -Method GET -Headers $headers" + /users/{user_id}/systems: + get: + tags: + - Graph + - Users + summary: List the Systems bound to a User + description: "This endpoint will return all Systems bound to a User, either\ + \ directly or indirectly, essentially traversing the JumpCloud Graph for your\ + \ Organization.\n\nEach element will contain the type, id, attributes and\ + \ paths.\n\nThe `attributes` object is a key/value hash of compiled graph\ + \ attributes for all paths followed.\n\nThe `paths` array enumerates each\ + \ path from this User to the corresponding System; this array represents all\ + \ grouping and/or associations that would have to be removed to deprovision\ + \ the System from this User.\n\nSee `/members` and `/associations` endpoints\ + \ to manage those collections.\n\n#### Sample Request\n```\ncurl -X GET https://console.jumpcloud.com/api/v2/users/{UserID}/systems\\\ + \n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\ + \ \\\n -H 'x-api-key: {API_KEY}'\n```" + operationId: graph_userTraverseSystem + parameters: + - name: user_id + in: path + description: ObjectID of the User. + required: true + style: simple + explode: false + schema: + type: string + - name: limit + in: query + description: The number of records to return at once. Limited to 100. + required: false + style: form + explode: true + schema: + type: integer + default: 10 + - name: x-org-id + in: header + description: Organization identifier that can be obtained from console settings. + required: false + style: simple + explode: false + schema: + type: string + - name: skip + in: query + description: The offset into the records to return. + required: false + style: form + explode: true + schema: + minimum: 0 + type: integer + default: 0 + - name: filter + in: query + description: "A filter to apply to the query.\n\n**Filter structure**: `::`.\n\ + \n**field** = Populate with a valid field from an endpoint response.\n\n\ + **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between,\ + \ search, in.\n_Note: v1 operators differ from v2 operators._\n\n**value**\ + \ = Populate with the value you want to search for. Is case sensitive. Supports\ + \ wild cards.\n\n**EX:** `GET /api/v2/groups?filter=name:eq:Test+Group`" + required: false + style: form + explode: false + schema: + type: array + items: + type: string + responses: + "200": + description: OK + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/GraphObjectWithPaths' + x-content-type: application/json + security: + - x-api-key: [] + x-scopes: + - systems + - systems.readonly + x-codeSamples: + - lang: Shell + source: "curl --request GET \\\n --url 'https://console.jumpcloud.com/api/v2/users/{user_id}/systems?limit=10&skip=0'\ + \ \\\n --header 'x-api-key: REPLACE_KEY_VALUE' \\\n --header 'x-org-id:\ + \ SOME_STRING_VALUE'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/users/{user_id}/systems\"\ + \n\nquerystring = {\"limit\":\"10\",\"skip\":\"0\"}\n\nheaders = {\n \ + \ \"x-org-id\": \"SOME_STRING_VALUE\",\n \"x-api-key\": \"REPLACE_KEY_VALUE\"\ + \n}\n\nresponse = requests.request(\"GET\", url, headers=headers, params=querystring)\n\ + \nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-org-id\", \"SOME_STRING_VALUE\")\n\ + $headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n$response = Invoke-RestMethod\ + \ -Uri 'https://console.jumpcloud.com/api/v2/users/{user_id}/systems?limit=10&skip=0'\ + \ -Method GET -Headers $headers" + /workdays: + get: + tags: + - Workday Import + summary: List Workdays + description: "This endpoint will return all the available information about\ + \ all your instances of Workday.\n\n##### Sample Request\n```\ncurl -X GET\ + \ https://console.jumpcloud.com/api/v2/workdays/ \\\n -H 'Accept: application/json'\ + \ \\\n -H 'Content-Type: application/json' \\\n -H 'x-api-key: {API_KEY}'\n\ + \ ```" + operationId: workdays_list + parameters: + - name: fields + in: query + description: "The comma separated fields included in the returned records.\n\ + If omitted, the default list of fields will be returned.\n" + required: false + style: form + explode: false + schema: + type: array + items: + type: string + - name: limit + in: query + description: The number of records to return at once. Limited to 100. + required: false + style: form + explode: true + schema: + type: integer + default: 10 + - name: skip + in: query + description: The offset into the records to return. + required: false + style: form + explode: true + schema: + minimum: 0 + type: integer + default: 0 + - name: sort + in: query + description: "The comma separated fields used to sort the collection.\nDefault\ + \ sort is ascending, prefix with `-` to sort descending.\n" + required: false + style: form + explode: false + schema: + type: array + items: + type: string + - name: filter + in: query + description: "A filter to apply to the query.\n\n**Filter structure**: `::`.\n\ + \n**field** = Populate with a valid field from an endpoint response.\n\n\ + **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between,\ + \ search, in.\n_Note: v1 operators differ from v2 operators._\n\n**value**\ + \ = Populate with the value you want to search for. Is case sensitive. Supports\ + \ wild cards.\n\n**EX:** `GET /api/v2/groups?filter=name:eq:Test+Group`" + required: false + style: form + explode: false + schema: + type: array + items: + type: string + - name: x-org-id + in: header + description: Organization identifier that can be obtained from console settings. + required: false + style: simple + explode: false + schema: + type: string + responses: + "200": + description: "" + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/workday-output' + x-content-type: application/json + security: + - x-api-key: [] + x-scopes: + - directories + - directories.readonly + x-codeSamples: + - lang: Shell + source: "curl --request GET \\\n --url 'https://console.jumpcloud.com/api/v2/workdays?limit=10&skip=0'\ + \ \\\n --header 'x-api-key: REPLACE_KEY_VALUE' \\\n --header 'x-org-id:\ + \ SOME_STRING_VALUE'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/workdays\"\ + \n\nquerystring = {\"limit\":\"10\",\"skip\":\"0\"}\n\nheaders = {\n \ + \ \"x-org-id\": \"SOME_STRING_VALUE\",\n \"x-api-key\": \"REPLACE_KEY_VALUE\"\ + \n}\n\nresponse = requests.request(\"GET\", url, headers=headers, params=querystring)\n\ + \nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-org-id\", \"SOME_STRING_VALUE\")\n\ + $headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n$response = Invoke-RestMethod\ + \ -Uri 'https://console.jumpcloud.com/api/v2/workdays?limit=10&skip=0' -Method\ + \ GET -Headers $headers" + post: + tags: + - Workday Import + summary: Create new Workday + description: "This endpoint allows you to create a new workday instance.\n\n\ + You must supply a username and password for `Basic Authentication` that is\ + \ the same as your WorkDay Integrator System User. Failure to provide these\ + \ credentials will result in the request being rejected.\n\nCurrently `O-Auth`\ + \ isn't a supported authentication protocol for WorkDay, but will be in the\ + \ future.\n\nCurrently, only one instance is allowed and it must be `Workday\ + \ Import`.\n\n#### Sample Request\n```\ncurl -X POST https://console.jumpcloud.com/api/v2/workdays/\ + \ \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\ + \ \\\n -H 'x-api-key: {API_KEY}' \\\n -d '{\n \"name\": \"Workday2\"\ + ,\n \"reportUrl\":\"https://workday.com/ccx/service/customreport2/gms/user/reportname?format=json\"\ + ,\n \"auth\": {\n \"basic\": {\n \"username\": \"someDeveloper\"\ + ,\n \"password\": \"notTheRealPassword\"\n }\n }\n }'\n```" + operationId: workdays_post + parameters: + - name: x-org-id + in: header + description: Organization identifier that can be obtained from console settings. + required: false + style: simple + explode: false + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/workday-input' + required: false + responses: + "201": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/workday-output' + security: + - x-api-key: [] + x-scopes: + - directories + x-codeSamples: + - lang: Shell + source: "curl --request POST \\\n --url https://console.jumpcloud.com/api/v2/workdays\ + \ \\\n --header 'content-type: application/json' \\\n --header 'x-api-key:\ + \ REPLACE_KEY_VALUE' \\\n --header 'x-org-id: SOME_STRING_VALUE' \\\n \ + \ --data '{\"auth\":{\"basic\":{\"password\":\"in tempor ipsum quis\",\"\ + username\":\"mollit ex\"},\"oauth\":{\"code\":\"non laborum dolore\"}},\"\ + name\":\"dolore tempor\",\"reportUrl\":\"est sit laboris\"}'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/workdays\"\ + \n\npayload = {\n \"auth\": {\n \"basic\": {\n \"password\"\ + : \"in tempor ipsum quis\",\n \"username\": \"mollit ex\"\n \ + \ },\n \"oauth\": {\"code\": \"non laborum dolore\"}\n },\n\ + \ \"name\": \"dolore tempor\",\n \"reportUrl\": \"est sit laboris\"\ + \n}\nheaders = {\n \"x-org-id\": \"SOME_STRING_VALUE\",\n \"x-api-key\"\ + : \"REPLACE_KEY_VALUE\",\n \"content-type\": \"application/json\"\n}\n\ + \nresponse = requests.request(\"POST\", url, json=payload, headers=headers)\n\ + \nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-org-id\", \"SOME_STRING_VALUE\")\n\ + $headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n$headers.Add(\"content-type\"\ + , \"application/json\")\n$response = Invoke-RestMethod -Uri 'https://console.jumpcloud.com/api/v2/workdays'\ + \ -Method POST -Headers $headers -ContentType 'application/json' -Body '{\"\ + auth\":{\"basic\":{\"password\":\"in tempor ipsum quis\",\"username\":\"\ + mollit ex\"},\"oauth\":{\"code\":\"non laborum dolore\"}},\"name\":\"dolore\ + \ tempor\",\"reportUrl\":\"est sit laboris\"}'" + x-codegen-request-body-name: body + /workdays/{id}: + get: + tags: + - Workday Import + summary: Get Workday + description: "This endpoint will return all the available information about\ + \ an instance of Workday.\n\n#### Sample Request\n\n```\ncurl -X GET https://console.jumpcloud.com/api/v2/workdays/\ + \ \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\ + \ \\\n -H 'x-api-key: {API_KEY}'\n ```" + operationId: workdays_get + parameters: + - name: id + in: path + required: true + style: simple + explode: false + schema: + type: string + - name: x-org-id + in: header + description: Organization identifier that can be obtained from console settings. + required: false + style: simple + explode: false + schema: + type: string + responses: + "200": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/workday-output' + security: + - x-api-key: [] + x-scopes: + - directories + - directories.readonly + x-codeSamples: + - lang: Shell + source: "curl --request GET \\\n --url https://console.jumpcloud.com/api/v2/workdays/{id}\ + \ \\\n --header 'x-api-key: REPLACE_KEY_VALUE' \\\n --header 'x-org-id:\ + \ SOME_STRING_VALUE'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/workdays/{id}\"\ + \n\nheaders = {\n \"x-org-id\": \"SOME_STRING_VALUE\",\n \"x-api-key\"\ + : \"REPLACE_KEY_VALUE\"\n}\n\nresponse = requests.request(\"GET\", url,\ + \ headers=headers)\n\nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-org-id\", \"SOME_STRING_VALUE\")\n\ + $headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n$response = Invoke-RestMethod\ + \ -Uri 'https://console.jumpcloud.com/api/v2/workdays/{id}' -Method GET\ + \ -Headers $headers" + put: + tags: + - Workday Import + summary: Update Workday + description: "This endpoint allows you to update the name and Custom Report\ + \ URL for a Workday Instance.\n\nCurrently, the name can not be changed from\ + \ the default of `Workday Import`.\n\n##### Sample Request\n```\ncurl -X PUT\ + \ https://console.jumpcloud.com/api/v2/workdays/{WorkdayID} \\\n -H 'Accept:\ + \ application/json' \\\n -H 'Content-Type: application/json' \\\n -H 'x-api-key:\ + \ {API_KEY}' \\\n -d '{\n\t\"reportUrl\":\"{Report_URL}\",\n\t\"name\":\"\ + {Name}\"\n}\t'\n```" + operationId: workdays_put + parameters: + - name: id + in: path + required: true + style: simple + explode: false + schema: + type: string + - name: x-org-id + in: header + description: Organization identifier that can be obtained from console settings. + required: false + style: simple + explode: false + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/workday-fields' + required: false + responses: + "200": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/workday-output' + security: + - x-api-key: [] + x-scopes: + - directories + x-codeSamples: + - lang: Shell + source: "curl --request PUT \\\n --url https://console.jumpcloud.com/api/v2/workdays/{id}\ + \ \\\n --header 'content-type: application/json' \\\n --header 'x-api-key:\ + \ REPLACE_KEY_VALUE' \\\n --header 'x-org-id: SOME_STRING_VALUE' \\\n \ + \ --data '{\"name\":\"string\",\"reportUrl\":\"string\"}'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/workdays/{id}\"\ + \n\npayload = {\n \"name\": \"string\",\n \"reportUrl\": \"string\"\ + \n}\nheaders = {\n \"x-org-id\": \"SOME_STRING_VALUE\",\n \"x-api-key\"\ + : \"REPLACE_KEY_VALUE\",\n \"content-type\": \"application/json\"\n}\n\ + \nresponse = requests.request(\"PUT\", url, json=payload, headers=headers)\n\ + \nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-org-id\", \"SOME_STRING_VALUE\")\n\ + $headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n$headers.Add(\"content-type\"\ + , \"application/json\")\n$response = Invoke-RestMethod -Uri 'https://console.jumpcloud.com/api/v2/workdays/{id}'\ + \ -Method PUT -Headers $headers -ContentType 'application/json' -Body '{\"\ + name\":\"string\",\"reportUrl\":\"string\"}'" + x-codegen-request-body-name: body + /workdays/{id}/import/{job_id}/results: + get: + tags: + - Workday Import + summary: List Import Results + description: "This endpoint provides a list of job results from the workday\ + \ import and will contain all imported data from Workday.\n\n#### Sample Request\n\ + ```\ncurl -X GET https://console.jumpcloud.com/api/v2/workdays/{WorkdayID}/import/{ImportJobID}/results\ + \ \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\ + \ \\\n -H 'x-api-key: {API_KEY}'\n```" + operationId: workdays_importresults + parameters: + - name: id + in: path + required: true + style: simple + explode: false + schema: + type: string + - name: job_id + in: path + required: true + style: simple + explode: false + schema: + type: string + - name: limit + in: query + description: The number of records to return at once. Limited to 100. + required: false + style: form + explode: true + schema: + type: integer + default: 10 + - name: skip + in: query + description: The offset into the records to return. + required: false + style: form + explode: true + schema: + minimum: 0 + type: integer + default: 0 + - name: x-org-id + in: header + description: Organization identifier that can be obtained from console settings. + required: false + style: simple + explode: false + schema: + type: string + responses: + "200": + description: "" + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/job-workresult' + x-content-type: application/json + security: + - x-api-key: [] + x-scopes: + - directories + - directories.readonly + x-codeSamples: + - lang: Shell + source: "curl --request GET \\\n --url 'https://console.jumpcloud.com/api/v2/workdays/{id}/import/{job_id}/results?limit=10&skip=0'\ + \ \\\n --header 'x-api-key: REPLACE_KEY_VALUE' \\\n --header 'x-org-id:\ + \ SOME_STRING_VALUE'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/workdays/{id}/import/{job_id}/results\"\ + \n\nquerystring = {\"limit\":\"10\",\"skip\":\"0\"}\n\nheaders = {\n \ + \ \"x-org-id\": \"SOME_STRING_VALUE\",\n \"x-api-key\": \"REPLACE_KEY_VALUE\"\ + \n}\n\nresponse = requests.request(\"GET\", url, headers=headers, params=querystring)\n\ + \nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-org-id\", \"SOME_STRING_VALUE\")\n\ + $headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n$response = Invoke-RestMethod\ + \ -Uri 'https://console.jumpcloud.com/api/v2/workdays/{id}/import/{job_id}/results?limit=10&skip=0'\ + \ -Method GET -Headers $headers" + /workdays/{workday_id}/auth: + post: + tags: + - Workday Import + summary: Authorize Workday + description: "This endpoint adds an authorization method to a workday instance.\n\ + \nYou must supply a username and password for `Basic Authentication` that\ + \ is the same as your WorkDay Integrator System User. Failure to provide\ + \ these credentials will result in the request being rejected.\n\nCurrently\ + \ `O-Auth` isn't a supported authentication protocol for WorkDay, but will\ + \ be in the future.\n\n#### Sample Request\n\n```\ncurl -X POST https://console.jumpcloud.com/api/v2/workdays/{WorkDayID}/auth\ + \ \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\ + \ \\\n -H 'x-api-key: {API_KEY}' \\\n -d '{\n\t\"auth\":{\n\t \"basic\"\ + : {\n\t\t\"username\": \"someDeveloper\",\t \n\t\t\"password\": \"notTheRealPassword\"\ + \n\n\t }\n\t}\n}'\n\n```" + operationId: workdays_authorize + parameters: + - name: workday_id + in: path + required: true + style: simple + explode: false + schema: + type: string + - name: x-org-id + in: header + description: Organization identifier that can be obtained from console settings. + required: false + style: simple + explode: false + schema: + type: string + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/auth-input-object' + required: false + responses: + "204": + description: "" + content: {} + security: + - x-api-key: [] + x-scopes: + - directories + x-codeSamples: + - lang: Shell + source: "curl --request POST \\\n --url https://console.jumpcloud.com/api/v2/workdays/{workday_id}/auth\ + \ \\\n --header 'content-type: application/json' \\\n --header 'x-api-key:\ + \ REPLACE_KEY_VALUE' \\\n --header 'x-org-id: SOME_STRING_VALUE' \\\n \ + \ --data '{\"auth\":{\"basic\":{\"password\":\"mollit cillum\",\"username\"\ + :\"veniam dolore\"},\"oauth\":{\"code\":\"minim ad ea dolor\"}}}'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/workdays/{workday_id}/auth\"\ + \n\npayload = {\"auth\": {\n \"basic\": {\n \"password\"\ + : \"mollit cillum\",\n \"username\": \"veniam dolore\"\n \ + \ },\n \"oauth\": {\"code\": \"minim ad ea dolor\"}\n }}\n\ + headers = {\n \"x-org-id\": \"SOME_STRING_VALUE\",\n \"x-api-key\"\ + : \"REPLACE_KEY_VALUE\",\n \"content-type\": \"application/json\"\n}\n\ + \nresponse = requests.request(\"POST\", url, json=payload, headers=headers)\n\ + \nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-org-id\", \"SOME_STRING_VALUE\")\n\ + $headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n$headers.Add(\"content-type\"\ + , \"application/json\")\n$response = Invoke-RestMethod -Uri 'https://console.jumpcloud.com/api/v2/workdays/{workday_id}/auth'\ + \ -Method POST -Headers $headers -ContentType 'application/json' -Body '{\"\ + auth\":{\"basic\":{\"password\":\"mollit cillum\",\"username\":\"veniam\ + \ dolore\"},\"oauth\":{\"code\":\"minim ad ea dolor\"}}}'" + x-codegen-request-body-name: body + delete: + tags: + - Workday Import + summary: Deauthorize Workday + description: "Removes any and all authorization methods from the workday instance\n\ + \n##### Sample Request\n```\ncurl -X DELETE https://console.jumpcloud.com/api/v2/workdays/{WorkDayID}/auth\ + \ \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\ + \ \\\n -H 'x-api-key: {API_KEY}'\n```" + operationId: workdays_deauthorize + parameters: + - name: workday_id + in: path + required: true + style: simple + explode: false + schema: + type: string + - name: x-org-id + in: header + description: Organization identifier that can be obtained from console settings. + required: false + style: simple + explode: false + schema: + type: string + responses: + "204": + description: "" + content: {} + security: + - x-api-key: [] + x-scopes: + - directories + x-codeSamples: + - lang: Shell + source: "curl --request DELETE \\\n --url https://console.jumpcloud.com/api/v2/workdays/{workday_id}/auth\ + \ \\\n --header 'x-api-key: REPLACE_KEY_VALUE' \\\n --header 'x-org-id:\ + \ SOME_STRING_VALUE'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/workdays/{workday_id}/auth\"\ + \n\nheaders = {\n \"x-org-id\": \"SOME_STRING_VALUE\",\n \"x-api-key\"\ + : \"REPLACE_KEY_VALUE\"\n}\n\nresponse = requests.request(\"DELETE\", url,\ + \ headers=headers)\n\nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-org-id\", \"SOME_STRING_VALUE\")\n\ + $headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n$response = Invoke-RestMethod\ + \ -Uri 'https://console.jumpcloud.com/api/v2/workdays/{workday_id}/auth'\ + \ -Method DELETE -Headers $headers" + /workdays/{workday_id}/import: + post: + tags: + - Workday Import + summary: Workday Import + description: "The endpoint allows you to create a Workday Import request.\n\n\ + #### Sample Request \n```\ncurl -X POST https://console.jumpcloud.com/api/v2/workdays/{WorkdayID}/import\ + \ \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\ + \ \\\n -H 'x-api-key: {API_KEY}' \\\n -d '[\n\t{\n\t\t\"email\":\"{email}\"\ + ,\n\t\t\"firstname\":\"{firstname}\",\n\t\t\"lastname\":\"{firstname}\",\n\ + \t\t\"username\":\"{username}\",\n\t\t\"attributes\":[\n\t\t\t{\"name\":\"\ + EmployeeID\",\"value\":\"0000\"},\n\t\t\t{\"name\":\"WorkdayID\",\"value\"\ + :\"name.name\"}\n\t\t\t]\n\t\t\n\t}\n]\n```" + operationId: workdays_import + parameters: + - name: workday_id + in: path + required: true + style: simple + explode: false + schema: + type: string + - name: x-org-id + in: header + description: Organization identifier that can be obtained from console settings. + required: false + style: simple + explode: false + schema: + type: string + requestBody: + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/bulk-user-create' + required: false + responses: + "201": + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/job-id' + security: + - x-api-key: [] + x-scopes: + - users + x-codeSamples: + - lang: Shell + source: "curl --request POST \\\n --url https://console.jumpcloud.com/api/v2/workdays/{workday_id}/import\ + \ \\\n --header 'content-type: application/json' \\\n --header 'x-api-key:\ + \ REPLACE_KEY_VALUE' \\\n --header 'x-org-id: SOME_STRING_VALUE' \\\n \ + \ --data '[{\"attributes\":[{}],\"email\":\"string\",\"firstname\":\"string\"\ + ,\"lastname\":\"string\",\"username\":\"string\"}]'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/workdays/{workday_id}/import\"\ + \n\npayload = [\n {\n \"attributes\": [{}],\n \"email\"\ + : \"string\",\n \"firstname\": \"string\",\n \"lastname\"\ + : \"string\",\n \"username\": \"string\"\n }\n]\nheaders = {\n\ + \ \"x-org-id\": \"SOME_STRING_VALUE\",\n \"x-api-key\": \"REPLACE_KEY_VALUE\"\ + ,\n \"content-type\": \"application/json\"\n}\n\nresponse = requests.request(\"\ + POST\", url, json=payload, headers=headers)\n\nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-org-id\", \"SOME_STRING_VALUE\")\n\ + $headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n$headers.Add(\"content-type\"\ + , \"application/json\")\n$response = Invoke-RestMethod -Uri 'https://console.jumpcloud.com/api/v2/workdays/{workday_id}/import'\ + \ -Method POST -Headers $headers -ContentType 'application/json' -Body '[{\"\ + attributes\":[{}],\"email\":\"string\",\"firstname\":\"string\",\"lastname\"\ + :\"string\",\"username\":\"string\"}]'" + x-codegen-request-body-name: body + /workdays/{workday_id}/workers: + get: + tags: + - Workday Import + summary: List Workday Workers + description: "This endpoint will return all of the data in your WorkDay Custom\ + \ Report that has been associated with your WorkDay Instance in JumpCloud.\n\ + \n##### Sample Request\n\n```\ncurl -X GET https://console.jumpcloud.com/api/v2/workdays/{WorkDayID}/workers\ + \ \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\ + \ \\\n -H 'x-api-key: {API_KEY}'\n\n\n```" + operationId: workdays_workers + parameters: + - name: workday_id + in: path + required: true + style: simple + explode: false + schema: + type: string + - name: limit + in: query + description: The number of records to return at once. Limited to 100. + required: false + style: form + explode: true + schema: + type: integer + default: 10 + - name: skip + in: query + description: The offset into the records to return. + required: false + style: form + explode: true + schema: + minimum: 0 + type: integer + default: 0 + - name: sort + in: query + description: "The comma separated fields used to sort the collection.\nDefault\ + \ sort is ascending, prefix with `-` to sort descending.\n" + required: false + style: form + explode: false + schema: + type: array + items: + type: string + - name: x-org-id + in: header + description: Organization identifier that can be obtained from console settings. + required: false + style: simple + explode: false + schema: + type: string + responses: + "200": + description: "" + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/workday-worker' + x-content-type: application/json + example: + - lastName: sint dolore Excepteur ad + - attributes: {} + email: nostrud tempor anim ips + firstName: et ad + username: Excepteur culpa nulla aliqua + - attributes: {} + email: veniam ullamco + - {} + - lastName: do + security: + - x-api-key: [] + x-scopes: + - directories + - directories.readonly + x-codeSamples: + - lang: Shell + source: "curl --request GET \\\n --url 'https://console.jumpcloud.com/api/v2/workdays/{workday_id}/workers?limit=10&skip=0'\ + \ \\\n --header 'x-api-key: REPLACE_KEY_VALUE' \\\n --header 'x-org-id:\ + \ SOME_STRING_VALUE'" + - lang: Python + source: "import requests\n\nurl = \"https://console.jumpcloud.com/api/v2/workdays/{workday_id}/workers\"\ + \n\nquerystring = {\"limit\":\"10\",\"skip\":\"0\"}\n\nheaders = {\n \ + \ \"x-org-id\": \"SOME_STRING_VALUE\",\n \"x-api-key\": \"REPLACE_KEY_VALUE\"\ + \n}\n\nresponse = requests.request(\"GET\", url, headers=headers, params=querystring)\n\ + \nprint(response.text)" + - lang: Powershell + source: "$headers=@{}\n$headers.Add(\"x-org-id\", \"SOME_STRING_VALUE\")\n\ + $headers.Add(\"x-api-key\", \"REPLACE_KEY_VALUE\")\n$response = Invoke-RestMethod\ + \ -Uri 'https://console.jumpcloud.com/api/v2/workdays/{workday_id}/workers?limit=10&skip=0'\ + \ -Method GET -Headers $headers" +components: + schemas: + ADE: + title: ADE + type: object + properties: + defaultDeviceGroupObjectIds: + type: array + description: "An array of ObjectIDs identifying the default device groups\ + \ for this specific type (based on the OS family) of automated device\ + \ enrollment. Currently, only a single DeviceGroupID is supported." + nullable: true + items: + type: string + enableZeroTouchEnrollment: + type: boolean + description: A toggle to determine if ADE registered devices should go through + JumpCloud Zero Touch Enrollment. + setupAssistantOptions: + type: array + items: + $ref: '#/components/schemas/DEPSetupAssistantOption' + welcomeScreen: + $ref: '#/components/schemas/DEPWelcomeScreen' + example: + setupAssistantOptions: + - option: accessibility + - option: accessibility + welcomeScreen: + button: button + paragraph: paragraph + title: title + enableZeroTouchEnrollment: true + defaultDeviceGroupObjectIds: + - defaultDeviceGroupObjectIds + - defaultDeviceGroupObjectIds + ADES: + title: ADES + type: object + properties: + ios: + $ref: '#/components/schemas/ADE' + macos: + $ref: '#/components/schemas/ADE' + example: + ios: + setupAssistantOptions: + - option: accessibility + - option: accessibility + welcomeScreen: + button: button + paragraph: paragraph + title: title + enableZeroTouchEnrollment: true + defaultDeviceGroupObjectIds: + - defaultDeviceGroupObjectIds + - defaultDeviceGroupObjectIds + macos: null + Address: + type: object + properties: + country: + maxLength: 1024 + type: string + extendedAddress: + maxLength: 1024 + type: string + id: + type: string + locality: + maxLength: 1024 + type: string + poBox: + maxLength: 1024 + type: string + postalCode: + maxLength: 1024 + type: string + region: + maxLength: 1024 + type: string + streetAddress: + maxLength: 1024 + type: string + type: + maxLength: 1024 + type: string + example: + country: country + poBox: poBox + streetAddress: streetAddress + postalCode: postalCode + locality: locality + id: id + extendedAddress: extendedAddress + region: region + type: type + Administrator: + title: Administrator + type: object + properties: + email: + type: string + enableMultiFactor: + type: boolean + firstname: + type: string + id: + type: string + lastname: + type: string + organizationAccessTotal: + type: number + registered: + type: boolean + role: + type: string + roleName: + type: string + suspended: + type: boolean + example: + email: joe@example.com + enableMultiFactor: true + firstname: Joe + id: 0123456789abcdef01234567 + lastname: Blough + registered: false + AdministratorOrganizationLink: + title: AdministratorOrganizationLink + type: object + properties: + administrator: + type: string + description: The identifier for an administrator + organization: + type: string + description: The identifier for an organization + example: + administrator: 6230a0c233a6cbea7c470398 + organization: 6230a0d26a4e4bc86c6b36f1 + AdministratorOrganizationLinkReq: + title: AdministratorOrganizationLinkReq + type: object + properties: + organization: + type: string + description: The identifier for an organization to link this administrator + to. + example: + organization: 6230a0d26a4e4bc86c6b36f1 + AnyValue: + type: object + description: "Can be any value - string, number, boolean, array or object." + AppleMDM: + title: AppleMDM + required: + - id + type: object + properties: + ades: + $ref: '#/components/schemas/ADES' + allowMobileUserEnrollment: + type: boolean + description: A toggle to allow mobile device enrollment for an organization. + apnsCertExpiry: + type: string + description: The expiration date and time for the APNS Certificate. + apnsPushTopic: + type: string + description: The push topic assigned to this enrollment by Apple after uploading + the Signed CSR plist. + defaultIosUserEnrollmentDeviceGroupID: + type: string + description: ObjectId uniquely identifying the MDM default iOS user enrollment + device group. + defaultSystemGroupID: + type: string + description: ObjectId uniquely identifying the MDM default System Group. + x-deprecated: true + dep: + $ref: '#/components/schemas/DEP' + depAccessTokenExpiry: + type: string + description: The expiration date and time for the DEP Access Token. This + aligns with the DEP Server Token State. + depServerTokenState: + type: string + description: "The state of the dep server token, presence and expiry." + enum: + - unknown + - missing + - valid + - expired + id: + type: string + description: "ObjectId uniquely identifying an MDM Enrollment," + name: + maxLength: 255 + type: string + description: A friendly name to identify this enrollment. Not required + to be unique. + example: + defaultIosUserEnrollmentDeviceGroupID: defaultIosUserEnrollmentDeviceGroupID + apnsPushTopic: apnsPushTopic + apnsCertExpiry: apnsCertExpiry + name: name + defaultSystemGroupID: defaultSystemGroupID + depAccessTokenExpiry: depAccessTokenExpiry + allowMobileUserEnrollment: true + id: id + ades: + ios: + setupAssistantOptions: + - option: accessibility + - option: accessibility + welcomeScreen: + button: button + paragraph: paragraph + title: title + enableZeroTouchEnrollment: true + defaultDeviceGroupObjectIds: + - defaultDeviceGroupObjectIds + - defaultDeviceGroupObjectIds + macos: null + dep: + setupAssistantOptions: + - null + - null + welcomeScreen: null + enableZeroTouchEnrollment: true + depServerTokenState: unknown + AuthnPolicy: + title: AuthnPolicy + type: object + properties: + conditions: + type: object + properties: {} + example: {} + description: + type: string + disabled: + type: boolean + effect: + $ref: '#/components/schemas/AuthnPolicyEffect' + id: + type: string + name: + type: string + targets: + $ref: '#/components/schemas/AuthnPolicyTargets' + type: + $ref: '#/components/schemas/AuthnPolicyType' + description: "This represents an authentication policy. See the details of\ + \ each field for valid values and restrictions.\n\nConditions may be added\ + \ to an authentication policy using the following conditional language:\n\n\ + ```\n ::= \n ::= | \ + \ | | | | \n\ + \ ::= { \"ipAddressIn\": [ , ... ] }\n ::= { \"deviceManaged\"\ + : }\n ::= { \"locationIn\": { \"countries\": [ ,\ + \ ... ] } }\n ::= { \"not\": }\n\ + \ ::= { \"all\": [ , ... ] }\n ::= { \"any\": [\ + \ , ... ] }\n```\n\nFor example, to add a condition that applies\ + \ to IP address in a given list the following condition can be added:\n\n\ + `{\"ipAddressIn\": [ ]}`\n\nIf you would rather exclude\ + \ IP addresses in the given lists, the following condition could be added:\n\ + \n`{\n \"not\": {\n \"ipAddressIn\": [ , \ + \ ]\n }\n}`\n\nYou may also include more than one condition and choose whether\ + \ \"all\" or \"any\" of them must be met for the policy to apply.\n\n`{\n\ + \ \"all\": [\n {\n \"ipAddressIn\": [ , ... ]\n\ + \ },\n {\n \"deviceManaged\": true\n },\n {\n \"locationIn\"\ + : {\n countries: [ , ... ]\n }\n }\n\ + \ ]\n}`" + example: + effect: + obligations: + userVerification: + requirement: none + mfa: + required: true + action: allow + name: name + description: description + disabled: true + id: id + conditions: {} + type: user_portal + targets: + userGroups: + exclusions: + - exclusions + - exclusions + inclusions: + - inclusions + - inclusions + userAttributes: + exclusions: + - field: field + value: {} + operator: EQ + - field: field + value: {} + operator: EQ + inclusions: + - null + - null + resources: + - id: id + type: user_portal + - id: id + type: user_portal + users: + inclusions: + - inclusions + - inclusions + AuthnPolicyEffect: + title: AuthnPolicyEffect + required: + - action + type: object + properties: + action: + type: string + enum: + - allow + - deny + - unknown + obligations: + $ref: '#/components/schemas/AuthnPolicyObligations' + example: + obligations: + userVerification: + requirement: none + mfa: + required: true + action: allow + x-examples: + example-allow: + action: allow + example-allow-with-mfa: + action: allow + obligations: + mfa: + required: true + example-deny: + action: deny + AuthnPolicyInput: + title: AuthnPolicyInput + type: object + properties: + conditions: + type: object + properties: {} + description: + type: string + disabled: + type: boolean + effect: + $ref: '#/components/schemas/AuthnPolicyEffect' + name: + type: string + targets: + $ref: '#/components/schemas/AuthnPolicyTargets' + type: + $ref: '#/components/schemas/AuthnPolicyType' + AuthnPolicyObligations: + title: AuthnPolicyObligations + type: object + properties: + mfa: + $ref: '#/components/schemas/AuthnPolicyObligations_mfa' + userVerification: + $ref: '#/components/schemas/AuthnPolicyObligations_userVerification' + example: + userVerification: + requirement: none + mfa: + required: true + AuthnPolicyResourceTarget: + title: AuthnPolicyResourceTarget + required: + - type + type: object + properties: + id: + type: string + description: "Object ID of the resource target. If undefined, then all resources\ + \ of the given type are targeted." + type: + type: string + enum: + - user_portal + - application + - ldap + example: + id: id + type: user_portal + AuthnPolicyTargets: + title: AuthnPolicyTargets + type: object + properties: + resources: + type: array + items: + $ref: '#/components/schemas/AuthnPolicyResourceTarget' + userAttributes: + $ref: '#/components/schemas/AuthnPolicyUserAttributeTarget' + userGroups: + $ref: '#/components/schemas/AuthnPolicyUserGroupTarget' + users: + $ref: '#/components/schemas/AuthnPolicyUserTarget' + example: + userGroups: + exclusions: + - exclusions + - exclusions + inclusions: + - inclusions + - inclusions + userAttributes: + exclusions: + - field: field + value: {} + operator: EQ + - field: field + value: {} + operator: EQ + inclusions: + - null + - null + resources: + - id: id + type: user_portal + - id: id + type: user_portal + users: + inclusions: + - inclusions + - inclusions + AuthnPolicyType: + title: AuthnPolicyType + type: string + default: user_portal + enum: + - user_portal + - application + - ldap + AuthnPolicyUserAttributeFilter: + title: AuthnPolicyUserAttributeFilter + type: object + properties: + field: + type: string + description: The only field that is currently supported is ldap_binding_user + operator: + type: string + enum: + - EQ + value: + $ref: '#/components/schemas/AnyValue' + example: + field: field + value: {} + operator: EQ + AuthnPolicyUserAttributeTarget: + title: AuthnPolicyUserAttributeTarget + type: object + properties: + exclusions: + type: array + items: + $ref: '#/components/schemas/AuthnPolicyUserAttributeFilter' + inclusions: + type: array + items: + $ref: '#/components/schemas/AuthnPolicyUserAttributeFilter' + description: User attribute targets are currently only supported for LDAP policies. + example: + exclusions: + - field: field + value: {} + operator: EQ + - field: field + value: {} + operator: EQ + inclusions: + - null + - null + AuthnPolicyUserGroupTarget: + title: AuthnPolicyUserGroupTarget + type: object + properties: + exclusions: + type: array + items: + type: string + inclusions: + type: array + items: + type: string + example: + exclusions: + - exclusions + - exclusions + inclusions: + - inclusions + - inclusions + AuthnPolicyUserTarget: + title: AuthnPolicyUserTarget + type: object + properties: + inclusions: + type: array + items: + type: string + example: + inclusions: + - inclusions + - inclusions + AutotaskCompany: + title: AutotaskCompany + required: + - id + - name + type: object + properties: + id: + type: string + description: The autotask company identifier. + name: + type: string + description: The autotask company name. + description: Autotask company details + example: + name: name + id: id + AutotaskCompanyResp: + title: AutotaskCompanyResp + required: + - records + - totalCount + type: object + properties: + records: + type: array + items: + $ref: '#/components/schemas/AutotaskCompany' + totalCount: + type: integer + description: Response for retrieving Autotask companies + example: + records: + - name: name + id: id + - name: name + id: id + totalCount: 0 + AutotaskCompanyTypeResp: + required: + - records + - totalCount + type: object + properties: + records: + type: array + items: + $ref: '#/components/schemas/BillingIntegrationCompanyType' + totalCount: + type: integer + description: Response for retrieving Autotask company types + example: + records: + - name: name + id: 0.8008281904610115 + - name: name + id: 0.8008281904610115 + totalCount: 6 + AutotaskContract: + title: AutotaskContract + required: + - companyId + - id + - name + type: object + properties: + companyId: + type: string + description: The Autotask company identifier linked to contract. + id: + type: string + description: The contract identifier. + name: + type: string + description: The contract name. + description: Autotask contract details + example: + companyId: companyId + name: name + id: id + AutotaskContractField: + title: AutotaskContractField + required: + - name + - values + type: object + properties: + name: + type: string + description: The contract field name. + values: + type: array + items: + $ref: '#/components/schemas/AutotaskContractField_values' + description: Autotask contract field details + example: + values: + - label: label + value: value + - label: label + value: value + name: name + AutotaskIntegration: + title: Get Autotask integration GET object + required: + - id + - username + type: object + properties: + id: + type: string + description: The identifier for this Autotask integration. + isMspAuthConfigured: + type: boolean + description: Has the msp-api been configured with auth data yet + username: + type: string + description: The username for connecting to Autotask. + description: Autotask integration configuration details + example: + isMspAuthConfigured: true + id: id + username: username + AutotaskIntegrationPatchReq: + title: Create Autotask Integration PATCH object + type: object + properties: + secret: + type: string + description: The secret for connecting to Autotask. + username: + type: string + description: The username for connecting to Autotask. + description: Request for updating a Autotask integration + AutotaskIntegrationReq: + title: Create Autotask Integration POST object + required: + - secret + - username + type: object + properties: + secret: + type: string + description: The secret for connecting to Autotask. + username: + type: string + description: The username for connecting to Autotask. + description: Request for creating a Autotask integration + AutotaskMappingRequest: + title: AutotaskMappingRequest + type: object + properties: + data: + type: array + items: + $ref: '#/components/schemas/AutotaskMappingRequest_data' + description: Request object for creating Autotask mappings + AutotaskMappingRequestCompany: + required: + - id + - name + type: object + properties: + id: + type: string + name: + type: string + AutotaskMappingRequestContract: + type: object + AutotaskMappingRequestOrganization: + required: + - id + - name + type: object + properties: + id: + minLength: 1 + type: string + name: + type: string + AutotaskMappingRequestService: + type: object + AutotaskMappingResponse: + title: AutotaskMappingResponse + type: object + properties: + company: + $ref: '#/components/schemas/AutotaskMappingResponseCompany' + contract: + $ref: '#/components/schemas/AutotaskMappingResponseContract' + lastSyncDateTime: + type: string + lastSyncStatus: + type: string + organization: + $ref: '#/components/schemas/AutotaskMappingResponseOrganization' + service: + $ref: '#/components/schemas/AutotaskMappingResponseService' + description: Autotask mapping GET response + example: + lastSyncDateTime: lastSyncDateTime + service: + name: name + id: id + nonBillableUsers: 0 + contract: + name: name + id: id + organization: + name: name + id: id + company: + name: name + id: id + lastSyncStatus: lastSyncStatus + AutotaskMappingResponseCompany: + type: object + properties: + id: + type: string + name: + type: string + example: + name: name + id: id + AutotaskMappingResponseContract: + type: object + properties: + id: + type: string + name: + type: string + example: + name: name + id: id + AutotaskMappingResponseOrganization: + type: object + properties: + id: + type: string + name: + type: string + example: + name: name + id: id + AutotaskMappingResponseService: + type: object + properties: + id: + type: string + name: + type: string + nonBillableUsers: + type: integer + example: + name: name + id: id + nonBillableUsers: 0 + AutotaskService: + title: AutotaskService + required: + - contractId + - id + - name + type: object + properties: + contractId: + type: string + description: The autotask contract identifier linked to this contract service. + id: + type: string + description: The contract service identifier. + name: + type: string + description: The autotask service name linked to this contract service. + description: Autotask contract service details + example: + contractId: contractId + name: name + id: id + AutotaskSettings: + title: Get Autotask integration settings GET object + type: object + properties: + automaticTicketing: + type: boolean + description: Determine whether Autotask uses automatic ticketing + companyTypeIds: + type: array + description: The array of Autotask companyType IDs applicable to the Provider. + items: + type: integer + description: Autotask integration settings + example: + automaticTicketing: true + companyTypeIds: + - 0 + - 0 + AutotaskSettingsPatchReq: + title: Update Autotask Integration's Settings PATCH object + type: object + properties: + automaticTicketing: + type: boolean + description: Determine whether Autotask uses automatic ticketing + companyTypeIds: + maxItems: 150 + type: array + description: The array of Autotask companyType IDs applicable to the Provider. + items: + type: integer + description: Request for updating a Autotask integration's settings + x-examples: + example-1: + automaticTicketing: true + companyTypeIds: + - 0 + - 1 + AutotaskTicketingAlertConfiguration: + type: object + properties: + category: + type: string + description: + type: string + destination: + type: string + enum: + - queue + - resource + displayName: + type: string + dueDays: + type: integer + id: + type: integer + priority: + $ref: '#/components/schemas/AutotaskTicketingAlertConfiguration_priority' + queue: + $ref: '#/components/schemas/AutotaskTicketingAlertConfiguration_priority' + resource: + $ref: '#/components/schemas/AutotaskTicketingAlertConfiguration_resource' + shouldCreateTickets: + type: boolean + source: + $ref: '#/components/schemas/AutotaskTicketingAlertConfiguration_priority' + status: + $ref: '#/components/schemas/AutotaskTicketingAlertConfiguration_priority' + description: "An AutotaskTicketingAlertConfiguration object requires a queueId\ + \ if the destination is queue. If the destination is resource, resource.id\ + \ and resource.role.id are required." + example: + resource: + role: null + name: name + id: 5 + displayName: displayName + shouldCreateTickets: true + destination: queue + description: description + id: 6 + source: null + category: category + priority: + name: name + id: 1 + dueDays: 0 + queue: null + status: null + AutotaskTicketingAlertConfigurationList: + required: + - records + type: object + properties: + records: + type: array + items: + type: object + allOf: + - type: object + properties: + alertId: + type: string + - $ref: '#/components/schemas/AutotaskTicketingAlertConfiguration' + example: + records: + - "" + - "" + AutotaskTicketingAlertConfigurationOption: + type: object + properties: + name: + type: string + values: + type: array + items: + $ref: '#/components/schemas/AutotaskTicketingAlertConfigurationOption_values' + example: + values: + - label: label + value: 0 + - label: label + value: 0 + name: name + AutotaskTicketingAlertConfigurationOptions: + type: object + properties: + options: + type: array + items: + $ref: '#/components/schemas/AutotaskTicketingAlertConfigurationOption' + resources: + type: array + items: + $ref: '#/components/schemas/AutotaskTicketingAlertConfigurationResource' + example: + options: + - values: + - label: label + value: 0 + - label: label + value: 0 + name: name + - values: + - label: label + value: 0 + - label: label + value: 0 + name: name + resources: + - roles: + - null + - null + name: name + id: 6 + - roles: + - null + - null + name: name + id: 6 + AutotaskTicketingAlertConfigurationRequest: + required: + - destination + - dueDays + - priority + - shouldCreateTickets + - status + type: object + properties: + destination: + type: string + enum: + - queue + - resource + dueDays: + type: integer + priority: + $ref: '#/components/schemas/AutotaskTicketingAlertConfiguration_priority' + queue: + $ref: '#/components/schemas/AutotaskTicketingAlertConfiguration_priority' + resource: + $ref: '#/components/schemas/AutotaskTicketingAlertConfiguration_resource' + shouldCreateTickets: + type: boolean + source: + $ref: '#/components/schemas/AutotaskTicketingAlertConfiguration_priority' + status: + $ref: '#/components/schemas/AutotaskTicketingAlertConfiguration_priority' + description: "An AutotaskTicketingAlertConfigurationRequest object requires\ + \ a queueId if the destination is queue. If the destination is resource, resource.id\ + \ and resource.role.id are required." + AutotaskTicketingAlertConfigurationResource: + type: object + properties: + id: + type: integer + name: + type: string + roles: + type: array + items: + $ref: '#/components/schemas/AutotaskTicketingAlertConfigurationOption_values' + example: + roles: + - null + - null + name: name + id: 6 + BillingIntegrationCompanyType: + required: + - id + - name + type: object + properties: + id: + type: number + description: The company type identifier. + name: + type: string + description: The company type name. + description: Billing Integration company type + example: + name: name + id: 0.8008281904610115 + CommandResultList: + title: CommandResultList + type: object + properties: + results: + type: array + items: + $ref: '#/components/schemas/CommandResultList_results' + totalCount: + type: integer + description: The total number of command results + description: List of command results + example: + totalCount: 1 + results: + - system: system + pendingCount: 6 + id: id + completedCount: 0 + command: command + - system: system + pendingCount: 6 + id: id + completedCount: 0 + command: command + ConnectWiseMappingRequest: + type: object + properties: + data: + type: array + items: + $ref: '#/components/schemas/ConnectWiseMappingRequest_data' + description: Request object for creating ConnectWise mappings + example: + data: + - agreement: {} + organization: + name: name + id: id + company: + name: name + id: id + delete: true + addition: {} + - agreement: {} + organization: + name: name + id: id + company: + name: name + id: id + delete: true + addition: {} + x-examples: + Create\Edit Existing Mapping example: + - addition: + id: string + name: string + agreement: + id: string + name: string + company: + id: string + name: string + organization: + id: newOrganizationId + name: string + - addition: + id: string + name: string + agreement: + id: string + name: string + company: + id: string + name: string + organization: + id: existingOrganizationId + name: string + Delete Mapping: + data: + - delete: true + organization: + id: orgId-1 + name: string + - delete: true + organization: + id: orgId-2 + name: string + - delete: true + organization: + id: orgId-3 + name: string + ConnectWiseMappingResponse: + title: ConnectWiseMappingResponse + type: object + properties: + addition: + $ref: '#/components/schemas/ConnectWiseMappingResponse_addition' + agreement: + $ref: '#/components/schemas/ConnectWiseMappingResponse_addition' + company: + $ref: '#/components/schemas/ConnectWiseMappingResponse_addition' + lastSyncDateTime: + type: string + lastSyncStatus: + type: string + organization: + $ref: '#/components/schemas/ConnectWiseMappingResponse_addition' + description: ConnectWise mapping GET response + example: + agreement: null + lastSyncDateTime: lastSyncDateTime + organization: null + company: null + lastSyncStatus: lastSyncStatus + addition: + name: name + id: id + ConnectWiseSettings: + title: Get ConnectWise integration settings GET object + type: object + properties: + automaticTicketing: + type: boolean + description: Determine whether ConnectWise uses automatic ticketing + companyTypeIds: + type: array + description: The array of ConnectWise companyType IDs applicable to the + Provider. + items: + type: integer + description: ConnectWise integration settings + example: + automaticTicketing: true + companyTypeIds: + - 0 + - 0 + ConnectWiseSettingsPatchReq: + title: Update ConnectWise Integration's Settings PATCH object + type: object + properties: + automaticTicketing: + type: boolean + description: Determine whether ConnectWise uses automatic ticketing + companyTypeIds: + maxItems: 150 + type: array + description: The array of ConnectWise companyType IDs applicable to the + Provider. + items: + type: integer + description: Request for updating a ConnectWise integration's settings + x-examples: + example-1: + automaticTicketing: true + companyTypeIds: + - 0 + - 1 + ConnectWiseTicketingAlertConfiguration: + required: + - shouldCreateTickets + type: object + properties: + category: + type: string + description: + type: string + displayName: + type: string + dueDays: + type: integer + id: + type: integer + priority: + $ref: '#/components/schemas/AutotaskTicketingAlertConfiguration_priority' + shouldCreateTickets: + type: boolean + source: + $ref: '#/components/schemas/AutotaskTicketingAlertConfiguration_priority' + example: + displayName: displayName + shouldCreateTickets: true + description: description + id: 6 + source: null + category: category + priority: + name: name + id: 1 + dueDays: 0 + ConnectWiseTicketingAlertConfigurationList: + required: + - records + type: object + properties: + records: + type: array + items: + type: object + allOf: + - type: object + properties: + alertId: + type: string + - $ref: '#/components/schemas/ConnectWiseTicketingAlertConfiguration' + example: + records: + - "" + - "" + ConnectWiseTicketingAlertConfigurationOption: + type: object + properties: + name: + type: string + values: + type: array + items: + $ref: '#/components/schemas/AutotaskTicketingAlertConfigurationOption_values' + example: + values: + - label: label + value: 0 + - label: label + value: 0 + name: name + ConnectWiseTicketingAlertConfigurationOptions: + required: + - records + type: object + properties: + records: + type: array + items: + $ref: '#/components/schemas/ConnectWiseTicketingAlertConfigurationOption' + example: + records: + - values: + - label: label + value: 0 + - label: label + value: 0 + name: name + - values: + - label: label + value: 0 + - label: label + value: 0 + name: name + ConnectWiseTicketingAlertConfigurationRequest: + required: + - shouldCreateTickets + type: object + properties: + dueDays: + type: integer + priority: + $ref: '#/components/schemas/AutotaskTicketingAlertConfiguration_priority' + shouldCreateTickets: + type: boolean + source: + $ref: '#/components/schemas/AutotaskTicketingAlertConfiguration_priority' + ConnectwiseAddition: + required: + - id + - name + type: object + properties: + id: + type: string + description: The addition identifier. + name: + type: string + description: The addition name. + description: Connectwise addition details + example: + name: name + id: id + ConnectwiseAgreement: + required: + - companyId + - id + - name + type: object + properties: + companyId: + type: string + description: The ConnectWise company identifier linked to agreement. + id: + type: string + description: The agreement identifier. + name: + type: string + description: The agreement name. + description: Connectwise agreement details + example: + companyId: companyId + name: name + id: id + ConnectwiseCompany: + required: + - id + - name + type: object + properties: + id: + type: string + description: The company identifier. + name: + type: string + description: The company name. + description: Connectwise company details + example: + name: name + id: id + ConnectwiseCompanyResp: + required: + - records + - totalCount + type: object + properties: + records: + type: array + items: + $ref: '#/components/schemas/ConnectwiseCompany' + totalCount: + type: integer + description: Response for retrieving ConnectWise companies + example: + records: + - name: name + id: id + - name: name + id: id + totalCount: 0 + ConnectwiseCompanyTypeResp: + required: + - records + - totalCount + type: object + properties: + records: + type: array + items: + $ref: '#/components/schemas/BillingIntegrationCompanyType' + totalCount: + type: integer + description: Response for retrieving ConnectWise company types + example: + records: + - name: name + id: 0.8008281904610115 + - name: name + id: 0.8008281904610115 + totalCount: 0 + ConnectwiseIntegration: + title: Get ConnectWise integration GET object + required: + - companyId + - id + - url + type: object + properties: + companyId: + type: string + description: The ConnectWise company identifier. + id: + type: string + description: The identifier for this ConnectWise integration. + isMspAuthConfigured: + type: boolean + description: Has the msp-api been configured with auth data yet + url: + type: string + description: The base url for connecting to ConnectWise. + description: ConnectWise integration configuration details + example: + companyId: companyId + isMspAuthConfigured: true + id: id + url: url + ConnectwiseIntegrationPatchReq: + title: Create ConnectWise Integration PATCH object + type: object + properties: + companyId: + type: string + description: The ConnectWise company identifier. + privateKey: + type: string + description: The ConnectWise private key for authentication + publicKey: + type: string + description: The ConnectWise public key for authentication. + url: + type: string + description: The base url for connecting to ConnectWise. + description: Request for updating a ConnectWise integration + ConnectwiseIntegrationReq: + title: Create ConnectWise Integration POST object + required: + - companyId + - privateKey + - publicKey + - url + type: object + properties: + companyId: + type: string + description: The ConnectWise company identifier. + privateKey: + type: string + description: The ConnectWise private key for authentication + publicKey: + type: string + description: The ConnectWise public key for authentication. + url: + type: string + description: The base url for connecting to ConnectWise. + description: Request for creating a ConnectWise integration + CustomEmail: + title: CustomEmail + required: + - subject + - type + type: object + properties: + body: + minLength: 0 + type: string + button: + minLength: 0 + type: string + header: + minLength: 0 + type: string + id: + type: string + readOnly: true + nextStepContactInfo: + minLength: 0 + type: string + subject: + minLength: 0 + type: string + title: + minLength: 0 + type: string + type: + $ref: '#/components/schemas/CustomEmailType' + description: Custom email content created by the admin user to personalize emails + sent to their system users. + example: + button: button + nextStepContactInfo: nextStepContactInfo + subject: subject + header: header + id: id + body: body + title: title + type: activate_gapps_user + CustomEmailTemplate: + title: CustomEmailTemplate + type: object + properties: + description: + type: string + displayName: + type: string + fields: + type: array + items: + $ref: '#/components/schemas/CustomEmailTemplateField' + type: + $ref: '#/components/schemas/CustomEmailType' + example: + displayName: displayName + description: description + fields: + - field: field + defaultValue: defaultValue + displayName: displayName + multiline: true + - field: field + defaultValue: defaultValue + displayName: displayName + multiline: true + type: activate_gapps_user + CustomEmailTemplateField: + title: CustomEmailTemplateField + type: object + properties: + defaultValue: + type: string + displayName: + type: string + field: + type: string + multiline: + type: boolean + example: + field: field + defaultValue: defaultValue + displayName: displayName + multiline: true + CustomEmailType: + type: string + enum: + - activate_gapps_user + - activate_o365_user + - lockout_notice_user + - password_expiration + - password_expiration_warning + - password_reset_confirmation + - user_change_password + - activate_user_custom + DEP: + title: DEP + type: object + properties: + enableZeroTouchEnrollment: + type: boolean + description: A toggle to determine if DEP registered devices should go through + JumpCloud Zero Touch Enrollment. + setupAssistantOptions: + type: array + items: + $ref: '#/components/schemas/DEPSetupAssistantOption' + welcomeScreen: + $ref: '#/components/schemas/DEPWelcomeScreen' + example: + setupAssistantOptions: + - null + - null + welcomeScreen: null + enableZeroTouchEnrollment: true + x-deprecated: true + DEPSetupAssistantOption: + title: DEP Setup Assistant Option + type: object + properties: + option: + $ref: '#/components/schemas/SetupAssistantOption' + example: + option: accessibility + DEPWelcomeScreen: + title: DEPWelcomeScreen + type: object + properties: + button: + maxLength: 64 + type: string + description: Text to display on the button on the DEP Welcome Screen. + paragraph: + maxLength: 1024 + type: string + description: A message to display on the DEP Welcome Screen. + title: + maxLength: 255 + type: string + description: The title to display on the DEP Welcome Screen. + example: + button: button + paragraph: paragraph + title: title + x-examples: + defaults: + button: continue + paragraph: "In just a few steps, you will be working securely from your\ + \ Mac." + title: Welcome + Directory: + title: Directory + required: + - id + - name + - type + type: object + properties: + id: + type: string + description: The ObjectID of the directory. + name: + type: string + description: The name of the directory. + oAuthStatus: + type: object + properties: {} + description: the expiry and error status of the bearer token + example: {} + type: + type: string + description: The type of directory. + enum: + - active_directory + - g_suite + - ldap_server + - office_365 + - workday + description: "" + example: + oAuthStatus: {} + name: name + id: id + type: active_directory + DuoAccount: + title: DuoAccount + required: + - id + type: object + properties: + id: + type: string + description: object ID + name: + type: string + description: Duo application name. + example: + name: name + id: id + DuoApplication: + title: DuoApplication + required: + - apiHost + - id + - integrationKey + - name + type: object + properties: + apiHost: + type: string + id: + type: string + integrationKey: + type: string + name: + type: string + example: + apiHost: apiHost + name: name + id: id + integrationKey: integrationKey + DuoApplicationReq: + title: DuoApplicationReq + required: + - apiHost + - integrationKey + - name + - secretKey + type: object + properties: + apiHost: + type: string + integrationKey: + type: string + name: + type: string + secretKey: + type: string + DuoApplicationUpdateReq: + title: DuoApplicationUpdateReq + required: + - apiHost + - integrationKey + - name + type: object + properties: + apiHost: + type: string + integrationKey: + type: string + name: + type: string + secretKey: + type: string + Error: + title: Error + type: object + properties: + code: + type: integer + description: HTTP status code + format: int32 + message: + type: string + description: Error message + status: + type: string + description: HTTP status description + description: "" + x-examples: {} + ErrorDetails: + allOf: + - $ref: '#/components/schemas/Error' + - type: object + properties: + details: + type: array + description: "Describes a list of objects with more detailed information\ + \ of the given error. Each detail schema is according to one of the\ + \ messages defined in Google's API: https://github.com/googleapis/googleapis/blob/master/google/rpc/error_details.proto" + items: + type: object + properties: {} + description: Object according to Google's API. + Filter: + title: Filter + required: + - field + - operator + - value + type: object + properties: + field: + type: string + description: Name of field in filter target object. + operator: + type: string + description: Filter comparison operator. + enum: + - eq + - ne + - gt + - ge + - lt + - le + - between + - search + - in + value: + type: string + description: Filter comparison value. + description: Filter for a field. + FilterQuery: + description: Query using a sequence of field filters. + allOf: + - $ref: '#/components/schemas/Query' + - title: FilterQuery + type: object + properties: + filters: + type: array + items: + $ref: '#/components/schemas/Filter' + x-internal: false + GSuiteBuiltinTranslation: + title: G Suite BuiltIn Translation + type: string + description: | + Built-in translations for G Suite export: + * `user_home_addresses` - Translate all JumpCloud user addresses of type `home` to G Suite Directory user addresses of type `home` + * `user_work_addresses` - Translate all JumpCloud user addresses of type `work` to G Suite Directory user addresses of type `work` + * `user_other_addresses` - Translate all JumpCloud user addresses of type `other` to G Suite Directory user addresses of type `other` + * `user_home_phone_numbers` - Translate all JumpCloud user phoneNumbers of type `home` to G Suite Directory user phones of type `home` + * `user_mobile_phone_numbers` - Translate all JumpCloud user phoneNumbers of type `mobile` to G Suite Directory user phones of type `mobile` + * `user_other_phone_numbers` - Translate all JumpCloud user phoneNumbers of type `other` to G Suite Directory user phones of type `other` + * `user_work_phone_numbers` - Translate all JumpCloud user phoneNumbers of type `work` to G Suite Directory user phones of type `work` + * `user_work_fax_phone_numbers` - Translate all JumpCloud user phoneNumbers of type `work_fax` to G Suite Directory user phones of type `work_fax` + * `user_work_mobile_phone_numbers` - Translate all JumpCloud user phoneNumbers of type `work_mobile` to G Suite Directory user phones of type `work_mobile` + * `user_manager` - Translate JumpCloud user `manager` to G Suite Directory user `relations-manager` + * `user_primary_organization_cost_center` - Translate JumpCloud user `costCenter` to G Suite Directory user `costCenter` for `primary` organization + * `user_primary_organization_department` - Translate JumpCloud user `department` to G Suite Directory user `department` for `primary` organization + * `user_primary_organization_description` - Translate JumpCloud user `employeeType` to G Suite Directory user `description` for `primary` organization + * `user_primary_organization_employee_id` - Translate JumpCloud user `employeeIdentifier` to G Suite Directory user `externalIds` element of type `organization` + * `user_primary_organization_title` - Translate JumpCloud user `jobTitle` to G Suite Directory user `title` for `primary` organization + * `user_alternate_email` - Translate JumpCloud user `alternateEmail` to G Suite Directory user `emails` + enum: + - user_home_addresses + - user_work_addresses + - user_other_addresses + - user_home_phone_numbers + - user_mobile_phone_numbers + - user_other_phone_numbers + - user_work_phone_numbers + - user_work_fax_phone_numbers + - user_work_mobile_phone_numbers + - user_manager + - user_alternate_email + - user_primary_organization_cost_center + - user_primary_organization_department + - user_primary_organization_description + - user_primary_organization_employee_id + - user_primary_organization_title + GSuiteDirectionTranslation: + title: G Suite Direction translation + type: string + description: | + Direction identify if an attribute is going to be exported or imported from GSuite + * `Import`- The data will be imported from GSuite into the user modal + * `Export`- The data will be exported from the user modal to GSuite + default: export + enum: + - export + - import + GSuiteTranslationRule: + title: G Suite Translation Rule + type: object + properties: + builtIn: + $ref: '#/components/schemas/GSuiteBuiltinTranslation' + direction: + $ref: '#/components/schemas/GSuiteDirectionTranslation' + id: + type: string + description: ObjectId uniquely identifying a Translation Rule. + example: + builtIn: user_home_addresses + id: id + direction: export + GSuiteTranslationRuleRequest: + title: G Suite Translation Rule Request + type: object + properties: + builtIn: + $ref: '#/components/schemas/GSuiteBuiltinTranslation' + direction: + $ref: '#/components/schemas/GSuiteDirectionTranslation' + example: + builtIn: user_home_addresses + direction: export + GraphAttribute-LdapGroups: + title: GraphAttribute (LdapGroups) + type: object + properties: + ldapGroups: + type: array + items: + $ref: '#/components/schemas/LdapGroup' + description: List of LDAP groups to provision when this JumpCloud group is bound + to an LDAP instance. + GraphAttribute-PosixGroups: + title: GraphAttribute (PosixGroups) + type: object + properties: + posixGroups: + type: array + items: + $ref: '#/components/schemas/GraphAttributePosixGroups_posixGroups' + description: List of POSIX groups to provision when this JumpCloud group is + bound to a supported resource. + GraphAttribute-Radius: + title: GraphAttribute (Radius) + type: object + properties: + radius: + $ref: '#/components/schemas/GraphAttributeRadius_radius' + description: RADIUS reply attributes are returned in the Access-Accept messages + sent to endpoints that authenticate with JumpCloud RADIUS. + GraphAttribute-SambaEnabled: + title: GraphAttribute (SambaEnabled) + type: object + properties: + sambaEnabled: + type: boolean + description: Enabling Samba support allows for LDAP users to authenticate to + endpoints that require Samba attributes within the LDAP directory + GraphAttribute-Sudo: + title: GraphAttribute (Sudo) + type: object + properties: + sudo: + $ref: '#/components/schemas/GraphAttributeSudo_sudo' + description: Setting user access controls in order to grant administrator permissions + GraphAttributes: + title: GraphAttributes + type: object + description: The graph attributes. + GraphConnection: + title: GraphConnection + required: + - to + type: object + properties: + attributes: + $ref: '#/components/schemas/GraphAttributes' + from: + $ref: '#/components/schemas/GraphObject' + to: + $ref: '#/components/schemas/GraphObject' + description: Represents an edge between two graph objects. From can be omitted + if it is clear from context. + example: + attributes: {} + from: + attributes: null + id: id + type: type + to: null + GraphObject: + title: GraphObject + required: + - id + - type + type: object + properties: + attributes: + $ref: '#/components/schemas/GraphAttributes' + id: + type: string + description: The ObjectID of the graph object. + type: + type: string + description: The type of graph object. + example: + attributes: null + id: id + type: type + GraphObjectWithPaths: + title: GraphObjectWithPaths + required: + - id + - paths + - type + type: object + properties: + compiledAttributes: + $ref: '#/components/schemas/GraphAttributes' + id: + type: string + description: Object ID of this graph object. + paths: + type: array + description: A path through the graph between two graph objects. + items: + type: array + items: + $ref: '#/components/schemas/GraphConnection' + type: + $ref: '#/components/schemas/GraphType' + example: + paths: + - - attributes: {} + from: + attributes: null + id: id + type: type + to: null + - attributes: {} + from: + attributes: null + id: id + type: type + to: null + - - attributes: {} + from: + attributes: null + id: id + type: type + to: null + - attributes: {} + from: + attributes: null + id: id + type: type + to: null + id: id + type: active_directory + compiledAttributes: {} + GraphOperation: + title: GraphOperation + required: + - id + - op + type: object + properties: + id: + type: string + description: The ObjectID of graph object being added or removed as an association. + op: + type: string + description: How to modify the graph connection. + enum: + - add + - remove + - update + GraphOperation-ActiveDirectory: + title: GraphOperation (ActiveDirectory) + allOf: + - $ref: '#/components/schemas/GraphOperation' + - required: + - type + type: object + properties: + attributes: + $ref: '#/components/schemas/GraphAttributes' + type: + type: string + description: Targets which a "active_directory" can be associated to. + enum: + - user + - user_group + GraphOperation-Application: + title: GraphOperation (Application) + allOf: + - $ref: '#/components/schemas/GraphOperation' + - required: + - type + type: object + properties: + attributes: + $ref: '#/components/schemas/GraphAttributes' + type: + type: string + description: Targets which a "application" can be associated to. + enum: + - user + - user_group + GraphOperation-Command: + title: GraphOperation (Command) + allOf: + - $ref: '#/components/schemas/GraphOperation' + - required: + - type + type: object + properties: + attributes: + $ref: '#/components/schemas/GraphAttributes' + type: + type: string + description: Targets which a "command" can be associated to. + enum: + - system + - system_group + GraphOperation-GSuite: + title: GraphOperation (GSuite) + allOf: + - $ref: '#/components/schemas/GraphOperation' + - required: + - type + type: object + properties: + attributes: + $ref: '#/components/schemas/GraphAttributes' + type: + type: string + description: Targets which a "g_suite" can be associated to. + enum: + - user + - user_group + GraphOperation-LdapServer: + title: GraphOperation (LdapServer) + allOf: + - $ref: '#/components/schemas/GraphOperation' + - required: + - type + type: object + properties: + attributes: + $ref: '#/components/schemas/GraphAttributes' + type: + type: string + description: Targets which a "ldap_server" can be associated to. + enum: + - user + - user_group + GraphOperation-Office365: + title: GraphOperation (Office365) + allOf: + - $ref: '#/components/schemas/GraphOperation' + - required: + - type + type: object + properties: + attributes: + $ref: '#/components/schemas/GraphAttributes' + type: + type: string + description: Targets which a "office_365" can be associated to. + enum: + - user + - user_group + GraphOperation-Policy: + title: GraphOperation (Policy) + allOf: + - $ref: '#/components/schemas/GraphOperation' + - required: + - type + type: object + properties: + attributes: + $ref: '#/components/schemas/GraphAttributes' + type: + type: string + description: Targets which a "policy" can be associated to. + enum: + - system + - system_group + GraphOperation-PolicyGroup: + title: GraphOperation (PolicyGroup) + allOf: + - $ref: '#/components/schemas/GraphOperation' + - required: + - type + type: object + properties: + attributes: + $ref: '#/components/schemas/GraphAttributes' + type: + type: string + description: Targets which a "policy_group" can be associated to. + enum: + - system + - system_group + GraphOperation-PolicyGroup-Member: + title: GraphOperation (PolicyGroup-Member) + allOf: + - $ref: '#/components/schemas/GraphOperation' + - required: + - type + type: object + properties: + attributes: + $ref: '#/components/schemas/GraphAttributes' + type: + type: string + description: The member type. + enum: + - policy + GraphOperation-RadiusServer: + title: GraphOperation (RadiusServer) + allOf: + - $ref: '#/components/schemas/GraphOperation' + - required: + - type + type: object + properties: + attributes: + $ref: '#/components/schemas/GraphAttributes' + type: + type: string + description: Targets which a "radius_server" can be associated to. + enum: + - user + - user_group + GraphOperation-SoftwareApp: + title: GraphOperation (SoftwareApp) + allOf: + - $ref: '#/components/schemas/GraphOperation' + - required: + - type + type: object + properties: + attributes: + $ref: '#/components/schemas/GraphAttributes' + type: + type: string + description: Targets which a "software_app" can be associated to. + enum: + - system + - system_group + GraphOperation-System: + title: GraphOperation (System) + allOf: + - $ref: '#/components/schemas/GraphOperation' + - required: + - type + type: object + properties: + attributes: + type: object + allOf: + - $ref: '#/components/schemas/GraphAttributes' + - $ref: '#/components/schemas/GraphAttribute-Sudo' + type: + type: string + description: Targets which a "system" can be associated to. + enum: + - command + - policy + - policy_group + - user + - user_group + GraphOperation-SystemGroup: + title: GraphOperation (SystemGroup) + allOf: + - $ref: '#/components/schemas/GraphOperation' + - required: + - type + type: object + properties: + attributes: + $ref: '#/components/schemas/GraphAttributes' + type: + type: string + description: Targets which a "system_group" can be associated to. + enum: + - command + - policy + - policy_group + - user + - user_group + GraphOperation-SystemGroup-Member: + title: GraphOperation (SystemGroup-Member) + allOf: + - $ref: '#/components/schemas/GraphOperation' + - required: + - type + type: object + properties: + attributes: + $ref: '#/components/schemas/GraphAttributes' + type: + type: string + description: The member type. + enum: + - system + GraphOperation-User: + title: GraphOperation (User) + allOf: + - $ref: '#/components/schemas/GraphOperation' + - required: + - type + type: object + properties: + attributes: + type: object + allOf: + - $ref: '#/components/schemas/GraphAttributes' + - $ref: '#/components/schemas/GraphAttribute-Sudo' + type: + type: string + description: Targets which a "user" can be associated to. + enum: + - active_directory + - application + - g_suite + - ldap_server + - office_365 + - radius_server + - system + - system_group + GraphOperation-UserGroup: + title: GraphOperation (UserGroup) + allOf: + - $ref: '#/components/schemas/GraphOperation' + - required: + - type + type: object + properties: + attributes: + $ref: '#/components/schemas/GraphAttributes' + type: + type: string + description: Targets which a "user_group" can be associated to. + enum: + - active_directory + - application + - g_suite + - ldap_server + - office_365 + - radius_server + - system + - system_group + GraphOperation-UserGroup-Member: + title: GraphOperation (UserGroup-Member) + allOf: + - $ref: '#/components/schemas/GraphOperation' + - required: + - type + type: object + properties: + attributes: + $ref: '#/components/schemas/GraphAttributes' + type: + type: string + description: The member type. + enum: + - user + GraphType: + title: GraphType + type: string + description: A graph object type. + enum: + - active_directory + - application + - command + - g_suite + - ldap_server + - office_365 + - policy + - policy_group + - radius_server + - system + - system_group + - user + - user_group + Group: + title: Group + type: object + properties: + attributes: + $ref: '#/components/schemas/GraphAttributes' + description: + type: string + description: Description of a Group + email: + type: string + description: E-mail address associated with a Group + id: + type: string + description: ObjectId uniquely identifying a Group. + name: + type: string + description: Display name of a Group. + type: + $ref: '#/components/schemas/GroupType' + example: + name: name + description: description + attributes: {} + id: id + type: policy_group + email: email + GroupAttributes-UserGroup: + title: GroupAttributes (UserGroup) + description: The graph attributes for a UserGroup. + allOf: + - $ref: '#/components/schemas/GraphAttributes' + - $ref: '#/components/schemas/GraphAttribute-Sudo' + - $ref: '#/components/schemas/GraphAttribute-LdapGroups' + - $ref: '#/components/schemas/GraphAttribute-PosixGroups' + - $ref: '#/components/schemas/GraphAttribute-Radius' + - $ref: '#/components/schemas/GraphAttribute-SambaEnabled' + GroupType: + title: GroupType + type: string + description: The group type. + enum: + - policy_group + - system_group + - user_group + IPList: + title: IPList + type: object + properties: + description: + type: string + id: + type: string + ips: + type: array + items: + type: string + name: + type: string + example: + name: name + description: description + id: id + ips: + - ips + - ips + IPListRequest: + title: IPListRequest + type: object + properties: + description: + type: string + ips: + type: array + items: + type: string + name: + type: string + Integration: + title: Integration + type: object + properties: + integrationId: + type: string + description: Unique identifier for this integration + type: + $ref: '#/components/schemas/IntegrationType' + description: An integration. + example: + integrationId: integrationId + type: autotask + IntegrationSyncError: + required: + - errorType + - message + - orgId + - timestamp + type: object + properties: + errorType: + type: string + message: + type: string + orgId: + type: string + timestamp: + type: string + description: Integration sync error details + example: + errorType: errorType + message: message + orgId: orgId + timestamp: timestamp + IntegrationSyncErrorResp: + required: + - records + - totalCount + type: object + properties: + records: + type: array + items: + $ref: '#/components/schemas/IntegrationSyncError' + totalCount: + type: integer + description: Response for retrieving integrations sync errors + example: + records: + - errorType: errorType + message: message + orgId: orgId + timestamp: timestamp + - errorType: errorType + message: message + orgId: orgId + timestamp: timestamp + totalCount: 0 + IntegrationType: + title: IntegrationType + type: string + description: The type of integration. + enum: + - autotask + - connectwise + IntegrationsResponse: + title: IntegrationsResponse + type: object + properties: + records: + type: array + items: + $ref: '#/components/schemas/Integration' + totalCount: + type: integer + description: Response for retrieving integrations. + example: + records: + - integrationId: integrationId + type: autotask + - integrationId: integrationId + type: autotask + totalCount: 0 + LdapGroup: + title: Ldap Group + type: object + properties: + name: + type: string + description: An LDAP group object. + LdapServerAction: + title: LDAP Server Action + type: string + enum: + - disable + - remove + MemberSuggestion: + type: object + properties: + object: + $ref: '#/components/schemas/GraphObject' + op: + type: string + description: How to modify group membership. + enum: + - add + - remove + example: + op: add + object: + attributes: null + id: id + type: type + MemberSuggestionsPostResult: + type: object + properties: + suggestions_found: + type: array + items: + type: string + suggestions_not_found: + type: array + items: + type: string + OSRestriction: + type: object + properties: + appleRestrictions: + $ref: '#/components/schemas/OSRestriction_appleRestrictions' + deprecatedVersion: + type: string + description: The version of the OS in which the policy was deprecated + earliestVersion: + type: string + description: The earliest version of the OS in which the policy can be applied + osName: + type: string + description: The name of the OS in which this restriction applies + supportedEnrollmentTypes: + type: array + description: This field is deprecated and will be ignored. Use appleRestrictions.supportedEnrollmentTypes + instead + items: + type: string + enum: + - automated + - device + - user + x-deprecated: true + description: Contains OS properties to restrict the application of policies + to devices based on the device's OS + example: + with-apple-restrictions: + appleRestrictions: + requiresSupervision: false + supportedEnrollmentTypes: + - automated + - device + - user + deprecatedVersion: "16.2" + earliestVersion: "14.1" + osName: iPadOS + Office365BuiltinTranslation: + title: Office 365 BuiltIn Translation + type: string + description: |- + Built-in translations for Office 365 (Microsoft Graph) export: + * `user_alternate_email` - Translate `alternateEmail` field of JumpCloud user to `otherMails` field of Microsoft Graph `user` + * `user_business_phones` - Translate `number` field of first JumpCloud user `phoneNumber` of type `work` to `businessPhones` field of Microsoft Graph `user` + * `user_city` - Translate `locality` field of JumpCloud user address of type `work` to `city` field of Microsoft Graph user + * `user_country` - Translate `country` field of JumpCloud user address of type `work` to `country` field of Microsoft Graph `user` + * `user_department` - Translate `department` field of JumpCloud user to `department` field of Microsoft Graph `user` + * `user_job_title` - Translate `jobTitle` field of JumpCloud user to `jobTitle` field of Microsoft Graph `user` + * `user_manager` - Translate `manager` field of JumpCloud user to `manager` field of Microsoft Graph `user` + * `user_mobile_phone` - Translate `number` field of first JumpCloud user `phoneNumber` of type `mobile` to `mobilePhone` field of Microsoft Graph `user` + * `user_office_location` - Translate `location` field of JumpCloud user to `officeLocation` field of Microsoft Graph `user` + * `user_postal_code` - Translate `postalCode` field of JumpCloud user address of type `work` to `postalCode` field of Microsoft Graph `user` + * `user_principal_name_from_alternate_email` - Translate user `alternateEmail` field of Jumpcloud user to `userPrincipalName` field of Microsoft Graph `user` + * `user_state` - Translate `region` field of JumpCloud user address of type `work` to `state` field of Microsoft Graph `user` + * `user_street_address` - Translate `streetAddress` field of JumpCloud user address of type `work` to `streetAddress` field of Microsoft Graph user + enum: + - user_alternate_email + - user_business_phones + - user_city + - user_country + - user_department + - user_job_title + - user_manager + - user_mobile_phone + - user_office_location + - user_postal_code + - user_principal_name_from_alternate_email + - user_state + - user_street_address + Office365DirectionTranslation: + title: Office 365 Direction translation + type: string + description: | + Direction identify if a attribute is going to be exported or imported from Office365 + * `Export`- The data will exported from the user modal to Office365 + default: export + enum: + - export + Office365TranslationRule: + title: Office 365 Translation Rule + type: object + properties: + builtIn: + $ref: '#/components/schemas/Office365BuiltinTranslation' + direction: + $ref: '#/components/schemas/Office365DirectionTranslation' + id: + type: string + description: ObjectId uniquely identifying a Translation Rule. + example: + builtIn: user_alternate_email + id: id + direction: export + Office365TranslationRuleRequest: + title: Office 365 Translation Rule Request + type: object + properties: + builtIn: + $ref: '#/components/schemas/Office365BuiltinTranslation' + direction: + $ref: '#/components/schemas/Office365DirectionTranslation' + example: + builtIn: user_department + direction: export + Organization: + title: Organization + type: object + properties: + id: + type: string + maxSystemUsers: + type: integer + description: The maximum number of users allowed in this organization. Requires + organizations.billing scope to modify. + name: + type: string + example: + id: 624d9eae6849cf3b3f93dc56 + name: Acme Inc + OrganizationCase: + title: OrganizationCase + type: object + properties: + caseNumber: + type: string + date: + type: string + description: + type: string + label: + type: string + reporter: + type: string + reporterEmail: + type: string + status: + type: string + subject: + type: string + description: Details of an organization's case (support/feature request) + example: + date: date + caseNumber: caseNumber + subject: subject + description: description + reporter: reporter + label: label + reporterEmail: reporterEmail + status: status + OrganizationCasesResponse: + title: OrganizationCasesResponse + type: object + properties: + results: + type: array + items: + $ref: '#/components/schemas/OrganizationCase' + totalCount: + type: integer + description: Response for retrieving an organization's cases (support/feature + requests) + example: + totalCount: 0 + results: + - date: date + caseNumber: caseNumber + subject: subject + description: description + reporter: reporter + label: label + reporterEmail: reporterEmail + status: status + - date: date + caseNumber: caseNumber + subject: subject + description: description + reporter: reporter + label: label + reporterEmail: reporterEmail + status: status + PhoneNumber: + type: object + properties: + id: + type: string + number: + maxLength: 1024 + type: string + type: + maxLength: 1024 + type: string + example: + number: number + id: id + type: type + Policy: + title: Policy + type: object + properties: + id: + type: string + description: ObjectId uniquely identifying a Policy. + name: + type: string + description: The description for this specific Policy. + template: + $ref: '#/components/schemas/PolicyTemplate' + description: An instance of a policy template. + example: + template: + reference: reference + alert: alert + displayName: displayName + osMetaFamily: linux + name: name + description: description + id: id + osRestrictions: + - with-apple-restrictions: + appleRestrictions: + requiresSupervision: false + supportedEnrollmentTypes: + - automated + - device + - user + deprecatedVersion: "16.2" + earliestVersion: "14.1" + osName: iPadOS + - with-apple-restrictions: + appleRestrictions: + requiresSupervision: false + supportedEnrollmentTypes: + - automated + - device + - user + deprecatedVersion: "16.2" + earliestVersion: "14.1" + osName: iPadOS + state: state + activation: activation + behavior: behavior + deliveryTypes: + - agent + - agent + name: name + id: id + PolicyGroup: + title: PolicyGroup + type: object + properties: + attributes: + $ref: '#/components/schemas/GraphAttributes' + description: + type: string + description: Description of a Policy Group + email: + type: string + description: E-mail address associated with a Policy Group + id: + type: string + description: ObjectId uniquely identifying a Policy Group. + name: + type: string + description: Display name of a Policy Group. + type: + type: string + description: The type of the group; always 'policy' for a Policy Group. + enum: + - policy_group + example: + name: name + description: description + attributes: {} + id: id + type: policy_group + email: email + PolicyGroupData: + title: PolicyGroupData + required: + - name + type: object + properties: + name: + type: string + description: Display name of a Policy Group. + PolicyRequest: + title: PolicyRequest + required: + - name + type: object + properties: + name: + type: string + description: The description for this specific Policy. + template: + $ref: '#/components/schemas/PolicyRequest_template' + values: + type: array + items: + $ref: '#/components/schemas/PolicyValue' + description: An instance of a policy template. + PolicyResult: + title: PolicyResult + type: object + properties: + detail: + type: string + description: Details pertaining to the policy result. + endedAt: + type: string + description: The end of the policy application. + format: date-time + exitStatus: + type: integer + description: The 32-bit unsigned exit status from the applying the policy. + format: uint32 + id: + type: string + description: ObjectId uniquely identifying a Policy Result. + policyID: + type: string + description: ObjectId uniquely identifying the parent Policy. + startedAt: + type: string + description: The start of the policy application. + format: date-time + state: + type: string + description: "Enumeration describing the state of the policy. Success, failed,\ + \ or pending." + stdErr: + type: string + description: The STDERR output from applying the policy. + stdOut: + type: string + description: The STDOUT output from applying the policy. + success: + type: boolean + description: True if the policy was successfully applied; false otherwise. + systemID: + type: string + description: ObjectId uniquely identifying the parent System. + example: + systemID: systemID + policyID: policyID + stdOut: stdOut + endedAt: 2000-01-23T04:56:07.000+00:00 + success: true + startedAt: 2000-01-23T04:56:07.000+00:00 + detail: detail + id: id + state: state + stdErr: stdErr + exitStatus: 0 + PolicyTemplate: + title: PolicyTemplate + type: object + properties: + activation: + type: string + description: Requirements before the policy can be activated. + alert: + type: string + description: Text to describe any risk associated with this policy. + behavior: + type: string + description: Specifics about the behavior of the policy. + deliveryTypes: + type: array + description: The supported delivery mechanisms for this policy template. + items: + type: string + default: agent + enum: + - agent + - mdm + description: + type: string + description: The default description for the Policy. + displayName: + type: string + description: The default display name for the Policy. + id: + type: string + description: ObjectId uniquely identifying a Policy Template. + name: + type: string + description: The unique name for the Policy Template. + osMetaFamily: + type: string + enum: + - linux + - darwin + - windows + - ios + - universal + osRestrictions: + type: array + items: + $ref: '#/components/schemas/OSRestriction' + reference: + type: string + description: URL to visit for further information. + state: + type: string + description: String describing the release status of the policy template. + default: "" + description: The shallow information about a Policy Template. + example: + reference: reference + alert: alert + displayName: displayName + osMetaFamily: linux + name: name + description: description + id: id + osRestrictions: + - with-apple-restrictions: + appleRestrictions: + requiresSupervision: false + supportedEnrollmentTypes: + - automated + - device + - user + deprecatedVersion: "16.2" + earliestVersion: "14.1" + osName: iPadOS + - with-apple-restrictions: + appleRestrictions: + requiresSupervision: false + supportedEnrollmentTypes: + - automated + - device + - user + deprecatedVersion: "16.2" + earliestVersion: "14.1" + osName: iPadOS + state: state + activation: activation + behavior: behavior + deliveryTypes: + - agent + - agent + x-examples: + example-1: + activation: string + alert: string + behavior: string + deliveryTypes: + - agent + description: string + displayName: string + id: string + name: string + osMetaFamily: linux + osRestrictions: + - deprecatedVersion: string + earliestVersion: string + osName: string + supportedEnrollmentTypes: + - automated + reference: string + state: "" + PolicyTemplateConfigField: + title: PolicyTemplateConfigField + required: + - id + - name + type: object + properties: + defaultValue: + type: string + description: The default value for this field. + displayOptions: + type: object + properties: {} + description: The options that correspond to the display_type. + example: {} + displayType: + type: string + description: The default rendering for this field. + enum: + - checkbox + - date + - email + - file + - number + - select + - text + - textarea + - singlelistbox + - doublelistbox + - table + id: + type: string + description: ObjectId uniquely identifying a Policy Template Configuration + Field + label: + type: string + description: The default label for this field. + name: + type: string + description: A unique name identifying this config field. + position: + type: number + description: The default position to render this field. + readOnly: + type: boolean + description: If an admin is allowed to modify this field. + required: + type: boolean + description: If this field is required for this field. + sensitive: + type: boolean + description: Defines if the policy template config field is sensitive or + not. + tooltip: + $ref: '#/components/schemas/PolicyTemplateConfigField_tooltip' + example: + displayType: checkbox + defaultValue: defaultValue + name: name + tooltip: + template: template + variables: + icon: icon + message: message + readOnly: true + id: id + label: label + position: 0.8008281904610115 + sensitive: true + required: true + displayOptions: {} + PolicyTemplateWithDetails: + title: PolicyTemplateWithDetails + type: object + properties: + activation: + type: string + description: Requirements before the policy can be activated. + behavior: + type: string + description: Specifics about the behavior of the policy. + configFields: + type: array + description: An unordered list of all the fields that can be configured + for this Policy Template. + items: + $ref: '#/components/schemas/PolicyTemplateConfigField' + description: + type: string + description: The default description for the Policy. + displayName: + type: string + description: The default display name for the Policy. + id: + type: string + description: ObjectId uniquely identifying a Policy Template. + name: + type: string + description: The unique name for the Policy Template. + osMetaFamily: + type: string + enum: + - linux + - darwin + - windows + - ios + - universal + osRestrictions: + type: array + items: + $ref: '#/components/schemas/OSRestriction' + description: The shallow information about a Policy Template. + example: + displayName: displayName + osMetaFamily: linux + name: name + description: description + id: id + osRestrictions: + - with-apple-restrictions: + appleRestrictions: + requiresSupervision: false + supportedEnrollmentTypes: + - automated + - device + - user + deprecatedVersion: "16.2" + earliestVersion: "14.1" + osName: iPadOS + - with-apple-restrictions: + appleRestrictions: + requiresSupervision: false + supportedEnrollmentTypes: + - automated + - device + - user + deprecatedVersion: "16.2" + earliestVersion: "14.1" + osName: iPadOS + activation: activation + behavior: behavior + configFields: + - displayType: checkbox + defaultValue: defaultValue + name: name + tooltip: + template: template + variables: + icon: icon + message: message + readOnly: true + id: id + label: label + position: 0.8008281904610115 + sensitive: true + required: true + displayOptions: {} + - displayType: checkbox + defaultValue: defaultValue + name: name + tooltip: + template: template + variables: + icon: icon + message: message + readOnly: true + id: id + label: label + position: 0.8008281904610115 + sensitive: true + required: true + displayOptions: {} + PolicyValue: + title: PolicyValue + type: object + properties: + configFieldID: + type: string + description: The ObjectId of the corresponding Policy Template configuration + field. + sensitive: + type: boolean + description: Defines if the value is sensitive or not. + value: + type: string + description: The value for the configuration field for this Policy instance. + example: + configFieldID: configFieldID + sensitive: true + value: value + PolicyWithDetails: + title: PolicyWithDetails + type: object + properties: + configFields: + type: array + items: + $ref: '#/components/schemas/PolicyTemplateConfigField' + id: + type: string + description: ObjectId uniquely identifying a Policy. + name: + type: string + description: The description for this specific Policy. + template: + $ref: '#/components/schemas/PolicyTemplate' + values: + type: array + items: + $ref: '#/components/schemas/PolicyValue' + description: An instance of a policy template. + example: + template: + reference: reference + alert: alert + displayName: displayName + osMetaFamily: linux + name: name + description: description + id: id + osRestrictions: + - with-apple-restrictions: + appleRestrictions: + requiresSupervision: false + supportedEnrollmentTypes: + - automated + - device + - user + deprecatedVersion: "16.2" + earliestVersion: "14.1" + osName: iPadOS + - with-apple-restrictions: + appleRestrictions: + requiresSupervision: false + supportedEnrollmentTypes: + - automated + - device + - user + deprecatedVersion: "16.2" + earliestVersion: "14.1" + osName: iPadOS + state: state + activation: activation + behavior: behavior + deliveryTypes: + - agent + - agent + values: + - configFieldID: configFieldID + sensitive: true + value: value + - configFieldID: configFieldID + sensitive: true + value: value + name: name + id: id + configFields: + - displayType: checkbox + defaultValue: defaultValue + name: name + tooltip: + template: template + variables: + icon: icon + message: message + readOnly: true + id: id + label: label + position: 0.8008281904610115 + sensitive: true + required: true + displayOptions: {} + - displayType: checkbox + defaultValue: defaultValue + name: name + tooltip: + template: template + variables: + icon: icon + message: message + readOnly: true + id: id + label: label + position: 0.8008281904610115 + sensitive: true + required: true + displayOptions: {} + Provider: + type: object + properties: + disallowOrgCreation: + type: boolean + id: + type: string + example: + disallowOrgCreation: true + id: 5c3536e9e0a6840001872799 + ProviderAdminReq: + title: ProviderAdminReq + required: + - email + type: object + properties: + bindNoOrgs: + type: boolean + default: false + email: + type: string + enableMultiFactor: + type: boolean + firstname: + type: string + lastname: + type: string + role: + type: string + roleName: + type: string + example: + bindNoOrgs: false + email: joe@example.com + enableMultiFactor: true + firstname: Joe + lastname: Blough + role: 5c3536e9e0a6840001872799 + roleName: Administrator + ProviderInvoice: + title: ProviderInvoice + type: object + properties: + amountBilled: + type: string + amountPaid: + type: string + amountRemaining: + type: string + currency: + type: string + dueDate: + type: string + id: + type: string + status: + type: string + description: Details of a an invoice + example: + amountBilled: "200.0" + amountPaid: "10.9" + amountRemaining: "189.1" + currency: USD + dueDate: 2021-08-07 + id: "234324" + status: Partially Paid + ProviderInvoiceResponse: + title: ProviderInvoiceResponse + type: object + properties: + records: + type: array + items: + $ref: '#/components/schemas/ProviderInvoice' + totalCount: + type: integer + description: Response for retrieve provider invoices + example: + records: + - amountBilled: "200.0" + amountPaid: "10.9" + amountRemaining: "189.1" + currency: USD + dueDate: 2021-08-07 + id: "234324" + status: Partially Paid + - amountBilled: "200.0" + amountPaid: "10.9" + amountRemaining: "189.1" + currency: USD + dueDate: 2021-08-07 + id: "234324" + status: Partially Paid + totalCount: 0 + PushEndpointResponse: + title: PushEndpointResponse + type: object + properties: + device: + $ref: '#/components/schemas/PushEndpointResponse_device' + enrollmentDate: + type: string + format: date-time + id: + type: string + lastUsedDate: + type: string + format: date-time + name: + type: string + state: + type: string + description: A push endpoint response from the auth service. + example: + lastUsedDate: 2000-01-23T04:56:07.000+00:00 + enrollmentDate: 2000-01-23T04:56:07.000+00:00 + name: name + id: id + state: state + device: + appVersion: appVersion + os: os + osVersion: osVersion + uvEnabled: true + model: model + make: make + PwmAllUsers: + required: + - results + - totalCount + type: object + properties: + results: + type: array + items: + $ref: '#/components/schemas/PwmAllUsers_results' + totalCount: + type: integer + format: int32 + example: 50 + PwmOverviewAppVersions: + required: + - results + - totalCount + type: object + properties: + results: + type: array + items: + $ref: '#/components/schemas/PwmOverviewAppVersions_results' + totalCount: + type: integer + format: int32 + example: 50 + PwmOverviewMain: + required: + - devices + - pendingInvites + - sharedFolders + - totalUsers + type: object + properties: + devices: + type: array + items: + $ref: '#/components/schemas/PwmOverviewMain_devices' + pendingInvites: + type: integer + format: int32 + example: 50 + sharedFolders: + type: integer + format: int32 + example: 50 + totalUsers: + type: integer + format: int32 + example: 50 + Query: + title: Query + required: + - queryType + type: object + properties: + queryType: + type: string + enum: + - FilterQuery + description: Basic query. + discriminator: + propertyName: queryType + x-examples: + example-1: + queryType: FilterQuery + QueuedCommandList: + title: QueuedCommandList + type: object + properties: + results: + type: array + items: + $ref: '#/components/schemas/QueuedCommandList_results' + totalCount: + type: integer + description: The total number of queued command results. + description: List of queued commands + example: + totalCount: 6 + results: + - system: system + pendingCount: 0 + id: id + command: command + - system: system + pendingCount: 0 + id: id + command: command + SetupAssistantOption: + title: Setup Assistant Option + type: string + description: "Options to skip screens during MacOS and iOS setup:\n* `accessibility`\ + \ - Skips the Accessibility pane, only if the Mac is connected to Ethernet\ + \ and the cloud config is downloaded.\n* `appearance` - Skips the Choose Your\ + \ Look screen.\n* `appleID` - Skips Apple ID setup.\n* `biometric` - Skips\ + \ biometric setup.\n* `diagnostics` - Skips the App Analytics pane.\n* `displayTone`\ + \ - Skips display tone setup.\n* `fileVault` - Skips FileVault setup assistant\ + \ screen.\n* `icloudDiagnostics` - Skips iCloud analytics screen.\n* `icloudStorage`\ + \ - Skips iCloud documents and desktop screen.\n* `location` - Skips location\ + \ services setup.\n* `payment` - Skips Apple Pay setup.\n* `privacy` - Skips\ + \ the Privacy setup.\n* `restore` - Skips restoring from backup.\n* `screenTime`\ + \ - Skips screen time setup.\n* `siri` - Skips Siri setup.\n* `tos` - Skips\ + \ terms and conditions.\n* `appStore` - Skips the App Store pane.\n* `deviceToDeviceMigration`\ + \ - Skips Device to Device Migration pane.\n* `displayZoom` - Skips zoom setup.\n\ + * `homeButton` - Skips the Meet the New Home Button screen on iPhone 7, iPhone\ + \ 7 Plus, iPhone 8, iPhone 8 Plus and iPhone SE.\n* `imessageAndFacetime`\ + \ - Skips the iMessage and FaceTime screen in iOS.\n* `messagingActivationUsingPhoneNumber`\ + \ - Skips the iMessage pane.\n* `moveFromAndroid` - If the Restore pane is\ + \ not skipped, removes the Move from Android option in the Restore pane on\ + \ iOS.O\n* `passcode` - Hides and disables the passcode pane.\n* `restoreComplete`\ + \ - Skips the Restore Completed pane.\n* `setupCellular` - Skips the add cellular\ + \ plan pane.\n* `softwareUpdate` - Skips the mandatory software update screen\ + \ in iOS.\n* `unlockWithWatch` - Skips Unlock Your Mac with your Apple Watch\ + \ pane.\n* `updateComplete` - Skips the Software Update Complete pane.\n*\ + \ `watchMigration` - Skips the screen for watch migration.\n* `welcome` -\ + \ Skips the Get Started pane.\n" + enum: + - accessibility + - appearance + - appleID + - biometric + - diagnostics + - displayTone + - fileVault + - icloudDiagnostics + - icloudStorage + - location + - payment + - privacy + - restore + - screenTime + - siri + - tos + - appStore + - displayZoom + - deviceToDeviceMigration + - homeButton + - imessageAndFacetime + - messagingActivationUsingPhoneNumber + - moveFromAndroid + - passcode + - restoreComplete + - setupCellular + - softwareUpdate + - unlockWithWatch + - updateComplete + - watchMigration + - welcome + SharedFolderAccessLevels: + required: + - results + type: object + properties: + results: + type: array + items: + $ref: '#/components/schemas/SharedFolderAccessLevels_results' + SharedFolderDetails: + required: + - createdAt + - itemsInFolder + - name + - usersWithAccess + - uuid + type: object + properties: + createdAt: + type: string + itemsInFolder: + type: integer + format: int32 + example: 15 + name: + type: string + example: folder admin + usersWithAccess: + type: integer + format: int32 + example: 5 + uuid: + type: string + format: uuid + SharedFolderUsers: + required: + - results + - totalCount + type: object + properties: + results: + type: array + items: + $ref: '#/components/schemas/SharedFolderUsers_results' + totalCount: + type: integer + format: int32 + example: 50 + SharedFoldersList: + required: + - results + - totalCount + type: object + properties: + results: + type: array + items: + $ref: '#/components/schemas/SharedFoldersList_results' + totalCount: + type: integer + format: int32 + example: 50 + SoftwareAppsRetryInstallationRequest: + title: SoftwareAppsRetryInstallationRequest + type: object + properties: + system_ids: + type: array + description: An array of system IDs to retry the software application installation. + items: + type: string + SuggestionCounts: + type: object + properties: + add: + type: integer + remove: + type: integer + total: + type: integer + example: + add: 0 + total: 1 + remove: 6 + SystemGroup: + title: SystemGroup + type: object + properties: + attributes: + $ref: '#/components/schemas/GraphAttributes' + description: + type: string + description: Description of a System Group + email: + type: string + description: E-mail address associated with a System Group + id: + type: string + description: ObjectId uniquely identifying a System Group. + name: + type: string + description: Display name of a System Group. + type: + type: string + description: The type of the group; always 'system' for a System Group. + enum: + - system_group + example: + name: name + description: description + attributes: {} + id: id + type: system_group + email: email + SystemGroupData: + title: SystemGroupData + required: + - name + type: object + properties: + name: + type: string + description: Display name of a System Group. + TicketingIntegrationAlert: + type: object + properties: + category: + type: string + description: + type: string + id: + type: integer + name: + type: string + example: + name: name + description: description + id: 0 + category: category + TicketingIntegrationAlertsResp: + required: + - records + type: object + properties: + records: + type: array + items: + $ref: '#/components/schemas/TicketingIntegrationAlert' + example: + records: + - name: name + description: description + id: 0 + category: category + - name: name + description: description + id: 0 + category: category + User: + title: User + type: object + properties: + addresses: + type: array + items: + $ref: '#/components/schemas/Address' + alternateEmail: + type: string + company: + maxLength: 1024 + type: string + costCenter: + maxLength: 1024 + type: string + department: + maxLength: 1024 + type: string + email: + maxLength: 1024 + type: string + employeeIdentifier: + maxLength: 256 + type: string + description: Must be unique per user. + employeeType: + maxLength: 1024 + type: string + firstname: + maxLength: 1024 + type: string + jobTitle: + maxLength: 1024 + type: string + lastname: + maxLength: 1024 + type: string + location: + maxLength: 1024 + type: string + phoneNumbers: + type: array + items: + $ref: '#/components/schemas/PhoneNumber' + example: + alternateEmail: alternateEmail + addresses: + - country: country + poBox: poBox + streetAddress: streetAddress + postalCode: postalCode + locality: locality + id: id + extendedAddress: extendedAddress + region: region + type: type + - country: country + poBox: poBox + streetAddress: streetAddress + postalCode: postalCode + locality: locality + id: id + extendedAddress: extendedAddress + region: region + type: type + firstname: firstname + costCenter: costCenter + jobTitle: jobTitle + phoneNumbers: + - number: number + id: id + type: type + - number: number + id: id + type: type + lastname: lastname + employeeIdentifier: employeeIdentifier + employeeType: employeeType + company: company + location: location + department: department + email: email + UserGroup: + title: UserGroup + type: object + properties: + attributes: + $ref: '#/components/schemas/GroupAttributes-UserGroup' + description: + type: string + description: Description of a User Group + email: + type: string + description: Email address of a User Group + id: + type: string + description: ObjectId uniquely identifying a User Group. + memberQuery: + $ref: '#/components/schemas/FilterQuery' + memberQueryExemptions: + type: array + description: Array of GraphObjects exempted from the query + items: + $ref: '#/components/schemas/GraphObject' + memberSuggestionsNotify: + type: boolean + description: True if notification emails are to be sent for membership suggestions. + membershipAutomated: + type: boolean + description: "True if membership of this group is automatically updated\ + \ based on the Member Query and Member Query Exemptions, if configured" + name: + type: string + description: Display name of a User Group. + suggestionCounts: + $ref: '#/components/schemas/SuggestionCounts' + type: + type: string + description: The type of the group. + enum: + - user_group + example: + memberQuery: "" + memberSuggestionsNotify: true + name: name + description: description + membershipAutomated: true + attributes: "" + id: id + suggestionCounts: + add: 0 + total: 1 + remove: 6 + type: user_group + email: email + memberQueryExemptions: + - attributes: null + id: id + type: type + - attributes: null + id: id + type: type + UserGroupPost: + title: UserGroupPost + required: + - name + type: object + properties: + attributes: + $ref: '#/components/schemas/GroupAttributes-UserGroup' + description: + type: string + description: Description of a User Group + email: + type: string + description: Email address of a User Group + memberQuery: + $ref: '#/components/schemas/FilterQuery' + memberQueryExemptions: + type: array + description: Array of GraphObjects exempted from the query + items: + $ref: '#/components/schemas/GraphObject' + memberSuggestionsNotify: + type: boolean + description: True if notification emails are to be sent for membership suggestions. + membershipAutomated: + type: boolean + description: "True if membership of this group is automatically updated\ + \ based on the Member Query and Member Query Exemptions, if configured" + name: + type: string + description: Display name of a User Group. + UserGroupPut: + title: UserGroupPut + required: + - name + type: object + properties: + attributes: + $ref: '#/components/schemas/GroupAttributes-UserGroup' + description: + type: string + description: Description of a User Group + email: + type: string + description: Email address of a User Group + memberQuery: + $ref: '#/components/schemas/FilterQuery' + memberQueryExemptions: + type: array + description: Array of GraphObjects exempted from the query + items: + $ref: '#/components/schemas/GraphObject' + memberSuggestionsNotify: + type: boolean + description: True if notification emails are to be sent for membership suggestions. + membershipAutomated: + type: boolean + description: "True if membership of this group is automatically updated\ + \ based on the Member Query and Member Query Exemptions, if configured" + name: + type: string + description: Display name of a User Group. + active-directory-agent-get-output: + title: Active Directory Agent Get Output + required: + - id + type: object + properties: + connectKey: + type: string + description: The connect key to use when installing the Agent on a Domain + Controller. + contactAt: + type: string + hostname: + type: string + id: + type: string + description: ObjectID of this Active Directory Agent. + source_ip: + type: string + state: + type: string + enum: + - unsealed + - active + - inactive + version: + type: string + example: + connectKey: connectKey + hostname: hostname + id: id + state: unsealed + contactAt: contactAt + version: version + source_ip: source_ip + active-directory-agent-input: + title: Active Directory Agent Input + type: object + active-directory-agent-list-output: + title: Active Directory Agent List Output + type: object + properties: + contactAt: + type: string + hostname: + type: string + id: + type: string + description: ObjectID of this Active Directory Agent. + source_ip: + type: string + state: + type: string + enum: + - unsealed + - active + - inactive + version: + type: string + example: + hostname: hostname + id: id + state: unsealed + contactAt: contactAt + version: version + source_ip: source_ip + active-directory-input: + title: Active Directory Input + type: object + properties: + domain: + type: string + description: Domain name for this Active Directory instance. + active-directory-output: + title: Active Directory Output + allOf: + - required: + - id + type: object + properties: + id: + type: string + description: ObjectID of this Active Directory instance. + - $ref: '#/components/schemas/active-directory-input' + apple-mdm-device: + title: Apple MDM Device + type: object + properties: + createdAt: + type: string + depRegistered: + type: boolean + deviceInformation: + $ref: '#/components/schemas/apple-mdm-device-info' + enrolled: + type: boolean + hasActivationLockBypassCodes: + type: boolean + id: + type: string + osVersion: + type: string + securityInfo: + $ref: '#/components/schemas/apple-mdm-device-security-info' + serialNumber: + type: string + udid: + type: string + example: + createdAt: createdAt + serialNumber: serialNumber + osVersion: osVersion + deviceInformation: + secondImei: secondImei + activationLockAllowedWhileSupervised: true + isActivationLockEnabled: true + subscriberCarrierNetwork: subscriberCarrierNetwork + secondIccid: secondIccid + deviceCapacity: 6.027456183070403 + deviceName: deviceName + isSupervised: true + secondSubscriberCarrierNetwork: secondSubscriberCarrierNetwork + modelName: modelName + iccid: iccid + availableDeviceCapacity: 0.8008281904610115 + imei: imei + wifiMac: wifiMac + securityInfo: + passcodePresent: true + isUserEnrollment: true + isActivationLockManageable: true + enrolledViaDep: true + userApprovedEnrollment: true + id: id + udid: udid + depRegistered: true + enrolled: true + hasActivationLockBypassCodes: true + x-tags: + - Apple MDM + apple-mdm-device-info: + title: Apple MDM Device Info + type: object + properties: + activationLockAllowedWhileSupervised: + type: boolean + availableDeviceCapacity: + type: number + deviceCapacity: + type: number + deviceName: + type: string + iccid: + type: string + imei: + type: string + isActivationLockEnabled: + type: boolean + isSupervised: + type: boolean + modelName: + type: string + secondIccid: + type: string + secondImei: + type: string + secondSubscriberCarrierNetwork: + type: string + subscriberCarrierNetwork: + type: string + wifiMac: + type: string + description: Apple MDM device information + example: + secondImei: secondImei + activationLockAllowedWhileSupervised: true + isActivationLockEnabled: true + subscriberCarrierNetwork: subscriberCarrierNetwork + secondIccid: secondIccid + deviceCapacity: 6.027456183070403 + deviceName: deviceName + isSupervised: true + secondSubscriberCarrierNetwork: secondSubscriberCarrierNetwork + modelName: modelName + iccid: iccid + availableDeviceCapacity: 0.8008281904610115 + imei: imei + wifiMac: wifiMac + x-tags: + - Apple MDM + apple-mdm-device-security-info: + title: Apple MDM Device Security Info + type: object + properties: + enrolledViaDep: + type: boolean + isActivationLockManageable: + type: boolean + isUserEnrollment: + type: boolean + passcodePresent: + type: boolean + userApprovedEnrollment: + type: boolean + description: Apple MDM device security information + example: + passcodePresent: true + isUserEnrollment: true + isActivationLockManageable: true + enrolledViaDep: true + userApprovedEnrollment: true + x-tags: + - Apple MDM + apple-mdm-patch-input: + title: Apple MDM Patch Input + type: object + properties: + ades: + $ref: '#/components/schemas/ADES' + allowMobileUserEnrollment: + type: boolean + description: A toggle to allow mobile device enrollment for an organization. + appleSignedCert: + type: string + description: A signed certificate obtained from Apple after providing Apple + with the plist file provided on POST. + defaultIosUserEnrollmentDeviceGroupID: + type: string + description: ObjectId uniquely identifying the MDM default iOS user enrollment + device group. + defaultSystemGroupID: + type: string + description: ObjectId uniquely identifying the MDM default System Group. + dep: + $ref: '#/components/schemas/DEP' + encryptedDepServerToken: + type: string + description: The S/MIME encoded DEP Server Token returned by Apple Business + Manager when creating an MDM instance. + name: + maxLength: 255 + type: string + description: A new name for the Apple MDM configuration. + apple-mdm-public-key-cert: + title: Apple MDM Public Key Certificate + type: string + apple-mdm-signed-csr-plist: + title: Apple MDM Signed CSR PList + type: string + auth-info: + title: Auth Info + type: object + properties: + expiry: + type: string + isValid: + type: boolean + message: + type: string + example: + isValid: true + expiry: expiry + message: message + auth-input: + title: Auth Input + type: object + properties: + basic: + $ref: '#/components/schemas/authinput_basic' + oauth: + $ref: '#/components/schemas/authinput_oauth' + auth-input-object: + title: Auth Input Object + type: object + properties: + auth: + $ref: '#/components/schemas/auth-input' + example: + auth: + basic: + password: mollit cillum + username: veniam dolore + oauth: + code: minim ad ea dolor + bulk-scheduled-statechange-create: + title: Bulk Schedule User State Change Create + required: + - start_date + - state + - user_ids + type: object + properties: + activation_email_override: + type: string + description: Send the activation or welcome email to the specified email + address upon activation. Can only be used with a single user_id and scheduled + activation. This field will be ignored if `send_activation_emails` is + explicitly set to false. + send_activation_emails: + type: boolean + description: Set to true to send activation or welcome email(s) to each + user_id upon activation. Set to false to suppress emails. Can only be + used with scheduled activation(s). + start_date: + type: string + description: Date and time that scheduled action should occur + format: date-time + state: + type: string + description: The state to move the user(s) to + enum: + - ACTIVATED + - SUSPENDED + user_ids: + type: array + description: Array of system user ids to schedule for a state change + items: + type: string + description: Model to support bulk scheduling of a state change for one or more + users + x-examples: + example-1: + start_date: 2020-01-01T02:00:00 + state: SUSPENDED + user_ids: + - 666f6f2d6261722d71757578 + - 0123456789ab0123456789ab + - 666f6f2d6261722d71757555 + example-2: + send_activation_emails: true + start_date: 2020-01-01T02:00:00 + state: ACTIVATED + user_ids: + - 666f6f2d6261722d71757578 + - 0123456789ab0123456789ab + - 666f6f2d6261722d71757555 + example-3: + activation_email_override: alternate-activation-email@email.com + start_date: 2020-01-01T02:00:00 + state: ACTIVATED + user_ids: + - 666f6f2d6261722d71757578 + bulk-user-create: + title: Bulk User Create + type: object + properties: + attributes: + type: array + description: Map of additional attributes. + items: + type: object + properties: {} + email: + type: string + firstname: + type: string + lastname: + type: string + username: + type: string + description: "See [V1 system user creation](https://docs.jumpcloud.com/api/1.0/index.html#operation/systemusers_post)\ + \ for full list of attributes." + bulk-user-update: + title: Bulk User Update + type: object + properties: + attributes: + type: array + description: Map of additional attributes. + items: + type: object + properties: {} + email: + type: string + firstname: + type: string + id: + type: string + description: Object ID of the systemuser being updated + lastname: + type: string + username: + type: string + description: "See [V1 system user update](https://docs.jumpcloud.com/api/1.0/index.html#operation/systemusers_put)\ + \ for full list of attributes." + feature: + type: object + properties: + name: + type: string + description: The unique identifier for this feature. + enum: + - cloudDirectory + - deviceManagement + - directoryInsightsPremium + - ldap + - mdm + - mfa + - premiumSupport + - radius + - sso + - systemInsights + - userLifecycle + - zeroTrust + - jumpcloudProtect + - osPatchManagement + - remoteAssist + - cloudInsights + - passwordManagement + description: A feature represents JumpCloud functionality. + example: + name: cloudDirectory + gsuite-output: + title: GSuite Output + type: object + properties: + groupsEnabled: + type: boolean + id: + type: string + name: + type: string + userLockoutAction: + type: string + enum: + - suspend + - maintain + userPasswordExpirationAction: + type: string + enum: + - suspend + - maintain + - remove_access + example: + groupsEnabled: true + userLockoutAction: suspend + name: name + userPasswordExpirationAction: suspend + id: id + gsuite-patch-input: + title: GSuite Patch Input + type: object + properties: + groupsEnabled: + type: boolean + name: + type: string + userLockoutAction: + type: string + enum: + - suspend + - maintain + userPasswordExpirationAction: + type: string + enum: + - suspend + - maintain + - remove_access + importUser: + title: Import User + type: object + properties: + addresses: + type: array + items: + $ref: '#/components/schemas/importUserAddress' + company: + type: string + costCenter: + type: string + department: + type: string + displayname: + type: string + email: + type: string + employeeIdentifier: + type: string + employeeType: + type: string + firstname: + type: string + id: + type: string + jobTitle: + type: string + lastname: + type: string + location: + type: string + manager: + type: string + middlename: + type: string + phoneNumbers: + type: array + items: + $ref: '#/components/schemas/importUserPhoneNumber' + username: + type: string + example: + addresses: + - country: country + streetAddress: streetAddress + postalCode: postalCode + locality: locality + region: region + type: type + - country: country + streetAddress: streetAddress + postalCode: postalCode + locality: locality + region: region + type: type + firstname: firstname + manager: manager + costCenter: costCenter + jobTitle: jobTitle + middlename: middlename + phoneNumbers: + - type: type + value: value + - type: type + value: value + lastname: lastname + employeeIdentifier: employeeIdentifier + employeeType: employeeType + displayname: displayname + company: company + location: location + id: id + department: department + email: email + username: username + importUserAddress: + title: Import User Address + type: object + properties: + country: + type: string + locality: + type: string + postalCode: + type: string + region: + type: string + streetAddress: + type: string + type: + type: string + example: + country: country + streetAddress: streetAddress + postalCode: postalCode + locality: locality + region: region + type: type + importUserPhoneNumber: + title: Import User Address + type: object + properties: + type: + type: string + value: + type: string + example: + type: type + value: value + importUsersResponse: + title: Import Users Response + type: object + properties: + total_count: + type: number + users: + type: array + items: + $ref: '#/components/schemas/importUser' + example: + total_count: 0.8008281904610115 + users: + - addresses: + - country: country + streetAddress: streetAddress + postalCode: postalCode + locality: locality + region: region + type: type + - country: country + streetAddress: streetAddress + postalCode: postalCode + locality: locality + region: region + type: type + firstname: firstname + manager: manager + costCenter: costCenter + jobTitle: jobTitle + middlename: middlename + phoneNumbers: + - type: type + value: value + - type: type + value: value + lastname: lastname + employeeIdentifier: employeeIdentifier + employeeType: employeeType + displayname: displayname + company: company + location: location + id: id + department: department + email: email + username: username + - addresses: + - country: country + streetAddress: streetAddress + postalCode: postalCode + locality: locality + region: region + type: type + - country: country + streetAddress: streetAddress + postalCode: postalCode + locality: locality + region: region + type: type + firstname: firstname + manager: manager + costCenter: costCenter + jobTitle: jobTitle + middlename: middlename + phoneNumbers: + - type: type + value: value + - type: type + value: value + lastname: lastname + employeeIdentifier: employeeIdentifier + employeeType: employeeType + displayname: displayname + company: company + location: location + id: id + department: department + email: email + username: username + job-id: + title: Job ID + type: object + properties: + jobId: + type: string + example: + jobId: jobId + x-examples: + example-1: + jobId: string + job-workresult: + title: Job WorkResult + type: object + properties: + createdAt: + type: string + id: + type: string + meta: + type: object + properties: {} + example: {} + persistedFields: + type: object + properties: {} + example: {} + status: + type: string + statusMsg: + type: string + updatedAt: + type: string + example: + createdAt: createdAt + statusMsg: statusMsg + meta: {} + id: id + persistedFields: {} + status: status + updatedAt: updatedAt + ldap-server-input: + title: LDAP Server Input + type: object + properties: + name: + type: string + description: The name of this LDAP server + userLockoutAction: + type: string + description: action to take; one of 'remove' or 'disable' + enum: + - disable + - remove + userPasswordExpirationAction: + type: string + description: action to take; one of 'remove' or 'disable' + enum: + - disable + - remove + ldap-server-output: + title: LDAP Server Output + allOf: + - required: + - id + type: object + properties: + id: + type: string + description: Unique identifier of this LDAP server + - $ref: '#/components/schemas/ldap-server-input' + mobileconfig: + title: mobileconfig + type: string + office365-output: + title: Office 365 Output + required: + - id + - userLockoutAction + - userPasswordExpirationAction + type: object + properties: + groupsEnabled: + type: boolean + id: + type: string + name: + type: string + userLockoutAction: + type: string + enum: + - suspend + - maintain + userPasswordExpirationAction: + type: string + enum: + - suspend + - maintain + example: + groupsEnabled: true + userLockoutAction: suspend + name: name + userPasswordExpirationAction: suspend + id: id + office365-patch-input: + title: Office 365 Patch Input + type: object + properties: + groupsEnabled: + type: boolean + name: + type: string + userLockoutAction: + type: string + enum: + - suspend + - maintain + userPasswordExpirationAction: + type: string + enum: + - suspend + - maintain + samba-domain-input: + title: Samba Domain Input + required: + - name + - sid + type: object + properties: + name: + type: string + description: Name of this domain's WorkGroup + sid: + type: string + description: Security identifier of this domain + samba-domain-output: + title: Samba Domain Output + allOf: + - required: + - id + type: object + properties: + id: + type: string + description: Unique identifier of this domain + - $ref: '#/components/schemas/samba-domain-input' + scheduled-userstate-result: + title: Scheduled Userstate Result + type: object + properties: + scheduledDate: + type: string + scheduledJobId: + type: string + state: + type: string + systemUserId: + type: string + example: + scheduledJobId: scheduledJobId + systemUserId: systemUserId + scheduledDate: scheduledDate + state: state + software-app: + title: Software Application Package + type: object + properties: + displayName: + type: string + id: + type: string + settings: + type: array + items: + $ref: '#/components/schemas/software-app-settings' + example: + settings: + - desiredState: desiredState + autoUpdate: false + assetKind: assetKind + assetSha256Strings: + - assetSha256Strings + - assetSha256Strings + packageId: packageId + description: description + packageVersion: packageVersion + packageManager: packageManager + locationObjectId: locationObjectId + packageSubtitle: packageSubtitle + allowUpdateDelay: false + packageKind: packageKind + appleVpp: + assignedLicenses: 0 + totalLicenses: 1 + availableLicenses: 6 + isConfigEnabled: true + details: {} + appConfiguration: appConfiguration + supportedDeviceFamilies: + - IPAD + - IPAD + assetSha256Size: 5 + location: location + - desiredState: desiredState + autoUpdate: false + assetKind: assetKind + assetSha256Strings: + - assetSha256Strings + - assetSha256Strings + packageId: packageId + description: description + packageVersion: packageVersion + packageManager: packageManager + locationObjectId: locationObjectId + packageSubtitle: packageSubtitle + allowUpdateDelay: false + packageKind: packageKind + appleVpp: + assignedLicenses: 0 + totalLicenses: 1 + availableLicenses: 6 + isConfigEnabled: true + details: {} + appConfiguration: appConfiguration + supportedDeviceFamilies: + - IPAD + - IPAD + assetSha256Size: 5 + location: location + displayName: displayName + id: id + software-app-apple-vpp: + title: software-app-apple-vpp + type: object + properties: + appConfiguration: + type: string + description: "Text sent to configure the application, the text should be\ + \ a valid plist. Returned only by 'GET /softwareapps/{id}'." + assignedLicenses: + type: integer + availableLicenses: + type: integer + details: + type: object + properties: {} + description: "App details returned by iTunes API. See example. The properties\ + \ in this field are out of our control and we cannot guarantee consistency,\ + \ so it should be checked by the client and manage the details accordingly." + example: {} + isConfigEnabled: + type: boolean + description: "Denotes if configuration has been enabled for the application.\ + \ Returned only by ''GET /softwareapps/{id}''." + supportedDeviceFamilies: + type: array + description: The supported device families for this VPP Application. + items: + type: string + enum: + - IPAD + - IPHONE + - IPOD + - MAC + totalLicenses: + type: integer + description: "appleVpp is an optional attribute, it will only be present on\ + \ apps with a 'setting' 'package_manager' type of 'APPLE_VPP'." + example: + assignedLicenses: 0 + totalLicenses: 1 + availableLicenses: 6 + isConfigEnabled: true + details: {} + appConfiguration: appConfiguration + supportedDeviceFamilies: + - IPAD + - IPAD + software-app-reclaim-licenses: + type: object + properties: + assignedLicenses: + type: integer + availableLicenses: + type: integer + reclaimedLicenses: + type: integer + totalLicenses: + type: integer + example: + assignedLicenses: 0 + reclaimedLicenses: 1 + totalLicenses: 5 + availableLicenses: 6 + software-app-settings: + type: object + properties: + allowUpdateDelay: + type: boolean + default: false + appleVpp: + $ref: '#/components/schemas/software-app-apple-vpp' + assetKind: + type: string + description: "The manifest asset kind (ex: software)." + assetSha256Size: + type: integer + description: The incremental size to use for summing the package as it is + downloaded. + assetSha256Strings: + type: array + description: "The array of checksums, one each for the hash size up to the\ + \ total size of the package." + items: + type: string + autoUpdate: + type: boolean + default: false + description: + type: string + description: The software app description. + desiredState: + type: string + description: State of Install or Uninstall + location: + type: string + description: Repository where the app is located within the package manager + locationObjectId: + type: string + description: ID of the repository where the app is located within the package + manager + packageId: + type: string + packageKind: + type: string + description: "The package manifest kind (ex: software-package)." + packageManager: + type: string + description: "App store serving the app: APPLE_VPP, CHOCOLATEY, etc." + packageSubtitle: + type: string + description: The package manifest subtitle. + packageVersion: + type: string + description: The package manifest version. + example: + desiredState: desiredState + autoUpdate: false + assetKind: assetKind + assetSha256Strings: + - assetSha256Strings + - assetSha256Strings + packageId: packageId + description: description + packageVersion: packageVersion + packageManager: packageManager + locationObjectId: locationObjectId + packageSubtitle: packageSubtitle + allowUpdateDelay: false + packageKind: packageKind + appleVpp: + assignedLicenses: 0 + totalLicenses: 1 + availableLicenses: 6 + isConfigEnabled: true + details: {} + appConfiguration: appConfiguration + supportedDeviceFamilies: + - IPAD + - IPAD + assetSha256Size: 5 + location: location + x-examples: + example-1: + allowUpdateDelay: false + autoUpdate: false + desiredState: string + location: string + locationObjectId: string + packageId: string + packageManager: string + software-app-status: + title: Software Application Status + type: object + properties: + code: + type: integer + details: + type: string + id: + type: string + softwareAppId: + type: string + state: + type: string + systemId: + type: string + timestamp: + type: string + version: + type: string + example: + systemId: systemId + code: 0 + softwareAppId: softwareAppId + details: details + id: id + state: state + version: version + timestamp: timestamp + software-app-with-status: + title: SoftwareAppsWithStatus + type: object + properties: + app: + $ref: '#/components/schemas/software-app' + status: + $ref: '#/components/schemas/software-app-status' + example: + app: + settings: + - desiredState: desiredState + autoUpdate: false + assetKind: assetKind + assetSha256Strings: + - assetSha256Strings + - assetSha256Strings + packageId: packageId + description: description + packageVersion: packageVersion + packageManager: packageManager + locationObjectId: locationObjectId + packageSubtitle: packageSubtitle + allowUpdateDelay: false + packageKind: packageKind + appleVpp: + assignedLicenses: 0 + totalLicenses: 1 + availableLicenses: 6 + isConfigEnabled: true + details: {} + appConfiguration: appConfiguration + supportedDeviceFamilies: + - IPAD + - IPAD + assetSha256Size: 5 + location: location + - desiredState: desiredState + autoUpdate: false + assetKind: assetKind + assetSha256Strings: + - assetSha256Strings + - assetSha256Strings + packageId: packageId + description: description + packageVersion: packageVersion + packageManager: packageManager + locationObjectId: locationObjectId + packageSubtitle: packageSubtitle + allowUpdateDelay: false + packageKind: packageKind + appleVpp: + assignedLicenses: 0 + totalLicenses: 1 + availableLicenses: 6 + isConfigEnabled: true + details: {} + appConfiguration: appConfiguration + supportedDeviceFamilies: + - IPAD + - IPAD + assetSha256Size: 5 + location: location + displayName: displayName + id: id + status: + systemId: systemId + code: 0 + softwareAppId: softwareAppId + details: details + id: id + state: state + version: version + timestamp: timestamp + subscription: + title: Subscription + required: + - annualPrice + - displayName + - features + - listPrice + - productCode + type: object + properties: + annualPrice: + type: number + description: The annual (discounted) price of this subscription. + displayName: + type: string + description: The display name of this subscription. + features: + type: array + description: Array of the features included in the subscription. + items: + $ref: '#/components/schemas/feature' + listPrice: + type: number + description: The list price of this subscription. + productCode: + type: string + description: Unique identifier corresponding to this subscription. + example: + features: + - name: cloudDirectory + - name: cloudDirectory + productCode: productCode + annualPrice: 0.8008281904610115 + displayName: displayName + listPrice: 6.027456183070403 + system-insights-alf: + title: System Insights ALF + type: object + properties: + allow_signed_enabled: + type: integer + collection_time: + type: string + firewall_unload: + type: integer + global_state: + type: integer + logging_enabled: + type: integer + logging_option: + type: integer + stealth_enabled: + type: integer + system_id: + type: string + version: + type: string + example: + logging_enabled: 5 + firewall_unload: 6 + stealth_enabled: 2 + allow_signed_enabled: 0 + system_id: system_id + collection_time: collection_time + global_state: 1 + logging_option: 5 + version: version + system-insights-alf-exceptions: + title: System Insights ALF Exceptions + type: object + properties: + collection_time: + type: string + path: + type: string + state: + type: number + system_id: + type: string + example: + path: path + system_id: system_id + collection_time: collection_time + state: 0.8008281904610115 + system-insights-alf-explicit-auths: + title: System Insights ALF Explicit Authorizations + type: object + properties: + collection_time: + type: string + process: + type: string + system_id: + type: string + example: + process: process + system_id: system_id + collection_time: collection_time + system-insights-appcompat-shims: + title: System Insights Application Compatibility Shims + type: object + properties: + collection_time: + type: string + description: + type: string + executable: + type: string + install_time: + type: number + path: + type: string + sdb_id: + type: string + system_id: + type: string + type: + type: string + example: + install_time: 0.8008281904610115 + path: path + sdb_id: sdb_id + system_id: system_id + description: description + collection_time: collection_time + type: type + executable: executable + system-insights-apps: + title: System Insights Apps + type: object + properties: + applescript_enabled: + type: string + bundle_executable: + type: string + bundle_identifier: + type: string + bundle_name: + type: string + bundle_package_type: + type: string + bundle_short_version: + type: string + bundle_version: + type: string + category: + type: string + collection_time: + type: string + compiler: + type: string + copyright: + type: string + development_region: + type: string + display_name: + type: string + element: + type: string + environment: + type: string + info_string: + type: string + last_opened_time: + type: number + minimum_system_version: + type: string + name: + type: string + path: + type: string + system_id: + type: string + example: + applescript_enabled: "1" + bundle_executable: App Store + bundle_identifier: com.apple.appstore + bundle_name: App Store + bundle_package_type: APPL + bundle_short_version: "2.4" + bundle_version: "658.1" + category: public.app-category.utilities + collection_time: 2019-06-03T19:41:30.658Z + compiler: com.apple.compilers.llvm.clang.1_0 + copyright: "" + development_region: English + display_name: App Store + element: "" + environment: "" + info_string: "" + last_opened_time: 1.55668896350383E9 + minimum_system_version: "10.13" + name: App Store.app + path: /Applications/App Store.app + system_id: 5c9e51a13c5146f89bae12d9 + system-insights-authorized-keys: + title: System Insights Authorized Keys + type: object + properties: + algorithm: + type: string + collection_time: + type: string + key: + type: string + key_file: + type: string + system_id: + type: string + uid: + type: string + example: + uid: uid + key_file: key_file + system_id: system_id + collection_time: collection_time + key: key + algorithm: algorithm + system-insights-azure-instance-metadata: + title: System Insights Azure Instance Metadata + type: object + properties: + collection_time: + type: string + location: + type: string + name: + type: string + offer: + type: string + os_type: + type: string + placement_group_id: + type: string + platform_fault_domain: + type: string + platform_update_domain: + type: string + publisher: + type: string + resource_group_name: + type: string + sku: + type: string + subscription_id: + type: string + system_id: + type: string + version: + type: string + vm_id: + type: string + vm_scale_set_name: + type: string + vm_size: + type: string + zone: + type: string + example: + system_id: system_id + platform_update_domain: platform_update_domain + placement_group_id: placement_group_id + resource_group_name: resource_group_name + version: version + vm_scale_set_name: vm_scale_set_name + offer: offer + subscription_id: subscription_id + vm_id: vm_id + zone: zone + os_type: os_type + name: name + publisher: publisher + vm_size: vm_size + location: location + platform_fault_domain: platform_fault_domain + collection_time: collection_time + sku: sku + system-insights-azure-instance-tags: + title: System Insights Azure Instance Tags + type: object + properties: + collection_time: + type: string + key: + type: string + system_id: + type: string + value: + type: string + vm_id: + type: string + example: + vm_id: vm_id + system_id: system_id + collection_time: collection_time + value: value + key: key + system-insights-battery: + title: System Insights Battery + type: object + properties: + amperage: + type: integer + charged: + type: integer + charging: + type: integer + collection_time: + type: string + condition: + type: string + current_capacity: + type: integer + cycle_count: + type: integer + designed_capacity: + type: integer + health: + type: string + manufacture_date: + type: integer + manufacturer: + type: string + max_capacity: + type: integer + minutes_to_full_charge: + type: integer + minutes_until_empty: + type: integer + model: + type: string + percent_remaining: + type: integer + serial_number: + type: string + state: + type: string + system_id: + type: string + voltage: + type: integer + example: + amperage: 93836453 + charged: 63086136 + charging: 6577424 + collection_time: anim in dolor + condition: magna Ut dolor laborum + current_capacity: 95829126 + cycle_count: -58203101 + designed_capacity: 51607498 + health: ipsum Duis amet magna sint + manufacture_date: 66625366 + manufacturer: laboris + max_capacity: 407375 + minutes_to_full_charge: -43087634 + minutes_until_empty: 56660087 + model: cupidatat quis esse tempor nostr + percent_remaining: -77798506 + serial_number: est do nisi anim eu + state: Duis qui eu labore + system_id: elit nulla cillum et + voltage: -79728034 + system-insights-bitlocker-info: + title: System Insights Bitlocker Info + type: object + properties: + collection_time: + type: string + conversion_status: + type: integer + device_id: + type: string + drive_letter: + type: string + encryption_method: + type: string + persistent_volume_id: + type: string + protection_status: + type: integer + system_id: + type: string + example: + collection_time: 2019-06-03T19:41:30.658Z + conversion_status: 0 + devide_id: "\\\\\\\\?\\\\Volume{3ba5cc52-e0fd-45fa-b8b8-5c88f44f8b17}\\" + drive_letter: 'C:' + encryption_method: None + persistent_volume_id: "" + protection_status: 0 + system_id: 5c9e51a13c5146f89bae12d9 + system-insights-browser-plugins: + title: System Insights Browser Plugins + type: object + properties: + collection_time: + type: string + description: + type: string + development_region: + type: string + disabled: + type: integer + identifier: + type: string + name: + type: string + native: + type: integer + path: + type: string + sdk: + type: string + system_id: + type: string + uid: + type: string + version: + type: string + example: + collection_time: 2019-06-03T19:41:30.858Z + description: LastPass Plugin + development_region: en-US + disabled: 0 + identifier: com.lastpass.nplastpass + name: LastPass + native: 0 + path: /Library/Internet Plug-Ins/nplastpass.plugin/ + sdk: 7D175 + system_id: 5c9e51a13c5146f89bae12d9 + uid: "0" + version: 4.1.7 + system-insights-certificates: + type: object + properties: + authority_key_id: + type: string + ca: + type: integer + common_name: + type: string + issuer: + type: string + key_algorithm: + type: string + key_strength: + type: string + key_usage: + type: string + not_valid_after: + type: string + not_valid_before: + type: string + path: + type: string + self_signed: + type: integer + serial: + type: string + sha1: + type: string + sid: + type: string + signing_algorithm: + type: string + store: + type: string + store_id: + type: string + store_location: + type: string + subject: + type: string + subject_key_id: + type: string + system_id: + type: string + username: + type: string + example: + store_id: store_id + key_usage: key_usage + not_valid_after: not_valid_after + subject: subject + system_id: system_id + not_valid_before: not_valid_before + signing_algorithm: signing_algorithm + key_algorithm: key_algorithm + store: store + issuer: issuer + sid: sid + sha1: sha1 + subject_key_id: subject_key_id + path: path + authority_key_id: authority_key_id + serial: serial + key_strength: key_strength + common_name: common_name + self_signed: 6 + ca: 0 + store_location: store_location + username: username + system-insights-chassis-info: + title: System Insights Chassis Info + type: object + properties: + audible_alarm: + type: string + breach_description: + type: string + chassis_types: + type: string + collection_time: + type: string + description: + type: string + lock: + type: string + manufacturer: + type: string + model: + type: string + security_breach: + type: string + serial: + type: string + sku: + type: string + smbios_tag: + type: string + status: + type: string + system_id: + type: string + visible_alarm: + type: string + example: + breach_description: breach_description + audible_alarm: audible_alarm + security_breach: security_breach + system_id: system_id + description: description + smbios_tag: smbios_tag + visible_alarm: visible_alarm + manufacturer: manufacturer + serial: serial + chassis_types: chassis_types + lock: lock + model: model + collection_time: collection_time + sku: sku + status: status + system-insights-chrome-extensions: + title: System Insights Chrome Extensions + type: object + properties: + author: + type: string + collection_time: + type: string + description: + type: string + identifier: + type: string + locale: + type: string + name: + type: string + path: + type: string + permissions: + type: string + persistent: + type: integer + system_id: + type: string + uid: + type: string + update_url: + type: string + version: + type: string + example: + author: "" + collection_time: 2019-06-03t19:41:31.125z + description: provider for discovery and services for mirroring of chrome media + router + identifier: pkedcjkdefgpdelpbcmbmeomcjbeemfm + locale: en + name: chrome media router + path: /users/thomas/library/application support/google/chrome/default/extensions/pkedcjkdefgpdelpbcmbmeomcjbeemfm/7419.311.0.1_0/ + permissions: "alarms, cast, cast.streaming, declarativewebrequest, desktopcapture,\ + \ gcm, http://*/*, identity, identity.email, management, mdns, mediarouterprivate,\ + \ metricsprivate, networkingprivate, processes, storage, system.cpu, settingsprivate,\ + \ tabcapture, tabs, webview, https://hangouts.google.com/*, https://*.google.com/cast/chromecast/home/gsse" + persistent: 0 + system_id: 5c9e51a13c5146f89bae12d9 + uid: "501" + update_url: https://clients2.google.com/service/update2/crx + version: 7419.311.0.1 + system-insights-connectivity: + title: system insights connectivity + type: object + properties: + collection_time: + type: string + disconnected: + type: integer + ipv4_internet: + type: integer + ipv4_local_network: + type: integer + ipv4_no_traffic: + type: integer + ipv4_subnet: + type: integer + ipv6_internet: + type: integer + ipv6_local_network: + type: integer + ipv6_no_traffic: + type: integer + ipv6_subnet: + type: integer + system_id: + type: string + example: + ipv6_subnet: 3 + disconnected: 0 + ipv4_local_network: 1 + ipv4_subnet: 5 + ipv4_no_traffic: 5 + system_id: system_id + ipv6_no_traffic: 9 + ipv6_local_network: 7 + ipv6_internet: 2 + collection_time: collection_time + ipv4_internet: 6 + system-insights-crashes: + title: System Insights Crashes + type: object + properties: + collection_time: + type: string + crash_path: + type: string + crashed_thread: + type: string + datetime: + type: string + exception_codes: + type: string + exception_notes: + type: string + exception_type: + type: string + identifier: + type: string + parent: + type: string + path: + type: string + pid: + type: string + registers: + type: string + responsible: + type: string + stack_trace: + type: string + system_id: + type: string + type: + type: string + uid: + type: integer + version: + type: string + example: + identifier: identifier + parent: parent + crashed_thread: crashed_thread + system_id: system_id + pid: pid + type: type + version: version + exception_notes: exception_notes + path: path + uid: 0 + datetime: datetime + exception_codes: exception_codes + responsible: responsible + crash_path: crash_path + exception_type: exception_type + registers: registers + collection_time: collection_time + stack_trace: stack_trace + system-insights-cups-destinations: + type: object + properties: + name: + type: string + option_name: + type: string + option_value: + type: string + system_id: + type: string + example: + option_value: option_value + system_id: system_id + name: name + option_name: option_name + system-insights-disk-encryption: + title: System Insights Disk Encryption + type: object + properties: + collection_time: + type: string + encrypted: + type: integer + encryption_status: + type: string + name: + type: string + system_id: + type: string + type: + type: string + uid: + type: string + user_uuid: + type: string + uuid: + type: string + example: + collection_time: 2019-06-03T19:41:31.557Z + encrypted: 0 + encryption_status: undefined + name: /dev/disk8 + system_id: 5c9e51a13c5146f89bae12d9 + type: "" + uid: "" + user_uuid: "" + uuid: "" + system-insights-disk-info: + title: System Insights Disk Info + type: object + properties: + collection_time: + type: string + description: + type: string + disk_index: + type: integer + disk_size: + type: string + hardware_model: + type: string + id: + type: string + manufacturer: + type: string + name: + type: string + partitions: + type: integer + pnp_device_id: + type: string + serial: + type: string + system_id: + type: string + type: + type: string + example: + collection_time: 2019-06-03T19:41:30.658Z + description: Disk drive + disk_index: 0 + disk_size: "64420392960" + hardware_model: "VMware, VMware Virtual S SCSI Disk Device" + id: \\.\PHYSICALDRIVE0 + manufacturer: (Standard disk drives) + name: \\.\PHYSICALDRIVE0 + partitions: 3 + pnp_device_id: SCSI\DISK&VEN_VMWARE_&PROD_VMWARE_VIRTUAL_S\5&1EC51BF7&0&000000 + serial: "" + system_id: 5c9e51a13c5146f89bae12d9 + type: SCSI + system-insights-dns-resolvers: + title: System Insights DNS Resolvers + type: object + properties: + address: + type: string + collection_time: + type: string + id: + type: number + netmask: + type: string + options: + type: string + system_id: + type: string + type: + type: string + example: + address: address + netmask: netmask + system_id: system_id + options: options + collection_time: collection_time + id: 0.8008281904610115 + type: type + system-insights-etc-hosts: + title: System Insights Etc Hosts + type: object + properties: + address: + type: string + collection_time: + type: string + hostnames: + type: string + system_id: + type: string + example: + address: 192.168.2.21 + collection_time: 2019-06-03T19:41:30.658Z + hostnames: hosty hosty.local + system_id: 5c9e51a13c5146f89bae12d9 + system-insights-firefox-addons: + title: System Insights Firefox Addons + type: object + properties: + active: + type: integer + autoupdate: + type: integer + collection_time: + type: string + creator: + type: string + description: + type: string + disabled: + type: integer + identifier: + type: string + location: + type: string + name: + type: string + path: + type: string + source_url: + type: string + system_id: + type: string + type: + type: string + uid: + type: string + version: + type: string + visible: + type: integer + example: + active: 1 + autoupdate: 1 + collection_time: 2019-06-03T19:41:31.204Z + creator: "null" + description: "" + disabled: 0 + identifier: fxmonitor@mozilla.org + location: app-system-addons + name: Firefox Monitor + path: "" + source_url: file:///var/folders/dn/zjm_0lzn4lv6bgnt5b3nkgxh0000gn/T/tmpaddon-9fb449 + system_id: 5c9e51a13c5146f89bae12d9 + type: extension + uid: "501" + version: "2.8" + visible: 1 + system-insights-groups: + title: System Insights Groups + type: object + properties: + collection_time: + type: string + comment: + type: string + gid: + type: string + gid_signed: + type: string + group_sid: + type: string + groupname: + type: string + system_id: + type: string + example: + collection_time: 2019-06-03T19:41:31.673Z + comment: "" + gid: "701" + gid_signed: "701" + group_sid: "" + groupname: "1" + system_id: 5c9e51a13c5146f89bae12d9 + system-insights-ie-extensions: + title: System Insights IE Extensions + type: object + properties: + collection_time: + type: string + name: + type: string + path: + type: string + registry_path: + type: string + system_id: + type: string + version: + type: string + example: + path: path + system_id: system_id + name: name + collection_time: collection_time + version: version + registry_path: registry_path + system-insights-interface-addresses: + title: System Insights Interface Addresses + type: object + properties: + address: + type: string + broadcast: + type: string + collection_time: + type: string + friendly_name: + type: string + interface: + type: string + mask: + type: string + point_to_point: + type: string + system_id: + type: string + type: + type: string + example: + address: ::1 + broadcast: "" + collection_time: 2019-06-03T19:41:31.008Z + friendly_name: "" + interface: lo0 + mask: ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff + point_to_point: ::1 + system_id: 5c9e51a13c5146f89bae12d9 + type: unknown + system-insights-interface-details: + type: object + properties: + collisions: + type: string + connection_id: + type: string + connection_status: + type: string + description: + type: string + dhcp_enabled: + type: integer + dhcp_lease_expires: + type: string + dhcp_lease_obtained: + type: string + dhcp_server: + type: string + dns_domain: + type: string + dns_domain_suffix_search_order: + type: string + dns_host_name: + type: string + dns_server_search_order: + type: string + enabled: + type: integer + flags: + type: integer + friendly_name: + type: string + ibytes: + type: string + idrops: + type: string + ierrors: + type: string + interface: + type: string + ipackets: + type: string + last_change: + type: string + link_speed: + type: string + mac: + type: string + manufacturer: + type: string + metric: + type: integer + mtu: + type: integer + obytes: + type: string + odrops: + type: string + oerrors: + type: string + opackets: + type: string + pci_slot: + type: string + physical_adapter: + type: integer + service: + type: string + speed: + type: integer + system_id: + type: string + type: + type: integer + example: + physical_adapter: 2 + flags: 1 + description: description + dhcp_server: dhcp_server + interface: interface + type: 9 + enabled: 6 + mac: mac + speed: 7 + manufacturer: manufacturer + dns_host_name: dns_host_name + ierrors: ierrors + obytes: obytes + opackets: opackets + friendly_name: friendly_name + ipackets: ipackets + collisions: collisions + last_change: last_change + dns_domain_suffix_search_order: dns_domain_suffix_search_order + system_id: system_id + connection_status: connection_status + ibytes: ibytes + link_speed: link_speed + pci_slot: pci_slot + mtu: 5 + dhcp_enabled: 0 + oerrors: oerrors + connection_id: connection_id + metric: 5 + odrops: odrops + service: service + dns_domain: dns_domain + idrops: idrops + dhcp_lease_obtained: dhcp_lease_obtained + dns_server_search_order: dns_server_search_order + dhcp_lease_expires: dhcp_lease_expires + system-insights-kernel-info: + title: System Insights Kernel Info + type: object + properties: + arguments: + type: string + collection_time: + type: string + device: + type: string + path: + type: string + system_id: + type: string + version: + type: string + example: + path: path + system_id: system_id + arguments: arguments + collection_time: collection_time + device: device + version: version + system-insights-launchd: + title: System Insights LaunchD + type: object + properties: + collection_time: + type: string + disabled: + type: string + groupname: + type: string + inetd_compatibility: + type: string + keep_alive: + type: string + label: + type: string + name: + type: string + on_demand: + type: string + path: + type: string + process_type: + type: string + program: + type: string + program_arguments: + type: string + queue_directories: + type: string + root_directory: + type: string + run_at_load: + type: string + start_interval: + type: string + start_on_mount: + type: string + stderr_path: + type: string + stdout_path: + type: string + system_id: + type: string + username: + type: string + watch_paths: + type: string + working_directory: + type: string + example: + program_arguments: program_arguments + start_on_mount: start_on_mount + stdout_path: stdout_path + run_at_load: run_at_load + system_id: system_id + watch_paths: watch_paths + working_directory: working_directory + label: label + program: program + root_directory: root_directory + groupname: groupname + on_demand: on_demand + path: path + stderr_path: stderr_path + start_interval: start_interval + name: name + disabled: disabled + process_type: process_type + collection_time: collection_time + keep_alive: keep_alive + inetd_compatibility: inetd_compatibility + queue_directories: queue_directories + username: username + system-insights-linux-packages: + title: System Insights Linux Packages + type: object + properties: + arch: + type: string + install_time: + type: integer + maintainer_or_vendor: + type: string + mount_namespace_id: + type: string + name: + type: string + package_format: + type: string + package_group_or_section: + type: string + pid_with_namespace: + type: integer + release_or_revision: + type: string + size: + type: string + system_id: + type: string + version: + type: string + example: + arch: amd64 + install_time: 100000 + maintainer_or_vendor: Ubuntu Developers + mount_namespace_id: id123 + name: zip + package_format: deb + package_group_or_section: utils + pid_with_namespace: 0 + release_or_revision: 11build1 + size: "100000" + system_id: 5c9e51a13c5146f89bae12d9 + version: 3.0-11build1 + system-insights-logged-in-users: + title: System Insights Logged-In Users + type: object + properties: + collection_time: + type: string + host: + type: string + pid: + type: integer + system_id: + type: string + time: + type: integer + tty: + type: string + type: + type: string + user: + type: string + example: + system_id: system_id + host: host + tty: tty + pid: 0 + collection_time: collection_time + time: 6 + type: type + user: user + system-insights-logical-drives: + title: System Insights Logical Drives + type: object + properties: + boot_partition: + type: integer + collection_time: + type: string + device_id: + type: string + file_system: + type: string + free_space: + type: string + size: + type: string + system_id: + type: string + type: + type: string + example: + boot_partition: 0 + collection_time: 2019-06-03T19:41:30.658Z + device_id: 'C:' + file_system: NTFS + free_space: "43194331136" + size: "63778582528" + system_id: 5c9e51a13c5146f89bae12d9 + type: Unknown + system-insights-managed-policies: + title: System Insights Managed Policies + type: object + properties: + collection_time: + type: string + domain: + type: string + manual: + type: integer + name: + type: string + system_id: + type: string + username: + type: string + uuid: + type: string + value: + type: string + example: + system_id: system_id + domain: domain + name: name + collection_time: collection_time + manual: 0 + uuid: uuid + value: value + username: username + system-insights-mounts: + title: System Insights Mounts + type: object + properties: + blocks: + type: string + blocks_available: + type: string + blocks_free: + type: string + blocks_size: + type: string + collection_time: + type: string + device: + type: string + device_alias: + type: string + flags: + type: string + inodes: + type: string + inodes_free: + type: string + path: + type: string + system_id: + type: string + type: + type: string + example: + blocks: "388086" + blocks_available: "95135" + blocks_free: "95135" + blocks_size: "4096" + collection_time: 2019-06-03T19:41:31.746Z + device: /dev/disk5s1 + device_alias: /dev/disk5s1 + flags: "70292505" + inodes: "4294967279" + inodes_free: "4294966853" + path: /private/var/folders/zz/zyxvpxvq6csfxvn_n0000000000000/T/.vbfolder_1dQavK + system_id: 5c9e51a13c5146f89bae12d9 + type: hfs + system-insights-os-version: + title: System Insights OS Version + type: object + properties: + build: + type: string + codename: + type: string + collection_time: + type: string + install_date: + type: string + major: + type: integer + minor: + type: integer + name: + type: string + patch: + type: integer + platform: + type: string + platform_like: + type: string + system_id: + type: string + version: + type: string + example: + build: 17G65 + codename: "" + collection_time: 2019-06-03T19:41:30.933Z + install_date: "" + major: 10 + minor: 13 + name: Mac OS X + patch: 6 + platform: darwin + platform_like: darwin + system_id: 5c9e51a13c5146f89bae12d9 + version: 10.13.6 + system-insights-patches: + title: System Insights Patches + type: object + properties: + caption: + type: string + collection_time: + type: string + csname: + type: string + description: + type: string + fix_comments: + type: string + hotfix_id: + type: string + install_date: + type: string + installed_by: + type: string + installed_on: + type: string + system_id: + type: string + example: + caption: http://support.microsoft.com/?kbid=4503308 + collection_time: 2019-06-03T19:41:31.673Z + csname: DESKTOP-B17DUKP + description: Security Update + fix_comments: "" + hotfix_id: KB4503308 + install_date: "" + installed_by: NT AUTHORITY\SYSTEM + installed_on: 7/30/2019 + system_id: 5c9e51a13c5146f89bae12d9 + system-insights-programs: + title: System Insights Programs + type: object + properties: + collection_time: + type: string + identifying_number: + type: string + install_date: + type: string + install_location: + type: string + install_source: + type: string + language: + type: string + name: + type: string + publisher: + type: string + system_id: + type: string + uninstall_string: + type: string + version: + type: string + example: + collection_time: 2019-06-03T19:41:31.673Z + identifying_number: "{2E8B8BDD-03DF-4C1C-8C99-E6A4BCBF43CE}" + install_date: "20190724" + install_location: "" + install_source: C:\Windows\SoftwareDistribution\Download\b78f29c88063bd09e7afd48e257d0126\img\ + language: "0" + name: Update for Windows 10 for x64-based Systems (KB4480730) + publisher: Microsoft Corporation + system_id: 5c9e51a13c5146f89bae12d9 + uninstall_string: "MsiExec.exe /X{2E8B8BDD-03DF-4C1C-8C99-E6A4BCBF43CE}" + version: 2.51.0.0 + system-insights-python-packages: + type: object + properties: + auther: + type: string + directory: + type: string + license: + type: string + name: + type: string + path: + type: string + summary: + type: string + system_id: + type: string + version: + type: string + example: + summary: summary + license: license + path: path + system_id: system_id + auther: auther + name: name + directory: directory + version: version + system-insights-safari-extensions: + title: System Insights Safari Extensions + type: object + properties: + author: + type: string + collection_time: + type: string + description: + type: string + developer_id: + type: string + identifier: + type: string + name: + type: string + path: + type: string + sdk: + type: string + system_id: + type: string + uid: + type: string + update_url: + type: string + version: + type: string + example: + author: Eyeo GmbH + collection_time: 2019-05-16T18:58:15.673Z + description: "Used by over 50 million people, a free ad blocker that blocks\ + \ ALL annoying ads, malware and tracking." + developer_id: GRYYZR985A + identifier: org.adblockplus.adblockplussafari + name: Adblock Plus + path: /Users/samuelharvanek/Library/Safari/Extensions/Adblock Plus.safariextz + sdk: "6.0" + system_id: 5cdb13e85a0e0719283583c0 + uid: "501" + update_url: https://update.adblockplus.org/adblockplussafari/updates.plist + version: 1.12.5 + system-insights-scheduled-tasks: + type: object + properties: + action: + type: string + enabled: + type: integer + hidden: + type: integer + last_run_code: + type: string + last_run_message: + type: string + last_run_time: + type: string + name: + type: string + next_run_time: + type: string + path: + type: string + state: + type: string + system_id: + type: string + example: + path: path + hidden: 6 + next_run_time: next_run_time + last_run_code: last_run_code + system_id: system_id + name: name + action: action + state: state + enabled: 0 + last_run_message: last_run_message + last_run_time: last_run_time + system-insights-secureboot: + title: System Insights Secure Boot + type: object + properties: + collection_time: + type: string + secure_boot: + type: number + setup_mode: + type: number + system_id: + type: string + example: + secure_boot: 0.8008281904610115 + system_id: system_id + collection_time: collection_time + setup_mode: 6.027456183070403 + system-insights-services: + type: object + properties: + description: + type: string + display_name: + type: string + module_path: + type: string + name: + type: string + path: + type: string + pid: + type: integer + service_exit_code: + type: integer + service_type: + type: string + start_type: + type: string + status: + type: string + system_id: + type: string + user_account: + type: string + win32_exit_code: + type: integer + example: + win32_exit_code: 1 + system_id: system_id + description: description + pid: 0 + service_exit_code: 6 + display_name: display_name + start_type: start_type + path: path + service_type: service_type + name: name + user_account: user_account + module_path: module_path + status: status + system-insights-shadow: + title: System Insights Shadow + type: object + properties: + collection_time: + type: string + expire: + type: string + flag: + type: string + hash_alg: + type: string + inactive: + type: string + last_change: + type: string + max: + type: string + min: + type: string + password_status: + type: string + system_id: + type: string + username: + type: string + warning: + type: string + example: + hash_alg: hash_alg + password_status: password_status + flag: flag + inactive: inactive + min: min + last_change: last_change + max: max + system_id: system_id + expire: expire + warning: warning + collection_time: collection_time + username: username + system-insights-shared-folders: + title: System Insights Shared Folders + type: object + properties: + collection_time: + type: string + name: + type: string + path: + type: string + system_id: + type: string + example: + path: path + system_id: system_id + name: name + collection_time: collection_time + system-insights-shared-resources: + title: System Insights Shared Resources + type: object + properties: + allow_maximum: + type: integer + collection_time: + type: string + description: + type: string + install_date: + type: string + maximum_allowed: + type: integer + name: + type: string + path: + type: string + status: + type: string + system_id: + type: string + type: + type: integer + example: + path: path + maximum_allowed: 6 + system_id: system_id + name: name + allow_maximum: 0 + description: description + collection_time: collection_time + install_date: install_date + type: 1 + status: status + system-insights-sharing-preferences: + title: System Insights Sharing Preferences + type: object + properties: + bluetooth_sharing: + type: integer + collection_time: + type: string + content_caching: + type: integer + disc_sharing: + type: integer + file_sharing: + type: integer + internet_sharing: + type: integer + printer_sharing: + type: integer + remote_apple_events: + type: integer + remote_login: + type: integer + remote_management: + type: integer + screen_sharing: + type: integer + system_id: + type: string + example: + disc_sharing: 1 + system_id: system_id + bluetooth_sharing: 0 + content_caching: 6 + internet_sharing: 5 + remote_login: 9 + file_sharing: 5 + collection_time: collection_time + screen_sharing: 2 + printer_sharing: 2 + remote_apple_events: 7 + remote_management: 3 + system-insights-sip-config: + title: System Insights SIP Config + type: object + properties: + collection_time: + type: string + config_flag: + type: string + enabled: + type: integer + enabled_nvram: + type: integer + system_id: + type: string + example: + system_id: system_id + enabled_nvram: 6 + collection_time: collection_time + config_flag: config_flag + enabled: 0 + system-insights-startup-items: + type: object + properties: + args: + type: string + name: + type: string + path: + type: string + source: + type: string + status: + type: string + system_id: + type: string + type: + type: string + username: + type: string + example: + args: args + path: path + system_id: system_id + name: name + source: source + type: type + status: status + username: username + system-insights-system-controls: + title: System Insights System Controls + type: object + properties: + collection_time: + type: string + config_value: + type: string + current_value: + type: string + field_name: + type: string + name: + type: string + oid: + type: string + subsystem: + type: string + system_id: + type: string + type: + type: string + example: + config_value: config_value + system_id: system_id + name: name + subsystem: subsystem + collection_time: collection_time + oid: oid + type: type + current_value: current_value + field_name: field_name + system-insights-system-info: + title: System Insights System Info + type: object + properties: + collection_time: + type: string + computer_name: + type: string + cpu_brand: + type: string + cpu_logical_cores: + type: integer + cpu_microcode: + type: string + cpu_physical_cores: + type: integer + cpu_subtype: + type: string + cpu_type: + type: string + hardware_model: + type: string + hardware_serial: + type: string + hardware_vendor: + type: string + hardware_version: + type: string + hostname: + type: string + local_hostname: + type: string + physical_memory: + type: string + system_id: + type: string + uuid: + type: string + example: + collection_time: 2019-06-03T19:41:30.771Z + computer_name: Johnny's MacBook Pro (2) + cpu_brand: Intel(R) Core(TM) i7-7820HQ CPU @ 2.90GHz + cpu_logical_cores: 8 + cpu_microcode: "" + cpu_physical_cores: 4 + cpu_subtype: Intel x86-64h Haswell + cpu_type: x86_64h + hardware_model: "MacBookPro14,3 " + hardware_serial: 111111FFFFFF + hardware_vendor: 'Apple Inc. ' + hardware_version: '1.0 ' + hostname: johnnys-macbook-pro-2.local + local_hostname: Jonnys-MacBook-Pro-2 + physical_memory: "17179869184" + system_id: 5c9e51a13c5146f89bae12d9 + uuid: 11111111-FFFF-1111-FFFF-111111111111 + system-insights-tpm-info: + title: System Insights TPM Info + type: object + properties: + activated: + type: number + collection_time: + type: string + enabled: + type: number + manufacturer_id: + type: number + manufacturer_name: + type: string + manufacturer_version: + type: string + owned: + type: number + physical_presence_version: + type: string + product_name: + type: string + spec_version: + type: string + system_id: + type: string + example: + manufacturer_id: 1.4658129805029452 + manufacturer_version: manufacturer_version + spec_version: spec_version + owned: 5.962133916683182 + system_id: system_id + collection_time: collection_time + manufacturer_name: manufacturer_name + physical_presence_version: physical_presence_version + product_name: product_name + enabled: 6.027456183070403 + activated: 0.8008281904610115 + system-insights-uptime: + title: System Insights Uptime + type: object + properties: + collection_time: + type: string + days: + type: integer + hours: + type: integer + minutes: + type: integer + seconds: + type: integer + system_id: + type: string + total_seconds: + type: string + example: + hours: 6 + seconds: 5 + total_seconds: total_seconds + minutes: 1 + system_id: system_id + days: 0 + collection_time: collection_time + system-insights-usb-devices: + title: System Insights USB Devices + type: object + properties: + class: + type: string + collection_time: + type: string + model: + type: string + model_id: + type: string + protocol: + type: string + removable: + type: integer + serial: + type: string + subclass: + type: string + system_id: + type: string + usb_address: + type: integer + usb_port: + type: integer + vendor: + type: string + vendor_id: + type: string + version: + type: string + example: + usb_address: 6 + system_id: system_id + model_id: model_id + version: version + protocol: protocol + serial: serial + removable: 0 + vendor: vendor + vendor_id: vendor_id + subclass: subclass + model: model + collection_time: collection_time + usb_port: 1 + class: class + system-insights-user-groups: + title: System Insights User Groups + type: object + properties: + collection_time: + type: string + gid: + type: string + system_id: + type: string + uid: + type: string + example: + uid: uid + gid: gid + system_id: system_id + collection_time: collection_time + system-insights-user-ssh-keys: + title: System Insights User SSH Keys + type: object + properties: + collection_time: + type: string + encrypted: + type: integer + path: + type: string + system_id: + type: string + uid: + type: string + example: + path: path + uid: uid + encrypted: 0 + system_id: system_id + collection_time: collection_time + system-insights-userassist: + title: System Insights User Assist + type: object + properties: + collection_time: + type: string + count: + type: number + last_execution_time: + type: number + path: + type: string + sid: + type: string + system_id: + type: string + example: + path: path + system_id: system_id + count: 0.8008281904610115 + collection_time: collection_time + last_execution_time: 6.027456183070403 + sid: sid + system-insights-users: + title: System Insights Users + type: object + properties: + ad_managed: + type: boolean + description: Indicates this account belongs to a AD-managed user + admin: + type: boolean + description: Indicates this account has local administrator privileges + collection_time: + type: string + description: + type: string + directory: + type: string + gid: + type: string + gid_signed: + type: string + last_login: + type: string + description: A Unix timestamp showing the last time this user logged in + managed: + type: boolean + description: Indicates this account belongs to a JumpCloud-managed user + real_user: + type: boolean + description: Indicates this account represents an interactive user account + vs. a system or daemon account + shell: + type: string + suspended: + type: boolean + description: Indicates this account is suspended or locked out + system_id: + type: string + type: + type: string + uid: + type: string + uid_signed: + type: string + username: + type: string + uuid: + type: string + example: + collection_time: 2019-06-03T19:41:29.710Z + description: AppleEvents Daemon + directory: /var/empty + gid: "55" + gid_signed: "55" + shell: /usr/bin/false + system_id: 5c9e51a13c5146f89bae12d9 + type: "" + uid: "55" + uid_signed: "55" + username: _appleevents + uuid: FFFFEEEE-DDDD-CCCC-BBBB-AAAA00000037 + system-insights-wifi-networks: + title: System Insights WiFi Networks + type: object + properties: + auto_login: + type: number + captive_portal: + type: number + collection_time: + type: string + disabled: + type: number + last_connected: + type: number + network_name: + type: string + passpoint: + type: number + possibly_hidden: + type: number + roaming: + type: number + roaming_profile: + type: string + security_type: + type: string + ssid: + type: string + system_id: + type: string + temporarily_disabled: + type: number + example: + temporarily_disabled: 9.301444243932576 + auto_login: 0.8008281904610115 + roaming: 7.061401241503109 + system_id: system_id + network_name: network_name + roaming_profile: roaming_profile + possibly_hidden: 2.3021358869347655 + ssid: ssid + captive_portal: 6.027456183070403 + passpoint: 5.637376656633329 + disabled: 1.4658129805029452 + collection_time: collection_time + security_type: security_type + last_connected: 5.962133916683182 + system-insights-wifi-status: + title: System Insights WiFi Status + type: object + properties: + bssid: + type: string + channel: + type: number + channel_band: + type: number + channel_width: + type: number + collection_time: + type: string + country_code: + type: string + interface: + type: string + mode: + type: string + network_name: + type: string + noise: + type: number + rssi: + type: number + security_type: + type: string + ssid: + type: string + system_id: + type: string + transmit_rate: + type: string + example: + rssi: 5.637376656633329 + bssid: bssid + system_id: system_id + channel: 0.8008281904610115 + network_name: network_name + channel_width: 1.4658129805029452 + interface: interface + ssid: ssid + channel_band: 6.027456183070403 + mode: mode + transmit_rate: transmit_rate + country_code: country_code + noise: 5.962133916683182 + collection_time: collection_time + security_type: security_type + system-insights-windows-security-center: + title: System Insights Windows Security Center + type: object + properties: + antispyware: + type: string + antivirus: + type: string + autoupdate: + type: string + collection_time: + type: string + firewall: + type: string + internet_settings: + type: string + system_id: + type: string + user_account_control: + type: string + windows_security_center_service: + type: string + example: + windows_security_center_service: windows_security_center_service + antivirus: antivirus + firewall: firewall + system_id: system_id + antispyware: antispyware + user_account_control: user_account_control + collection_time: collection_time + internet_settings: internet_settings + autoupdate: autoupdate + system-insights-windows-security-products: + title: System Insights Windows Security Products + type: object + properties: + collection_time: + type: string + name: + type: string + remediation_path: + type: string + signatures_up_to_date: + type: number + state: + type: string + state_timestamp: + type: string + system_id: + type: string + type: + type: string + example: + state_timestamp: state_timestamp + system_id: system_id + name: name + collection_time: collection_time + signatures_up_to_date: 0.8008281904610115 + state: state + type: type + remediation_path: remediation_path + systemfdekey: + title: SystemFDEKey + required: + - key + type: object + properties: + key: + type: string + example: + key: key + workday-fields: + title: Workday Fields + type: object + properties: + name: + type: string + reportUrl: + type: string + workday-input: + title: Workday Input + type: object + properties: + auth: + $ref: '#/components/schemas/auth-input' + name: + type: string + reportUrl: + type: string + example: + auth: + basic: + password: in tempor ipsum quis + username: mollit ex + oauth: + code: non laborum dolore + name: dolore tempor + reportUrl: est sit laboris + workday-output: + title: Workday Output + type: object + properties: + auth: + $ref: '#/components/schemas/workdayoutput_auth' + id: + type: string + lastImport: + type: string + name: + type: string + reportUrl: + type: string + example: + lastImport: lastImport + auth: + basic: + isValid: true + expiry: expiry + message: message + oauth: null + name: name + id: id + reportUrl: reportUrl + workday-worker: + title: Workday Worker + type: object + properties: + attributes: + type: object + properties: {} + example: {} + email: + type: string + firstName: + type: string + lastName: + type: string + username: + type: string + example: + firstName: firstName + lastName: lastName + attributes: {} + email: email + username: username + inline_response_400: + type: object + properties: + message: + type: string + device_id_erase_body: + type: object + properties: + pin: + pattern: "^[0-9]{6}$" + type: string + description: "6-digit PIN, required for MacOS, to erase the device" + example: "123456" + device_id_lock_body: + type: object + properties: + pin: + pattern: "^[0-9]{6}$" + type: string + description: "6-digit PIN, required for MacOS, to lock the device" + example: "123456" + device_id_restart_body: + type: object + properties: + kextPaths: + type: array + description: The string to pass when doing a restart and performing a RebuildKernelCache. + items: + type: string + application_id_logo_body: + properties: + image: + type: string + description: The file to upload. + format: binary + inline_response_200: + type: object + properties: + events_count: + type: integer + results: + type: array + items: + $ref: '#/components/schemas/scheduled-userstate-result' + example: + events_count: 0 + results: + - scheduledJobId: scheduledJobId + systemUserId: systemUserId + scheduledDate: scheduledDate + state: state + - scheduledJobId: scheduledJobId + systemUserId: systemUserId + scheduledDate: scheduledDate + state: state + inline_response_200_1: + type: object + properties: + nextPageToken: + type: string + users: + type: array + items: + $ref: '#/components/schemas/User' + example: + nextPageToken: nextPageToken + users: + - alternateEmail: alternateEmail + addresses: + - country: country + poBox: poBox + streetAddress: streetAddress + postalCode: postalCode + locality: locality + id: id + extendedAddress: extendedAddress + region: region + type: type + - country: country + poBox: poBox + streetAddress: streetAddress + postalCode: postalCode + locality: locality + id: id + extendedAddress: extendedAddress + region: region + type: type + firstname: firstname + costCenter: costCenter + jobTitle: jobTitle + phoneNumbers: + - number: number + id: id + type: type + - number: number + id: id + type: type + lastname: lastname + employeeIdentifier: employeeIdentifier + employeeType: employeeType + company: company + location: location + department: department + email: email + - alternateEmail: alternateEmail + addresses: + - country: country + poBox: poBox + streetAddress: streetAddress + postalCode: postalCode + locality: locality + id: id + extendedAddress: extendedAddress + region: region + type: type + - country: country + poBox: poBox + streetAddress: streetAddress + postalCode: postalCode + locality: locality + id: id + extendedAddress: extendedAddress + region: region + type: type + firstname: firstname + costCenter: costCenter + jobTitle: jobTitle + phoneNumbers: + - number: number + id: id + type: type + - number: number + id: id + type: type + lastname: lastname + employeeIdentifier: employeeIdentifier + employeeType: employeeType + company: company + location: location + department: department + email: email + inline_response_200_2: + type: object + properties: + nextPageToken: + type: string + users: + type: array + items: + $ref: '#/components/schemas/inline_response_200_2_users' + example: + nextPageToken: nextPageToken + users: + - thumbnailPhotoUrl: thumbnailPhotoUrl + familyName: familyName + givenName: givenName + id: id + primaryEmail: primaryEmail + - thumbnailPhotoUrl: thumbnailPhotoUrl + familyName: familyName + givenName: givenName + id: id + primaryEmail: primaryEmail + inline_response_200_3: + type: object + properties: + results: + type: array + items: + $ref: '#/components/schemas/AutotaskContract' + totalCount: + type: integer + example: + totalCount: 0 + results: + - companyId: companyId + name: name + id: id + - companyId: companyId + name: name + id: id + inline_response_200_4: + type: object + properties: + results: + type: array + items: + $ref: '#/components/schemas/AutotaskContractField' + totalCount: + type: integer + example: + totalCount: 0 + results: + - values: + - label: label + value: value + - label: label + value: value + name: name + - values: + - label: label + value: value + - label: label + value: value + name: name + inline_response_200_5: + type: object + properties: + results: + type: array + items: + $ref: '#/components/schemas/AutotaskService' + totalCount: + type: integer + example: + totalCount: 0 + results: + - contractId: contractId + name: name + id: id + - contractId: contractId + name: name + id: id + inline_response_200_6: + type: object + properties: + records: + type: array + items: + $ref: '#/components/schemas/AutotaskMappingResponse' + totalCount: + type: number + example: + records: + - lastSyncDateTime: lastSyncDateTime + service: + name: name + id: id + nonBillableUsers: 0 + contract: + name: name + id: id + organization: + name: name + id: id + company: + name: name + id: id + lastSyncStatus: lastSyncStatus + - lastSyncDateTime: lastSyncDateTime + service: + name: name + id: id + nonBillableUsers: 0 + contract: + name: name + id: id + organization: + name: name + id: id + company: + name: name + id: id + lastSyncStatus: lastSyncStatus + totalCount: 6.027456183070403 + inline_response_200_7: + type: object + properties: + results: + type: array + items: + $ref: '#/components/schemas/ConnectwiseAgreement' + totalCount: + type: integer + example: + totalCount: 0 + results: + - companyId: companyId + name: name + id: id + - companyId: companyId + name: name + id: id + inline_response_200_8: + type: object + properties: + results: + type: array + items: + $ref: '#/components/schemas/ConnectwiseAddition' + totalCount: + type: integer + example: + totalCount: 0 + results: + - name: name + id: id + - name: name + id: id + inline_response_200_9: + type: object + properties: + records: + type: array + items: + $ref: '#/components/schemas/ConnectWiseMappingResponse' + totalCount: + type: number + example: + records: + - agreement: null + lastSyncDateTime: lastSyncDateTime + organization: null + company: null + lastSyncStatus: lastSyncStatus + addition: + name: name + id: id + - agreement: null + lastSyncDateTime: lastSyncDateTime + organization: null + company: null + lastSyncStatus: lastSyncStatus + addition: + name: name + id: id + totalCount: 0.8008281904610115 + ldapservers_id_body: + type: object + properties: + id: + type: string + userLockoutAction: + $ref: '#/components/schemas/LdapServerAction' + userPasswordExpirationAction: + $ref: '#/components/schemas/LdapServerAction' + inline_response_200_10: + type: object + properties: + id: + type: string + name: + type: string + userLockoutAction: + $ref: '#/components/schemas/LdapServerAction' + userPasswordExpirationAction: + $ref: '#/components/schemas/LdapServerAction' + example: + userLockoutAction: disable + name: name + userPasswordExpirationAction: null + id: id + inline_response_200_11: + type: object + properties: + skipToken: + type: string + top: + type: integer + users: + type: array + items: + $ref: '#/components/schemas/inline_response_200_11_users' + example: + top: 0 + skipToken: skipToken + users: + - surname: surname + givenName: givenName + id: id + userPrincipalName: userPrincipalName + - surname: surname + givenName: givenName + id: id + userPrincipalName: userPrincipalName + inline_response_200_12: + type: object + properties: + results: + type: array + items: + $ref: '#/components/schemas/Administrator' + totalCount: + type: integer + example: + totalCount: 0 + results: + - email: joe@example.com + enableMultiFactor: true + firstname: Joe + id: 0123456789abcdef01234567 + lastname: Blough + registered: false + - email: joe@example.com + enableMultiFactor: true + firstname: Joe + id: 0123456789abcdef01234567 + lastname: Blough + registered: false + inline_response_201: + required: + - integrationId + type: object + properties: + integrationId: + type: string + description: The identifier of the created integration + example: + integrationId: integrationId + inline_response_200_13: + type: object + properties: + results: + type: array + items: + $ref: '#/components/schemas/Organization' + totalCount: + type: integer + example: + totalCount: 0 + results: + - id: 624d9eae6849cf3b3f93dc56 + name: Acme Inc + - id: 624d9eae6849cf3b3f93dc56 + name: Acme Inc + group_id_suggestions_body: + type: object + properties: + user_ids: + type: array + items: + type: string + x-examples: + example-1: + user_ids: + - "212345678901234567890123" + - "123456789012345678901234" + pushendpoints_push_endpoint_id_body: + type: object + properties: + name: + type: string + state: + type: string + enum: + - active + - inactive + AuthnPolicyObligations_mfa: + type: object + properties: + required: + type: boolean + example: + required: true + AuthnPolicyObligations_userVerification: + type: object + properties: + requirement: + type: string + enum: + - none + - optional + - required + example: + requirement: none + AutotaskContractField_values: + type: object + properties: + label: + type: string + value: + type: string + example: + label: label + value: value + AutotaskMappingRequest_data: + required: + - company + - contract + - organization + - service + type: object + properties: + company: + $ref: '#/components/schemas/AutotaskMappingRequestCompany' + contract: + $ref: '#/components/schemas/AutotaskMappingRequestContract' + delete: + type: boolean + organization: + $ref: '#/components/schemas/AutotaskMappingRequestOrganization' + service: + $ref: '#/components/schemas/AutotaskMappingRequestService' + AutotaskTicketingAlertConfiguration_priority: + type: object + properties: + id: + type: integer + name: + type: string + example: + name: name + id: 1 + AutotaskTicketingAlertConfiguration_resource: + type: object + properties: + id: + type: integer + name: + type: string + role: + $ref: '#/components/schemas/AutotaskTicketingAlertConfiguration_priority' + example: + role: null + name: name + id: 5 + AutotaskTicketingAlertConfigurationOption_values: + type: object + properties: + label: + type: string + value: + type: integer + example: + label: label + value: 0 + CommandResultList_results: + type: object + properties: + command: + type: string + description: "The ID of the command, from savedAgentCommands." + completedCount: + type: integer + description: The number of devices that we do have results from. + id: + type: string + description: The workflowInstanceId. + pendingCount: + type: integer + description: The number of devices that we haven't received results from. + system: + type: string + description: The ID of the device the command is bound to. + example: + system: system + pendingCount: 6 + id: id + completedCount: 0 + command: command + ConnectWiseMappingRequest_company: + required: + - id + - name + type: object + properties: + id: + type: string + name: + type: string + example: + name: name + id: id + ConnectWiseMappingRequest_organization: + required: + - id + - name + type: object + properties: + id: + minLength: 1 + type: string + name: + type: string + example: + name: name + id: id + ConnectWiseMappingRequest_data: + required: + - addition + - agreement + - company + - organization + type: object + properties: + addition: + type: object + properties: {} + example: {} + agreement: + type: object + properties: {} + example: {} + company: + $ref: '#/components/schemas/ConnectWiseMappingRequest_company' + delete: + type: boolean + organization: + $ref: '#/components/schemas/ConnectWiseMappingRequest_organization' + example: + agreement: {} + organization: + name: name + id: id + company: + name: name + id: id + delete: true + addition: {} + ConnectWiseMappingResponse_addition: + type: object + properties: + id: + type: string + name: + type: string + example: + name: name + id: id + GraphAttributePosixGroups_posixGroups: + required: + - id + - name + type: object + properties: + id: + type: integer + name: + type: string + GraphAttributeRadius_radius_reply: + required: + - name + - value + type: object + properties: + name: + type: string + value: + type: string + GraphAttributeRadius_radius: + type: object + properties: + reply: + type: array + items: + $ref: '#/components/schemas/GraphAttributeRadius_radius_reply' + GraphAttributeSudo_sudo: + required: + - enabled + - withoutPassword + type: object + properties: + enabled: + type: boolean + description: Enables sudo + withoutPassword: + type: boolean + description: Enable sudo without password (requires 'enabled' to be true) + OSRestriction_appleRestrictions: + type: object + properties: + requiresSupervision: + type: boolean + description: Boolean representing if the policy requires the Apple devices + to be MDM supervised + supportedEnrollmentTypes: + type: array + description: The supported Apple enrollment types for this policy + items: + type: string + enum: + - automated + - device + - user + description: "The Apple specific restricitons for this policy, if there are\ + \ any" + PolicyRequest_template: + type: object + properties: + id: + type: string + description: ObjectId uniquely identifying a Policy instance; only allowed + on POST requests. + PolicyTemplateConfigField_tooltip_variables: + type: object + properties: + icon: + type: string + message: + type: string + example: + icon: icon + message: message + PolicyTemplateConfigField_tooltip: + type: object + properties: + template: + type: string + variables: + $ref: '#/components/schemas/PolicyTemplateConfigField_tooltip_variables' + example: + template: template + variables: + icon: icon + message: message + PushEndpointResponse_device: + type: object + properties: + appVersion: + type: string + make: + type: string + model: + type: string + os: + type: string + osVersion: + type: string + uvEnabled: + type: boolean + example: + appVersion: appVersion + os: os + osVersion: osVersion + uvEnabled: true + model: model + make: make + PwmAllUsers_groups: + required: + - id + - name + type: object + properties: + id: + type: string + format: uuid + name: + type: string + example: group name + PwmAllUsers_results: + required: + - email + - id + - name + - status + type: object + properties: + email: + type: string + format: email + groups: + type: array + items: + $ref: '#/components/schemas/PwmAllUsers_groups' + id: + type: string + format: uuid + name: + type: string + example: folder admin + status: + type: string + example: active + PwmOverviewAppVersions_results: + type: object + properties: + usersCount: + type: integer + format: int32 + example: 10 + version: + type: string + example: 1.0.0 + PwmOverviewMain_devices: + type: object + properties: + count: + type: integer + format: int32 + example: 10 + id: + type: integer + format: int32 + example: 1 + name: + type: string + example: ios + QueuedCommandList_results: + type: object + properties: + command: + type: string + description: "The ID of the command, from savedAgentCommands." + id: + type: string + description: The workflowInstanceId. + pendingCount: + type: integer + description: The number of devices that still haven't received the directive. + system: + type: string + description: The ID of the device the command is bound to. + example: + system: system + pendingCount: 0 + id: id + command: command + SharedFolderAccessLevels_results: + required: + - id + - name + type: object + properties: + description: + type: string + example: folder admin description + id: + type: string + format: uuid + name: + type: string + example: folder admin + SharedFolderUsers_results: + required: + - accessLevelId + - accessLevelName + - email + - id + - name + - status + type: object + properties: + accessLevelId: + type: string + format: uuid + accessLevelName: + type: string + example: folder admin + email: + type: string + format: email + id: + type: string + format: uuid + name: + type: string + example: folder admin + status: + type: string + example: active + SharedFoldersList_results: + required: + - createdAt + - itemsInFolder + - name + - usersWithAccess + - uuid + type: object + properties: + createdAt: + type: string + itemsInFolder: + type: integer + format: int32 + example: 15 + name: + type: string + example: folder admin + usersWithAccess: + type: integer + format: int32 + example: 5 + uuid: + type: string + format: uuid + authinput_basic: + type: object + properties: + password: + type: string + username: + type: string + authinput_oauth: + type: object + properties: + code: + type: string + workdayoutput_auth: + type: object + properties: + basic: + $ref: '#/components/schemas/auth-info' + oauth: + $ref: '#/components/schemas/auth-info' + example: + basic: + isValid: true + expiry: expiry + message: message + oauth: null + inline_response_200_2_users: + type: object + properties: + familyName: + type: string + givenName: + type: string + id: + type: string + primaryEmail: + type: string + thumbnailPhotoUrl: + type: string + example: + thumbnailPhotoUrl: thumbnailPhotoUrl + familyName: familyName + givenName: givenName + id: id + primaryEmail: primaryEmail + inline_response_200_11_users: + type: object + properties: + givenName: + type: string + id: + type: string + surname: + type: string + userPrincipalName: + type: string + example: + surname: surname + givenName: givenName + id: id + userPrincipalName: userPrincipalName + responses: + PwmAllUsers: + description: Success + content: + application/json: + schema: + $ref: '#/components/schemas/PwmAllUsers' + PwmOverviewAppVersions: + description: Success + content: + application/json: + schema: + $ref: '#/components/schemas/PwmOverviewAppVersions' + PwmOverviewMain: + description: Success + content: + application/json: + schema: + $ref: '#/components/schemas/PwmOverviewMain' + SharedFolderAccessLevels: + description: Success + content: + application/json: + schema: + $ref: '#/components/schemas/SharedFolderAccessLevels' + SharedFolderDetails: + description: Success + content: + application/json: + schema: + $ref: '#/components/schemas/SharedFolderDetails' + SharedFolderUsers: + description: Success + content: + application/json: + schema: + $ref: '#/components/schemas/SharedFolderUsers' + SharedFoldersList: + description: Success + content: + application/json: + schema: + $ref: '#/components/schemas/SharedFoldersList' + trait:standardErrors:400: + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorDetails' + trait:standardErrors:401: + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + trait:standardErrors:403: + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + trait:standardErrors:404: + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + trait:standardErrors:409: + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + trait:standardErrors:500: + description: "" + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + parameters: + trait:authnfallbackpolicy:resourceType: + name: resource_type + in: path + required: true + style: simple + explode: false + schema: + type: string + trait:fields:fields: + name: fields + in: query + description: "The comma separated fields included in the returned records.\n\ + If omitted, the default list of fields will be returned.\n" + required: false + style: form + explode: false + schema: + type: array + items: + type: string + trait:filter:filter: + name: filter + in: query + description: "A filter to apply to the query.\n\n**Filter structure**: `::`.\n\ + \n**field** = Populate with a valid field from an endpoint response.\n\n**operator**\ + \ = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in.\n\ + _Note: v1 operators differ from v2 operators._\n\n**value** = Populate with\ + \ the value you want to search for. Is case sensitive. Supports wild cards.\n\ + \n**EX:** `GET /api/v2/groups?filter=name:eq:Test+Group`" + required: false + style: form + explode: false + schema: + type: array + items: + type: string + trait:folderId:folderId: + name: folderId + in: path + description: | + Folder Id in uuid format + required: true + style: simple + explode: false + schema: + type: string + format: uuid + trait:graphTargetsActiveDirectory:targets: + name: targets + in: query + description: Targets which a "active_directory" can be associated to. + required: true + style: form + explode: false + schema: + type: array + items: + type: string + enum: + - user + - user_group + trait:graphTargetsApplication:targets: + name: targets + in: query + description: Targets which a "application" can be associated to. + required: true + style: form + explode: false + schema: + type: array + items: + type: string + enum: + - user + - user_group + trait:graphTargetsCommand:targets: + name: targets + in: query + description: Targets which a "command" can be associated to. + required: true + style: form + explode: false + schema: + type: array + items: + type: string + enum: + - system + - system_group + trait:graphTargetsGSuite:targets: + name: targets + in: query + description: Targets which a "g_suite" can be associated to. + required: true + style: form + explode: false + schema: + type: array + items: + type: string + enum: + - user + - user_group + trait:graphTargetsLdapServer:targets: + name: targets + in: query + description: Targets which a "ldap_server" can be associated to. + required: true + style: form + explode: false + schema: + type: array + items: + type: string + enum: + - user + - user_group + trait:graphTargetsOffice365:targets: + name: targets + in: query + description: Targets which a "office_365" can be associated to. + required: true + style: form + explode: false + schema: + type: array + items: + type: string + enum: + - user + - user_group + trait:graphTargetsPolicy:targets: + name: targets + in: query + description: Targets which a "policy" can be associated to. + required: true + style: form + explode: false + schema: + type: array + items: + type: string + enum: + - system + - system_group + trait:graphTargetsPolicyGroup:targets: + name: targets + in: query + description: Targets which a "policy_group" can be associated to. + required: true + style: form + explode: false + schema: + type: array + items: + type: string + enum: + - system + - system_group + trait:graphTargetsRadiusServer:targets: + name: targets + in: query + description: Targets which a "radius_server" can be associated to. + required: true + style: form + explode: false + schema: + type: array + items: + type: string + enum: + - user + - user_group + trait:graphTargetsSoftwareApp:targets: + name: targets + in: query + description: Targets which a "software_app" can be associated to. + required: true + style: form + explode: false + schema: + type: array + items: + type: string + enum: + - system + - system_group + trait:graphTargetsSystem:targets: + name: targets + in: query + description: Targets which a "system" can be associated to. + required: true + style: form + explode: false + schema: + type: array + items: + type: string + enum: + - command + - policy + - policy_group + - user + - user_group + trait:graphTargetsSystemGroup:targets: + name: targets + in: query + description: Targets which a "system_group" can be associated to. + required: true + style: form + explode: false + schema: + type: array + items: + type: string + enum: + - command + - policy + - policy_group + - user + - user_group + trait:graphTargetsUser:targets: + name: targets + in: query + description: Targets which a "user" can be associated to. + required: true + style: form + explode: false + schema: + type: array + items: + type: string + enum: + - active_directory + - application + - g_suite + - ldap_server + - office_365 + - radius_server + - system + - system_group + trait:graphTargetsUserGroup:targets: + name: targets + in: query + description: Targets which a "user_group" can be associated to. + required: true + style: form + explode: false + schema: + type: array + items: + type: string + enum: + - active_directory + - application + - g_suite + - ldap_server + - office_365 + - radius_server + - system + - system_group + trait:gsuite:maxResults: + name: maxResults + in: query + description: Google Directory API maximum number of results per page. See https://developers.google.com/admin-sdk/directory/reference/rest/v1/users/list. + required: false + style: form + explode: true + schema: + type: integer + trait:gsuite:orderBy: + name: orderBy + in: query + description: Google Directory API sort field parameter. See https://developers.google.com/admin-sdk/directory/reference/rest/v1/users/list. + required: false + style: form + explode: true + schema: + type: string + trait:gsuite:pageToken: + name: pageToken + in: query + description: Google Directory API token used to access the next page of results. + See https://developers.google.com/admin-sdk/directory/reference/rest/v1/users/list. + required: false + style: form + explode: true + schema: + type: string + trait:gsuite:query: + name: query + in: query + description: Google Directory API search parameter. See https://developers.google.com/admin-sdk/directory/v1/guides/search-users. + required: false + style: form + explode: true + schema: + type: string + trait:gsuite:sortOrder: + name: sortOrder + in: query + description: Google Directory API sort direction parameter. See https://developers.google.com/admin-sdk/directory/reference/rest/v1/users/list. + required: false + style: form + explode: true + schema: + type: string + trait:limit:limit: + name: limit + in: query + description: The number of records to return at once. Limited to 100. + required: false + style: form + explode: true + schema: + type: integer + default: 10 + trait:limitMax100:limit: + name: limit + in: query + required: false + style: form + explode: true + schema: + maximum: 100 + minimum: 0 + type: integer + default: 10 + trait:listCount:x-total-count: + name: x-total-count + in: header + required: false + style: simple + explode: false + schema: + type: integer + trait:listCount:x-unfiltered-total-count: + name: x-unfiltered-total-count + in: header + description: "If provided in the request with any non-empty value, this header\ + \ will be returned on the response populated with the total count of objects\ + \ without filters taken into account" + required: false + style: simple + explode: false + schema: + type: integer + trait:multiTenantRequestHeaders:x-org-id: + name: x-org-id + in: header + description: Organization identifier that can be obtained from console settings. + required: false + style: simple + explode: false + schema: + type: string + trait:o365:ConsistencyLevel: + name: ConsistencyLevel + in: header + description: Defines the consistency header for O365 requests. See https://docs.microsoft.com/en-us/graph/api/user-list?view=graph-rest-1.0&tabs=http#request-headers + required: false + style: simple + explode: false + schema: + type: string + trait:search:search: + name: search + in: query + description: The search string to query records + required: false + style: form + explode: true + schema: + type: string + trait:singleSort:singleSort: + name: sort + in: query + description: "Field to sort by\nDefault sort is ascending, prefix with `-` to\ + \ sort descending.\n" + required: false + style: form + explode: true + schema: + type: string + trait:skip:skip: + name: skip + in: query + description: The offset into the records to return. + required: false + style: form + explode: true + schema: + minimum: 0 + type: integer + default: 0 + trait:sort:sort: + name: sort + in: query + description: "The comma separated fields used to sort the collection.\nDefault\ + \ sort is ascending, prefix with `-` to sort descending.\n" + required: false + style: form + explode: false + schema: + type: array + items: + type: string + trait:systemContextAuth:Authorization: + name: Authorization + in: header + description: Authorization header for the System Context API + required: false + style: simple + explode: false + schema: + type: string + trait:systemContextAuth:Date: + name: Date + in: header + description: Current date header for the System Context API + required: false + style: simple + explode: false + schema: + type: string + trait:systemInsightsCertificatesFilter:filter: + name: filter + in: query + description: "Supported operators are: eq, in. e.g:\nFilter for single value:\n\ + `filter=field:eq:value`\nFilter value in a list: (note \"pipe\" character:\ + \ `|` separating values)\n`filter=field:in:value1|value2|value3`\nNote: You\ + \ can only filter by `system_id` and `common_name`\n" + required: false + style: form + explode: false + schema: + type: array + items: + type: string + trait:systemInsightsControlsFilter:filter: + name: filter + in: query + description: "Supported operators are: eq, in. e.g:\nFilter for single value:\n\ + `filter=field:eq:value`\nFilter value in a list: (note \"pipe\" character:\ + \ `|` separating values)\n`filter=field:in:value1|value2|value3`\nNote: You\ + \ can only filter by `system_id` and `name`\n" + required: false + style: form + explode: false + schema: + type: array + items: + type: string + trait:systemInsightsFilter:filter: + name: filter + in: query + description: "Supported operators are: eq, in. e.g:\nFilter for single value:\n\ + `filter=field:eq:value`\nFilter for any value in a list: (note \"pipe\" character:\ + \ `|` separating values)\n`filter=field:in:value1|value2|value3`\n" + required: false + style: form + explode: false + schema: + type: array + items: + type: string + trait:systemInsightsFilterUptime:filter: + name: filter + in: query + description: "Supported operators are: eq, gte, in. e.g:\nFilter for single\ + \ value:\n`filter=field:gte:value`\nFilter for any value in a list: (note\ + \ \"pipe\" character: `|` separating values)\n`filter=field:in:value1|value2|value3`\n" + required: false + style: form + explode: false + schema: + type: array + items: + type: string + trait:systemInsightsLimit:limit: + name: limit + in: query + required: false + style: form + explode: true + schema: + maximum: 10000 + minimum: 0 + type: integer + default: 10 + trait:systemInsightsSort:sort: + name: sort + in: query + description: "The comma separated fields used to sort the collection.\nDefault\ + \ sort is ascending, prefix with `-` to sort descending. e.g:\nSort by single\ + \ field:\n`sort=field`\nSort descending by single field:\n`sort=-field`\n\ + Sort by multiple fields:\n`sort=field1,-field2,field3`\n" + required: false + style: form + explode: false + schema: + type: array + items: + type: string + trait:userId:userId: + name: userId + in: path + description: | + User Id in uuid format + required: true + style: simple + explode: false + schema: + type: string + format: uuid + securitySchemes: + x-api-key: + type: apiKey + name: x-api-key + in: header +x-scopes: +- administrators +- administrators.readonly +- anonymous +- applications +- applications.readonly +- authn +- authn.readonly +- commandrunner.legacy +- commands +- commands.readonly +- directories +- directories.readonly +- groups +- groups.readonly +- groups.self +- mdm +- mdm.readonly +- mfa +- mfa.readonly +- organizations +- organizations.billing +- organizations.readonly +- providers +- providers.readonly +- radius +- radius.readonly +- subscriptions.readonly +- systeminsights.readonly +- systems +- systems.readonly +- systems.self +- users +- users.readonly +- users.self +x-tagGroups: +- name: endpoints + tags: + - Active Directory + - Administrators + - Apple MDM + - Applications + - Authentication Policies + - Bulk Job Requests + - Commands + - Command Results + - Custom Emails + - Directories + - Duo + - fde + - G Suite + - G Suite Import + - Graph + - Groups + - Image + - IP Lists + - LDAP Servers + - Logos + - Managed Service Provider + - Office 365 + - Office 365 Import + - Organizations + - Policies + - Policy Group Associations + - Policy Group Members & Membership + - Policy Groups + - Policytemplates + - Providers + - RADIUS Servers + - Samba Domains + - Software Apps + - Subscriptions + - System Group Associations + - System Group Members & Membership + - System Groups + - System Insights + - Systems + - SCIM Import + - User Group Associations + - User Group Members & Membership + - User Groups + - Users + - Workday Import +x-original-swagger-version: "2.0" diff --git a/jcapiv2/api_active_directory.go b/jcapiv2/api_active_directory.go new file mode 100644 index 0000000..78fa4e9 --- /dev/null +++ b/jcapiv2/api_active_directory.go @@ -0,0 +1,1396 @@ + +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +import ( + "context" + "io/ioutil" + "net/http" + "net/url" + "strings" + "fmt" + "github.com/antihax/optional" +) + +// Linger please +var ( + _ context.Context +) + +type ActiveDirectoryApiService service +/* +ActiveDirectoryApiService Delete Active Directory Agent +This endpoint deletes an Active Directory agent. #### Sample Request ``` curl -X DELETE https://console.jumpcloud.com/api/v2/activedirectories/{activedirectory_id}/agents/{agent_id} \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param activedirectoryId + * @param agentId + * @param optional nil or *ActiveDirectoryApiActivedirectoriesAgentsDeleteOpts - Optional Parameters: + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. + +*/ + +type ActiveDirectoryApiActivedirectoriesAgentsDeleteOpts struct { + XOrgId optional.String +} + +func (a *ActiveDirectoryApiService) ActivedirectoriesAgentsDelete(ctx context.Context, activedirectoryId string, agentId string, localVarOptionals *ActiveDirectoryApiActivedirectoriesAgentsDeleteOpts) (*http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Delete") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/activedirectories/{activedirectory_id}/agents/{agent_id}" + localVarPath = strings.Replace(localVarPath, "{"+"activedirectory_id"+"}", fmt.Sprintf("%v", activedirectoryId), -1) + localVarPath = strings.Replace(localVarPath, "{"+"agent_id"+"}", fmt.Sprintf("%v", agentId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarHttpResponse, err + } + + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + return localVarHttpResponse, newErr + } + + return localVarHttpResponse, nil +} +/* +ActiveDirectoryApiService Get Active Directory Agent +This endpoint returns an Active Directory agent. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/activedirectories/{activedirectory_id}/agents/{agent_id} \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param activedirectoryId + * @param agentId + * @param optional nil or *ActiveDirectoryApiActivedirectoriesAgentsGetOpts - Optional Parameters: + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. +@return ActiveDirectoryAgentListOutput +*/ + +type ActiveDirectoryApiActivedirectoriesAgentsGetOpts struct { + XOrgId optional.String +} + +func (a *ActiveDirectoryApiService) ActivedirectoriesAgentsGet(ctx context.Context, activedirectoryId string, agentId string, localVarOptionals *ActiveDirectoryApiActivedirectoriesAgentsGetOpts) (ActiveDirectoryAgentListOutput, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue ActiveDirectoryAgentListOutput + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/activedirectories/{activedirectory_id}/agents/{agent_id}" + localVarPath = strings.Replace(localVarPath, "{"+"activedirectory_id"+"}", fmt.Sprintf("%v", activedirectoryId), -1) + localVarPath = strings.Replace(localVarPath, "{"+"agent_id"+"}", fmt.Sprintf("%v", agentId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v ActiveDirectoryAgentListOutput + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +ActiveDirectoryApiService List Active Directory Agents +This endpoint allows you to list all your Active Directory Agents for a given Instance. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/activedirectories/{activedirectory_id}/agents \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param activedirectoryId + * @param optional nil or *ActiveDirectoryApiActivedirectoriesAgentsListOpts - Optional Parameters: + * @param "Limit" (optional.Int32) - The number of records to return at once. Limited to 100. + * @param "Skip" (optional.Int32) - The offset into the records to return. + * @param "Sort" (optional.Interface of []string) - The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. +@return []ActiveDirectoryAgentListOutput +*/ + +type ActiveDirectoryApiActivedirectoriesAgentsListOpts struct { + Limit optional.Int32 + Skip optional.Int32 + Sort optional.Interface + XOrgId optional.String +} + +func (a *ActiveDirectoryApiService) ActivedirectoriesAgentsList(ctx context.Context, activedirectoryId string, localVarOptionals *ActiveDirectoryApiActivedirectoriesAgentsListOpts) ([]ActiveDirectoryAgentListOutput, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []ActiveDirectoryAgentListOutput + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/activedirectories/{activedirectory_id}/agents" + localVarPath = strings.Replace(localVarPath, "{"+"activedirectory_id"+"}", fmt.Sprintf("%v", activedirectoryId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { + localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Skip.IsSet() { + localVarQueryParams.Add("skip", parameterToString(localVarOptionals.Skip.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Sort.IsSet() { + localVarQueryParams.Add("sort", parameterToString(localVarOptionals.Sort.Value(), "csv")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v []ActiveDirectoryAgentListOutput + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +ActiveDirectoryApiService Create a new Active Directory Agent +This endpoint allows you to create a new Active Directory Agent. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/activedirectories/{activedirectory_id}/agents \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{}' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param activedirectoryId + * @param optional nil or *ActiveDirectoryApiActivedirectoriesAgentsPostOpts - Optional Parameters: + * @param "Body" (optional.Interface of ActiveDirectoryAgentInput) - + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. +@return ActiveDirectoryAgentGetOutput +*/ + +type ActiveDirectoryApiActivedirectoriesAgentsPostOpts struct { + Body optional.Interface + XOrgId optional.String +} + +func (a *ActiveDirectoryApiService) ActivedirectoriesAgentsPost(ctx context.Context, activedirectoryId string, localVarOptionals *ActiveDirectoryApiActivedirectoriesAgentsPostOpts) (ActiveDirectoryAgentGetOutput, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Post") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue ActiveDirectoryAgentGetOutput + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/activedirectories/{activedirectory_id}/agents" + localVarPath = strings.Replace(localVarPath, "{"+"activedirectory_id"+"}", fmt.Sprintf("%v", activedirectoryId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + // body params + if localVarOptionals != nil && localVarOptionals.Body.IsSet() { + + localVarOptionalBody:= localVarOptionals.Body.Value() + localVarPostBody = &localVarOptionalBody + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 201 { + var v ActiveDirectoryAgentGetOutput + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +ActiveDirectoryApiService Delete an Active Directory +This endpoint allows you to delete an Active Directory Instance. #### Sample Request ``` curl -X DELETE https://console.jumpcloud.com/api/v2/activedirectories/{ActiveDirectory_ID} \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param id ObjectID of this Active Directory instance. + * @param optional nil or *ActiveDirectoryApiActivedirectoriesDeleteOpts - Optional Parameters: + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. +@return ActiveDirectoryOutput +*/ + +type ActiveDirectoryApiActivedirectoriesDeleteOpts struct { + XOrgId optional.String +} + +func (a *ActiveDirectoryApiService) ActivedirectoriesDelete(ctx context.Context, id string, localVarOptionals *ActiveDirectoryApiActivedirectoriesDeleteOpts) (ActiveDirectoryOutput, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Delete") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue ActiveDirectoryOutput + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/activedirectories/{id}" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v ActiveDirectoryOutput + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +ActiveDirectoryApiService Get an Active Directory +This endpoint returns a specific Active Directory. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/activedirectories/{ActiveDirectory_ID} \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param id ObjectID of this Active Directory instance. + * @param optional nil or *ActiveDirectoryApiActivedirectoriesGetOpts - Optional Parameters: + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. +@return ActiveDirectoryOutput +*/ + +type ActiveDirectoryApiActivedirectoriesGetOpts struct { + XOrgId optional.String +} + +func (a *ActiveDirectoryApiService) ActivedirectoriesGet(ctx context.Context, id string, localVarOptionals *ActiveDirectoryApiActivedirectoriesGetOpts) (ActiveDirectoryOutput, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue ActiveDirectoryOutput + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/activedirectories/{id}" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v ActiveDirectoryOutput + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +ActiveDirectoryApiService List Active Directories +This endpoint allows you to list all your Active Directory Instances. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/activedirectories/ \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param optional nil or *ActiveDirectoryApiActivedirectoriesListOpts - Optional Parameters: + * @param "Fields" (optional.Interface of []string) - The comma separated fields included in the returned records. If omitted, the default list of fields will be returned. + * @param "Filter" (optional.Interface of []string) - A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` + * @param "Limit" (optional.Int32) - The number of records to return at once. Limited to 100. + * @param "Skip" (optional.Int32) - The offset into the records to return. + * @param "Sort" (optional.Interface of []string) - The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. +@return []ActiveDirectoryOutput +*/ + +type ActiveDirectoryApiActivedirectoriesListOpts struct { + Fields optional.Interface + Filter optional.Interface + Limit optional.Int32 + Skip optional.Int32 + Sort optional.Interface + XOrgId optional.String +} + +func (a *ActiveDirectoryApiService) ActivedirectoriesList(ctx context.Context, localVarOptionals *ActiveDirectoryApiActivedirectoriesListOpts) ([]ActiveDirectoryOutput, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []ActiveDirectoryOutput + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/activedirectories" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Fields.IsSet() { + localVarQueryParams.Add("fields", parameterToString(localVarOptionals.Fields.Value(), "csv")) + } + if localVarOptionals != nil && localVarOptionals.Filter.IsSet() { + localVarQueryParams.Add("filter", parameterToString(localVarOptionals.Filter.Value(), "csv")) + } + if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { + localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Skip.IsSet() { + localVarQueryParams.Add("skip", parameterToString(localVarOptionals.Skip.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Sort.IsSet() { + localVarQueryParams.Add("sort", parameterToString(localVarOptionals.Sort.Value(), "csv")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v []ActiveDirectoryOutput + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +ActiveDirectoryApiService Create a new Active Directory +This endpoint allows you to create a new Active Directory. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/activedirectories/ \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"domain\": \"{DC=AD_domain_name;DC=com}\" }' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param optional nil or *ActiveDirectoryApiActivedirectoriesPostOpts - Optional Parameters: + * @param "Body" (optional.Interface of ActiveDirectoryInput) - + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. +@return ActiveDirectoryOutput +*/ + +type ActiveDirectoryApiActivedirectoriesPostOpts struct { + Body optional.Interface + XOrgId optional.String +} + +func (a *ActiveDirectoryApiService) ActivedirectoriesPost(ctx context.Context, localVarOptionals *ActiveDirectoryApiActivedirectoriesPostOpts) (ActiveDirectoryOutput, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Post") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue ActiveDirectoryOutput + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/activedirectories" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + // body params + if localVarOptionals != nil && localVarOptionals.Body.IsSet() { + + localVarOptionalBody:= localVarOptionals.Body.Value() + localVarPostBody = &localVarOptionalBody + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 201 { + var v ActiveDirectoryOutput + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +ActiveDirectoryApiService List the associations of an Active Directory instance +This endpoint returns the direct associations of this Active Directory instance. A direct association can be a non-homogeneous relationship between 2 different objects, for example Active Directory and Users. #### Sample Request ``` curl -X GET 'https://console.jumpcloud.com/api/v2/activedirectories/{ActiveDirectory_ID}/associations?targets=user \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param activedirectoryId + * @param targets Targets which a \"active_directory\" can be associated to. + * @param optional nil or *ActiveDirectoryApiGraphActiveDirectoryAssociationsListOpts - Optional Parameters: + * @param "Limit" (optional.Int32) - The number of records to return at once. Limited to 100. + * @param "Skip" (optional.Int32) - The offset into the records to return. + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. +@return []GraphConnection +*/ + +type ActiveDirectoryApiGraphActiveDirectoryAssociationsListOpts struct { + Limit optional.Int32 + Skip optional.Int32 + XOrgId optional.String +} + +func (a *ActiveDirectoryApiService) GraphActiveDirectoryAssociationsList(ctx context.Context, activedirectoryId string, targets []string, localVarOptionals *ActiveDirectoryApiGraphActiveDirectoryAssociationsListOpts) ([]GraphConnection, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []GraphConnection + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/activedirectories/{activedirectory_id}/associations" + localVarPath = strings.Replace(localVarPath, "{"+"activedirectory_id"+"}", fmt.Sprintf("%v", activedirectoryId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + localVarQueryParams.Add("targets", parameterToString(targets, "csv")) + if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { + localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Skip.IsSet() { + localVarQueryParams.Add("skip", parameterToString(localVarOptionals.Skip.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v []GraphConnection + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +ActiveDirectoryApiService Manage the associations of an Active Directory instance +This endpoint allows you to manage the _direct_ associations of an Active Directory instance. A direct association can be a non-homogeneous relationship between 2 different objects, for example Active Directory and Users. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/activedirectories/{AD_Instance_ID}/associations \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"op\": \"add\", \"type\": \"user\", \"id\": \"{User_ID}\" }' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param activedirectoryId + * @param optional nil or *ActiveDirectoryApiGraphActiveDirectoryAssociationsPostOpts - Optional Parameters: + * @param "Body" (optional.Interface of GraphOperationActiveDirectory) - + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. + +*/ + +type ActiveDirectoryApiGraphActiveDirectoryAssociationsPostOpts struct { + Body optional.Interface + XOrgId optional.String +} + +func (a *ActiveDirectoryApiService) GraphActiveDirectoryAssociationsPost(ctx context.Context, activedirectoryId string, localVarOptionals *ActiveDirectoryApiGraphActiveDirectoryAssociationsPostOpts) (*http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Post") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/activedirectories/{activedirectory_id}/associations" + localVarPath = strings.Replace(localVarPath, "{"+"activedirectory_id"+"}", fmt.Sprintf("%v", activedirectoryId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + // body params + if localVarOptionals != nil && localVarOptionals.Body.IsSet() { + + localVarOptionalBody:= localVarOptionals.Body.Value() + localVarPostBody = &localVarOptionalBody + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarHttpResponse, err + } + + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + return localVarHttpResponse, newErr + } + + return localVarHttpResponse, nil +} +/* +ActiveDirectoryApiService List the Users bound to an Active Directory instance +This endpoint will return all Users bound to an Active Directory instance, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this Active Directory instance to the corresponding User; this array represents all grouping and/or associations that would have to be removed to deprovision the User from this Active Directory instance. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/activedirectories/{ActiveDirectory_ID}/users \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param activedirectoryId ObjectID of the Active Directory instance. + * @param optional nil or *ActiveDirectoryApiGraphActiveDirectoryTraverseUserOpts - Optional Parameters: + * @param "Filter" (optional.Interface of []string) - A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` + * @param "Limit" (optional.Int32) - The number of records to return at once. Limited to 100. + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. + * @param "Skip" (optional.Int32) - The offset into the records to return. +@return []GraphObjectWithPaths +*/ + +type ActiveDirectoryApiGraphActiveDirectoryTraverseUserOpts struct { + Filter optional.Interface + Limit optional.Int32 + XOrgId optional.String + Skip optional.Int32 +} + +func (a *ActiveDirectoryApiService) GraphActiveDirectoryTraverseUser(ctx context.Context, activedirectoryId string, localVarOptionals *ActiveDirectoryApiGraphActiveDirectoryTraverseUserOpts) ([]GraphObjectWithPaths, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []GraphObjectWithPaths + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/activedirectories/{activedirectory_id}/users" + localVarPath = strings.Replace(localVarPath, "{"+"activedirectory_id"+"}", fmt.Sprintf("%v", activedirectoryId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Filter.IsSet() { + localVarQueryParams.Add("filter", parameterToString(localVarOptionals.Filter.Value(), "csv")) + } + if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { + localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Skip.IsSet() { + localVarQueryParams.Add("skip", parameterToString(localVarOptionals.Skip.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v []GraphObjectWithPaths + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +ActiveDirectoryApiService List the User Groups bound to an Active Directory instance +This endpoint will return all Users Groups bound to an Active Directory instance, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the group's type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this Active Directory instance to the corresponding User Group; this array represents all grouping and/or associations that would have to be removed to deprovision the User Group from this Active Directory instance. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/activedirectories/{ActiveDirectory_ID}/usergroups \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param activedirectoryId ObjectID of the Active Directory instance. + * @param optional nil or *ActiveDirectoryApiGraphActiveDirectoryTraverseUserGroupOpts - Optional Parameters: + * @param "Limit" (optional.Int32) - The number of records to return at once. Limited to 100. + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. + * @param "Skip" (optional.Int32) - The offset into the records to return. + * @param "Filter" (optional.Interface of []string) - A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` +@return []GraphObjectWithPaths +*/ + +type ActiveDirectoryApiGraphActiveDirectoryTraverseUserGroupOpts struct { + Limit optional.Int32 + XOrgId optional.String + Skip optional.Int32 + Filter optional.Interface +} + +func (a *ActiveDirectoryApiService) GraphActiveDirectoryTraverseUserGroup(ctx context.Context, activedirectoryId string, localVarOptionals *ActiveDirectoryApiGraphActiveDirectoryTraverseUserGroupOpts) ([]GraphObjectWithPaths, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []GraphObjectWithPaths + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/activedirectories/{activedirectory_id}/usergroups" + localVarPath = strings.Replace(localVarPath, "{"+"activedirectory_id"+"}", fmt.Sprintf("%v", activedirectoryId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { + localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Skip.IsSet() { + localVarQueryParams.Add("skip", parameterToString(localVarOptionals.Skip.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Filter.IsSet() { + localVarQueryParams.Add("filter", parameterToString(localVarOptionals.Filter.Value(), "csv")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v []GraphObjectWithPaths + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} diff --git a/jcapiv2/api_administrators.go b/jcapiv2/api_administrators.go new file mode 100644 index 0000000..fba7896 --- /dev/null +++ b/jcapiv2/api_administrators.go @@ -0,0 +1,648 @@ + +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +import ( + "context" + "io/ioutil" + "net/http" + "net/url" + "strings" + "fmt" + "github.com/antihax/optional" +) + +// Linger please +var ( + _ context.Context +) + +type AdministratorsApiService service +/* +AdministratorsApiService Allow Adminstrator access to an Organization. +This endpoint allows you to grant Administrator access to an Organization. + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param id + * @param optional nil or *AdministratorsApiAdministratorOrganizationsCreateByAdministratorOpts - Optional Parameters: + * @param "Body" (optional.Interface of AdministratorOrganizationLinkReq) - +@return AdministratorOrganizationLink +*/ + +type AdministratorsApiAdministratorOrganizationsCreateByAdministratorOpts struct { + Body optional.Interface +} + +func (a *AdministratorsApiService) AdministratorOrganizationsCreateByAdministrator(ctx context.Context, id string, localVarOptionals *AdministratorsApiAdministratorOrganizationsCreateByAdministratorOpts) (AdministratorOrganizationLink, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Post") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue AdministratorOrganizationLink + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/administrators/{id}/organizationlinks" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + // body params + if localVarOptionals != nil && localVarOptionals.Body.IsSet() { + + localVarOptionalBody:= localVarOptionals.Body.Value() + localVarPostBody = &localVarOptionalBody + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 201 { + var v AdministratorOrganizationLink + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 400 { + var v ErrorDetails + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 401 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 403 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 404 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 500 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +AdministratorsApiService List the association links between an Administrator and Organizations. +This endpoint returns the association links between an Administrator and Organizations. + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param id + * @param optional nil or *AdministratorsApiAdministratorOrganizationsListByAdministratorOpts - Optional Parameters: + * @param "Limit" (optional.Int32) - The number of records to return at once. Limited to 100. + * @param "Skip" (optional.Int32) - The offset into the records to return. +@return []AdministratorOrganizationLink +*/ + +type AdministratorsApiAdministratorOrganizationsListByAdministratorOpts struct { + Limit optional.Int32 + Skip optional.Int32 +} + +func (a *AdministratorsApiService) AdministratorOrganizationsListByAdministrator(ctx context.Context, id string, localVarOptionals *AdministratorsApiAdministratorOrganizationsListByAdministratorOpts) ([]AdministratorOrganizationLink, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []AdministratorOrganizationLink + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/administrators/{id}/organizationlinks" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { + localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Skip.IsSet() { + localVarQueryParams.Add("skip", parameterToString(localVarOptionals.Skip.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v []AdministratorOrganizationLink + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 400 { + var v ErrorDetails + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 401 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 403 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 404 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 500 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +AdministratorsApiService List the association links between an Organization and Administrators. +This endpoint returns the association links between an Organization and Administrators. + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param id + * @param optional nil or *AdministratorsApiAdministratorOrganizationsListByOrganizationOpts - Optional Parameters: + * @param "Limit" (optional.Int32) - The number of records to return at once. Limited to 100. + * @param "Skip" (optional.Int32) - The offset into the records to return. +@return []AdministratorOrganizationLink +*/ + +type AdministratorsApiAdministratorOrganizationsListByOrganizationOpts struct { + Limit optional.Int32 + Skip optional.Int32 +} + +func (a *AdministratorsApiService) AdministratorOrganizationsListByOrganization(ctx context.Context, id string, localVarOptionals *AdministratorsApiAdministratorOrganizationsListByOrganizationOpts) ([]AdministratorOrganizationLink, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []AdministratorOrganizationLink + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/organizations/{id}/administratorlinks" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { + localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Skip.IsSet() { + localVarQueryParams.Add("skip", parameterToString(localVarOptionals.Skip.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v []AdministratorOrganizationLink + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 400 { + var v ErrorDetails + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 401 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 403 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 404 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 500 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +AdministratorsApiService Remove association between an Administrator and an Organization. +This endpoint removes the association link between an Administrator and an Organization. + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param administratorId + * @param id + +*/ +func (a *AdministratorsApiService) AdministratorOrganizationsRemoveByAdministrator(ctx context.Context, administratorId string, id string) (*http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Delete") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/administrators/{administrator_id}/organizationlinks/{id}" + localVarPath = strings.Replace(localVarPath, "{"+"administrator_id"+"}", fmt.Sprintf("%v", administratorId), -1) + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarHttpResponse, err + } + + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 400 { + var v ErrorDetails + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarHttpResponse, newErr + } + newErr.model = v + return localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 401 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarHttpResponse, newErr + } + newErr.model = v + return localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 403 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarHttpResponse, newErr + } + newErr.model = v + return localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 404 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarHttpResponse, newErr + } + newErr.model = v + return localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 500 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarHttpResponse, newErr + } + newErr.model = v + return localVarHttpResponse, newErr + } + return localVarHttpResponse, newErr + } + + return localVarHttpResponse, nil +} diff --git a/jcapiv2/api_apple_mdm.go b/jcapiv2/api_apple_mdm.go new file mode 100644 index 0000000..11423e9 --- /dev/null +++ b/jcapiv2/api_apple_mdm.go @@ -0,0 +1,2598 @@ + +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +import ( + "context" + "io/ioutil" + "net/http" + "net/url" + "strings" + "fmt" + "github.com/antihax/optional" +) + +// Linger please +var ( + _ context.Context +) + +type AppleMDMApiService service +/* +AppleMDMApiService Get Apple MDM CSR Plist +Retrieves an Apple MDM signed CSR Plist for an organization. The user must supply the returned plist to Apple for signing, and then provide the certificate provided by Apple back into the PUT API. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/applemdms/{APPLE_MDM_ID}/csr \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param appleMdmId + * @param optional nil or *AppleMDMApiApplemdmsCsrgetOpts - Optional Parameters: + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. +@return string +*/ + +type AppleMDMApiApplemdmsCsrgetOpts struct { + XOrgId optional.String +} + +func (a *AppleMDMApiService) ApplemdmsCsrget(ctx context.Context, appleMdmId string, localVarOptionals *AppleMDMApiApplemdmsCsrgetOpts) (string, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue string + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/applemdms/{apple_mdm_id}/csr" + localVarPath = strings.Replace(localVarPath, "{"+"apple_mdm_id"+"}", fmt.Sprintf("%v", appleMdmId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/octet-stream"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v string + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 400 { + var v ErrorDetails + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 401 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 403 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 404 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 409 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 500 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +AppleMDMApiService Delete an Apple MDM +Removes an Apple MDM configuration. Warning: This is a destructive operation and will remove your Apple Push Certificates. We will no longer be able to manage your devices and the only recovery option is to re-register all devices into MDM. #### Sample Request ``` curl -X DELETE https://console.jumpcloud.com/api/v2/applemdms/{id} \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param id + * @param optional nil or *AppleMDMApiApplemdmsDeleteOpts - Optional Parameters: + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. +@return AppleMdm +*/ + +type AppleMDMApiApplemdmsDeleteOpts struct { + XOrgId optional.String +} + +func (a *AppleMDMApiService) ApplemdmsDelete(ctx context.Context, id string, localVarOptionals *AppleMDMApiApplemdmsDeleteOpts) (AppleMdm, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Delete") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue AppleMdm + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/applemdms/{id}" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v AppleMdm + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 400 { + var v ErrorDetails + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 401 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 403 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 404 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 409 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 500 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +AppleMDMApiService Remove an Apple MDM Device's Enrollment +Remove a single Apple MDM device from MDM enrollment. #### Sample Request ``` curl -X DELETE https://console.jumpcloud.com/api/v2/applemdms/{apple_mdm_id}/devices/{device_id} \\ -H 'accept: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param appleMdmId + * @param deviceId + * @param optional nil or *AppleMDMApiApplemdmsDeletedeviceOpts - Optional Parameters: + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. +@return AppleMdmDevice +*/ + +type AppleMDMApiApplemdmsDeletedeviceOpts struct { + XOrgId optional.String +} + +func (a *AppleMDMApiService) ApplemdmsDeletedevice(ctx context.Context, appleMdmId string, deviceId string, localVarOptionals *AppleMDMApiApplemdmsDeletedeviceOpts) (AppleMdmDevice, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Delete") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue AppleMdmDevice + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/applemdms/{apple_mdm_id}/devices/{device_id}" + localVarPath = strings.Replace(localVarPath, "{"+"apple_mdm_id"+"}", fmt.Sprintf("%v", appleMdmId), -1) + localVarPath = strings.Replace(localVarPath, "{"+"device_id"+"}", fmt.Sprintf("%v", deviceId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v AppleMdmDevice + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +AppleMDMApiService Get Apple MDM DEP Public Key +Retrieves an Apple MDM DEP Public Key. + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param appleMdmId + * @param optional nil or *AppleMDMApiApplemdmsDepkeygetOpts - Optional Parameters: + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. +@return string +*/ + +type AppleMDMApiApplemdmsDepkeygetOpts struct { + XOrgId optional.String +} + +func (a *AppleMDMApiService) ApplemdmsDepkeyget(ctx context.Context, appleMdmId string, localVarOptionals *AppleMDMApiApplemdmsDepkeygetOpts) (string, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue string + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/applemdms/{apple_mdm_id}/depkey" + localVarPath = strings.Replace(localVarPath, "{"+"apple_mdm_id"+"}", fmt.Sprintf("%v", appleMdmId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/x-pem-file"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v string + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 400 { + var v ErrorDetails + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 401 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 403 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 404 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 409 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 500 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +AppleMDMApiService Clears the Activation Lock for a Device +Clears the activation lock on the specified device. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/applemdms/{apple_mdm_id}/devices/{device_id}/clearActivationLock \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{}' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param appleMdmId + * @param deviceId + * @param optional nil or *AppleMDMApiApplemdmsDevicesClearActivationLockOpts - Optional Parameters: + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. + +*/ + +type AppleMDMApiApplemdmsDevicesClearActivationLockOpts struct { + XOrgId optional.String +} + +func (a *AppleMDMApiService) ApplemdmsDevicesClearActivationLock(ctx context.Context, appleMdmId string, deviceId string, localVarOptionals *AppleMDMApiApplemdmsDevicesClearActivationLockOpts) (*http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Post") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/applemdms/{apple_mdm_id}/devices/{device_id}/clearActivationLock" + localVarPath = strings.Replace(localVarPath, "{"+"apple_mdm_id"+"}", fmt.Sprintf("%v", appleMdmId), -1) + localVarPath = strings.Replace(localVarPath, "{"+"device_id"+"}", fmt.Sprintf("%v", deviceId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarHttpResponse, err + } + + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 400 { + var v InlineResponse400 + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarHttpResponse, newErr + } + newErr.model = v + return localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 401 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarHttpResponse, newErr + } + newErr.model = v + return localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 403 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarHttpResponse, newErr + } + newErr.model = v + return localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 404 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarHttpResponse, newErr + } + newErr.model = v + return localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 409 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarHttpResponse, newErr + } + newErr.model = v + return localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 500 { + var v InlineResponse400 + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarHttpResponse, newErr + } + newErr.model = v + return localVarHttpResponse, newErr + } + return localVarHttpResponse, newErr + } + + return localVarHttpResponse, nil +} +/* +AppleMDMApiService Refresh activation lock information for a device +Refreshes the activation lock information for a device #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/applemdms/{apple_mdm_id}/devices/{device_id}/refreshActivationLockInformation \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{}' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param appleMdmId + * @param deviceId + * @param optional nil or *AppleMDMApiApplemdmsDevicesRefreshActivationLockInformationOpts - Optional Parameters: + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. + +*/ + +type AppleMDMApiApplemdmsDevicesRefreshActivationLockInformationOpts struct { + XOrgId optional.String +} + +func (a *AppleMDMApiService) ApplemdmsDevicesRefreshActivationLockInformation(ctx context.Context, appleMdmId string, deviceId string, localVarOptionals *AppleMDMApiApplemdmsDevicesRefreshActivationLockInformationOpts) (*http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Post") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/applemdms/{apple_mdm_id}/devices/{device_id}/refreshActivationLockInformation" + localVarPath = strings.Replace(localVarPath, "{"+"apple_mdm_id"+"}", fmt.Sprintf("%v", appleMdmId), -1) + localVarPath = strings.Replace(localVarPath, "{"+"device_id"+"}", fmt.Sprintf("%v", deviceId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarHttpResponse, err + } + + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 400 { + var v InlineResponse400 + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarHttpResponse, newErr + } + newErr.model = v + return localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 401 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarHttpResponse, newErr + } + newErr.model = v + return localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 403 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarHttpResponse, newErr + } + newErr.model = v + return localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 404 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarHttpResponse, newErr + } + newErr.model = v + return localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 409 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarHttpResponse, newErr + } + newErr.model = v + return localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 500 { + var v InlineResponse400 + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarHttpResponse, newErr + } + newErr.model = v + return localVarHttpResponse, newErr + } + return localVarHttpResponse, newErr + } + + return localVarHttpResponse, nil +} +/* +AppleMDMApiService Erase Device +Erases a DEP-enrolled device. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/applemdms/{apple_mdm_id}/devices/{device_id}/erase \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{}' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param appleMdmId + * @param deviceId + * @param optional nil or *AppleMDMApiApplemdmsDeviceseraseOpts - Optional Parameters: + * @param "Body" (optional.Interface of DeviceIdEraseBody) - + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. + +*/ + +type AppleMDMApiApplemdmsDeviceseraseOpts struct { + Body optional.Interface + XOrgId optional.String +} + +func (a *AppleMDMApiService) ApplemdmsDeviceserase(ctx context.Context, appleMdmId string, deviceId string, localVarOptionals *AppleMDMApiApplemdmsDeviceseraseOpts) (*http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Post") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/applemdms/{apple_mdm_id}/devices/{device_id}/erase" + localVarPath = strings.Replace(localVarPath, "{"+"apple_mdm_id"+"}", fmt.Sprintf("%v", appleMdmId), -1) + localVarPath = strings.Replace(localVarPath, "{"+"device_id"+"}", fmt.Sprintf("%v", deviceId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + // body params + if localVarOptionals != nil && localVarOptionals.Body.IsSet() { + + localVarOptionalBody:= localVarOptionals.Body.Value() + localVarPostBody = &localVarOptionalBody + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarHttpResponse, err + } + + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 400 { + var v InlineResponse400 + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarHttpResponse, newErr + } + newErr.model = v + return localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 401 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarHttpResponse, newErr + } + newErr.model = v + return localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 403 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarHttpResponse, newErr + } + newErr.model = v + return localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 404 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarHttpResponse, newErr + } + newErr.model = v + return localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 409 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarHttpResponse, newErr + } + newErr.model = v + return localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 500 { + var v InlineResponse400 + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarHttpResponse, newErr + } + newErr.model = v + return localVarHttpResponse, newErr + } + return localVarHttpResponse, newErr + } + + return localVarHttpResponse, nil +} +/* +AppleMDMApiService List AppleMDM Devices +Lists all Apple MDM devices. The filter and sort queries will allow the following fields: `createdAt` `depRegistered` `enrolled` `id` `osVersion` `serialNumber` `udid` #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/applemdms/{apple_mdm_id}/devices \\ -H 'accept: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{}' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param appleMdmId + * @param optional nil or *AppleMDMApiApplemdmsDeviceslistOpts - Optional Parameters: + * @param "Limit" (optional.Int32) - The number of records to return at once. Limited to 100. + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. + * @param "Skip" (optional.Int32) - The offset into the records to return. + * @param "Filter" (optional.Interface of []string) - A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` + * @param "Sort" (optional.Interface of []string) - The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. + * @param "XTotalCount" (optional.Int32) - +@return []AppleMdmDevice +*/ + +type AppleMDMApiApplemdmsDeviceslistOpts struct { + Limit optional.Int32 + XOrgId optional.String + Skip optional.Int32 + Filter optional.Interface + Sort optional.Interface + XTotalCount optional.Int32 +} + +func (a *AppleMDMApiService) ApplemdmsDeviceslist(ctx context.Context, appleMdmId string, localVarOptionals *AppleMDMApiApplemdmsDeviceslistOpts) ([]AppleMdmDevice, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []AppleMdmDevice + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/applemdms/{apple_mdm_id}/devices" + localVarPath = strings.Replace(localVarPath, "{"+"apple_mdm_id"+"}", fmt.Sprintf("%v", appleMdmId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { + localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Skip.IsSet() { + localVarQueryParams.Add("skip", parameterToString(localVarOptionals.Skip.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Filter.IsSet() { + localVarQueryParams.Add("filter", parameterToString(localVarOptionals.Filter.Value(), "csv")) + } + if localVarOptionals != nil && localVarOptionals.Sort.IsSet() { + localVarQueryParams.Add("sort", parameterToString(localVarOptionals.Sort.Value(), "csv")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if localVarOptionals != nil && localVarOptionals.XTotalCount.IsSet() { + localVarHeaderParams["x-total-count"] = parameterToString(localVarOptionals.XTotalCount.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v []AppleMdmDevice + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 400 { + var v ErrorDetails + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 401 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 403 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 404 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 409 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 500 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +AppleMDMApiService Lock Device +Locks a DEP-enrolled device. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/applemdms/{apple_mdm_id}/devices/{device_id}/lock \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{}' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param appleMdmId + * @param deviceId + * @param optional nil or *AppleMDMApiApplemdmsDeviceslockOpts - Optional Parameters: + * @param "Body" (optional.Interface of DeviceIdLockBody) - + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. + +*/ + +type AppleMDMApiApplemdmsDeviceslockOpts struct { + Body optional.Interface + XOrgId optional.String +} + +func (a *AppleMDMApiService) ApplemdmsDeviceslock(ctx context.Context, appleMdmId string, deviceId string, localVarOptionals *AppleMDMApiApplemdmsDeviceslockOpts) (*http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Post") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/applemdms/{apple_mdm_id}/devices/{device_id}/lock" + localVarPath = strings.Replace(localVarPath, "{"+"apple_mdm_id"+"}", fmt.Sprintf("%v", appleMdmId), -1) + localVarPath = strings.Replace(localVarPath, "{"+"device_id"+"}", fmt.Sprintf("%v", deviceId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + // body params + if localVarOptionals != nil && localVarOptionals.Body.IsSet() { + + localVarOptionalBody:= localVarOptionals.Body.Value() + localVarPostBody = &localVarOptionalBody + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarHttpResponse, err + } + + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 400 { + var v InlineResponse400 + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarHttpResponse, newErr + } + newErr.model = v + return localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 401 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarHttpResponse, newErr + } + newErr.model = v + return localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 403 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarHttpResponse, newErr + } + newErr.model = v + return localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 404 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarHttpResponse, newErr + } + newErr.model = v + return localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 409 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarHttpResponse, newErr + } + newErr.model = v + return localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 500 { + var v InlineResponse400 + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarHttpResponse, newErr + } + newErr.model = v + return localVarHttpResponse, newErr + } + return localVarHttpResponse, newErr + } + + return localVarHttpResponse, nil +} +/* +AppleMDMApiService Restart Device +Restarts a DEP-enrolled device. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/applemdms/{apple_mdm_id}/devices/{device_id}/restart \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{\"kextPaths\": [\"Path1\", \"Path2\"]}' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param appleMdmId + * @param deviceId + * @param optional nil or *AppleMDMApiApplemdmsDevicesrestartOpts - Optional Parameters: + * @param "Body" (optional.Interface of DeviceIdRestartBody) - + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. + +*/ + +type AppleMDMApiApplemdmsDevicesrestartOpts struct { + Body optional.Interface + XOrgId optional.String +} + +func (a *AppleMDMApiService) ApplemdmsDevicesrestart(ctx context.Context, appleMdmId string, deviceId string, localVarOptionals *AppleMDMApiApplemdmsDevicesrestartOpts) (*http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Post") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/applemdms/{apple_mdm_id}/devices/{device_id}/restart" + localVarPath = strings.Replace(localVarPath, "{"+"apple_mdm_id"+"}", fmt.Sprintf("%v", appleMdmId), -1) + localVarPath = strings.Replace(localVarPath, "{"+"device_id"+"}", fmt.Sprintf("%v", deviceId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + // body params + if localVarOptionals != nil && localVarOptionals.Body.IsSet() { + + localVarOptionalBody:= localVarOptionals.Body.Value() + localVarPostBody = &localVarOptionalBody + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarHttpResponse, err + } + + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 400 { + var v InlineResponse400 + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarHttpResponse, newErr + } + newErr.model = v + return localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 401 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarHttpResponse, newErr + } + newErr.model = v + return localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 403 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarHttpResponse, newErr + } + newErr.model = v + return localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 404 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarHttpResponse, newErr + } + newErr.model = v + return localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 409 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarHttpResponse, newErr + } + newErr.model = v + return localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 500 { + var v InlineResponse400 + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarHttpResponse, newErr + } + newErr.model = v + return localVarHttpResponse, newErr + } + return localVarHttpResponse, newErr + } + + return localVarHttpResponse, nil +} +/* +AppleMDMApiService Shut Down Device +Shuts down a DEP-enrolled device. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/applemdms/{apple_mdm_id}/devices/{device_id}/shutdown \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{}' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param appleMdmId + * @param deviceId + * @param optional nil or *AppleMDMApiApplemdmsDevicesshutdownOpts - Optional Parameters: + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. + +*/ + +type AppleMDMApiApplemdmsDevicesshutdownOpts struct { + XOrgId optional.String +} + +func (a *AppleMDMApiService) ApplemdmsDevicesshutdown(ctx context.Context, appleMdmId string, deviceId string, localVarOptionals *AppleMDMApiApplemdmsDevicesshutdownOpts) (*http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Post") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/applemdms/{apple_mdm_id}/devices/{device_id}/shutdown" + localVarPath = strings.Replace(localVarPath, "{"+"apple_mdm_id"+"}", fmt.Sprintf("%v", appleMdmId), -1) + localVarPath = strings.Replace(localVarPath, "{"+"device_id"+"}", fmt.Sprintf("%v", deviceId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarHttpResponse, err + } + + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 400 { + var v InlineResponse400 + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarHttpResponse, newErr + } + newErr.model = v + return localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 401 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarHttpResponse, newErr + } + newErr.model = v + return localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 403 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarHttpResponse, newErr + } + newErr.model = v + return localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 404 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarHttpResponse, newErr + } + newErr.model = v + return localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 409 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarHttpResponse, newErr + } + newErr.model = v + return localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 500 { + var v InlineResponse400 + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarHttpResponse, newErr + } + newErr.model = v + return localVarHttpResponse, newErr + } + return localVarHttpResponse, newErr + } + + return localVarHttpResponse, nil +} +/* +AppleMDMApiService Get an Apple MDM Enrollment Profile +Get an enrollment profile Currently only requesting the mobileconfig is supported. #### Sample Request ``` curl https://console.jumpcloud.com/api/v2/applemdms/{APPLE_MDM_ID}/enrollmentprofiles/{ID} \\ -H 'accept: application/x-apple-aspen-config' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param appleMdmId + * @param id + * @param optional nil or *AppleMDMApiApplemdmsEnrollmentprofilesgetOpts - Optional Parameters: + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. +@return string +*/ + +type AppleMDMApiApplemdmsEnrollmentprofilesgetOpts struct { + XOrgId optional.String +} + +func (a *AppleMDMApiService) ApplemdmsEnrollmentprofilesget(ctx context.Context, appleMdmId string, id string, localVarOptionals *AppleMDMApiApplemdmsEnrollmentprofilesgetOpts) (string, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue string + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/applemdms/{apple_mdm_id}/enrollmentprofiles/{id}" + localVarPath = strings.Replace(localVarPath, "{"+"apple_mdm_id"+"}", fmt.Sprintf("%v", appleMdmId), -1) + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/x-apple-aspen-config"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v string + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +AppleMDMApiService List Apple MDM Enrollment Profiles +Get a list of enrollment profiles for an apple mdm. Note: currently only one enrollment profile is supported. #### Sample Request ``` curl https://console.jumpcloud.com/api/v2/applemdms/{APPLE_MDM_ID}/enrollmentprofiles \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param appleMdmId + * @param optional nil or *AppleMDMApiApplemdmsEnrollmentprofileslistOpts - Optional Parameters: + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. +@return []AppleMdm +*/ + +type AppleMDMApiApplemdmsEnrollmentprofileslistOpts struct { + XOrgId optional.String +} + +func (a *AppleMDMApiService) ApplemdmsEnrollmentprofileslist(ctx context.Context, appleMdmId string, localVarOptionals *AppleMDMApiApplemdmsEnrollmentprofileslistOpts) ([]AppleMdm, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []AppleMdm + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/applemdms/{apple_mdm_id}/enrollmentprofiles" + localVarPath = strings.Replace(localVarPath, "{"+"apple_mdm_id"+"}", fmt.Sprintf("%v", appleMdmId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v []AppleMdm + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +AppleMDMApiService Details of an AppleMDM Device +Gets a single Apple MDM device. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/applemdms/{apple_mdm_id}/devices/{device_id} \\ -H 'accept: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param appleMdmId + * @param deviceId + * @param optional nil or *AppleMDMApiApplemdmsGetdeviceOpts - Optional Parameters: + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. +@return AppleMdmDevice +*/ + +type AppleMDMApiApplemdmsGetdeviceOpts struct { + XOrgId optional.String +} + +func (a *AppleMDMApiService) ApplemdmsGetdevice(ctx context.Context, appleMdmId string, deviceId string, localVarOptionals *AppleMDMApiApplemdmsGetdeviceOpts) (AppleMdmDevice, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue AppleMdmDevice + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/applemdms/{apple_mdm_id}/devices/{device_id}" + localVarPath = strings.Replace(localVarPath, "{"+"apple_mdm_id"+"}", fmt.Sprintf("%v", appleMdmId), -1) + localVarPath = strings.Replace(localVarPath, "{"+"device_id"+"}", fmt.Sprintf("%v", deviceId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v AppleMdmDevice + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 400 { + var v ErrorDetails + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 401 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 403 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 404 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 409 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 500 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +AppleMDMApiService List Apple MDMs +Get a list of all Apple MDM configurations. An empty topic indicates that a signed certificate from Apple has not been provided to the PUT endpoint yet. Note: currently only one MDM configuration per organization is supported. #### Sample Request ``` curl https://console.jumpcloud.com/api/v2/applemdms \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param optional nil or *AppleMDMApiApplemdmsListOpts - Optional Parameters: + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. +@return []AppleMdm +*/ + +type AppleMDMApiApplemdmsListOpts struct { + XOrgId optional.String +} + +func (a *AppleMDMApiService) ApplemdmsList(ctx context.Context, localVarOptionals *AppleMDMApiApplemdmsListOpts) ([]AppleMdm, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []AppleMdm + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/applemdms" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v []AppleMdm + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +AppleMDMApiService Update an Apple MDM +Updates an Apple MDM configuration. This endpoint is used to supply JumpCloud with a signed certificate from Apple in order to finalize the setup and allow JumpCloud to manage your devices. It may also be used to update the DEP Settings. #### Sample Request ``` curl -X PUT https://console.jumpcloud.com/api/v2/applemdms/{ID} \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"name\": \"MDM name\", \"appleSignedCert\": \"{CERTIFICATE}\", \"encryptedDepServerToken\": \"{SERVER_TOKEN}\", \"dep\": { \"welcomeScreen\": { \"title\": \"Welcome\", \"paragraph\": \"In just a few steps, you will be working securely from your Mac.\", \"button\": \"continue\", }, }, }' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param id + * @param optional nil or *AppleMDMApiApplemdmsPutOpts - Optional Parameters: + * @param "Body" (optional.Interface of AppleMdmPatchInput) - + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. +@return AppleMdm +*/ + +type AppleMDMApiApplemdmsPutOpts struct { + Body optional.Interface + XOrgId optional.String +} + +func (a *AppleMDMApiService) ApplemdmsPut(ctx context.Context, id string, localVarOptionals *AppleMDMApiApplemdmsPutOpts) (AppleMdm, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Put") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue AppleMdm + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/applemdms/{id}" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + // body params + if localVarOptionals != nil && localVarOptionals.Body.IsSet() { + + localVarOptionalBody:= localVarOptionals.Body.Value() + localVarPostBody = &localVarOptionalBody + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v AppleMdm + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 400 { + var v ErrorDetails + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 401 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 403 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 404 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 409 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 500 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +AppleMDMApiService Refresh DEP Devices +Refreshes the list of devices that a JumpCloud admin has added to their virtual MDM in Apple Business Manager - ABM so that they can be DEP enrolled with JumpCloud. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/applemdms/{apple_mdm_id}/refreshdepdevices \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{}' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param appleMdmId + * @param optional nil or *AppleMDMApiApplemdmsRefreshdepdevicesOpts - Optional Parameters: + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. + +*/ + +type AppleMDMApiApplemdmsRefreshdepdevicesOpts struct { + XOrgId optional.String +} + +func (a *AppleMDMApiService) ApplemdmsRefreshdepdevices(ctx context.Context, appleMdmId string, localVarOptionals *AppleMDMApiApplemdmsRefreshdepdevicesOpts) (*http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Post") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/applemdms/{apple_mdm_id}/refreshdepdevices" + localVarPath = strings.Replace(localVarPath, "{"+"apple_mdm_id"+"}", fmt.Sprintf("%v", appleMdmId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarHttpResponse, err + } + + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 400 { + var v InlineResponse400 + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarHttpResponse, newErr + } + newErr.model = v + return localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 401 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarHttpResponse, newErr + } + newErr.model = v + return localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 403 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarHttpResponse, newErr + } + newErr.model = v + return localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 404 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarHttpResponse, newErr + } + newErr.model = v + return localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 409 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarHttpResponse, newErr + } + newErr.model = v + return localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 500 { + var v InlineResponse400 + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarHttpResponse, newErr + } + newErr.model = v + return localVarHttpResponse, newErr + } + return localVarHttpResponse, newErr + } + + return localVarHttpResponse, nil +} diff --git a/jcapiv2/api_applications.go b/jcapiv2/api_applications.go new file mode 100644 index 0000000..6444e7d --- /dev/null +++ b/jcapiv2/api_applications.go @@ -0,0 +1,1058 @@ + +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +import ( + "context" + "io/ioutil" + "net/http" + "net/url" + "strings" + "fmt" + "github.com/antihax/optional" + "os" +) + +// Linger please +var ( + _ context.Context +) + +type ApplicationsApiService service +/* +ApplicationsApiService Delete application image +Deletes the specified image from an application + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param applicationId + * @param optional nil or *ApplicationsApiApplicationsDeleteLogoOpts - Optional Parameters: + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. + +*/ + +type ApplicationsApiApplicationsDeleteLogoOpts struct { + XOrgId optional.String +} + +func (a *ApplicationsApiService) ApplicationsDeleteLogo(ctx context.Context, applicationId string, localVarOptionals *ApplicationsApiApplicationsDeleteLogoOpts) (*http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Delete") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/applications/{application_id}/logo" + localVarPath = strings.Replace(localVarPath, "{"+"application_id"+"}", fmt.Sprintf("%v", applicationId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarHttpResponse, err + } + + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 400 { + var v ErrorDetails + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarHttpResponse, newErr + } + newErr.model = v + return localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 401 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarHttpResponse, newErr + } + newErr.model = v + return localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 403 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarHttpResponse, newErr + } + newErr.model = v + return localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 404 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarHttpResponse, newErr + } + newErr.model = v + return localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 409 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarHttpResponse, newErr + } + newErr.model = v + return localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 500 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarHttpResponse, newErr + } + newErr.model = v + return localVarHttpResponse, newErr + } + return localVarHttpResponse, newErr + } + + return localVarHttpResponse, nil +} +/* +ApplicationsApiService Get an Application +The endpoint retrieves an Application. + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param applicationId ObjectID of the Application. + * @param optional nil or *ApplicationsApiApplicationsGetOpts - Optional Parameters: + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. +@return interface{} +*/ + +type ApplicationsApiApplicationsGetOpts struct { + XOrgId optional.String +} + +func (a *ApplicationsApiService) ApplicationsGet(ctx context.Context, applicationId string, localVarOptionals *ApplicationsApiApplicationsGetOpts) (interface{}, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue interface{} + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/applications/{application_id}" + localVarPath = strings.Replace(localVarPath, "{"+"application_id"+"}", fmt.Sprintf("%v", applicationId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v interface{} + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +ApplicationsApiService +This endpoint sets the logo for an application. #### Sample Request ``` curl -X POST 'https://console.jumpcloud.com/api/v2/applications/{Application_ID}/logo \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param applicationId + * @param optional nil or *ApplicationsApiApplicationsPostLogoOpts - Optional Parameters: + * @param "Image" (optional.*os.File) - + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. + +*/ + +type ApplicationsApiApplicationsPostLogoOpts struct { + Image optional.Interface + XOrgId optional.String +} + +func (a *ApplicationsApiService) ApplicationsPostLogo(ctx context.Context, applicationId string, localVarOptionals *ApplicationsApiApplicationsPostLogoOpts) (*http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Post") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/applications/{application_id}/logo" + localVarPath = strings.Replace(localVarPath, "{"+"application_id"+"}", fmt.Sprintf("%v", applicationId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{"multipart/form-data"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + var localVarFile *os.File + if localVarOptionals != nil && localVarOptionals.Image.IsSet() { + localVarFileOk := false + localVarFile, localVarFileOk = localVarOptionals.Image.Value().(*os.File) + if !localVarFileOk { + return nil, reportError("image should be *os.File") + } + } + if localVarFile != nil { + fbs, _ := ioutil.ReadAll(localVarFile) + localVarFileBytes = fbs + localVarFileName = localVarFile.Name() + localVarFile.Close() + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarHttpResponse, err + } + + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 400 { + var v ErrorDetails + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarHttpResponse, newErr + } + newErr.model = v + return localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 401 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarHttpResponse, newErr + } + newErr.model = v + return localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 403 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarHttpResponse, newErr + } + newErr.model = v + return localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 404 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarHttpResponse, newErr + } + newErr.model = v + return localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 409 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarHttpResponse, newErr + } + newErr.model = v + return localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 500 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarHttpResponse, newErr + } + newErr.model = v + return localVarHttpResponse, newErr + } + return localVarHttpResponse, newErr + } + + return localVarHttpResponse, nil +} +/* +ApplicationsApiService List the associations of an Application +This endpoint will return the _direct_ associations of an Application. A direct association can be a non-homogeneous relationship between 2 different objects, for example Applications and User Groups. #### Sample Request ``` curl -X GET 'https://console.jumpcloud.com/api/v2/applications/{Application_ID}/associations?targets=user_group \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param applicationId ObjectID of the Application. + * @param targets Targets which a \"application\" can be associated to. + * @param optional nil or *ApplicationsApiGraphApplicationAssociationsListOpts - Optional Parameters: + * @param "Limit" (optional.Int32) - The number of records to return at once. Limited to 100. + * @param "Skip" (optional.Int32) - The offset into the records to return. + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. +@return []GraphConnection +*/ + +type ApplicationsApiGraphApplicationAssociationsListOpts struct { + Limit optional.Int32 + Skip optional.Int32 + XOrgId optional.String +} + +func (a *ApplicationsApiService) GraphApplicationAssociationsList(ctx context.Context, applicationId string, targets []string, localVarOptionals *ApplicationsApiGraphApplicationAssociationsListOpts) ([]GraphConnection, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []GraphConnection + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/applications/{application_id}/associations" + localVarPath = strings.Replace(localVarPath, "{"+"application_id"+"}", fmt.Sprintf("%v", applicationId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + localVarQueryParams.Add("targets", parameterToString(targets, "csv")) + if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { + localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Skip.IsSet() { + localVarQueryParams.Add("skip", parameterToString(localVarOptionals.Skip.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v []GraphConnection + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +ApplicationsApiService Manage the associations of an Application +This endpoint allows you to manage the _direct_ associations of an Application. A direct association can be a non-homogeneous relationship between 2 different objects, for example Application and User Groups. #### Sample Request ``` curl -X POST 'https://console.jumpcloud.com/api/v2/applications/{Application_ID}/associations' \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"op\": \"add\", \"type\": \"user_group\", \"id\": \"{Group_ID}\" }' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param applicationId ObjectID of the Application. + * @param optional nil or *ApplicationsApiGraphApplicationAssociationsPostOpts - Optional Parameters: + * @param "Body" (optional.Interface of GraphOperationApplication) - + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. + +*/ + +type ApplicationsApiGraphApplicationAssociationsPostOpts struct { + Body optional.Interface + XOrgId optional.String +} + +func (a *ApplicationsApiService) GraphApplicationAssociationsPost(ctx context.Context, applicationId string, localVarOptionals *ApplicationsApiGraphApplicationAssociationsPostOpts) (*http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Post") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/applications/{application_id}/associations" + localVarPath = strings.Replace(localVarPath, "{"+"application_id"+"}", fmt.Sprintf("%v", applicationId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + // body params + if localVarOptionals != nil && localVarOptionals.Body.IsSet() { + + localVarOptionalBody:= localVarOptionals.Body.Value() + localVarPostBody = &localVarOptionalBody + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarHttpResponse, err + } + + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + return localVarHttpResponse, newErr + } + + return localVarHttpResponse, nil +} +/* +ApplicationsApiService List the Users bound to an Application +This endpoint will return all Users bound to an Application, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this Application to the corresponding User; this array represents all grouping and/or associations that would have to be removed to deprovision the User from this Application. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/applications/{Application_ID}/users \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param applicationId ObjectID of the Application. + * @param optional nil or *ApplicationsApiGraphApplicationTraverseUserOpts - Optional Parameters: + * @param "Limit" (optional.Int32) - The number of records to return at once. Limited to 100. + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. + * @param "Skip" (optional.Int32) - The offset into the records to return. + * @param "Filter" (optional.Interface of []string) - A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` +@return []GraphObjectWithPaths +*/ + +type ApplicationsApiGraphApplicationTraverseUserOpts struct { + Limit optional.Int32 + XOrgId optional.String + Skip optional.Int32 + Filter optional.Interface +} + +func (a *ApplicationsApiService) GraphApplicationTraverseUser(ctx context.Context, applicationId string, localVarOptionals *ApplicationsApiGraphApplicationTraverseUserOpts) ([]GraphObjectWithPaths, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []GraphObjectWithPaths + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/applications/{application_id}/users" + localVarPath = strings.Replace(localVarPath, "{"+"application_id"+"}", fmt.Sprintf("%v", applicationId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { + localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Skip.IsSet() { + localVarQueryParams.Add("skip", parameterToString(localVarOptionals.Skip.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Filter.IsSet() { + localVarQueryParams.Add("filter", parameterToString(localVarOptionals.Filter.Value(), "csv")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v []GraphObjectWithPaths + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +ApplicationsApiService List the User Groups bound to an Application +This endpoint will return all Users Groups bound to an Application, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the group's type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this Application to the corresponding User Group; this array represents all grouping and/or associations that would have to be removed to deprovision the User Group from this Application. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/applications/{Application_ID}/usergroups \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param applicationId ObjectID of the Application. + * @param optional nil or *ApplicationsApiGraphApplicationTraverseUserGroupOpts - Optional Parameters: + * @param "Limit" (optional.Int32) - The number of records to return at once. Limited to 100. + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. + * @param "Skip" (optional.Int32) - The offset into the records to return. + * @param "Filter" (optional.Interface of []string) - A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` +@return []GraphObjectWithPaths +*/ + +type ApplicationsApiGraphApplicationTraverseUserGroupOpts struct { + Limit optional.Int32 + XOrgId optional.String + Skip optional.Int32 + Filter optional.Interface +} + +func (a *ApplicationsApiService) GraphApplicationTraverseUserGroup(ctx context.Context, applicationId string, localVarOptionals *ApplicationsApiGraphApplicationTraverseUserGroupOpts) ([]GraphObjectWithPaths, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []GraphObjectWithPaths + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/applications/{application_id}/usergroups" + localVarPath = strings.Replace(localVarPath, "{"+"application_id"+"}", fmt.Sprintf("%v", applicationId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { + localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Skip.IsSet() { + localVarQueryParams.Add("skip", parameterToString(localVarOptionals.Skip.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Filter.IsSet() { + localVarQueryParams.Add("filter", parameterToString(localVarOptionals.Filter.Value(), "csv")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v []GraphObjectWithPaths + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +ApplicationsApiService Get a list of users to import from an Application IdM service provider +Get a list of users to import from an Application IdM service provider. + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param applicationId ObjectID of the Application. + * @param optional nil or *ApplicationsApiImportUsersOpts - Optional Parameters: + * @param "Filter" (optional.String) - Filter users by a search term + * @param "Query" (optional.String) - URL query to merge with the service provider request + * @param "Sort" (optional.String) - Sort users by supported fields + * @param "SortOrder" (optional.String) - + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. + * @param "Limit" (optional.Int32) - The number of records to return at once. Limited to 100. + * @param "Skip" (optional.Int32) - The offset into the records to return. +@return ImportUsersResponse +*/ + +type ApplicationsApiImportUsersOpts struct { + Filter optional.String + Query optional.String + Sort optional.String + SortOrder optional.String + XOrgId optional.String + Limit optional.Int32 + Skip optional.Int32 +} + +func (a *ApplicationsApiService) ImportUsers(ctx context.Context, applicationId string, localVarOptionals *ApplicationsApiImportUsersOpts) (ImportUsersResponse, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue ImportUsersResponse + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/applications/{application_id}/import/users" + localVarPath = strings.Replace(localVarPath, "{"+"application_id"+"}", fmt.Sprintf("%v", applicationId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Filter.IsSet() { + localVarQueryParams.Add("filter", parameterToString(localVarOptionals.Filter.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Query.IsSet() { + localVarQueryParams.Add("query", parameterToString(localVarOptionals.Query.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Sort.IsSet() { + localVarQueryParams.Add("sort", parameterToString(localVarOptionals.Sort.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.SortOrder.IsSet() { + localVarQueryParams.Add("sortOrder", parameterToString(localVarOptionals.SortOrder.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { + localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Skip.IsSet() { + localVarQueryParams.Add("skip", parameterToString(localVarOptionals.Skip.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v ImportUsersResponse + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} diff --git a/jcapiv2/api_authentication_policies.go b/jcapiv2/api_authentication_policies.go new file mode 100644 index 0000000..0a0c3bf --- /dev/null +++ b/jcapiv2/api_authentication_policies.go @@ -0,0 +1,905 @@ + +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +import ( + "context" + "io/ioutil" + "net/http" + "net/url" + "strings" + "fmt" + "github.com/antihax/optional" +) + +// Linger please +var ( + _ context.Context +) + +type AuthenticationPoliciesApiService service +/* +AuthenticationPoliciesApiService Delete Authentication Policy +Delete the specified authentication policy. #### Sample Request ``` curl -X DELETE https://console.jumpcloud.com/api/v2/authn/policies/{id} \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param id Unique identifier of the authentication policy + * @param optional nil or *AuthenticationPoliciesApiAuthnpoliciesDeleteOpts - Optional Parameters: + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. +@return AuthnPolicy +*/ + +type AuthenticationPoliciesApiAuthnpoliciesDeleteOpts struct { + XOrgId optional.String +} + +func (a *AuthenticationPoliciesApiService) AuthnpoliciesDelete(ctx context.Context, id string, localVarOptionals *AuthenticationPoliciesApiAuthnpoliciesDeleteOpts) (AuthnPolicy, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Delete") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue AuthnPolicy + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/authn/policies/{id}" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v AuthnPolicy + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 400 { + var v ErrorDetails + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 401 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 403 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 404 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 409 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 500 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +AuthenticationPoliciesApiService Get an authentication policy +Return a specific authentication policy. #### Sample Request ``` curl https://console.jumpcloud.com/api/v2/authn/policies/{id} \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param id Unique identifier of the authentication policy + * @param optional nil or *AuthenticationPoliciesApiAuthnpoliciesGetOpts - Optional Parameters: + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. +@return AuthnPolicy +*/ + +type AuthenticationPoliciesApiAuthnpoliciesGetOpts struct { + XOrgId optional.String +} + +func (a *AuthenticationPoliciesApiService) AuthnpoliciesGet(ctx context.Context, id string, localVarOptionals *AuthenticationPoliciesApiAuthnpoliciesGetOpts) (AuthnPolicy, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue AuthnPolicy + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/authn/policies/{id}" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v AuthnPolicy + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 400 { + var v ErrorDetails + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 401 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 403 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 404 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 409 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 500 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +AuthenticationPoliciesApiService List Authentication Policies +Get a list of all authentication policies. #### Sample Request ``` curl https://console.jumpcloud.com/api/v2/authn/policies \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param optional nil or *AuthenticationPoliciesApiAuthnpoliciesListOpts - Optional Parameters: + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. + * @param "XTotalCount" (optional.Int32) - + * @param "Limit" (optional.Int32) - The number of records to return at once. Limited to 100. + * @param "Skip" (optional.Int32) - The offset into the records to return. + * @param "Filter" (optional.Interface of []string) - A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` + * @param "Sort" (optional.Interface of []string) - The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. +@return []AuthnPolicy +*/ + +type AuthenticationPoliciesApiAuthnpoliciesListOpts struct { + XOrgId optional.String + XTotalCount optional.Int32 + Limit optional.Int32 + Skip optional.Int32 + Filter optional.Interface + Sort optional.Interface +} + +func (a *AuthenticationPoliciesApiService) AuthnpoliciesList(ctx context.Context, localVarOptionals *AuthenticationPoliciesApiAuthnpoliciesListOpts) ([]AuthnPolicy, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []AuthnPolicy + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/authn/policies" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { + localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Skip.IsSet() { + localVarQueryParams.Add("skip", parameterToString(localVarOptionals.Skip.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Filter.IsSet() { + localVarQueryParams.Add("filter", parameterToString(localVarOptionals.Filter.Value(), "csv")) + } + if localVarOptionals != nil && localVarOptionals.Sort.IsSet() { + localVarQueryParams.Add("sort", parameterToString(localVarOptionals.Sort.Value(), "csv")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if localVarOptionals != nil && localVarOptionals.XTotalCount.IsSet() { + localVarHeaderParams["x-total-count"] = parameterToString(localVarOptionals.XTotalCount.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v []AuthnPolicy + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 400 { + var v ErrorDetails + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 401 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 403 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 404 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 409 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 500 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +AuthenticationPoliciesApiService Patch Authentication Policy +Patch the specified authentication policy. #### Sample Request ``` curl -X PATCH https://console.jumpcloud.com/api/v2/authn/policies/{id} \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"disabled\": false }' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param id Unique identifier of the authentication policy + * @param optional nil or *AuthenticationPoliciesApiAuthnpoliciesPatchOpts - Optional Parameters: + * @param "Body" (optional.Interface of AuthnPolicyInput) - + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. +@return AuthnPolicy +*/ + +type AuthenticationPoliciesApiAuthnpoliciesPatchOpts struct { + Body optional.Interface + XOrgId optional.String +} + +func (a *AuthenticationPoliciesApiService) AuthnpoliciesPatch(ctx context.Context, id string, localVarOptionals *AuthenticationPoliciesApiAuthnpoliciesPatchOpts) (AuthnPolicy, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Patch") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue AuthnPolicy + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/authn/policies/{id}" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + // body params + if localVarOptionals != nil && localVarOptionals.Body.IsSet() { + + localVarOptionalBody:= localVarOptionals.Body.Value() + localVarPostBody = &localVarOptionalBody + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v AuthnPolicy + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 400 { + var v ErrorDetails + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 401 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 403 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 404 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 409 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 500 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +AuthenticationPoliciesApiService Create an Authentication Policy +Create an authentication policy. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/authn/policies \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"name\": \"Sample Policy\", \"disabled\": false, \"effect\": { \"action\": \"allow\" }, \"targets\": { \"users\": { \"inclusions\": [\"ALL\"] }, \"userGroups\": { \"exclusions\": [{USER_GROUP_ID}] }, \"resources\": [ {\"type\": \"user_portal\" } ] }, \"conditions\":{ \"ipAddressIn\": [{IP_LIST_ID}] } }' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param optional nil or *AuthenticationPoliciesApiAuthnpoliciesPostOpts - Optional Parameters: + * @param "Body" (optional.Interface of AuthnPolicyInput) - + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. +@return AuthnPolicy +*/ + +type AuthenticationPoliciesApiAuthnpoliciesPostOpts struct { + Body optional.Interface + XOrgId optional.String +} + +func (a *AuthenticationPoliciesApiService) AuthnpoliciesPost(ctx context.Context, localVarOptionals *AuthenticationPoliciesApiAuthnpoliciesPostOpts) (AuthnPolicy, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Post") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue AuthnPolicy + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/authn/policies" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + // body params + if localVarOptionals != nil && localVarOptionals.Body.IsSet() { + + localVarOptionalBody:= localVarOptionals.Body.Value() + localVarPostBody = &localVarOptionalBody + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 201 { + var v AuthnPolicy + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 400 { + var v ErrorDetails + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 401 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 403 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 404 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 409 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 500 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} diff --git a/jcapiv2/api_bulk_job_requests.go b/jcapiv2/api_bulk_job_requests.go new file mode 100644 index 0000000..b3f46d9 --- /dev/null +++ b/jcapiv2/api_bulk_job_requests.go @@ -0,0 +1,1026 @@ + +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +import ( + "context" + "io/ioutil" + "net/http" + "net/url" + "strings" + "fmt" + "github.com/antihax/optional" +) + +// Linger please +var ( + _ context.Context +) + +type BulkJobRequestsApiService service +/* +BulkJobRequestsApiService Create Scheduled Userstate Job +This endpoint allows you to create scheduled statechange jobs. #### Sample Request ``` curl -X POST \"https://console.jumpcloud.com/api/v2/bulk/userstates\" \\ -H 'x-api-key: {API_KEY}' \\ -H 'Content-Type: application/json' \\ -H 'Accept: application/json' \\ -d '{ \"user_ids\": [\"{User_ID_1}\", \"{User_ID_2}\", \"{User_ID_3}\"], \"state\": \"SUSPENDED\", \"start_date\": \"2000-01-01T00:00:00.000Z\" }' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param optional nil or *BulkJobRequestsApiBulkUserStatesCreateOpts - Optional Parameters: + * @param "Body" (optional.Interface of BulkScheduledStatechangeCreate) - + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. +@return []ScheduledUserstateResult +*/ + +type BulkJobRequestsApiBulkUserStatesCreateOpts struct { + Body optional.Interface + XOrgId optional.String +} + +func (a *BulkJobRequestsApiService) BulkUserStatesCreate(ctx context.Context, localVarOptionals *BulkJobRequestsApiBulkUserStatesCreateOpts) ([]ScheduledUserstateResult, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Post") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []ScheduledUserstateResult + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/bulk/userstates" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + // body params + if localVarOptionals != nil && localVarOptionals.Body.IsSet() { + + localVarOptionalBody:= localVarOptionals.Body.Value() + localVarPostBody = &localVarOptionalBody + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 201 { + var v []ScheduledUserstateResult + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 400 { + var v interface{} + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 401 { + var v interface{} + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 500 { + var v interface{} + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +BulkJobRequestsApiService Delete Scheduled Userstate Job +This endpoint deletes a scheduled statechange job. #### Sample Request ``` curl -X DELETE \"https://console.jumpcloud.com/api/v2/bulk/userstates/{ScheduledJob_ID}\" \\ -H 'x-api-key: {API_KEY}' \\ -H 'Content-Type: application/json' \\ -H 'Accept: application/json' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param id Unique identifier of the scheduled statechange job. + * @param optional nil or *BulkJobRequestsApiBulkUserStatesDeleteOpts - Optional Parameters: + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. + +*/ + +type BulkJobRequestsApiBulkUserStatesDeleteOpts struct { + XOrgId optional.String +} + +func (a *BulkJobRequestsApiService) BulkUserStatesDelete(ctx context.Context, id string, localVarOptionals *BulkJobRequestsApiBulkUserStatesDeleteOpts) (*http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Delete") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/bulk/userstates/{id}" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarHttpResponse, err + } + + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 400 { + var v ErrorDetails + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarHttpResponse, newErr + } + newErr.model = v + return localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 401 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarHttpResponse, newErr + } + newErr.model = v + return localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 403 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarHttpResponse, newErr + } + newErr.model = v + return localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 404 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarHttpResponse, newErr + } + newErr.model = v + return localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 409 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarHttpResponse, newErr + } + newErr.model = v + return localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 500 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarHttpResponse, newErr + } + newErr.model = v + return localVarHttpResponse, newErr + } + return localVarHttpResponse, newErr + } + + return localVarHttpResponse, nil +} +/* +BulkJobRequestsApiService Gets the next scheduled state change for each user in a list of system users +This endpoint is used to lookup the next upcoming scheduled state change for each user in the given list. The users parameter is limited to 100 items per request. #### Sample Request ``` curl -X GET \"https://console.jumpcloud.com/api/v2/bulk/userstates/eventlist/next?users={UserID1},{UserID2},{UserID3}\" \\ -H 'x-api-key: {API_KEY}' \\ -H 'Content-Type: application/json' \\ -H 'Accept: application/json' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param users A list of system user IDs + * @param optional nil or *BulkJobRequestsApiBulkUserStatesGetNextScheduledOpts - Optional Parameters: + * @param "Limit" (optional.Int32) - The number of records to return at once. Limited to 100. + * @param "Skip" (optional.Int32) - The offset into the records to return. +@return InlineResponse200 +*/ + +type BulkJobRequestsApiBulkUserStatesGetNextScheduledOpts struct { + Limit optional.Int32 + Skip optional.Int32 +} + +func (a *BulkJobRequestsApiService) BulkUserStatesGetNextScheduled(ctx context.Context, users []string, localVarOptionals *BulkJobRequestsApiBulkUserStatesGetNextScheduledOpts) (InlineResponse200, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue InlineResponse200 + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/bulk/userstates/eventlist/next" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if len(users) > 100 { + return localVarReturnValue, nil, reportError("users must have less than 100 elements") + } + + localVarQueryParams.Add("users", parameterToString(users, "csv")) + if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { + localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Skip.IsSet() { + localVarQueryParams.Add("skip", parameterToString(localVarOptionals.Skip.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v InlineResponse200 + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 400 { + var v ErrorDetails + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 401 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 403 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 404 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 500 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +BulkJobRequestsApiService List Scheduled Userstate Change Jobs +The endpoint allows you to list scheduled statechange jobs. #### Sample Request ``` curl -X GET \"https://console.jumpcloud.com/api/v2/bulk/userstates\" \\ -H 'x-api-key: {API_KEY}' \\ -H 'Content-Type: application/json' \\ -H 'Accept: application/json' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param optional nil or *BulkJobRequestsApiBulkUserStatesListOpts - Optional Parameters: + * @param "Limit" (optional.Int32) - The number of records to return at once. Limited to 100. + * @param "Filter" (optional.Interface of []string) - A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` + * @param "Skip" (optional.Int32) - The offset into the records to return. + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. + * @param "Userid" (optional.String) - The systemuser id to filter by. +@return []ScheduledUserstateResult +*/ + +type BulkJobRequestsApiBulkUserStatesListOpts struct { + Limit optional.Int32 + Filter optional.Interface + Skip optional.Int32 + XOrgId optional.String + Userid optional.String +} + +func (a *BulkJobRequestsApiService) BulkUserStatesList(ctx context.Context, localVarOptionals *BulkJobRequestsApiBulkUserStatesListOpts) ([]ScheduledUserstateResult, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []ScheduledUserstateResult + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/bulk/userstates" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { + localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Filter.IsSet() { + localVarQueryParams.Add("filter", parameterToString(localVarOptionals.Filter.Value(), "csv")) + } + if localVarOptionals != nil && localVarOptionals.Skip.IsSet() { + localVarQueryParams.Add("skip", parameterToString(localVarOptionals.Skip.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Userid.IsSet() { + localVarQueryParams.Add("userid", parameterToString(localVarOptionals.Userid.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v []ScheduledUserstateResult + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 400 { + var v ErrorDetails + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 401 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 403 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 404 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 409 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 500 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +BulkJobRequestsApiService Bulk Users Create +The endpoint allows you to create a bulk job to asynchronously create users. See [Create a System User](https://docs.jumpcloud.com/api/1.0/index.html#operation/systemusers_post) for the full list of attributes. #### Default User State The `state` of each user in the request can be explicitly passed in or omitted. If `state` is omitted, then the user will get created using the value returned from the [Get an Organization](https://docs.jumpcloud.com/api/1.0/index.html#operation/organizations_get) endpoint. The default user state for bulk created users depends on the `creation-source` header. For `creation-source:jumpcloud:bulk` the default state is stored in `settings.newSystemUserStateDefaults.csvImport`. For other `creation-source` header values, the default state is stored in `settings.newSystemUserStateDefaults.applicationImport` These default state values can be changed in the admin portal settings or by using the [Update an Organization](https://docs.jumpcloud.com/api/1.0/index.html#operation/organization_put) endpoint. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/bulk/users \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '[ { \"email\":\"{email}\", \"firstname\":\"{firstname}\", \"lastname\":\"{firstname}\", \"username\":\"{username}\", \"attributes\":[ { \"name\":\"EmployeeID\", \"value\":\"0000\" }, { \"name\":\"Custom\", \"value\":\"attribute\" } ] } ]' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param optional nil or *BulkJobRequestsApiBulkUsersCreateOpts - Optional Parameters: + * @param "Body" (optional.Interface of []BulkUserCreate) - + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. + * @param "CreationSource" (optional.String) - Defines the creation-source header for gapps, o365 and workdays requests. If the header isn't sent, the default value is `jumpcloud:bulk`, if you send the header with a malformed value you receive a 400 error. +@return JobId +*/ + +type BulkJobRequestsApiBulkUsersCreateOpts struct { + Body optional.Interface + XOrgId optional.String + CreationSource optional.String +} + +func (a *BulkJobRequestsApiService) BulkUsersCreate(ctx context.Context, localVarOptionals *BulkJobRequestsApiBulkUsersCreateOpts) (JobId, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Post") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue JobId + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/bulk/users" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if localVarOptionals != nil && localVarOptionals.CreationSource.IsSet() { + localVarHeaderParams["creation-source"] = parameterToString(localVarOptionals.CreationSource.Value(), "") + } + // body params + if localVarOptionals != nil && localVarOptionals.Body.IsSet() { + + localVarOptionalBody:= localVarOptionals.Body.Value() + localVarPostBody = &localVarOptionalBody + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 201 { + var v JobId + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +BulkJobRequestsApiService List Bulk Users Results +This endpoint will return the results of particular user import or update job request. #### Sample Request ``` curl -X GET \\ https://console.jumpcloud.com/api/v2/bulk/users/{ImportJobID}/results \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param jobId + * @param optional nil or *BulkJobRequestsApiBulkUsersCreateResultsOpts - Optional Parameters: + * @param "Limit" (optional.Int32) - The number of records to return at once. Limited to 100. + * @param "Skip" (optional.Int32) - The offset into the records to return. + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. +@return []JobWorkresult +*/ + +type BulkJobRequestsApiBulkUsersCreateResultsOpts struct { + Limit optional.Int32 + Skip optional.Int32 + XOrgId optional.String +} + +func (a *BulkJobRequestsApiService) BulkUsersCreateResults(ctx context.Context, jobId string, localVarOptionals *BulkJobRequestsApiBulkUsersCreateResultsOpts) ([]JobWorkresult, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []JobWorkresult + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/bulk/users/{job_id}/results" + localVarPath = strings.Replace(localVarPath, "{"+"job_id"+"}", fmt.Sprintf("%v", jobId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { + localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Skip.IsSet() { + localVarQueryParams.Add("skip", parameterToString(localVarOptionals.Skip.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v []JobWorkresult + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +BulkJobRequestsApiService Bulk Users Update +The endpoint allows you to create a bulk job to asynchronously update users. See [Update a System User](https://docs.jumpcloud.com/api/1.0/index.html#operation/systemusers_put) for full list of attributes. #### Sample Request ``` curl -X PATCH https://console.jumpcloud.com/api/v2/bulk/users \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '[ { \"id\":\"5be9fb4ddb01290001e85109\", \"firstname\":\"{UPDATED_FIRSTNAME}\", \"department\":\"{UPDATED_DEPARTMENT}\", \"attributes\":[ {\"name\":\"Custom\",\"value\":\"{ATTRIBUTE_VALUE}\"} ] }, { \"id\":\"5be9fb4ddb01290001e85109\", \"firstname\":\"{UPDATED_FIRSTNAME}\", \"costCenter\":\"{UPDATED_COST_CENTER}\", \"phoneNumbers\":[ {\"type\":\"home\",\"number\":\"{HOME_PHONE_NUMBER}\"}, {\"type\":\"work\",\"number\":\"{WORK_PHONE_NUMBER}\"} ] } ] ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param optional nil or *BulkJobRequestsApiBulkUsersUpdateOpts - Optional Parameters: + * @param "Body" (optional.Interface of []BulkUserUpdate) - + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. +@return JobId +*/ + +type BulkJobRequestsApiBulkUsersUpdateOpts struct { + Body optional.Interface + XOrgId optional.String +} + +func (a *BulkJobRequestsApiService) BulkUsersUpdate(ctx context.Context, localVarOptionals *BulkJobRequestsApiBulkUsersUpdateOpts) (JobId, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Patch") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue JobId + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/bulk/users" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + // body params + if localVarOptionals != nil && localVarOptionals.Body.IsSet() { + + localVarOptionalBody:= localVarOptionals.Body.Value() + localVarPostBody = &localVarOptionalBody + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 201 { + var v JobId + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} diff --git a/jcapiv2/api_command_results.go b/jcapiv2/api_command_results.go new file mode 100644 index 0000000..e016a12 --- /dev/null +++ b/jcapiv2/api_command_results.go @@ -0,0 +1,148 @@ + +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +import ( + "context" + "io/ioutil" + "net/http" + "net/url" + "strings" + "github.com/antihax/optional" +) + +// Linger please +var ( + _ context.Context +) + +type CommandResultsApiService service +/* +CommandResultsApiService List all Command Results by Workflow +This endpoint returns all command results, grouped by workflowInstanceId. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/commandresult/workflows \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key:{API_KEY}' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param optional nil or *CommandResultsApiCommandsListResultsByWorkflowOpts - Optional Parameters: + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. + * @param "Limit" (optional.Int32) - + * @param "Filter" (optional.Interface of []string) - A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` + * @param "Skip" (optional.Int32) - The offset into the records to return. +@return CommandResultList +*/ + +type CommandResultsApiCommandsListResultsByWorkflowOpts struct { + XOrgId optional.String + Limit optional.Int32 + Filter optional.Interface + Skip optional.Int32 +} + +func (a *CommandResultsApiService) CommandsListResultsByWorkflow(ctx context.Context, localVarOptionals *CommandResultsApiCommandsListResultsByWorkflowOpts) (CommandResultList, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue CommandResultList + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/commandresult/workflows" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { + localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Filter.IsSet() { + localVarQueryParams.Add("filter", parameterToString(localVarOptionals.Filter.Value(), "csv")) + } + if localVarOptionals != nil && localVarOptionals.Skip.IsSet() { + localVarQueryParams.Add("skip", parameterToString(localVarOptionals.Skip.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v CommandResultList + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} diff --git a/jcapiv2/api_commands.go b/jcapiv2/api_commands.go new file mode 100644 index 0000000..14d83d5 --- /dev/null +++ b/jcapiv2/api_commands.go @@ -0,0 +1,765 @@ + +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +import ( + "context" + "io/ioutil" + "net/http" + "net/url" + "strings" + "fmt" + "github.com/antihax/optional" +) + +// Linger please +var ( + _ context.Context +) + +type CommandsApiService service +/* +CommandsApiService Cancel all queued commands for an organization by workflow instance Id +This endpoint allows all queued commands for one workflow instance to be canceled. #### Sample Request ``` curl -X DELETE https://console.jumpcloud.com/api/v2/commandqueue/{workflow_instance_id} \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param workflowInstanceId Workflow instance Id of the queued commands to cancel. + * @param optional nil or *CommandsApiCommandsCancelQueuedCommandsByWorkflowInstanceIdOpts - Optional Parameters: + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. + +*/ + +type CommandsApiCommandsCancelQueuedCommandsByWorkflowInstanceIdOpts struct { + XOrgId optional.String +} + +func (a *CommandsApiService) CommandsCancelQueuedCommandsByWorkflowInstanceId(ctx context.Context, workflowInstanceId string, localVarOptionals *CommandsApiCommandsCancelQueuedCommandsByWorkflowInstanceIdOpts) (*http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Delete") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/commandqueue/{workflow_instance_id}" + localVarPath = strings.Replace(localVarPath, "{"+"workflow_instance_id"+"}", fmt.Sprintf("%v", workflowInstanceId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarHttpResponse, err + } + + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 400 { + var v ErrorDetails + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarHttpResponse, newErr + } + newErr.model = v + return localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 401 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarHttpResponse, newErr + } + newErr.model = v + return localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 403 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarHttpResponse, newErr + } + newErr.model = v + return localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 404 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarHttpResponse, newErr + } + newErr.model = v + return localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 409 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarHttpResponse, newErr + } + newErr.model = v + return localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 500 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarHttpResponse, newErr + } + newErr.model = v + return localVarHttpResponse, newErr + } + return localVarHttpResponse, newErr + } + + return localVarHttpResponse, nil +} +/* +CommandsApiService Fetch the queued Commands for an Organization +This endpoint will return all queued Commands for an Organization. Each element will contain the workflow ID, the command name, the launch type (e.g. manual, triggered, or scheduled), the target OS, the number of assigned devices, and the number of pending devices that have not yet ran the command. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/queuedcommand/workflows \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param optional nil or *CommandsApiCommandsGetQueuedCommandsByWorkflowOpts - Optional Parameters: + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. + * @param "Limit" (optional.Int32) - + * @param "Filter" (optional.Interface of []string) - A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` + * @param "Skip" (optional.Int32) - The offset into the records to return. +@return QueuedCommandList +*/ + +type CommandsApiCommandsGetQueuedCommandsByWorkflowOpts struct { + XOrgId optional.String + Limit optional.Int32 + Filter optional.Interface + Skip optional.Int32 +} + +func (a *CommandsApiService) CommandsGetQueuedCommandsByWorkflow(ctx context.Context, localVarOptionals *CommandsApiCommandsGetQueuedCommandsByWorkflowOpts) (QueuedCommandList, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue QueuedCommandList + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/queuedcommand/workflows" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { + localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Filter.IsSet() { + localVarQueryParams.Add("filter", parameterToString(localVarOptionals.Filter.Value(), "csv")) + } + if localVarOptionals != nil && localVarOptionals.Skip.IsSet() { + localVarQueryParams.Add("skip", parameterToString(localVarOptionals.Skip.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v QueuedCommandList + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +CommandsApiService List the associations of a Command +This endpoint will return the _direct_ associations of this Command. A direct association can be a non-homogeneous relationship between 2 different objects, for example Commands and User Groups. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/commands/{Command_ID}/associations?targets=system_group \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param commandId ObjectID of the Command. + * @param targets Targets which a \"command\" can be associated to. + * @param optional nil or *CommandsApiGraphCommandAssociationsListOpts - Optional Parameters: + * @param "Limit" (optional.Int32) - The number of records to return at once. Limited to 100. + * @param "Skip" (optional.Int32) - The offset into the records to return. + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. +@return []GraphConnection +*/ + +type CommandsApiGraphCommandAssociationsListOpts struct { + Limit optional.Int32 + Skip optional.Int32 + XOrgId optional.String +} + +func (a *CommandsApiService) GraphCommandAssociationsList(ctx context.Context, commandId string, targets []string, localVarOptionals *CommandsApiGraphCommandAssociationsListOpts) ([]GraphConnection, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []GraphConnection + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/commands/{command_id}/associations" + localVarPath = strings.Replace(localVarPath, "{"+"command_id"+"}", fmt.Sprintf("%v", commandId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + localVarQueryParams.Add("targets", parameterToString(targets, "csv")) + if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { + localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Skip.IsSet() { + localVarQueryParams.Add("skip", parameterToString(localVarOptionals.Skip.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v []GraphConnection + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +CommandsApiService Manage the associations of a Command +This endpoint will allow you to manage the _direct_ associations of this Command. A direct association can be a non-homogeneous relationship between 2 different objects, for example Commands and User Groups. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/commands/{Command_ID}/associations \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"op\": \"add\", \"type\": \"system_group\", \"id\": \"Group_ID\" }' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param commandId ObjectID of the Command. + * @param optional nil or *CommandsApiGraphCommandAssociationsPostOpts - Optional Parameters: + * @param "Body" (optional.Interface of GraphOperationCommand) - + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. + +*/ + +type CommandsApiGraphCommandAssociationsPostOpts struct { + Body optional.Interface + XOrgId optional.String +} + +func (a *CommandsApiService) GraphCommandAssociationsPost(ctx context.Context, commandId string, localVarOptionals *CommandsApiGraphCommandAssociationsPostOpts) (*http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Post") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/commands/{command_id}/associations" + localVarPath = strings.Replace(localVarPath, "{"+"command_id"+"}", fmt.Sprintf("%v", commandId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + // body params + if localVarOptionals != nil && localVarOptionals.Body.IsSet() { + + localVarOptionalBody:= localVarOptionals.Body.Value() + localVarPostBody = &localVarOptionalBody + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarHttpResponse, err + } + + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + return localVarHttpResponse, newErr + } + + return localVarHttpResponse, nil +} +/* +CommandsApiService List the Systems bound to a Command +This endpoint will return all Systems bound to a Command, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this Command to the corresponding System; this array represents all grouping and/or associations that would have to be removed to deprovision the System from this Command. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/commands/{Command_ID}/systems \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param commandId ObjectID of the Command. + * @param optional nil or *CommandsApiGraphCommandTraverseSystemOpts - Optional Parameters: + * @param "Limit" (optional.Int32) - The number of records to return at once. Limited to 100. + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. + * @param "Skip" (optional.Int32) - The offset into the records to return. + * @param "Filter" (optional.Interface of []string) - A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` +@return []GraphObjectWithPaths +*/ + +type CommandsApiGraphCommandTraverseSystemOpts struct { + Limit optional.Int32 + XOrgId optional.String + Skip optional.Int32 + Filter optional.Interface +} + +func (a *CommandsApiService) GraphCommandTraverseSystem(ctx context.Context, commandId string, localVarOptionals *CommandsApiGraphCommandTraverseSystemOpts) ([]GraphObjectWithPaths, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []GraphObjectWithPaths + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/commands/{command_id}/systems" + localVarPath = strings.Replace(localVarPath, "{"+"command_id"+"}", fmt.Sprintf("%v", commandId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { + localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Skip.IsSet() { + localVarQueryParams.Add("skip", parameterToString(localVarOptionals.Skip.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Filter.IsSet() { + localVarQueryParams.Add("filter", parameterToString(localVarOptionals.Filter.Value(), "csv")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v []GraphObjectWithPaths + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +CommandsApiService List the System Groups bound to a Command +This endpoint will return all System Groups bound to a Command, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the group's type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this Command to the corresponding System Group; this array represents all grouping and/or associations that would have to be removed to deprovision the System Group from this Command. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/commands/{Command_ID}/systemgroups \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param commandId ObjectID of the Command. + * @param optional nil or *CommandsApiGraphCommandTraverseSystemGroupOpts - Optional Parameters: + * @param "Limit" (optional.Int32) - The number of records to return at once. Limited to 100. + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. + * @param "Skip" (optional.Int32) - The offset into the records to return. + * @param "Filter" (optional.Interface of []string) - A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` +@return []GraphObjectWithPaths +*/ + +type CommandsApiGraphCommandTraverseSystemGroupOpts struct { + Limit optional.Int32 + XOrgId optional.String + Skip optional.Int32 + Filter optional.Interface +} + +func (a *CommandsApiService) GraphCommandTraverseSystemGroup(ctx context.Context, commandId string, localVarOptionals *CommandsApiGraphCommandTraverseSystemGroupOpts) ([]GraphObjectWithPaths, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []GraphObjectWithPaths + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/commands/{command_id}/systemgroups" + localVarPath = strings.Replace(localVarPath, "{"+"command_id"+"}", fmt.Sprintf("%v", commandId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { + localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Skip.IsSet() { + localVarQueryParams.Add("skip", parameterToString(localVarOptionals.Skip.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Filter.IsSet() { + localVarQueryParams.Add("filter", parameterToString(localVarOptionals.Filter.Value(), "csv")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v []GraphObjectWithPaths + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} diff --git a/jcapiv2/api_custom_emails.go b/jcapiv2/api_custom_emails.go new file mode 100644 index 0000000..d65e1d8 --- /dev/null +++ b/jcapiv2/api_custom_emails.go @@ -0,0 +1,833 @@ + +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +import ( + "context" + "io/ioutil" + "net/http" + "net/url" + "strings" + "fmt" + "github.com/antihax/optional" +) + +// Linger please +var ( + _ context.Context +) + +type CustomEmailsApiService service +/* +CustomEmailsApiService Create custom email configuration +Create the custom email configuration for the specified custom email type + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param optional nil or *CustomEmailsApiCustomEmailsCreateOpts - Optional Parameters: + * @param "Body" (optional.Interface of CustomEmail) - + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. +@return CustomEmail +*/ + +type CustomEmailsApiCustomEmailsCreateOpts struct { + Body optional.Interface + XOrgId optional.String +} + +func (a *CustomEmailsApiService) CustomEmailsCreate(ctx context.Context, localVarOptionals *CustomEmailsApiCustomEmailsCreateOpts) (CustomEmail, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Post") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue CustomEmail + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/customemails" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + // body params + if localVarOptionals != nil && localVarOptionals.Body.IsSet() { + + localVarOptionalBody:= localVarOptionals.Body.Value() + localVarPostBody = &localVarOptionalBody + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 201 { + var v CustomEmail + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 400 { + var v ErrorDetails + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 401 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 403 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 404 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 409 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 500 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +CustomEmailsApiService Delete custom email configuration +Delete the custom email configuration for the specified custom email type + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param customEmailType + * @param optional nil or *CustomEmailsApiCustomEmailsDestroyOpts - Optional Parameters: + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. + +*/ + +type CustomEmailsApiCustomEmailsDestroyOpts struct { + XOrgId optional.String +} + +func (a *CustomEmailsApiService) CustomEmailsDestroy(ctx context.Context, customEmailType string, localVarOptionals *CustomEmailsApiCustomEmailsDestroyOpts) (*http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Delete") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/customemails/{custom_email_type}" + localVarPath = strings.Replace(localVarPath, "{"+"custom_email_type"+"}", fmt.Sprintf("%v", customEmailType), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarHttpResponse, err + } + + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 400 { + var v ErrorDetails + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarHttpResponse, newErr + } + newErr.model = v + return localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 401 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarHttpResponse, newErr + } + newErr.model = v + return localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 403 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarHttpResponse, newErr + } + newErr.model = v + return localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 404 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarHttpResponse, newErr + } + newErr.model = v + return localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 409 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarHttpResponse, newErr + } + newErr.model = v + return localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 500 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarHttpResponse, newErr + } + newErr.model = v + return localVarHttpResponse, newErr + } + return localVarHttpResponse, newErr + } + + return localVarHttpResponse, nil +} +/* +CustomEmailsApiService List custom email templates +Get the list of custom email templates + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). +@return []CustomEmailTemplate +*/ +func (a *CustomEmailsApiService) CustomEmailsGetTemplates(ctx context.Context) ([]CustomEmailTemplate, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []CustomEmailTemplate + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/customemail/templates" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v []CustomEmailTemplate + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 400 { + var v ErrorDetails + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 401 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 403 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 500 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +CustomEmailsApiService Get custom email configuration +Get the custom email configuration for the specified custom email type + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param customEmailType + * @param optional nil or *CustomEmailsApiCustomEmailsReadOpts - Optional Parameters: + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. +@return CustomEmail +*/ + +type CustomEmailsApiCustomEmailsReadOpts struct { + XOrgId optional.String +} + +func (a *CustomEmailsApiService) CustomEmailsRead(ctx context.Context, customEmailType string, localVarOptionals *CustomEmailsApiCustomEmailsReadOpts) (CustomEmail, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue CustomEmail + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/customemails/{custom_email_type}" + localVarPath = strings.Replace(localVarPath, "{"+"custom_email_type"+"}", fmt.Sprintf("%v", customEmailType), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v CustomEmail + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 400 { + var v ErrorDetails + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 401 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 403 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 404 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 409 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 500 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +CustomEmailsApiService Update custom email configuration +Update the custom email configuration for the specified custom email type + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param customEmailType + * @param optional nil or *CustomEmailsApiCustomEmailsUpdateOpts - Optional Parameters: + * @param "Body" (optional.Interface of CustomEmail) - + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. +@return CustomEmail +*/ + +type CustomEmailsApiCustomEmailsUpdateOpts struct { + Body optional.Interface + XOrgId optional.String +} + +func (a *CustomEmailsApiService) CustomEmailsUpdate(ctx context.Context, customEmailType string, localVarOptionals *CustomEmailsApiCustomEmailsUpdateOpts) (CustomEmail, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Put") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue CustomEmail + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/customemails/{custom_email_type}" + localVarPath = strings.Replace(localVarPath, "{"+"custom_email_type"+"}", fmt.Sprintf("%v", customEmailType), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + // body params + if localVarOptionals != nil && localVarOptionals.Body.IsSet() { + + localVarOptionalBody:= localVarOptionals.Body.Value() + localVarPostBody = &localVarOptionalBody + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v CustomEmail + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 400 { + var v ErrorDetails + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 401 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 403 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 404 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 409 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 500 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} diff --git a/jcapiv2/api_directories.go b/jcapiv2/api_directories.go new file mode 100644 index 0000000..4c39eb0 --- /dev/null +++ b/jcapiv2/api_directories.go @@ -0,0 +1,163 @@ + +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +import ( + "context" + "io/ioutil" + "net/http" + "net/url" + "strings" + "github.com/antihax/optional" +) + +// Linger please +var ( + _ context.Context +) + +type DirectoriesApiService service +/* +DirectoriesApiService List All Directories +This endpoint returns all active directories (LDAP, O365 Suite, G-Suite). #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param optional nil or *DirectoriesApiDirectoriesListOpts - Optional Parameters: + * @param "Fields" (optional.Interface of []string) - The comma separated fields included in the returned records. If omitted, the default list of fields will be returned. + * @param "Limit" (optional.Int32) - The number of records to return at once. Limited to 100. + * @param "Sort" (optional.Interface of []string) - The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. + * @param "Skip" (optional.Int32) - The offset into the records to return. + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. +@return []Directory +*/ + +type DirectoriesApiDirectoriesListOpts struct { + Fields optional.Interface + Limit optional.Int32 + Sort optional.Interface + Skip optional.Int32 + XOrgId optional.String +} + +func (a *DirectoriesApiService) DirectoriesList(ctx context.Context, localVarOptionals *DirectoriesApiDirectoriesListOpts) ([]Directory, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []Directory + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/directories" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Fields.IsSet() { + localVarQueryParams.Add("fields", parameterToString(localVarOptionals.Fields.Value(), "csv")) + } + if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { + localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Sort.IsSet() { + localVarQueryParams.Add("sort", parameterToString(localVarOptionals.Sort.Value(), "csv")) + } + if localVarOptionals != nil && localVarOptionals.Skip.IsSet() { + localVarQueryParams.Add("skip", parameterToString(localVarOptionals.Skip.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v []Directory + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 0 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} diff --git a/jcapiv2/api_duo.go b/jcapiv2/api_duo.go new file mode 100644 index 0000000..2022476 --- /dev/null +++ b/jcapiv2/api_duo.go @@ -0,0 +1,1438 @@ + +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +import ( + "context" + "io/ioutil" + "net/http" + "net/url" + "strings" + "fmt" + "github.com/antihax/optional" +) + +// Linger please +var ( + _ context.Context +) + +type DuoApiService service +/* +DuoApiService Delete a Duo Account +Removes the specified Duo account, an error will be returned if the account has some Duo application used in a protected resource. #### Sample Request ``` curl -X DELETE https://console.jumpcloud.com/api/v2/duo/accounts/{id} \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param id ObjectID of the Duo Account + * @param optional nil or *DuoApiDuoAccountDeleteOpts - Optional Parameters: + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. +@return DuoAccount +*/ + +type DuoApiDuoAccountDeleteOpts struct { + XOrgId optional.String +} + +func (a *DuoApiService) DuoAccountDelete(ctx context.Context, id string, localVarOptionals *DuoApiDuoAccountDeleteOpts) (DuoAccount, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Delete") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue DuoAccount + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/duo/accounts/{id}" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v DuoAccount + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 400 { + var v ErrorDetails + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 401 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 403 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 404 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 409 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 500 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +DuoApiService Get a Duo Acount +This endpoint returns a specific Duo account. #### Sample Request ``` curl https://console.jumpcloud.com/api/v2/duo/accounts/{id} \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param id ObjectID of the Duo Account + * @param optional nil or *DuoApiDuoAccountGetOpts - Optional Parameters: + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. +@return DuoAccount +*/ + +type DuoApiDuoAccountGetOpts struct { + XOrgId optional.String +} + +func (a *DuoApiService) DuoAccountGet(ctx context.Context, id string, localVarOptionals *DuoApiDuoAccountGetOpts) (DuoAccount, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue DuoAccount + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/duo/accounts/{id}" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v DuoAccount + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +DuoApiService List Duo Accounts +This endpoint returns all the Duo accounts for your organization. Note: There can currently only be one Duo account for your organization. #### Sample Request ``` curl https://console.jumpcloud.com/api/v2/duo/accounts \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param optional nil or *DuoApiDuoAccountListOpts - Optional Parameters: + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. +@return []DuoAccount +*/ + +type DuoApiDuoAccountListOpts struct { + XOrgId optional.String +} + +func (a *DuoApiService) DuoAccountList(ctx context.Context, localVarOptionals *DuoApiDuoAccountListOpts) ([]DuoAccount, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []DuoAccount + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/duo/accounts" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v []DuoAccount + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +DuoApiService Create Duo Account +Registers a Duo account for an organization. Only one Duo account will be allowed, in case an organization has a Duo account already a 409 (Conflict) code will be returned. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/duo/accounts \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{}' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param optional nil or *DuoApiDuoAccountPostOpts - Optional Parameters: + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. +@return DuoAccount +*/ + +type DuoApiDuoAccountPostOpts struct { + XOrgId optional.String +} + +func (a *DuoApiService) DuoAccountPost(ctx context.Context, localVarOptionals *DuoApiDuoAccountPostOpts) (DuoAccount, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Post") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue DuoAccount + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/duo/accounts" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 201 { + var v DuoAccount + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 400 { + var v ErrorDetails + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 401 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 403 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 404 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 409 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 500 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +DuoApiService Delete a Duo Application +Deletes the specified Duo application, an error will be returned if the application is used in a protected resource. #### Sample Request ``` curl -X DELETE https://console.jumpcloud.com/api/v2/duo/accounts/{ACCOUNT_ID}/applications/{APPLICATION_ID} \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}'' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param accountId + * @param applicationId + * @param optional nil or *DuoApiDuoApplicationDeleteOpts - Optional Parameters: + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. +@return DuoApplication +*/ + +type DuoApiDuoApplicationDeleteOpts struct { + XOrgId optional.String +} + +func (a *DuoApiService) DuoApplicationDelete(ctx context.Context, accountId string, applicationId string, localVarOptionals *DuoApiDuoApplicationDeleteOpts) (DuoApplication, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Delete") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue DuoApplication + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/duo/accounts/{account_id}/applications/{application_id}" + localVarPath = strings.Replace(localVarPath, "{"+"account_id"+"}", fmt.Sprintf("%v", accountId), -1) + localVarPath = strings.Replace(localVarPath, "{"+"application_id"+"}", fmt.Sprintf("%v", applicationId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v DuoApplication + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 400 { + var v ErrorDetails + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 401 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 403 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 404 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 409 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 500 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +DuoApiService Get a Duo application +This endpoint returns a specific Duo application that is associated with the specified Duo account. #### Sample Request ``` curl https://console.jumpcloud.com/api/v2/duo/accounts/{ACCOUNT_ID}/applications/{APPLICATION_ID} \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param accountId + * @param applicationId + * @param optional nil or *DuoApiDuoApplicationGetOpts - Optional Parameters: + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. +@return DuoApplication +*/ + +type DuoApiDuoApplicationGetOpts struct { + XOrgId optional.String +} + +func (a *DuoApiService) DuoApplicationGet(ctx context.Context, accountId string, applicationId string, localVarOptionals *DuoApiDuoApplicationGetOpts) (DuoApplication, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue DuoApplication + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/duo/accounts/{account_id}/applications/{application_id}" + localVarPath = strings.Replace(localVarPath, "{"+"account_id"+"}", fmt.Sprintf("%v", accountId), -1) + localVarPath = strings.Replace(localVarPath, "{"+"application_id"+"}", fmt.Sprintf("%v", applicationId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v DuoApplication + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 400 { + var v ErrorDetails + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 401 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 403 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 404 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 409 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 500 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +DuoApiService List Duo Applications +This endpoint returns all the Duo applications for the specified Duo account. Note: There can currently only be one Duo application for your organization. #### Sample Request ``` curl https://console.jumpcloud.com/api/v2/duo/accounts/{ACCOUNT_ID}/applications \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param accountId + * @param optional nil or *DuoApiDuoApplicationListOpts - Optional Parameters: + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. +@return []DuoApplication +*/ + +type DuoApiDuoApplicationListOpts struct { + XOrgId optional.String +} + +func (a *DuoApiService) DuoApplicationList(ctx context.Context, accountId string, localVarOptionals *DuoApiDuoApplicationListOpts) ([]DuoApplication, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []DuoApplication + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/duo/accounts/{account_id}/applications" + localVarPath = strings.Replace(localVarPath, "{"+"account_id"+"}", fmt.Sprintf("%v", accountId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v []DuoApplication + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 400 { + var v ErrorDetails + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 401 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 403 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 404 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 409 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 500 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +DuoApiService Create Duo Application +Creates a Duo application for your organization and the specified account. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/duo/accounts/{ACCOUNT_ID}/applications \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"name\": \"Application Name\", \"apiHost\": \"api-1234.duosecurity.com\", \"integrationKey\": \"1234\", \"secretKey\": \"5678\" }' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param accountId + * @param optional nil or *DuoApiDuoApplicationPostOpts - Optional Parameters: + * @param "Body" (optional.Interface of DuoApplicationReq) - + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. +@return DuoApplication +*/ + +type DuoApiDuoApplicationPostOpts struct { + Body optional.Interface + XOrgId optional.String +} + +func (a *DuoApiService) DuoApplicationPost(ctx context.Context, accountId string, localVarOptionals *DuoApiDuoApplicationPostOpts) (DuoApplication, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Post") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue DuoApplication + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/duo/accounts/{account_id}/applications" + localVarPath = strings.Replace(localVarPath, "{"+"account_id"+"}", fmt.Sprintf("%v", accountId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + // body params + if localVarOptionals != nil && localVarOptionals.Body.IsSet() { + + localVarOptionalBody:= localVarOptionals.Body.Value() + localVarPostBody = &localVarOptionalBody + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 201 { + var v DuoApplication + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 400 { + var v ErrorDetails + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 401 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 403 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 404 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 409 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 500 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +DuoApiService Update Duo Application +Updates the specified Duo application. #### Sample Request ``` curl -X PUT https://console.jumpcloud.com/api/v2/duo/accounts/{ACCOUNT_ID}/applications/{APPLICATION_ID} \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"name\": \"Application Name\", \"apiHost\": \"api-1234.duosecurity.com\", \"integrationKey\": \"1234\", \"secretKey\": \"5678\" }' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param accountId + * @param applicationId + * @param optional nil or *DuoApiDuoApplicationUpdateOpts - Optional Parameters: + * @param "Body" (optional.Interface of DuoApplicationUpdateReq) - + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. +@return DuoApplication +*/ + +type DuoApiDuoApplicationUpdateOpts struct { + Body optional.Interface + XOrgId optional.String +} + +func (a *DuoApiService) DuoApplicationUpdate(ctx context.Context, accountId string, applicationId string, localVarOptionals *DuoApiDuoApplicationUpdateOpts) (DuoApplication, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Put") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue DuoApplication + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/duo/accounts/{account_id}/applications/{application_id}" + localVarPath = strings.Replace(localVarPath, "{"+"account_id"+"}", fmt.Sprintf("%v", accountId), -1) + localVarPath = strings.Replace(localVarPath, "{"+"application_id"+"}", fmt.Sprintf("%v", applicationId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + // body params + if localVarOptionals != nil && localVarOptionals.Body.IsSet() { + + localVarOptionalBody:= localVarOptionals.Body.Value() + localVarPostBody = &localVarOptionalBody + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v DuoApplication + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 400 { + var v ErrorDetails + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 401 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 403 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 404 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 409 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 500 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} diff --git a/jcapiv2/api_fde.go b/jcapiv2/api_fde.go new file mode 100644 index 0000000..9a692ee --- /dev/null +++ b/jcapiv2/api_fde.go @@ -0,0 +1,196 @@ + +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +import ( + "context" + "io/ioutil" + "net/http" + "net/url" + "strings" + "fmt" + "github.com/antihax/optional" +) + +// Linger please +var ( + _ context.Context +) + +type FdeApiService service +/* +FdeApiService Get System FDE Key +This endpoint will return the current (latest) fde key saved for a system. + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param systemId + * @param optional nil or *FdeApiSystemsGetFDEKeyOpts - Optional Parameters: + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. +@return Systemfdekey +*/ + +type FdeApiSystemsGetFDEKeyOpts struct { + XOrgId optional.String +} + +func (a *FdeApiService) SystemsGetFDEKey(ctx context.Context, systemId string, localVarOptionals *FdeApiSystemsGetFDEKeyOpts) (Systemfdekey, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue Systemfdekey + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/systems/{system_id}/fdekey" + localVarPath = strings.Replace(localVarPath, "{"+"system_id"+"}", fmt.Sprintf("%v", systemId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v Systemfdekey + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 400 { + var v ErrorDetails + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 401 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 403 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 404 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 409 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 500 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} diff --git a/jcapiv2/api_g_suite.go b/jcapiv2/api_g_suite.go new file mode 100644 index 0000000..7b80a15 --- /dev/null +++ b/jcapiv2/api_g_suite.go @@ -0,0 +1,1387 @@ + +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +import ( + "context" + "io/ioutil" + "net/http" + "net/url" + "strings" + "fmt" + "github.com/antihax/optional" +) + +// Linger please +var ( + _ context.Context +) + +type GSuiteApiService service +/* +GSuiteApiService List the associations of a G Suite instance +This endpoint returns the _direct_ associations of this G Suite instance. A direct association can be a non-homogeneous relationship between 2 different objects, for example G Suite and Users. #### Sample Request ``` curl -X GET 'https://console.jumpcloud.com/api/v2/gsuites/{Gsuite_ID}/associations?targets=user_group \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param gsuiteId ObjectID of the G Suite instance. + * @param targets Targets which a \"g_suite\" can be associated to. + * @param optional nil or *GSuiteApiGraphGSuiteAssociationsListOpts - Optional Parameters: + * @param "Limit" (optional.Int32) - The number of records to return at once. Limited to 100. + * @param "Skip" (optional.Int32) - The offset into the records to return. + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. +@return []GraphConnection +*/ + +type GSuiteApiGraphGSuiteAssociationsListOpts struct { + Limit optional.Int32 + Skip optional.Int32 + XOrgId optional.String +} + +func (a *GSuiteApiService) GraphGSuiteAssociationsList(ctx context.Context, gsuiteId string, targets []string, localVarOptionals *GSuiteApiGraphGSuiteAssociationsListOpts) ([]GraphConnection, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []GraphConnection + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/gsuites/{gsuite_id}/associations" + localVarPath = strings.Replace(localVarPath, "{"+"gsuite_id"+"}", fmt.Sprintf("%v", gsuiteId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + localVarQueryParams.Add("targets", parameterToString(targets, "csv")) + if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { + localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Skip.IsSet() { + localVarQueryParams.Add("skip", parameterToString(localVarOptionals.Skip.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v []GraphConnection + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +GSuiteApiService Manage the associations of a G Suite instance +This endpoint returns the _direct_ associations of this G Suite instance. A direct association can be a non-homogeneous relationship between 2 different objects, for example G Suite and Users. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/gsuites/{Gsuite_ID}/associations \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"op\": \"add\", \"type\": \"user_group\", \"id\": \"{Group_ID}\" }' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param gsuiteId ObjectID of the G Suite instance. + * @param optional nil or *GSuiteApiGraphGSuiteAssociationsPostOpts - Optional Parameters: + * @param "Body" (optional.Interface of GraphOperationGSuite) - + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. + +*/ + +type GSuiteApiGraphGSuiteAssociationsPostOpts struct { + Body optional.Interface + XOrgId optional.String +} + +func (a *GSuiteApiService) GraphGSuiteAssociationsPost(ctx context.Context, gsuiteId string, localVarOptionals *GSuiteApiGraphGSuiteAssociationsPostOpts) (*http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Post") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/gsuites/{gsuite_id}/associations" + localVarPath = strings.Replace(localVarPath, "{"+"gsuite_id"+"}", fmt.Sprintf("%v", gsuiteId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + // body params + if localVarOptionals != nil && localVarOptionals.Body.IsSet() { + + localVarOptionalBody:= localVarOptionals.Body.Value() + localVarPostBody = &localVarOptionalBody + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarHttpResponse, err + } + + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + return localVarHttpResponse, newErr + } + + return localVarHttpResponse, nil +} +/* +GSuiteApiService List the Users bound to a G Suite instance +This endpoint will return all Users bound to a G Suite instance, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this G Suite instance to the corresponding User; this array represents all grouping and/or associations that would have to be removed to deprovision the User from this G Suite instance. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/gsuites/{Gsuite_ID}/users \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param gsuiteId ObjectID of the G Suite instance. + * @param optional nil or *GSuiteApiGraphGSuiteTraverseUserOpts - Optional Parameters: + * @param "Limit" (optional.Int32) - The number of records to return at once. Limited to 100. + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. + * @param "Skip" (optional.Int32) - The offset into the records to return. + * @param "Filter" (optional.Interface of []string) - A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` +@return []GraphObjectWithPaths +*/ + +type GSuiteApiGraphGSuiteTraverseUserOpts struct { + Limit optional.Int32 + XOrgId optional.String + Skip optional.Int32 + Filter optional.Interface +} + +func (a *GSuiteApiService) GraphGSuiteTraverseUser(ctx context.Context, gsuiteId string, localVarOptionals *GSuiteApiGraphGSuiteTraverseUserOpts) ([]GraphObjectWithPaths, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []GraphObjectWithPaths + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/gsuites/{gsuite_id}/users" + localVarPath = strings.Replace(localVarPath, "{"+"gsuite_id"+"}", fmt.Sprintf("%v", gsuiteId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { + localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Skip.IsSet() { + localVarQueryParams.Add("skip", parameterToString(localVarOptionals.Skip.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Filter.IsSet() { + localVarQueryParams.Add("filter", parameterToString(localVarOptionals.Filter.Value(), "csv")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v []GraphObjectWithPaths + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +GSuiteApiService List the User Groups bound to a G Suite instance +This endpoint will return all User Groups bound to an G Suite instance, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the group's type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this G Suite instance to the corresponding User Group; this array represents all grouping and/or associations that would have to be removed to deprovision the User Group from this G Suite instance. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/gsuites/{GSuite_ID}/usergroups \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param gsuiteId ObjectID of the G Suite instance. + * @param optional nil or *GSuiteApiGraphGSuiteTraverseUserGroupOpts - Optional Parameters: + * @param "Limit" (optional.Int32) - The number of records to return at once. Limited to 100. + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. + * @param "Skip" (optional.Int32) - The offset into the records to return. + * @param "Filter" (optional.Interface of []string) - A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` +@return []GraphObjectWithPaths +*/ + +type GSuiteApiGraphGSuiteTraverseUserGroupOpts struct { + Limit optional.Int32 + XOrgId optional.String + Skip optional.Int32 + Filter optional.Interface +} + +func (a *GSuiteApiService) GraphGSuiteTraverseUserGroup(ctx context.Context, gsuiteId string, localVarOptionals *GSuiteApiGraphGSuiteTraverseUserGroupOpts) ([]GraphObjectWithPaths, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []GraphObjectWithPaths + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/gsuites/{gsuite_id}/usergroups" + localVarPath = strings.Replace(localVarPath, "{"+"gsuite_id"+"}", fmt.Sprintf("%v", gsuiteId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { + localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Skip.IsSet() { + localVarQueryParams.Add("skip", parameterToString(localVarOptionals.Skip.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Filter.IsSet() { + localVarQueryParams.Add("filter", parameterToString(localVarOptionals.Filter.Value(), "csv")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v []GraphObjectWithPaths + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +GSuiteApiService Get G Suite +This endpoint returns a specific G Suite. ##### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/gsuites/{GSUITE_ID} \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param id Unique identifier of the GSuite. + * @param optional nil or *GSuiteApiGsuitesGetOpts - Optional Parameters: + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. +@return GsuiteOutput +*/ + +type GSuiteApiGsuitesGetOpts struct { + XOrgId optional.String +} + +func (a *GSuiteApiService) GsuitesGet(ctx context.Context, id string, localVarOptionals *GSuiteApiGsuitesGetOpts) (GsuiteOutput, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue GsuiteOutput + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/gsuites/{id}" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v GsuiteOutput + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +GSuiteApiService Get a list of users in Jumpcloud format to import from a Google Workspace account. +Lists available G Suite users for import, translated to the Jumpcloud user schema. + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param gsuiteId + * @param optional nil or *GSuiteApiGsuitesListImportJumpcloudUsersOpts - Optional Parameters: + * @param "MaxResults" (optional.Int32) - Google Directory API maximum number of results per page. See https://developers.google.com/admin-sdk/directory/reference/rest/v1/users/list. + * @param "OrderBy" (optional.String) - Google Directory API sort field parameter. See https://developers.google.com/admin-sdk/directory/reference/rest/v1/users/list. + * @param "PageToken" (optional.String) - Google Directory API token used to access the next page of results. See https://developers.google.com/admin-sdk/directory/reference/rest/v1/users/list. + * @param "Query" (optional.String) - Google Directory API search parameter. See https://developers.google.com/admin-sdk/directory/v1/guides/search-users. + * @param "SortOrder" (optional.String) - Google Directory API sort direction parameter. See https://developers.google.com/admin-sdk/directory/reference/rest/v1/users/list. +@return InlineResponse2001 +*/ + +type GSuiteApiGsuitesListImportJumpcloudUsersOpts struct { + MaxResults optional.Int32 + OrderBy optional.String + PageToken optional.String + Query optional.String + SortOrder optional.String +} + +func (a *GSuiteApiService) GsuitesListImportJumpcloudUsers(ctx context.Context, gsuiteId string, localVarOptionals *GSuiteApiGsuitesListImportJumpcloudUsersOpts) (InlineResponse2001, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue InlineResponse2001 + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/gsuites/{gsuite_id}/import/jumpcloudusers" + localVarPath = strings.Replace(localVarPath, "{"+"gsuite_id"+"}", fmt.Sprintf("%v", gsuiteId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.MaxResults.IsSet() { + localVarQueryParams.Add("maxResults", parameterToString(localVarOptionals.MaxResults.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.OrderBy.IsSet() { + localVarQueryParams.Add("orderBy", parameterToString(localVarOptionals.OrderBy.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.PageToken.IsSet() { + localVarQueryParams.Add("pageToken", parameterToString(localVarOptionals.PageToken.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Query.IsSet() { + localVarQueryParams.Add("query", parameterToString(localVarOptionals.Query.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.SortOrder.IsSet() { + localVarQueryParams.Add("sortOrder", parameterToString(localVarOptionals.SortOrder.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v InlineResponse2001 + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +GSuiteApiService Get a list of users to import from a G Suite instance +Lists G Suite users available for import. + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param gsuiteId + * @param optional nil or *GSuiteApiGsuitesListImportUsersOpts - Optional Parameters: + * @param "Limit" (optional.Int32) - The number of records to return at once. Limited to 100. + * @param "MaxResults" (optional.Int32) - Google Directory API maximum number of results per page. See https://developers.google.com/admin-sdk/directory/reference/rest/v1/users/list. + * @param "OrderBy" (optional.String) - Google Directory API sort field parameter. See https://developers.google.com/admin-sdk/directory/reference/rest/v1/users/list. + * @param "PageToken" (optional.String) - Google Directory API token used to access the next page of results. See https://developers.google.com/admin-sdk/directory/reference/rest/v1/users/list. + * @param "Query" (optional.String) - Google Directory API search parameter. See https://developers.google.com/admin-sdk/directory/v1/guides/search-users. + * @param "SortOrder" (optional.String) - Google Directory API sort direction parameter. See https://developers.google.com/admin-sdk/directory/reference/rest/v1/users/list. +@return InlineResponse2002 +*/ + +type GSuiteApiGsuitesListImportUsersOpts struct { + Limit optional.Int32 + MaxResults optional.Int32 + OrderBy optional.String + PageToken optional.String + Query optional.String + SortOrder optional.String +} + +func (a *GSuiteApiService) GsuitesListImportUsers(ctx context.Context, gsuiteId string, localVarOptionals *GSuiteApiGsuitesListImportUsersOpts) (InlineResponse2002, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue InlineResponse2002 + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/gsuites/{gsuite_id}/import/users" + localVarPath = strings.Replace(localVarPath, "{"+"gsuite_id"+"}", fmt.Sprintf("%v", gsuiteId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { + localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.MaxResults.IsSet() { + localVarQueryParams.Add("maxResults", parameterToString(localVarOptionals.MaxResults.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.OrderBy.IsSet() { + localVarQueryParams.Add("orderBy", parameterToString(localVarOptionals.OrderBy.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.PageToken.IsSet() { + localVarQueryParams.Add("pageToken", parameterToString(localVarOptionals.PageToken.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Query.IsSet() { + localVarQueryParams.Add("query", parameterToString(localVarOptionals.Query.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.SortOrder.IsSet() { + localVarQueryParams.Add("sortOrder", parameterToString(localVarOptionals.SortOrder.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v InlineResponse2002 + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +GSuiteApiService Update existing G Suite +This endpoint allows updating some attributes of a G Suite. ##### Sample Request ``` curl -X PATCH https://console.jumpcloud.com/api/v2/gsuites/{GSUITE_ID} \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"userLockoutAction\": \"suspend\", \"userPasswordExpirationAction\": \"maintain\" }' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param id Unique identifier of the GSuite. + * @param optional nil or *GSuiteApiGsuitesPatchOpts - Optional Parameters: + * @param "Body" (optional.Interface of GsuitePatchInput) - + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. +@return GsuiteOutput +*/ + +type GSuiteApiGsuitesPatchOpts struct { + Body optional.Interface + XOrgId optional.String +} + +func (a *GSuiteApiService) GsuitesPatch(ctx context.Context, id string, localVarOptionals *GSuiteApiGsuitesPatchOpts) (GsuiteOutput, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Patch") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue GsuiteOutput + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/gsuites/{id}" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + // body params + if localVarOptionals != nil && localVarOptionals.Body.IsSet() { + + localVarOptionalBody:= localVarOptionals.Body.Value() + localVarPostBody = &localVarOptionalBody + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v GsuiteOutput + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +GSuiteApiService Deletes a G Suite translation rule +This endpoint allows you to delete a translation rule for a specific G Suite instance. These rules specify how JumpCloud attributes translate to [G Suite Admin SDK](https://developers.google.com/admin-sdk/directory/) attributes. #### Sample Request ``` curl -X DELETE https://console.jumpcloud.com/api/v2/gsuites/{gsuite_id}/translationrules/{id} \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param gsuiteId + * @param id + +*/ +func (a *GSuiteApiService) TranslationRulesGSuiteDelete(ctx context.Context, gsuiteId string, id string) (*http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Delete") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/gsuites/{gsuite_id}/translationrules/{id}" + localVarPath = strings.Replace(localVarPath, "{"+"gsuite_id"+"}", fmt.Sprintf("%v", gsuiteId), -1) + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarHttpResponse, err + } + + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + return localVarHttpResponse, newErr + } + + return localVarHttpResponse, nil +} +/* +GSuiteApiService Gets a specific G Suite translation rule +This endpoint returns a specific translation rule for a specific G Suite instance. These rules specify how JumpCloud attributes translate to [G Suite Admin SDK](https://developers.google.com/admin-sdk/directory/) attributes. ###### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/gsuites/{gsuite_id}/translationrules/{id} \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param gsuiteId + * @param id +@return GSuiteTranslationRule +*/ +func (a *GSuiteApiService) TranslationRulesGSuiteGet(ctx context.Context, gsuiteId string, id string) (GSuiteTranslationRule, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue GSuiteTranslationRule + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/gsuites/{gsuite_id}/translationrules/{id}" + localVarPath = strings.Replace(localVarPath, "{"+"gsuite_id"+"}", fmt.Sprintf("%v", gsuiteId), -1) + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v GSuiteTranslationRule + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +GSuiteApiService List all the G Suite Translation Rules +This endpoint returns all graph translation rules for a specific G Suite instance. These rules specify how JumpCloud attributes translate to [G Suite Admin SDK](https://developers.google.com/admin-sdk/directory/) attributes. ##### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/gsuites/{gsuite_id}/translationrules \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param gsuiteId + * @param optional nil or *GSuiteApiTranslationRulesGSuiteListOpts - Optional Parameters: + * @param "Fields" (optional.Interface of []string) - The comma separated fields included in the returned records. If omitted, the default list of fields will be returned. + * @param "Filter" (optional.Interface of []string) - A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` + * @param "Limit" (optional.Int32) - The number of records to return at once. Limited to 100. + * @param "Skip" (optional.Int32) - The offset into the records to return. + * @param "Sort" (optional.Interface of []string) - The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. +@return []GSuiteTranslationRule +*/ + +type GSuiteApiTranslationRulesGSuiteListOpts struct { + Fields optional.Interface + Filter optional.Interface + Limit optional.Int32 + Skip optional.Int32 + Sort optional.Interface +} + +func (a *GSuiteApiService) TranslationRulesGSuiteList(ctx context.Context, gsuiteId string, localVarOptionals *GSuiteApiTranslationRulesGSuiteListOpts) ([]GSuiteTranslationRule, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []GSuiteTranslationRule + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/gsuites/{gsuite_id}/translationrules" + localVarPath = strings.Replace(localVarPath, "{"+"gsuite_id"+"}", fmt.Sprintf("%v", gsuiteId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Fields.IsSet() { + localVarQueryParams.Add("fields", parameterToString(localVarOptionals.Fields.Value(), "csv")) + } + if localVarOptionals != nil && localVarOptionals.Filter.IsSet() { + localVarQueryParams.Add("filter", parameterToString(localVarOptionals.Filter.Value(), "csv")) + } + if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { + localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Skip.IsSet() { + localVarQueryParams.Add("skip", parameterToString(localVarOptionals.Skip.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Sort.IsSet() { + localVarQueryParams.Add("sort", parameterToString(localVarOptionals.Sort.Value(), "csv")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v []GSuiteTranslationRule + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +GSuiteApiService Create a new G Suite Translation Rule +This endpoint allows you to create a translation rule for a specific G Suite instance. These rules specify how JumpCloud attributes translate to [G Suite Admin SDK](https://developers.google.com/admin-sdk/directory/) attributes. ##### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/gsuites/{gsuite_id}/translationrules \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ {Translation Rule Parameters} }' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param gsuiteId + * @param optional nil or *GSuiteApiTranslationRulesGSuitePostOpts - Optional Parameters: + * @param "Body" (optional.Interface of GSuiteTranslationRuleRequest) - +@return GSuiteTranslationRule +*/ + +type GSuiteApiTranslationRulesGSuitePostOpts struct { + Body optional.Interface +} + +func (a *GSuiteApiService) TranslationRulesGSuitePost(ctx context.Context, gsuiteId string, localVarOptionals *GSuiteApiTranslationRulesGSuitePostOpts) (GSuiteTranslationRule, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Post") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue GSuiteTranslationRule + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/gsuites/{gsuite_id}/translationrules" + localVarPath = strings.Replace(localVarPath, "{"+"gsuite_id"+"}", fmt.Sprintf("%v", gsuiteId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + // body params + if localVarOptionals != nil && localVarOptionals.Body.IsSet() { + + localVarOptionalBody:= localVarOptionals.Body.Value() + localVarPostBody = &localVarOptionalBody + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 201 { + var v GSuiteTranslationRule + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} diff --git a/jcapiv2/api_g_suite_import.go b/jcapiv2/api_g_suite_import.go new file mode 100644 index 0000000..ff595b8 --- /dev/null +++ b/jcapiv2/api_g_suite_import.go @@ -0,0 +1,289 @@ + +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +import ( + "context" + "io/ioutil" + "net/http" + "net/url" + "strings" + "fmt" + "github.com/antihax/optional" +) + +// Linger please +var ( + _ context.Context +) + +type GSuiteImportApiService service +/* +GSuiteImportApiService Get a list of users in Jumpcloud format to import from a Google Workspace account. +Lists available G Suite users for import, translated to the Jumpcloud user schema. + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param gsuiteId + * @param optional nil or *GSuiteImportApiGsuitesListImportJumpcloudUsersOpts - Optional Parameters: + * @param "MaxResults" (optional.Int32) - Google Directory API maximum number of results per page. See https://developers.google.com/admin-sdk/directory/reference/rest/v1/users/list. + * @param "OrderBy" (optional.String) - Google Directory API sort field parameter. See https://developers.google.com/admin-sdk/directory/reference/rest/v1/users/list. + * @param "PageToken" (optional.String) - Google Directory API token used to access the next page of results. See https://developers.google.com/admin-sdk/directory/reference/rest/v1/users/list. + * @param "Query" (optional.String) - Google Directory API search parameter. See https://developers.google.com/admin-sdk/directory/v1/guides/search-users. + * @param "SortOrder" (optional.String) - Google Directory API sort direction parameter. See https://developers.google.com/admin-sdk/directory/reference/rest/v1/users/list. +@return InlineResponse2001 +*/ + +type GSuiteImportApiGsuitesListImportJumpcloudUsersOpts struct { + MaxResults optional.Int32 + OrderBy optional.String + PageToken optional.String + Query optional.String + SortOrder optional.String +} + +func (a *GSuiteImportApiService) GsuitesListImportJumpcloudUsers(ctx context.Context, gsuiteId string, localVarOptionals *GSuiteImportApiGsuitesListImportJumpcloudUsersOpts) (InlineResponse2001, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue InlineResponse2001 + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/gsuites/{gsuite_id}/import/jumpcloudusers" + localVarPath = strings.Replace(localVarPath, "{"+"gsuite_id"+"}", fmt.Sprintf("%v", gsuiteId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.MaxResults.IsSet() { + localVarQueryParams.Add("maxResults", parameterToString(localVarOptionals.MaxResults.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.OrderBy.IsSet() { + localVarQueryParams.Add("orderBy", parameterToString(localVarOptionals.OrderBy.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.PageToken.IsSet() { + localVarQueryParams.Add("pageToken", parameterToString(localVarOptionals.PageToken.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Query.IsSet() { + localVarQueryParams.Add("query", parameterToString(localVarOptionals.Query.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.SortOrder.IsSet() { + localVarQueryParams.Add("sortOrder", parameterToString(localVarOptionals.SortOrder.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v InlineResponse2001 + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +GSuiteImportApiService Get a list of users to import from a G Suite instance +Lists G Suite users available for import. + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param gsuiteId + * @param optional nil or *GSuiteImportApiGsuitesListImportUsersOpts - Optional Parameters: + * @param "Limit" (optional.Int32) - The number of records to return at once. Limited to 100. + * @param "MaxResults" (optional.Int32) - Google Directory API maximum number of results per page. See https://developers.google.com/admin-sdk/directory/reference/rest/v1/users/list. + * @param "OrderBy" (optional.String) - Google Directory API sort field parameter. See https://developers.google.com/admin-sdk/directory/reference/rest/v1/users/list. + * @param "PageToken" (optional.String) - Google Directory API token used to access the next page of results. See https://developers.google.com/admin-sdk/directory/reference/rest/v1/users/list. + * @param "Query" (optional.String) - Google Directory API search parameter. See https://developers.google.com/admin-sdk/directory/v1/guides/search-users. + * @param "SortOrder" (optional.String) - Google Directory API sort direction parameter. See https://developers.google.com/admin-sdk/directory/reference/rest/v1/users/list. +@return InlineResponse2002 +*/ + +type GSuiteImportApiGsuitesListImportUsersOpts struct { + Limit optional.Int32 + MaxResults optional.Int32 + OrderBy optional.String + PageToken optional.String + Query optional.String + SortOrder optional.String +} + +func (a *GSuiteImportApiService) GsuitesListImportUsers(ctx context.Context, gsuiteId string, localVarOptionals *GSuiteImportApiGsuitesListImportUsersOpts) (InlineResponse2002, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue InlineResponse2002 + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/gsuites/{gsuite_id}/import/users" + localVarPath = strings.Replace(localVarPath, "{"+"gsuite_id"+"}", fmt.Sprintf("%v", gsuiteId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { + localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.MaxResults.IsSet() { + localVarQueryParams.Add("maxResults", parameterToString(localVarOptionals.MaxResults.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.OrderBy.IsSet() { + localVarQueryParams.Add("orderBy", parameterToString(localVarOptionals.OrderBy.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.PageToken.IsSet() { + localVarQueryParams.Add("pageToken", parameterToString(localVarOptionals.PageToken.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Query.IsSet() { + localVarQueryParams.Add("query", parameterToString(localVarOptionals.Query.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.SortOrder.IsSet() { + localVarQueryParams.Add("sortOrder", parameterToString(localVarOptionals.SortOrder.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v InlineResponse2002 + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} diff --git a/jcapiv2/api_graph.go b/jcapiv2/api_graph.go new file mode 100644 index 0000000..ec6a021 --- /dev/null +++ b/jcapiv2/api_graph.go @@ -0,0 +1,10630 @@ + +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +import ( + "context" + "io/ioutil" + "net/http" + "net/url" + "strings" + "fmt" + "github.com/antihax/optional" +) + +// Linger please +var ( + _ context.Context +) + +type GraphApiService service +/* +GraphApiService List the associations of an Active Directory instance +This endpoint returns the direct associations of this Active Directory instance. A direct association can be a non-homogeneous relationship between 2 different objects, for example Active Directory and Users. #### Sample Request ``` curl -X GET 'https://console.jumpcloud.com/api/v2/activedirectories/{ActiveDirectory_ID}/associations?targets=user \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param activedirectoryId + * @param targets Targets which a \"active_directory\" can be associated to. + * @param optional nil or *GraphApiGraphActiveDirectoryAssociationsListOpts - Optional Parameters: + * @param "Limit" (optional.Int32) - The number of records to return at once. Limited to 100. + * @param "Skip" (optional.Int32) - The offset into the records to return. + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. +@return []GraphConnection +*/ + +type GraphApiGraphActiveDirectoryAssociationsListOpts struct { + Limit optional.Int32 + Skip optional.Int32 + XOrgId optional.String +} + +func (a *GraphApiService) GraphActiveDirectoryAssociationsList(ctx context.Context, activedirectoryId string, targets []string, localVarOptionals *GraphApiGraphActiveDirectoryAssociationsListOpts) ([]GraphConnection, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []GraphConnection + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/activedirectories/{activedirectory_id}/associations" + localVarPath = strings.Replace(localVarPath, "{"+"activedirectory_id"+"}", fmt.Sprintf("%v", activedirectoryId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + localVarQueryParams.Add("targets", parameterToString(targets, "csv")) + if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { + localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Skip.IsSet() { + localVarQueryParams.Add("skip", parameterToString(localVarOptionals.Skip.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v []GraphConnection + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +GraphApiService Manage the associations of an Active Directory instance +This endpoint allows you to manage the _direct_ associations of an Active Directory instance. A direct association can be a non-homogeneous relationship between 2 different objects, for example Active Directory and Users. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/activedirectories/{AD_Instance_ID}/associations \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"op\": \"add\", \"type\": \"user\", \"id\": \"{User_ID}\" }' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param activedirectoryId + * @param optional nil or *GraphApiGraphActiveDirectoryAssociationsPostOpts - Optional Parameters: + * @param "Body" (optional.Interface of GraphOperationActiveDirectory) - + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. + +*/ + +type GraphApiGraphActiveDirectoryAssociationsPostOpts struct { + Body optional.Interface + XOrgId optional.String +} + +func (a *GraphApiService) GraphActiveDirectoryAssociationsPost(ctx context.Context, activedirectoryId string, localVarOptionals *GraphApiGraphActiveDirectoryAssociationsPostOpts) (*http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Post") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/activedirectories/{activedirectory_id}/associations" + localVarPath = strings.Replace(localVarPath, "{"+"activedirectory_id"+"}", fmt.Sprintf("%v", activedirectoryId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + // body params + if localVarOptionals != nil && localVarOptionals.Body.IsSet() { + + localVarOptionalBody:= localVarOptionals.Body.Value() + localVarPostBody = &localVarOptionalBody + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarHttpResponse, err + } + + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + return localVarHttpResponse, newErr + } + + return localVarHttpResponse, nil +} +/* +GraphApiService List the Users bound to an Active Directory instance +This endpoint will return all Users bound to an Active Directory instance, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this Active Directory instance to the corresponding User; this array represents all grouping and/or associations that would have to be removed to deprovision the User from this Active Directory instance. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/activedirectories/{ActiveDirectory_ID}/users \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param activedirectoryId ObjectID of the Active Directory instance. + * @param optional nil or *GraphApiGraphActiveDirectoryTraverseUserOpts - Optional Parameters: + * @param "Filter" (optional.Interface of []string) - A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` + * @param "Limit" (optional.Int32) - The number of records to return at once. Limited to 100. + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. + * @param "Skip" (optional.Int32) - The offset into the records to return. +@return []GraphObjectWithPaths +*/ + +type GraphApiGraphActiveDirectoryTraverseUserOpts struct { + Filter optional.Interface + Limit optional.Int32 + XOrgId optional.String + Skip optional.Int32 +} + +func (a *GraphApiService) GraphActiveDirectoryTraverseUser(ctx context.Context, activedirectoryId string, localVarOptionals *GraphApiGraphActiveDirectoryTraverseUserOpts) ([]GraphObjectWithPaths, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []GraphObjectWithPaths + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/activedirectories/{activedirectory_id}/users" + localVarPath = strings.Replace(localVarPath, "{"+"activedirectory_id"+"}", fmt.Sprintf("%v", activedirectoryId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Filter.IsSet() { + localVarQueryParams.Add("filter", parameterToString(localVarOptionals.Filter.Value(), "csv")) + } + if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { + localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Skip.IsSet() { + localVarQueryParams.Add("skip", parameterToString(localVarOptionals.Skip.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v []GraphObjectWithPaths + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +GraphApiService List the User Groups bound to an Active Directory instance +This endpoint will return all Users Groups bound to an Active Directory instance, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the group's type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this Active Directory instance to the corresponding User Group; this array represents all grouping and/or associations that would have to be removed to deprovision the User Group from this Active Directory instance. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/activedirectories/{ActiveDirectory_ID}/usergroups \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param activedirectoryId ObjectID of the Active Directory instance. + * @param optional nil or *GraphApiGraphActiveDirectoryTraverseUserGroupOpts - Optional Parameters: + * @param "Limit" (optional.Int32) - The number of records to return at once. Limited to 100. + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. + * @param "Skip" (optional.Int32) - The offset into the records to return. + * @param "Filter" (optional.Interface of []string) - A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` +@return []GraphObjectWithPaths +*/ + +type GraphApiGraphActiveDirectoryTraverseUserGroupOpts struct { + Limit optional.Int32 + XOrgId optional.String + Skip optional.Int32 + Filter optional.Interface +} + +func (a *GraphApiService) GraphActiveDirectoryTraverseUserGroup(ctx context.Context, activedirectoryId string, localVarOptionals *GraphApiGraphActiveDirectoryTraverseUserGroupOpts) ([]GraphObjectWithPaths, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []GraphObjectWithPaths + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/activedirectories/{activedirectory_id}/usergroups" + localVarPath = strings.Replace(localVarPath, "{"+"activedirectory_id"+"}", fmt.Sprintf("%v", activedirectoryId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { + localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Skip.IsSet() { + localVarQueryParams.Add("skip", parameterToString(localVarOptionals.Skip.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Filter.IsSet() { + localVarQueryParams.Add("filter", parameterToString(localVarOptionals.Filter.Value(), "csv")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v []GraphObjectWithPaths + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +GraphApiService List the associations of an Application +This endpoint will return the _direct_ associations of an Application. A direct association can be a non-homogeneous relationship between 2 different objects, for example Applications and User Groups. #### Sample Request ``` curl -X GET 'https://console.jumpcloud.com/api/v2/applications/{Application_ID}/associations?targets=user_group \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param applicationId ObjectID of the Application. + * @param targets Targets which a \"application\" can be associated to. + * @param optional nil or *GraphApiGraphApplicationAssociationsListOpts - Optional Parameters: + * @param "Limit" (optional.Int32) - The number of records to return at once. Limited to 100. + * @param "Skip" (optional.Int32) - The offset into the records to return. + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. +@return []GraphConnection +*/ + +type GraphApiGraphApplicationAssociationsListOpts struct { + Limit optional.Int32 + Skip optional.Int32 + XOrgId optional.String +} + +func (a *GraphApiService) GraphApplicationAssociationsList(ctx context.Context, applicationId string, targets []string, localVarOptionals *GraphApiGraphApplicationAssociationsListOpts) ([]GraphConnection, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []GraphConnection + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/applications/{application_id}/associations" + localVarPath = strings.Replace(localVarPath, "{"+"application_id"+"}", fmt.Sprintf("%v", applicationId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + localVarQueryParams.Add("targets", parameterToString(targets, "csv")) + if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { + localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Skip.IsSet() { + localVarQueryParams.Add("skip", parameterToString(localVarOptionals.Skip.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v []GraphConnection + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +GraphApiService Manage the associations of an Application +This endpoint allows you to manage the _direct_ associations of an Application. A direct association can be a non-homogeneous relationship between 2 different objects, for example Application and User Groups. #### Sample Request ``` curl -X POST 'https://console.jumpcloud.com/api/v2/applications/{Application_ID}/associations' \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"op\": \"add\", \"type\": \"user_group\", \"id\": \"{Group_ID}\" }' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param applicationId ObjectID of the Application. + * @param optional nil or *GraphApiGraphApplicationAssociationsPostOpts - Optional Parameters: + * @param "Body" (optional.Interface of GraphOperationApplication) - + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. + +*/ + +type GraphApiGraphApplicationAssociationsPostOpts struct { + Body optional.Interface + XOrgId optional.String +} + +func (a *GraphApiService) GraphApplicationAssociationsPost(ctx context.Context, applicationId string, localVarOptionals *GraphApiGraphApplicationAssociationsPostOpts) (*http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Post") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/applications/{application_id}/associations" + localVarPath = strings.Replace(localVarPath, "{"+"application_id"+"}", fmt.Sprintf("%v", applicationId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + // body params + if localVarOptionals != nil && localVarOptionals.Body.IsSet() { + + localVarOptionalBody:= localVarOptionals.Body.Value() + localVarPostBody = &localVarOptionalBody + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarHttpResponse, err + } + + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + return localVarHttpResponse, newErr + } + + return localVarHttpResponse, nil +} +/* +GraphApiService List the Users bound to an Application +This endpoint will return all Users bound to an Application, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this Application to the corresponding User; this array represents all grouping and/or associations that would have to be removed to deprovision the User from this Application. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/applications/{Application_ID}/users \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param applicationId ObjectID of the Application. + * @param optional nil or *GraphApiGraphApplicationTraverseUserOpts - Optional Parameters: + * @param "Limit" (optional.Int32) - The number of records to return at once. Limited to 100. + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. + * @param "Skip" (optional.Int32) - The offset into the records to return. + * @param "Filter" (optional.Interface of []string) - A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` +@return []GraphObjectWithPaths +*/ + +type GraphApiGraphApplicationTraverseUserOpts struct { + Limit optional.Int32 + XOrgId optional.String + Skip optional.Int32 + Filter optional.Interface +} + +func (a *GraphApiService) GraphApplicationTraverseUser(ctx context.Context, applicationId string, localVarOptionals *GraphApiGraphApplicationTraverseUserOpts) ([]GraphObjectWithPaths, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []GraphObjectWithPaths + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/applications/{application_id}/users" + localVarPath = strings.Replace(localVarPath, "{"+"application_id"+"}", fmt.Sprintf("%v", applicationId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { + localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Skip.IsSet() { + localVarQueryParams.Add("skip", parameterToString(localVarOptionals.Skip.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Filter.IsSet() { + localVarQueryParams.Add("filter", parameterToString(localVarOptionals.Filter.Value(), "csv")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v []GraphObjectWithPaths + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +GraphApiService List the User Groups bound to an Application +This endpoint will return all Users Groups bound to an Application, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the group's type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this Application to the corresponding User Group; this array represents all grouping and/or associations that would have to be removed to deprovision the User Group from this Application. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/applications/{Application_ID}/usergroups \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param applicationId ObjectID of the Application. + * @param optional nil or *GraphApiGraphApplicationTraverseUserGroupOpts - Optional Parameters: + * @param "Limit" (optional.Int32) - The number of records to return at once. Limited to 100. + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. + * @param "Skip" (optional.Int32) - The offset into the records to return. + * @param "Filter" (optional.Interface of []string) - A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` +@return []GraphObjectWithPaths +*/ + +type GraphApiGraphApplicationTraverseUserGroupOpts struct { + Limit optional.Int32 + XOrgId optional.String + Skip optional.Int32 + Filter optional.Interface +} + +func (a *GraphApiService) GraphApplicationTraverseUserGroup(ctx context.Context, applicationId string, localVarOptionals *GraphApiGraphApplicationTraverseUserGroupOpts) ([]GraphObjectWithPaths, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []GraphObjectWithPaths + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/applications/{application_id}/usergroups" + localVarPath = strings.Replace(localVarPath, "{"+"application_id"+"}", fmt.Sprintf("%v", applicationId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { + localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Skip.IsSet() { + localVarQueryParams.Add("skip", parameterToString(localVarOptionals.Skip.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Filter.IsSet() { + localVarQueryParams.Add("filter", parameterToString(localVarOptionals.Filter.Value(), "csv")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v []GraphObjectWithPaths + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +GraphApiService List the associations of a Command +This endpoint will return the _direct_ associations of this Command. A direct association can be a non-homogeneous relationship between 2 different objects, for example Commands and User Groups. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/commands/{Command_ID}/associations?targets=system_group \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param commandId ObjectID of the Command. + * @param targets Targets which a \"command\" can be associated to. + * @param optional nil or *GraphApiGraphCommandAssociationsListOpts - Optional Parameters: + * @param "Limit" (optional.Int32) - The number of records to return at once. Limited to 100. + * @param "Skip" (optional.Int32) - The offset into the records to return. + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. +@return []GraphConnection +*/ + +type GraphApiGraphCommandAssociationsListOpts struct { + Limit optional.Int32 + Skip optional.Int32 + XOrgId optional.String +} + +func (a *GraphApiService) GraphCommandAssociationsList(ctx context.Context, commandId string, targets []string, localVarOptionals *GraphApiGraphCommandAssociationsListOpts) ([]GraphConnection, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []GraphConnection + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/commands/{command_id}/associations" + localVarPath = strings.Replace(localVarPath, "{"+"command_id"+"}", fmt.Sprintf("%v", commandId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + localVarQueryParams.Add("targets", parameterToString(targets, "csv")) + if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { + localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Skip.IsSet() { + localVarQueryParams.Add("skip", parameterToString(localVarOptionals.Skip.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v []GraphConnection + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +GraphApiService Manage the associations of a Command +This endpoint will allow you to manage the _direct_ associations of this Command. A direct association can be a non-homogeneous relationship between 2 different objects, for example Commands and User Groups. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/commands/{Command_ID}/associations \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"op\": \"add\", \"type\": \"system_group\", \"id\": \"Group_ID\" }' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param commandId ObjectID of the Command. + * @param optional nil or *GraphApiGraphCommandAssociationsPostOpts - Optional Parameters: + * @param "Body" (optional.Interface of GraphOperationCommand) - + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. + +*/ + +type GraphApiGraphCommandAssociationsPostOpts struct { + Body optional.Interface + XOrgId optional.String +} + +func (a *GraphApiService) GraphCommandAssociationsPost(ctx context.Context, commandId string, localVarOptionals *GraphApiGraphCommandAssociationsPostOpts) (*http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Post") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/commands/{command_id}/associations" + localVarPath = strings.Replace(localVarPath, "{"+"command_id"+"}", fmt.Sprintf("%v", commandId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + // body params + if localVarOptionals != nil && localVarOptionals.Body.IsSet() { + + localVarOptionalBody:= localVarOptionals.Body.Value() + localVarPostBody = &localVarOptionalBody + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarHttpResponse, err + } + + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + return localVarHttpResponse, newErr + } + + return localVarHttpResponse, nil +} +/* +GraphApiService List the Systems bound to a Command +This endpoint will return all Systems bound to a Command, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this Command to the corresponding System; this array represents all grouping and/or associations that would have to be removed to deprovision the System from this Command. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/commands/{Command_ID}/systems \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param commandId ObjectID of the Command. + * @param optional nil or *GraphApiGraphCommandTraverseSystemOpts - Optional Parameters: + * @param "Limit" (optional.Int32) - The number of records to return at once. Limited to 100. + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. + * @param "Skip" (optional.Int32) - The offset into the records to return. + * @param "Filter" (optional.Interface of []string) - A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` +@return []GraphObjectWithPaths +*/ + +type GraphApiGraphCommandTraverseSystemOpts struct { + Limit optional.Int32 + XOrgId optional.String + Skip optional.Int32 + Filter optional.Interface +} + +func (a *GraphApiService) GraphCommandTraverseSystem(ctx context.Context, commandId string, localVarOptionals *GraphApiGraphCommandTraverseSystemOpts) ([]GraphObjectWithPaths, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []GraphObjectWithPaths + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/commands/{command_id}/systems" + localVarPath = strings.Replace(localVarPath, "{"+"command_id"+"}", fmt.Sprintf("%v", commandId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { + localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Skip.IsSet() { + localVarQueryParams.Add("skip", parameterToString(localVarOptionals.Skip.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Filter.IsSet() { + localVarQueryParams.Add("filter", parameterToString(localVarOptionals.Filter.Value(), "csv")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v []GraphObjectWithPaths + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +GraphApiService List the System Groups bound to a Command +This endpoint will return all System Groups bound to a Command, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the group's type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this Command to the corresponding System Group; this array represents all grouping and/or associations that would have to be removed to deprovision the System Group from this Command. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/commands/{Command_ID}/systemgroups \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param commandId ObjectID of the Command. + * @param optional nil or *GraphApiGraphCommandTraverseSystemGroupOpts - Optional Parameters: + * @param "Limit" (optional.Int32) - The number of records to return at once. Limited to 100. + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. + * @param "Skip" (optional.Int32) - The offset into the records to return. + * @param "Filter" (optional.Interface of []string) - A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` +@return []GraphObjectWithPaths +*/ + +type GraphApiGraphCommandTraverseSystemGroupOpts struct { + Limit optional.Int32 + XOrgId optional.String + Skip optional.Int32 + Filter optional.Interface +} + +func (a *GraphApiService) GraphCommandTraverseSystemGroup(ctx context.Context, commandId string, localVarOptionals *GraphApiGraphCommandTraverseSystemGroupOpts) ([]GraphObjectWithPaths, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []GraphObjectWithPaths + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/commands/{command_id}/systemgroups" + localVarPath = strings.Replace(localVarPath, "{"+"command_id"+"}", fmt.Sprintf("%v", commandId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { + localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Skip.IsSet() { + localVarQueryParams.Add("skip", parameterToString(localVarOptionals.Skip.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Filter.IsSet() { + localVarQueryParams.Add("filter", parameterToString(localVarOptionals.Filter.Value(), "csv")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v []GraphObjectWithPaths + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +GraphApiService List the associations of a G Suite instance +This endpoint returns the _direct_ associations of this G Suite instance. A direct association can be a non-homogeneous relationship between 2 different objects, for example G Suite and Users. #### Sample Request ``` curl -X GET 'https://console.jumpcloud.com/api/v2/gsuites/{Gsuite_ID}/associations?targets=user_group \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param gsuiteId ObjectID of the G Suite instance. + * @param targets Targets which a \"g_suite\" can be associated to. + * @param optional nil or *GraphApiGraphGSuiteAssociationsListOpts - Optional Parameters: + * @param "Limit" (optional.Int32) - The number of records to return at once. Limited to 100. + * @param "Skip" (optional.Int32) - The offset into the records to return. + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. +@return []GraphConnection +*/ + +type GraphApiGraphGSuiteAssociationsListOpts struct { + Limit optional.Int32 + Skip optional.Int32 + XOrgId optional.String +} + +func (a *GraphApiService) GraphGSuiteAssociationsList(ctx context.Context, gsuiteId string, targets []string, localVarOptionals *GraphApiGraphGSuiteAssociationsListOpts) ([]GraphConnection, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []GraphConnection + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/gsuites/{gsuite_id}/associations" + localVarPath = strings.Replace(localVarPath, "{"+"gsuite_id"+"}", fmt.Sprintf("%v", gsuiteId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + localVarQueryParams.Add("targets", parameterToString(targets, "csv")) + if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { + localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Skip.IsSet() { + localVarQueryParams.Add("skip", parameterToString(localVarOptionals.Skip.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v []GraphConnection + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +GraphApiService Manage the associations of a G Suite instance +This endpoint returns the _direct_ associations of this G Suite instance. A direct association can be a non-homogeneous relationship between 2 different objects, for example G Suite and Users. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/gsuites/{Gsuite_ID}/associations \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"op\": \"add\", \"type\": \"user_group\", \"id\": \"{Group_ID}\" }' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param gsuiteId ObjectID of the G Suite instance. + * @param optional nil or *GraphApiGraphGSuiteAssociationsPostOpts - Optional Parameters: + * @param "Body" (optional.Interface of GraphOperationGSuite) - + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. + +*/ + +type GraphApiGraphGSuiteAssociationsPostOpts struct { + Body optional.Interface + XOrgId optional.String +} + +func (a *GraphApiService) GraphGSuiteAssociationsPost(ctx context.Context, gsuiteId string, localVarOptionals *GraphApiGraphGSuiteAssociationsPostOpts) (*http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Post") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/gsuites/{gsuite_id}/associations" + localVarPath = strings.Replace(localVarPath, "{"+"gsuite_id"+"}", fmt.Sprintf("%v", gsuiteId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + // body params + if localVarOptionals != nil && localVarOptionals.Body.IsSet() { + + localVarOptionalBody:= localVarOptionals.Body.Value() + localVarPostBody = &localVarOptionalBody + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarHttpResponse, err + } + + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + return localVarHttpResponse, newErr + } + + return localVarHttpResponse, nil +} +/* +GraphApiService List the Users bound to a G Suite instance +This endpoint will return all Users bound to a G Suite instance, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this G Suite instance to the corresponding User; this array represents all grouping and/or associations that would have to be removed to deprovision the User from this G Suite instance. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/gsuites/{Gsuite_ID}/users \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param gsuiteId ObjectID of the G Suite instance. + * @param optional nil or *GraphApiGraphGSuiteTraverseUserOpts - Optional Parameters: + * @param "Limit" (optional.Int32) - The number of records to return at once. Limited to 100. + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. + * @param "Skip" (optional.Int32) - The offset into the records to return. + * @param "Filter" (optional.Interface of []string) - A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` +@return []GraphObjectWithPaths +*/ + +type GraphApiGraphGSuiteTraverseUserOpts struct { + Limit optional.Int32 + XOrgId optional.String + Skip optional.Int32 + Filter optional.Interface +} + +func (a *GraphApiService) GraphGSuiteTraverseUser(ctx context.Context, gsuiteId string, localVarOptionals *GraphApiGraphGSuiteTraverseUserOpts) ([]GraphObjectWithPaths, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []GraphObjectWithPaths + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/gsuites/{gsuite_id}/users" + localVarPath = strings.Replace(localVarPath, "{"+"gsuite_id"+"}", fmt.Sprintf("%v", gsuiteId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { + localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Skip.IsSet() { + localVarQueryParams.Add("skip", parameterToString(localVarOptionals.Skip.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Filter.IsSet() { + localVarQueryParams.Add("filter", parameterToString(localVarOptionals.Filter.Value(), "csv")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v []GraphObjectWithPaths + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +GraphApiService List the User Groups bound to a G Suite instance +This endpoint will return all User Groups bound to an G Suite instance, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the group's type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this G Suite instance to the corresponding User Group; this array represents all grouping and/or associations that would have to be removed to deprovision the User Group from this G Suite instance. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/gsuites/{GSuite_ID}/usergroups \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param gsuiteId ObjectID of the G Suite instance. + * @param optional nil or *GraphApiGraphGSuiteTraverseUserGroupOpts - Optional Parameters: + * @param "Limit" (optional.Int32) - The number of records to return at once. Limited to 100. + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. + * @param "Skip" (optional.Int32) - The offset into the records to return. + * @param "Filter" (optional.Interface of []string) - A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` +@return []GraphObjectWithPaths +*/ + +type GraphApiGraphGSuiteTraverseUserGroupOpts struct { + Limit optional.Int32 + XOrgId optional.String + Skip optional.Int32 + Filter optional.Interface +} + +func (a *GraphApiService) GraphGSuiteTraverseUserGroup(ctx context.Context, gsuiteId string, localVarOptionals *GraphApiGraphGSuiteTraverseUserGroupOpts) ([]GraphObjectWithPaths, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []GraphObjectWithPaths + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/gsuites/{gsuite_id}/usergroups" + localVarPath = strings.Replace(localVarPath, "{"+"gsuite_id"+"}", fmt.Sprintf("%v", gsuiteId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { + localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Skip.IsSet() { + localVarQueryParams.Add("skip", parameterToString(localVarOptionals.Skip.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Filter.IsSet() { + localVarQueryParams.Add("filter", parameterToString(localVarOptionals.Filter.Value(), "csv")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v []GraphObjectWithPaths + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +GraphApiService List the associations of a LDAP Server +This endpoint returns the _direct_ associations of this LDAP Server. A direct association can be a non-homogeneous relationship between 2 different objects, for example LDAP and Users. #### Sample Request ``` curl -X GET 'https://console.jumpcloud.com/api/v2/ldapservers/{LDAP_ID}/associations?targets=user_group \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param ldapserverId ObjectID of the LDAP Server. + * @param targets Targets which a \"ldap_server\" can be associated to. + * @param optional nil or *GraphApiGraphLdapServerAssociationsListOpts - Optional Parameters: + * @param "Limit" (optional.Int32) - The number of records to return at once. Limited to 100. + * @param "Skip" (optional.Int32) - The offset into the records to return. + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. +@return []GraphConnection +*/ + +type GraphApiGraphLdapServerAssociationsListOpts struct { + Limit optional.Int32 + Skip optional.Int32 + XOrgId optional.String +} + +func (a *GraphApiService) GraphLdapServerAssociationsList(ctx context.Context, ldapserverId string, targets []string, localVarOptionals *GraphApiGraphLdapServerAssociationsListOpts) ([]GraphConnection, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []GraphConnection + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/ldapservers/{ldapserver_id}/associations" + localVarPath = strings.Replace(localVarPath, "{"+"ldapserver_id"+"}", fmt.Sprintf("%v", ldapserverId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + localVarQueryParams.Add("targets", parameterToString(targets, "csv")) + if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { + localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Skip.IsSet() { + localVarQueryParams.Add("skip", parameterToString(localVarOptionals.Skip.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v []GraphConnection + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +GraphApiService Manage the associations of a LDAP Server +This endpoint allows you to manage the _direct_ associations of a LDAP Server. A direct association can be a non-homogeneous relationship between 2 different objects, for example LDAP and Users. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/ldapservers/{LDAP_ID}/associations \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"op\": \"add\", \"type\": \"user\", \"id\": \"{User_ID}\" }' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param ldapserverId ObjectID of the LDAP Server. + * @param optional nil or *GraphApiGraphLdapServerAssociationsPostOpts - Optional Parameters: + * @param "Body" (optional.Interface of GraphOperationLdapServer) - + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. + +*/ + +type GraphApiGraphLdapServerAssociationsPostOpts struct { + Body optional.Interface + XOrgId optional.String +} + +func (a *GraphApiService) GraphLdapServerAssociationsPost(ctx context.Context, ldapserverId string, localVarOptionals *GraphApiGraphLdapServerAssociationsPostOpts) (*http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Post") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/ldapservers/{ldapserver_id}/associations" + localVarPath = strings.Replace(localVarPath, "{"+"ldapserver_id"+"}", fmt.Sprintf("%v", ldapserverId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + // body params + if localVarOptionals != nil && localVarOptionals.Body.IsSet() { + + localVarOptionalBody:= localVarOptionals.Body.Value() + localVarPostBody = &localVarOptionalBody + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarHttpResponse, err + } + + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + return localVarHttpResponse, newErr + } + + return localVarHttpResponse, nil +} +/* +GraphApiService List the Users bound to a LDAP Server +This endpoint will return all Users bound to an LDAP Server, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this LDAP server instance to the corresponding User; this array represents all grouping and/or associations that would have to be removed to deprovision the User from this LDAP server instance. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/ldapservers/{LDAP_ID}/users \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param ldapserverId ObjectID of the LDAP Server. + * @param optional nil or *GraphApiGraphLdapServerTraverseUserOpts - Optional Parameters: + * @param "Limit" (optional.Int32) - The number of records to return at once. Limited to 100. + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. + * @param "Skip" (optional.Int32) - The offset into the records to return. + * @param "Filter" (optional.Interface of []string) - A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` +@return []GraphObjectWithPaths +*/ + +type GraphApiGraphLdapServerTraverseUserOpts struct { + Limit optional.Int32 + XOrgId optional.String + Skip optional.Int32 + Filter optional.Interface +} + +func (a *GraphApiService) GraphLdapServerTraverseUser(ctx context.Context, ldapserverId string, localVarOptionals *GraphApiGraphLdapServerTraverseUserOpts) ([]GraphObjectWithPaths, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []GraphObjectWithPaths + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/ldapservers/{ldapserver_id}/users" + localVarPath = strings.Replace(localVarPath, "{"+"ldapserver_id"+"}", fmt.Sprintf("%v", ldapserverId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { + localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Skip.IsSet() { + localVarQueryParams.Add("skip", parameterToString(localVarOptionals.Skip.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Filter.IsSet() { + localVarQueryParams.Add("filter", parameterToString(localVarOptionals.Filter.Value(), "csv")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v []GraphObjectWithPaths + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +GraphApiService List the User Groups bound to a LDAP Server +This endpoint will return all Users Groups bound to a LDAP Server, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the group's type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this LDAP server instance to the corresponding User Group; this array represents all grouping and/or associations that would have to be removed to deprovision the User Group from this LDAP server instance. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/ldapservers/{LDAP_ID}/usergroups \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param ldapserverId ObjectID of the LDAP Server. + * @param optional nil or *GraphApiGraphLdapServerTraverseUserGroupOpts - Optional Parameters: + * @param "Limit" (optional.Int32) - The number of records to return at once. Limited to 100. + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. + * @param "Skip" (optional.Int32) - The offset into the records to return. + * @param "Filter" (optional.Interface of []string) - A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` +@return []GraphObjectWithPaths +*/ + +type GraphApiGraphLdapServerTraverseUserGroupOpts struct { + Limit optional.Int32 + XOrgId optional.String + Skip optional.Int32 + Filter optional.Interface +} + +func (a *GraphApiService) GraphLdapServerTraverseUserGroup(ctx context.Context, ldapserverId string, localVarOptionals *GraphApiGraphLdapServerTraverseUserGroupOpts) ([]GraphObjectWithPaths, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []GraphObjectWithPaths + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/ldapservers/{ldapserver_id}/usergroups" + localVarPath = strings.Replace(localVarPath, "{"+"ldapserver_id"+"}", fmt.Sprintf("%v", ldapserverId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { + localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Skip.IsSet() { + localVarQueryParams.Add("skip", parameterToString(localVarOptionals.Skip.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Filter.IsSet() { + localVarQueryParams.Add("filter", parameterToString(localVarOptionals.Filter.Value(), "csv")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v []GraphObjectWithPaths + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +GraphApiService List the associations of an Office 365 instance +This endpoint returns _direct_ associations of an Office 365 instance. A direct association can be a non-homogeneous relationship between 2 different objects, for example Office 365 and Users. #### Sample Request ``` curl -X GET 'https://console.jumpcloud.com/api/v2/office365s/{OFFICE365_ID}/associations?targets=user_group' \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param office365Id ObjectID of the Office 365 instance. + * @param targets Targets which a \"office_365\" can be associated to. + * @param optional nil or *GraphApiGraphOffice365AssociationsListOpts - Optional Parameters: + * @param "Limit" (optional.Int32) - The number of records to return at once. Limited to 100. + * @param "Skip" (optional.Int32) - The offset into the records to return. + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. +@return []GraphConnection +*/ + +type GraphApiGraphOffice365AssociationsListOpts struct { + Limit optional.Int32 + Skip optional.Int32 + XOrgId optional.String +} + +func (a *GraphApiService) GraphOffice365AssociationsList(ctx context.Context, office365Id string, targets []string, localVarOptionals *GraphApiGraphOffice365AssociationsListOpts) ([]GraphConnection, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []GraphConnection + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/office365s/{office365_id}/associations" + localVarPath = strings.Replace(localVarPath, "{"+"office365_id"+"}", fmt.Sprintf("%v", office365Id), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + localVarQueryParams.Add("targets", parameterToString(targets, "csv")) + if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { + localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Skip.IsSet() { + localVarQueryParams.Add("skip", parameterToString(localVarOptionals.Skip.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v []GraphConnection + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +GraphApiService Manage the associations of an Office 365 instance +This endpoint allows you to manage the _direct_ associations of a Office 365 instance. A direct association can be a non-homogeneous relationship between 2 different objects, for example Office 365 and Users. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/office365s/{OFFICE365_ID}/associations \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"op\": \"add\", \"type\": \"user_group\", \"id\": \"{Group_ID}\" }' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param office365Id ObjectID of the Office 365 instance. + * @param optional nil or *GraphApiGraphOffice365AssociationsPostOpts - Optional Parameters: + * @param "Body" (optional.Interface of GraphOperationOffice365) - + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. + +*/ + +type GraphApiGraphOffice365AssociationsPostOpts struct { + Body optional.Interface + XOrgId optional.String +} + +func (a *GraphApiService) GraphOffice365AssociationsPost(ctx context.Context, office365Id string, localVarOptionals *GraphApiGraphOffice365AssociationsPostOpts) (*http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Post") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/office365s/{office365_id}/associations" + localVarPath = strings.Replace(localVarPath, "{"+"office365_id"+"}", fmt.Sprintf("%v", office365Id), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + // body params + if localVarOptionals != nil && localVarOptionals.Body.IsSet() { + + localVarOptionalBody:= localVarOptionals.Body.Value() + localVarPostBody = &localVarOptionalBody + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarHttpResponse, err + } + + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + return localVarHttpResponse, newErr + } + + return localVarHttpResponse, nil +} +/* +GraphApiService List the Users bound to an Office 365 instance +This endpoint will return all Users bound to an Office 365 instance, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this Office 365 instance to the corresponding User; this array represents all grouping and/or associations that would have to be removed to deprovision the User from this Office 365 instance. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/office365s/{OFFICE365_ID}/users \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param office365Id ObjectID of the Office 365 suite. + * @param optional nil or *GraphApiGraphOffice365TraverseUserOpts - Optional Parameters: + * @param "Limit" (optional.Int32) - The number of records to return at once. Limited to 100. + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. + * @param "Skip" (optional.Int32) - The offset into the records to return. + * @param "Filter" (optional.Interface of []string) - A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` +@return []GraphObjectWithPaths +*/ + +type GraphApiGraphOffice365TraverseUserOpts struct { + Limit optional.Int32 + XOrgId optional.String + Skip optional.Int32 + Filter optional.Interface +} + +func (a *GraphApiService) GraphOffice365TraverseUser(ctx context.Context, office365Id string, localVarOptionals *GraphApiGraphOffice365TraverseUserOpts) ([]GraphObjectWithPaths, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []GraphObjectWithPaths + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/office365s/{office365_id}/users" + localVarPath = strings.Replace(localVarPath, "{"+"office365_id"+"}", fmt.Sprintf("%v", office365Id), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { + localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Skip.IsSet() { + localVarQueryParams.Add("skip", parameterToString(localVarOptionals.Skip.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Filter.IsSet() { + localVarQueryParams.Add("filter", parameterToString(localVarOptionals.Filter.Value(), "csv")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v []GraphObjectWithPaths + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +GraphApiService List the User Groups bound to an Office 365 instance +This endpoint will return all Users Groups bound to an Office 365 instance, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the group's type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this Office 365 instance to the corresponding User Group; this array represents all grouping and/or associations that would have to be removed to deprovision the User Group from this Office 365 instance. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/office365s/{OFFICE365_ID/usergroups \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param office365Id ObjectID of the Office 365 suite. + * @param optional nil or *GraphApiGraphOffice365TraverseUserGroupOpts - Optional Parameters: + * @param "Limit" (optional.Int32) - The number of records to return at once. Limited to 100. + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. + * @param "Skip" (optional.Int32) - The offset into the records to return. + * @param "Filter" (optional.Interface of []string) - A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` +@return []GraphObjectWithPaths +*/ + +type GraphApiGraphOffice365TraverseUserGroupOpts struct { + Limit optional.Int32 + XOrgId optional.String + Skip optional.Int32 + Filter optional.Interface +} + +func (a *GraphApiService) GraphOffice365TraverseUserGroup(ctx context.Context, office365Id string, localVarOptionals *GraphApiGraphOffice365TraverseUserGroupOpts) ([]GraphObjectWithPaths, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []GraphObjectWithPaths + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/office365s/{office365_id}/usergroups" + localVarPath = strings.Replace(localVarPath, "{"+"office365_id"+"}", fmt.Sprintf("%v", office365Id), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { + localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Skip.IsSet() { + localVarQueryParams.Add("skip", parameterToString(localVarOptionals.Skip.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Filter.IsSet() { + localVarQueryParams.Add("filter", parameterToString(localVarOptionals.Filter.Value(), "csv")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v []GraphObjectWithPaths + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +GraphApiService List the associations of a Policy +This endpoint returns the _direct_ associations of a Policy. A direct association can be a non-homogeneous relationship between 2 different objects, for example Policies and Systems. #### Sample Request ``` curl -X GET 'https://console.jumpcloud.com/api/v2/policies/{Policy_ID}/associations?targets=system_group \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param policyId ObjectID of the Policy. + * @param targets Targets which a \"policy\" can be associated to. + * @param optional nil or *GraphApiGraphPolicyAssociationsListOpts - Optional Parameters: + * @param "Limit" (optional.Int32) - The number of records to return at once. Limited to 100. + * @param "Skip" (optional.Int32) - The offset into the records to return. + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. +@return []GraphConnection +*/ + +type GraphApiGraphPolicyAssociationsListOpts struct { + Limit optional.Int32 + Skip optional.Int32 + XOrgId optional.String +} + +func (a *GraphApiService) GraphPolicyAssociationsList(ctx context.Context, policyId string, targets []string, localVarOptionals *GraphApiGraphPolicyAssociationsListOpts) ([]GraphConnection, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []GraphConnection + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/policies/{policy_id}/associations" + localVarPath = strings.Replace(localVarPath, "{"+"policy_id"+"}", fmt.Sprintf("%v", policyId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + localVarQueryParams.Add("targets", parameterToString(targets, "csv")) + if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { + localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Skip.IsSet() { + localVarQueryParams.Add("skip", parameterToString(localVarOptionals.Skip.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v []GraphConnection + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +GraphApiService Manage the associations of a Policy +This endpoint allows you to manage the _direct_ associations of a Policy. A direct association can be a non-homogeneous relationship between 2 different objects, for example Policies and Systems. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/policies/{Policy_ID}/associations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"op\": \"add\", \"type\": \"system_group\", \"id\": \"{Group_ID}\" }' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param policyId ObjectID of the Policy. + * @param optional nil or *GraphApiGraphPolicyAssociationsPostOpts - Optional Parameters: + * @param "Body" (optional.Interface of GraphOperationPolicy) - + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. + +*/ + +type GraphApiGraphPolicyAssociationsPostOpts struct { + Body optional.Interface + XOrgId optional.String +} + +func (a *GraphApiService) GraphPolicyAssociationsPost(ctx context.Context, policyId string, localVarOptionals *GraphApiGraphPolicyAssociationsPostOpts) (*http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Post") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/policies/{policy_id}/associations" + localVarPath = strings.Replace(localVarPath, "{"+"policy_id"+"}", fmt.Sprintf("%v", policyId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + // body params + if localVarOptionals != nil && localVarOptionals.Body.IsSet() { + + localVarOptionalBody:= localVarOptionals.Body.Value() + localVarPostBody = &localVarOptionalBody + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarHttpResponse, err + } + + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + return localVarHttpResponse, newErr + } + + return localVarHttpResponse, nil +} +/* +GraphApiService List the associations of a Policy Group. +This endpoint returns the _direct_ associations of this Policy Group. A direct association can be a non-homogeneous relationship between 2 different objects, for example Policy Groups and Policies. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/policygroups/{GroupID}/associations?targets=system \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param groupId ObjectID of the Policy Group. + * @param targets Targets which a \"policy_group\" can be associated to. + * @param optional nil or *GraphApiGraphPolicyGroupAssociationsListOpts - Optional Parameters: + * @param "Limit" (optional.Int32) - The number of records to return at once. Limited to 100. + * @param "Skip" (optional.Int32) - The offset into the records to return. + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. +@return []GraphConnection +*/ + +type GraphApiGraphPolicyGroupAssociationsListOpts struct { + Limit optional.Int32 + Skip optional.Int32 + XOrgId optional.String +} + +func (a *GraphApiService) GraphPolicyGroupAssociationsList(ctx context.Context, groupId string, targets []string, localVarOptionals *GraphApiGraphPolicyGroupAssociationsListOpts) ([]GraphConnection, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []GraphConnection + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/policygroups/{group_id}/associations" + localVarPath = strings.Replace(localVarPath, "{"+"group_id"+"}", fmt.Sprintf("%v", groupId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + localVarQueryParams.Add("targets", parameterToString(targets, "csv")) + if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { + localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Skip.IsSet() { + localVarQueryParams.Add("skip", parameterToString(localVarOptionals.Skip.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v []GraphConnection + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +GraphApiService Manage the associations of a Policy Group +This endpoint manages the _direct_ associations of this Policy Group. A direct association can be a non-homogeneous relationship between 2 different objects, for example Policy Groups and Policies. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/policygroups/{GroupID}/associations \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"op\": \"add\", \"type\": \"system\", \"id\": \"{SystemID}\" }' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param groupId ObjectID of the Policy Group. + * @param optional nil or *GraphApiGraphPolicyGroupAssociationsPostOpts - Optional Parameters: + * @param "Body" (optional.Interface of GraphOperationPolicyGroup) - + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. + +*/ + +type GraphApiGraphPolicyGroupAssociationsPostOpts struct { + Body optional.Interface + XOrgId optional.String +} + +func (a *GraphApiService) GraphPolicyGroupAssociationsPost(ctx context.Context, groupId string, localVarOptionals *GraphApiGraphPolicyGroupAssociationsPostOpts) (*http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Post") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/policygroups/{group_id}/associations" + localVarPath = strings.Replace(localVarPath, "{"+"group_id"+"}", fmt.Sprintf("%v", groupId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + // body params + if localVarOptionals != nil && localVarOptionals.Body.IsSet() { + + localVarOptionalBody:= localVarOptionals.Body.Value() + localVarPostBody = &localVarOptionalBody + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarHttpResponse, err + } + + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + return localVarHttpResponse, newErr + } + + return localVarHttpResponse, nil +} +/* +GraphApiService List the members of a Policy Group +This endpoint returns the Policy members of a Policy Group. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/policygroups/{GroupID}/members \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param groupId ObjectID of the Policy Group. + * @param optional nil or *GraphApiGraphPolicyGroupMembersListOpts - Optional Parameters: + * @param "Limit" (optional.Int32) - The number of records to return at once. Limited to 100. + * @param "Skip" (optional.Int32) - The offset into the records to return. + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. +@return []GraphConnection +*/ + +type GraphApiGraphPolicyGroupMembersListOpts struct { + Limit optional.Int32 + Skip optional.Int32 + XOrgId optional.String +} + +func (a *GraphApiService) GraphPolicyGroupMembersList(ctx context.Context, groupId string, localVarOptionals *GraphApiGraphPolicyGroupMembersListOpts) ([]GraphConnection, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []GraphConnection + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/policygroups/{group_id}/members" + localVarPath = strings.Replace(localVarPath, "{"+"group_id"+"}", fmt.Sprintf("%v", groupId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { + localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Skip.IsSet() { + localVarQueryParams.Add("skip", parameterToString(localVarOptionals.Skip.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v []GraphConnection + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +GraphApiService Manage the members of a Policy Group +This endpoint allows you to manage the Policy members of a Policy Group. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/policygroups/{GroupID}/members \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"op\": \"add\", \"type\": \"policy\", \"id\": \"{Policy_ID}\" }' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param groupId ObjectID of the Policy Group. + * @param optional nil or *GraphApiGraphPolicyGroupMembersPostOpts - Optional Parameters: + * @param "Body" (optional.Interface of GraphOperationPolicyGroupMember) - + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. + +*/ + +type GraphApiGraphPolicyGroupMembersPostOpts struct { + Body optional.Interface + XOrgId optional.String +} + +func (a *GraphApiService) GraphPolicyGroupMembersPost(ctx context.Context, groupId string, localVarOptionals *GraphApiGraphPolicyGroupMembersPostOpts) (*http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Post") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/policygroups/{group_id}/members" + localVarPath = strings.Replace(localVarPath, "{"+"group_id"+"}", fmt.Sprintf("%v", groupId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + // body params + if localVarOptionals != nil && localVarOptionals.Body.IsSet() { + + localVarOptionalBody:= localVarOptionals.Body.Value() + localVarPostBody = &localVarOptionalBody + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarHttpResponse, err + } + + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + return localVarHttpResponse, newErr + } + + return localVarHttpResponse, nil +} +/* +GraphApiService List the Policy Group's membership +This endpoint returns all Policy members that are a member of this Policy Group. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/policygroups/{GroupID}/membership \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param groupId ObjectID of the Policy Group. + * @param optional nil or *GraphApiGraphPolicyGroupMembershipOpts - Optional Parameters: + * @param "Filter" (optional.Interface of []string) - A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` + * @param "Limit" (optional.Int32) - The number of records to return at once. Limited to 100. + * @param "Skip" (optional.Int32) - The offset into the records to return. + * @param "Sort" (optional.Interface of []string) - The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. +@return []GraphObjectWithPaths +*/ + +type GraphApiGraphPolicyGroupMembershipOpts struct { + Filter optional.Interface + Limit optional.Int32 + Skip optional.Int32 + Sort optional.Interface + XOrgId optional.String +} + +func (a *GraphApiService) GraphPolicyGroupMembership(ctx context.Context, groupId string, localVarOptionals *GraphApiGraphPolicyGroupMembershipOpts) ([]GraphObjectWithPaths, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []GraphObjectWithPaths + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/policygroups/{group_id}/membership" + localVarPath = strings.Replace(localVarPath, "{"+"group_id"+"}", fmt.Sprintf("%v", groupId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Filter.IsSet() { + localVarQueryParams.Add("filter", parameterToString(localVarOptionals.Filter.Value(), "csv")) + } + if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { + localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Skip.IsSet() { + localVarQueryParams.Add("skip", parameterToString(localVarOptionals.Skip.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Sort.IsSet() { + localVarQueryParams.Add("sort", parameterToString(localVarOptionals.Sort.Value(), "csv")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v []GraphObjectWithPaths + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +GraphApiService List the Systems bound to a Policy Group +This endpoint will return all Systems bound to a Policy Group, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this Policy Group to the corresponding System; this array represents all grouping and/or associations that would have to be removed to deprovision the System from this Policy Group. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/policygroups/{GroupID}/systems \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param groupId ObjectID of the Policy Group. + * @param optional nil or *GraphApiGraphPolicyGroupTraverseSystemOpts - Optional Parameters: + * @param "Limit" (optional.Int32) - The number of records to return at once. Limited to 100. + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. + * @param "Skip" (optional.Int32) - The offset into the records to return. + * @param "Filter" (optional.Interface of []string) - A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` +@return []GraphObjectWithPaths +*/ + +type GraphApiGraphPolicyGroupTraverseSystemOpts struct { + Limit optional.Int32 + XOrgId optional.String + Skip optional.Int32 + Filter optional.Interface +} + +func (a *GraphApiService) GraphPolicyGroupTraverseSystem(ctx context.Context, groupId string, localVarOptionals *GraphApiGraphPolicyGroupTraverseSystemOpts) ([]GraphObjectWithPaths, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []GraphObjectWithPaths + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/policygroups/{group_id}/systems" + localVarPath = strings.Replace(localVarPath, "{"+"group_id"+"}", fmt.Sprintf("%v", groupId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { + localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Skip.IsSet() { + localVarQueryParams.Add("skip", parameterToString(localVarOptionals.Skip.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Filter.IsSet() { + localVarQueryParams.Add("filter", parameterToString(localVarOptionals.Filter.Value(), "csv")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v []GraphObjectWithPaths + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +GraphApiService List the System Groups bound to Policy Groups +This endpoint will return all System Groups bound to a Policy Group, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this Policy Group to the corresponding System Group; this array represents all grouping and/or associations that would have to be removed to deprovision the System Group from this Policy Group. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/policygroups/{GroupID}/systemgroups \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param groupId ObjectID of the Policy Group. + * @param optional nil or *GraphApiGraphPolicyGroupTraverseSystemGroupOpts - Optional Parameters: + * @param "Limit" (optional.Int32) - The number of records to return at once. Limited to 100. + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. + * @param "Skip" (optional.Int32) - The offset into the records to return. + * @param "Filter" (optional.Interface of []string) - A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` +@return []GraphObjectWithPaths +*/ + +type GraphApiGraphPolicyGroupTraverseSystemGroupOpts struct { + Limit optional.Int32 + XOrgId optional.String + Skip optional.Int32 + Filter optional.Interface +} + +func (a *GraphApiService) GraphPolicyGroupTraverseSystemGroup(ctx context.Context, groupId string, localVarOptionals *GraphApiGraphPolicyGroupTraverseSystemGroupOpts) ([]GraphObjectWithPaths, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []GraphObjectWithPaths + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/policygroups/{group_id}/systemgroups" + localVarPath = strings.Replace(localVarPath, "{"+"group_id"+"}", fmt.Sprintf("%v", groupId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { + localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Skip.IsSet() { + localVarQueryParams.Add("skip", parameterToString(localVarOptionals.Skip.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Filter.IsSet() { + localVarQueryParams.Add("filter", parameterToString(localVarOptionals.Filter.Value(), "csv")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v []GraphObjectWithPaths + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +GraphApiService List the parent Groups of a Policy +This endpoint returns all the Policy Groups a Policy is a member of. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/policies/{Policy_ID}/memberof \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param policyId ObjectID of the Policy. + * @param optional nil or *GraphApiGraphPolicyMemberOfOpts - Optional Parameters: + * @param "Filter" (optional.Interface of []string) - A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` + * @param "Limit" (optional.Int32) - The number of records to return at once. Limited to 100. + * @param "Skip" (optional.Int32) - The offset into the records to return. + * @param "Date" (optional.String) - Current date header for the System Context API + * @param "Authorization" (optional.String) - Authorization header for the System Context API + * @param "Sort" (optional.Interface of []string) - The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. +@return []GraphObjectWithPaths +*/ + +type GraphApiGraphPolicyMemberOfOpts struct { + Filter optional.Interface + Limit optional.Int32 + Skip optional.Int32 + Date optional.String + Authorization optional.String + Sort optional.Interface + XOrgId optional.String +} + +func (a *GraphApiService) GraphPolicyMemberOf(ctx context.Context, policyId string, localVarOptionals *GraphApiGraphPolicyMemberOfOpts) ([]GraphObjectWithPaths, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []GraphObjectWithPaths + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/policies/{policy_id}/memberof" + localVarPath = strings.Replace(localVarPath, "{"+"policy_id"+"}", fmt.Sprintf("%v", policyId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Filter.IsSet() { + localVarQueryParams.Add("filter", parameterToString(localVarOptionals.Filter.Value(), "csv")) + } + if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { + localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Skip.IsSet() { + localVarQueryParams.Add("skip", parameterToString(localVarOptionals.Skip.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Sort.IsSet() { + localVarQueryParams.Add("sort", parameterToString(localVarOptionals.Sort.Value(), "csv")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.Date.IsSet() { + localVarHeaderParams["Date"] = parameterToString(localVarOptionals.Date.Value(), "") + } + if localVarOptionals != nil && localVarOptionals.Authorization.IsSet() { + localVarHeaderParams["Authorization"] = parameterToString(localVarOptionals.Authorization.Value(), "") + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v []GraphObjectWithPaths + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +GraphApiService List the Systems bound to a Policy +This endpoint will return all Systems bound to a Policy, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this Policy to the corresponding System; this array represents all grouping and/or associations that would have to be removed to deprovision the System from this Policy. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/policies/{Policy_ID}/systems \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param policyId ObjectID of the Command. + * @param optional nil or *GraphApiGraphPolicyTraverseSystemOpts - Optional Parameters: + * @param "Limit" (optional.Int32) - The number of records to return at once. Limited to 100. + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. + * @param "Skip" (optional.Int32) - The offset into the records to return. + * @param "Filter" (optional.Interface of []string) - A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` +@return []GraphObjectWithPaths +*/ + +type GraphApiGraphPolicyTraverseSystemOpts struct { + Limit optional.Int32 + XOrgId optional.String + Skip optional.Int32 + Filter optional.Interface +} + +func (a *GraphApiService) GraphPolicyTraverseSystem(ctx context.Context, policyId string, localVarOptionals *GraphApiGraphPolicyTraverseSystemOpts) ([]GraphObjectWithPaths, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []GraphObjectWithPaths + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/policies/{policy_id}/systems" + localVarPath = strings.Replace(localVarPath, "{"+"policy_id"+"}", fmt.Sprintf("%v", policyId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { + localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Skip.IsSet() { + localVarQueryParams.Add("skip", parameterToString(localVarOptionals.Skip.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Filter.IsSet() { + localVarQueryParams.Add("filter", parameterToString(localVarOptionals.Filter.Value(), "csv")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v []GraphObjectWithPaths + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +GraphApiService List the System Groups bound to a Policy +This endpoint will return all Systems Groups bound to a Policy, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the group's type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this Policy to the corresponding System Group; this array represents all grouping and/or associations that would have to be removed to deprovision the System Group from this Policy. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/policies/{Policy_ID}/systemgroups \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param policyId ObjectID of the Command. + * @param optional nil or *GraphApiGraphPolicyTraverseSystemGroupOpts - Optional Parameters: + * @param "Limit" (optional.Int32) - The number of records to return at once. Limited to 100. + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. + * @param "Skip" (optional.Int32) - The offset into the records to return. + * @param "Filter" (optional.Interface of []string) - A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` +@return []GraphObjectWithPaths +*/ + +type GraphApiGraphPolicyTraverseSystemGroupOpts struct { + Limit optional.Int32 + XOrgId optional.String + Skip optional.Int32 + Filter optional.Interface +} + +func (a *GraphApiService) GraphPolicyTraverseSystemGroup(ctx context.Context, policyId string, localVarOptionals *GraphApiGraphPolicyTraverseSystemGroupOpts) ([]GraphObjectWithPaths, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []GraphObjectWithPaths + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/policies/{policy_id}/systemgroups" + localVarPath = strings.Replace(localVarPath, "{"+"policy_id"+"}", fmt.Sprintf("%v", policyId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { + localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Skip.IsSet() { + localVarQueryParams.Add("skip", parameterToString(localVarOptionals.Skip.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Filter.IsSet() { + localVarQueryParams.Add("filter", parameterToString(localVarOptionals.Filter.Value(), "csv")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v []GraphObjectWithPaths + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +GraphApiService List the associations of a RADIUS Server +This endpoint returns the _direct_ associations of a Radius Server. A direct association can be a non-homogeneous relationship between 2 different objects, for example Radius Servers and Users. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/radiusservers/{RADIUS_ID}/associations?targets=user_group \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param radiusserverId ObjectID of the Radius Server. + * @param targets Targets which a \"radius_server\" can be associated to. + * @param optional nil or *GraphApiGraphRadiusServerAssociationsListOpts - Optional Parameters: + * @param "Limit" (optional.Int32) - The number of records to return at once. Limited to 100. + * @param "Skip" (optional.Int32) - The offset into the records to return. + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. +@return []GraphConnection +*/ + +type GraphApiGraphRadiusServerAssociationsListOpts struct { + Limit optional.Int32 + Skip optional.Int32 + XOrgId optional.String +} + +func (a *GraphApiService) GraphRadiusServerAssociationsList(ctx context.Context, radiusserverId string, targets []string, localVarOptionals *GraphApiGraphRadiusServerAssociationsListOpts) ([]GraphConnection, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []GraphConnection + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/radiusservers/{radiusserver_id}/associations" + localVarPath = strings.Replace(localVarPath, "{"+"radiusserver_id"+"}", fmt.Sprintf("%v", radiusserverId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + localVarQueryParams.Add("targets", parameterToString(targets, "csv")) + if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { + localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Skip.IsSet() { + localVarQueryParams.Add("skip", parameterToString(localVarOptionals.Skip.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v []GraphConnection + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +GraphApiService Manage the associations of a RADIUS Server +This endpoint allows you to manage the _direct_ associations of a Radius Server. A direct association can be a non-homogeneous relationship between 2 different objects, for example Radius Servers and Users. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/radiusservers/{RADIUS_ID}/associations \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"type\":\"user\", \"id\":\"{USER_ID}\", \"op\":\"add\" }' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param radiusserverId ObjectID of the Radius Server. + * @param optional nil or *GraphApiGraphRadiusServerAssociationsPostOpts - Optional Parameters: + * @param "Body" (optional.Interface of GraphOperationRadiusServer) - + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. + +*/ + +type GraphApiGraphRadiusServerAssociationsPostOpts struct { + Body optional.Interface + XOrgId optional.String +} + +func (a *GraphApiService) GraphRadiusServerAssociationsPost(ctx context.Context, radiusserverId string, localVarOptionals *GraphApiGraphRadiusServerAssociationsPostOpts) (*http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Post") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/radiusservers/{radiusserver_id}/associations" + localVarPath = strings.Replace(localVarPath, "{"+"radiusserver_id"+"}", fmt.Sprintf("%v", radiusserverId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + // body params + if localVarOptionals != nil && localVarOptionals.Body.IsSet() { + + localVarOptionalBody:= localVarOptionals.Body.Value() + localVarPostBody = &localVarOptionalBody + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarHttpResponse, err + } + + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + return localVarHttpResponse, newErr + } + + return localVarHttpResponse, nil +} +/* +GraphApiService List the Users bound to a RADIUS Server +This endpoint will return all Users bound to a RADIUS Server, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this RADIUS server instance to the corresponding User; this array represents all grouping and/or associations that would have to be removed to deprovision the User from this RADIUS server instance. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/ldapservers/{LDAP_ID}/users \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param radiusserverId ObjectID of the Radius Server. + * @param optional nil or *GraphApiGraphRadiusServerTraverseUserOpts - Optional Parameters: + * @param "Limit" (optional.Int32) - The number of records to return at once. Limited to 100. + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. + * @param "Skip" (optional.Int32) - The offset into the records to return. + * @param "Filter" (optional.Interface of []string) - A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` +@return []GraphObjectWithPaths +*/ + +type GraphApiGraphRadiusServerTraverseUserOpts struct { + Limit optional.Int32 + XOrgId optional.String + Skip optional.Int32 + Filter optional.Interface +} + +func (a *GraphApiService) GraphRadiusServerTraverseUser(ctx context.Context, radiusserverId string, localVarOptionals *GraphApiGraphRadiusServerTraverseUserOpts) ([]GraphObjectWithPaths, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []GraphObjectWithPaths + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/radiusservers/{radiusserver_id}/users" + localVarPath = strings.Replace(localVarPath, "{"+"radiusserver_id"+"}", fmt.Sprintf("%v", radiusserverId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { + localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Skip.IsSet() { + localVarQueryParams.Add("skip", parameterToString(localVarOptionals.Skip.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Filter.IsSet() { + localVarQueryParams.Add("filter", parameterToString(localVarOptionals.Filter.Value(), "csv")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v []GraphObjectWithPaths + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +GraphApiService List the User Groups bound to a RADIUS Server +This endpoint will return all Users Groups bound to a RADIUS Server, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the group's type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this RADIUS server instance to the corresponding User Group; this array represents all grouping and/or associations that would have to be removed to deprovision the User Group from this RADIUS server instance. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/radiusservers/{RADIUS_ID}/usergroups \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param radiusserverId ObjectID of the Radius Server. + * @param optional nil or *GraphApiGraphRadiusServerTraverseUserGroupOpts - Optional Parameters: + * @param "Limit" (optional.Int32) - The number of records to return at once. Limited to 100. + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. + * @param "Skip" (optional.Int32) - The offset into the records to return. + * @param "Filter" (optional.Interface of []string) - A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` +@return []GraphObjectWithPaths +*/ + +type GraphApiGraphRadiusServerTraverseUserGroupOpts struct { + Limit optional.Int32 + XOrgId optional.String + Skip optional.Int32 + Filter optional.Interface +} + +func (a *GraphApiService) GraphRadiusServerTraverseUserGroup(ctx context.Context, radiusserverId string, localVarOptionals *GraphApiGraphRadiusServerTraverseUserGroupOpts) ([]GraphObjectWithPaths, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []GraphObjectWithPaths + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/radiusservers/{radiusserver_id}/usergroups" + localVarPath = strings.Replace(localVarPath, "{"+"radiusserver_id"+"}", fmt.Sprintf("%v", radiusserverId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { + localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Skip.IsSet() { + localVarQueryParams.Add("skip", parameterToString(localVarOptionals.Skip.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Filter.IsSet() { + localVarQueryParams.Add("filter", parameterToString(localVarOptionals.Filter.Value(), "csv")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v []GraphObjectWithPaths + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +GraphApiService List the associations of a Software Application +This endpoint will return the _direct_ associations of a Software Application. A direct association can be a non-homogeneous relationship between 2 different objects, for example Software Application and System Groups. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/softwareapps/{software_app_id}/associations?targets=system_group \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param softwareAppId ObjectID of the Software App. + * @param targets Targets which a \"software_app\" can be associated to. + * @param optional nil or *GraphApiGraphSoftwareappsAssociationsListOpts - Optional Parameters: + * @param "Limit" (optional.Int32) - The number of records to return at once. Limited to 100. + * @param "Skip" (optional.Int32) - The offset into the records to return. + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. +@return []GraphConnection +*/ + +type GraphApiGraphSoftwareappsAssociationsListOpts struct { + Limit optional.Int32 + Skip optional.Int32 + XOrgId optional.String +} + +func (a *GraphApiService) GraphSoftwareappsAssociationsList(ctx context.Context, softwareAppId string, targets []string, localVarOptionals *GraphApiGraphSoftwareappsAssociationsListOpts) ([]GraphConnection, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []GraphConnection + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/softwareapps/{software_app_id}/associations" + localVarPath = strings.Replace(localVarPath, "{"+"software_app_id"+"}", fmt.Sprintf("%v", softwareAppId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + localVarQueryParams.Add("targets", parameterToString(targets, "csv")) + if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { + localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Skip.IsSet() { + localVarQueryParams.Add("skip", parameterToString(localVarOptionals.Skip.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v []GraphConnection + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +GraphApiService Manage the associations of a software application. +This endpoint allows you to associate or disassociate a software application to a system or system group. #### Sample Request ``` $ curl -X POST https://console.jumpcloud.com/api/v2/softwareapps/{software_app_id}/associations \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"id\": \"<object_id>\", \"op\": \"add\", \"type\": \"system\" }' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param softwareAppId ObjectID of the Software App. + * @param optional nil or *GraphApiGraphSoftwareappsAssociationsPostOpts - Optional Parameters: + * @param "Body" (optional.Interface of GraphOperationSoftwareApp) - + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. + +*/ + +type GraphApiGraphSoftwareappsAssociationsPostOpts struct { + Body optional.Interface + XOrgId optional.String +} + +func (a *GraphApiService) GraphSoftwareappsAssociationsPost(ctx context.Context, softwareAppId string, localVarOptionals *GraphApiGraphSoftwareappsAssociationsPostOpts) (*http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Post") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/softwareapps/{software_app_id}/associations" + localVarPath = strings.Replace(localVarPath, "{"+"software_app_id"+"}", fmt.Sprintf("%v", softwareAppId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + // body params + if localVarOptionals != nil && localVarOptionals.Body.IsSet() { + + localVarOptionalBody:= localVarOptionals.Body.Value() + localVarPostBody = &localVarOptionalBody + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarHttpResponse, err + } + + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + return localVarHttpResponse, newErr + } + + return localVarHttpResponse, nil +} +/* +GraphApiService List the Systems bound to a Software App. +This endpoint will return all Systems bound to a Software App, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this Software App to the corresponding System; this array represents all grouping and/or associations that would have to be removed to deprovision the System from this Software App. See `/associations` endpoint to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/softwareapps/{software_app_id}/systems \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param softwareAppId ObjectID of the Software App. + * @param optional nil or *GraphApiGraphSoftwareappsTraverseSystemOpts - Optional Parameters: + * @param "Limit" (optional.Int32) - The number of records to return at once. Limited to 100. + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. + * @param "Skip" (optional.Int32) - The offset into the records to return. + * @param "Filter" (optional.Interface of []string) - A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` +@return []GraphObjectWithPaths +*/ + +type GraphApiGraphSoftwareappsTraverseSystemOpts struct { + Limit optional.Int32 + XOrgId optional.String + Skip optional.Int32 + Filter optional.Interface +} + +func (a *GraphApiService) GraphSoftwareappsTraverseSystem(ctx context.Context, softwareAppId string, localVarOptionals *GraphApiGraphSoftwareappsTraverseSystemOpts) ([]GraphObjectWithPaths, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []GraphObjectWithPaths + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/softwareapps/{software_app_id}/systems" + localVarPath = strings.Replace(localVarPath, "{"+"software_app_id"+"}", fmt.Sprintf("%v", softwareAppId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { + localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Skip.IsSet() { + localVarQueryParams.Add("skip", parameterToString(localVarOptionals.Skip.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Filter.IsSet() { + localVarQueryParams.Add("filter", parameterToString(localVarOptionals.Filter.Value(), "csv")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v []GraphObjectWithPaths + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +GraphApiService List the System Groups bound to a Software App. +This endpoint will return all Systems Groups bound to a Software App, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the group's type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this Software App to the corresponding System Group; this array represents all grouping and/or associations that would have to be removed to deprovision the System Group from this Software App. See `/associations` endpoint to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/softwareapps/{software_app_id}/systemgroups \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param softwareAppId ObjectID of the Software App. + * @param optional nil or *GraphApiGraphSoftwareappsTraverseSystemGroupOpts - Optional Parameters: + * @param "Limit" (optional.Int32) - The number of records to return at once. Limited to 100. + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. + * @param "Skip" (optional.Int32) - The offset into the records to return. + * @param "Filter" (optional.Interface of []string) - A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` +@return []GraphObjectWithPaths +*/ + +type GraphApiGraphSoftwareappsTraverseSystemGroupOpts struct { + Limit optional.Int32 + XOrgId optional.String + Skip optional.Int32 + Filter optional.Interface +} + +func (a *GraphApiService) GraphSoftwareappsTraverseSystemGroup(ctx context.Context, softwareAppId string, localVarOptionals *GraphApiGraphSoftwareappsTraverseSystemGroupOpts) ([]GraphObjectWithPaths, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []GraphObjectWithPaths + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/softwareapps/{software_app_id}/systemgroups" + localVarPath = strings.Replace(localVarPath, "{"+"software_app_id"+"}", fmt.Sprintf("%v", softwareAppId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { + localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Skip.IsSet() { + localVarQueryParams.Add("skip", parameterToString(localVarOptionals.Skip.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Filter.IsSet() { + localVarQueryParams.Add("filter", parameterToString(localVarOptionals.Filter.Value(), "csv")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v []GraphObjectWithPaths + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +GraphApiService List the associations of a System +This endpoint returns the _direct_ associations of a System. A direct association can be a non-homogeneous relationship between 2 different objects, for example Systems and Users. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/systems/{System_ID}/associations?targets=user \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param systemId ObjectID of the System. + * @param targets Targets which a \"system\" can be associated to. + * @param optional nil or *GraphApiGraphSystemAssociationsListOpts - Optional Parameters: + * @param "Limit" (optional.Int32) - The number of records to return at once. Limited to 100. + * @param "Skip" (optional.Int32) - The offset into the records to return. + * @param "Date" (optional.String) - Current date header for the System Context API + * @param "Authorization" (optional.String) - Authorization header for the System Context API + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. +@return []GraphConnection +*/ + +type GraphApiGraphSystemAssociationsListOpts struct { + Limit optional.Int32 + Skip optional.Int32 + Date optional.String + Authorization optional.String + XOrgId optional.String +} + +func (a *GraphApiService) GraphSystemAssociationsList(ctx context.Context, systemId string, targets []string, localVarOptionals *GraphApiGraphSystemAssociationsListOpts) ([]GraphConnection, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []GraphConnection + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/systems/{system_id}/associations" + localVarPath = strings.Replace(localVarPath, "{"+"system_id"+"}", fmt.Sprintf("%v", systemId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + localVarQueryParams.Add("targets", parameterToString(targets, "csv")) + if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { + localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Skip.IsSet() { + localVarQueryParams.Add("skip", parameterToString(localVarOptionals.Skip.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.Date.IsSet() { + localVarHeaderParams["Date"] = parameterToString(localVarOptionals.Date.Value(), "") + } + if localVarOptionals != nil && localVarOptionals.Authorization.IsSet() { + localVarHeaderParams["Authorization"] = parameterToString(localVarOptionals.Authorization.Value(), "") + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v []GraphConnection + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +GraphApiService Manage associations of a System +This endpoint allows you to manage the _direct_ associations of a System. A direct association can be a non-homogeneous relationship between 2 different objects, for example Systems and Users. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/systems/{System_ID}/associations \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"attributes\": { \"sudo\": { \"enabled\": true, \"withoutPassword\": false } }, \"op\": \"add\", \"type\": \"user\", \"id\": \"UserID\" }' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param systemId ObjectID of the System. + * @param optional nil or *GraphApiGraphSystemAssociationsPostOpts - Optional Parameters: + * @param "Body" (optional.Interface of GraphOperationSystem) - + * @param "Date" (optional.String) - Current date header for the System Context API + * @param "Authorization" (optional.String) - Authorization header for the System Context API + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. + +*/ + +type GraphApiGraphSystemAssociationsPostOpts struct { + Body optional.Interface + Date optional.String + Authorization optional.String + XOrgId optional.String +} + +func (a *GraphApiService) GraphSystemAssociationsPost(ctx context.Context, systemId string, localVarOptionals *GraphApiGraphSystemAssociationsPostOpts) (*http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Post") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/systems/{system_id}/associations" + localVarPath = strings.Replace(localVarPath, "{"+"system_id"+"}", fmt.Sprintf("%v", systemId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.Date.IsSet() { + localVarHeaderParams["Date"] = parameterToString(localVarOptionals.Date.Value(), "") + } + if localVarOptionals != nil && localVarOptionals.Authorization.IsSet() { + localVarHeaderParams["Authorization"] = parameterToString(localVarOptionals.Authorization.Value(), "") + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + // body params + if localVarOptionals != nil && localVarOptionals.Body.IsSet() { + + localVarOptionalBody:= localVarOptionals.Body.Value() + localVarPostBody = &localVarOptionalBody + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarHttpResponse, err + } + + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + return localVarHttpResponse, newErr + } + + return localVarHttpResponse, nil +} +/* +GraphApiService List the associations of a System Group +This endpoint returns the _direct_ associations of a System Group. A direct association can be a non-homogeneous relationship between 2 different objects, for example System Groups and Users. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/systemgroups/{GroupID}/associations?targets=user \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param groupId ObjectID of the System Group. + * @param targets Targets which a \"system_group\" can be associated to. + * @param optional nil or *GraphApiGraphSystemGroupAssociationsListOpts - Optional Parameters: + * @param "Limit" (optional.Int32) - The number of records to return at once. Limited to 100. + * @param "Skip" (optional.Int32) - The offset into the records to return. + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. +@return []GraphConnection +*/ + +type GraphApiGraphSystemGroupAssociationsListOpts struct { + Limit optional.Int32 + Skip optional.Int32 + XOrgId optional.String +} + +func (a *GraphApiService) GraphSystemGroupAssociationsList(ctx context.Context, groupId string, targets []string, localVarOptionals *GraphApiGraphSystemGroupAssociationsListOpts) ([]GraphConnection, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []GraphConnection + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/systemgroups/{group_id}/associations" + localVarPath = strings.Replace(localVarPath, "{"+"group_id"+"}", fmt.Sprintf("%v", groupId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + localVarQueryParams.Add("targets", parameterToString(targets, "csv")) + if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { + localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Skip.IsSet() { + localVarQueryParams.Add("skip", parameterToString(localVarOptionals.Skip.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v []GraphConnection + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +GraphApiService Manage the associations of a System Group +This endpoint allows you to manage the _direct_ associations of a System Group. A direct association can be a non-homogeneous relationship between 2 different objects, for example System Groups and Users. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/systemgroups/{GroupID}/associations \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"op\": \"add\", \"type\": \"user\", \"id\": \"{UserID}\" }' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param groupId ObjectID of the System Group. + * @param optional nil or *GraphApiGraphSystemGroupAssociationsPostOpts - Optional Parameters: + * @param "Body" (optional.Interface of GraphOperationSystemGroup) - + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. + +*/ + +type GraphApiGraphSystemGroupAssociationsPostOpts struct { + Body optional.Interface + XOrgId optional.String +} + +func (a *GraphApiService) GraphSystemGroupAssociationsPost(ctx context.Context, groupId string, localVarOptionals *GraphApiGraphSystemGroupAssociationsPostOpts) (*http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Post") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/systemgroups/{group_id}/associations" + localVarPath = strings.Replace(localVarPath, "{"+"group_id"+"}", fmt.Sprintf("%v", groupId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + // body params + if localVarOptionals != nil && localVarOptionals.Body.IsSet() { + + localVarOptionalBody:= localVarOptionals.Body.Value() + localVarPostBody = &localVarOptionalBody + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarHttpResponse, err + } + + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + return localVarHttpResponse, newErr + } + + return localVarHttpResponse, nil +} +/* +GraphApiService List the members of a System Group +This endpoint returns the system members of a System Group. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/systemgroups/{Group_ID}/members \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param groupId ObjectID of the System Group. + * @param optional nil or *GraphApiGraphSystemGroupMembersListOpts - Optional Parameters: + * @param "Limit" (optional.Int32) - The number of records to return at once. Limited to 100. + * @param "Skip" (optional.Int32) - The offset into the records to return. + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. +@return []GraphConnection +*/ + +type GraphApiGraphSystemGroupMembersListOpts struct { + Limit optional.Int32 + Skip optional.Int32 + XOrgId optional.String +} + +func (a *GraphApiService) GraphSystemGroupMembersList(ctx context.Context, groupId string, localVarOptionals *GraphApiGraphSystemGroupMembersListOpts) ([]GraphConnection, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []GraphConnection + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/systemgroups/{group_id}/members" + localVarPath = strings.Replace(localVarPath, "{"+"group_id"+"}", fmt.Sprintf("%v", groupId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { + localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Skip.IsSet() { + localVarQueryParams.Add("skip", parameterToString(localVarOptionals.Skip.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v []GraphConnection + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +GraphApiService Manage the members of a System Group +This endpoint allows you to manage the system members of a System Group. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/systemgroups/{Group_ID}/members \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"op\": \"add\", \"type\": \"system\", \"id\": \"{System_ID}\" }' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param groupId ObjectID of the System Group. + * @param optional nil or *GraphApiGraphSystemGroupMembersPostOpts - Optional Parameters: + * @param "Body" (optional.Interface of GraphOperationSystemGroupMember) - + * @param "Date" (optional.String) - Current date header for the System Context API + * @param "Authorization" (optional.String) - Authorization header for the System Context API + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. + +*/ + +type GraphApiGraphSystemGroupMembersPostOpts struct { + Body optional.Interface + Date optional.String + Authorization optional.String + XOrgId optional.String +} + +func (a *GraphApiService) GraphSystemGroupMembersPost(ctx context.Context, groupId string, localVarOptionals *GraphApiGraphSystemGroupMembersPostOpts) (*http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Post") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/systemgroups/{group_id}/members" + localVarPath = strings.Replace(localVarPath, "{"+"group_id"+"}", fmt.Sprintf("%v", groupId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.Date.IsSet() { + localVarHeaderParams["Date"] = parameterToString(localVarOptionals.Date.Value(), "") + } + if localVarOptionals != nil && localVarOptionals.Authorization.IsSet() { + localVarHeaderParams["Authorization"] = parameterToString(localVarOptionals.Authorization.Value(), "") + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + // body params + if localVarOptionals != nil && localVarOptionals.Body.IsSet() { + + localVarOptionalBody:= localVarOptionals.Body.Value() + localVarPostBody = &localVarOptionalBody + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarHttpResponse, err + } + + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + return localVarHttpResponse, newErr + } + + return localVarHttpResponse, nil +} +/* +GraphApiService List the System Group's membership +This endpoint returns all Systems that are a member of this System Group. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/systemgroups/{Group_ID/membership \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param groupId ObjectID of the System Group. + * @param optional nil or *GraphApiGraphSystemGroupMembershipOpts - Optional Parameters: + * @param "Limit" (optional.Int32) - The number of records to return at once. Limited to 100. + * @param "Skip" (optional.Int32) - The offset into the records to return. + * @param "Sort" (optional.Interface of []string) - The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. + * @param "Filter" (optional.Interface of []string) - A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. +@return []GraphObjectWithPaths +*/ + +type GraphApiGraphSystemGroupMembershipOpts struct { + Limit optional.Int32 + Skip optional.Int32 + Sort optional.Interface + Filter optional.Interface + XOrgId optional.String +} + +func (a *GraphApiService) GraphSystemGroupMembership(ctx context.Context, groupId string, localVarOptionals *GraphApiGraphSystemGroupMembershipOpts) ([]GraphObjectWithPaths, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []GraphObjectWithPaths + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/systemgroups/{group_id}/membership" + localVarPath = strings.Replace(localVarPath, "{"+"group_id"+"}", fmt.Sprintf("%v", groupId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { + localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Skip.IsSet() { + localVarQueryParams.Add("skip", parameterToString(localVarOptionals.Skip.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Sort.IsSet() { + localVarQueryParams.Add("sort", parameterToString(localVarOptionals.Sort.Value(), "csv")) + } + if localVarOptionals != nil && localVarOptionals.Filter.IsSet() { + localVarQueryParams.Add("filter", parameterToString(localVarOptionals.Filter.Value(), "csv")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v []GraphObjectWithPaths + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +GraphApiService List the Commands bound to a System Group +This endpoint will return all Commands bound to a System Group, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the group's type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this System Group to the corresponding Command; this array represents all grouping and/or associations that would have to be removed to deprovision the Command from this System Group. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/systemgroups/{GroupID}/commands \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param groupId ObjectID of the System Group. + * @param optional nil or *GraphApiGraphSystemGroupTraverseCommandOpts - Optional Parameters: + * @param "Limit" (optional.Int32) - The number of records to return at once. Limited to 100. + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. + * @param "Skip" (optional.Int32) - The offset into the records to return. + * @param "Filter" (optional.Interface of []string) - A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` +@return []GraphObjectWithPaths +*/ + +type GraphApiGraphSystemGroupTraverseCommandOpts struct { + Limit optional.Int32 + XOrgId optional.String + Skip optional.Int32 + Filter optional.Interface +} + +func (a *GraphApiService) GraphSystemGroupTraverseCommand(ctx context.Context, groupId string, localVarOptionals *GraphApiGraphSystemGroupTraverseCommandOpts) ([]GraphObjectWithPaths, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []GraphObjectWithPaths + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/systemgroups/{group_id}/commands" + localVarPath = strings.Replace(localVarPath, "{"+"group_id"+"}", fmt.Sprintf("%v", groupId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { + localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Skip.IsSet() { + localVarQueryParams.Add("skip", parameterToString(localVarOptionals.Skip.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Filter.IsSet() { + localVarQueryParams.Add("filter", parameterToString(localVarOptionals.Filter.Value(), "csv")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v []GraphObjectWithPaths + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +GraphApiService List the Policies bound to a System Group +This endpoint will return all Policies bound to a System Group, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this System Group to the corresponding Policy; this array represents all grouping and/or associations that would have to be removed to deprovision the Policy from this System Group. See `/members` and `/associations` endpoints to manage those collections. This endpoint is not public yet as we haven't finished the code. ##### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/systemgroups/{GroupID}/policies \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param groupId ObjectID of the System Group. + * @param optional nil or *GraphApiGraphSystemGroupTraversePolicyOpts - Optional Parameters: + * @param "Limit" (optional.Int32) - The number of records to return at once. Limited to 100. + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. + * @param "Skip" (optional.Int32) - The offset into the records to return. + * @param "Filter" (optional.Interface of []string) - A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` +@return []GraphObjectWithPaths +*/ + +type GraphApiGraphSystemGroupTraversePolicyOpts struct { + Limit optional.Int32 + XOrgId optional.String + Skip optional.Int32 + Filter optional.Interface +} + +func (a *GraphApiService) GraphSystemGroupTraversePolicy(ctx context.Context, groupId string, localVarOptionals *GraphApiGraphSystemGroupTraversePolicyOpts) ([]GraphObjectWithPaths, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []GraphObjectWithPaths + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/systemgroups/{group_id}/policies" + localVarPath = strings.Replace(localVarPath, "{"+"group_id"+"}", fmt.Sprintf("%v", groupId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { + localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Skip.IsSet() { + localVarQueryParams.Add("skip", parameterToString(localVarOptionals.Skip.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Filter.IsSet() { + localVarQueryParams.Add("filter", parameterToString(localVarOptionals.Filter.Value(), "csv")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v []GraphObjectWithPaths + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +GraphApiService List the Policy Groups bound to a System Group +This endpoint will return all Policy Groups bound to a System Group, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this System Group to the corresponding Policy Group; this array represents all grouping and/or associations that would have to be removed to deprovision the Policy Group from this System Group. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/systemgroups/{GroupID}/policygroups \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param groupId ObjectID of the System Group. + * @param optional nil or *GraphApiGraphSystemGroupTraversePolicyGroupOpts - Optional Parameters: + * @param "Limit" (optional.Int32) - The number of records to return at once. Limited to 100. + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. + * @param "Skip" (optional.Int32) - The offset into the records to return. + * @param "Filter" (optional.Interface of []string) - A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` +@return []GraphObjectWithPaths +*/ + +type GraphApiGraphSystemGroupTraversePolicyGroupOpts struct { + Limit optional.Int32 + XOrgId optional.String + Skip optional.Int32 + Filter optional.Interface +} + +func (a *GraphApiService) GraphSystemGroupTraversePolicyGroup(ctx context.Context, groupId string, localVarOptionals *GraphApiGraphSystemGroupTraversePolicyGroupOpts) ([]GraphObjectWithPaths, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []GraphObjectWithPaths + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/systemgroups/{group_id}/policygroups" + localVarPath = strings.Replace(localVarPath, "{"+"group_id"+"}", fmt.Sprintf("%v", groupId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { + localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Skip.IsSet() { + localVarQueryParams.Add("skip", parameterToString(localVarOptionals.Skip.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Filter.IsSet() { + localVarQueryParams.Add("filter", parameterToString(localVarOptionals.Filter.Value(), "csv")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v []GraphObjectWithPaths + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +GraphApiService List the Users bound to a System Group +This endpoint will return all Users bound to a System Group, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this System Group to the corresponding User; this array represents all grouping and/or associations that would have to be removed to deprovision the User from this System Group. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/systemgroups/{GroupID}/users \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param groupId ObjectID of the System Group. + * @param optional nil or *GraphApiGraphSystemGroupTraverseUserOpts - Optional Parameters: + * @param "Limit" (optional.Int32) - The number of records to return at once. Limited to 100. + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. + * @param "Skip" (optional.Int32) - The offset into the records to return. + * @param "Filter" (optional.Interface of []string) - A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` +@return []GraphObjectWithPaths +*/ + +type GraphApiGraphSystemGroupTraverseUserOpts struct { + Limit optional.Int32 + XOrgId optional.String + Skip optional.Int32 + Filter optional.Interface +} + +func (a *GraphApiService) GraphSystemGroupTraverseUser(ctx context.Context, groupId string, localVarOptionals *GraphApiGraphSystemGroupTraverseUserOpts) ([]GraphObjectWithPaths, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []GraphObjectWithPaths + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/systemgroups/{group_id}/users" + localVarPath = strings.Replace(localVarPath, "{"+"group_id"+"}", fmt.Sprintf("%v", groupId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { + localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Skip.IsSet() { + localVarQueryParams.Add("skip", parameterToString(localVarOptionals.Skip.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Filter.IsSet() { + localVarQueryParams.Add("filter", parameterToString(localVarOptionals.Filter.Value(), "csv")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v []GraphObjectWithPaths + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +GraphApiService List the User Groups bound to a System Group +This endpoint will return all User Groups bound to a System Group, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this System Group to the corresponding User Group; this array represents all grouping and/or associations that would have to be removed to deprovision the User Group from this System Group. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/systemgroups/{GroupID}/usergroups \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param groupId ObjectID of the System Group. + * @param optional nil or *GraphApiGraphSystemGroupTraverseUserGroupOpts - Optional Parameters: + * @param "Limit" (optional.Int32) - The number of records to return at once. Limited to 100. + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. + * @param "Skip" (optional.Int32) - The offset into the records to return. + * @param "Filter" (optional.Interface of []string) - A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` +@return []GraphObjectWithPaths +*/ + +type GraphApiGraphSystemGroupTraverseUserGroupOpts struct { + Limit optional.Int32 + XOrgId optional.String + Skip optional.Int32 + Filter optional.Interface +} + +func (a *GraphApiService) GraphSystemGroupTraverseUserGroup(ctx context.Context, groupId string, localVarOptionals *GraphApiGraphSystemGroupTraverseUserGroupOpts) ([]GraphObjectWithPaths, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []GraphObjectWithPaths + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/systemgroups/{group_id}/usergroups" + localVarPath = strings.Replace(localVarPath, "{"+"group_id"+"}", fmt.Sprintf("%v", groupId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { + localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Skip.IsSet() { + localVarQueryParams.Add("skip", parameterToString(localVarOptionals.Skip.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Filter.IsSet() { + localVarQueryParams.Add("filter", parameterToString(localVarOptionals.Filter.Value(), "csv")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v []GraphObjectWithPaths + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +GraphApiService List the parent Groups of a System +This endpoint returns all the System Groups a System is a member of. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/systems/{System_ID}/memberof \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param systemId ObjectID of the System. + * @param optional nil or *GraphApiGraphSystemMemberOfOpts - Optional Parameters: + * @param "Filter" (optional.Interface of []string) - A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` + * @param "Limit" (optional.Int32) - The number of records to return at once. Limited to 100. + * @param "Skip" (optional.Int32) - The offset into the records to return. + * @param "Date" (optional.String) - Current date header for the System Context API + * @param "Authorization" (optional.String) - Authorization header for the System Context API + * @param "Sort" (optional.Interface of []string) - The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. +@return []GraphObjectWithPaths +*/ + +type GraphApiGraphSystemMemberOfOpts struct { + Filter optional.Interface + Limit optional.Int32 + Skip optional.Int32 + Date optional.String + Authorization optional.String + Sort optional.Interface + XOrgId optional.String +} + +func (a *GraphApiService) GraphSystemMemberOf(ctx context.Context, systemId string, localVarOptionals *GraphApiGraphSystemMemberOfOpts) ([]GraphObjectWithPaths, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []GraphObjectWithPaths + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/systems/{system_id}/memberof" + localVarPath = strings.Replace(localVarPath, "{"+"system_id"+"}", fmt.Sprintf("%v", systemId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Filter.IsSet() { + localVarQueryParams.Add("filter", parameterToString(localVarOptionals.Filter.Value(), "csv")) + } + if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { + localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Skip.IsSet() { + localVarQueryParams.Add("skip", parameterToString(localVarOptionals.Skip.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Sort.IsSet() { + localVarQueryParams.Add("sort", parameterToString(localVarOptionals.Sort.Value(), "csv")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.Date.IsSet() { + localVarHeaderParams["Date"] = parameterToString(localVarOptionals.Date.Value(), "") + } + if localVarOptionals != nil && localVarOptionals.Authorization.IsSet() { + localVarHeaderParams["Authorization"] = parameterToString(localVarOptionals.Authorization.Value(), "") + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v []GraphObjectWithPaths + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +GraphApiService List the Commands bound to a System +This endpoint will return all Commands bound to a System, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this System to the corresponding Command; this array represents all grouping and/or associations that would have to be removed to deprovision the Command from this System. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/systems/{System_ID}/commands \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param systemId ObjectID of the System. + * @param optional nil or *GraphApiGraphSystemTraverseCommandOpts - Optional Parameters: + * @param "Limit" (optional.Int32) - The number of records to return at once. Limited to 100. + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. + * @param "Skip" (optional.Int32) - The offset into the records to return. + * @param "Filter" (optional.Interface of []string) - A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` +@return []GraphObjectWithPaths +*/ + +type GraphApiGraphSystemTraverseCommandOpts struct { + Limit optional.Int32 + XOrgId optional.String + Skip optional.Int32 + Filter optional.Interface +} + +func (a *GraphApiService) GraphSystemTraverseCommand(ctx context.Context, systemId string, localVarOptionals *GraphApiGraphSystemTraverseCommandOpts) ([]GraphObjectWithPaths, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []GraphObjectWithPaths + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/systems/{system_id}/commands" + localVarPath = strings.Replace(localVarPath, "{"+"system_id"+"}", fmt.Sprintf("%v", systemId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { + localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Skip.IsSet() { + localVarQueryParams.Add("skip", parameterToString(localVarOptionals.Skip.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Filter.IsSet() { + localVarQueryParams.Add("filter", parameterToString(localVarOptionals.Filter.Value(), "csv")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v []GraphObjectWithPaths + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +GraphApiService List the Policies bound to a System +This endpoint will return all Policies bound to a System, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this System to the corresponding Policy; this array represents all grouping and/or associations that would have to be removed to deprovision the Policy from this System. See `/members` and `/associations` endpoints to manage those collections. This endpoint is not yet public as we have finish the code. ##### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/{System_ID}/policies \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param systemId ObjectID of the System. + * @param optional nil or *GraphApiGraphSystemTraversePolicyOpts - Optional Parameters: + * @param "Limit" (optional.Int32) - The number of records to return at once. Limited to 100. + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. + * @param "Skip" (optional.Int32) - The offset into the records to return. + * @param "Filter" (optional.Interface of []string) - A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` +@return []GraphObjectWithPaths +*/ + +type GraphApiGraphSystemTraversePolicyOpts struct { + Limit optional.Int32 + XOrgId optional.String + Skip optional.Int32 + Filter optional.Interface +} + +func (a *GraphApiService) GraphSystemTraversePolicy(ctx context.Context, systemId string, localVarOptionals *GraphApiGraphSystemTraversePolicyOpts) ([]GraphObjectWithPaths, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []GraphObjectWithPaths + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/systems/{system_id}/policies" + localVarPath = strings.Replace(localVarPath, "{"+"system_id"+"}", fmt.Sprintf("%v", systemId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { + localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Skip.IsSet() { + localVarQueryParams.Add("skip", parameterToString(localVarOptionals.Skip.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Filter.IsSet() { + localVarQueryParams.Add("filter", parameterToString(localVarOptionals.Filter.Value(), "csv")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v []GraphObjectWithPaths + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +GraphApiService List the Policy Groups bound to a System +This endpoint will return all Policy Groups bound to a System, either directly or indirectly essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this System to the corresponding Policy Group; this array represents all grouping and/or associations that would have to be removed to deprovision the Policy Group from this System. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/systems/{System_ID}/policygroups \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param systemId ObjectID of the System. + * @param optional nil or *GraphApiGraphSystemTraversePolicyGroupOpts - Optional Parameters: + * @param "Limit" (optional.Int32) - The number of records to return at once. Limited to 100. + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. + * @param "Skip" (optional.Int32) - The offset into the records to return. + * @param "Date" (optional.String) - Current date header for the System Context API + * @param "Authorization" (optional.String) - Authorization header for the System Context API + * @param "Filter" (optional.Interface of []string) - A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` +@return []GraphObjectWithPaths +*/ + +type GraphApiGraphSystemTraversePolicyGroupOpts struct { + Limit optional.Int32 + XOrgId optional.String + Skip optional.Int32 + Date optional.String + Authorization optional.String + Filter optional.Interface +} + +func (a *GraphApiService) GraphSystemTraversePolicyGroup(ctx context.Context, systemId string, localVarOptionals *GraphApiGraphSystemTraversePolicyGroupOpts) ([]GraphObjectWithPaths, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []GraphObjectWithPaths + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/systems/{system_id}/policygroups" + localVarPath = strings.Replace(localVarPath, "{"+"system_id"+"}", fmt.Sprintf("%v", systemId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { + localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Skip.IsSet() { + localVarQueryParams.Add("skip", parameterToString(localVarOptionals.Skip.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Filter.IsSet() { + localVarQueryParams.Add("filter", parameterToString(localVarOptionals.Filter.Value(), "csv")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if localVarOptionals != nil && localVarOptionals.Date.IsSet() { + localVarHeaderParams["Date"] = parameterToString(localVarOptionals.Date.Value(), "") + } + if localVarOptionals != nil && localVarOptionals.Authorization.IsSet() { + localVarHeaderParams["Authorization"] = parameterToString(localVarOptionals.Authorization.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v []GraphObjectWithPaths + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +GraphApiService List the Users bound to a System +This endpoint will return all Users bound to a System, either directly or indirectly essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this System to the corresponding User; this array represents all grouping and/or associations that would have to be removed to deprovision the User from this System. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/systems/{System_ID}/users \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param systemId ObjectID of the System. + * @param optional nil or *GraphApiGraphSystemTraverseUserOpts - Optional Parameters: + * @param "Limit" (optional.Int32) - The number of records to return at once. Limited to 100. + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. + * @param "Skip" (optional.Int32) - The offset into the records to return. + * @param "Date" (optional.String) - Current date header for the System Context API + * @param "Authorization" (optional.String) - Authorization header for the System Context API + * @param "Filter" (optional.Interface of []string) - A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` +@return []GraphObjectWithPaths +*/ + +type GraphApiGraphSystemTraverseUserOpts struct { + Limit optional.Int32 + XOrgId optional.String + Skip optional.Int32 + Date optional.String + Authorization optional.String + Filter optional.Interface +} + +func (a *GraphApiService) GraphSystemTraverseUser(ctx context.Context, systemId string, localVarOptionals *GraphApiGraphSystemTraverseUserOpts) ([]GraphObjectWithPaths, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []GraphObjectWithPaths + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/systems/{system_id}/users" + localVarPath = strings.Replace(localVarPath, "{"+"system_id"+"}", fmt.Sprintf("%v", systemId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { + localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Skip.IsSet() { + localVarQueryParams.Add("skip", parameterToString(localVarOptionals.Skip.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Filter.IsSet() { + localVarQueryParams.Add("filter", parameterToString(localVarOptionals.Filter.Value(), "csv")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if localVarOptionals != nil && localVarOptionals.Date.IsSet() { + localVarHeaderParams["Date"] = parameterToString(localVarOptionals.Date.Value(), "") + } + if localVarOptionals != nil && localVarOptionals.Authorization.IsSet() { + localVarHeaderParams["Authorization"] = parameterToString(localVarOptionals.Authorization.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v []GraphObjectWithPaths + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +GraphApiService List the User Groups bound to a System +This endpoint will return all User Groups bound to a System, either directly or indirectly essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this System to the corresponding User Group; this array represents all grouping and/or associations that would have to be removed to deprovision the User Group from this System. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/systems/{System_ID}/usergroups \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param systemId ObjectID of the System. + * @param optional nil or *GraphApiGraphSystemTraverseUserGroupOpts - Optional Parameters: + * @param "Limit" (optional.Int32) - The number of records to return at once. Limited to 100. + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. + * @param "Skip" (optional.Int32) - The offset into the records to return. + * @param "Date" (optional.String) - Current date header for the System Context API + * @param "Authorization" (optional.String) - Authorization header for the System Context API + * @param "Filter" (optional.Interface of []string) - A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` +@return []GraphObjectWithPaths +*/ + +type GraphApiGraphSystemTraverseUserGroupOpts struct { + Limit optional.Int32 + XOrgId optional.String + Skip optional.Int32 + Date optional.String + Authorization optional.String + Filter optional.Interface +} + +func (a *GraphApiService) GraphSystemTraverseUserGroup(ctx context.Context, systemId string, localVarOptionals *GraphApiGraphSystemTraverseUserGroupOpts) ([]GraphObjectWithPaths, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []GraphObjectWithPaths + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/systems/{system_id}/usergroups" + localVarPath = strings.Replace(localVarPath, "{"+"system_id"+"}", fmt.Sprintf("%v", systemId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { + localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Skip.IsSet() { + localVarQueryParams.Add("skip", parameterToString(localVarOptionals.Skip.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Filter.IsSet() { + localVarQueryParams.Add("filter", parameterToString(localVarOptionals.Filter.Value(), "csv")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if localVarOptionals != nil && localVarOptionals.Date.IsSet() { + localVarHeaderParams["Date"] = parameterToString(localVarOptionals.Date.Value(), "") + } + if localVarOptionals != nil && localVarOptionals.Authorization.IsSet() { + localVarHeaderParams["Authorization"] = parameterToString(localVarOptionals.Authorization.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v []GraphObjectWithPaths + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +GraphApiService List the associations of a User +This endpoint returns the _direct_ associations of a User. A direct association can be a non-homogeneous relationship between 2 different objects, for example Users and Systems. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/users/{UserID}/associations?targets=system_group \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param userId ObjectID of the User. + * @param targets Targets which a \"user\" can be associated to. + * @param optional nil or *GraphApiGraphUserAssociationsListOpts - Optional Parameters: + * @param "Limit" (optional.Int32) - The number of records to return at once. Limited to 100. + * @param "Skip" (optional.Int32) - The offset into the records to return. + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. +@return []GraphConnection +*/ + +type GraphApiGraphUserAssociationsListOpts struct { + Limit optional.Int32 + Skip optional.Int32 + XOrgId optional.String +} + +func (a *GraphApiService) GraphUserAssociationsList(ctx context.Context, userId string, targets []string, localVarOptionals *GraphApiGraphUserAssociationsListOpts) ([]GraphConnection, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []GraphConnection + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/users/{user_id}/associations" + localVarPath = strings.Replace(localVarPath, "{"+"user_id"+"}", fmt.Sprintf("%v", userId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + localVarQueryParams.Add("targets", parameterToString(targets, "csv")) + if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { + localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Skip.IsSet() { + localVarQueryParams.Add("skip", parameterToString(localVarOptionals.Skip.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v []GraphConnection + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +GraphApiService Manage the associations of a User +This endpoint allows you to manage the _direct_ associations of a User. A direct association can be a non-homogeneous relationship between 2 different objects, for example Users and Systems. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/users/{UserID}/associations \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"attributes\": { \"sudo\": { \"enabled\": true, \"withoutPassword\": false } }, \"op\": \"add\", \"type\": \"system_group\", \"id\": \"{GroupID}\" }' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param userId ObjectID of the User. + * @param optional nil or *GraphApiGraphUserAssociationsPostOpts - Optional Parameters: + * @param "Body" (optional.Interface of GraphOperationUser) - + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. + +*/ + +type GraphApiGraphUserAssociationsPostOpts struct { + Body optional.Interface + XOrgId optional.String +} + +func (a *GraphApiService) GraphUserAssociationsPost(ctx context.Context, userId string, localVarOptionals *GraphApiGraphUserAssociationsPostOpts) (*http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Post") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/users/{user_id}/associations" + localVarPath = strings.Replace(localVarPath, "{"+"user_id"+"}", fmt.Sprintf("%v", userId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + // body params + if localVarOptionals != nil && localVarOptionals.Body.IsSet() { + + localVarOptionalBody:= localVarOptionals.Body.Value() + localVarPostBody = &localVarOptionalBody + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarHttpResponse, err + } + + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + return localVarHttpResponse, newErr + } + + return localVarHttpResponse, nil +} +/* +GraphApiService List the associations of a User Group. +This endpoint returns the _direct_ associations of this User Group. A direct association can be a non-homogeneous relationship between 2 different objects, for example User Groups and Users. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/usergroups/{GroupID}/associations?targets=system \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param groupId ObjectID of the User Group. + * @param targets Targets which a \"user_group\" can be associated to. + * @param optional nil or *GraphApiGraphUserGroupAssociationsListOpts - Optional Parameters: + * @param "Limit" (optional.Int32) - The number of records to return at once. Limited to 100. + * @param "Skip" (optional.Int32) - The offset into the records to return. + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. +@return []GraphConnection +*/ + +type GraphApiGraphUserGroupAssociationsListOpts struct { + Limit optional.Int32 + Skip optional.Int32 + XOrgId optional.String +} + +func (a *GraphApiService) GraphUserGroupAssociationsList(ctx context.Context, groupId string, targets []string, localVarOptionals *GraphApiGraphUserGroupAssociationsListOpts) ([]GraphConnection, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []GraphConnection + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/usergroups/{group_id}/associations" + localVarPath = strings.Replace(localVarPath, "{"+"group_id"+"}", fmt.Sprintf("%v", groupId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + localVarQueryParams.Add("targets", parameterToString(targets, "csv")) + if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { + localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Skip.IsSet() { + localVarQueryParams.Add("skip", parameterToString(localVarOptionals.Skip.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v []GraphConnection + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +GraphApiService Manage the associations of a User Group +This endpoint manages the _direct_ associations of this User Group. A direct association can be a non-homogeneous relationship between 2 different objects, for example User Groups and Users. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/usergroups/{GroupID}/associations \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"op\": \"add\", \"type\": \"system\", \"id\": \"{SystemID}\" }' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param groupId ObjectID of the User Group. + * @param optional nil or *GraphApiGraphUserGroupAssociationsPostOpts - Optional Parameters: + * @param "Body" (optional.Interface of GraphOperationUserGroup) - + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. + +*/ + +type GraphApiGraphUserGroupAssociationsPostOpts struct { + Body optional.Interface + XOrgId optional.String +} + +func (a *GraphApiService) GraphUserGroupAssociationsPost(ctx context.Context, groupId string, localVarOptionals *GraphApiGraphUserGroupAssociationsPostOpts) (*http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Post") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/usergroups/{group_id}/associations" + localVarPath = strings.Replace(localVarPath, "{"+"group_id"+"}", fmt.Sprintf("%v", groupId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + // body params + if localVarOptionals != nil && localVarOptionals.Body.IsSet() { + + localVarOptionalBody:= localVarOptionals.Body.Value() + localVarPostBody = &localVarOptionalBody + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarHttpResponse, err + } + + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + return localVarHttpResponse, newErr + } + + return localVarHttpResponse, nil +} +/* +GraphApiService List the members of a User Group +This endpoint returns the user members of a User Group. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/usergroups/{GroupID}/members \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param groupId ObjectID of the User Group. + * @param optional nil or *GraphApiGraphUserGroupMembersListOpts - Optional Parameters: + * @param "Limit" (optional.Int32) - The number of records to return at once. Limited to 100. + * @param "Skip" (optional.Int32) - The offset into the records to return. + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. +@return []GraphConnection +*/ + +type GraphApiGraphUserGroupMembersListOpts struct { + Limit optional.Int32 + Skip optional.Int32 + XOrgId optional.String +} + +func (a *GraphApiService) GraphUserGroupMembersList(ctx context.Context, groupId string, localVarOptionals *GraphApiGraphUserGroupMembersListOpts) ([]GraphConnection, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []GraphConnection + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/usergroups/{group_id}/members" + localVarPath = strings.Replace(localVarPath, "{"+"group_id"+"}", fmt.Sprintf("%v", groupId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { + localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Skip.IsSet() { + localVarQueryParams.Add("skip", parameterToString(localVarOptionals.Skip.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v []GraphConnection + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +GraphApiService Manage the members of a User Group +This endpoint allows you to manage the user members of a User Group. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/usergroups/{GroupID}/members \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"op\": \"add\", \"type\": \"user\", \"id\": \"{User_ID}\" }' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param groupId ObjectID of the User Group. + * @param optional nil or *GraphApiGraphUserGroupMembersPostOpts - Optional Parameters: + * @param "Body" (optional.Interface of GraphOperationUserGroupMember) - + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. + +*/ + +type GraphApiGraphUserGroupMembersPostOpts struct { + Body optional.Interface + XOrgId optional.String +} + +func (a *GraphApiService) GraphUserGroupMembersPost(ctx context.Context, groupId string, localVarOptionals *GraphApiGraphUserGroupMembersPostOpts) (*http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Post") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/usergroups/{group_id}/members" + localVarPath = strings.Replace(localVarPath, "{"+"group_id"+"}", fmt.Sprintf("%v", groupId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + // body params + if localVarOptionals != nil && localVarOptionals.Body.IsSet() { + + localVarOptionalBody:= localVarOptionals.Body.Value() + localVarPostBody = &localVarOptionalBody + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarHttpResponse, err + } + + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + return localVarHttpResponse, newErr + } + + return localVarHttpResponse, nil +} +/* +GraphApiService List the User Group's membership +This endpoint returns all users members that are a member of this User Group. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/usergroups/{GroupID}/membership \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param groupId ObjectID of the User Group. + * @param optional nil or *GraphApiGraphUserGroupMembershipOpts - Optional Parameters: + * @param "Filter" (optional.Interface of []string) - A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` + * @param "Limit" (optional.Int32) - The number of records to return at once. Limited to 100. + * @param "Skip" (optional.Int32) - The offset into the records to return. + * @param "Sort" (optional.Interface of []string) - The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. +@return []GraphObjectWithPaths +*/ + +type GraphApiGraphUserGroupMembershipOpts struct { + Filter optional.Interface + Limit optional.Int32 + Skip optional.Int32 + Sort optional.Interface + XOrgId optional.String +} + +func (a *GraphApiService) GraphUserGroupMembership(ctx context.Context, groupId string, localVarOptionals *GraphApiGraphUserGroupMembershipOpts) ([]GraphObjectWithPaths, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []GraphObjectWithPaths + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/usergroups/{group_id}/membership" + localVarPath = strings.Replace(localVarPath, "{"+"group_id"+"}", fmt.Sprintf("%v", groupId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Filter.IsSet() { + localVarQueryParams.Add("filter", parameterToString(localVarOptionals.Filter.Value(), "csv")) + } + if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { + localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Skip.IsSet() { + localVarQueryParams.Add("skip", parameterToString(localVarOptionals.Skip.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Sort.IsSet() { + localVarQueryParams.Add("sort", parameterToString(localVarOptionals.Sort.Value(), "csv")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v []GraphObjectWithPaths + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +GraphApiService List the Active Directories bound to a User Group +This endpoint will return all Active Directory Instances bound to a User Group, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this User Group to the corresponding Active Directory; this array represents all grouping and/or associations that would have to be removed to deprovision the Active Directory from this User Group. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/usergroups/{GroupID}/activedirectories \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param groupId ObjectID of the User Group. + * @param optional nil or *GraphApiGraphUserGroupTraverseActiveDirectoryOpts - Optional Parameters: + * @param "Limit" (optional.Int32) - The number of records to return at once. Limited to 100. + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. + * @param "Skip" (optional.Int32) - The offset into the records to return. + * @param "Filter" (optional.Interface of []string) - A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` +@return []GraphObjectWithPaths +*/ + +type GraphApiGraphUserGroupTraverseActiveDirectoryOpts struct { + Limit optional.Int32 + XOrgId optional.String + Skip optional.Int32 + Filter optional.Interface +} + +func (a *GraphApiService) GraphUserGroupTraverseActiveDirectory(ctx context.Context, groupId string, localVarOptionals *GraphApiGraphUserGroupTraverseActiveDirectoryOpts) ([]GraphObjectWithPaths, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []GraphObjectWithPaths + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/usergroups/{group_id}/activedirectories" + localVarPath = strings.Replace(localVarPath, "{"+"group_id"+"}", fmt.Sprintf("%v", groupId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { + localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Skip.IsSet() { + localVarQueryParams.Add("skip", parameterToString(localVarOptionals.Skip.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Filter.IsSet() { + localVarQueryParams.Add("filter", parameterToString(localVarOptionals.Filter.Value(), "csv")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v []GraphObjectWithPaths + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +GraphApiService List the Applications bound to a User Group +This endpoint will return all Applications bound to a User Group, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this User Group to the corresponding Application; this array represents all grouping and/or associations that would have to be removed to deprovision the Application from this User Group. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/usergroups/{GroupID}/applications \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param groupId ObjectID of the User Group. + * @param optional nil or *GraphApiGraphUserGroupTraverseApplicationOpts - Optional Parameters: + * @param "Limit" (optional.Int32) - The number of records to return at once. Limited to 100. + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. + * @param "Skip" (optional.Int32) - The offset into the records to return. + * @param "Filter" (optional.Interface of []string) - A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` +@return []GraphObjectWithPaths +*/ + +type GraphApiGraphUserGroupTraverseApplicationOpts struct { + Limit optional.Int32 + XOrgId optional.String + Skip optional.Int32 + Filter optional.Interface +} + +func (a *GraphApiService) GraphUserGroupTraverseApplication(ctx context.Context, groupId string, localVarOptionals *GraphApiGraphUserGroupTraverseApplicationOpts) ([]GraphObjectWithPaths, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []GraphObjectWithPaths + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/usergroups/{group_id}/applications" + localVarPath = strings.Replace(localVarPath, "{"+"group_id"+"}", fmt.Sprintf("%v", groupId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { + localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Skip.IsSet() { + localVarQueryParams.Add("skip", parameterToString(localVarOptionals.Skip.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Filter.IsSet() { + localVarQueryParams.Add("filter", parameterToString(localVarOptionals.Filter.Value(), "csv")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v []GraphObjectWithPaths + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +GraphApiService List the Directories bound to a User Group +This endpoint will return all Directories bound to a User Group, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this User Group to the corresponding Directory; this array represents all grouping and/or associations that would have to be removed to deprovision the Directories from this User Group. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/usergroups/{GroupID}/directories \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param groupId ObjectID of the User Group. + * @param optional nil or *GraphApiGraphUserGroupTraverseDirectoryOpts - Optional Parameters: + * @param "Limit" (optional.Int32) - The number of records to return at once. Limited to 100. + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. + * @param "Skip" (optional.Int32) - The offset into the records to return. + * @param "Filter" (optional.Interface of []string) - A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` +@return []GraphObjectWithPaths +*/ + +type GraphApiGraphUserGroupTraverseDirectoryOpts struct { + Limit optional.Int32 + XOrgId optional.String + Skip optional.Int32 + Filter optional.Interface +} + +func (a *GraphApiService) GraphUserGroupTraverseDirectory(ctx context.Context, groupId string, localVarOptionals *GraphApiGraphUserGroupTraverseDirectoryOpts) ([]GraphObjectWithPaths, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []GraphObjectWithPaths + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/usergroups/{group_id}/directories" + localVarPath = strings.Replace(localVarPath, "{"+"group_id"+"}", fmt.Sprintf("%v", groupId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { + localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Skip.IsSet() { + localVarQueryParams.Add("skip", parameterToString(localVarOptionals.Skip.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Filter.IsSet() { + localVarQueryParams.Add("filter", parameterToString(localVarOptionals.Filter.Value(), "csv")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v []GraphObjectWithPaths + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +GraphApiService List the G Suite instances bound to a User Group +This endpoint will return all G Suite Instances bound to a User Group, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this User Group to the corresponding G Suite instance; this array represents all grouping and/or associations that would have to be removed to deprovision the G Suite instance from this User Group. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/usergroups/{GroupID/gsuites \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param groupId ObjectID of the User Group. + * @param optional nil or *GraphApiGraphUserGroupTraverseGSuiteOpts - Optional Parameters: + * @param "Limit" (optional.Int32) - The number of records to return at once. Limited to 100. + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. + * @param "Skip" (optional.Int32) - The offset into the records to return. + * @param "Filter" (optional.Interface of []string) - A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` +@return []GraphObjectWithPaths +*/ + +type GraphApiGraphUserGroupTraverseGSuiteOpts struct { + Limit optional.Int32 + XOrgId optional.String + Skip optional.Int32 + Filter optional.Interface +} + +func (a *GraphApiService) GraphUserGroupTraverseGSuite(ctx context.Context, groupId string, localVarOptionals *GraphApiGraphUserGroupTraverseGSuiteOpts) ([]GraphObjectWithPaths, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []GraphObjectWithPaths + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/usergroups/{group_id}/gsuites" + localVarPath = strings.Replace(localVarPath, "{"+"group_id"+"}", fmt.Sprintf("%v", groupId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { + localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Skip.IsSet() { + localVarQueryParams.Add("skip", parameterToString(localVarOptionals.Skip.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Filter.IsSet() { + localVarQueryParams.Add("filter", parameterToString(localVarOptionals.Filter.Value(), "csv")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v []GraphObjectWithPaths + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +GraphApiService List the LDAP Servers bound to a User Group +This endpoint will return all LDAP Servers bound to a User Group, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this User Group to the corresponding LDAP Server; this array represents all grouping and/or associations that would have to be removed to deprovision the LDAP Server from this User Group. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/usergroups/{GroupID}/ldapservers \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param groupId ObjectID of the User Group. + * @param optional nil or *GraphApiGraphUserGroupTraverseLdapServerOpts - Optional Parameters: + * @param "Limit" (optional.Int32) - The number of records to return at once. Limited to 100. + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. + * @param "Skip" (optional.Int32) - The offset into the records to return. + * @param "Filter" (optional.Interface of []string) - A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` +@return []GraphObjectWithPaths +*/ + +type GraphApiGraphUserGroupTraverseLdapServerOpts struct { + Limit optional.Int32 + XOrgId optional.String + Skip optional.Int32 + Filter optional.Interface +} + +func (a *GraphApiService) GraphUserGroupTraverseLdapServer(ctx context.Context, groupId string, localVarOptionals *GraphApiGraphUserGroupTraverseLdapServerOpts) ([]GraphObjectWithPaths, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []GraphObjectWithPaths + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/usergroups/{group_id}/ldapservers" + localVarPath = strings.Replace(localVarPath, "{"+"group_id"+"}", fmt.Sprintf("%v", groupId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { + localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Skip.IsSet() { + localVarQueryParams.Add("skip", parameterToString(localVarOptionals.Skip.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Filter.IsSet() { + localVarQueryParams.Add("filter", parameterToString(localVarOptionals.Filter.Value(), "csv")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v []GraphObjectWithPaths + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +GraphApiService List the Office 365 instances bound to a User Group +This endpoint will return all Office 365 instances bound to a User Group, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this User Group to the corresponding Office 365 instance; this array represents all grouping and/or associations that would have to be removed to deprovision the Office 365 instance from this User Group. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/usergroups/{GroupID}/office365s \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param groupId ObjectID of the User Group. + * @param optional nil or *GraphApiGraphUserGroupTraverseOffice365Opts - Optional Parameters: + * @param "Limit" (optional.Int32) - The number of records to return at once. Limited to 100. + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. + * @param "Skip" (optional.Int32) - The offset into the records to return. + * @param "Filter" (optional.Interface of []string) - A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` +@return []GraphObjectWithPaths +*/ + +type GraphApiGraphUserGroupTraverseOffice365Opts struct { + Limit optional.Int32 + XOrgId optional.String + Skip optional.Int32 + Filter optional.Interface +} + +func (a *GraphApiService) GraphUserGroupTraverseOffice365(ctx context.Context, groupId string, localVarOptionals *GraphApiGraphUserGroupTraverseOffice365Opts) ([]GraphObjectWithPaths, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []GraphObjectWithPaths + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/usergroups/{group_id}/office365s" + localVarPath = strings.Replace(localVarPath, "{"+"group_id"+"}", fmt.Sprintf("%v", groupId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { + localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Skip.IsSet() { + localVarQueryParams.Add("skip", parameterToString(localVarOptionals.Skip.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Filter.IsSet() { + localVarQueryParams.Add("filter", parameterToString(localVarOptionals.Filter.Value(), "csv")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v []GraphObjectWithPaths + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +GraphApiService List the RADIUS Servers bound to a User Group +This endpoint will return all RADIUS servers bound to a User Group, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this User Group to the corresponding RADIUS Server; this array represents all grouping and/or associations that would have to be removed to deprovision the RADIUS Server from this User Group. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/usergroups/{GroupID}/radiusservers \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param groupId ObjectID of the User Group. + * @param optional nil or *GraphApiGraphUserGroupTraverseRadiusServerOpts - Optional Parameters: + * @param "Limit" (optional.Int32) - The number of records to return at once. Limited to 100. + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. + * @param "Skip" (optional.Int32) - The offset into the records to return. + * @param "Filter" (optional.Interface of []string) - A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` +@return []GraphObjectWithPaths +*/ + +type GraphApiGraphUserGroupTraverseRadiusServerOpts struct { + Limit optional.Int32 + XOrgId optional.String + Skip optional.Int32 + Filter optional.Interface +} + +func (a *GraphApiService) GraphUserGroupTraverseRadiusServer(ctx context.Context, groupId string, localVarOptionals *GraphApiGraphUserGroupTraverseRadiusServerOpts) ([]GraphObjectWithPaths, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []GraphObjectWithPaths + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/usergroups/{group_id}/radiusservers" + localVarPath = strings.Replace(localVarPath, "{"+"group_id"+"}", fmt.Sprintf("%v", groupId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { + localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Skip.IsSet() { + localVarQueryParams.Add("skip", parameterToString(localVarOptionals.Skip.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Filter.IsSet() { + localVarQueryParams.Add("filter", parameterToString(localVarOptionals.Filter.Value(), "csv")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v []GraphObjectWithPaths + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +GraphApiService List the Systems bound to a User Group +This endpoint will return all Systems bound to a User Group, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this User Group to the corresponding System; this array represents all grouping and/or associations that would have to be removed to deprovision the System from this User Group. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/usergroups/{GroupID}/systems \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param groupId ObjectID of the User Group. + * @param optional nil or *GraphApiGraphUserGroupTraverseSystemOpts - Optional Parameters: + * @param "Limit" (optional.Int32) - The number of records to return at once. Limited to 100. + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. + * @param "Skip" (optional.Int32) - The offset into the records to return. + * @param "Filter" (optional.Interface of []string) - A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` +@return []GraphObjectWithPaths +*/ + +type GraphApiGraphUserGroupTraverseSystemOpts struct { + Limit optional.Int32 + XOrgId optional.String + Skip optional.Int32 + Filter optional.Interface +} + +func (a *GraphApiService) GraphUserGroupTraverseSystem(ctx context.Context, groupId string, localVarOptionals *GraphApiGraphUserGroupTraverseSystemOpts) ([]GraphObjectWithPaths, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []GraphObjectWithPaths + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/usergroups/{group_id}/systems" + localVarPath = strings.Replace(localVarPath, "{"+"group_id"+"}", fmt.Sprintf("%v", groupId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { + localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Skip.IsSet() { + localVarQueryParams.Add("skip", parameterToString(localVarOptionals.Skip.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Filter.IsSet() { + localVarQueryParams.Add("filter", parameterToString(localVarOptionals.Filter.Value(), "csv")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v []GraphObjectWithPaths + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +GraphApiService List the System Groups bound to User Groups +This endpoint will return all System Groups bound to a User Group, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this User Group to the corresponding System Group; this array represents all grouping and/or associations that would have to be removed to deprovision the System Group from this User Group. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/usergroups/{GroupID}/systemgroups \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param groupId ObjectID of the User Group. + * @param optional nil or *GraphApiGraphUserGroupTraverseSystemGroupOpts - Optional Parameters: + * @param "Limit" (optional.Int32) - The number of records to return at once. Limited to 100. + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. + * @param "Skip" (optional.Int32) - The offset into the records to return. + * @param "Filter" (optional.Interface of []string) - A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` +@return []GraphObjectWithPaths +*/ + +type GraphApiGraphUserGroupTraverseSystemGroupOpts struct { + Limit optional.Int32 + XOrgId optional.String + Skip optional.Int32 + Filter optional.Interface +} + +func (a *GraphApiService) GraphUserGroupTraverseSystemGroup(ctx context.Context, groupId string, localVarOptionals *GraphApiGraphUserGroupTraverseSystemGroupOpts) ([]GraphObjectWithPaths, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []GraphObjectWithPaths + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/usergroups/{group_id}/systemgroups" + localVarPath = strings.Replace(localVarPath, "{"+"group_id"+"}", fmt.Sprintf("%v", groupId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { + localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Skip.IsSet() { + localVarQueryParams.Add("skip", parameterToString(localVarOptionals.Skip.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Filter.IsSet() { + localVarQueryParams.Add("filter", parameterToString(localVarOptionals.Filter.Value(), "csv")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v []GraphObjectWithPaths + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +GraphApiService List the parent Groups of a User +This endpoint returns all the User Groups a User is a member of. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/users/{UserID}/memberof \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param userId ObjectID of the User. + * @param optional nil or *GraphApiGraphUserMemberOfOpts - Optional Parameters: + * @param "Filter" (optional.Interface of []string) - A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` + * @param "Limit" (optional.Int32) - The number of records to return at once. Limited to 100. + * @param "Skip" (optional.Int32) - The offset into the records to return. + * @param "Sort" (optional.Interface of []string) - The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. +@return []GraphObjectWithPaths +*/ + +type GraphApiGraphUserMemberOfOpts struct { + Filter optional.Interface + Limit optional.Int32 + Skip optional.Int32 + Sort optional.Interface + XOrgId optional.String +} + +func (a *GraphApiService) GraphUserMemberOf(ctx context.Context, userId string, localVarOptionals *GraphApiGraphUserMemberOfOpts) ([]GraphObjectWithPaths, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []GraphObjectWithPaths + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/users/{user_id}/memberof" + localVarPath = strings.Replace(localVarPath, "{"+"user_id"+"}", fmt.Sprintf("%v", userId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Filter.IsSet() { + localVarQueryParams.Add("filter", parameterToString(localVarOptionals.Filter.Value(), "csv")) + } + if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { + localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Skip.IsSet() { + localVarQueryParams.Add("skip", parameterToString(localVarOptionals.Skip.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Sort.IsSet() { + localVarQueryParams.Add("sort", parameterToString(localVarOptionals.Sort.Value(), "csv")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v []GraphObjectWithPaths + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +GraphApiService List the Active Directory instances bound to a User +This endpoint will return all Active Directory Instances bound to a User, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this User to the corresponding Active Directory instance; this array represents all grouping and/or associations that would have to be removed to deprovision the Active Directory instance from this User. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/users/{UserID}/activedirectories \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param userId ObjectID of the User. + * @param optional nil or *GraphApiGraphUserTraverseActiveDirectoryOpts - Optional Parameters: + * @param "Filter" (optional.Interface of []string) - A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` + * @param "Limit" (optional.Int32) - The number of records to return at once. Limited to 100. + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. + * @param "Skip" (optional.Int32) - The offset into the records to return. +@return []GraphObjectWithPaths +*/ + +type GraphApiGraphUserTraverseActiveDirectoryOpts struct { + Filter optional.Interface + Limit optional.Int32 + XOrgId optional.String + Skip optional.Int32 +} + +func (a *GraphApiService) GraphUserTraverseActiveDirectory(ctx context.Context, userId string, localVarOptionals *GraphApiGraphUserTraverseActiveDirectoryOpts) ([]GraphObjectWithPaths, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []GraphObjectWithPaths + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/users/{user_id}/activedirectories" + localVarPath = strings.Replace(localVarPath, "{"+"user_id"+"}", fmt.Sprintf("%v", userId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Filter.IsSet() { + localVarQueryParams.Add("filter", parameterToString(localVarOptionals.Filter.Value(), "csv")) + } + if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { + localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Skip.IsSet() { + localVarQueryParams.Add("skip", parameterToString(localVarOptionals.Skip.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v []GraphObjectWithPaths + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +GraphApiService List the Applications bound to a User +This endpoint will return all Applications bound to a User, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this User to the corresponding Application; this array represents all grouping and/or associations that would have to be removed to deprovision the Application from this User. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/users/{UserID}/applications \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param userId ObjectID of the User. + * @param optional nil or *GraphApiGraphUserTraverseApplicationOpts - Optional Parameters: + * @param "Limit" (optional.Int32) - The number of records to return at once. Limited to 100. + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. + * @param "Skip" (optional.Int32) - The offset into the records to return. + * @param "Filter" (optional.Interface of []string) - A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` +@return []GraphObjectWithPaths +*/ + +type GraphApiGraphUserTraverseApplicationOpts struct { + Limit optional.Int32 + XOrgId optional.String + Skip optional.Int32 + Filter optional.Interface +} + +func (a *GraphApiService) GraphUserTraverseApplication(ctx context.Context, userId string, localVarOptionals *GraphApiGraphUserTraverseApplicationOpts) ([]GraphObjectWithPaths, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []GraphObjectWithPaths + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/users/{user_id}/applications" + localVarPath = strings.Replace(localVarPath, "{"+"user_id"+"}", fmt.Sprintf("%v", userId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { + localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Skip.IsSet() { + localVarQueryParams.Add("skip", parameterToString(localVarOptionals.Skip.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Filter.IsSet() { + localVarQueryParams.Add("filter", parameterToString(localVarOptionals.Filter.Value(), "csv")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v []GraphObjectWithPaths + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +GraphApiService List the Directories bound to a User +This endpoint will return all Directories bound to a User, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this User to the corresponding Directory; this array represents all grouping and/or associations that would have to be removed to deprovision the Directory from this User. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/users/{UserID}/directories \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param userId ObjectID of the User. + * @param optional nil or *GraphApiGraphUserTraverseDirectoryOpts - Optional Parameters: + * @param "Limit" (optional.Int32) - The number of records to return at once. Limited to 100. + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. + * @param "Skip" (optional.Int32) - The offset into the records to return. + * @param "Filter" (optional.Interface of []string) - A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` +@return []GraphObjectWithPaths +*/ + +type GraphApiGraphUserTraverseDirectoryOpts struct { + Limit optional.Int32 + XOrgId optional.String + Skip optional.Int32 + Filter optional.Interface +} + +func (a *GraphApiService) GraphUserTraverseDirectory(ctx context.Context, userId string, localVarOptionals *GraphApiGraphUserTraverseDirectoryOpts) ([]GraphObjectWithPaths, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []GraphObjectWithPaths + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/users/{user_id}/directories" + localVarPath = strings.Replace(localVarPath, "{"+"user_id"+"}", fmt.Sprintf("%v", userId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { + localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Skip.IsSet() { + localVarQueryParams.Add("skip", parameterToString(localVarOptionals.Skip.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Filter.IsSet() { + localVarQueryParams.Add("filter", parameterToString(localVarOptionals.Filter.Value(), "csv")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v []GraphObjectWithPaths + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +GraphApiService List the G Suite instances bound to a User +This endpoint will return all G-Suite Instances bound to a User, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this User to the corresponding G Suite instance; this array represents all grouping and/or associations that would have to be removed to deprovision the G Suite instance from this User. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/users/{UserID}/gsuites \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param userId ObjectID of the User. + * @param optional nil or *GraphApiGraphUserTraverseGSuiteOpts - Optional Parameters: + * @param "Limit" (optional.Int32) - The number of records to return at once. Limited to 100. + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. + * @param "Skip" (optional.Int32) - The offset into the records to return. + * @param "Filter" (optional.Interface of []string) - A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` +@return []GraphObjectWithPaths +*/ + +type GraphApiGraphUserTraverseGSuiteOpts struct { + Limit optional.Int32 + XOrgId optional.String + Skip optional.Int32 + Filter optional.Interface +} + +func (a *GraphApiService) GraphUserTraverseGSuite(ctx context.Context, userId string, localVarOptionals *GraphApiGraphUserTraverseGSuiteOpts) ([]GraphObjectWithPaths, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []GraphObjectWithPaths + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/users/{user_id}/gsuites" + localVarPath = strings.Replace(localVarPath, "{"+"user_id"+"}", fmt.Sprintf("%v", userId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { + localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Skip.IsSet() { + localVarQueryParams.Add("skip", parameterToString(localVarOptionals.Skip.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Filter.IsSet() { + localVarQueryParams.Add("filter", parameterToString(localVarOptionals.Filter.Value(), "csv")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v []GraphObjectWithPaths + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +GraphApiService List the LDAP servers bound to a User +This endpoint will return all LDAP Servers bound to a User, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this User to the corresponding LDAP Server; this array represents all grouping and/or associations that would have to be removed to deprovision the LDAP Server from this User. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/users/{UserID}/ldapservers \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param userId ObjectID of the User. + * @param optional nil or *GraphApiGraphUserTraverseLdapServerOpts - Optional Parameters: + * @param "Limit" (optional.Int32) - The number of records to return at once. Limited to 100. + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. + * @param "Skip" (optional.Int32) - The offset into the records to return. + * @param "Filter" (optional.Interface of []string) - A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` +@return []GraphObjectWithPaths +*/ + +type GraphApiGraphUserTraverseLdapServerOpts struct { + Limit optional.Int32 + XOrgId optional.String + Skip optional.Int32 + Filter optional.Interface +} + +func (a *GraphApiService) GraphUserTraverseLdapServer(ctx context.Context, userId string, localVarOptionals *GraphApiGraphUserTraverseLdapServerOpts) ([]GraphObjectWithPaths, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []GraphObjectWithPaths + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/users/{user_id}/ldapservers" + localVarPath = strings.Replace(localVarPath, "{"+"user_id"+"}", fmt.Sprintf("%v", userId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { + localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Skip.IsSet() { + localVarQueryParams.Add("skip", parameterToString(localVarOptionals.Skip.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Filter.IsSet() { + localVarQueryParams.Add("filter", parameterToString(localVarOptionals.Filter.Value(), "csv")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v []GraphObjectWithPaths + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +GraphApiService List the Office 365 instances bound to a User +This endpoint will return all Office 365 Instances bound to a User, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this User to the corresponding Office 365 instance; this array represents all grouping and/or associations that would have to be removed to deprovision the Office 365 instance from this User. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/users/{UserID}/office365s \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param userId ObjectID of the User. + * @param optional nil or *GraphApiGraphUserTraverseOffice365Opts - Optional Parameters: + * @param "Limit" (optional.Int32) - The number of records to return at once. Limited to 100. + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. + * @param "Skip" (optional.Int32) - The offset into the records to return. + * @param "Filter" (optional.Interface of []string) - A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` +@return []GraphObjectWithPaths +*/ + +type GraphApiGraphUserTraverseOffice365Opts struct { + Limit optional.Int32 + XOrgId optional.String + Skip optional.Int32 + Filter optional.Interface +} + +func (a *GraphApiService) GraphUserTraverseOffice365(ctx context.Context, userId string, localVarOptionals *GraphApiGraphUserTraverseOffice365Opts) ([]GraphObjectWithPaths, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []GraphObjectWithPaths + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/users/{user_id}/office365s" + localVarPath = strings.Replace(localVarPath, "{"+"user_id"+"}", fmt.Sprintf("%v", userId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { + localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Skip.IsSet() { + localVarQueryParams.Add("skip", parameterToString(localVarOptionals.Skip.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Filter.IsSet() { + localVarQueryParams.Add("filter", parameterToString(localVarOptionals.Filter.Value(), "csv")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v []GraphObjectWithPaths + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +GraphApiService List the RADIUS Servers bound to a User +This endpoint will return all RADIUS Servers bound to a User, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this User to the corresponding RADIUS Server; this array represents all grouping and/or associations that would have to be removed to deprovision the RADIUS Server from this User. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/users/{UserID}/radiusservers \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param userId ObjectID of the User. + * @param optional nil or *GraphApiGraphUserTraverseRadiusServerOpts - Optional Parameters: + * @param "Limit" (optional.Int32) - The number of records to return at once. Limited to 100. + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. + * @param "Skip" (optional.Int32) - The offset into the records to return. + * @param "Filter" (optional.Interface of []string) - A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` +@return []GraphObjectWithPaths +*/ + +type GraphApiGraphUserTraverseRadiusServerOpts struct { + Limit optional.Int32 + XOrgId optional.String + Skip optional.Int32 + Filter optional.Interface +} + +func (a *GraphApiService) GraphUserTraverseRadiusServer(ctx context.Context, userId string, localVarOptionals *GraphApiGraphUserTraverseRadiusServerOpts) ([]GraphObjectWithPaths, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []GraphObjectWithPaths + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/users/{user_id}/radiusservers" + localVarPath = strings.Replace(localVarPath, "{"+"user_id"+"}", fmt.Sprintf("%v", userId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { + localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Skip.IsSet() { + localVarQueryParams.Add("skip", parameterToString(localVarOptionals.Skip.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Filter.IsSet() { + localVarQueryParams.Add("filter", parameterToString(localVarOptionals.Filter.Value(), "csv")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v []GraphObjectWithPaths + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +GraphApiService List the Systems bound to a User +This endpoint will return all Systems bound to a User, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this User to the corresponding System; this array represents all grouping and/or associations that would have to be removed to deprovision the System from this User. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/users/{UserID}/systems\\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param userId ObjectID of the User. + * @param optional nil or *GraphApiGraphUserTraverseSystemOpts - Optional Parameters: + * @param "Limit" (optional.Int32) - The number of records to return at once. Limited to 100. + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. + * @param "Skip" (optional.Int32) - The offset into the records to return. + * @param "Filter" (optional.Interface of []string) - A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` +@return []GraphObjectWithPaths +*/ + +type GraphApiGraphUserTraverseSystemOpts struct { + Limit optional.Int32 + XOrgId optional.String + Skip optional.Int32 + Filter optional.Interface +} + +func (a *GraphApiService) GraphUserTraverseSystem(ctx context.Context, userId string, localVarOptionals *GraphApiGraphUserTraverseSystemOpts) ([]GraphObjectWithPaths, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []GraphObjectWithPaths + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/users/{user_id}/systems" + localVarPath = strings.Replace(localVarPath, "{"+"user_id"+"}", fmt.Sprintf("%v", userId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { + localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Skip.IsSet() { + localVarQueryParams.Add("skip", parameterToString(localVarOptionals.Skip.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Filter.IsSet() { + localVarQueryParams.Add("filter", parameterToString(localVarOptionals.Filter.Value(), "csv")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v []GraphObjectWithPaths + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +GraphApiService List the System Groups bound to a User +This endpoint will return all System Groups bound to a User, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this User to the corresponding System Group; this array represents all grouping and/or associations that would have to be removed to deprovision the System Group from this User. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/users/{UserID}/systemgroups\\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param userId ObjectID of the User. + * @param optional nil or *GraphApiGraphUserTraverseSystemGroupOpts - Optional Parameters: + * @param "Limit" (optional.Int32) - The number of records to return at once. Limited to 100. + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. + * @param "Skip" (optional.Int32) - The offset into the records to return. + * @param "Filter" (optional.Interface of []string) - A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` +@return []GraphObjectWithPaths +*/ + +type GraphApiGraphUserTraverseSystemGroupOpts struct { + Limit optional.Int32 + XOrgId optional.String + Skip optional.Int32 + Filter optional.Interface +} + +func (a *GraphApiService) GraphUserTraverseSystemGroup(ctx context.Context, userId string, localVarOptionals *GraphApiGraphUserTraverseSystemGroupOpts) ([]GraphObjectWithPaths, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []GraphObjectWithPaths + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/users/{user_id}/systemgroups" + localVarPath = strings.Replace(localVarPath, "{"+"user_id"+"}", fmt.Sprintf("%v", userId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { + localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Skip.IsSet() { + localVarQueryParams.Add("skip", parameterToString(localVarOptionals.Skip.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Filter.IsSet() { + localVarQueryParams.Add("filter", parameterToString(localVarOptionals.Filter.Value(), "csv")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v []GraphObjectWithPaths + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +GraphApiService List the policy statuses for a system +This endpoint returns the policy results for a particular system. ##### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/systems/{System_ID}/policystatuses \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param systemId ObjectID of the System. + * @param optional nil or *GraphApiPolicystatusesSystemsListOpts - Optional Parameters: + * @param "Fields" (optional.Interface of []string) - The comma separated fields included in the returned records. If omitted, the default list of fields will be returned. + * @param "Filter" (optional.Interface of []string) - A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` + * @param "Limit" (optional.Int32) - The number of records to return at once. Limited to 100. + * @param "Skip" (optional.Int32) - The offset into the records to return. + * @param "Sort" (optional.Interface of []string) - The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. +@return []PolicyResult +*/ + +type GraphApiPolicystatusesSystemsListOpts struct { + Fields optional.Interface + Filter optional.Interface + Limit optional.Int32 + Skip optional.Int32 + Sort optional.Interface + XOrgId optional.String +} + +func (a *GraphApiService) PolicystatusesSystemsList(ctx context.Context, systemId string, localVarOptionals *GraphApiPolicystatusesSystemsListOpts) ([]PolicyResult, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []PolicyResult + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/systems/{system_id}/policystatuses" + localVarPath = strings.Replace(localVarPath, "{"+"system_id"+"}", fmt.Sprintf("%v", systemId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Fields.IsSet() { + localVarQueryParams.Add("fields", parameterToString(localVarOptionals.Fields.Value(), "csv")) + } + if localVarOptionals != nil && localVarOptionals.Filter.IsSet() { + localVarQueryParams.Add("filter", parameterToString(localVarOptionals.Filter.Value(), "csv")) + } + if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { + localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Skip.IsSet() { + localVarQueryParams.Add("skip", parameterToString(localVarOptionals.Skip.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Sort.IsSet() { + localVarQueryParams.Add("sort", parameterToString(localVarOptionals.Sort.Value(), "csv")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v []PolicyResult + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} diff --git a/jcapiv2/api_groups.go b/jcapiv2/api_groups.go new file mode 100644 index 0000000..44af6e6 --- /dev/null +++ b/jcapiv2/api_groups.go @@ -0,0 +1,173 @@ + +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +import ( + "context" + "io/ioutil" + "net/http" + "net/url" + "strings" + "github.com/antihax/optional" +) + +// Linger please +var ( + _ context.Context +) + +type GroupsApiService service +/* +GroupsApiService List All Groups +This endpoint returns all Groups that exist in your organization. #### Available filter fields: - `name` - `disabled` - `type` #### Sample Request ``` curl -X GET \\ https://console.jumpcloud.com/api/v2/groups \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param optional nil or *GroupsApiGroupsListOpts - Optional Parameters: + * @param "Fields" (optional.Interface of []string) - The comma separated fields included in the returned records. If omitted, the default list of fields will be returned. + * @param "Filter" (optional.Interface of []string) - A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` + * @param "Limit" (optional.Int32) - The number of records to return at once. Limited to 100. + * @param "Skip" (optional.Int32) - The offset into the records to return. + * @param "Sort" (optional.Interface of []string) - The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. + * @param "XUnfilteredTotalCount" (optional.Int32) - If provided in the request with any non-empty value, this header will be returned on the response populated with the total count of objects without filters taken into account +@return []Group +*/ + +type GroupsApiGroupsListOpts struct { + Fields optional.Interface + Filter optional.Interface + Limit optional.Int32 + Skip optional.Int32 + Sort optional.Interface + XOrgId optional.String + XUnfilteredTotalCount optional.Int32 +} + +func (a *GroupsApiService) GroupsList(ctx context.Context, localVarOptionals *GroupsApiGroupsListOpts) ([]Group, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []Group + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/groups" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Fields.IsSet() { + localVarQueryParams.Add("fields", parameterToString(localVarOptionals.Fields.Value(), "csv")) + } + if localVarOptionals != nil && localVarOptionals.Filter.IsSet() { + localVarQueryParams.Add("filter", parameterToString(localVarOptionals.Filter.Value(), "csv")) + } + if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { + localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Skip.IsSet() { + localVarQueryParams.Add("skip", parameterToString(localVarOptionals.Skip.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Sort.IsSet() { + localVarQueryParams.Add("sort", parameterToString(localVarOptionals.Sort.Value(), "csv")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if localVarOptionals != nil && localVarOptionals.XUnfilteredTotalCount.IsSet() { + localVarHeaderParams["x-unfiltered-total-count"] = parameterToString(localVarOptionals.XUnfilteredTotalCount.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v []Group + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 0 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} diff --git a/jcapiv2/api_image.go b/jcapiv2/api_image.go new file mode 100644 index 0000000..4d83045 --- /dev/null +++ b/jcapiv2/api_image.go @@ -0,0 +1,179 @@ + +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +import ( + "context" + "io/ioutil" + "net/http" + "net/url" + "strings" + "fmt" + "github.com/antihax/optional" +) + +// Linger please +var ( + _ context.Context +) + +type ImageApiService service +/* +ImageApiService Delete application image +Deletes the specified image from an application + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param applicationId + * @param optional nil or *ImageApiApplicationsDeleteLogoOpts - Optional Parameters: + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. + +*/ + +type ImageApiApplicationsDeleteLogoOpts struct { + XOrgId optional.String +} + +func (a *ImageApiService) ApplicationsDeleteLogo(ctx context.Context, applicationId string, localVarOptionals *ImageApiApplicationsDeleteLogoOpts) (*http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Delete") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/applications/{application_id}/logo" + localVarPath = strings.Replace(localVarPath, "{"+"application_id"+"}", fmt.Sprintf("%v", applicationId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarHttpResponse, err + } + + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 400 { + var v ErrorDetails + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarHttpResponse, newErr + } + newErr.model = v + return localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 401 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarHttpResponse, newErr + } + newErr.model = v + return localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 403 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarHttpResponse, newErr + } + newErr.model = v + return localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 404 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarHttpResponse, newErr + } + newErr.model = v + return localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 409 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarHttpResponse, newErr + } + newErr.model = v + return localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 500 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarHttpResponse, newErr + } + newErr.model = v + return localVarHttpResponse, newErr + } + return localVarHttpResponse, newErr + } + + return localVarHttpResponse, nil +} diff --git a/jcapiv2/api_ip_lists.go b/jcapiv2/api_ip_lists.go new file mode 100644 index 0000000..2a0c8fd --- /dev/null +++ b/jcapiv2/api_ip_lists.go @@ -0,0 +1,1081 @@ + +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +import ( + "context" + "io/ioutil" + "net/http" + "net/url" + "strings" + "fmt" + "github.com/antihax/optional" +) + +// Linger please +var ( + _ context.Context +) + +type IPListsApiService service +/* +IPListsApiService Delete an IP list +Delete a specific IP list. #### Sample Request ``` curl -X DELETE https://console.jumpcloud.com/api/v2/iplists/{id} \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param id + * @param optional nil or *IPListsApiIplistsDeleteOpts - Optional Parameters: + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. +@return IpList +*/ + +type IPListsApiIplistsDeleteOpts struct { + XOrgId optional.String +} + +func (a *IPListsApiService) IplistsDelete(ctx context.Context, id string, localVarOptionals *IPListsApiIplistsDeleteOpts) (IpList, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Delete") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue IpList + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/iplists/{id}" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v IpList + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 400 { + var v ErrorDetails + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 401 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 403 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 404 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 409 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 500 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +IPListsApiService Get an IP list +Return a specific IP list. #### Sample Request ``` curl https://console.jumpcloud.com/api/v2/iplists/{id} \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param id + * @param optional nil or *IPListsApiIplistsGetOpts - Optional Parameters: + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. +@return IpList +*/ + +type IPListsApiIplistsGetOpts struct { + XOrgId optional.String +} + +func (a *IPListsApiService) IplistsGet(ctx context.Context, id string, localVarOptionals *IPListsApiIplistsGetOpts) (IpList, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue IpList + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/iplists/{id}" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v IpList + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 400 { + var v ErrorDetails + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 401 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 403 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 404 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 409 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 500 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +IPListsApiService List IP Lists +Retrieve all IP lists. #### Sample Request ``` curl https://console.jumpcloud.com/api/v2/iplists \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param optional nil or *IPListsApiIplistsListOpts - Optional Parameters: + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. + * @param "XTotalCount" (optional.Int32) - + * @param "Limit" (optional.Int32) - The number of records to return at once. Limited to 100. + * @param "Skip" (optional.Int32) - The offset into the records to return. + * @param "Filter" (optional.Interface of []string) - A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` + * @param "Sort" (optional.Interface of []string) - The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. +@return []IpList +*/ + +type IPListsApiIplistsListOpts struct { + XOrgId optional.String + XTotalCount optional.Int32 + Limit optional.Int32 + Skip optional.Int32 + Filter optional.Interface + Sort optional.Interface +} + +func (a *IPListsApiService) IplistsList(ctx context.Context, localVarOptionals *IPListsApiIplistsListOpts) ([]IpList, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []IpList + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/iplists" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { + localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Skip.IsSet() { + localVarQueryParams.Add("skip", parameterToString(localVarOptionals.Skip.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Filter.IsSet() { + localVarQueryParams.Add("filter", parameterToString(localVarOptionals.Filter.Value(), "csv")) + } + if localVarOptionals != nil && localVarOptionals.Sort.IsSet() { + localVarQueryParams.Add("sort", parameterToString(localVarOptionals.Sort.Value(), "csv")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if localVarOptionals != nil && localVarOptionals.XTotalCount.IsSet() { + localVarHeaderParams["x-total-count"] = parameterToString(localVarOptionals.XTotalCount.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v []IpList + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 400 { + var v ErrorDetails + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 401 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 403 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 404 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 409 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 500 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +IPListsApiService Update an IP list +Update a specific IP list. #### Sample Request ``` curl -X PATCH https://console.jumpcloud.com/api/v2/iplists/{id} \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{\"name\": \"New IP List Name\"}' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param id + * @param optional nil or *IPListsApiIplistsPatchOpts - Optional Parameters: + * @param "Body" (optional.Interface of IpListRequest) - + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. +@return IpList +*/ + +type IPListsApiIplistsPatchOpts struct { + Body optional.Interface + XOrgId optional.String +} + +func (a *IPListsApiService) IplistsPatch(ctx context.Context, id string, localVarOptionals *IPListsApiIplistsPatchOpts) (IpList, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Patch") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue IpList + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/iplists/{id}" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + // body params + if localVarOptionals != nil && localVarOptionals.Body.IsSet() { + + localVarOptionalBody:= localVarOptionals.Body.Value() + localVarPostBody = &localVarOptionalBody + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v IpList + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 400 { + var v ErrorDetails + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 401 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 403 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 404 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 409 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 500 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +IPListsApiService Create IP List +Create an IP list. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/iplists \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"name\": \"Sample IP List\", \"ips\": [ \"192.168.10.12\", \"192.168.10.20 - 192.168.10.30\", \"123.225.10.0/32\" ] }' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param optional nil or *IPListsApiIplistsPostOpts - Optional Parameters: + * @param "Body" (optional.Interface of IpListRequest) - + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. +@return IpList +*/ + +type IPListsApiIplistsPostOpts struct { + Body optional.Interface + XOrgId optional.String +} + +func (a *IPListsApiService) IplistsPost(ctx context.Context, localVarOptionals *IPListsApiIplistsPostOpts) (IpList, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Post") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue IpList + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/iplists" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + // body params + if localVarOptionals != nil && localVarOptionals.Body.IsSet() { + + localVarOptionalBody:= localVarOptionals.Body.Value() + localVarPostBody = &localVarOptionalBody + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 201 { + var v IpList + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 400 { + var v ErrorDetails + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 401 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 403 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 404 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 409 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 500 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +IPListsApiService Replace an IP list +Replace a specific IP list. #### Sample Request ``` curl -X PUT https://console.jumpcloud.com/api/v2/iplists/{id} \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"name\": \"Sample IP List\", \"ips\": [ \"192.168.10.10\" ] }' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param id + * @param optional nil or *IPListsApiIplistsPutOpts - Optional Parameters: + * @param "Body" (optional.Interface of IpListRequest) - + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. +@return IpList +*/ + +type IPListsApiIplistsPutOpts struct { + Body optional.Interface + XOrgId optional.String +} + +func (a *IPListsApiService) IplistsPut(ctx context.Context, id string, localVarOptionals *IPListsApiIplistsPutOpts) (IpList, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Put") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue IpList + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/iplists/{id}" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + // body params + if localVarOptionals != nil && localVarOptionals.Body.IsSet() { + + localVarOptionalBody:= localVarOptionals.Body.Value() + localVarPostBody = &localVarOptionalBody + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v IpList + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 400 { + var v ErrorDetails + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 401 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 403 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 404 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 409 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 500 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} diff --git a/jcapiv2/api_ldap_servers.go b/jcapiv2/api_ldap_servers.go new file mode 100644 index 0000000..a671ab0 --- /dev/null +++ b/jcapiv2/api_ldap_servers.go @@ -0,0 +1,858 @@ + +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +import ( + "context" + "io/ioutil" + "net/http" + "net/url" + "strings" + "fmt" + "github.com/antihax/optional" +) + +// Linger please +var ( + _ context.Context +) + +type LDAPServersApiService service +/* +LDAPServersApiService List the associations of a LDAP Server +This endpoint returns the _direct_ associations of this LDAP Server. A direct association can be a non-homogeneous relationship between 2 different objects, for example LDAP and Users. #### Sample Request ``` curl -X GET 'https://console.jumpcloud.com/api/v2/ldapservers/{LDAP_ID}/associations?targets=user_group \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param ldapserverId ObjectID of the LDAP Server. + * @param targets Targets which a \"ldap_server\" can be associated to. + * @param optional nil or *LDAPServersApiGraphLdapServerAssociationsListOpts - Optional Parameters: + * @param "Limit" (optional.Int32) - The number of records to return at once. Limited to 100. + * @param "Skip" (optional.Int32) - The offset into the records to return. + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. +@return []GraphConnection +*/ + +type LDAPServersApiGraphLdapServerAssociationsListOpts struct { + Limit optional.Int32 + Skip optional.Int32 + XOrgId optional.String +} + +func (a *LDAPServersApiService) GraphLdapServerAssociationsList(ctx context.Context, ldapserverId string, targets []string, localVarOptionals *LDAPServersApiGraphLdapServerAssociationsListOpts) ([]GraphConnection, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []GraphConnection + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/ldapservers/{ldapserver_id}/associations" + localVarPath = strings.Replace(localVarPath, "{"+"ldapserver_id"+"}", fmt.Sprintf("%v", ldapserverId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + localVarQueryParams.Add("targets", parameterToString(targets, "csv")) + if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { + localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Skip.IsSet() { + localVarQueryParams.Add("skip", parameterToString(localVarOptionals.Skip.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v []GraphConnection + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +LDAPServersApiService Manage the associations of a LDAP Server +This endpoint allows you to manage the _direct_ associations of a LDAP Server. A direct association can be a non-homogeneous relationship between 2 different objects, for example LDAP and Users. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/ldapservers/{LDAP_ID}/associations \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"op\": \"add\", \"type\": \"user\", \"id\": \"{User_ID}\" }' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param ldapserverId ObjectID of the LDAP Server. + * @param optional nil or *LDAPServersApiGraphLdapServerAssociationsPostOpts - Optional Parameters: + * @param "Body" (optional.Interface of GraphOperationLdapServer) - + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. + +*/ + +type LDAPServersApiGraphLdapServerAssociationsPostOpts struct { + Body optional.Interface + XOrgId optional.String +} + +func (a *LDAPServersApiService) GraphLdapServerAssociationsPost(ctx context.Context, ldapserverId string, localVarOptionals *LDAPServersApiGraphLdapServerAssociationsPostOpts) (*http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Post") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/ldapservers/{ldapserver_id}/associations" + localVarPath = strings.Replace(localVarPath, "{"+"ldapserver_id"+"}", fmt.Sprintf("%v", ldapserverId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + // body params + if localVarOptionals != nil && localVarOptionals.Body.IsSet() { + + localVarOptionalBody:= localVarOptionals.Body.Value() + localVarPostBody = &localVarOptionalBody + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarHttpResponse, err + } + + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + return localVarHttpResponse, newErr + } + + return localVarHttpResponse, nil +} +/* +LDAPServersApiService List the Users bound to a LDAP Server +This endpoint will return all Users bound to an LDAP Server, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this LDAP server instance to the corresponding User; this array represents all grouping and/or associations that would have to be removed to deprovision the User from this LDAP server instance. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/ldapservers/{LDAP_ID}/users \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param ldapserverId ObjectID of the LDAP Server. + * @param optional nil or *LDAPServersApiGraphLdapServerTraverseUserOpts - Optional Parameters: + * @param "Limit" (optional.Int32) - The number of records to return at once. Limited to 100. + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. + * @param "Skip" (optional.Int32) - The offset into the records to return. + * @param "Filter" (optional.Interface of []string) - A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` +@return []GraphObjectWithPaths +*/ + +type LDAPServersApiGraphLdapServerTraverseUserOpts struct { + Limit optional.Int32 + XOrgId optional.String + Skip optional.Int32 + Filter optional.Interface +} + +func (a *LDAPServersApiService) GraphLdapServerTraverseUser(ctx context.Context, ldapserverId string, localVarOptionals *LDAPServersApiGraphLdapServerTraverseUserOpts) ([]GraphObjectWithPaths, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []GraphObjectWithPaths + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/ldapservers/{ldapserver_id}/users" + localVarPath = strings.Replace(localVarPath, "{"+"ldapserver_id"+"}", fmt.Sprintf("%v", ldapserverId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { + localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Skip.IsSet() { + localVarQueryParams.Add("skip", parameterToString(localVarOptionals.Skip.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Filter.IsSet() { + localVarQueryParams.Add("filter", parameterToString(localVarOptionals.Filter.Value(), "csv")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v []GraphObjectWithPaths + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +LDAPServersApiService List the User Groups bound to a LDAP Server +This endpoint will return all Users Groups bound to a LDAP Server, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the group's type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this LDAP server instance to the corresponding User Group; this array represents all grouping and/or associations that would have to be removed to deprovision the User Group from this LDAP server instance. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/ldapservers/{LDAP_ID}/usergroups \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param ldapserverId ObjectID of the LDAP Server. + * @param optional nil or *LDAPServersApiGraphLdapServerTraverseUserGroupOpts - Optional Parameters: + * @param "Limit" (optional.Int32) - The number of records to return at once. Limited to 100. + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. + * @param "Skip" (optional.Int32) - The offset into the records to return. + * @param "Filter" (optional.Interface of []string) - A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` +@return []GraphObjectWithPaths +*/ + +type LDAPServersApiGraphLdapServerTraverseUserGroupOpts struct { + Limit optional.Int32 + XOrgId optional.String + Skip optional.Int32 + Filter optional.Interface +} + +func (a *LDAPServersApiService) GraphLdapServerTraverseUserGroup(ctx context.Context, ldapserverId string, localVarOptionals *LDAPServersApiGraphLdapServerTraverseUserGroupOpts) ([]GraphObjectWithPaths, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []GraphObjectWithPaths + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/ldapservers/{ldapserver_id}/usergroups" + localVarPath = strings.Replace(localVarPath, "{"+"ldapserver_id"+"}", fmt.Sprintf("%v", ldapserverId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { + localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Skip.IsSet() { + localVarQueryParams.Add("skip", parameterToString(localVarOptionals.Skip.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Filter.IsSet() { + localVarQueryParams.Add("filter", parameterToString(localVarOptionals.Filter.Value(), "csv")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v []GraphObjectWithPaths + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +LDAPServersApiService Get LDAP Server +This endpoint returns a specific LDAP server. ##### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/ldapservers/{LDAP_ID} \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param id Unique identifier of the LDAP server. + * @param optional nil or *LDAPServersApiLdapserversGetOpts - Optional Parameters: + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. +@return LdapServerOutput +*/ + +type LDAPServersApiLdapserversGetOpts struct { + XOrgId optional.String +} + +func (a *LDAPServersApiService) LdapserversGet(ctx context.Context, id string, localVarOptionals *LDAPServersApiLdapserversGetOpts) (LdapServerOutput, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue LdapServerOutput + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/ldapservers/{id}" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v LdapServerOutput + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +LDAPServersApiService List LDAP Servers +This endpoint returns the object IDs of your LDAP servers. ##### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/ldapservers/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param optional nil or *LDAPServersApiLdapserversListOpts - Optional Parameters: + * @param "Fields" (optional.Interface of []string) - The comma separated fields included in the returned records. If omitted, the default list of fields will be returned. + * @param "Filter" (optional.Interface of []string) - A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` + * @param "Limit" (optional.Int32) - The number of records to return at once. Limited to 100. + * @param "Skip" (optional.Int32) - The offset into the records to return. + * @param "Sort" (optional.Interface of []string) - The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. +@return []LdapServerOutput +*/ + +type LDAPServersApiLdapserversListOpts struct { + Fields optional.Interface + Filter optional.Interface + Limit optional.Int32 + Skip optional.Int32 + Sort optional.Interface + XOrgId optional.String +} + +func (a *LDAPServersApiService) LdapserversList(ctx context.Context, localVarOptionals *LDAPServersApiLdapserversListOpts) ([]LdapServerOutput, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []LdapServerOutput + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/ldapservers" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Fields.IsSet() { + localVarQueryParams.Add("fields", parameterToString(localVarOptionals.Fields.Value(), "csv")) + } + if localVarOptionals != nil && localVarOptionals.Filter.IsSet() { + localVarQueryParams.Add("filter", parameterToString(localVarOptionals.Filter.Value(), "csv")) + } + if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { + localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Skip.IsSet() { + localVarQueryParams.Add("skip", parameterToString(localVarOptionals.Skip.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Sort.IsSet() { + localVarQueryParams.Add("sort", parameterToString(localVarOptionals.Sort.Value(), "csv")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v []LdapServerOutput + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +LDAPServersApiService Update existing LDAP server +This endpoint allows updating some attributes of an LDAP server. Sample Request ``` curl -X PATCH https://console.jumpcloud.com/api/v2/ldapservers/{LDAP_ID} \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"userLockoutAction\": \"remove\", \"userPasswordExpirationAction\": \"disable\" }' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param id Unique identifier of the LDAP server. + * @param optional nil or *LDAPServersApiLdapserversPatchOpts - Optional Parameters: + * @param "Body" (optional.Interface of LdapserversIdBody) - + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. +@return InlineResponse20010 +*/ + +type LDAPServersApiLdapserversPatchOpts struct { + Body optional.Interface + XOrgId optional.String +} + +func (a *LDAPServersApiService) LdapserversPatch(ctx context.Context, id string, localVarOptionals *LDAPServersApiLdapserversPatchOpts) (InlineResponse20010, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Patch") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue InlineResponse20010 + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/ldapservers/{id}" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + // body params + if localVarOptionals != nil && localVarOptionals.Body.IsSet() { + + localVarOptionalBody:= localVarOptionals.Body.Value() + localVarPostBody = &localVarOptionalBody + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v InlineResponse20010 + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 400 { + var v InlineResponse400 + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} diff --git a/jcapiv2/api_logos.go b/jcapiv2/api_logos.go new file mode 100644 index 0000000..a72c6db --- /dev/null +++ b/jcapiv2/api_logos.go @@ -0,0 +1,132 @@ + +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +import ( + "context" + "io/ioutil" + "net/http" + "net/url" + "strings" + "fmt" +) + +// Linger please +var ( + _ context.Context +) + +type LogosApiService service +/* +LogosApiService Get the logo associated with the specified id +Return the logo image associated with the specified id + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param id +@return *os.File +*/ +func (a *LogosApiService) LogosGet(ctx context.Context, id string) (*os.File, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue *os.File + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/logos/{id}" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"image/gif", "image/jpeg", "image/png"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v *os.File + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 404 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 500 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} diff --git a/jcapiv2/api_managed_service_provider.go b/jcapiv2/api_managed_service_provider.go new file mode 100644 index 0000000..557061d --- /dev/null +++ b/jcapiv2/api_managed_service_provider.go @@ -0,0 +1,1674 @@ + +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +import ( + "context" + "io/ioutil" + "net/http" + "net/url" + "strings" + "fmt" + "github.com/antihax/optional" +) + +// Linger please +var ( + _ context.Context +) + +type ManagedServiceProviderApiService service +/* +ManagedServiceProviderApiService Allow Adminstrator access to an Organization. +This endpoint allows you to grant Administrator access to an Organization. + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param id + * @param optional nil or *ManagedServiceProviderApiAdministratorOrganizationsCreateByAdministratorOpts - Optional Parameters: + * @param "Body" (optional.Interface of AdministratorOrganizationLinkReq) - +@return AdministratorOrganizationLink +*/ + +type ManagedServiceProviderApiAdministratorOrganizationsCreateByAdministratorOpts struct { + Body optional.Interface +} + +func (a *ManagedServiceProviderApiService) AdministratorOrganizationsCreateByAdministrator(ctx context.Context, id string, localVarOptionals *ManagedServiceProviderApiAdministratorOrganizationsCreateByAdministratorOpts) (AdministratorOrganizationLink, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Post") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue AdministratorOrganizationLink + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/administrators/{id}/organizationlinks" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + // body params + if localVarOptionals != nil && localVarOptionals.Body.IsSet() { + + localVarOptionalBody:= localVarOptionals.Body.Value() + localVarPostBody = &localVarOptionalBody + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 201 { + var v AdministratorOrganizationLink + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 400 { + var v ErrorDetails + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 401 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 403 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 404 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 500 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +ManagedServiceProviderApiService List the association links between an Administrator and Organizations. +This endpoint returns the association links between an Administrator and Organizations. + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param id + * @param optional nil or *ManagedServiceProviderApiAdministratorOrganizationsListByAdministratorOpts - Optional Parameters: + * @param "Limit" (optional.Int32) - The number of records to return at once. Limited to 100. + * @param "Skip" (optional.Int32) - The offset into the records to return. +@return []AdministratorOrganizationLink +*/ + +type ManagedServiceProviderApiAdministratorOrganizationsListByAdministratorOpts struct { + Limit optional.Int32 + Skip optional.Int32 +} + +func (a *ManagedServiceProviderApiService) AdministratorOrganizationsListByAdministrator(ctx context.Context, id string, localVarOptionals *ManagedServiceProviderApiAdministratorOrganizationsListByAdministratorOpts) ([]AdministratorOrganizationLink, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []AdministratorOrganizationLink + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/administrators/{id}/organizationlinks" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { + localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Skip.IsSet() { + localVarQueryParams.Add("skip", parameterToString(localVarOptionals.Skip.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v []AdministratorOrganizationLink + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 400 { + var v ErrorDetails + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 401 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 403 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 404 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 500 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +ManagedServiceProviderApiService List the association links between an Organization and Administrators. +This endpoint returns the association links between an Organization and Administrators. + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param id + * @param optional nil or *ManagedServiceProviderApiAdministratorOrganizationsListByOrganizationOpts - Optional Parameters: + * @param "Limit" (optional.Int32) - The number of records to return at once. Limited to 100. + * @param "Skip" (optional.Int32) - The offset into the records to return. +@return []AdministratorOrganizationLink +*/ + +type ManagedServiceProviderApiAdministratorOrganizationsListByOrganizationOpts struct { + Limit optional.Int32 + Skip optional.Int32 +} + +func (a *ManagedServiceProviderApiService) AdministratorOrganizationsListByOrganization(ctx context.Context, id string, localVarOptionals *ManagedServiceProviderApiAdministratorOrganizationsListByOrganizationOpts) ([]AdministratorOrganizationLink, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []AdministratorOrganizationLink + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/organizations/{id}/administratorlinks" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { + localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Skip.IsSet() { + localVarQueryParams.Add("skip", parameterToString(localVarOptionals.Skip.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v []AdministratorOrganizationLink + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 400 { + var v ErrorDetails + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 401 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 403 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 404 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 500 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +ManagedServiceProviderApiService Remove association between an Administrator and an Organization. +This endpoint removes the association link between an Administrator and an Organization. + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param administratorId + * @param id + +*/ +func (a *ManagedServiceProviderApiService) AdministratorOrganizationsRemoveByAdministrator(ctx context.Context, administratorId string, id string) (*http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Delete") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/administrators/{administrator_id}/organizationlinks/{id}" + localVarPath = strings.Replace(localVarPath, "{"+"administrator_id"+"}", fmt.Sprintf("%v", administratorId), -1) + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarHttpResponse, err + } + + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 400 { + var v ErrorDetails + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarHttpResponse, newErr + } + newErr.model = v + return localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 401 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarHttpResponse, newErr + } + newErr.model = v + return localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 403 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarHttpResponse, newErr + } + newErr.model = v + return localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 404 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarHttpResponse, newErr + } + newErr.model = v + return localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 500 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarHttpResponse, newErr + } + newErr.model = v + return localVarHttpResponse, newErr + } + return localVarHttpResponse, newErr + } + + return localVarHttpResponse, nil +} +/* +ManagedServiceProviderApiService Update Provider Organization +This endpoint updates a provider's organization + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param providerId + * @param id + * @param optional nil or *ManagedServiceProviderApiProviderOrganizationsUpdateOrgOpts - Optional Parameters: + * @param "Body" (optional.Interface of Organization) - +@return Organization +*/ + +type ManagedServiceProviderApiProviderOrganizationsUpdateOrgOpts struct { + Body optional.Interface +} + +func (a *ManagedServiceProviderApiService) ProviderOrganizationsUpdateOrg(ctx context.Context, providerId string, id string, localVarOptionals *ManagedServiceProviderApiProviderOrganizationsUpdateOrgOpts) (Organization, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Put") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue Organization + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/providers/{provider_id}/organizations/{id}" + localVarPath = strings.Replace(localVarPath, "{"+"provider_id"+"}", fmt.Sprintf("%v", providerId), -1) + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + // body params + if localVarOptionals != nil && localVarOptionals.Body.IsSet() { + + localVarOptionalBody:= localVarOptionals.Body.Value() + localVarPostBody = &localVarOptionalBody + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v Organization + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +ManagedServiceProviderApiService Retrieve Provider +This endpoint returns details about a provider + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param providerId + * @param optional nil or *ManagedServiceProviderApiProvidersGetProviderOpts - Optional Parameters: + * @param "Fields" (optional.Interface of []string) - The comma separated fields included in the returned records. If omitted, the default list of fields will be returned. +@return Provider +*/ + +type ManagedServiceProviderApiProvidersGetProviderOpts struct { + Fields optional.Interface +} + +func (a *ManagedServiceProviderApiService) ProvidersGetProvider(ctx context.Context, providerId string, localVarOptionals *ManagedServiceProviderApiProvidersGetProviderOpts) (Provider, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue Provider + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/providers/{provider_id}" + localVarPath = strings.Replace(localVarPath, "{"+"provider_id"+"}", fmt.Sprintf("%v", providerId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Fields.IsSet() { + localVarQueryParams.Add("fields", parameterToString(localVarOptionals.Fields.Value(), "csv")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v Provider + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 400 { + var v ErrorDetails + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 401 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 403 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 404 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 500 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +ManagedServiceProviderApiService List Provider Administrators +This endpoint returns a list of the Administrators associated with the Provider. You must be associated with the provider to use this route. + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param providerId + * @param optional nil or *ManagedServiceProviderApiProvidersListAdministratorsOpts - Optional Parameters: + * @param "Fields" (optional.Interface of []string) - The comma separated fields included in the returned records. If omitted, the default list of fields will be returned. + * @param "Filter" (optional.Interface of []string) - A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` + * @param "Limit" (optional.Int32) - The number of records to return at once. Limited to 100. + * @param "Skip" (optional.Int32) - The offset into the records to return. + * @param "Sort" (optional.Interface of []string) - The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. +@return InlineResponse20012 +*/ + +type ManagedServiceProviderApiProvidersListAdministratorsOpts struct { + Fields optional.Interface + Filter optional.Interface + Limit optional.Int32 + Skip optional.Int32 + Sort optional.Interface +} + +func (a *ManagedServiceProviderApiService) ProvidersListAdministrators(ctx context.Context, providerId string, localVarOptionals *ManagedServiceProviderApiProvidersListAdministratorsOpts) (InlineResponse20012, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue InlineResponse20012 + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/providers/{provider_id}/administrators" + localVarPath = strings.Replace(localVarPath, "{"+"provider_id"+"}", fmt.Sprintf("%v", providerId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Fields.IsSet() { + localVarQueryParams.Add("fields", parameterToString(localVarOptionals.Fields.Value(), "csv")) + } + if localVarOptionals != nil && localVarOptionals.Filter.IsSet() { + localVarQueryParams.Add("filter", parameterToString(localVarOptionals.Filter.Value(), "csv")) + } + if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { + localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Skip.IsSet() { + localVarQueryParams.Add("skip", parameterToString(localVarOptionals.Skip.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Sort.IsSet() { + localVarQueryParams.Add("sort", parameterToString(localVarOptionals.Sort.Value(), "csv")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v InlineResponse20012 + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 401 { + var v InlineResponse400 + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +ManagedServiceProviderApiService List Provider Organizations +This endpoint returns a list of the Organizations associated with the Provider. You must be associated with the provider to use this route. + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param providerId + * @param optional nil or *ManagedServiceProviderApiProvidersListOrganizationsOpts - Optional Parameters: + * @param "Fields" (optional.Interface of []string) - The comma separated fields included in the returned records. If omitted, the default list of fields will be returned. + * @param "Filter" (optional.Interface of []string) - A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` + * @param "Limit" (optional.Int32) - The number of records to return at once. Limited to 100. + * @param "Skip" (optional.Int32) - The offset into the records to return. + * @param "Sort" (optional.Interface of []string) - The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. +@return InlineResponse20013 +*/ + +type ManagedServiceProviderApiProvidersListOrganizationsOpts struct { + Fields optional.Interface + Filter optional.Interface + Limit optional.Int32 + Skip optional.Int32 + Sort optional.Interface +} + +func (a *ManagedServiceProviderApiService) ProvidersListOrganizations(ctx context.Context, providerId string, localVarOptionals *ManagedServiceProviderApiProvidersListOrganizationsOpts) (InlineResponse20013, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue InlineResponse20013 + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/providers/{provider_id}/organizations" + localVarPath = strings.Replace(localVarPath, "{"+"provider_id"+"}", fmt.Sprintf("%v", providerId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Fields.IsSet() { + localVarQueryParams.Add("fields", parameterToString(localVarOptionals.Fields.Value(), "csv")) + } + if localVarOptionals != nil && localVarOptionals.Filter.IsSet() { + localVarQueryParams.Add("filter", parameterToString(localVarOptionals.Filter.Value(), "csv")) + } + if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { + localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Skip.IsSet() { + localVarQueryParams.Add("skip", parameterToString(localVarOptionals.Skip.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Sort.IsSet() { + localVarQueryParams.Add("sort", parameterToString(localVarOptionals.Sort.Value(), "csv")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v InlineResponse20013 + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 400 { + var v ErrorDetails + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 401 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 403 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 404 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 500 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +ManagedServiceProviderApiService Create a new Provider Administrator +This endpoint allows you to create a provider administrator. You must be associated with the provider to use this route. You must provide either `role` or `roleName`. + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param providerId + * @param optional nil or *ManagedServiceProviderApiProvidersPostAdminsOpts - Optional Parameters: + * @param "Body" (optional.Interface of ProviderAdminReq) - +@return Administrator +*/ + +type ManagedServiceProviderApiProvidersPostAdminsOpts struct { + Body optional.Interface +} + +func (a *ManagedServiceProviderApiService) ProvidersPostAdmins(ctx context.Context, providerId string, localVarOptionals *ManagedServiceProviderApiProvidersPostAdminsOpts) (Administrator, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Post") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue Administrator + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/providers/{provider_id}/administrators" + localVarPath = strings.Replace(localVarPath, "{"+"provider_id"+"}", fmt.Sprintf("%v", providerId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + // body params + if localVarOptionals != nil && localVarOptionals.Body.IsSet() { + + localVarOptionalBody:= localVarOptionals.Body.Value() + localVarPostBody = &localVarOptionalBody + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v Administrator + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 401 { + var v InlineResponse400 + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +ManagedServiceProviderApiService Download a provider's invoice. +Retrieves an invoice for this provider. You must be associated to the provider to use this endpoint. + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param providerId + * @param iD +@return *os.File +*/ +func (a *ManagedServiceProviderApiService) ProvidersRetrieveInvoice(ctx context.Context, providerId string, iD string) (*os.File, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue *os.File + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/providers/{provider_id}/invoices/{ID}" + localVarPath = strings.Replace(localVarPath, "{"+"provider_id"+"}", fmt.Sprintf("%v", providerId), -1) + localVarPath = strings.Replace(localVarPath, "{"+"ID"+"}", fmt.Sprintf("%v", iD), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/pdf"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v *os.File + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 400 { + var v ErrorDetails + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 401 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 403 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 404 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 500 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +ManagedServiceProviderApiService List a provider's invoices. +Retrieves a list of invoices for this provider. You must be associated to the provider to use this endpoint. + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param providerId + * @param optional nil or *ManagedServiceProviderApiProvidersRetrieveInvoicesOpts - Optional Parameters: + * @param "Skip" (optional.Int32) - The offset into the records to return. + * @param "Sort" (optional.Interface of []string) - The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. + * @param "Limit" (optional.Int32) - The number of records to return at once. Limited to 100. +@return ProviderInvoiceResponse +*/ + +type ManagedServiceProviderApiProvidersRetrieveInvoicesOpts struct { + Skip optional.Int32 + Sort optional.Interface + Limit optional.Int32 +} + +func (a *ManagedServiceProviderApiService) ProvidersRetrieveInvoices(ctx context.Context, providerId string, localVarOptionals *ManagedServiceProviderApiProvidersRetrieveInvoicesOpts) (ProviderInvoiceResponse, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue ProviderInvoiceResponse + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/providers/{provider_id}/invoices" + localVarPath = strings.Replace(localVarPath, "{"+"provider_id"+"}", fmt.Sprintf("%v", providerId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Skip.IsSet() { + localVarQueryParams.Add("skip", parameterToString(localVarOptionals.Skip.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Sort.IsSet() { + localVarQueryParams.Add("sort", parameterToString(localVarOptionals.Sort.Value(), "csv")) + } + if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { + localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v ProviderInvoiceResponse + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 400 { + var v ErrorDetails + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 401 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 403 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 404 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 500 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} diff --git a/jcapiv2/api_office365.go b/jcapiv2/api_office365.go new file mode 100644 index 0000000..b9090ec --- /dev/null +++ b/jcapiv2/api_office365.go @@ -0,0 +1,1287 @@ + +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +import ( + "context" + "io/ioutil" + "net/http" + "net/url" + "strings" + "fmt" + "github.com/antihax/optional" +) + +// Linger please +var ( + _ context.Context +) + +type Office365ApiService service +/* +Office365ApiService List the associations of an Office 365 instance +This endpoint returns _direct_ associations of an Office 365 instance. A direct association can be a non-homogeneous relationship between 2 different objects, for example Office 365 and Users. #### Sample Request ``` curl -X GET 'https://console.jumpcloud.com/api/v2/office365s/{OFFICE365_ID}/associations?targets=user_group' \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param office365Id ObjectID of the Office 365 instance. + * @param targets Targets which a \"office_365\" can be associated to. + * @param optional nil or *Office365ApiGraphOffice365AssociationsListOpts - Optional Parameters: + * @param "Limit" (optional.Int32) - The number of records to return at once. Limited to 100. + * @param "Skip" (optional.Int32) - The offset into the records to return. + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. +@return []GraphConnection +*/ + +type Office365ApiGraphOffice365AssociationsListOpts struct { + Limit optional.Int32 + Skip optional.Int32 + XOrgId optional.String +} + +func (a *Office365ApiService) GraphOffice365AssociationsList(ctx context.Context, office365Id string, targets []string, localVarOptionals *Office365ApiGraphOffice365AssociationsListOpts) ([]GraphConnection, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []GraphConnection + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/office365s/{office365_id}/associations" + localVarPath = strings.Replace(localVarPath, "{"+"office365_id"+"}", fmt.Sprintf("%v", office365Id), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + localVarQueryParams.Add("targets", parameterToString(targets, "csv")) + if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { + localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Skip.IsSet() { + localVarQueryParams.Add("skip", parameterToString(localVarOptionals.Skip.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v []GraphConnection + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +Office365ApiService Manage the associations of an Office 365 instance +This endpoint allows you to manage the _direct_ associations of a Office 365 instance. A direct association can be a non-homogeneous relationship between 2 different objects, for example Office 365 and Users. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/office365s/{OFFICE365_ID}/associations \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"op\": \"add\", \"type\": \"user_group\", \"id\": \"{Group_ID}\" }' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param office365Id ObjectID of the Office 365 instance. + * @param optional nil or *Office365ApiGraphOffice365AssociationsPostOpts - Optional Parameters: + * @param "Body" (optional.Interface of GraphOperationOffice365) - + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. + +*/ + +type Office365ApiGraphOffice365AssociationsPostOpts struct { + Body optional.Interface + XOrgId optional.String +} + +func (a *Office365ApiService) GraphOffice365AssociationsPost(ctx context.Context, office365Id string, localVarOptionals *Office365ApiGraphOffice365AssociationsPostOpts) (*http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Post") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/office365s/{office365_id}/associations" + localVarPath = strings.Replace(localVarPath, "{"+"office365_id"+"}", fmt.Sprintf("%v", office365Id), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + // body params + if localVarOptionals != nil && localVarOptionals.Body.IsSet() { + + localVarOptionalBody:= localVarOptionals.Body.Value() + localVarPostBody = &localVarOptionalBody + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarHttpResponse, err + } + + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + return localVarHttpResponse, newErr + } + + return localVarHttpResponse, nil +} +/* +Office365ApiService List the Users bound to an Office 365 instance +This endpoint will return all Users bound to an Office 365 instance, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this Office 365 instance to the corresponding User; this array represents all grouping and/or associations that would have to be removed to deprovision the User from this Office 365 instance. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/office365s/{OFFICE365_ID}/users \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param office365Id ObjectID of the Office 365 suite. + * @param optional nil or *Office365ApiGraphOffice365TraverseUserOpts - Optional Parameters: + * @param "Limit" (optional.Int32) - The number of records to return at once. Limited to 100. + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. + * @param "Skip" (optional.Int32) - The offset into the records to return. + * @param "Filter" (optional.Interface of []string) - A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` +@return []GraphObjectWithPaths +*/ + +type Office365ApiGraphOffice365TraverseUserOpts struct { + Limit optional.Int32 + XOrgId optional.String + Skip optional.Int32 + Filter optional.Interface +} + +func (a *Office365ApiService) GraphOffice365TraverseUser(ctx context.Context, office365Id string, localVarOptionals *Office365ApiGraphOffice365TraverseUserOpts) ([]GraphObjectWithPaths, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []GraphObjectWithPaths + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/office365s/{office365_id}/users" + localVarPath = strings.Replace(localVarPath, "{"+"office365_id"+"}", fmt.Sprintf("%v", office365Id), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { + localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Skip.IsSet() { + localVarQueryParams.Add("skip", parameterToString(localVarOptionals.Skip.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Filter.IsSet() { + localVarQueryParams.Add("filter", parameterToString(localVarOptionals.Filter.Value(), "csv")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v []GraphObjectWithPaths + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +Office365ApiService List the User Groups bound to an Office 365 instance +This endpoint will return all Users Groups bound to an Office 365 instance, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the group's type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this Office 365 instance to the corresponding User Group; this array represents all grouping and/or associations that would have to be removed to deprovision the User Group from this Office 365 instance. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/office365s/{OFFICE365_ID/usergroups \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param office365Id ObjectID of the Office 365 suite. + * @param optional nil or *Office365ApiGraphOffice365TraverseUserGroupOpts - Optional Parameters: + * @param "Limit" (optional.Int32) - The number of records to return at once. Limited to 100. + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. + * @param "Skip" (optional.Int32) - The offset into the records to return. + * @param "Filter" (optional.Interface of []string) - A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` +@return []GraphObjectWithPaths +*/ + +type Office365ApiGraphOffice365TraverseUserGroupOpts struct { + Limit optional.Int32 + XOrgId optional.String + Skip optional.Int32 + Filter optional.Interface +} + +func (a *Office365ApiService) GraphOffice365TraverseUserGroup(ctx context.Context, office365Id string, localVarOptionals *Office365ApiGraphOffice365TraverseUserGroupOpts) ([]GraphObjectWithPaths, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []GraphObjectWithPaths + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/office365s/{office365_id}/usergroups" + localVarPath = strings.Replace(localVarPath, "{"+"office365_id"+"}", fmt.Sprintf("%v", office365Id), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { + localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Skip.IsSet() { + localVarQueryParams.Add("skip", parameterToString(localVarOptionals.Skip.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Filter.IsSet() { + localVarQueryParams.Add("filter", parameterToString(localVarOptionals.Filter.Value(), "csv")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v []GraphObjectWithPaths + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +Office365ApiService Get Office 365 instance +This endpoint returns a specific Office 365 instance. ##### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/office365s/{OFFICE365_ID} \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param office365Id ObjectID of the Office 365 instance. + * @param optional nil or *Office365ApiOffice365sGetOpts - Optional Parameters: + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. +@return Office365Output +*/ + +type Office365ApiOffice365sGetOpts struct { + XOrgId optional.String +} + +func (a *Office365ApiService) Office365sGet(ctx context.Context, office365Id string, localVarOptionals *Office365ApiOffice365sGetOpts) (Office365Output, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue Office365Output + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/office365s/{office365_id}" + localVarPath = strings.Replace(localVarPath, "{"+"office365_id"+"}", fmt.Sprintf("%v", office365Id), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v Office365Output + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +Office365ApiService Get a list of users to import from an Office 365 instance +Lists Office 365 users available for import. + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param office365Id + * @param optional nil or *Office365ApiOffice365sListImportUsersOpts - Optional Parameters: + * @param "ConsistencyLevel" (optional.String) - Defines the consistency header for O365 requests. See https://docs.microsoft.com/en-us/graph/api/user-list?view=graph-rest-1.0&tabs=http#request-headers + * @param "Top" (optional.Int32) - Office 365 API maximum number of results per page. See https://docs.microsoft.com/en-us/graph/paging. + * @param "SkipToken" (optional.String) - Office 365 API token used to access the next page of results. See https://docs.microsoft.com/en-us/graph/paging. + * @param "Filter" (optional.String) - Office 365 API filter parameter. See https://docs.microsoft.com/en-us/graph/api/user-list?view=graph-rest-1.0&tabs=http#optional-query-parameters. + * @param "Search" (optional.String) - Office 365 API search parameter. See https://docs.microsoft.com/en-us/graph/api/user-list?view=graph-rest-1.0&tabs=http#optional-query-parameters. + * @param "Orderby" (optional.String) - Office 365 API orderby parameter. See https://docs.microsoft.com/en-us/graph/api/user-list?view=graph-rest-1.0&tabs=http#optional-query-parameters. + * @param "Count" (optional.Bool) - Office 365 API count parameter. See https://docs.microsoft.com/en-us/graph/api/user-list?view=graph-rest-1.0&tabs=http#optional-query-parameters. +@return InlineResponse20011 +*/ + +type Office365ApiOffice365sListImportUsersOpts struct { + ConsistencyLevel optional.String + Top optional.Int32 + SkipToken optional.String + Filter optional.String + Search optional.String + Orderby optional.String + Count optional.Bool +} + +func (a *Office365ApiService) Office365sListImportUsers(ctx context.Context, office365Id string, localVarOptionals *Office365ApiOffice365sListImportUsersOpts) (InlineResponse20011, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue InlineResponse20011 + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/office365s/{office365_id}/import/users" + localVarPath = strings.Replace(localVarPath, "{"+"office365_id"+"}", fmt.Sprintf("%v", office365Id), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Top.IsSet() { + localVarQueryParams.Add("top", parameterToString(localVarOptionals.Top.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.SkipToken.IsSet() { + localVarQueryParams.Add("skipToken", parameterToString(localVarOptionals.SkipToken.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Filter.IsSet() { + localVarQueryParams.Add("filter", parameterToString(localVarOptionals.Filter.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Search.IsSet() { + localVarQueryParams.Add("search", parameterToString(localVarOptionals.Search.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Orderby.IsSet() { + localVarQueryParams.Add("orderby", parameterToString(localVarOptionals.Orderby.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Count.IsSet() { + localVarQueryParams.Add("count", parameterToString(localVarOptionals.Count.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.ConsistencyLevel.IsSet() { + localVarHeaderParams["ConsistencyLevel"] = parameterToString(localVarOptionals.ConsistencyLevel.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v InlineResponse20011 + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +Office365ApiService Update existing Office 365 instance. +This endpoint allows updating some attributes of an Office 365 instance. ##### Sample Request ``` curl -X PATCH https://console.jumpcloud.com/api/v2/office365s/{OFFICE365_ID} \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"userLockoutAction\": \"maintain\", \"userPasswordExpirationAction\": \"suspend\" }' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param office365Id ObjectID of the Office 365 instance. + * @param optional nil or *Office365ApiOffice365sPatchOpts - Optional Parameters: + * @param "Body" (optional.Interface of Office365PatchInput) - + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. +@return Office365Output +*/ + +type Office365ApiOffice365sPatchOpts struct { + Body optional.Interface + XOrgId optional.String +} + +func (a *Office365ApiService) Office365sPatch(ctx context.Context, office365Id string, localVarOptionals *Office365ApiOffice365sPatchOpts) (Office365Output, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Patch") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue Office365Output + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/office365s/{office365_id}" + localVarPath = strings.Replace(localVarPath, "{"+"office365_id"+"}", fmt.Sprintf("%v", office365Id), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + // body params + if localVarOptionals != nil && localVarOptionals.Body.IsSet() { + + localVarOptionalBody:= localVarOptionals.Body.Value() + localVarPostBody = &localVarOptionalBody + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v Office365Output + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +Office365ApiService Deletes a Office 365 translation rule +This endpoint allows you to delete a translation rule for a specific Office 365 instance. These rules specify how JumpCloud attributes translate to [Microsoft Graph](https://developer.microsoft.com/en-us/graph) attributes. #### Sample Request ``` curl -X DELETE https://console.jumpcloud.com/api/v2/office365s/{office365_id}/translationrules/{id} \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param office365Id + * @param id + +*/ +func (a *Office365ApiService) TranslationRulesOffice365Delete(ctx context.Context, office365Id string, id string) (*http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Delete") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/office365s/{office365_id}/translationrules/{id}" + localVarPath = strings.Replace(localVarPath, "{"+"office365_id"+"}", fmt.Sprintf("%v", office365Id), -1) + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarHttpResponse, err + } + + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + return localVarHttpResponse, newErr + } + + return localVarHttpResponse, nil +} +/* +Office365ApiService Gets a specific Office 365 translation rule +This endpoint returns a specific translation rule for a specific Office 365 instance. These rules specify how JumpCloud attributes translate to [Microsoft Graph](https://developer.microsoft.com/en-us/graph) attributes. ###### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/office365s/{office365_id}/translationrules/{id} \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param office365Id + * @param id +@return Office365TranslationRule +*/ +func (a *Office365ApiService) TranslationRulesOffice365Get(ctx context.Context, office365Id string, id string) (Office365TranslationRule, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue Office365TranslationRule + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/office365s/{office365_id}/translationrules/{id}" + localVarPath = strings.Replace(localVarPath, "{"+"office365_id"+"}", fmt.Sprintf("%v", office365Id), -1) + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v Office365TranslationRule + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +Office365ApiService List all the Office 365 Translation Rules +This endpoint returns all translation rules for a specific Office 365 instance. These rules specify how JumpCloud attributes translate to [Microsoft Graph](https://developer.microsoft.com/en-us/graph) attributes. ##### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/office365s/{office365_id}/translationrules \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param office365Id + * @param optional nil or *Office365ApiTranslationRulesOffice365ListOpts - Optional Parameters: + * @param "Fields" (optional.Interface of []string) - The comma separated fields included in the returned records. If omitted, the default list of fields will be returned. + * @param "Filter" (optional.Interface of []string) - A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` + * @param "Limit" (optional.Int32) - The number of records to return at once. Limited to 100. + * @param "Skip" (optional.Int32) - The offset into the records to return. + * @param "Sort" (optional.Interface of []string) - The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. +@return []Office365TranslationRule +*/ + +type Office365ApiTranslationRulesOffice365ListOpts struct { + Fields optional.Interface + Filter optional.Interface + Limit optional.Int32 + Skip optional.Int32 + Sort optional.Interface +} + +func (a *Office365ApiService) TranslationRulesOffice365List(ctx context.Context, office365Id string, localVarOptionals *Office365ApiTranslationRulesOffice365ListOpts) ([]Office365TranslationRule, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []Office365TranslationRule + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/office365s/{office365_id}/translationrules" + localVarPath = strings.Replace(localVarPath, "{"+"office365_id"+"}", fmt.Sprintf("%v", office365Id), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Fields.IsSet() { + localVarQueryParams.Add("fields", parameterToString(localVarOptionals.Fields.Value(), "csv")) + } + if localVarOptionals != nil && localVarOptionals.Filter.IsSet() { + localVarQueryParams.Add("filter", parameterToString(localVarOptionals.Filter.Value(), "csv")) + } + if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { + localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Skip.IsSet() { + localVarQueryParams.Add("skip", parameterToString(localVarOptionals.Skip.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Sort.IsSet() { + localVarQueryParams.Add("sort", parameterToString(localVarOptionals.Sort.Value(), "csv")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v []Office365TranslationRule + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +Office365ApiService Create a new Office 365 Translation Rule +This endpoint allows you to create a translation rule for a specific Office 365 instance. These rules specify how JumpCloud attributes translate to [Microsoft Graph](https://developer.microsoft.com/en-us/graph) attributes. ##### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/office365s/{office365_id}/translationrules \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ {Translation Rule Parameters} }' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param office365Id + * @param optional nil or *Office365ApiTranslationRulesOffice365PostOpts - Optional Parameters: + * @param "Body" (optional.Interface of Office365TranslationRuleRequest) - +@return Office365TranslationRule +*/ + +type Office365ApiTranslationRulesOffice365PostOpts struct { + Body optional.Interface +} + +func (a *Office365ApiService) TranslationRulesOffice365Post(ctx context.Context, office365Id string, localVarOptionals *Office365ApiTranslationRulesOffice365PostOpts) (Office365TranslationRule, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Post") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue Office365TranslationRule + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/office365s/{office365_id}/translationrules" + localVarPath = strings.Replace(localVarPath, "{"+"office365_id"+"}", fmt.Sprintf("%v", office365Id), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + // body params + if localVarOptionals != nil && localVarOptionals.Body.IsSet() { + + localVarOptionalBody:= localVarOptionals.Body.Value() + localVarPostBody = &localVarOptionalBody + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 201 { + var v Office365TranslationRule + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 400 { + var v ErrorDetails + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} diff --git a/jcapiv2/api_office365_import.go b/jcapiv2/api_office365_import.go new file mode 100644 index 0000000..55fe2a1 --- /dev/null +++ b/jcapiv2/api_office365_import.go @@ -0,0 +1,166 @@ + +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +import ( + "context" + "io/ioutil" + "net/http" + "net/url" + "strings" + "fmt" + "github.com/antihax/optional" +) + +// Linger please +var ( + _ context.Context +) + +type Office365ImportApiService service +/* +Office365ImportApiService Get a list of users to import from an Office 365 instance +Lists Office 365 users available for import. + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param office365Id + * @param optional nil or *Office365ImportApiOffice365sListImportUsersOpts - Optional Parameters: + * @param "ConsistencyLevel" (optional.String) - Defines the consistency header for O365 requests. See https://docs.microsoft.com/en-us/graph/api/user-list?view=graph-rest-1.0&tabs=http#request-headers + * @param "Top" (optional.Int32) - Office 365 API maximum number of results per page. See https://docs.microsoft.com/en-us/graph/paging. + * @param "SkipToken" (optional.String) - Office 365 API token used to access the next page of results. See https://docs.microsoft.com/en-us/graph/paging. + * @param "Filter" (optional.String) - Office 365 API filter parameter. See https://docs.microsoft.com/en-us/graph/api/user-list?view=graph-rest-1.0&tabs=http#optional-query-parameters. + * @param "Search" (optional.String) - Office 365 API search parameter. See https://docs.microsoft.com/en-us/graph/api/user-list?view=graph-rest-1.0&tabs=http#optional-query-parameters. + * @param "Orderby" (optional.String) - Office 365 API orderby parameter. See https://docs.microsoft.com/en-us/graph/api/user-list?view=graph-rest-1.0&tabs=http#optional-query-parameters. + * @param "Count" (optional.Bool) - Office 365 API count parameter. See https://docs.microsoft.com/en-us/graph/api/user-list?view=graph-rest-1.0&tabs=http#optional-query-parameters. +@return InlineResponse20011 +*/ + +type Office365ImportApiOffice365sListImportUsersOpts struct { + ConsistencyLevel optional.String + Top optional.Int32 + SkipToken optional.String + Filter optional.String + Search optional.String + Orderby optional.String + Count optional.Bool +} + +func (a *Office365ImportApiService) Office365sListImportUsers(ctx context.Context, office365Id string, localVarOptionals *Office365ImportApiOffice365sListImportUsersOpts) (InlineResponse20011, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue InlineResponse20011 + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/office365s/{office365_id}/import/users" + localVarPath = strings.Replace(localVarPath, "{"+"office365_id"+"}", fmt.Sprintf("%v", office365Id), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Top.IsSet() { + localVarQueryParams.Add("top", parameterToString(localVarOptionals.Top.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.SkipToken.IsSet() { + localVarQueryParams.Add("skipToken", parameterToString(localVarOptionals.SkipToken.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Filter.IsSet() { + localVarQueryParams.Add("filter", parameterToString(localVarOptionals.Filter.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Search.IsSet() { + localVarQueryParams.Add("search", parameterToString(localVarOptionals.Search.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Orderby.IsSet() { + localVarQueryParams.Add("orderby", parameterToString(localVarOptionals.Orderby.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Count.IsSet() { + localVarQueryParams.Add("count", parameterToString(localVarOptionals.Count.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.ConsistencyLevel.IsSet() { + localVarHeaderParams["ConsistencyLevel"] = parameterToString(localVarOptionals.ConsistencyLevel.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v InlineResponse20011 + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} diff --git a/jcapiv2/api_organizations.go b/jcapiv2/api_organizations.go new file mode 100644 index 0000000..f4f2f62 --- /dev/null +++ b/jcapiv2/api_organizations.go @@ -0,0 +1,764 @@ + +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +import ( + "context" + "io/ioutil" + "net/http" + "net/url" + "strings" + "fmt" + "github.com/antihax/optional" +) + +// Linger please +var ( + _ context.Context +) + +type OrganizationsApiService service +/* +OrganizationsApiService Allow Adminstrator access to an Organization. +This endpoint allows you to grant Administrator access to an Organization. + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param id + * @param optional nil or *OrganizationsApiAdministratorOrganizationsCreateByAdministratorOpts - Optional Parameters: + * @param "Body" (optional.Interface of AdministratorOrganizationLinkReq) - +@return AdministratorOrganizationLink +*/ + +type OrganizationsApiAdministratorOrganizationsCreateByAdministratorOpts struct { + Body optional.Interface +} + +func (a *OrganizationsApiService) AdministratorOrganizationsCreateByAdministrator(ctx context.Context, id string, localVarOptionals *OrganizationsApiAdministratorOrganizationsCreateByAdministratorOpts) (AdministratorOrganizationLink, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Post") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue AdministratorOrganizationLink + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/administrators/{id}/organizationlinks" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + // body params + if localVarOptionals != nil && localVarOptionals.Body.IsSet() { + + localVarOptionalBody:= localVarOptionals.Body.Value() + localVarPostBody = &localVarOptionalBody + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 201 { + var v AdministratorOrganizationLink + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 400 { + var v ErrorDetails + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 401 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 403 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 404 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 500 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +OrganizationsApiService List the association links between an Administrator and Organizations. +This endpoint returns the association links between an Administrator and Organizations. + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param id + * @param optional nil or *OrganizationsApiAdministratorOrganizationsListByAdministratorOpts - Optional Parameters: + * @param "Limit" (optional.Int32) - The number of records to return at once. Limited to 100. + * @param "Skip" (optional.Int32) - The offset into the records to return. +@return []AdministratorOrganizationLink +*/ + +type OrganizationsApiAdministratorOrganizationsListByAdministratorOpts struct { + Limit optional.Int32 + Skip optional.Int32 +} + +func (a *OrganizationsApiService) AdministratorOrganizationsListByAdministrator(ctx context.Context, id string, localVarOptionals *OrganizationsApiAdministratorOrganizationsListByAdministratorOpts) ([]AdministratorOrganizationLink, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []AdministratorOrganizationLink + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/administrators/{id}/organizationlinks" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { + localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Skip.IsSet() { + localVarQueryParams.Add("skip", parameterToString(localVarOptionals.Skip.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v []AdministratorOrganizationLink + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 400 { + var v ErrorDetails + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 401 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 403 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 404 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 500 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +OrganizationsApiService List the association links between an Organization and Administrators. +This endpoint returns the association links between an Organization and Administrators. + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param id + * @param optional nil or *OrganizationsApiAdministratorOrganizationsListByOrganizationOpts - Optional Parameters: + * @param "Limit" (optional.Int32) - The number of records to return at once. Limited to 100. + * @param "Skip" (optional.Int32) - The offset into the records to return. +@return []AdministratorOrganizationLink +*/ + +type OrganizationsApiAdministratorOrganizationsListByOrganizationOpts struct { + Limit optional.Int32 + Skip optional.Int32 +} + +func (a *OrganizationsApiService) AdministratorOrganizationsListByOrganization(ctx context.Context, id string, localVarOptionals *OrganizationsApiAdministratorOrganizationsListByOrganizationOpts) ([]AdministratorOrganizationLink, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []AdministratorOrganizationLink + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/organizations/{id}/administratorlinks" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { + localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Skip.IsSet() { + localVarQueryParams.Add("skip", parameterToString(localVarOptionals.Skip.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v []AdministratorOrganizationLink + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 400 { + var v ErrorDetails + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 401 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 403 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 404 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 500 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +OrganizationsApiService Remove association between an Administrator and an Organization. +This endpoint removes the association link between an Administrator and an Organization. + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param administratorId + * @param id + +*/ +func (a *OrganizationsApiService) AdministratorOrganizationsRemoveByAdministrator(ctx context.Context, administratorId string, id string) (*http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Delete") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/administrators/{administrator_id}/organizationlinks/{id}" + localVarPath = strings.Replace(localVarPath, "{"+"administrator_id"+"}", fmt.Sprintf("%v", administratorId), -1) + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarHttpResponse, err + } + + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 400 { + var v ErrorDetails + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarHttpResponse, newErr + } + newErr.model = v + return localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 401 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarHttpResponse, newErr + } + newErr.model = v + return localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 403 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarHttpResponse, newErr + } + newErr.model = v + return localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 404 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarHttpResponse, newErr + } + newErr.model = v + return localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 500 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarHttpResponse, newErr + } + newErr.model = v + return localVarHttpResponse, newErr + } + return localVarHttpResponse, newErr + } + + return localVarHttpResponse, nil +} +/* +OrganizationsApiService Get all cases (Support/Feature requests) for organization +This endpoint returns the cases (Support/Feature requests) for the organization + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param optional nil or *OrganizationsApiOrganizationsListCasesOpts - Optional Parameters: + * @param "Skip" (optional.Int32) - The offset into the records to return. + * @param "Sort" (optional.Interface of []string) - The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. + * @param "Limit" (optional.Int32) - The number of records to return at once. Limited to 100. +@return OrganizationCasesResponse +*/ + +type OrganizationsApiOrganizationsListCasesOpts struct { + Skip optional.Int32 + Sort optional.Interface + Limit optional.Int32 +} + +func (a *OrganizationsApiService) OrganizationsListCases(ctx context.Context, localVarOptionals *OrganizationsApiOrganizationsListCasesOpts) (OrganizationCasesResponse, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue OrganizationCasesResponse + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/organizations/cases" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Skip.IsSet() { + localVarQueryParams.Add("skip", parameterToString(localVarOptionals.Skip.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Sort.IsSet() { + localVarQueryParams.Add("sort", parameterToString(localVarOptionals.Sort.Value(), "csv")) + } + if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { + localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v OrganizationCasesResponse + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} diff --git a/jcapiv2/api_policies.go b/jcapiv2/api_policies.go new file mode 100644 index 0000000..ab7efc2 --- /dev/null +++ b/jcapiv2/api_policies.go @@ -0,0 +1,2088 @@ + +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +import ( + "context" + "io/ioutil" + "net/http" + "net/url" + "strings" + "fmt" + "github.com/antihax/optional" +) + +// Linger please +var ( + _ context.Context +) + +type PoliciesApiService service +/* +PoliciesApiService List the associations of a Policy +This endpoint returns the _direct_ associations of a Policy. A direct association can be a non-homogeneous relationship between 2 different objects, for example Policies and Systems. #### Sample Request ``` curl -X GET 'https://console.jumpcloud.com/api/v2/policies/{Policy_ID}/associations?targets=system_group \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param policyId ObjectID of the Policy. + * @param targets Targets which a \"policy\" can be associated to. + * @param optional nil or *PoliciesApiGraphPolicyAssociationsListOpts - Optional Parameters: + * @param "Limit" (optional.Int32) - The number of records to return at once. Limited to 100. + * @param "Skip" (optional.Int32) - The offset into the records to return. + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. +@return []GraphConnection +*/ + +type PoliciesApiGraphPolicyAssociationsListOpts struct { + Limit optional.Int32 + Skip optional.Int32 + XOrgId optional.String +} + +func (a *PoliciesApiService) GraphPolicyAssociationsList(ctx context.Context, policyId string, targets []string, localVarOptionals *PoliciesApiGraphPolicyAssociationsListOpts) ([]GraphConnection, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []GraphConnection + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/policies/{policy_id}/associations" + localVarPath = strings.Replace(localVarPath, "{"+"policy_id"+"}", fmt.Sprintf("%v", policyId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + localVarQueryParams.Add("targets", parameterToString(targets, "csv")) + if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { + localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Skip.IsSet() { + localVarQueryParams.Add("skip", parameterToString(localVarOptionals.Skip.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v []GraphConnection + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +PoliciesApiService Manage the associations of a Policy +This endpoint allows you to manage the _direct_ associations of a Policy. A direct association can be a non-homogeneous relationship between 2 different objects, for example Policies and Systems. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/policies/{Policy_ID}/associations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"op\": \"add\", \"type\": \"system_group\", \"id\": \"{Group_ID}\" }' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param policyId ObjectID of the Policy. + * @param optional nil or *PoliciesApiGraphPolicyAssociationsPostOpts - Optional Parameters: + * @param "Body" (optional.Interface of GraphOperationPolicy) - + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. + +*/ + +type PoliciesApiGraphPolicyAssociationsPostOpts struct { + Body optional.Interface + XOrgId optional.String +} + +func (a *PoliciesApiService) GraphPolicyAssociationsPost(ctx context.Context, policyId string, localVarOptionals *PoliciesApiGraphPolicyAssociationsPostOpts) (*http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Post") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/policies/{policy_id}/associations" + localVarPath = strings.Replace(localVarPath, "{"+"policy_id"+"}", fmt.Sprintf("%v", policyId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + // body params + if localVarOptionals != nil && localVarOptionals.Body.IsSet() { + + localVarOptionalBody:= localVarOptionals.Body.Value() + localVarPostBody = &localVarOptionalBody + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarHttpResponse, err + } + + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + return localVarHttpResponse, newErr + } + + return localVarHttpResponse, nil +} +/* +PoliciesApiService List the parent Groups of a Policy +This endpoint returns all the Policy Groups a Policy is a member of. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/policies/{Policy_ID}/memberof \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param policyId ObjectID of the Policy. + * @param optional nil or *PoliciesApiGraphPolicyMemberOfOpts - Optional Parameters: + * @param "Filter" (optional.Interface of []string) - A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` + * @param "Limit" (optional.Int32) - The number of records to return at once. Limited to 100. + * @param "Skip" (optional.Int32) - The offset into the records to return. + * @param "Date" (optional.String) - Current date header for the System Context API + * @param "Authorization" (optional.String) - Authorization header for the System Context API + * @param "Sort" (optional.Interface of []string) - The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. +@return []GraphObjectWithPaths +*/ + +type PoliciesApiGraphPolicyMemberOfOpts struct { + Filter optional.Interface + Limit optional.Int32 + Skip optional.Int32 + Date optional.String + Authorization optional.String + Sort optional.Interface + XOrgId optional.String +} + +func (a *PoliciesApiService) GraphPolicyMemberOf(ctx context.Context, policyId string, localVarOptionals *PoliciesApiGraphPolicyMemberOfOpts) ([]GraphObjectWithPaths, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []GraphObjectWithPaths + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/policies/{policy_id}/memberof" + localVarPath = strings.Replace(localVarPath, "{"+"policy_id"+"}", fmt.Sprintf("%v", policyId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Filter.IsSet() { + localVarQueryParams.Add("filter", parameterToString(localVarOptionals.Filter.Value(), "csv")) + } + if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { + localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Skip.IsSet() { + localVarQueryParams.Add("skip", parameterToString(localVarOptionals.Skip.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Sort.IsSet() { + localVarQueryParams.Add("sort", parameterToString(localVarOptionals.Sort.Value(), "csv")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.Date.IsSet() { + localVarHeaderParams["Date"] = parameterToString(localVarOptionals.Date.Value(), "") + } + if localVarOptionals != nil && localVarOptionals.Authorization.IsSet() { + localVarHeaderParams["Authorization"] = parameterToString(localVarOptionals.Authorization.Value(), "") + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v []GraphObjectWithPaths + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +PoliciesApiService List the Systems bound to a Policy +This endpoint will return all Systems bound to a Policy, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this Policy to the corresponding System; this array represents all grouping and/or associations that would have to be removed to deprovision the System from this Policy. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/policies/{Policy_ID}/systems \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param policyId ObjectID of the Command. + * @param optional nil or *PoliciesApiGraphPolicyTraverseSystemOpts - Optional Parameters: + * @param "Limit" (optional.Int32) - The number of records to return at once. Limited to 100. + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. + * @param "Skip" (optional.Int32) - The offset into the records to return. + * @param "Filter" (optional.Interface of []string) - A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` +@return []GraphObjectWithPaths +*/ + +type PoliciesApiGraphPolicyTraverseSystemOpts struct { + Limit optional.Int32 + XOrgId optional.String + Skip optional.Int32 + Filter optional.Interface +} + +func (a *PoliciesApiService) GraphPolicyTraverseSystem(ctx context.Context, policyId string, localVarOptionals *PoliciesApiGraphPolicyTraverseSystemOpts) ([]GraphObjectWithPaths, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []GraphObjectWithPaths + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/policies/{policy_id}/systems" + localVarPath = strings.Replace(localVarPath, "{"+"policy_id"+"}", fmt.Sprintf("%v", policyId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { + localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Skip.IsSet() { + localVarQueryParams.Add("skip", parameterToString(localVarOptionals.Skip.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Filter.IsSet() { + localVarQueryParams.Add("filter", parameterToString(localVarOptionals.Filter.Value(), "csv")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v []GraphObjectWithPaths + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +PoliciesApiService List the System Groups bound to a Policy +This endpoint will return all Systems Groups bound to a Policy, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the group's type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this Policy to the corresponding System Group; this array represents all grouping and/or associations that would have to be removed to deprovision the System Group from this Policy. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/policies/{Policy_ID}/systemgroups \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param policyId ObjectID of the Command. + * @param optional nil or *PoliciesApiGraphPolicyTraverseSystemGroupOpts - Optional Parameters: + * @param "Limit" (optional.Int32) - The number of records to return at once. Limited to 100. + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. + * @param "Skip" (optional.Int32) - The offset into the records to return. + * @param "Filter" (optional.Interface of []string) - A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` +@return []GraphObjectWithPaths +*/ + +type PoliciesApiGraphPolicyTraverseSystemGroupOpts struct { + Limit optional.Int32 + XOrgId optional.String + Skip optional.Int32 + Filter optional.Interface +} + +func (a *PoliciesApiService) GraphPolicyTraverseSystemGroup(ctx context.Context, policyId string, localVarOptionals *PoliciesApiGraphPolicyTraverseSystemGroupOpts) ([]GraphObjectWithPaths, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []GraphObjectWithPaths + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/policies/{policy_id}/systemgroups" + localVarPath = strings.Replace(localVarPath, "{"+"policy_id"+"}", fmt.Sprintf("%v", policyId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { + localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Skip.IsSet() { + localVarQueryParams.Add("skip", parameterToString(localVarOptionals.Skip.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Filter.IsSet() { + localVarQueryParams.Add("filter", parameterToString(localVarOptionals.Filter.Value(), "csv")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v []GraphObjectWithPaths + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +PoliciesApiService Deletes a Policy +This endpoint allows you to delete a policy. #### Sample Request ``` curl -X DELETE https://console.jumpcloud.com/api/v2/policies/5a837ecd232e110d4291e6b9 \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param id ObjectID of the Policy object. + * @param optional nil or *PoliciesApiPoliciesDeleteOpts - Optional Parameters: + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. + +*/ + +type PoliciesApiPoliciesDeleteOpts struct { + XOrgId optional.String +} + +func (a *PoliciesApiService) PoliciesDelete(ctx context.Context, id string, localVarOptionals *PoliciesApiPoliciesDeleteOpts) (*http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Delete") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/policies/{id}" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarHttpResponse, err + } + + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + return localVarHttpResponse, newErr + } + + return localVarHttpResponse, nil +} +/* +PoliciesApiService Gets a specific Policy. +This endpoint returns a specific policy. ###### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/policies/{PolicyID} \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param id ObjectID of the Policy object. + * @param optional nil or *PoliciesApiPoliciesGetOpts - Optional Parameters: + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. +@return PolicyWithDetails +*/ + +type PoliciesApiPoliciesGetOpts struct { + XOrgId optional.String +} + +func (a *PoliciesApiService) PoliciesGet(ctx context.Context, id string, localVarOptionals *PoliciesApiPoliciesGetOpts) (PolicyWithDetails, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue PolicyWithDetails + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/policies/{id}" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v PolicyWithDetails + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +PoliciesApiService Lists all the Policies +This endpoint returns all policies. ##### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/policies \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param optional nil or *PoliciesApiPoliciesListOpts - Optional Parameters: + * @param "Fields" (optional.Interface of []string) - The comma separated fields included in the returned records. If omitted, the default list of fields will be returned. + * @param "Filter" (optional.Interface of []string) - A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` + * @param "Limit" (optional.Int32) - The number of records to return at once. Limited to 100. + * @param "Skip" (optional.Int32) - The offset into the records to return. + * @param "Sort" (optional.Interface of []string) - The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. +@return []Policy +*/ + +type PoliciesApiPoliciesListOpts struct { + Fields optional.Interface + Filter optional.Interface + Limit optional.Int32 + Skip optional.Int32 + Sort optional.Interface + XOrgId optional.String +} + +func (a *PoliciesApiService) PoliciesList(ctx context.Context, localVarOptionals *PoliciesApiPoliciesListOpts) ([]Policy, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []Policy + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/policies" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Fields.IsSet() { + localVarQueryParams.Add("fields", parameterToString(localVarOptionals.Fields.Value(), "csv")) + } + if localVarOptionals != nil && localVarOptionals.Filter.IsSet() { + localVarQueryParams.Add("filter", parameterToString(localVarOptionals.Filter.Value(), "csv")) + } + if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { + localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Skip.IsSet() { + localVarQueryParams.Add("skip", parameterToString(localVarOptionals.Skip.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Sort.IsSet() { + localVarQueryParams.Add("sort", parameterToString(localVarOptionals.Sort.Value(), "csv")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v []Policy + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 500 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +PoliciesApiService Create a new Policy +This endpoint allows you to create a policy. Given the amount of configurable parameters required to create a Policy, we suggest you use the JumpCloud Admin Console to create new policies. ##### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/policies \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ {Policy_Parameters} }' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param optional nil or *PoliciesApiPoliciesPostOpts - Optional Parameters: + * @param "Body" (optional.Interface of PolicyRequest) - + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. +@return PolicyWithDetails +*/ + +type PoliciesApiPoliciesPostOpts struct { + Body optional.Interface + XOrgId optional.String +} + +func (a *PoliciesApiService) PoliciesPost(ctx context.Context, localVarOptionals *PoliciesApiPoliciesPostOpts) (PolicyWithDetails, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Post") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue PolicyWithDetails + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/policies" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + // body params + if localVarOptionals != nil && localVarOptionals.Body.IsSet() { + + localVarOptionalBody:= localVarOptionals.Body.Value() + localVarPostBody = &localVarOptionalBody + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 201 { + var v PolicyWithDetails + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +PoliciesApiService Update an existing Policy +This endpoint allows you to update a policy. Given the amount of configurable parameters required to update a Policy, we suggest you use the JumpCloud Admin Console to create new policies. ##### Sample Request ``` curl -X PUT https://console.jumpcloud.com/api/v2/policies/59fced45c9118022172547ff \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ {Policy_Parameters} }' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param id ObjectID of the Policy object. + * @param optional nil or *PoliciesApiPoliciesPutOpts - Optional Parameters: + * @param "Body" (optional.Interface of PolicyRequest) - + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. +@return Policy +*/ + +type PoliciesApiPoliciesPutOpts struct { + Body optional.Interface + XOrgId optional.String +} + +func (a *PoliciesApiService) PoliciesPut(ctx context.Context, id string, localVarOptionals *PoliciesApiPoliciesPutOpts) (Policy, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Put") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue Policy + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/policies/{id}" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + // body params + if localVarOptionals != nil && localVarOptionals.Body.IsSet() { + + localVarOptionalBody:= localVarOptionals.Body.Value() + localVarPostBody = &localVarOptionalBody + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v Policy + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +PoliciesApiService Get a specific Policy Result. +This endpoint will return the policy results for a specific policy. ##### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/policyresults/{Policy_ID} \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param id ObjectID of the Policy Result. + * @param optional nil or *PoliciesApiPolicyresultsGetOpts - Optional Parameters: + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. +@return PolicyResult +*/ + +type PoliciesApiPolicyresultsGetOpts struct { + XOrgId optional.String +} + +func (a *PoliciesApiService) PolicyresultsGet(ctx context.Context, id string, localVarOptionals *PoliciesApiPolicyresultsGetOpts) (PolicyResult, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue PolicyResult + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/policyresults/{id}" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v PolicyResult + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +PoliciesApiService Lists all the policy results of a policy. +This endpoint returns all policies results for a specific policy. ##### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/policies/{Policy_ID}/policyresults \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param policyId + * @param optional nil or *PoliciesApiPolicyresultsListOpts - Optional Parameters: + * @param "Fields" (optional.Interface of []string) - The comma separated fields included in the returned records. If omitted, the default list of fields will be returned. + * @param "Filter" (optional.Interface of []string) - A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` + * @param "Limit" (optional.Int32) - The number of records to return at once. Limited to 100. + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. + * @param "Skip" (optional.Int32) - The offset into the records to return. + * @param "Sort" (optional.Interface of []string) - The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. +@return []PolicyResult +*/ + +type PoliciesApiPolicyresultsListOpts struct { + Fields optional.Interface + Filter optional.Interface + Limit optional.Int32 + XOrgId optional.String + Skip optional.Int32 + Sort optional.Interface +} + +func (a *PoliciesApiService) PolicyresultsList(ctx context.Context, policyId string, localVarOptionals *PoliciesApiPolicyresultsListOpts) ([]PolicyResult, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []PolicyResult + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/policies/{policy_id}/policyresults" + localVarPath = strings.Replace(localVarPath, "{"+"policy_id"+"}", fmt.Sprintf("%v", policyId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Fields.IsSet() { + localVarQueryParams.Add("fields", parameterToString(localVarOptionals.Fields.Value(), "csv")) + } + if localVarOptionals != nil && localVarOptionals.Filter.IsSet() { + localVarQueryParams.Add("filter", parameterToString(localVarOptionals.Filter.Value(), "csv")) + } + if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { + localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Skip.IsSet() { + localVarQueryParams.Add("skip", parameterToString(localVarOptionals.Skip.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Sort.IsSet() { + localVarQueryParams.Add("sort", parameterToString(localVarOptionals.Sort.Value(), "csv")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v []PolicyResult + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +PoliciesApiService Lists all of the policy results for an organization. +This endpoint returns all policy results for an organization. ##### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/policyresults \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param optional nil or *PoliciesApiPolicyresultsOrgListOpts - Optional Parameters: + * @param "Fields" (optional.Interface of []string) - The comma separated fields included in the returned records. If omitted, the default list of fields will be returned. + * @param "Filter" (optional.Interface of []string) - A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` + * @param "Limit" (optional.Int32) - The number of records to return at once. Limited to 100. + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. + * @param "Skip" (optional.Int32) - The offset into the records to return. + * @param "Sort" (optional.Interface of []string) - The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. +@return []PolicyResult +*/ + +type PoliciesApiPolicyresultsOrgListOpts struct { + Fields optional.Interface + Filter optional.Interface + Limit optional.Int32 + XOrgId optional.String + Skip optional.Int32 + Sort optional.Interface +} + +func (a *PoliciesApiService) PolicyresultsOrgList(ctx context.Context, localVarOptionals *PoliciesApiPolicyresultsOrgListOpts) ([]PolicyResult, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []PolicyResult + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/policyresults" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Fields.IsSet() { + localVarQueryParams.Add("fields", parameterToString(localVarOptionals.Fields.Value(), "csv")) + } + if localVarOptionals != nil && localVarOptionals.Filter.IsSet() { + localVarQueryParams.Add("filter", parameterToString(localVarOptionals.Filter.Value(), "csv")) + } + if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { + localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Skip.IsSet() { + localVarQueryParams.Add("skip", parameterToString(localVarOptionals.Skip.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Sort.IsSet() { + localVarQueryParams.Add("sort", parameterToString(localVarOptionals.Sort.Value(), "csv")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v []PolicyResult + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +PoliciesApiService Lists the latest policy results of a policy. +This endpoint returns the latest policy results for a specific policy. ##### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/policies/{Policy_ID}/policystatuses \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param policyId + * @param optional nil or *PoliciesApiPolicystatusesPoliciesListOpts - Optional Parameters: + * @param "Fields" (optional.Interface of []string) - The comma separated fields included in the returned records. If omitted, the default list of fields will be returned. + * @param "Filter" (optional.Interface of []string) - A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` + * @param "Limit" (optional.Int32) - The number of records to return at once. Limited to 100. + * @param "Skip" (optional.Int32) - The offset into the records to return. + * @param "Sort" (optional.Interface of []string) - The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. +@return []PolicyResult +*/ + +type PoliciesApiPolicystatusesPoliciesListOpts struct { + Fields optional.Interface + Filter optional.Interface + Limit optional.Int32 + Skip optional.Int32 + Sort optional.Interface + XOrgId optional.String +} + +func (a *PoliciesApiService) PolicystatusesPoliciesList(ctx context.Context, policyId string, localVarOptionals *PoliciesApiPolicystatusesPoliciesListOpts) ([]PolicyResult, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []PolicyResult + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/policies/{policy_id}/policystatuses" + localVarPath = strings.Replace(localVarPath, "{"+"policy_id"+"}", fmt.Sprintf("%v", policyId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Fields.IsSet() { + localVarQueryParams.Add("fields", parameterToString(localVarOptionals.Fields.Value(), "csv")) + } + if localVarOptionals != nil && localVarOptionals.Filter.IsSet() { + localVarQueryParams.Add("filter", parameterToString(localVarOptionals.Filter.Value(), "csv")) + } + if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { + localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Skip.IsSet() { + localVarQueryParams.Add("skip", parameterToString(localVarOptionals.Skip.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Sort.IsSet() { + localVarQueryParams.Add("sort", parameterToString(localVarOptionals.Sort.Value(), "csv")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v []PolicyResult + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +PoliciesApiService List the policy statuses for a system +This endpoint returns the policy results for a particular system. ##### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/systems/{System_ID}/policystatuses \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param systemId ObjectID of the System. + * @param optional nil or *PoliciesApiPolicystatusesSystemsListOpts - Optional Parameters: + * @param "Fields" (optional.Interface of []string) - The comma separated fields included in the returned records. If omitted, the default list of fields will be returned. + * @param "Filter" (optional.Interface of []string) - A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` + * @param "Limit" (optional.Int32) - The number of records to return at once. Limited to 100. + * @param "Skip" (optional.Int32) - The offset into the records to return. + * @param "Sort" (optional.Interface of []string) - The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. +@return []PolicyResult +*/ + +type PoliciesApiPolicystatusesSystemsListOpts struct { + Fields optional.Interface + Filter optional.Interface + Limit optional.Int32 + Skip optional.Int32 + Sort optional.Interface + XOrgId optional.String +} + +func (a *PoliciesApiService) PolicystatusesSystemsList(ctx context.Context, systemId string, localVarOptionals *PoliciesApiPolicystatusesSystemsListOpts) ([]PolicyResult, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []PolicyResult + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/systems/{system_id}/policystatuses" + localVarPath = strings.Replace(localVarPath, "{"+"system_id"+"}", fmt.Sprintf("%v", systemId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Fields.IsSet() { + localVarQueryParams.Add("fields", parameterToString(localVarOptionals.Fields.Value(), "csv")) + } + if localVarOptionals != nil && localVarOptionals.Filter.IsSet() { + localVarQueryParams.Add("filter", parameterToString(localVarOptionals.Filter.Value(), "csv")) + } + if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { + localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Skip.IsSet() { + localVarQueryParams.Add("skip", parameterToString(localVarOptionals.Skip.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Sort.IsSet() { + localVarQueryParams.Add("sort", parameterToString(localVarOptionals.Sort.Value(), "csv")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v []PolicyResult + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +PoliciesApiService Get a specific Policy Template +This endpoint returns a specific policy template. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/policytemplates/{Policy_Template_ID}\\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param id ObjectID of the Policy Template. + * @param optional nil or *PoliciesApiPolicytemplatesGetOpts - Optional Parameters: + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. +@return PolicyTemplateWithDetails +*/ + +type PoliciesApiPolicytemplatesGetOpts struct { + XOrgId optional.String +} + +func (a *PoliciesApiService) PolicytemplatesGet(ctx context.Context, id string, localVarOptionals *PoliciesApiPolicytemplatesGetOpts) (PolicyTemplateWithDetails, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue PolicyTemplateWithDetails + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/policytemplates/{id}" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v PolicyTemplateWithDetails + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +PoliciesApiService Lists all of the Policy Templates +This endpoint returns all policy templates. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/policytemplates \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param optional nil or *PoliciesApiPolicytemplatesListOpts - Optional Parameters: + * @param "Fields" (optional.Interface of []string) - The comma separated fields included in the returned records. If omitted, the default list of fields will be returned. + * @param "Filter" (optional.Interface of []string) - A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` + * @param "Limit" (optional.Int32) - The number of records to return at once. Limited to 100. + * @param "Skip" (optional.Int32) - The offset into the records to return. + * @param "Sort" (optional.Interface of []string) - The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. +@return []PolicyTemplate +*/ + +type PoliciesApiPolicytemplatesListOpts struct { + Fields optional.Interface + Filter optional.Interface + Limit optional.Int32 + Skip optional.Int32 + Sort optional.Interface + XOrgId optional.String +} + +func (a *PoliciesApiService) PolicytemplatesList(ctx context.Context, localVarOptionals *PoliciesApiPolicytemplatesListOpts) ([]PolicyTemplate, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []PolicyTemplate + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/policytemplates" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Fields.IsSet() { + localVarQueryParams.Add("fields", parameterToString(localVarOptionals.Fields.Value(), "csv")) + } + if localVarOptionals != nil && localVarOptionals.Filter.IsSet() { + localVarQueryParams.Add("filter", parameterToString(localVarOptionals.Filter.Value(), "csv")) + } + if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { + localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Skip.IsSet() { + localVarQueryParams.Add("skip", parameterToString(localVarOptionals.Skip.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Sort.IsSet() { + localVarQueryParams.Add("sort", parameterToString(localVarOptionals.Sort.Value(), "csv")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v []PolicyTemplate + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 500 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} diff --git a/jcapiv2/api_policy_group_associations.go b/jcapiv2/api_policy_group_associations.go new file mode 100644 index 0000000..086894a --- /dev/null +++ b/jcapiv2/api_policy_group_associations.go @@ -0,0 +1,493 @@ + +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +import ( + "context" + "io/ioutil" + "net/http" + "net/url" + "strings" + "fmt" + "github.com/antihax/optional" +) + +// Linger please +var ( + _ context.Context +) + +type PolicyGroupAssociationsApiService service +/* +PolicyGroupAssociationsApiService List the associations of a Policy Group. +This endpoint returns the _direct_ associations of this Policy Group. A direct association can be a non-homogeneous relationship between 2 different objects, for example Policy Groups and Policies. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/policygroups/{GroupID}/associations?targets=system \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param groupId ObjectID of the Policy Group. + * @param targets Targets which a \"policy_group\" can be associated to. + * @param optional nil or *PolicyGroupAssociationsApiGraphPolicyGroupAssociationsListOpts - Optional Parameters: + * @param "Limit" (optional.Int32) - The number of records to return at once. Limited to 100. + * @param "Skip" (optional.Int32) - The offset into the records to return. + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. +@return []GraphConnection +*/ + +type PolicyGroupAssociationsApiGraphPolicyGroupAssociationsListOpts struct { + Limit optional.Int32 + Skip optional.Int32 + XOrgId optional.String +} + +func (a *PolicyGroupAssociationsApiService) GraphPolicyGroupAssociationsList(ctx context.Context, groupId string, targets []string, localVarOptionals *PolicyGroupAssociationsApiGraphPolicyGroupAssociationsListOpts) ([]GraphConnection, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []GraphConnection + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/policygroups/{group_id}/associations" + localVarPath = strings.Replace(localVarPath, "{"+"group_id"+"}", fmt.Sprintf("%v", groupId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + localVarQueryParams.Add("targets", parameterToString(targets, "csv")) + if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { + localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Skip.IsSet() { + localVarQueryParams.Add("skip", parameterToString(localVarOptionals.Skip.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v []GraphConnection + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +PolicyGroupAssociationsApiService Manage the associations of a Policy Group +This endpoint manages the _direct_ associations of this Policy Group. A direct association can be a non-homogeneous relationship between 2 different objects, for example Policy Groups and Policies. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/policygroups/{GroupID}/associations \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"op\": \"add\", \"type\": \"system\", \"id\": \"{SystemID}\" }' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param groupId ObjectID of the Policy Group. + * @param optional nil or *PolicyGroupAssociationsApiGraphPolicyGroupAssociationsPostOpts - Optional Parameters: + * @param "Body" (optional.Interface of GraphOperationPolicyGroup) - + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. + +*/ + +type PolicyGroupAssociationsApiGraphPolicyGroupAssociationsPostOpts struct { + Body optional.Interface + XOrgId optional.String +} + +func (a *PolicyGroupAssociationsApiService) GraphPolicyGroupAssociationsPost(ctx context.Context, groupId string, localVarOptionals *PolicyGroupAssociationsApiGraphPolicyGroupAssociationsPostOpts) (*http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Post") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/policygroups/{group_id}/associations" + localVarPath = strings.Replace(localVarPath, "{"+"group_id"+"}", fmt.Sprintf("%v", groupId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + // body params + if localVarOptionals != nil && localVarOptionals.Body.IsSet() { + + localVarOptionalBody:= localVarOptionals.Body.Value() + localVarPostBody = &localVarOptionalBody + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarHttpResponse, err + } + + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + return localVarHttpResponse, newErr + } + + return localVarHttpResponse, nil +} +/* +PolicyGroupAssociationsApiService List the Systems bound to a Policy Group +This endpoint will return all Systems bound to a Policy Group, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this Policy Group to the corresponding System; this array represents all grouping and/or associations that would have to be removed to deprovision the System from this Policy Group. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/policygroups/{GroupID}/systems \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param groupId ObjectID of the Policy Group. + * @param optional nil or *PolicyGroupAssociationsApiGraphPolicyGroupTraverseSystemOpts - Optional Parameters: + * @param "Limit" (optional.Int32) - The number of records to return at once. Limited to 100. + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. + * @param "Skip" (optional.Int32) - The offset into the records to return. + * @param "Filter" (optional.Interface of []string) - A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` +@return []GraphObjectWithPaths +*/ + +type PolicyGroupAssociationsApiGraphPolicyGroupTraverseSystemOpts struct { + Limit optional.Int32 + XOrgId optional.String + Skip optional.Int32 + Filter optional.Interface +} + +func (a *PolicyGroupAssociationsApiService) GraphPolicyGroupTraverseSystem(ctx context.Context, groupId string, localVarOptionals *PolicyGroupAssociationsApiGraphPolicyGroupTraverseSystemOpts) ([]GraphObjectWithPaths, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []GraphObjectWithPaths + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/policygroups/{group_id}/systems" + localVarPath = strings.Replace(localVarPath, "{"+"group_id"+"}", fmt.Sprintf("%v", groupId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { + localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Skip.IsSet() { + localVarQueryParams.Add("skip", parameterToString(localVarOptionals.Skip.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Filter.IsSet() { + localVarQueryParams.Add("filter", parameterToString(localVarOptionals.Filter.Value(), "csv")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v []GraphObjectWithPaths + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +PolicyGroupAssociationsApiService List the System Groups bound to Policy Groups +This endpoint will return all System Groups bound to a Policy Group, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this Policy Group to the corresponding System Group; this array represents all grouping and/or associations that would have to be removed to deprovision the System Group from this Policy Group. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/policygroups/{GroupID}/systemgroups \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param groupId ObjectID of the Policy Group. + * @param optional nil or *PolicyGroupAssociationsApiGraphPolicyGroupTraverseSystemGroupOpts - Optional Parameters: + * @param "Limit" (optional.Int32) - The number of records to return at once. Limited to 100. + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. + * @param "Skip" (optional.Int32) - The offset into the records to return. + * @param "Filter" (optional.Interface of []string) - A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` +@return []GraphObjectWithPaths +*/ + +type PolicyGroupAssociationsApiGraphPolicyGroupTraverseSystemGroupOpts struct { + Limit optional.Int32 + XOrgId optional.String + Skip optional.Int32 + Filter optional.Interface +} + +func (a *PolicyGroupAssociationsApiService) GraphPolicyGroupTraverseSystemGroup(ctx context.Context, groupId string, localVarOptionals *PolicyGroupAssociationsApiGraphPolicyGroupTraverseSystemGroupOpts) ([]GraphObjectWithPaths, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []GraphObjectWithPaths + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/policygroups/{group_id}/systemgroups" + localVarPath = strings.Replace(localVarPath, "{"+"group_id"+"}", fmt.Sprintf("%v", groupId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { + localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Skip.IsSet() { + localVarQueryParams.Add("skip", parameterToString(localVarOptionals.Skip.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Filter.IsSet() { + localVarQueryParams.Add("filter", parameterToString(localVarOptionals.Filter.Value(), "csv")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v []GraphObjectWithPaths + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} diff --git a/jcapiv2/api_policy_group_members_membership.go b/jcapiv2/api_policy_group_members_membership.go new file mode 100644 index 0000000..a8a9398 --- /dev/null +++ b/jcapiv2/api_policy_group_members_membership.go @@ -0,0 +1,373 @@ + +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +import ( + "context" + "io/ioutil" + "net/http" + "net/url" + "strings" + "fmt" + "github.com/antihax/optional" +) + +// Linger please +var ( + _ context.Context +) + +type PolicyGroupMembersMembershipApiService service +/* +PolicyGroupMembersMembershipApiService List the members of a Policy Group +This endpoint returns the Policy members of a Policy Group. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/policygroups/{GroupID}/members \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param groupId ObjectID of the Policy Group. + * @param optional nil or *PolicyGroupMembersMembershipApiGraphPolicyGroupMembersListOpts - Optional Parameters: + * @param "Limit" (optional.Int32) - The number of records to return at once. Limited to 100. + * @param "Skip" (optional.Int32) - The offset into the records to return. + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. +@return []GraphConnection +*/ + +type PolicyGroupMembersMembershipApiGraphPolicyGroupMembersListOpts struct { + Limit optional.Int32 + Skip optional.Int32 + XOrgId optional.String +} + +func (a *PolicyGroupMembersMembershipApiService) GraphPolicyGroupMembersList(ctx context.Context, groupId string, localVarOptionals *PolicyGroupMembersMembershipApiGraphPolicyGroupMembersListOpts) ([]GraphConnection, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []GraphConnection + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/policygroups/{group_id}/members" + localVarPath = strings.Replace(localVarPath, "{"+"group_id"+"}", fmt.Sprintf("%v", groupId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { + localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Skip.IsSet() { + localVarQueryParams.Add("skip", parameterToString(localVarOptionals.Skip.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v []GraphConnection + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +PolicyGroupMembersMembershipApiService Manage the members of a Policy Group +This endpoint allows you to manage the Policy members of a Policy Group. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/policygroups/{GroupID}/members \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"op\": \"add\", \"type\": \"policy\", \"id\": \"{Policy_ID}\" }' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param groupId ObjectID of the Policy Group. + * @param optional nil or *PolicyGroupMembersMembershipApiGraphPolicyGroupMembersPostOpts - Optional Parameters: + * @param "Body" (optional.Interface of GraphOperationPolicyGroupMember) - + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. + +*/ + +type PolicyGroupMembersMembershipApiGraphPolicyGroupMembersPostOpts struct { + Body optional.Interface + XOrgId optional.String +} + +func (a *PolicyGroupMembersMembershipApiService) GraphPolicyGroupMembersPost(ctx context.Context, groupId string, localVarOptionals *PolicyGroupMembersMembershipApiGraphPolicyGroupMembersPostOpts) (*http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Post") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/policygroups/{group_id}/members" + localVarPath = strings.Replace(localVarPath, "{"+"group_id"+"}", fmt.Sprintf("%v", groupId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + // body params + if localVarOptionals != nil && localVarOptionals.Body.IsSet() { + + localVarOptionalBody:= localVarOptionals.Body.Value() + localVarPostBody = &localVarOptionalBody + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarHttpResponse, err + } + + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + return localVarHttpResponse, newErr + } + + return localVarHttpResponse, nil +} +/* +PolicyGroupMembersMembershipApiService List the Policy Group's membership +This endpoint returns all Policy members that are a member of this Policy Group. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/policygroups/{GroupID}/membership \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param groupId ObjectID of the Policy Group. + * @param optional nil or *PolicyGroupMembersMembershipApiGraphPolicyGroupMembershipOpts - Optional Parameters: + * @param "Filter" (optional.Interface of []string) - A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` + * @param "Limit" (optional.Int32) - The number of records to return at once. Limited to 100. + * @param "Skip" (optional.Int32) - The offset into the records to return. + * @param "Sort" (optional.Interface of []string) - The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. +@return []GraphObjectWithPaths +*/ + +type PolicyGroupMembersMembershipApiGraphPolicyGroupMembershipOpts struct { + Filter optional.Interface + Limit optional.Int32 + Skip optional.Int32 + Sort optional.Interface + XOrgId optional.String +} + +func (a *PolicyGroupMembersMembershipApiService) GraphPolicyGroupMembership(ctx context.Context, groupId string, localVarOptionals *PolicyGroupMembersMembershipApiGraphPolicyGroupMembershipOpts) ([]GraphObjectWithPaths, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []GraphObjectWithPaths + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/policygroups/{group_id}/membership" + localVarPath = strings.Replace(localVarPath, "{"+"group_id"+"}", fmt.Sprintf("%v", groupId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Filter.IsSet() { + localVarQueryParams.Add("filter", parameterToString(localVarOptionals.Filter.Value(), "csv")) + } + if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { + localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Skip.IsSet() { + localVarQueryParams.Add("skip", parameterToString(localVarOptionals.Skip.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Sort.IsSet() { + localVarQueryParams.Add("sort", parameterToString(localVarOptionals.Sort.Value(), "csv")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v []GraphObjectWithPaths + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} diff --git a/jcapiv2/api_policy_groups.go b/jcapiv2/api_policy_groups.go new file mode 100644 index 0000000..bd15dac --- /dev/null +++ b/jcapiv2/api_policy_groups.go @@ -0,0 +1,1425 @@ + +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +import ( + "context" + "io/ioutil" + "net/http" + "net/url" + "strings" + "fmt" + "github.com/antihax/optional" +) + +// Linger please +var ( + _ context.Context +) + +type PolicyGroupsApiService service +/* +PolicyGroupsApiService List the associations of a Policy Group. +This endpoint returns the _direct_ associations of this Policy Group. A direct association can be a non-homogeneous relationship between 2 different objects, for example Policy Groups and Policies. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/policygroups/{GroupID}/associations?targets=system \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param groupId ObjectID of the Policy Group. + * @param targets Targets which a \"policy_group\" can be associated to. + * @param optional nil or *PolicyGroupsApiGraphPolicyGroupAssociationsListOpts - Optional Parameters: + * @param "Limit" (optional.Int32) - The number of records to return at once. Limited to 100. + * @param "Skip" (optional.Int32) - The offset into the records to return. + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. +@return []GraphConnection +*/ + +type PolicyGroupsApiGraphPolicyGroupAssociationsListOpts struct { + Limit optional.Int32 + Skip optional.Int32 + XOrgId optional.String +} + +func (a *PolicyGroupsApiService) GraphPolicyGroupAssociationsList(ctx context.Context, groupId string, targets []string, localVarOptionals *PolicyGroupsApiGraphPolicyGroupAssociationsListOpts) ([]GraphConnection, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []GraphConnection + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/policygroups/{group_id}/associations" + localVarPath = strings.Replace(localVarPath, "{"+"group_id"+"}", fmt.Sprintf("%v", groupId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + localVarQueryParams.Add("targets", parameterToString(targets, "csv")) + if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { + localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Skip.IsSet() { + localVarQueryParams.Add("skip", parameterToString(localVarOptionals.Skip.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v []GraphConnection + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +PolicyGroupsApiService Manage the associations of a Policy Group +This endpoint manages the _direct_ associations of this Policy Group. A direct association can be a non-homogeneous relationship between 2 different objects, for example Policy Groups and Policies. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/policygroups/{GroupID}/associations \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"op\": \"add\", \"type\": \"system\", \"id\": \"{SystemID}\" }' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param groupId ObjectID of the Policy Group. + * @param optional nil or *PolicyGroupsApiGraphPolicyGroupAssociationsPostOpts - Optional Parameters: + * @param "Body" (optional.Interface of GraphOperationPolicyGroup) - + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. + +*/ + +type PolicyGroupsApiGraphPolicyGroupAssociationsPostOpts struct { + Body optional.Interface + XOrgId optional.String +} + +func (a *PolicyGroupsApiService) GraphPolicyGroupAssociationsPost(ctx context.Context, groupId string, localVarOptionals *PolicyGroupsApiGraphPolicyGroupAssociationsPostOpts) (*http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Post") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/policygroups/{group_id}/associations" + localVarPath = strings.Replace(localVarPath, "{"+"group_id"+"}", fmt.Sprintf("%v", groupId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + // body params + if localVarOptionals != nil && localVarOptionals.Body.IsSet() { + + localVarOptionalBody:= localVarOptionals.Body.Value() + localVarPostBody = &localVarOptionalBody + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarHttpResponse, err + } + + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + return localVarHttpResponse, newErr + } + + return localVarHttpResponse, nil +} +/* +PolicyGroupsApiService List the members of a Policy Group +This endpoint returns the Policy members of a Policy Group. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/policygroups/{GroupID}/members \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param groupId ObjectID of the Policy Group. + * @param optional nil or *PolicyGroupsApiGraphPolicyGroupMembersListOpts - Optional Parameters: + * @param "Limit" (optional.Int32) - The number of records to return at once. Limited to 100. + * @param "Skip" (optional.Int32) - The offset into the records to return. + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. +@return []GraphConnection +*/ + +type PolicyGroupsApiGraphPolicyGroupMembersListOpts struct { + Limit optional.Int32 + Skip optional.Int32 + XOrgId optional.String +} + +func (a *PolicyGroupsApiService) GraphPolicyGroupMembersList(ctx context.Context, groupId string, localVarOptionals *PolicyGroupsApiGraphPolicyGroupMembersListOpts) ([]GraphConnection, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []GraphConnection + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/policygroups/{group_id}/members" + localVarPath = strings.Replace(localVarPath, "{"+"group_id"+"}", fmt.Sprintf("%v", groupId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { + localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Skip.IsSet() { + localVarQueryParams.Add("skip", parameterToString(localVarOptionals.Skip.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v []GraphConnection + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +PolicyGroupsApiService Manage the members of a Policy Group +This endpoint allows you to manage the Policy members of a Policy Group. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/policygroups/{GroupID}/members \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"op\": \"add\", \"type\": \"policy\", \"id\": \"{Policy_ID}\" }' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param groupId ObjectID of the Policy Group. + * @param optional nil or *PolicyGroupsApiGraphPolicyGroupMembersPostOpts - Optional Parameters: + * @param "Body" (optional.Interface of GraphOperationPolicyGroupMember) - + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. + +*/ + +type PolicyGroupsApiGraphPolicyGroupMembersPostOpts struct { + Body optional.Interface + XOrgId optional.String +} + +func (a *PolicyGroupsApiService) GraphPolicyGroupMembersPost(ctx context.Context, groupId string, localVarOptionals *PolicyGroupsApiGraphPolicyGroupMembersPostOpts) (*http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Post") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/policygroups/{group_id}/members" + localVarPath = strings.Replace(localVarPath, "{"+"group_id"+"}", fmt.Sprintf("%v", groupId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + // body params + if localVarOptionals != nil && localVarOptionals.Body.IsSet() { + + localVarOptionalBody:= localVarOptionals.Body.Value() + localVarPostBody = &localVarOptionalBody + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarHttpResponse, err + } + + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + return localVarHttpResponse, newErr + } + + return localVarHttpResponse, nil +} +/* +PolicyGroupsApiService List the Policy Group's membership +This endpoint returns all Policy members that are a member of this Policy Group. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/policygroups/{GroupID}/membership \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param groupId ObjectID of the Policy Group. + * @param optional nil or *PolicyGroupsApiGraphPolicyGroupMembershipOpts - Optional Parameters: + * @param "Filter" (optional.Interface of []string) - A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` + * @param "Limit" (optional.Int32) - The number of records to return at once. Limited to 100. + * @param "Skip" (optional.Int32) - The offset into the records to return. + * @param "Sort" (optional.Interface of []string) - The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. +@return []GraphObjectWithPaths +*/ + +type PolicyGroupsApiGraphPolicyGroupMembershipOpts struct { + Filter optional.Interface + Limit optional.Int32 + Skip optional.Int32 + Sort optional.Interface + XOrgId optional.String +} + +func (a *PolicyGroupsApiService) GraphPolicyGroupMembership(ctx context.Context, groupId string, localVarOptionals *PolicyGroupsApiGraphPolicyGroupMembershipOpts) ([]GraphObjectWithPaths, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []GraphObjectWithPaths + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/policygroups/{group_id}/membership" + localVarPath = strings.Replace(localVarPath, "{"+"group_id"+"}", fmt.Sprintf("%v", groupId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Filter.IsSet() { + localVarQueryParams.Add("filter", parameterToString(localVarOptionals.Filter.Value(), "csv")) + } + if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { + localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Skip.IsSet() { + localVarQueryParams.Add("skip", parameterToString(localVarOptionals.Skip.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Sort.IsSet() { + localVarQueryParams.Add("sort", parameterToString(localVarOptionals.Sort.Value(), "csv")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v []GraphObjectWithPaths + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +PolicyGroupsApiService List the Systems bound to a Policy Group +This endpoint will return all Systems bound to a Policy Group, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this Policy Group to the corresponding System; this array represents all grouping and/or associations that would have to be removed to deprovision the System from this Policy Group. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/policygroups/{GroupID}/systems \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param groupId ObjectID of the Policy Group. + * @param optional nil or *PolicyGroupsApiGraphPolicyGroupTraverseSystemOpts - Optional Parameters: + * @param "Limit" (optional.Int32) - The number of records to return at once. Limited to 100. + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. + * @param "Skip" (optional.Int32) - The offset into the records to return. + * @param "Filter" (optional.Interface of []string) - A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` +@return []GraphObjectWithPaths +*/ + +type PolicyGroupsApiGraphPolicyGroupTraverseSystemOpts struct { + Limit optional.Int32 + XOrgId optional.String + Skip optional.Int32 + Filter optional.Interface +} + +func (a *PolicyGroupsApiService) GraphPolicyGroupTraverseSystem(ctx context.Context, groupId string, localVarOptionals *PolicyGroupsApiGraphPolicyGroupTraverseSystemOpts) ([]GraphObjectWithPaths, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []GraphObjectWithPaths + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/policygroups/{group_id}/systems" + localVarPath = strings.Replace(localVarPath, "{"+"group_id"+"}", fmt.Sprintf("%v", groupId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { + localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Skip.IsSet() { + localVarQueryParams.Add("skip", parameterToString(localVarOptionals.Skip.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Filter.IsSet() { + localVarQueryParams.Add("filter", parameterToString(localVarOptionals.Filter.Value(), "csv")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v []GraphObjectWithPaths + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +PolicyGroupsApiService List the System Groups bound to Policy Groups +This endpoint will return all System Groups bound to a Policy Group, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this Policy Group to the corresponding System Group; this array represents all grouping and/or associations that would have to be removed to deprovision the System Group from this Policy Group. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/policygroups/{GroupID}/systemgroups \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param groupId ObjectID of the Policy Group. + * @param optional nil or *PolicyGroupsApiGraphPolicyGroupTraverseSystemGroupOpts - Optional Parameters: + * @param "Limit" (optional.Int32) - The number of records to return at once. Limited to 100. + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. + * @param "Skip" (optional.Int32) - The offset into the records to return. + * @param "Filter" (optional.Interface of []string) - A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` +@return []GraphObjectWithPaths +*/ + +type PolicyGroupsApiGraphPolicyGroupTraverseSystemGroupOpts struct { + Limit optional.Int32 + XOrgId optional.String + Skip optional.Int32 + Filter optional.Interface +} + +func (a *PolicyGroupsApiService) GraphPolicyGroupTraverseSystemGroup(ctx context.Context, groupId string, localVarOptionals *PolicyGroupsApiGraphPolicyGroupTraverseSystemGroupOpts) ([]GraphObjectWithPaths, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []GraphObjectWithPaths + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/policygroups/{group_id}/systemgroups" + localVarPath = strings.Replace(localVarPath, "{"+"group_id"+"}", fmt.Sprintf("%v", groupId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { + localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Skip.IsSet() { + localVarQueryParams.Add("skip", parameterToString(localVarOptionals.Skip.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Filter.IsSet() { + localVarQueryParams.Add("filter", parameterToString(localVarOptionals.Filter.Value(), "csv")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v []GraphObjectWithPaths + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +PolicyGroupsApiService Delete a Policy Group +This endpoint allows you to delete a Policy Group. #### Sample Request ``` curl -X DELETE https://console.jumpcloud.com/api/v2/policygroups/{GroupID} \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param id ObjectID of the Policy Group. + * @param optional nil or *PolicyGroupsApiGroupsPolicyDeleteOpts - Optional Parameters: + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. +@return PolicyGroup +*/ + +type PolicyGroupsApiGroupsPolicyDeleteOpts struct { + XOrgId optional.String +} + +func (a *PolicyGroupsApiService) GroupsPolicyDelete(ctx context.Context, id string, localVarOptionals *PolicyGroupsApiGroupsPolicyDeleteOpts) (PolicyGroup, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Delete") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue PolicyGroup + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/policygroups/{id}" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v PolicyGroup + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +PolicyGroupsApiService View an individual Policy Group details +This endpoint returns the details of a Policy Group. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/policygroups/{GroupID} \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param id ObjectID of the Policy Group. + * @param optional nil or *PolicyGroupsApiGroupsPolicyGetOpts - Optional Parameters: + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. +@return PolicyGroup +*/ + +type PolicyGroupsApiGroupsPolicyGetOpts struct { + XOrgId optional.String +} + +func (a *PolicyGroupsApiService) GroupsPolicyGet(ctx context.Context, id string, localVarOptionals *PolicyGroupsApiGroupsPolicyGetOpts) (PolicyGroup, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue PolicyGroup + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/policygroups/{id}" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v PolicyGroup + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +PolicyGroupsApiService List all Policy Groups +This endpoint returns all Policy Groups. Available filter fields: - `name` - `disabled` - `type` #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/policygroups \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param optional nil or *PolicyGroupsApiGroupsPolicyListOpts - Optional Parameters: + * @param "Fields" (optional.Interface of []string) - The comma separated fields included in the returned records. If omitted, the default list of fields will be returned. + * @param "Filter" (optional.Interface of []string) - A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` + * @param "Limit" (optional.Int32) - The number of records to return at once. Limited to 100. + * @param "Skip" (optional.Int32) - The offset into the records to return. + * @param "Sort" (optional.Interface of []string) - The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. +@return []PolicyGroup +*/ + +type PolicyGroupsApiGroupsPolicyListOpts struct { + Fields optional.Interface + Filter optional.Interface + Limit optional.Int32 + Skip optional.Int32 + Sort optional.Interface + XOrgId optional.String +} + +func (a *PolicyGroupsApiService) GroupsPolicyList(ctx context.Context, localVarOptionals *PolicyGroupsApiGroupsPolicyListOpts) ([]PolicyGroup, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []PolicyGroup + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/policygroups" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Fields.IsSet() { + localVarQueryParams.Add("fields", parameterToString(localVarOptionals.Fields.Value(), "csv")) + } + if localVarOptionals != nil && localVarOptionals.Filter.IsSet() { + localVarQueryParams.Add("filter", parameterToString(localVarOptionals.Filter.Value(), "csv")) + } + if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { + localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Skip.IsSet() { + localVarQueryParams.Add("skip", parameterToString(localVarOptionals.Skip.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Sort.IsSet() { + localVarQueryParams.Add("sort", parameterToString(localVarOptionals.Sort.Value(), "csv")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v []PolicyGroup + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 0 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +PolicyGroupsApiService Create a new Policy Group +This endpoint allows you to create a new Policy Group. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/policygroups \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"name\": \"{Group_Name}\" }' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param optional nil or *PolicyGroupsApiGroupsPolicyPostOpts - Optional Parameters: + * @param "Body" (optional.Interface of PolicyGroupData) - + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. +@return PolicyGroup +*/ + +type PolicyGroupsApiGroupsPolicyPostOpts struct { + Body optional.Interface + XOrgId optional.String +} + +func (a *PolicyGroupsApiService) GroupsPolicyPost(ctx context.Context, localVarOptionals *PolicyGroupsApiGroupsPolicyPostOpts) (PolicyGroup, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Post") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue PolicyGroup + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/policygroups" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + // body params + if localVarOptionals != nil && localVarOptionals.Body.IsSet() { + + localVarOptionalBody:= localVarOptionals.Body.Value() + localVarPostBody = &localVarOptionalBody + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 201 { + var v PolicyGroup + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +PolicyGroupsApiService Update a Policy Group +This endpoint allows you to do a full update of the Policy Group. #### Sample Request ``` curl -X PUT https://console.jumpcloud.com/api/v2/policygroups/{Group_ID} \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"name\": \"group_update\" }' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param id ObjectID of the Policy Group. + * @param optional nil or *PolicyGroupsApiGroupsPolicyPutOpts - Optional Parameters: + * @param "Body" (optional.Interface of PolicyGroupData) - + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. +@return PolicyGroup +*/ + +type PolicyGroupsApiGroupsPolicyPutOpts struct { + Body optional.Interface + XOrgId optional.String +} + +func (a *PolicyGroupsApiService) GroupsPolicyPut(ctx context.Context, id string, localVarOptionals *PolicyGroupsApiGroupsPolicyPutOpts) (PolicyGroup, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Put") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue PolicyGroup + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/policygroups/{id}" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + // body params + if localVarOptionals != nil && localVarOptionals.Body.IsSet() { + + localVarOptionalBody:= localVarOptionals.Body.Value() + localVarPostBody = &localVarOptionalBody + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v PolicyGroup + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} diff --git a/jcapiv2/api_policytemplates.go b/jcapiv2/api_policytemplates.go new file mode 100644 index 0000000..1af3da5 --- /dev/null +++ b/jcapiv2/api_policytemplates.go @@ -0,0 +1,277 @@ + +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +import ( + "context" + "io/ioutil" + "net/http" + "net/url" + "strings" + "fmt" + "github.com/antihax/optional" +) + +// Linger please +var ( + _ context.Context +) + +type PolicytemplatesApiService service +/* +PolicytemplatesApiService Get a specific Policy Template +This endpoint returns a specific policy template. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/policytemplates/{Policy_Template_ID}\\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param id ObjectID of the Policy Template. + * @param optional nil or *PolicytemplatesApiPolicytemplatesGetOpts - Optional Parameters: + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. +@return PolicyTemplateWithDetails +*/ + +type PolicytemplatesApiPolicytemplatesGetOpts struct { + XOrgId optional.String +} + +func (a *PolicytemplatesApiService) PolicytemplatesGet(ctx context.Context, id string, localVarOptionals *PolicytemplatesApiPolicytemplatesGetOpts) (PolicyTemplateWithDetails, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue PolicyTemplateWithDetails + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/policytemplates/{id}" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v PolicyTemplateWithDetails + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +PolicytemplatesApiService Lists all of the Policy Templates +This endpoint returns all policy templates. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/policytemplates \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param optional nil or *PolicytemplatesApiPolicytemplatesListOpts - Optional Parameters: + * @param "Fields" (optional.Interface of []string) - The comma separated fields included in the returned records. If omitted, the default list of fields will be returned. + * @param "Filter" (optional.Interface of []string) - A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` + * @param "Limit" (optional.Int32) - The number of records to return at once. Limited to 100. + * @param "Skip" (optional.Int32) - The offset into the records to return. + * @param "Sort" (optional.Interface of []string) - The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. +@return []PolicyTemplate +*/ + +type PolicytemplatesApiPolicytemplatesListOpts struct { + Fields optional.Interface + Filter optional.Interface + Limit optional.Int32 + Skip optional.Int32 + Sort optional.Interface + XOrgId optional.String +} + +func (a *PolicytemplatesApiService) PolicytemplatesList(ctx context.Context, localVarOptionals *PolicytemplatesApiPolicytemplatesListOpts) ([]PolicyTemplate, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []PolicyTemplate + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/policytemplates" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Fields.IsSet() { + localVarQueryParams.Add("fields", parameterToString(localVarOptionals.Fields.Value(), "csv")) + } + if localVarOptionals != nil && localVarOptionals.Filter.IsSet() { + localVarQueryParams.Add("filter", parameterToString(localVarOptionals.Filter.Value(), "csv")) + } + if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { + localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Skip.IsSet() { + localVarQueryParams.Add("skip", parameterToString(localVarOptionals.Skip.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Sort.IsSet() { + localVarQueryParams.Add("sort", parameterToString(localVarOptionals.Sort.Value(), "csv")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v []PolicyTemplate + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 500 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} diff --git a/jcapiv2/api_providers.go b/jcapiv2/api_providers.go new file mode 100644 index 0000000..c911682 --- /dev/null +++ b/jcapiv2/api_providers.go @@ -0,0 +1,6648 @@ + +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +import ( + "context" + "io/ioutil" + "net/http" + "net/url" + "strings" + "fmt" + "github.com/antihax/optional" +) + +// Linger please +var ( + _ context.Context +) + +type ProvidersApiService service +/* +ProvidersApiService Creates a new Autotask integration for the provider +Creates a new Autotask integration for the provider. You must be associated with the provider to use this route. A 422 Unprocessable Entity response means the server failed to validate with Autotask. + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param providerId + * @param optional nil or *ProvidersApiAutotaskCreateConfigurationOpts - Optional Parameters: + * @param "Body" (optional.Interface of AutotaskIntegrationReq) - +@return InlineResponse201 +*/ + +type ProvidersApiAutotaskCreateConfigurationOpts struct { + Body optional.Interface +} + +func (a *ProvidersApiService) AutotaskCreateConfiguration(ctx context.Context, providerId string, localVarOptionals *ProvidersApiAutotaskCreateConfigurationOpts) (InlineResponse201, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Post") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue InlineResponse201 + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/providers/{provider_id}/integrations/autotask" + localVarPath = strings.Replace(localVarPath, "{"+"provider_id"+"}", fmt.Sprintf("%v", providerId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + // body params + if localVarOptionals != nil && localVarOptionals.Body.IsSet() { + + localVarOptionalBody:= localVarOptionals.Body.Value() + localVarPostBody = &localVarOptionalBody + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 201 { + var v InlineResponse201 + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 400 { + var v ErrorDetails + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 401 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 403 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 404 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 409 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 422 { + var v interface{} + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 500 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +ProvidersApiService Delete Autotask Integration +Removes a Autotask integration. + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param uUID + +*/ +func (a *ProvidersApiService) AutotaskDeleteConfiguration(ctx context.Context, uUID string) (*http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Delete") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/integrations/autotask/{UUID}" + localVarPath = strings.Replace(localVarPath, "{"+"UUID"+"}", fmt.Sprintf("%v", uUID), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarHttpResponse, err + } + + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 400 { + var v ErrorDetails + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarHttpResponse, newErr + } + newErr.model = v + return localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 401 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarHttpResponse, newErr + } + newErr.model = v + return localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 403 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarHttpResponse, newErr + } + newErr.model = v + return localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 404 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarHttpResponse, newErr + } + newErr.model = v + return localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 500 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarHttpResponse, newErr + } + newErr.model = v + return localVarHttpResponse, newErr + } + return localVarHttpResponse, newErr + } + + return localVarHttpResponse, nil +} +/* +ProvidersApiService Retrieve Autotask Integration Configuration +Retrieves configuration for given Autotask integration id. You must be associated to the provider the integration is tied to in order to use this api. + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param uUID +@return AutotaskIntegration +*/ +func (a *ProvidersApiService) AutotaskGetConfiguration(ctx context.Context, uUID string) (AutotaskIntegration, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue AutotaskIntegration + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/integrations/autotask/{UUID}" + localVarPath = strings.Replace(localVarPath, "{"+"UUID"+"}", fmt.Sprintf("%v", uUID), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v AutotaskIntegration + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 400 { + var v ErrorDetails + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 401 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 403 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 404 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 500 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +ProvidersApiService Create, edit, and/or delete Autotask Mappings +Create, edit, and/or delete mappings between Jumpcloud organizations and Autotask companies/contracts/services. You must be associated to the same provider as the Autotask integration to use this api. + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param uUID + * @param optional nil or *ProvidersApiAutotaskPatchMappingsOpts - Optional Parameters: + * @param "Body" (optional.Interface of AutotaskMappingRequest) - +@return AutotaskMappingResponse +*/ + +type ProvidersApiAutotaskPatchMappingsOpts struct { + Body optional.Interface +} + +func (a *ProvidersApiService) AutotaskPatchMappings(ctx context.Context, uUID string, localVarOptionals *ProvidersApiAutotaskPatchMappingsOpts) (AutotaskMappingResponse, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Patch") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue AutotaskMappingResponse + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/integrations/autotask/{UUID}/mappings" + localVarPath = strings.Replace(localVarPath, "{"+"UUID"+"}", fmt.Sprintf("%v", uUID), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + // body params + if localVarOptionals != nil && localVarOptionals.Body.IsSet() { + + localVarOptionalBody:= localVarOptionals.Body.Value() + localVarPostBody = &localVarOptionalBody + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 204 { + var v AutotaskMappingResponse + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 400 { + var v ErrorDetails + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 401 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 403 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 404 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 500 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +ProvidersApiService Create, edit, and/or delete Autotask Integration settings +Create, edit, and/or delete Autotask settings. You must be associated to the same provider as the Autotask integration to use this endpoint. + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param uUID + * @param optional nil or *ProvidersApiAutotaskPatchSettingsOpts - Optional Parameters: + * @param "Body" (optional.Interface of AutotaskSettingsPatchReq) - +@return AutotaskSettings +*/ + +type ProvidersApiAutotaskPatchSettingsOpts struct { + Body optional.Interface +} + +func (a *ProvidersApiService) AutotaskPatchSettings(ctx context.Context, uUID string, localVarOptionals *ProvidersApiAutotaskPatchSettingsOpts) (AutotaskSettings, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Patch") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue AutotaskSettings + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/integrations/autotask/{UUID}/settings" + localVarPath = strings.Replace(localVarPath, "{"+"UUID"+"}", fmt.Sprintf("%v", uUID), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + // body params + if localVarOptionals != nil && localVarOptionals.Body.IsSet() { + + localVarOptionalBody:= localVarOptionals.Body.Value() + localVarPostBody = &localVarOptionalBody + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v AutotaskSettings + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 400 { + var v ErrorDetails + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 401 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 403 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 404 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 500 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +ProvidersApiService Get all Autotask ticketing alert configuration options for a provider +Get all Autotask ticketing alert configuration options for a provider. + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param providerId +@return AutotaskTicketingAlertConfigurationOptions +*/ +func (a *ProvidersApiService) AutotaskRetrieveAllAlertConfigurationOptions(ctx context.Context, providerId string) (AutotaskTicketingAlertConfigurationOptions, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue AutotaskTicketingAlertConfigurationOptions + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/providers/{provider_id}/integrations/autotask/alerts/configuration/options" + localVarPath = strings.Replace(localVarPath, "{"+"provider_id"+"}", fmt.Sprintf("%v", providerId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v AutotaskTicketingAlertConfigurationOptions + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 400 { + var v ErrorDetails + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 401 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 403 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 404 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 500 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +ProvidersApiService Get all Autotask ticketing alert configurations for a provider +Get all Autotask ticketing alert configurations for a provider. + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param providerId +@return AutotaskTicketingAlertConfigurationList +*/ +func (a *ProvidersApiService) AutotaskRetrieveAllAlertConfigurations(ctx context.Context, providerId string) (AutotaskTicketingAlertConfigurationList, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue AutotaskTicketingAlertConfigurationList + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/providers/{provider_id}/integrations/autotask/alerts/configuration" + localVarPath = strings.Replace(localVarPath, "{"+"provider_id"+"}", fmt.Sprintf("%v", providerId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v AutotaskTicketingAlertConfigurationList + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 400 { + var v ErrorDetails + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 401 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 403 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 404 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 500 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +ProvidersApiService Retrieve Autotask Companies +Retrieves a list of Autotask companies for the given Autotask id. You must be associated to the same provider as the Autotask integration to use this endpoint. + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param uUID + * @param optional nil or *ProvidersApiAutotaskRetrieveCompaniesOpts - Optional Parameters: + * @param "Fields" (optional.Interface of []string) - The comma separated fields included in the returned records. If omitted, the default list of fields will be returned. + * @param "Filter" (optional.Interface of []string) - A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` + * @param "Limit" (optional.Int32) - The number of records to return at once. Limited to 100. + * @param "Skip" (optional.Int32) - The offset into the records to return. + * @param "Sort" (optional.Interface of []string) - The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. +@return AutotaskCompanyResp +*/ + +type ProvidersApiAutotaskRetrieveCompaniesOpts struct { + Fields optional.Interface + Filter optional.Interface + Limit optional.Int32 + Skip optional.Int32 + Sort optional.Interface +} + +func (a *ProvidersApiService) AutotaskRetrieveCompanies(ctx context.Context, uUID string, localVarOptionals *ProvidersApiAutotaskRetrieveCompaniesOpts) (AutotaskCompanyResp, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue AutotaskCompanyResp + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/integrations/autotask/{UUID}/companies" + localVarPath = strings.Replace(localVarPath, "{"+"UUID"+"}", fmt.Sprintf("%v", uUID), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Fields.IsSet() { + localVarQueryParams.Add("fields", parameterToString(localVarOptionals.Fields.Value(), "csv")) + } + if localVarOptionals != nil && localVarOptionals.Filter.IsSet() { + localVarQueryParams.Add("filter", parameterToString(localVarOptionals.Filter.Value(), "csv")) + } + if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { + localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Skip.IsSet() { + localVarQueryParams.Add("skip", parameterToString(localVarOptionals.Skip.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Sort.IsSet() { + localVarQueryParams.Add("sort", parameterToString(localVarOptionals.Sort.Value(), "csv")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v AutotaskCompanyResp + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 400 { + var v ErrorDetails + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 401 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 403 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 404 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 500 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +ProvidersApiService Retrieve Autotask Company Types +Retrieves a list of user defined company types from Autotask for the given Autotask id. + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param uUID +@return AutotaskCompanyTypeResp +*/ +func (a *ProvidersApiService) AutotaskRetrieveCompanyTypes(ctx context.Context, uUID string) (AutotaskCompanyTypeResp, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue AutotaskCompanyTypeResp + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/integrations/autotask/{UUID}/companytypes" + localVarPath = strings.Replace(localVarPath, "{"+"UUID"+"}", fmt.Sprintf("%v", uUID), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v AutotaskCompanyTypeResp + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 400 { + var v ErrorDetails + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 401 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 403 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 404 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 500 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +ProvidersApiService Retrieve Autotask Contracts +Retrieves a list of Autotask contracts for the given Autotask integration id. You must be associated to the same provider as the Autotask integration to use this endpoint. + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param uUID + * @param optional nil or *ProvidersApiAutotaskRetrieveContractsOpts - Optional Parameters: + * @param "Fields" (optional.Interface of []string) - The comma separated fields included in the returned records. If omitted, the default list of fields will be returned. + * @param "Filter" (optional.Interface of []string) - A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` + * @param "Limit" (optional.Int32) - The number of records to return at once. Limited to 100. + * @param "Skip" (optional.Int32) - The offset into the records to return. + * @param "Sort" (optional.Interface of []string) - The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. +@return InlineResponse2003 +*/ + +type ProvidersApiAutotaskRetrieveContractsOpts struct { + Fields optional.Interface + Filter optional.Interface + Limit optional.Int32 + Skip optional.Int32 + Sort optional.Interface +} + +func (a *ProvidersApiService) AutotaskRetrieveContracts(ctx context.Context, uUID string, localVarOptionals *ProvidersApiAutotaskRetrieveContractsOpts) (InlineResponse2003, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue InlineResponse2003 + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/integrations/autotask/{UUID}/contracts" + localVarPath = strings.Replace(localVarPath, "{"+"UUID"+"}", fmt.Sprintf("%v", uUID), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Fields.IsSet() { + localVarQueryParams.Add("fields", parameterToString(localVarOptionals.Fields.Value(), "csv")) + } + if localVarOptionals != nil && localVarOptionals.Filter.IsSet() { + localVarQueryParams.Add("filter", parameterToString(localVarOptionals.Filter.Value(), "csv")) + } + if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { + localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Skip.IsSet() { + localVarQueryParams.Add("skip", parameterToString(localVarOptionals.Skip.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Sort.IsSet() { + localVarQueryParams.Add("sort", parameterToString(localVarOptionals.Sort.Value(), "csv")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v InlineResponse2003 + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 400 { + var v ErrorDetails + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 401 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 403 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 404 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 500 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +ProvidersApiService Retrieve Autotask Contract Fields +Retrieves a list of Autotask contract fields for the given Autotask integration id. You must be associated to the same provider as the Autotask integration to use this endpoint. + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param uUID +@return InlineResponse2004 +*/ +func (a *ProvidersApiService) AutotaskRetrieveContractsFields(ctx context.Context, uUID string) (InlineResponse2004, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue InlineResponse2004 + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/integrations/autotask/{UUID}/contracts/fields" + localVarPath = strings.Replace(localVarPath, "{"+"UUID"+"}", fmt.Sprintf("%v", uUID), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v InlineResponse2004 + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 400 { + var v ErrorDetails + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 401 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 403 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 404 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 500 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +ProvidersApiService Retrieve Autotask mappings +Retrieves the list of mappings for this Autotask integration. You must be associated to the same provider as the Autotask integration to use this api. + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param uUID + * @param optional nil or *ProvidersApiAutotaskRetrieveMappingsOpts - Optional Parameters: + * @param "Fields" (optional.Interface of []string) - The comma separated fields included in the returned records. If omitted, the default list of fields will be returned. + * @param "Filter" (optional.Interface of []string) - A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` + * @param "Limit" (optional.Int32) - The number of records to return at once. Limited to 100. + * @param "Skip" (optional.Int32) - The offset into the records to return. + * @param "Sort" (optional.Interface of []string) - The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. +@return InlineResponse2006 +*/ + +type ProvidersApiAutotaskRetrieveMappingsOpts struct { + Fields optional.Interface + Filter optional.Interface + Limit optional.Int32 + Skip optional.Int32 + Sort optional.Interface +} + +func (a *ProvidersApiService) AutotaskRetrieveMappings(ctx context.Context, uUID string, localVarOptionals *ProvidersApiAutotaskRetrieveMappingsOpts) (InlineResponse2006, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue InlineResponse2006 + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/integrations/autotask/{UUID}/mappings" + localVarPath = strings.Replace(localVarPath, "{"+"UUID"+"}", fmt.Sprintf("%v", uUID), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Fields.IsSet() { + localVarQueryParams.Add("fields", parameterToString(localVarOptionals.Fields.Value(), "csv")) + } + if localVarOptionals != nil && localVarOptionals.Filter.IsSet() { + localVarQueryParams.Add("filter", parameterToString(localVarOptionals.Filter.Value(), "csv")) + } + if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { + localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Skip.IsSet() { + localVarQueryParams.Add("skip", parameterToString(localVarOptionals.Skip.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Sort.IsSet() { + localVarQueryParams.Add("sort", parameterToString(localVarOptionals.Sort.Value(), "csv")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v InlineResponse2006 + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 400 { + var v ErrorDetails + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 401 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 403 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 404 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 500 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +ProvidersApiService Retrieve Autotask Contract Services +Retrieves a list of Autotask contract services for the given Autotask integration id. You must be associated to the same provider as the Autotask integration to use this endpoint. + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param uUID + * @param optional nil or *ProvidersApiAutotaskRetrieveServicesOpts - Optional Parameters: + * @param "Fields" (optional.Interface of []string) - The comma separated fields included in the returned records. If omitted, the default list of fields will be returned. + * @param "Filter" (optional.Interface of []string) - A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` + * @param "Limit" (optional.Int32) - The number of records to return at once. Limited to 100. + * @param "Skip" (optional.Int32) - The offset into the records to return. + * @param "Sort" (optional.Interface of []string) - The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. +@return InlineResponse2005 +*/ + +type ProvidersApiAutotaskRetrieveServicesOpts struct { + Fields optional.Interface + Filter optional.Interface + Limit optional.Int32 + Skip optional.Int32 + Sort optional.Interface +} + +func (a *ProvidersApiService) AutotaskRetrieveServices(ctx context.Context, uUID string, localVarOptionals *ProvidersApiAutotaskRetrieveServicesOpts) (InlineResponse2005, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue InlineResponse2005 + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/integrations/autotask/{UUID}/contracts/services" + localVarPath = strings.Replace(localVarPath, "{"+"UUID"+"}", fmt.Sprintf("%v", uUID), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Fields.IsSet() { + localVarQueryParams.Add("fields", parameterToString(localVarOptionals.Fields.Value(), "csv")) + } + if localVarOptionals != nil && localVarOptionals.Filter.IsSet() { + localVarQueryParams.Add("filter", parameterToString(localVarOptionals.Filter.Value(), "csv")) + } + if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { + localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Skip.IsSet() { + localVarQueryParams.Add("skip", parameterToString(localVarOptionals.Skip.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Sort.IsSet() { + localVarQueryParams.Add("sort", parameterToString(localVarOptionals.Sort.Value(), "csv")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v InlineResponse2005 + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 400 { + var v ErrorDetails + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 401 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 403 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 404 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 500 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +ProvidersApiService Retrieve Autotask Integration settings +Retrieve the Autotask integration settings. You must be associated to the same provider as the Autotask integration to use this endpoint. + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param uUID +@return AutotaskSettings +*/ +func (a *ProvidersApiService) AutotaskRetrieveSettings(ctx context.Context, uUID string) (AutotaskSettings, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue AutotaskSettings + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/integrations/autotask/{UUID}/settings" + localVarPath = strings.Replace(localVarPath, "{"+"UUID"+"}", fmt.Sprintf("%v", uUID), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v AutotaskSettings + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 400 { + var v ErrorDetails + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 401 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 403 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 404 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 500 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +ProvidersApiService Update an Autotask ticketing alert's configuration +Update an Autotask ticketing alert's configuration + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param providerId + * @param alertUUID + * @param optional nil or *ProvidersApiAutotaskUpdateAlertConfigurationOpts - Optional Parameters: + * @param "Body" (optional.Interface of AutotaskTicketingAlertConfigurationRequest) - +@return AutotaskTicketingAlertConfiguration +*/ + +type ProvidersApiAutotaskUpdateAlertConfigurationOpts struct { + Body optional.Interface +} + +func (a *ProvidersApiService) AutotaskUpdateAlertConfiguration(ctx context.Context, providerId string, alertUUID string, localVarOptionals *ProvidersApiAutotaskUpdateAlertConfigurationOpts) (AutotaskTicketingAlertConfiguration, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Put") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue AutotaskTicketingAlertConfiguration + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/providers/{provider_id}/integrations/autotask/alerts/{alert_UUID}/configuration" + localVarPath = strings.Replace(localVarPath, "{"+"provider_id"+"}", fmt.Sprintf("%v", providerId), -1) + localVarPath = strings.Replace(localVarPath, "{"+"alert_UUID"+"}", fmt.Sprintf("%v", alertUUID), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + // body params + if localVarOptionals != nil && localVarOptionals.Body.IsSet() { + + localVarOptionalBody:= localVarOptionals.Body.Value() + localVarPostBody = &localVarOptionalBody + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v AutotaskTicketingAlertConfiguration + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 400 { + var v ErrorDetails + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 401 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 403 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 404 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 500 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +ProvidersApiService Update Autotask Integration configuration +Update the Autotask integration configuration. A 422 Unprocessable Entity response means the server failed to validate with Autotask. + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param uUID + * @param optional nil or *ProvidersApiAutotaskUpdateConfigurationOpts - Optional Parameters: + * @param "Body" (optional.Interface of AutotaskIntegrationPatchReq) - +@return AutotaskIntegration +*/ + +type ProvidersApiAutotaskUpdateConfigurationOpts struct { + Body optional.Interface +} + +func (a *ProvidersApiService) AutotaskUpdateConfiguration(ctx context.Context, uUID string, localVarOptionals *ProvidersApiAutotaskUpdateConfigurationOpts) (AutotaskIntegration, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Patch") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue AutotaskIntegration + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/integrations/autotask/{UUID}" + localVarPath = strings.Replace(localVarPath, "{"+"UUID"+"}", fmt.Sprintf("%v", uUID), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + // body params + if localVarOptionals != nil && localVarOptionals.Body.IsSet() { + + localVarOptionalBody:= localVarOptionals.Body.Value() + localVarPostBody = &localVarOptionalBody + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v AutotaskIntegration + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 400 { + var v ErrorDetails + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 401 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 403 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 404 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 422 { + var v interface{} + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 500 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +ProvidersApiService Creates a new ConnectWise integration for the provider +Creates a new ConnectWise integration for the provider. You must be associated with the provider to use this route. A 422 Unprocessable Entity response means the server failed to validate with ConnectWise. + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param providerId + * @param optional nil or *ProvidersApiConnectwiseCreateConfigurationOpts - Optional Parameters: + * @param "Body" (optional.Interface of ConnectwiseIntegrationReq) - +@return InlineResponse201 +*/ + +type ProvidersApiConnectwiseCreateConfigurationOpts struct { + Body optional.Interface +} + +func (a *ProvidersApiService) ConnectwiseCreateConfiguration(ctx context.Context, providerId string, localVarOptionals *ProvidersApiConnectwiseCreateConfigurationOpts) (InlineResponse201, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Post") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue InlineResponse201 + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/providers/{provider_id}/integrations/connectwise" + localVarPath = strings.Replace(localVarPath, "{"+"provider_id"+"}", fmt.Sprintf("%v", providerId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + // body params + if localVarOptionals != nil && localVarOptionals.Body.IsSet() { + + localVarOptionalBody:= localVarOptionals.Body.Value() + localVarPostBody = &localVarOptionalBody + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 201 { + var v InlineResponse201 + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 400 { + var v ErrorDetails + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 401 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 403 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 404 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 409 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 422 { + var v interface{} + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 500 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +ProvidersApiService Delete ConnectWise Integration +Removes a ConnectWise integration. + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param uUID + +*/ +func (a *ProvidersApiService) ConnectwiseDeleteConfiguration(ctx context.Context, uUID string) (*http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Delete") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/integrations/connectwise/{UUID}" + localVarPath = strings.Replace(localVarPath, "{"+"UUID"+"}", fmt.Sprintf("%v", uUID), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarHttpResponse, err + } + + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 400 { + var v ErrorDetails + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarHttpResponse, newErr + } + newErr.model = v + return localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 401 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarHttpResponse, newErr + } + newErr.model = v + return localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 403 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarHttpResponse, newErr + } + newErr.model = v + return localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 404 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarHttpResponse, newErr + } + newErr.model = v + return localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 500 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarHttpResponse, newErr + } + newErr.model = v + return localVarHttpResponse, newErr + } + return localVarHttpResponse, newErr + } + + return localVarHttpResponse, nil +} +/* +ProvidersApiService Retrieve ConnectWise Integration Configuration +Retrieves configuration for given ConnectWise integration id. You must be associated to the provider the integration is tied to in order to use this api. + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param uUID +@return ConnectwiseIntegration +*/ +func (a *ProvidersApiService) ConnectwiseGetConfiguration(ctx context.Context, uUID string) (ConnectwiseIntegration, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue ConnectwiseIntegration + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/integrations/connectwise/{UUID}" + localVarPath = strings.Replace(localVarPath, "{"+"UUID"+"}", fmt.Sprintf("%v", uUID), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v ConnectwiseIntegration + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 400 { + var v ErrorDetails + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 401 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 403 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 404 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 500 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +ProvidersApiService Create, edit, and/or delete ConnectWise Mappings +Create, edit, and/or delete mappings between Jumpcloud organizations and ConnectWise companies/agreements/additions. You must be associated to the same provider as the ConnectWise integration to use this api. + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param uUID + * @param optional nil or *ProvidersApiConnectwisePatchMappingsOpts - Optional Parameters: + * @param "Body" (optional.Interface of ConnectWiseMappingRequest) - +@return ConnectWiseMappingRequest +*/ + +type ProvidersApiConnectwisePatchMappingsOpts struct { + Body optional.Interface +} + +func (a *ProvidersApiService) ConnectwisePatchMappings(ctx context.Context, uUID string, localVarOptionals *ProvidersApiConnectwisePatchMappingsOpts) (ConnectWiseMappingRequest, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Patch") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue ConnectWiseMappingRequest + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/integrations/connectwise/{UUID}/mappings" + localVarPath = strings.Replace(localVarPath, "{"+"UUID"+"}", fmt.Sprintf("%v", uUID), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + // body params + if localVarOptionals != nil && localVarOptionals.Body.IsSet() { + + localVarOptionalBody:= localVarOptionals.Body.Value() + localVarPostBody = &localVarOptionalBody + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 204 { + var v ConnectWiseMappingRequest + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 400 { + var v ErrorDetails + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 401 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 403 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 404 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 500 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +ProvidersApiService Create, edit, and/or delete ConnectWise Integration settings +Create, edit, and/or delete ConnectWiseIntegration settings. You must be associated to the same provider as the ConnectWise integration to use this endpoint. + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param uUID + * @param optional nil or *ProvidersApiConnectwisePatchSettingsOpts - Optional Parameters: + * @param "Body" (optional.Interface of ConnectWiseSettingsPatchReq) - +@return ConnectWiseSettings +*/ + +type ProvidersApiConnectwisePatchSettingsOpts struct { + Body optional.Interface +} + +func (a *ProvidersApiService) ConnectwisePatchSettings(ctx context.Context, uUID string, localVarOptionals *ProvidersApiConnectwisePatchSettingsOpts) (ConnectWiseSettings, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Patch") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue ConnectWiseSettings + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/integrations/connectwise/{UUID}/settings" + localVarPath = strings.Replace(localVarPath, "{"+"UUID"+"}", fmt.Sprintf("%v", uUID), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + // body params + if localVarOptionals != nil && localVarOptionals.Body.IsSet() { + + localVarOptionalBody:= localVarOptionals.Body.Value() + localVarPostBody = &localVarOptionalBody + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v ConnectWiseSettings + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 400 { + var v ErrorDetails + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 401 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 403 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 404 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 500 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +ProvidersApiService Retrieve ConnectWise Additions +Retrieves a list of ConnectWise additions for the given ConnectWise id and Agreement id. You must be associated to the same provider as the ConnectWise integration to use this endpoint. + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param uUID + * @param agreementID + * @param optional nil or *ProvidersApiConnectwiseRetrieveAdditionsOpts - Optional Parameters: + * @param "Fields" (optional.Interface of []string) - The comma separated fields included in the returned records. If omitted, the default list of fields will be returned. + * @param "Filter" (optional.Interface of []string) - A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` + * @param "Limit" (optional.Int32) - The number of records to return at once. Limited to 100. + * @param "Skip" (optional.Int32) - The offset into the records to return. + * @param "Sort" (optional.Interface of []string) - The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. +@return InlineResponse2008 +*/ + +type ProvidersApiConnectwiseRetrieveAdditionsOpts struct { + Fields optional.Interface + Filter optional.Interface + Limit optional.Int32 + Skip optional.Int32 + Sort optional.Interface +} + +func (a *ProvidersApiService) ConnectwiseRetrieveAdditions(ctx context.Context, uUID string, agreementID string, localVarOptionals *ProvidersApiConnectwiseRetrieveAdditionsOpts) (InlineResponse2008, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue InlineResponse2008 + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/integrations/connectwise/{UUID}/agreements/{agreement_ID}/additions" + localVarPath = strings.Replace(localVarPath, "{"+"UUID"+"}", fmt.Sprintf("%v", uUID), -1) + localVarPath = strings.Replace(localVarPath, "{"+"agreement_ID"+"}", fmt.Sprintf("%v", agreementID), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Fields.IsSet() { + localVarQueryParams.Add("fields", parameterToString(localVarOptionals.Fields.Value(), "csv")) + } + if localVarOptionals != nil && localVarOptionals.Filter.IsSet() { + localVarQueryParams.Add("filter", parameterToString(localVarOptionals.Filter.Value(), "csv")) + } + if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { + localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Skip.IsSet() { + localVarQueryParams.Add("skip", parameterToString(localVarOptionals.Skip.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Sort.IsSet() { + localVarQueryParams.Add("sort", parameterToString(localVarOptionals.Sort.Value(), "csv")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v InlineResponse2008 + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 400 { + var v ErrorDetails + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 401 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 403 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 404 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 500 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +ProvidersApiService Retrieve ConnectWise Agreements +Retrieves a list of ConnectWise agreements for the given ConnectWise id. You must be associated to the same provider as the ConnectWise integration to use this endpoint. + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param uUID + * @param optional nil or *ProvidersApiConnectwiseRetrieveAgreementsOpts - Optional Parameters: + * @param "Fields" (optional.Interface of []string) - The comma separated fields included in the returned records. If omitted, the default list of fields will be returned. + * @param "Filter" (optional.Interface of []string) - A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` + * @param "Limit" (optional.Int32) - The number of records to return at once. Limited to 100. + * @param "Skip" (optional.Int32) - The offset into the records to return. + * @param "Sort" (optional.Interface of []string) - The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. +@return InlineResponse2007 +*/ + +type ProvidersApiConnectwiseRetrieveAgreementsOpts struct { + Fields optional.Interface + Filter optional.Interface + Limit optional.Int32 + Skip optional.Int32 + Sort optional.Interface +} + +func (a *ProvidersApiService) ConnectwiseRetrieveAgreements(ctx context.Context, uUID string, localVarOptionals *ProvidersApiConnectwiseRetrieveAgreementsOpts) (InlineResponse2007, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue InlineResponse2007 + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/integrations/connectwise/{UUID}/agreements" + localVarPath = strings.Replace(localVarPath, "{"+"UUID"+"}", fmt.Sprintf("%v", uUID), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Fields.IsSet() { + localVarQueryParams.Add("fields", parameterToString(localVarOptionals.Fields.Value(), "csv")) + } + if localVarOptionals != nil && localVarOptionals.Filter.IsSet() { + localVarQueryParams.Add("filter", parameterToString(localVarOptionals.Filter.Value(), "csv")) + } + if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { + localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Skip.IsSet() { + localVarQueryParams.Add("skip", parameterToString(localVarOptionals.Skip.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Sort.IsSet() { + localVarQueryParams.Add("sort", parameterToString(localVarOptionals.Sort.Value(), "csv")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v InlineResponse2007 + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 400 { + var v ErrorDetails + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 401 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 403 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 404 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 500 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +ProvidersApiService Get all ConnectWise ticketing alert configuration options for a provider +Get all ConnectWise ticketing alert configuration options for a provider. + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param providerId +@return ConnectWiseTicketingAlertConfigurationOptions +*/ +func (a *ProvidersApiService) ConnectwiseRetrieveAllAlertConfigurationOptions(ctx context.Context, providerId string) (ConnectWiseTicketingAlertConfigurationOptions, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue ConnectWiseTicketingAlertConfigurationOptions + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/providers/{provider_id}/integrations/connectwise/alerts/configuration/options" + localVarPath = strings.Replace(localVarPath, "{"+"provider_id"+"}", fmt.Sprintf("%v", providerId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v ConnectWiseTicketingAlertConfigurationOptions + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 400 { + var v ErrorDetails + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 401 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 403 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 404 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 500 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +ProvidersApiService Get all ConnectWise ticketing alert configurations for a provider +Get all ConnectWise ticketing alert configurations for a provider. + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param providerId +@return ConnectWiseTicketingAlertConfigurationList +*/ +func (a *ProvidersApiService) ConnectwiseRetrieveAllAlertConfigurations(ctx context.Context, providerId string) (ConnectWiseTicketingAlertConfigurationList, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue ConnectWiseTicketingAlertConfigurationList + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/providers/{provider_id}/integrations/connectwise/alerts/configuration" + localVarPath = strings.Replace(localVarPath, "{"+"provider_id"+"}", fmt.Sprintf("%v", providerId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v ConnectWiseTicketingAlertConfigurationList + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 400 { + var v ErrorDetails + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 401 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 403 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 404 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 500 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +ProvidersApiService Retrieve ConnectWise Companies +Retrieves a list of ConnectWise companies for the given ConnectWise id. You must be associated to the same provider as the ConnectWise integration to use this endpoint. + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param uUID + * @param optional nil or *ProvidersApiConnectwiseRetrieveCompaniesOpts - Optional Parameters: + * @param "Fields" (optional.Interface of []string) - The comma separated fields included in the returned records. If omitted, the default list of fields will be returned. + * @param "Filter" (optional.Interface of []string) - A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` + * @param "Limit" (optional.Int32) - The number of records to return at once. Limited to 100. + * @param "Skip" (optional.Int32) - The offset into the records to return. + * @param "Sort" (optional.Interface of []string) - The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. +@return ConnectwiseCompanyResp +*/ + +type ProvidersApiConnectwiseRetrieveCompaniesOpts struct { + Fields optional.Interface + Filter optional.Interface + Limit optional.Int32 + Skip optional.Int32 + Sort optional.Interface +} + +func (a *ProvidersApiService) ConnectwiseRetrieveCompanies(ctx context.Context, uUID string, localVarOptionals *ProvidersApiConnectwiseRetrieveCompaniesOpts) (ConnectwiseCompanyResp, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue ConnectwiseCompanyResp + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/integrations/connectwise/{UUID}/companies" + localVarPath = strings.Replace(localVarPath, "{"+"UUID"+"}", fmt.Sprintf("%v", uUID), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Fields.IsSet() { + localVarQueryParams.Add("fields", parameterToString(localVarOptionals.Fields.Value(), "csv")) + } + if localVarOptionals != nil && localVarOptionals.Filter.IsSet() { + localVarQueryParams.Add("filter", parameterToString(localVarOptionals.Filter.Value(), "csv")) + } + if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { + localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Skip.IsSet() { + localVarQueryParams.Add("skip", parameterToString(localVarOptionals.Skip.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Sort.IsSet() { + localVarQueryParams.Add("sort", parameterToString(localVarOptionals.Sort.Value(), "csv")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v ConnectwiseCompanyResp + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 400 { + var v ErrorDetails + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 401 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 403 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 404 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 500 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +ProvidersApiService Retrieve ConnectWise Company Types +Retrieves a list of user defined company types from ConnectWise for the given ConnectWise id. + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param uUID +@return ConnectwiseCompanyTypeResp +*/ +func (a *ProvidersApiService) ConnectwiseRetrieveCompanyTypes(ctx context.Context, uUID string) (ConnectwiseCompanyTypeResp, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue ConnectwiseCompanyTypeResp + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/integrations/connectwise/{UUID}/companytypes" + localVarPath = strings.Replace(localVarPath, "{"+"UUID"+"}", fmt.Sprintf("%v", uUID), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v ConnectwiseCompanyTypeResp + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 400 { + var v ErrorDetails + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 401 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 403 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 404 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 500 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +ProvidersApiService Retrieve ConnectWise mappings +Retrieves the list of mappings for this ConnectWise integration. You must be associated to the same provider as the ConnectWise integration to use this api. + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param uUID + * @param optional nil or *ProvidersApiConnectwiseRetrieveMappingsOpts - Optional Parameters: + * @param "Fields" (optional.Interface of []string) - The comma separated fields included in the returned records. If omitted, the default list of fields will be returned. + * @param "Filter" (optional.Interface of []string) - A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` + * @param "Limit" (optional.Int32) - The number of records to return at once. Limited to 100. + * @param "Skip" (optional.Int32) - The offset into the records to return. + * @param "Sort" (optional.Interface of []string) - The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. +@return InlineResponse2009 +*/ + +type ProvidersApiConnectwiseRetrieveMappingsOpts struct { + Fields optional.Interface + Filter optional.Interface + Limit optional.Int32 + Skip optional.Int32 + Sort optional.Interface +} + +func (a *ProvidersApiService) ConnectwiseRetrieveMappings(ctx context.Context, uUID string, localVarOptionals *ProvidersApiConnectwiseRetrieveMappingsOpts) (InlineResponse2009, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue InlineResponse2009 + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/integrations/connectwise/{UUID}/mappings" + localVarPath = strings.Replace(localVarPath, "{"+"UUID"+"}", fmt.Sprintf("%v", uUID), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Fields.IsSet() { + localVarQueryParams.Add("fields", parameterToString(localVarOptionals.Fields.Value(), "csv")) + } + if localVarOptionals != nil && localVarOptionals.Filter.IsSet() { + localVarQueryParams.Add("filter", parameterToString(localVarOptionals.Filter.Value(), "csv")) + } + if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { + localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Skip.IsSet() { + localVarQueryParams.Add("skip", parameterToString(localVarOptionals.Skip.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Sort.IsSet() { + localVarQueryParams.Add("sort", parameterToString(localVarOptionals.Sort.Value(), "csv")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v InlineResponse2009 + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 400 { + var v ErrorDetails + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 401 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 403 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 404 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 500 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +ProvidersApiService Retrieve ConnectWise Integration settings +Retrieve the ConnectWise integration settings. You must be associated to the same provider as the ConnectWise integration to use this endpoint. + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param uUID +@return ConnectWiseSettings +*/ +func (a *ProvidersApiService) ConnectwiseRetrieveSettings(ctx context.Context, uUID string) (ConnectWiseSettings, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue ConnectWiseSettings + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/integrations/connectwise/{UUID}/settings" + localVarPath = strings.Replace(localVarPath, "{"+"UUID"+"}", fmt.Sprintf("%v", uUID), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v ConnectWiseSettings + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 400 { + var v ErrorDetails + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 401 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 403 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 404 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 500 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +ProvidersApiService Update a ConnectWise ticketing alert's configuration +Update a ConnectWise ticketing alert's configuration. + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param providerId + * @param alertUUID + * @param optional nil or *ProvidersApiConnectwiseUpdateAlertConfigurationOpts - Optional Parameters: + * @param "Body" (optional.Interface of ConnectWiseTicketingAlertConfigurationRequest) - +@return ConnectWiseTicketingAlertConfiguration +*/ + +type ProvidersApiConnectwiseUpdateAlertConfigurationOpts struct { + Body optional.Interface +} + +func (a *ProvidersApiService) ConnectwiseUpdateAlertConfiguration(ctx context.Context, providerId string, alertUUID string, localVarOptionals *ProvidersApiConnectwiseUpdateAlertConfigurationOpts) (ConnectWiseTicketingAlertConfiguration, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Put") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue ConnectWiseTicketingAlertConfiguration + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/providers/{provider_id}/integrations/connectwise/alerts/{alert_UUID}/configuration" + localVarPath = strings.Replace(localVarPath, "{"+"provider_id"+"}", fmt.Sprintf("%v", providerId), -1) + localVarPath = strings.Replace(localVarPath, "{"+"alert_UUID"+"}", fmt.Sprintf("%v", alertUUID), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + // body params + if localVarOptionals != nil && localVarOptionals.Body.IsSet() { + + localVarOptionalBody:= localVarOptionals.Body.Value() + localVarPostBody = &localVarOptionalBody + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v ConnectWiseTicketingAlertConfiguration + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 400 { + var v ErrorDetails + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 401 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 403 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 404 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 500 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +ProvidersApiService Update ConnectWise Integration configuration +Update the ConnectWise integration configuration. A 422 Unprocessable Entity response means the server failed to validate with ConnectWise. + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param uUID + * @param optional nil or *ProvidersApiConnectwiseUpdateConfigurationOpts - Optional Parameters: + * @param "Body" (optional.Interface of ConnectwiseIntegrationPatchReq) - +@return ConnectwiseIntegration +*/ + +type ProvidersApiConnectwiseUpdateConfigurationOpts struct { + Body optional.Interface +} + +func (a *ProvidersApiService) ConnectwiseUpdateConfiguration(ctx context.Context, uUID string, localVarOptionals *ProvidersApiConnectwiseUpdateConfigurationOpts) (ConnectwiseIntegration, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Patch") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue ConnectwiseIntegration + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/integrations/connectwise/{UUID}" + localVarPath = strings.Replace(localVarPath, "{"+"UUID"+"}", fmt.Sprintf("%v", uUID), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + // body params + if localVarOptionals != nil && localVarOptionals.Body.IsSet() { + + localVarOptionalBody:= localVarOptionals.Body.Value() + localVarPostBody = &localVarOptionalBody + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v ConnectwiseIntegration + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 400 { + var v ErrorDetails + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 401 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 403 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 404 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 422 { + var v interface{} + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 500 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +ProvidersApiService Get all ticketing alerts available for a provider's ticketing integration. +Get all ticketing alerts available for a provider's ticketing integration. + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param providerId +@return TicketingIntegrationAlertsResp +*/ +func (a *ProvidersApiService) MtpIntegrationRetrieveAlerts(ctx context.Context, providerId string) (TicketingIntegrationAlertsResp, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue TicketingIntegrationAlertsResp + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/providers/{provider_id}/integrations/ticketing/alerts" + localVarPath = strings.Replace(localVarPath, "{"+"provider_id"+"}", fmt.Sprintf("%v", providerId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v TicketingIntegrationAlertsResp + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 400 { + var v ErrorDetails + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 401 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 403 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 404 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 500 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +ProvidersApiService Retrieve Recent Integration Sync Errors +Retrieves recent sync errors for given integration type and integration id. You must be associated to the provider the integration is tied to in order to use this api. + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param uUID + * @param integrationType +@return IntegrationSyncErrorResp +*/ +func (a *ProvidersApiService) MtpIntegrationRetrieveSyncErrors(ctx context.Context, uUID string, integrationType string) (IntegrationSyncErrorResp, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue IntegrationSyncErrorResp + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/integrations/{integration_type}/{UUID}/errors" + localVarPath = strings.Replace(localVarPath, "{"+"UUID"+"}", fmt.Sprintf("%v", uUID), -1) + localVarPath = strings.Replace(localVarPath, "{"+"integration_type"+"}", fmt.Sprintf("%v", integrationType), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v IntegrationSyncErrorResp + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 400 { + var v ErrorDetails + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 401 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 403 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 404 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 500 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +ProvidersApiService Update Provider Organization +This endpoint updates a provider's organization + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param providerId + * @param id + * @param optional nil or *ProvidersApiProviderOrganizationsUpdateOrgOpts - Optional Parameters: + * @param "Body" (optional.Interface of Organization) - +@return Organization +*/ + +type ProvidersApiProviderOrganizationsUpdateOrgOpts struct { + Body optional.Interface +} + +func (a *ProvidersApiService) ProviderOrganizationsUpdateOrg(ctx context.Context, providerId string, id string, localVarOptionals *ProvidersApiProviderOrganizationsUpdateOrgOpts) (Organization, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Put") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue Organization + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/providers/{provider_id}/organizations/{id}" + localVarPath = strings.Replace(localVarPath, "{"+"provider_id"+"}", fmt.Sprintf("%v", providerId), -1) + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + // body params + if localVarOptionals != nil && localVarOptionals.Body.IsSet() { + + localVarOptionalBody:= localVarOptionals.Body.Value() + localVarPostBody = &localVarOptionalBody + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v Organization + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +ProvidersApiService Retrieve Provider +This endpoint returns details about a provider + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param providerId + * @param optional nil or *ProvidersApiProvidersGetProviderOpts - Optional Parameters: + * @param "Fields" (optional.Interface of []string) - The comma separated fields included in the returned records. If omitted, the default list of fields will be returned. +@return Provider +*/ + +type ProvidersApiProvidersGetProviderOpts struct { + Fields optional.Interface +} + +func (a *ProvidersApiService) ProvidersGetProvider(ctx context.Context, providerId string, localVarOptionals *ProvidersApiProvidersGetProviderOpts) (Provider, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue Provider + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/providers/{provider_id}" + localVarPath = strings.Replace(localVarPath, "{"+"provider_id"+"}", fmt.Sprintf("%v", providerId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Fields.IsSet() { + localVarQueryParams.Add("fields", parameterToString(localVarOptionals.Fields.Value(), "csv")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v Provider + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 400 { + var v ErrorDetails + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 401 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 403 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 404 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 500 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +ProvidersApiService List Provider Administrators +This endpoint returns a list of the Administrators associated with the Provider. You must be associated with the provider to use this route. + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param providerId + * @param optional nil or *ProvidersApiProvidersListAdministratorsOpts - Optional Parameters: + * @param "Fields" (optional.Interface of []string) - The comma separated fields included in the returned records. If omitted, the default list of fields will be returned. + * @param "Filter" (optional.Interface of []string) - A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` + * @param "Limit" (optional.Int32) - The number of records to return at once. Limited to 100. + * @param "Skip" (optional.Int32) - The offset into the records to return. + * @param "Sort" (optional.Interface of []string) - The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. +@return InlineResponse20012 +*/ + +type ProvidersApiProvidersListAdministratorsOpts struct { + Fields optional.Interface + Filter optional.Interface + Limit optional.Int32 + Skip optional.Int32 + Sort optional.Interface +} + +func (a *ProvidersApiService) ProvidersListAdministrators(ctx context.Context, providerId string, localVarOptionals *ProvidersApiProvidersListAdministratorsOpts) (InlineResponse20012, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue InlineResponse20012 + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/providers/{provider_id}/administrators" + localVarPath = strings.Replace(localVarPath, "{"+"provider_id"+"}", fmt.Sprintf("%v", providerId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Fields.IsSet() { + localVarQueryParams.Add("fields", parameterToString(localVarOptionals.Fields.Value(), "csv")) + } + if localVarOptionals != nil && localVarOptionals.Filter.IsSet() { + localVarQueryParams.Add("filter", parameterToString(localVarOptionals.Filter.Value(), "csv")) + } + if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { + localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Skip.IsSet() { + localVarQueryParams.Add("skip", parameterToString(localVarOptionals.Skip.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Sort.IsSet() { + localVarQueryParams.Add("sort", parameterToString(localVarOptionals.Sort.Value(), "csv")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v InlineResponse20012 + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 401 { + var v InlineResponse400 + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +ProvidersApiService List Provider Organizations +This endpoint returns a list of the Organizations associated with the Provider. You must be associated with the provider to use this route. + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param providerId + * @param optional nil or *ProvidersApiProvidersListOrganizationsOpts - Optional Parameters: + * @param "Fields" (optional.Interface of []string) - The comma separated fields included in the returned records. If omitted, the default list of fields will be returned. + * @param "Filter" (optional.Interface of []string) - A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` + * @param "Limit" (optional.Int32) - The number of records to return at once. Limited to 100. + * @param "Skip" (optional.Int32) - The offset into the records to return. + * @param "Sort" (optional.Interface of []string) - The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. +@return InlineResponse20013 +*/ + +type ProvidersApiProvidersListOrganizationsOpts struct { + Fields optional.Interface + Filter optional.Interface + Limit optional.Int32 + Skip optional.Int32 + Sort optional.Interface +} + +func (a *ProvidersApiService) ProvidersListOrganizations(ctx context.Context, providerId string, localVarOptionals *ProvidersApiProvidersListOrganizationsOpts) (InlineResponse20013, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue InlineResponse20013 + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/providers/{provider_id}/organizations" + localVarPath = strings.Replace(localVarPath, "{"+"provider_id"+"}", fmt.Sprintf("%v", providerId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Fields.IsSet() { + localVarQueryParams.Add("fields", parameterToString(localVarOptionals.Fields.Value(), "csv")) + } + if localVarOptionals != nil && localVarOptionals.Filter.IsSet() { + localVarQueryParams.Add("filter", parameterToString(localVarOptionals.Filter.Value(), "csv")) + } + if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { + localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Skip.IsSet() { + localVarQueryParams.Add("skip", parameterToString(localVarOptionals.Skip.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Sort.IsSet() { + localVarQueryParams.Add("sort", parameterToString(localVarOptionals.Sort.Value(), "csv")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v InlineResponse20013 + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 400 { + var v ErrorDetails + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 401 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 403 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 404 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 500 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +ProvidersApiService Create a new Provider Administrator +This endpoint allows you to create a provider administrator. You must be associated with the provider to use this route. You must provide either `role` or `roleName`. + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param providerId + * @param optional nil or *ProvidersApiProvidersPostAdminsOpts - Optional Parameters: + * @param "Body" (optional.Interface of ProviderAdminReq) - +@return Administrator +*/ + +type ProvidersApiProvidersPostAdminsOpts struct { + Body optional.Interface +} + +func (a *ProvidersApiService) ProvidersPostAdmins(ctx context.Context, providerId string, localVarOptionals *ProvidersApiProvidersPostAdminsOpts) (Administrator, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Post") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue Administrator + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/providers/{provider_id}/administrators" + localVarPath = strings.Replace(localVarPath, "{"+"provider_id"+"}", fmt.Sprintf("%v", providerId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + // body params + if localVarOptionals != nil && localVarOptionals.Body.IsSet() { + + localVarOptionalBody:= localVarOptionals.Body.Value() + localVarPostBody = &localVarOptionalBody + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v Administrator + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 401 { + var v InlineResponse400 + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +ProvidersApiService Delete Provider Administrator +This endpoint removes an Administrator associated with the Provider. You must be associated with the provider to use this route. + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param providerId + * @param id + +*/ +func (a *ProvidersApiService) ProvidersRemoveAdministrator(ctx context.Context, providerId string, id string) (*http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Delete") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/providers/{provider_id}/administrators/{id}" + localVarPath = strings.Replace(localVarPath, "{"+"provider_id"+"}", fmt.Sprintf("%v", providerId), -1) + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarHttpResponse, err + } + + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 400 { + var v ErrorDetails + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarHttpResponse, newErr + } + newErr.model = v + return localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 401 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarHttpResponse, newErr + } + newErr.model = v + return localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 403 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarHttpResponse, newErr + } + newErr.model = v + return localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 404 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarHttpResponse, newErr + } + newErr.model = v + return localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 500 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarHttpResponse, newErr + } + newErr.model = v + return localVarHttpResponse, newErr + } + return localVarHttpResponse, newErr + } + + return localVarHttpResponse, nil +} +/* +ProvidersApiService Retrieve Integrations for Provider +Retrieves a list of integrations this provider has configured. You must be associated to the provider to use this endpoint. + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param providerId + * @param optional nil or *ProvidersApiProvidersRetrieveIntegrationsOpts - Optional Parameters: + * @param "Filter" (optional.Interface of []string) - A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` + * @param "Limit" (optional.Int32) - The number of records to return at once. Limited to 100. + * @param "Skip" (optional.Int32) - The offset into the records to return. + * @param "Sort" (optional.Interface of []string) - The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. +@return IntegrationsResponse +*/ + +type ProvidersApiProvidersRetrieveIntegrationsOpts struct { + Filter optional.Interface + Limit optional.Int32 + Skip optional.Int32 + Sort optional.Interface +} + +func (a *ProvidersApiService) ProvidersRetrieveIntegrations(ctx context.Context, providerId string, localVarOptionals *ProvidersApiProvidersRetrieveIntegrationsOpts) (IntegrationsResponse, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue IntegrationsResponse + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/providers/{provider_id}/integrations" + localVarPath = strings.Replace(localVarPath, "{"+"provider_id"+"}", fmt.Sprintf("%v", providerId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Filter.IsSet() { + localVarQueryParams.Add("filter", parameterToString(localVarOptionals.Filter.Value(), "csv")) + } + if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { + localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Skip.IsSet() { + localVarQueryParams.Add("skip", parameterToString(localVarOptionals.Skip.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Sort.IsSet() { + localVarQueryParams.Add("sort", parameterToString(localVarOptionals.Sort.Value(), "csv")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v IntegrationsResponse + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 400 { + var v ErrorDetails + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 401 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 403 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 404 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 500 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +ProvidersApiService Download a provider's invoice. +Retrieves an invoice for this provider. You must be associated to the provider to use this endpoint. + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param providerId + * @param iD +@return *os.File +*/ +func (a *ProvidersApiService) ProvidersRetrieveInvoice(ctx context.Context, providerId string, iD string) (*os.File, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue *os.File + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/providers/{provider_id}/invoices/{ID}" + localVarPath = strings.Replace(localVarPath, "{"+"provider_id"+"}", fmt.Sprintf("%v", providerId), -1) + localVarPath = strings.Replace(localVarPath, "{"+"ID"+"}", fmt.Sprintf("%v", iD), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/pdf"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v *os.File + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 400 { + var v ErrorDetails + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 401 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 403 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 404 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 500 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +ProvidersApiService List a provider's invoices. +Retrieves a list of invoices for this provider. You must be associated to the provider to use this endpoint. + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param providerId + * @param optional nil or *ProvidersApiProvidersRetrieveInvoicesOpts - Optional Parameters: + * @param "Skip" (optional.Int32) - The offset into the records to return. + * @param "Sort" (optional.Interface of []string) - The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. + * @param "Limit" (optional.Int32) - The number of records to return at once. Limited to 100. +@return ProviderInvoiceResponse +*/ + +type ProvidersApiProvidersRetrieveInvoicesOpts struct { + Skip optional.Int32 + Sort optional.Interface + Limit optional.Int32 +} + +func (a *ProvidersApiService) ProvidersRetrieveInvoices(ctx context.Context, providerId string, localVarOptionals *ProvidersApiProvidersRetrieveInvoicesOpts) (ProviderInvoiceResponse, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue ProviderInvoiceResponse + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/providers/{provider_id}/invoices" + localVarPath = strings.Replace(localVarPath, "{"+"provider_id"+"}", fmt.Sprintf("%v", providerId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Skip.IsSet() { + localVarQueryParams.Add("skip", parameterToString(localVarOptionals.Skip.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Sort.IsSet() { + localVarQueryParams.Add("sort", parameterToString(localVarOptionals.Sort.Value(), "csv")) + } + if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { + localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v ProviderInvoiceResponse + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 400 { + var v ErrorDetails + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 401 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 403 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 404 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 500 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} diff --git a/jcapiv2/api_radius_servers.go b/jcapiv2/api_radius_servers.go new file mode 100644 index 0000000..b3846f6 --- /dev/null +++ b/jcapiv2/api_radius_servers.go @@ -0,0 +1,493 @@ + +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +import ( + "context" + "io/ioutil" + "net/http" + "net/url" + "strings" + "fmt" + "github.com/antihax/optional" +) + +// Linger please +var ( + _ context.Context +) + +type RADIUSServersApiService service +/* +RADIUSServersApiService List the associations of a RADIUS Server +This endpoint returns the _direct_ associations of a Radius Server. A direct association can be a non-homogeneous relationship between 2 different objects, for example Radius Servers and Users. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/radiusservers/{RADIUS_ID}/associations?targets=user_group \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param radiusserverId ObjectID of the Radius Server. + * @param targets Targets which a \"radius_server\" can be associated to. + * @param optional nil or *RADIUSServersApiGraphRadiusServerAssociationsListOpts - Optional Parameters: + * @param "Limit" (optional.Int32) - The number of records to return at once. Limited to 100. + * @param "Skip" (optional.Int32) - The offset into the records to return. + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. +@return []GraphConnection +*/ + +type RADIUSServersApiGraphRadiusServerAssociationsListOpts struct { + Limit optional.Int32 + Skip optional.Int32 + XOrgId optional.String +} + +func (a *RADIUSServersApiService) GraphRadiusServerAssociationsList(ctx context.Context, radiusserverId string, targets []string, localVarOptionals *RADIUSServersApiGraphRadiusServerAssociationsListOpts) ([]GraphConnection, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []GraphConnection + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/radiusservers/{radiusserver_id}/associations" + localVarPath = strings.Replace(localVarPath, "{"+"radiusserver_id"+"}", fmt.Sprintf("%v", radiusserverId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + localVarQueryParams.Add("targets", parameterToString(targets, "csv")) + if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { + localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Skip.IsSet() { + localVarQueryParams.Add("skip", parameterToString(localVarOptionals.Skip.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v []GraphConnection + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +RADIUSServersApiService Manage the associations of a RADIUS Server +This endpoint allows you to manage the _direct_ associations of a Radius Server. A direct association can be a non-homogeneous relationship between 2 different objects, for example Radius Servers and Users. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/radiusservers/{RADIUS_ID}/associations \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"type\":\"user\", \"id\":\"{USER_ID}\", \"op\":\"add\" }' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param radiusserverId ObjectID of the Radius Server. + * @param optional nil or *RADIUSServersApiGraphRadiusServerAssociationsPostOpts - Optional Parameters: + * @param "Body" (optional.Interface of GraphOperationRadiusServer) - + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. + +*/ + +type RADIUSServersApiGraphRadiusServerAssociationsPostOpts struct { + Body optional.Interface + XOrgId optional.String +} + +func (a *RADIUSServersApiService) GraphRadiusServerAssociationsPost(ctx context.Context, radiusserverId string, localVarOptionals *RADIUSServersApiGraphRadiusServerAssociationsPostOpts) (*http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Post") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/radiusservers/{radiusserver_id}/associations" + localVarPath = strings.Replace(localVarPath, "{"+"radiusserver_id"+"}", fmt.Sprintf("%v", radiusserverId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + // body params + if localVarOptionals != nil && localVarOptionals.Body.IsSet() { + + localVarOptionalBody:= localVarOptionals.Body.Value() + localVarPostBody = &localVarOptionalBody + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarHttpResponse, err + } + + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + return localVarHttpResponse, newErr + } + + return localVarHttpResponse, nil +} +/* +RADIUSServersApiService List the Users bound to a RADIUS Server +This endpoint will return all Users bound to a RADIUS Server, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this RADIUS server instance to the corresponding User; this array represents all grouping and/or associations that would have to be removed to deprovision the User from this RADIUS server instance. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/ldapservers/{LDAP_ID}/users \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param radiusserverId ObjectID of the Radius Server. + * @param optional nil or *RADIUSServersApiGraphRadiusServerTraverseUserOpts - Optional Parameters: + * @param "Limit" (optional.Int32) - The number of records to return at once. Limited to 100. + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. + * @param "Skip" (optional.Int32) - The offset into the records to return. + * @param "Filter" (optional.Interface of []string) - A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` +@return []GraphObjectWithPaths +*/ + +type RADIUSServersApiGraphRadiusServerTraverseUserOpts struct { + Limit optional.Int32 + XOrgId optional.String + Skip optional.Int32 + Filter optional.Interface +} + +func (a *RADIUSServersApiService) GraphRadiusServerTraverseUser(ctx context.Context, radiusserverId string, localVarOptionals *RADIUSServersApiGraphRadiusServerTraverseUserOpts) ([]GraphObjectWithPaths, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []GraphObjectWithPaths + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/radiusservers/{radiusserver_id}/users" + localVarPath = strings.Replace(localVarPath, "{"+"radiusserver_id"+"}", fmt.Sprintf("%v", radiusserverId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { + localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Skip.IsSet() { + localVarQueryParams.Add("skip", parameterToString(localVarOptionals.Skip.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Filter.IsSet() { + localVarQueryParams.Add("filter", parameterToString(localVarOptionals.Filter.Value(), "csv")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v []GraphObjectWithPaths + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +RADIUSServersApiService List the User Groups bound to a RADIUS Server +This endpoint will return all Users Groups bound to a RADIUS Server, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the group's type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this RADIUS server instance to the corresponding User Group; this array represents all grouping and/or associations that would have to be removed to deprovision the User Group from this RADIUS server instance. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/radiusservers/{RADIUS_ID}/usergroups \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param radiusserverId ObjectID of the Radius Server. + * @param optional nil or *RADIUSServersApiGraphRadiusServerTraverseUserGroupOpts - Optional Parameters: + * @param "Limit" (optional.Int32) - The number of records to return at once. Limited to 100. + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. + * @param "Skip" (optional.Int32) - The offset into the records to return. + * @param "Filter" (optional.Interface of []string) - A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` +@return []GraphObjectWithPaths +*/ + +type RADIUSServersApiGraphRadiusServerTraverseUserGroupOpts struct { + Limit optional.Int32 + XOrgId optional.String + Skip optional.Int32 + Filter optional.Interface +} + +func (a *RADIUSServersApiService) GraphRadiusServerTraverseUserGroup(ctx context.Context, radiusserverId string, localVarOptionals *RADIUSServersApiGraphRadiusServerTraverseUserGroupOpts) ([]GraphObjectWithPaths, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []GraphObjectWithPaths + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/radiusservers/{radiusserver_id}/usergroups" + localVarPath = strings.Replace(localVarPath, "{"+"radiusserver_id"+"}", fmt.Sprintf("%v", radiusserverId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { + localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Skip.IsSet() { + localVarQueryParams.Add("skip", parameterToString(localVarOptionals.Skip.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Filter.IsSet() { + localVarQueryParams.Add("filter", parameterToString(localVarOptionals.Filter.Value(), "csv")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v []GraphObjectWithPaths + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} diff --git a/jcapiv2/api_samba_domains.go b/jcapiv2/api_samba_domains.go new file mode 100644 index 0000000..33b9723 --- /dev/null +++ b/jcapiv2/api_samba_domains.go @@ -0,0 +1,620 @@ + +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +import ( + "context" + "io/ioutil" + "net/http" + "net/url" + "strings" + "fmt" + "github.com/antihax/optional" +) + +// Linger please +var ( + _ context.Context +) + +type SambaDomainsApiService service +/* +SambaDomainsApiService Delete Samba Domain +This endpoint allows you to delete a samba domain from an LDAP server. ##### Sample Request ``` curl -X DELETE https://console.jumpcloud.com/api/v2/ldapservers/{LDAP_ID}/sambadomains/{SAMBA_ID} \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param ldapserverId Unique identifier of the LDAP server. + * @param id Unique identifier of the samba domain. + * @param optional nil or *SambaDomainsApiLdapserversSambaDomainsDeleteOpts - Optional Parameters: + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. +@return string +*/ + +type SambaDomainsApiLdapserversSambaDomainsDeleteOpts struct { + XOrgId optional.String +} + +func (a *SambaDomainsApiService) LdapserversSambaDomainsDelete(ctx context.Context, ldapserverId string, id string, localVarOptionals *SambaDomainsApiLdapserversSambaDomainsDeleteOpts) (string, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Delete") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue string + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/ldapservers/{ldapserver_id}/sambadomains/{id}" + localVarPath = strings.Replace(localVarPath, "{"+"ldapserver_id"+"}", fmt.Sprintf("%v", ldapserverId), -1) + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v string + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +SambaDomainsApiService Get Samba Domain +This endpoint returns a specific samba domain for an LDAP server. ##### Sample Request ``` curl -X GET \\ https://console.jumpcloud.com/api/v2/ldapservers/ldapservers/{LDAP_ID}/sambadomains/{SAMBA_ID} \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param ldapserverId Unique identifier of the LDAP server. + * @param id Unique identifier of the samba domain. + * @param optional nil or *SambaDomainsApiLdapserversSambaDomainsGetOpts - Optional Parameters: + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. +@return SambaDomainOutput +*/ + +type SambaDomainsApiLdapserversSambaDomainsGetOpts struct { + XOrgId optional.String +} + +func (a *SambaDomainsApiService) LdapserversSambaDomainsGet(ctx context.Context, ldapserverId string, id string, localVarOptionals *SambaDomainsApiLdapserversSambaDomainsGetOpts) (SambaDomainOutput, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue SambaDomainOutput + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/ldapservers/{ldapserver_id}/sambadomains/{id}" + localVarPath = strings.Replace(localVarPath, "{"+"ldapserver_id"+"}", fmt.Sprintf("%v", ldapserverId), -1) + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v SambaDomainOutput + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +SambaDomainsApiService List Samba Domains +This endpoint returns all samba domains for an LDAP server. ##### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/ldapservers/{LDAP_ID}/sambadomains \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param ldapserverId Unique identifier of the LDAP server. + * @param optional nil or *SambaDomainsApiLdapserversSambaDomainsListOpts - Optional Parameters: + * @param "Fields" (optional.Interface of []string) - The comma separated fields included in the returned records. If omitted, the default list of fields will be returned. + * @param "Filter" (optional.Interface of []string) - A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` + * @param "Limit" (optional.Int32) - The number of records to return at once. Limited to 100. + * @param "Skip" (optional.Int32) - The offset into the records to return. + * @param "Sort" (optional.Interface of []string) - The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. +@return []SambaDomainOutput +*/ + +type SambaDomainsApiLdapserversSambaDomainsListOpts struct { + Fields optional.Interface + Filter optional.Interface + Limit optional.Int32 + Skip optional.Int32 + Sort optional.Interface + XOrgId optional.String +} + +func (a *SambaDomainsApiService) LdapserversSambaDomainsList(ctx context.Context, ldapserverId string, localVarOptionals *SambaDomainsApiLdapserversSambaDomainsListOpts) ([]SambaDomainOutput, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []SambaDomainOutput + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/ldapservers/{ldapserver_id}/sambadomains" + localVarPath = strings.Replace(localVarPath, "{"+"ldapserver_id"+"}", fmt.Sprintf("%v", ldapserverId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Fields.IsSet() { + localVarQueryParams.Add("fields", parameterToString(localVarOptionals.Fields.Value(), "csv")) + } + if localVarOptionals != nil && localVarOptionals.Filter.IsSet() { + localVarQueryParams.Add("filter", parameterToString(localVarOptionals.Filter.Value(), "csv")) + } + if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { + localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Skip.IsSet() { + localVarQueryParams.Add("skip", parameterToString(localVarOptionals.Skip.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Sort.IsSet() { + localVarQueryParams.Add("sort", parameterToString(localVarOptionals.Sort.Value(), "csv")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v []SambaDomainOutput + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 0 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +SambaDomainsApiService Create Samba Domain +This endpoint allows you to create a samba domain for an LDAP server. ##### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/ldapservers/{LDAP_ID}/sambadomains \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"sid\":\"{SID_ID}\", \"name\":\"{WORKGROUP_NAME}\" }' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param ldapserverId Unique identifier of the LDAP server. + * @param optional nil or *SambaDomainsApiLdapserversSambaDomainsPostOpts - Optional Parameters: + * @param "Body" (optional.Interface of SambaDomainInput) - + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. +@return SambaDomainOutput +*/ + +type SambaDomainsApiLdapserversSambaDomainsPostOpts struct { + Body optional.Interface + XOrgId optional.String +} + +func (a *SambaDomainsApiService) LdapserversSambaDomainsPost(ctx context.Context, ldapserverId string, localVarOptionals *SambaDomainsApiLdapserversSambaDomainsPostOpts) (SambaDomainOutput, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Post") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue SambaDomainOutput + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/ldapservers/{ldapserver_id}/sambadomains" + localVarPath = strings.Replace(localVarPath, "{"+"ldapserver_id"+"}", fmt.Sprintf("%v", ldapserverId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + // body params + if localVarOptionals != nil && localVarOptionals.Body.IsSet() { + + localVarOptionalBody:= localVarOptionals.Body.Value() + localVarPostBody = &localVarOptionalBody + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 201 { + var v SambaDomainOutput + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +SambaDomainsApiService Update Samba Domain +This endpoint allows you to update the samba domain information for an LDAP server. ##### Sample Request ``` curl -X PUT https://console.jumpcloud.com/api/v2/ldapservers/{LDAP_ID}/sambadomains/{SAMBA_ID} \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"sid\":\"{SID_ID}\", \"name\":\"{WORKGROUP_NAME}\" }' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param ldapserverId Unique identifier of the LDAP server. + * @param id Unique identifier of the samba domain. + * @param optional nil or *SambaDomainsApiLdapserversSambaDomainsPutOpts - Optional Parameters: + * @param "Body" (optional.Interface of SambaDomainInput) - +@return SambaDomainOutput +*/ + +type SambaDomainsApiLdapserversSambaDomainsPutOpts struct { + Body optional.Interface +} + +func (a *SambaDomainsApiService) LdapserversSambaDomainsPut(ctx context.Context, ldapserverId string, id string, localVarOptionals *SambaDomainsApiLdapserversSambaDomainsPutOpts) (SambaDomainOutput, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Put") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue SambaDomainOutput + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/ldapservers/{ldapserver_id}/sambadomains/{id}" + localVarPath = strings.Replace(localVarPath, "{"+"ldapserver_id"+"}", fmt.Sprintf("%v", ldapserverId), -1) + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + // body params + if localVarOptionals != nil && localVarOptionals.Body.IsSet() { + + localVarOptionalBody:= localVarOptionals.Body.Value() + localVarPostBody = &localVarOptionalBody + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v SambaDomainOutput + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} diff --git a/jcapiv2/api_scim_import.go b/jcapiv2/api_scim_import.go new file mode 100644 index 0000000..d029858 --- /dev/null +++ b/jcapiv2/api_scim_import.go @@ -0,0 +1,166 @@ + +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +import ( + "context" + "io/ioutil" + "net/http" + "net/url" + "strings" + "fmt" + "github.com/antihax/optional" +) + +// Linger please +var ( + _ context.Context +) + +type SCIMImportApiService service +/* +SCIMImportApiService Get a list of users to import from an Application IdM service provider +Get a list of users to import from an Application IdM service provider. + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param applicationId ObjectID of the Application. + * @param optional nil or *SCIMImportApiImportUsersOpts - Optional Parameters: + * @param "Filter" (optional.String) - Filter users by a search term + * @param "Query" (optional.String) - URL query to merge with the service provider request + * @param "Sort" (optional.String) - Sort users by supported fields + * @param "SortOrder" (optional.String) - + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. + * @param "Limit" (optional.Int32) - The number of records to return at once. Limited to 100. + * @param "Skip" (optional.Int32) - The offset into the records to return. +@return ImportUsersResponse +*/ + +type SCIMImportApiImportUsersOpts struct { + Filter optional.String + Query optional.String + Sort optional.String + SortOrder optional.String + XOrgId optional.String + Limit optional.Int32 + Skip optional.Int32 +} + +func (a *SCIMImportApiService) ImportUsers(ctx context.Context, applicationId string, localVarOptionals *SCIMImportApiImportUsersOpts) (ImportUsersResponse, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue ImportUsersResponse + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/applications/{application_id}/import/users" + localVarPath = strings.Replace(localVarPath, "{"+"application_id"+"}", fmt.Sprintf("%v", applicationId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Filter.IsSet() { + localVarQueryParams.Add("filter", parameterToString(localVarOptionals.Filter.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Query.IsSet() { + localVarQueryParams.Add("query", parameterToString(localVarOptionals.Query.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Sort.IsSet() { + localVarQueryParams.Add("sort", parameterToString(localVarOptionals.Sort.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.SortOrder.IsSet() { + localVarQueryParams.Add("sortOrder", parameterToString(localVarOptionals.SortOrder.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { + localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Skip.IsSet() { + localVarQueryParams.Add("skip", parameterToString(localVarOptionals.Skip.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v ImportUsersResponse + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} diff --git a/jcapiv2/api_software_apps.go b/jcapiv2/api_software_apps.go new file mode 100644 index 0000000..4156658 --- /dev/null +++ b/jcapiv2/api_software_apps.go @@ -0,0 +1,1538 @@ + +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +import ( + "context" + "io/ioutil" + "net/http" + "net/url" + "strings" + "fmt" + "github.com/antihax/optional" +) + +// Linger please +var ( + _ context.Context +) + +type SoftwareAppsApiService service +/* +SoftwareAppsApiService List the associations of a Software Application +This endpoint will return the _direct_ associations of a Software Application. A direct association can be a non-homogeneous relationship between 2 different objects, for example Software Application and System Groups. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/softwareapps/{software_app_id}/associations?targets=system_group \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param softwareAppId ObjectID of the Software App. + * @param targets Targets which a \"software_app\" can be associated to. + * @param optional nil or *SoftwareAppsApiGraphSoftwareappsAssociationsListOpts - Optional Parameters: + * @param "Limit" (optional.Int32) - The number of records to return at once. Limited to 100. + * @param "Skip" (optional.Int32) - The offset into the records to return. + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. +@return []GraphConnection +*/ + +type SoftwareAppsApiGraphSoftwareappsAssociationsListOpts struct { + Limit optional.Int32 + Skip optional.Int32 + XOrgId optional.String +} + +func (a *SoftwareAppsApiService) GraphSoftwareappsAssociationsList(ctx context.Context, softwareAppId string, targets []string, localVarOptionals *SoftwareAppsApiGraphSoftwareappsAssociationsListOpts) ([]GraphConnection, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []GraphConnection + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/softwareapps/{software_app_id}/associations" + localVarPath = strings.Replace(localVarPath, "{"+"software_app_id"+"}", fmt.Sprintf("%v", softwareAppId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + localVarQueryParams.Add("targets", parameterToString(targets, "csv")) + if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { + localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Skip.IsSet() { + localVarQueryParams.Add("skip", parameterToString(localVarOptionals.Skip.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v []GraphConnection + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +SoftwareAppsApiService Manage the associations of a software application. +This endpoint allows you to associate or disassociate a software application to a system or system group. #### Sample Request ``` $ curl -X POST https://console.jumpcloud.com/api/v2/softwareapps/{software_app_id}/associations \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"id\": \"<object_id>\", \"op\": \"add\", \"type\": \"system\" }' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param softwareAppId ObjectID of the Software App. + * @param optional nil or *SoftwareAppsApiGraphSoftwareappsAssociationsPostOpts - Optional Parameters: + * @param "Body" (optional.Interface of GraphOperationSoftwareApp) - + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. + +*/ + +type SoftwareAppsApiGraphSoftwareappsAssociationsPostOpts struct { + Body optional.Interface + XOrgId optional.String +} + +func (a *SoftwareAppsApiService) GraphSoftwareappsAssociationsPost(ctx context.Context, softwareAppId string, localVarOptionals *SoftwareAppsApiGraphSoftwareappsAssociationsPostOpts) (*http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Post") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/softwareapps/{software_app_id}/associations" + localVarPath = strings.Replace(localVarPath, "{"+"software_app_id"+"}", fmt.Sprintf("%v", softwareAppId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + // body params + if localVarOptionals != nil && localVarOptionals.Body.IsSet() { + + localVarOptionalBody:= localVarOptionals.Body.Value() + localVarPostBody = &localVarOptionalBody + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarHttpResponse, err + } + + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + return localVarHttpResponse, newErr + } + + return localVarHttpResponse, nil +} +/* +SoftwareAppsApiService List the Systems bound to a Software App. +This endpoint will return all Systems bound to a Software App, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this Software App to the corresponding System; this array represents all grouping and/or associations that would have to be removed to deprovision the System from this Software App. See `/associations` endpoint to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/softwareapps/{software_app_id}/systems \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param softwareAppId ObjectID of the Software App. + * @param optional nil or *SoftwareAppsApiGraphSoftwareappsTraverseSystemOpts - Optional Parameters: + * @param "Limit" (optional.Int32) - The number of records to return at once. Limited to 100. + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. + * @param "Skip" (optional.Int32) - The offset into the records to return. + * @param "Filter" (optional.Interface of []string) - A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` +@return []GraphObjectWithPaths +*/ + +type SoftwareAppsApiGraphSoftwareappsTraverseSystemOpts struct { + Limit optional.Int32 + XOrgId optional.String + Skip optional.Int32 + Filter optional.Interface +} + +func (a *SoftwareAppsApiService) GraphSoftwareappsTraverseSystem(ctx context.Context, softwareAppId string, localVarOptionals *SoftwareAppsApiGraphSoftwareappsTraverseSystemOpts) ([]GraphObjectWithPaths, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []GraphObjectWithPaths + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/softwareapps/{software_app_id}/systems" + localVarPath = strings.Replace(localVarPath, "{"+"software_app_id"+"}", fmt.Sprintf("%v", softwareAppId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { + localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Skip.IsSet() { + localVarQueryParams.Add("skip", parameterToString(localVarOptionals.Skip.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Filter.IsSet() { + localVarQueryParams.Add("filter", parameterToString(localVarOptionals.Filter.Value(), "csv")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v []GraphObjectWithPaths + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +SoftwareAppsApiService List the System Groups bound to a Software App. +This endpoint will return all Systems Groups bound to a Software App, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the group's type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this Software App to the corresponding System Group; this array represents all grouping and/or associations that would have to be removed to deprovision the System Group from this Software App. See `/associations` endpoint to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/softwareapps/{software_app_id}/systemgroups \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param softwareAppId ObjectID of the Software App. + * @param optional nil or *SoftwareAppsApiGraphSoftwareappsTraverseSystemGroupOpts - Optional Parameters: + * @param "Limit" (optional.Int32) - The number of records to return at once. Limited to 100. + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. + * @param "Skip" (optional.Int32) - The offset into the records to return. + * @param "Filter" (optional.Interface of []string) - A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` +@return []GraphObjectWithPaths +*/ + +type SoftwareAppsApiGraphSoftwareappsTraverseSystemGroupOpts struct { + Limit optional.Int32 + XOrgId optional.String + Skip optional.Int32 + Filter optional.Interface +} + +func (a *SoftwareAppsApiService) GraphSoftwareappsTraverseSystemGroup(ctx context.Context, softwareAppId string, localVarOptionals *SoftwareAppsApiGraphSoftwareappsTraverseSystemGroupOpts) ([]GraphObjectWithPaths, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []GraphObjectWithPaths + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/softwareapps/{software_app_id}/systemgroups" + localVarPath = strings.Replace(localVarPath, "{"+"software_app_id"+"}", fmt.Sprintf("%v", softwareAppId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { + localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Skip.IsSet() { + localVarQueryParams.Add("skip", parameterToString(localVarOptionals.Skip.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Filter.IsSet() { + localVarQueryParams.Add("filter", parameterToString(localVarOptionals.Filter.Value(), "csv")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v []GraphObjectWithPaths + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +SoftwareAppsApiService Get the status of the provided Software Application +This endpoint allows you to get the status of the provided Software Application on associated JumpCloud systems. #### Sample Request ``` $ curl -X GET https://console.jumpcloud.com/api/v2/softwareapps/{software_app_id}/statuses \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param softwareAppId ObjectID of the Software App. + * @param optional nil or *SoftwareAppsApiSoftwareAppStatusesListOpts - Optional Parameters: + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. + * @param "Filter" (optional.Interface of []string) - A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` + * @param "Limit" (optional.Int32) - The number of records to return at once. Limited to 100. + * @param "Skip" (optional.Int32) - The offset into the records to return. + * @param "Sort" (optional.Interface of []string) - The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. +@return []SoftwareAppStatus +*/ + +type SoftwareAppsApiSoftwareAppStatusesListOpts struct { + XOrgId optional.String + Filter optional.Interface + Limit optional.Int32 + Skip optional.Int32 + Sort optional.Interface +} + +func (a *SoftwareAppsApiService) SoftwareAppStatusesList(ctx context.Context, softwareAppId string, localVarOptionals *SoftwareAppsApiSoftwareAppStatusesListOpts) ([]SoftwareAppStatus, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []SoftwareAppStatus + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/softwareapps/{software_app_id}/statuses" + localVarPath = strings.Replace(localVarPath, "{"+"software_app_id"+"}", fmt.Sprintf("%v", softwareAppId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Filter.IsSet() { + localVarQueryParams.Add("filter", parameterToString(localVarOptionals.Filter.Value(), "csv")) + } + if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { + localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Skip.IsSet() { + localVarQueryParams.Add("skip", parameterToString(localVarOptionals.Skip.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Sort.IsSet() { + localVarQueryParams.Add("sort", parameterToString(localVarOptionals.Sort.Value(), "csv")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v []SoftwareAppStatus + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +SoftwareAppsApiService Delete a configured Software Application +Removes a Software Application configuration. Warning: This is a destructive operation and will unmanage the application on all affected systems. #### Sample Request ``` curl -X DELETE https://console.jumpcloud.com/api/v2/softwareapps/{id} \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param id + * @param optional nil or *SoftwareAppsApiSoftwareAppsDeleteOpts - Optional Parameters: + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. + +*/ + +type SoftwareAppsApiSoftwareAppsDeleteOpts struct { + XOrgId optional.String +} + +func (a *SoftwareAppsApiService) SoftwareAppsDelete(ctx context.Context, id string, localVarOptionals *SoftwareAppsApiSoftwareAppsDeleteOpts) (*http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Delete") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/softwareapps/{id}" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarHttpResponse, err + } + + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 400 { + var v ErrorDetails + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarHttpResponse, newErr + } + newErr.model = v + return localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 401 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarHttpResponse, newErr + } + newErr.model = v + return localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 403 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarHttpResponse, newErr + } + newErr.model = v + return localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 404 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarHttpResponse, newErr + } + newErr.model = v + return localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 409 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarHttpResponse, newErr + } + newErr.model = v + return localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 500 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarHttpResponse, newErr + } + newErr.model = v + return localVarHttpResponse, newErr + } + return localVarHttpResponse, newErr + } + + return localVarHttpResponse, nil +} +/* +SoftwareAppsApiService Retrieve a configured Software Application. +Retrieves a Software Application. The optional isConfigEnabled and appConfiguration apple_vpp attributes are populated in this response. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/softwareapps/{id} \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param id + * @param optional nil or *SoftwareAppsApiSoftwareAppsGetOpts - Optional Parameters: + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. +@return SoftwareApp +*/ + +type SoftwareAppsApiSoftwareAppsGetOpts struct { + XOrgId optional.String +} + +func (a *SoftwareAppsApiService) SoftwareAppsGet(ctx context.Context, id string, localVarOptionals *SoftwareAppsApiSoftwareAppsGetOpts) (SoftwareApp, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue SoftwareApp + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/softwareapps/{id}" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v SoftwareApp + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 400 { + var v ErrorDetails + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 401 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 403 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 404 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 409 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 500 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +SoftwareAppsApiService Get all configured Software Applications. +This endpoint allows you to get all configured Software Applications that will be managed by JumpCloud on associated JumpCloud systems. The optional isConfigEnabled and appConfiguration apple_vpp attributes are not included in the response. #### Sample Request ``` $ curl -X GET https://console.jumpcloud.com/api/v2/softwareapps \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param optional nil or *SoftwareAppsApiSoftwareAppsListOpts - Optional Parameters: + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. + * @param "Filter" (optional.Interface of []string) - A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` + * @param "Limit" (optional.Int32) - The number of records to return at once. Limited to 100. + * @param "Skip" (optional.Int32) - The offset into the records to return. + * @param "Sort" (optional.Interface of []string) - The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. +@return []SoftwareApp +*/ + +type SoftwareAppsApiSoftwareAppsListOpts struct { + XOrgId optional.String + Filter optional.Interface + Limit optional.Int32 + Skip optional.Int32 + Sort optional.Interface +} + +func (a *SoftwareAppsApiService) SoftwareAppsList(ctx context.Context, localVarOptionals *SoftwareAppsApiSoftwareAppsListOpts) ([]SoftwareApp, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []SoftwareApp + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/softwareapps" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Filter.IsSet() { + localVarQueryParams.Add("filter", parameterToString(localVarOptionals.Filter.Value(), "csv")) + } + if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { + localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Skip.IsSet() { + localVarQueryParams.Add("skip", parameterToString(localVarOptionals.Skip.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Sort.IsSet() { + localVarQueryParams.Add("sort", parameterToString(localVarOptionals.Sort.Value(), "csv")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v []SoftwareApp + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +SoftwareAppsApiService Create a Software Application that will be managed by JumpCloud. +This endpoint allows you to create a Software Application that will be managed by JumpCloud on associated JumpCloud systems. The optional isConfigEnabled and appConfiguration apple_vpp attributes are not included in the response. #### Sample Request ``` $ curl -X POST https://console.jumpcloud.com/api/v2/softwareapps \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"displayName\": \"Adobe Reader\", \"settings\": [{\"packageId\": \"adobereader\"}] }' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param optional nil or *SoftwareAppsApiSoftwareAppsPostOpts - Optional Parameters: + * @param "Body" (optional.Interface of SoftwareApp) - + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. +@return SoftwareApp +*/ + +type SoftwareAppsApiSoftwareAppsPostOpts struct { + Body optional.Interface + XOrgId optional.String +} + +func (a *SoftwareAppsApiService) SoftwareAppsPost(ctx context.Context, localVarOptionals *SoftwareAppsApiSoftwareAppsPostOpts) (SoftwareApp, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Post") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue SoftwareApp + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/softwareapps" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + // body params + if localVarOptionals != nil && localVarOptionals.Body.IsSet() { + + localVarOptionalBody:= localVarOptionals.Body.Value() + localVarPostBody = &localVarOptionalBody + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 201 { + var v SoftwareApp + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +SoftwareAppsApiService Reclaim Licenses for a Software Application. +This endpoint allows you to reclaim the licenses from a software app associated with devices that are deleted. #### Sample Request ``` $ curl -X POST https://console.jumpcloud.com/api/v2/softwareapps/{software_app_id}/reclaim-licenses \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{}' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param softwareAppId +@return SoftwareAppReclaimLicenses +*/ +func (a *SoftwareAppsApiService) SoftwareAppsReclaimLicenses(ctx context.Context, softwareAppId string) (SoftwareAppReclaimLicenses, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Post") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue SoftwareAppReclaimLicenses + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/softwareapps/{software_app_id}/reclaim-licenses" + localVarPath = strings.Replace(localVarPath, "{"+"software_app_id"+"}", fmt.Sprintf("%v", softwareAppId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v SoftwareAppReclaimLicenses + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +SoftwareAppsApiService Retry Installation for a Software Application +This endpoints initiates an installation retry of an Apple VPP App for the provided system IDs #### Sample Request ``` $ curl -X POST https://console.jumpcloud.com/api/v2/softwareapps/{software_app_id}/retry-installation \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{\"system_ids\": \"{<system_id_1>, <system_id_2>, ...}\"}' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param body + * @param softwareAppId + +*/ +func (a *SoftwareAppsApiService) SoftwareAppsRetryInstallation(ctx context.Context, body SoftwareAppsRetryInstallationRequest, softwareAppId string) (*http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Post") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/softwareapps/{software_app_id}/retry-installation" + localVarPath = strings.Replace(localVarPath, "{"+"software_app_id"+"}", fmt.Sprintf("%v", softwareAppId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + // body params + localVarPostBody = &body + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarHttpResponse, err + } + + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 400 { + var v ErrorDetails + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarHttpResponse, newErr + } + newErr.model = v + return localVarHttpResponse, newErr + } + return localVarHttpResponse, newErr + } + + return localVarHttpResponse, nil +} +/* +SoftwareAppsApiService Update a Software Application Configuration. +This endpoint updates a specific Software Application configuration for the organization. displayName can be changed alone if no settings are provided. If a setting is provided, it should include all its information since this endpoint will update all the settings' fields. The optional isConfigEnabled and appConfiguration apple_vpp attributes are not included in the response. #### Sample Request - displayName only ``` curl -X PUT https://console.jumpcloud.com/api/v2/softwareapps/{id} \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"displayName\": \"My Software App\" }' ``` #### Sample Request - all attributes ``` curl -X PUT https://console.jumpcloud.com/api/v2/softwareapps/{id} \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"displayName\": \"My Software App\", \"settings\": [ { \"packageId\": \"123456\", \"autoUpdate\": false, \"allowUpdateDelay\": false, \"packageManager\": \"APPLE_VPP\", \"locationObjectId\": \"123456789012123456789012\", \"location\": \"123456\", \"desiredState\": \"Install\", \"appleVpp\": { \"appConfiguration\": \"<?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?><!DOCTYPE plist PUBLIC \\\"-//Apple//DTD PLIST 1.0//EN\\\" \\\"http://www.apple.com/DTDs/PropertyList-1.0.dtd\\\"><plist version=\\\"1.0\\\"><dict><key>MyKey</key><string>My String</string></dict></plist>\", \"assignedLicenses\": 20, \"availableLicenses\": 10, \"details\": {}, \"isConfigEnabled\": true, \"supportedDeviceFamilies\": [ \"IPAD\", \"MAC\" ], \"totalLicenses\": 30 }, \"packageSubtitle\": \"My package subtitle\", \"packageVersion\": \"1.2.3\", \"packageKind\": \"software-package\", \"assetKind\": \"software\", \"assetSha256Size\": 256, \"assetSha256Strings\": [ \"a123b123c123d123\" ], \"description\": \"My app description\" } ] }' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param id + * @param optional nil or *SoftwareAppsApiSoftwareAppsUpdateOpts - Optional Parameters: + * @param "Body" (optional.Interface of SoftwareApp) - + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. +@return SoftwareApp +*/ + +type SoftwareAppsApiSoftwareAppsUpdateOpts struct { + Body optional.Interface + XOrgId optional.String +} + +func (a *SoftwareAppsApiService) SoftwareAppsUpdate(ctx context.Context, id string, localVarOptionals *SoftwareAppsApiSoftwareAppsUpdateOpts) (SoftwareApp, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Put") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue SoftwareApp + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/softwareapps/{id}" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + // body params + if localVarOptionals != nil && localVarOptionals.Body.IsSet() { + + localVarOptionalBody:= localVarOptionals.Body.Value() + localVarPostBody = &localVarOptionalBody + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v SoftwareApp + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 400 { + var v ErrorDetails + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 401 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 403 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 404 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 500 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} diff --git a/jcapiv2/api_subscriptions.go b/jcapiv2/api_subscriptions.go new file mode 100644 index 0000000..a7ffb97 --- /dev/null +++ b/jcapiv2/api_subscriptions.go @@ -0,0 +1,109 @@ + +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +import ( + "context" + "io/ioutil" + "net/http" + "net/url" + "strings" +) + +// Linger please +var ( + _ context.Context +) + +type SubscriptionsApiService service +/* +SubscriptionsApiService Lists all the Pricing & Packaging Subscriptions +This endpoint returns all pricing & packaging subscriptions. ##### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/subscriptions \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). +@return []Subscription +*/ +func (a *SubscriptionsApiService) SubscriptionsGet(ctx context.Context) ([]Subscription, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []Subscription + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/subscriptions" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v []Subscription + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} diff --git a/jcapiv2/api_system_group_associations.go b/jcapiv2/api_system_group_associations.go new file mode 100644 index 0000000..0599b0e --- /dev/null +++ b/jcapiv2/api_system_group_associations.go @@ -0,0 +1,862 @@ + +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +import ( + "context" + "io/ioutil" + "net/http" + "net/url" + "strings" + "fmt" + "github.com/antihax/optional" +) + +// Linger please +var ( + _ context.Context +) + +type SystemGroupAssociationsApiService service +/* +SystemGroupAssociationsApiService List the associations of a System Group +This endpoint returns the _direct_ associations of a System Group. A direct association can be a non-homogeneous relationship between 2 different objects, for example System Groups and Users. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/systemgroups/{GroupID}/associations?targets=user \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param groupId ObjectID of the System Group. + * @param targets Targets which a \"system_group\" can be associated to. + * @param optional nil or *SystemGroupAssociationsApiGraphSystemGroupAssociationsListOpts - Optional Parameters: + * @param "Limit" (optional.Int32) - The number of records to return at once. Limited to 100. + * @param "Skip" (optional.Int32) - The offset into the records to return. + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. +@return []GraphConnection +*/ + +type SystemGroupAssociationsApiGraphSystemGroupAssociationsListOpts struct { + Limit optional.Int32 + Skip optional.Int32 + XOrgId optional.String +} + +func (a *SystemGroupAssociationsApiService) GraphSystemGroupAssociationsList(ctx context.Context, groupId string, targets []string, localVarOptionals *SystemGroupAssociationsApiGraphSystemGroupAssociationsListOpts) ([]GraphConnection, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []GraphConnection + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/systemgroups/{group_id}/associations" + localVarPath = strings.Replace(localVarPath, "{"+"group_id"+"}", fmt.Sprintf("%v", groupId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + localVarQueryParams.Add("targets", parameterToString(targets, "csv")) + if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { + localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Skip.IsSet() { + localVarQueryParams.Add("skip", parameterToString(localVarOptionals.Skip.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v []GraphConnection + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +SystemGroupAssociationsApiService Manage the associations of a System Group +This endpoint allows you to manage the _direct_ associations of a System Group. A direct association can be a non-homogeneous relationship between 2 different objects, for example System Groups and Users. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/systemgroups/{GroupID}/associations \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"op\": \"add\", \"type\": \"user\", \"id\": \"{UserID}\" }' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param groupId ObjectID of the System Group. + * @param optional nil or *SystemGroupAssociationsApiGraphSystemGroupAssociationsPostOpts - Optional Parameters: + * @param "Body" (optional.Interface of GraphOperationSystemGroup) - + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. + +*/ + +type SystemGroupAssociationsApiGraphSystemGroupAssociationsPostOpts struct { + Body optional.Interface + XOrgId optional.String +} + +func (a *SystemGroupAssociationsApiService) GraphSystemGroupAssociationsPost(ctx context.Context, groupId string, localVarOptionals *SystemGroupAssociationsApiGraphSystemGroupAssociationsPostOpts) (*http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Post") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/systemgroups/{group_id}/associations" + localVarPath = strings.Replace(localVarPath, "{"+"group_id"+"}", fmt.Sprintf("%v", groupId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + // body params + if localVarOptionals != nil && localVarOptionals.Body.IsSet() { + + localVarOptionalBody:= localVarOptionals.Body.Value() + localVarPostBody = &localVarOptionalBody + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarHttpResponse, err + } + + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + return localVarHttpResponse, newErr + } + + return localVarHttpResponse, nil +} +/* +SystemGroupAssociationsApiService List the Commands bound to a System Group +This endpoint will return all Commands bound to a System Group, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the group's type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this System Group to the corresponding Command; this array represents all grouping and/or associations that would have to be removed to deprovision the Command from this System Group. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/systemgroups/{GroupID}/commands \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param groupId ObjectID of the System Group. + * @param optional nil or *SystemGroupAssociationsApiGraphSystemGroupTraverseCommandOpts - Optional Parameters: + * @param "Limit" (optional.Int32) - The number of records to return at once. Limited to 100. + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. + * @param "Skip" (optional.Int32) - The offset into the records to return. + * @param "Filter" (optional.Interface of []string) - A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` +@return []GraphObjectWithPaths +*/ + +type SystemGroupAssociationsApiGraphSystemGroupTraverseCommandOpts struct { + Limit optional.Int32 + XOrgId optional.String + Skip optional.Int32 + Filter optional.Interface +} + +func (a *SystemGroupAssociationsApiService) GraphSystemGroupTraverseCommand(ctx context.Context, groupId string, localVarOptionals *SystemGroupAssociationsApiGraphSystemGroupTraverseCommandOpts) ([]GraphObjectWithPaths, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []GraphObjectWithPaths + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/systemgroups/{group_id}/commands" + localVarPath = strings.Replace(localVarPath, "{"+"group_id"+"}", fmt.Sprintf("%v", groupId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { + localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Skip.IsSet() { + localVarQueryParams.Add("skip", parameterToString(localVarOptionals.Skip.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Filter.IsSet() { + localVarQueryParams.Add("filter", parameterToString(localVarOptionals.Filter.Value(), "csv")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v []GraphObjectWithPaths + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +SystemGroupAssociationsApiService List the Policies bound to a System Group +This endpoint will return all Policies bound to a System Group, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this System Group to the corresponding Policy; this array represents all grouping and/or associations that would have to be removed to deprovision the Policy from this System Group. See `/members` and `/associations` endpoints to manage those collections. This endpoint is not public yet as we haven't finished the code. ##### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/systemgroups/{GroupID}/policies \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param groupId ObjectID of the System Group. + * @param optional nil or *SystemGroupAssociationsApiGraphSystemGroupTraversePolicyOpts - Optional Parameters: + * @param "Limit" (optional.Int32) - The number of records to return at once. Limited to 100. + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. + * @param "Skip" (optional.Int32) - The offset into the records to return. + * @param "Filter" (optional.Interface of []string) - A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` +@return []GraphObjectWithPaths +*/ + +type SystemGroupAssociationsApiGraphSystemGroupTraversePolicyOpts struct { + Limit optional.Int32 + XOrgId optional.String + Skip optional.Int32 + Filter optional.Interface +} + +func (a *SystemGroupAssociationsApiService) GraphSystemGroupTraversePolicy(ctx context.Context, groupId string, localVarOptionals *SystemGroupAssociationsApiGraphSystemGroupTraversePolicyOpts) ([]GraphObjectWithPaths, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []GraphObjectWithPaths + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/systemgroups/{group_id}/policies" + localVarPath = strings.Replace(localVarPath, "{"+"group_id"+"}", fmt.Sprintf("%v", groupId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { + localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Skip.IsSet() { + localVarQueryParams.Add("skip", parameterToString(localVarOptionals.Skip.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Filter.IsSet() { + localVarQueryParams.Add("filter", parameterToString(localVarOptionals.Filter.Value(), "csv")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v []GraphObjectWithPaths + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +SystemGroupAssociationsApiService List the Policy Groups bound to a System Group +This endpoint will return all Policy Groups bound to a System Group, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this System Group to the corresponding Policy Group; this array represents all grouping and/or associations that would have to be removed to deprovision the Policy Group from this System Group. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/systemgroups/{GroupID}/policygroups \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param groupId ObjectID of the System Group. + * @param optional nil or *SystemGroupAssociationsApiGraphSystemGroupTraversePolicyGroupOpts - Optional Parameters: + * @param "Limit" (optional.Int32) - The number of records to return at once. Limited to 100. + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. + * @param "Skip" (optional.Int32) - The offset into the records to return. + * @param "Filter" (optional.Interface of []string) - A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` +@return []GraphObjectWithPaths +*/ + +type SystemGroupAssociationsApiGraphSystemGroupTraversePolicyGroupOpts struct { + Limit optional.Int32 + XOrgId optional.String + Skip optional.Int32 + Filter optional.Interface +} + +func (a *SystemGroupAssociationsApiService) GraphSystemGroupTraversePolicyGroup(ctx context.Context, groupId string, localVarOptionals *SystemGroupAssociationsApiGraphSystemGroupTraversePolicyGroupOpts) ([]GraphObjectWithPaths, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []GraphObjectWithPaths + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/systemgroups/{group_id}/policygroups" + localVarPath = strings.Replace(localVarPath, "{"+"group_id"+"}", fmt.Sprintf("%v", groupId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { + localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Skip.IsSet() { + localVarQueryParams.Add("skip", parameterToString(localVarOptionals.Skip.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Filter.IsSet() { + localVarQueryParams.Add("filter", parameterToString(localVarOptionals.Filter.Value(), "csv")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v []GraphObjectWithPaths + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +SystemGroupAssociationsApiService List the Users bound to a System Group +This endpoint will return all Users bound to a System Group, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this System Group to the corresponding User; this array represents all grouping and/or associations that would have to be removed to deprovision the User from this System Group. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/systemgroups/{GroupID}/users \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param groupId ObjectID of the System Group. + * @param optional nil or *SystemGroupAssociationsApiGraphSystemGroupTraverseUserOpts - Optional Parameters: + * @param "Limit" (optional.Int32) - The number of records to return at once. Limited to 100. + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. + * @param "Skip" (optional.Int32) - The offset into the records to return. + * @param "Filter" (optional.Interface of []string) - A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` +@return []GraphObjectWithPaths +*/ + +type SystemGroupAssociationsApiGraphSystemGroupTraverseUserOpts struct { + Limit optional.Int32 + XOrgId optional.String + Skip optional.Int32 + Filter optional.Interface +} + +func (a *SystemGroupAssociationsApiService) GraphSystemGroupTraverseUser(ctx context.Context, groupId string, localVarOptionals *SystemGroupAssociationsApiGraphSystemGroupTraverseUserOpts) ([]GraphObjectWithPaths, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []GraphObjectWithPaths + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/systemgroups/{group_id}/users" + localVarPath = strings.Replace(localVarPath, "{"+"group_id"+"}", fmt.Sprintf("%v", groupId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { + localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Skip.IsSet() { + localVarQueryParams.Add("skip", parameterToString(localVarOptionals.Skip.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Filter.IsSet() { + localVarQueryParams.Add("filter", parameterToString(localVarOptionals.Filter.Value(), "csv")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v []GraphObjectWithPaths + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +SystemGroupAssociationsApiService List the User Groups bound to a System Group +This endpoint will return all User Groups bound to a System Group, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this System Group to the corresponding User Group; this array represents all grouping and/or associations that would have to be removed to deprovision the User Group from this System Group. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/systemgroups/{GroupID}/usergroups \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param groupId ObjectID of the System Group. + * @param optional nil or *SystemGroupAssociationsApiGraphSystemGroupTraverseUserGroupOpts - Optional Parameters: + * @param "Limit" (optional.Int32) - The number of records to return at once. Limited to 100. + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. + * @param "Skip" (optional.Int32) - The offset into the records to return. + * @param "Filter" (optional.Interface of []string) - A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` +@return []GraphObjectWithPaths +*/ + +type SystemGroupAssociationsApiGraphSystemGroupTraverseUserGroupOpts struct { + Limit optional.Int32 + XOrgId optional.String + Skip optional.Int32 + Filter optional.Interface +} + +func (a *SystemGroupAssociationsApiService) GraphSystemGroupTraverseUserGroup(ctx context.Context, groupId string, localVarOptionals *SystemGroupAssociationsApiGraphSystemGroupTraverseUserGroupOpts) ([]GraphObjectWithPaths, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []GraphObjectWithPaths + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/systemgroups/{group_id}/usergroups" + localVarPath = strings.Replace(localVarPath, "{"+"group_id"+"}", fmt.Sprintf("%v", groupId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { + localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Skip.IsSet() { + localVarQueryParams.Add("skip", parameterToString(localVarOptionals.Skip.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Filter.IsSet() { + localVarQueryParams.Add("filter", parameterToString(localVarOptionals.Filter.Value(), "csv")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v []GraphObjectWithPaths + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} diff --git a/jcapiv2/api_system_group_members_membership.go b/jcapiv2/api_system_group_members_membership.go new file mode 100644 index 0000000..46d40a2 --- /dev/null +++ b/jcapiv2/api_system_group_members_membership.go @@ -0,0 +1,383 @@ + +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +import ( + "context" + "io/ioutil" + "net/http" + "net/url" + "strings" + "fmt" + "github.com/antihax/optional" +) + +// Linger please +var ( + _ context.Context +) + +type SystemGroupMembersMembershipApiService service +/* +SystemGroupMembersMembershipApiService List the members of a System Group +This endpoint returns the system members of a System Group. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/systemgroups/{Group_ID}/members \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param groupId ObjectID of the System Group. + * @param optional nil or *SystemGroupMembersMembershipApiGraphSystemGroupMembersListOpts - Optional Parameters: + * @param "Limit" (optional.Int32) - The number of records to return at once. Limited to 100. + * @param "Skip" (optional.Int32) - The offset into the records to return. + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. +@return []GraphConnection +*/ + +type SystemGroupMembersMembershipApiGraphSystemGroupMembersListOpts struct { + Limit optional.Int32 + Skip optional.Int32 + XOrgId optional.String +} + +func (a *SystemGroupMembersMembershipApiService) GraphSystemGroupMembersList(ctx context.Context, groupId string, localVarOptionals *SystemGroupMembersMembershipApiGraphSystemGroupMembersListOpts) ([]GraphConnection, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []GraphConnection + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/systemgroups/{group_id}/members" + localVarPath = strings.Replace(localVarPath, "{"+"group_id"+"}", fmt.Sprintf("%v", groupId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { + localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Skip.IsSet() { + localVarQueryParams.Add("skip", parameterToString(localVarOptionals.Skip.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v []GraphConnection + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +SystemGroupMembersMembershipApiService Manage the members of a System Group +This endpoint allows you to manage the system members of a System Group. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/systemgroups/{Group_ID}/members \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"op\": \"add\", \"type\": \"system\", \"id\": \"{System_ID}\" }' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param groupId ObjectID of the System Group. + * @param optional nil or *SystemGroupMembersMembershipApiGraphSystemGroupMembersPostOpts - Optional Parameters: + * @param "Body" (optional.Interface of GraphOperationSystemGroupMember) - + * @param "Date" (optional.String) - Current date header for the System Context API + * @param "Authorization" (optional.String) - Authorization header for the System Context API + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. + +*/ + +type SystemGroupMembersMembershipApiGraphSystemGroupMembersPostOpts struct { + Body optional.Interface + Date optional.String + Authorization optional.String + XOrgId optional.String +} + +func (a *SystemGroupMembersMembershipApiService) GraphSystemGroupMembersPost(ctx context.Context, groupId string, localVarOptionals *SystemGroupMembersMembershipApiGraphSystemGroupMembersPostOpts) (*http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Post") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/systemgroups/{group_id}/members" + localVarPath = strings.Replace(localVarPath, "{"+"group_id"+"}", fmt.Sprintf("%v", groupId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.Date.IsSet() { + localVarHeaderParams["Date"] = parameterToString(localVarOptionals.Date.Value(), "") + } + if localVarOptionals != nil && localVarOptionals.Authorization.IsSet() { + localVarHeaderParams["Authorization"] = parameterToString(localVarOptionals.Authorization.Value(), "") + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + // body params + if localVarOptionals != nil && localVarOptionals.Body.IsSet() { + + localVarOptionalBody:= localVarOptionals.Body.Value() + localVarPostBody = &localVarOptionalBody + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarHttpResponse, err + } + + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + return localVarHttpResponse, newErr + } + + return localVarHttpResponse, nil +} +/* +SystemGroupMembersMembershipApiService List the System Group's membership +This endpoint returns all Systems that are a member of this System Group. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/systemgroups/{Group_ID/membership \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param groupId ObjectID of the System Group. + * @param optional nil or *SystemGroupMembersMembershipApiGraphSystemGroupMembershipOpts - Optional Parameters: + * @param "Limit" (optional.Int32) - The number of records to return at once. Limited to 100. + * @param "Skip" (optional.Int32) - The offset into the records to return. + * @param "Sort" (optional.Interface of []string) - The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. + * @param "Filter" (optional.Interface of []string) - A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. +@return []GraphObjectWithPaths +*/ + +type SystemGroupMembersMembershipApiGraphSystemGroupMembershipOpts struct { + Limit optional.Int32 + Skip optional.Int32 + Sort optional.Interface + Filter optional.Interface + XOrgId optional.String +} + +func (a *SystemGroupMembersMembershipApiService) GraphSystemGroupMembership(ctx context.Context, groupId string, localVarOptionals *SystemGroupMembersMembershipApiGraphSystemGroupMembershipOpts) ([]GraphObjectWithPaths, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []GraphObjectWithPaths + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/systemgroups/{group_id}/membership" + localVarPath = strings.Replace(localVarPath, "{"+"group_id"+"}", fmt.Sprintf("%v", groupId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { + localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Skip.IsSet() { + localVarQueryParams.Add("skip", parameterToString(localVarOptionals.Skip.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Sort.IsSet() { + localVarQueryParams.Add("sort", parameterToString(localVarOptionals.Sort.Value(), "csv")) + } + if localVarOptionals != nil && localVarOptionals.Filter.IsSet() { + localVarQueryParams.Add("filter", parameterToString(localVarOptionals.Filter.Value(), "csv")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v []GraphObjectWithPaths + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} diff --git a/jcapiv2/api_system_groups.go b/jcapiv2/api_system_groups.go new file mode 100644 index 0000000..412a75f --- /dev/null +++ b/jcapiv2/api_system_groups.go @@ -0,0 +1,1681 @@ + +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +import ( + "context" + "io/ioutil" + "net/http" + "net/url" + "strings" + "fmt" + "github.com/antihax/optional" +) + +// Linger please +var ( + _ context.Context +) + +type SystemGroupsApiService service +/* +SystemGroupsApiService List the associations of a System Group +This endpoint returns the _direct_ associations of a System Group. A direct association can be a non-homogeneous relationship between 2 different objects, for example System Groups and Users. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/systemgroups/{GroupID}/associations?targets=user \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param groupId ObjectID of the System Group. + * @param targets Targets which a \"system_group\" can be associated to. + * @param optional nil or *SystemGroupsApiGraphSystemGroupAssociationsListOpts - Optional Parameters: + * @param "Limit" (optional.Int32) - The number of records to return at once. Limited to 100. + * @param "Skip" (optional.Int32) - The offset into the records to return. + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. +@return []GraphConnection +*/ + +type SystemGroupsApiGraphSystemGroupAssociationsListOpts struct { + Limit optional.Int32 + Skip optional.Int32 + XOrgId optional.String +} + +func (a *SystemGroupsApiService) GraphSystemGroupAssociationsList(ctx context.Context, groupId string, targets []string, localVarOptionals *SystemGroupsApiGraphSystemGroupAssociationsListOpts) ([]GraphConnection, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []GraphConnection + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/systemgroups/{group_id}/associations" + localVarPath = strings.Replace(localVarPath, "{"+"group_id"+"}", fmt.Sprintf("%v", groupId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + localVarQueryParams.Add("targets", parameterToString(targets, "csv")) + if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { + localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Skip.IsSet() { + localVarQueryParams.Add("skip", parameterToString(localVarOptionals.Skip.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v []GraphConnection + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +SystemGroupsApiService Manage the associations of a System Group +This endpoint allows you to manage the _direct_ associations of a System Group. A direct association can be a non-homogeneous relationship between 2 different objects, for example System Groups and Users. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/systemgroups/{GroupID}/associations \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"op\": \"add\", \"type\": \"user\", \"id\": \"{UserID}\" }' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param groupId ObjectID of the System Group. + * @param optional nil or *SystemGroupsApiGraphSystemGroupAssociationsPostOpts - Optional Parameters: + * @param "Body" (optional.Interface of GraphOperationSystemGroup) - + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. + +*/ + +type SystemGroupsApiGraphSystemGroupAssociationsPostOpts struct { + Body optional.Interface + XOrgId optional.String +} + +func (a *SystemGroupsApiService) GraphSystemGroupAssociationsPost(ctx context.Context, groupId string, localVarOptionals *SystemGroupsApiGraphSystemGroupAssociationsPostOpts) (*http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Post") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/systemgroups/{group_id}/associations" + localVarPath = strings.Replace(localVarPath, "{"+"group_id"+"}", fmt.Sprintf("%v", groupId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + // body params + if localVarOptionals != nil && localVarOptionals.Body.IsSet() { + + localVarOptionalBody:= localVarOptionals.Body.Value() + localVarPostBody = &localVarOptionalBody + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarHttpResponse, err + } + + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + return localVarHttpResponse, newErr + } + + return localVarHttpResponse, nil +} +/* +SystemGroupsApiService List the members of a System Group +This endpoint returns the system members of a System Group. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/systemgroups/{Group_ID}/members \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param groupId ObjectID of the System Group. + * @param optional nil or *SystemGroupsApiGraphSystemGroupMembersListOpts - Optional Parameters: + * @param "Limit" (optional.Int32) - The number of records to return at once. Limited to 100. + * @param "Skip" (optional.Int32) - The offset into the records to return. + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. +@return []GraphConnection +*/ + +type SystemGroupsApiGraphSystemGroupMembersListOpts struct { + Limit optional.Int32 + Skip optional.Int32 + XOrgId optional.String +} + +func (a *SystemGroupsApiService) GraphSystemGroupMembersList(ctx context.Context, groupId string, localVarOptionals *SystemGroupsApiGraphSystemGroupMembersListOpts) ([]GraphConnection, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []GraphConnection + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/systemgroups/{group_id}/members" + localVarPath = strings.Replace(localVarPath, "{"+"group_id"+"}", fmt.Sprintf("%v", groupId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { + localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Skip.IsSet() { + localVarQueryParams.Add("skip", parameterToString(localVarOptionals.Skip.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v []GraphConnection + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +SystemGroupsApiService Manage the members of a System Group +This endpoint allows you to manage the system members of a System Group. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/systemgroups/{Group_ID}/members \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"op\": \"add\", \"type\": \"system\", \"id\": \"{System_ID}\" }' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param groupId ObjectID of the System Group. + * @param optional nil or *SystemGroupsApiGraphSystemGroupMembersPostOpts - Optional Parameters: + * @param "Body" (optional.Interface of GraphOperationSystemGroupMember) - + * @param "Date" (optional.String) - Current date header for the System Context API + * @param "Authorization" (optional.String) - Authorization header for the System Context API + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. + +*/ + +type SystemGroupsApiGraphSystemGroupMembersPostOpts struct { + Body optional.Interface + Date optional.String + Authorization optional.String + XOrgId optional.String +} + +func (a *SystemGroupsApiService) GraphSystemGroupMembersPost(ctx context.Context, groupId string, localVarOptionals *SystemGroupsApiGraphSystemGroupMembersPostOpts) (*http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Post") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/systemgroups/{group_id}/members" + localVarPath = strings.Replace(localVarPath, "{"+"group_id"+"}", fmt.Sprintf("%v", groupId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.Date.IsSet() { + localVarHeaderParams["Date"] = parameterToString(localVarOptionals.Date.Value(), "") + } + if localVarOptionals != nil && localVarOptionals.Authorization.IsSet() { + localVarHeaderParams["Authorization"] = parameterToString(localVarOptionals.Authorization.Value(), "") + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + // body params + if localVarOptionals != nil && localVarOptionals.Body.IsSet() { + + localVarOptionalBody:= localVarOptionals.Body.Value() + localVarPostBody = &localVarOptionalBody + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarHttpResponse, err + } + + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + return localVarHttpResponse, newErr + } + + return localVarHttpResponse, nil +} +/* +SystemGroupsApiService List the System Group's membership +This endpoint returns all Systems that are a member of this System Group. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/systemgroups/{Group_ID/membership \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param groupId ObjectID of the System Group. + * @param optional nil or *SystemGroupsApiGraphSystemGroupMembershipOpts - Optional Parameters: + * @param "Limit" (optional.Int32) - The number of records to return at once. Limited to 100. + * @param "Skip" (optional.Int32) - The offset into the records to return. + * @param "Sort" (optional.Interface of []string) - The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. + * @param "Filter" (optional.Interface of []string) - A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. +@return []GraphObjectWithPaths +*/ + +type SystemGroupsApiGraphSystemGroupMembershipOpts struct { + Limit optional.Int32 + Skip optional.Int32 + Sort optional.Interface + Filter optional.Interface + XOrgId optional.String +} + +func (a *SystemGroupsApiService) GraphSystemGroupMembership(ctx context.Context, groupId string, localVarOptionals *SystemGroupsApiGraphSystemGroupMembershipOpts) ([]GraphObjectWithPaths, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []GraphObjectWithPaths + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/systemgroups/{group_id}/membership" + localVarPath = strings.Replace(localVarPath, "{"+"group_id"+"}", fmt.Sprintf("%v", groupId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { + localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Skip.IsSet() { + localVarQueryParams.Add("skip", parameterToString(localVarOptionals.Skip.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Sort.IsSet() { + localVarQueryParams.Add("sort", parameterToString(localVarOptionals.Sort.Value(), "csv")) + } + if localVarOptionals != nil && localVarOptionals.Filter.IsSet() { + localVarQueryParams.Add("filter", parameterToString(localVarOptionals.Filter.Value(), "csv")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v []GraphObjectWithPaths + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +SystemGroupsApiService List the Policies bound to a System Group +This endpoint will return all Policies bound to a System Group, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this System Group to the corresponding Policy; this array represents all grouping and/or associations that would have to be removed to deprovision the Policy from this System Group. See `/members` and `/associations` endpoints to manage those collections. This endpoint is not public yet as we haven't finished the code. ##### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/systemgroups/{GroupID}/policies \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param groupId ObjectID of the System Group. + * @param optional nil or *SystemGroupsApiGraphSystemGroupTraversePolicyOpts - Optional Parameters: + * @param "Limit" (optional.Int32) - The number of records to return at once. Limited to 100. + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. + * @param "Skip" (optional.Int32) - The offset into the records to return. + * @param "Filter" (optional.Interface of []string) - A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` +@return []GraphObjectWithPaths +*/ + +type SystemGroupsApiGraphSystemGroupTraversePolicyOpts struct { + Limit optional.Int32 + XOrgId optional.String + Skip optional.Int32 + Filter optional.Interface +} + +func (a *SystemGroupsApiService) GraphSystemGroupTraversePolicy(ctx context.Context, groupId string, localVarOptionals *SystemGroupsApiGraphSystemGroupTraversePolicyOpts) ([]GraphObjectWithPaths, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []GraphObjectWithPaths + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/systemgroups/{group_id}/policies" + localVarPath = strings.Replace(localVarPath, "{"+"group_id"+"}", fmt.Sprintf("%v", groupId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { + localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Skip.IsSet() { + localVarQueryParams.Add("skip", parameterToString(localVarOptionals.Skip.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Filter.IsSet() { + localVarQueryParams.Add("filter", parameterToString(localVarOptionals.Filter.Value(), "csv")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v []GraphObjectWithPaths + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +SystemGroupsApiService List the Policy Groups bound to a System Group +This endpoint will return all Policy Groups bound to a System Group, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this System Group to the corresponding Policy Group; this array represents all grouping and/or associations that would have to be removed to deprovision the Policy Group from this System Group. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/systemgroups/{GroupID}/policygroups \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param groupId ObjectID of the System Group. + * @param optional nil or *SystemGroupsApiGraphSystemGroupTraversePolicyGroupOpts - Optional Parameters: + * @param "Limit" (optional.Int32) - The number of records to return at once. Limited to 100. + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. + * @param "Skip" (optional.Int32) - The offset into the records to return. + * @param "Filter" (optional.Interface of []string) - A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` +@return []GraphObjectWithPaths +*/ + +type SystemGroupsApiGraphSystemGroupTraversePolicyGroupOpts struct { + Limit optional.Int32 + XOrgId optional.String + Skip optional.Int32 + Filter optional.Interface +} + +func (a *SystemGroupsApiService) GraphSystemGroupTraversePolicyGroup(ctx context.Context, groupId string, localVarOptionals *SystemGroupsApiGraphSystemGroupTraversePolicyGroupOpts) ([]GraphObjectWithPaths, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []GraphObjectWithPaths + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/systemgroups/{group_id}/policygroups" + localVarPath = strings.Replace(localVarPath, "{"+"group_id"+"}", fmt.Sprintf("%v", groupId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { + localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Skip.IsSet() { + localVarQueryParams.Add("skip", parameterToString(localVarOptionals.Skip.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Filter.IsSet() { + localVarQueryParams.Add("filter", parameterToString(localVarOptionals.Filter.Value(), "csv")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v []GraphObjectWithPaths + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +SystemGroupsApiService List the Users bound to a System Group +This endpoint will return all Users bound to a System Group, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this System Group to the corresponding User; this array represents all grouping and/or associations that would have to be removed to deprovision the User from this System Group. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/systemgroups/{GroupID}/users \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param groupId ObjectID of the System Group. + * @param optional nil or *SystemGroupsApiGraphSystemGroupTraverseUserOpts - Optional Parameters: + * @param "Limit" (optional.Int32) - The number of records to return at once. Limited to 100. + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. + * @param "Skip" (optional.Int32) - The offset into the records to return. + * @param "Filter" (optional.Interface of []string) - A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` +@return []GraphObjectWithPaths +*/ + +type SystemGroupsApiGraphSystemGroupTraverseUserOpts struct { + Limit optional.Int32 + XOrgId optional.String + Skip optional.Int32 + Filter optional.Interface +} + +func (a *SystemGroupsApiService) GraphSystemGroupTraverseUser(ctx context.Context, groupId string, localVarOptionals *SystemGroupsApiGraphSystemGroupTraverseUserOpts) ([]GraphObjectWithPaths, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []GraphObjectWithPaths + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/systemgroups/{group_id}/users" + localVarPath = strings.Replace(localVarPath, "{"+"group_id"+"}", fmt.Sprintf("%v", groupId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { + localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Skip.IsSet() { + localVarQueryParams.Add("skip", parameterToString(localVarOptionals.Skip.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Filter.IsSet() { + localVarQueryParams.Add("filter", parameterToString(localVarOptionals.Filter.Value(), "csv")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v []GraphObjectWithPaths + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +SystemGroupsApiService List the User Groups bound to a System Group +This endpoint will return all User Groups bound to a System Group, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this System Group to the corresponding User Group; this array represents all grouping and/or associations that would have to be removed to deprovision the User Group from this System Group. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/systemgroups/{GroupID}/usergroups \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param groupId ObjectID of the System Group. + * @param optional nil or *SystemGroupsApiGraphSystemGroupTraverseUserGroupOpts - Optional Parameters: + * @param "Limit" (optional.Int32) - The number of records to return at once. Limited to 100. + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. + * @param "Skip" (optional.Int32) - The offset into the records to return. + * @param "Filter" (optional.Interface of []string) - A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` +@return []GraphObjectWithPaths +*/ + +type SystemGroupsApiGraphSystemGroupTraverseUserGroupOpts struct { + Limit optional.Int32 + XOrgId optional.String + Skip optional.Int32 + Filter optional.Interface +} + +func (a *SystemGroupsApiService) GraphSystemGroupTraverseUserGroup(ctx context.Context, groupId string, localVarOptionals *SystemGroupsApiGraphSystemGroupTraverseUserGroupOpts) ([]GraphObjectWithPaths, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []GraphObjectWithPaths + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/systemgroups/{group_id}/usergroups" + localVarPath = strings.Replace(localVarPath, "{"+"group_id"+"}", fmt.Sprintf("%v", groupId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { + localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Skip.IsSet() { + localVarQueryParams.Add("skip", parameterToString(localVarOptionals.Skip.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Filter.IsSet() { + localVarQueryParams.Add("filter", parameterToString(localVarOptionals.Filter.Value(), "csv")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v []GraphObjectWithPaths + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +SystemGroupsApiService Delete a System Group +This endpoint allows you to delete a System Group. #### Sample Request ``` curl -X DELETE https://console.jumpcloud.com/api/v2/systemgroups/{Group_ID} \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param id ObjectID of the System Group. + * @param optional nil or *SystemGroupsApiGroupsSystemDeleteOpts - Optional Parameters: + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. +@return SystemGroup +*/ + +type SystemGroupsApiGroupsSystemDeleteOpts struct { + XOrgId optional.String +} + +func (a *SystemGroupsApiService) GroupsSystemDelete(ctx context.Context, id string, localVarOptionals *SystemGroupsApiGroupsSystemDeleteOpts) (SystemGroup, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Delete") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue SystemGroup + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/systemgroups/{id}" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v SystemGroup + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +SystemGroupsApiService View an individual System Group details +This endpoint returns the details of a System Group. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/systemgroups/{Group_ID} \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param id ObjectID of the System Group. + * @param optional nil or *SystemGroupsApiGroupsSystemGetOpts - Optional Parameters: + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. +@return SystemGroup +*/ + +type SystemGroupsApiGroupsSystemGetOpts struct { + XOrgId optional.String +} + +func (a *SystemGroupsApiService) GroupsSystemGet(ctx context.Context, id string, localVarOptionals *SystemGroupsApiGroupsSystemGetOpts) (SystemGroup, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue SystemGroup + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/systemgroups/{id}" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v SystemGroup + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +SystemGroupsApiService List all System Groups +This endpoint returns all System Groups. Available filter fields: - `name` - `disabled` - `type` #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/systemgroups \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param optional nil or *SystemGroupsApiGroupsSystemListOpts - Optional Parameters: + * @param "Fields" (optional.Interface of []string) - The comma separated fields included in the returned records. If omitted, the default list of fields will be returned. + * @param "Filter" (optional.Interface of []string) - A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` + * @param "Limit" (optional.Int32) - The number of records to return at once. Limited to 100. + * @param "Skip" (optional.Int32) - The offset into the records to return. + * @param "Sort" (optional.Interface of []string) - The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. +@return []SystemGroup +*/ + +type SystemGroupsApiGroupsSystemListOpts struct { + Fields optional.Interface + Filter optional.Interface + Limit optional.Int32 + Skip optional.Int32 + Sort optional.Interface + XOrgId optional.String +} + +func (a *SystemGroupsApiService) GroupsSystemList(ctx context.Context, localVarOptionals *SystemGroupsApiGroupsSystemListOpts) ([]SystemGroup, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []SystemGroup + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/systemgroups" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Fields.IsSet() { + localVarQueryParams.Add("fields", parameterToString(localVarOptionals.Fields.Value(), "csv")) + } + if localVarOptionals != nil && localVarOptionals.Filter.IsSet() { + localVarQueryParams.Add("filter", parameterToString(localVarOptionals.Filter.Value(), "csv")) + } + if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { + localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Skip.IsSet() { + localVarQueryParams.Add("skip", parameterToString(localVarOptionals.Skip.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Sort.IsSet() { + localVarQueryParams.Add("sort", parameterToString(localVarOptionals.Sort.Value(), "csv")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v []SystemGroup + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 0 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +SystemGroupsApiService Create a new System Group +This endpoint allows you to create a new System Group. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/systemgroups \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"name\": \"{Group_Name}\" }' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param optional nil or *SystemGroupsApiGroupsSystemPostOpts - Optional Parameters: + * @param "Body" (optional.Interface of SystemGroupData) - + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. +@return SystemGroup +*/ + +type SystemGroupsApiGroupsSystemPostOpts struct { + Body optional.Interface + XOrgId optional.String +} + +func (a *SystemGroupsApiService) GroupsSystemPost(ctx context.Context, localVarOptionals *SystemGroupsApiGroupsSystemPostOpts) (SystemGroup, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Post") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue SystemGroup + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/systemgroups" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + // body params + if localVarOptionals != nil && localVarOptionals.Body.IsSet() { + + localVarOptionalBody:= localVarOptionals.Body.Value() + localVarPostBody = &localVarOptionalBody + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 201 { + var v SystemGroup + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +SystemGroupsApiService Update a System Group +This endpoint allows you to do a full update of the System Group. #### Sample Request ``` curl -X PUT https://console.jumpcloud.com/api/v2/systemgroups/{Group_ID} \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"name\": \"Name_Update\" }' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param id ObjectID of the System Group. + * @param optional nil or *SystemGroupsApiGroupsSystemPutOpts - Optional Parameters: + * @param "Body" (optional.Interface of SystemGroupData) - + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. +@return SystemGroup +*/ + +type SystemGroupsApiGroupsSystemPutOpts struct { + Body optional.Interface + XOrgId optional.String +} + +func (a *SystemGroupsApiService) GroupsSystemPut(ctx context.Context, id string, localVarOptionals *SystemGroupsApiGroupsSystemPutOpts) (SystemGroup, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Put") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue SystemGroup + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/systemgroups/{id}" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + // body params + if localVarOptionals != nil && localVarOptionals.Body.IsSet() { + + localVarOptionalBody:= localVarOptionals.Body.Value() + localVarPostBody = &localVarOptionalBody + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v SystemGroup + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} diff --git a/jcapiv2/api_system_insights.go b/jcapiv2/api_system_insights.go new file mode 100644 index 0000000..8131466 --- /dev/null +++ b/jcapiv2/api_system_insights.go @@ -0,0 +1,7553 @@ + +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +import ( + "context" + "io/ioutil" + "net/http" + "net/url" + "strings" + "github.com/antihax/optional" +) + +// Linger please +var ( + _ context.Context +) + +type SystemInsightsApiService service +/* +SystemInsightsApiService List System Insights ALF +Valid filter fields are `system_id` and `global_state`. + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param optional nil or *SystemInsightsApiSysteminsightsListAlfOpts - Optional Parameters: + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. + * @param "Filter" (optional.Interface of []string) - Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` + * @param "Skip" (optional.Int32) - The offset into the records to return. + * @param "Sort" (optional.Interface of []string) - The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` + * @param "Limit" (optional.Int32) - +@return []SystemInsightsAlf +*/ + +type SystemInsightsApiSysteminsightsListAlfOpts struct { + XOrgId optional.String + Filter optional.Interface + Skip optional.Int32 + Sort optional.Interface + Limit optional.Int32 +} + +func (a *SystemInsightsApiService) SysteminsightsListAlf(ctx context.Context, localVarOptionals *SystemInsightsApiSysteminsightsListAlfOpts) ([]SystemInsightsAlf, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []SystemInsightsAlf + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/systeminsights/alf" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Filter.IsSet() { + localVarQueryParams.Add("filter", parameterToString(localVarOptionals.Filter.Value(), "csv")) + } + if localVarOptionals != nil && localVarOptionals.Skip.IsSet() { + localVarQueryParams.Add("skip", parameterToString(localVarOptionals.Skip.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Sort.IsSet() { + localVarQueryParams.Add("sort", parameterToString(localVarOptionals.Sort.Value(), "csv")) + } + if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { + localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v []SystemInsightsAlf + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +SystemInsightsApiService List System Insights ALF Exceptions +Valid filter fields are `system_id` and `state`. + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param optional nil or *SystemInsightsApiSysteminsightsListAlfExceptionsOpts - Optional Parameters: + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. + * @param "Filter" (optional.Interface of []string) - Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` + * @param "Skip" (optional.Int32) - The offset into the records to return. + * @param "Sort" (optional.Interface of []string) - The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` + * @param "Limit" (optional.Int32) - +@return []SystemInsightsAlfExceptions +*/ + +type SystemInsightsApiSysteminsightsListAlfExceptionsOpts struct { + XOrgId optional.String + Filter optional.Interface + Skip optional.Int32 + Sort optional.Interface + Limit optional.Int32 +} + +func (a *SystemInsightsApiService) SysteminsightsListAlfExceptions(ctx context.Context, localVarOptionals *SystemInsightsApiSysteminsightsListAlfExceptionsOpts) ([]SystemInsightsAlfExceptions, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []SystemInsightsAlfExceptions + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/systeminsights/alf_exceptions" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Filter.IsSet() { + localVarQueryParams.Add("filter", parameterToString(localVarOptionals.Filter.Value(), "csv")) + } + if localVarOptionals != nil && localVarOptionals.Skip.IsSet() { + localVarQueryParams.Add("skip", parameterToString(localVarOptionals.Skip.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Sort.IsSet() { + localVarQueryParams.Add("sort", parameterToString(localVarOptionals.Sort.Value(), "csv")) + } + if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { + localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v []SystemInsightsAlfExceptions + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +SystemInsightsApiService List System Insights ALF Explicit Authentications +Valid filter fields are `system_id` and `process`. + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param optional nil or *SystemInsightsApiSysteminsightsListAlfExplicitAuthsOpts - Optional Parameters: + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. + * @param "Filter" (optional.Interface of []string) - Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` + * @param "Skip" (optional.Int32) - The offset into the records to return. + * @param "Sort" (optional.Interface of []string) - The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` + * @param "Limit" (optional.Int32) - +@return []SystemInsightsAlfExplicitAuths +*/ + +type SystemInsightsApiSysteminsightsListAlfExplicitAuthsOpts struct { + XOrgId optional.String + Filter optional.Interface + Skip optional.Int32 + Sort optional.Interface + Limit optional.Int32 +} + +func (a *SystemInsightsApiService) SysteminsightsListAlfExplicitAuths(ctx context.Context, localVarOptionals *SystemInsightsApiSysteminsightsListAlfExplicitAuthsOpts) ([]SystemInsightsAlfExplicitAuths, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []SystemInsightsAlfExplicitAuths + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/systeminsights/alf_explicit_auths" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Filter.IsSet() { + localVarQueryParams.Add("filter", parameterToString(localVarOptionals.Filter.Value(), "csv")) + } + if localVarOptionals != nil && localVarOptionals.Skip.IsSet() { + localVarQueryParams.Add("skip", parameterToString(localVarOptionals.Skip.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Sort.IsSet() { + localVarQueryParams.Add("sort", parameterToString(localVarOptionals.Sort.Value(), "csv")) + } + if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { + localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v []SystemInsightsAlfExplicitAuths + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +SystemInsightsApiService List System Insights Application Compatibility Shims +Valid filter fields are `system_id` and `enabled`. + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param optional nil or *SystemInsightsApiSysteminsightsListAppcompatShimsOpts - Optional Parameters: + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. + * @param "Skip" (optional.Int32) - The offset into the records to return. + * @param "Sort" (optional.Interface of []string) - The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` + * @param "Filter" (optional.Interface of []string) - Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` + * @param "Limit" (optional.Int32) - +@return []SystemInsightsAppcompatShims +*/ + +type SystemInsightsApiSysteminsightsListAppcompatShimsOpts struct { + XOrgId optional.String + Skip optional.Int32 + Sort optional.Interface + Filter optional.Interface + Limit optional.Int32 +} + +func (a *SystemInsightsApiService) SysteminsightsListAppcompatShims(ctx context.Context, localVarOptionals *SystemInsightsApiSysteminsightsListAppcompatShimsOpts) ([]SystemInsightsAppcompatShims, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []SystemInsightsAppcompatShims + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/systeminsights/appcompat_shims" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Skip.IsSet() { + localVarQueryParams.Add("skip", parameterToString(localVarOptionals.Skip.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Sort.IsSet() { + localVarQueryParams.Add("sort", parameterToString(localVarOptionals.Sort.Value(), "csv")) + } + if localVarOptionals != nil && localVarOptionals.Filter.IsSet() { + localVarQueryParams.Add("filter", parameterToString(localVarOptionals.Filter.Value(), "csv")) + } + if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { + localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v []SystemInsightsAppcompatShims + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +SystemInsightsApiService List System Insights Apps +Lists all apps for macOS devices. For Windows devices, use [List System Insights Programs](#operation/systeminsights_list_programs). Valid filter fields are `system_id` and `bundle_name`. + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param optional nil or *SystemInsightsApiSysteminsightsListAppsOpts - Optional Parameters: + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. + * @param "Skip" (optional.Int32) - The offset into the records to return. + * @param "Sort" (optional.Interface of []string) - The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` + * @param "Filter" (optional.Interface of []string) - Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` + * @param "Limit" (optional.Int32) - +@return []SystemInsightsApps +*/ + +type SystemInsightsApiSysteminsightsListAppsOpts struct { + XOrgId optional.String + Skip optional.Int32 + Sort optional.Interface + Filter optional.Interface + Limit optional.Int32 +} + +func (a *SystemInsightsApiService) SysteminsightsListApps(ctx context.Context, localVarOptionals *SystemInsightsApiSysteminsightsListAppsOpts) ([]SystemInsightsApps, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []SystemInsightsApps + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/systeminsights/apps" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Skip.IsSet() { + localVarQueryParams.Add("skip", parameterToString(localVarOptionals.Skip.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Sort.IsSet() { + localVarQueryParams.Add("sort", parameterToString(localVarOptionals.Sort.Value(), "csv")) + } + if localVarOptionals != nil && localVarOptionals.Filter.IsSet() { + localVarQueryParams.Add("filter", parameterToString(localVarOptionals.Filter.Value(), "csv")) + } + if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { + localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v []SystemInsightsApps + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +SystemInsightsApiService List System Insights Authorized Keys +Valid filter fields are `system_id` and `uid`. + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param optional nil or *SystemInsightsApiSysteminsightsListAuthorizedKeysOpts - Optional Parameters: + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. + * @param "Skip" (optional.Int32) - The offset into the records to return. + * @param "Sort" (optional.Interface of []string) - The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` + * @param "Filter" (optional.Interface of []string) - Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` + * @param "Limit" (optional.Int32) - +@return []SystemInsightsAuthorizedKeys +*/ + +type SystemInsightsApiSysteminsightsListAuthorizedKeysOpts struct { + XOrgId optional.String + Skip optional.Int32 + Sort optional.Interface + Filter optional.Interface + Limit optional.Int32 +} + +func (a *SystemInsightsApiService) SysteminsightsListAuthorizedKeys(ctx context.Context, localVarOptionals *SystemInsightsApiSysteminsightsListAuthorizedKeysOpts) ([]SystemInsightsAuthorizedKeys, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []SystemInsightsAuthorizedKeys + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/systeminsights/authorized_keys" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Skip.IsSet() { + localVarQueryParams.Add("skip", parameterToString(localVarOptionals.Skip.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Sort.IsSet() { + localVarQueryParams.Add("sort", parameterToString(localVarOptionals.Sort.Value(), "csv")) + } + if localVarOptionals != nil && localVarOptionals.Filter.IsSet() { + localVarQueryParams.Add("filter", parameterToString(localVarOptionals.Filter.Value(), "csv")) + } + if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { + localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v []SystemInsightsAuthorizedKeys + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +SystemInsightsApiService List System Insights Azure Instance Metadata +Valid filter fields are `system_id`. + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param optional nil or *SystemInsightsApiSysteminsightsListAzureInstanceMetadataOpts - Optional Parameters: + * @param "Skip" (optional.Int32) - The offset into the records to return. + * @param "Sort" (optional.Interface of []string) - The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` + * @param "Filter" (optional.Interface of []string) - Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. + * @param "Limit" (optional.Int32) - +@return []SystemInsightsAzureInstanceMetadata +*/ + +type SystemInsightsApiSysteminsightsListAzureInstanceMetadataOpts struct { + Skip optional.Int32 + Sort optional.Interface + Filter optional.Interface + XOrgId optional.String + Limit optional.Int32 +} + +func (a *SystemInsightsApiService) SysteminsightsListAzureInstanceMetadata(ctx context.Context, localVarOptionals *SystemInsightsApiSysteminsightsListAzureInstanceMetadataOpts) ([]SystemInsightsAzureInstanceMetadata, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []SystemInsightsAzureInstanceMetadata + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/systeminsights/azure_instance_metadata" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Skip.IsSet() { + localVarQueryParams.Add("skip", parameterToString(localVarOptionals.Skip.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Sort.IsSet() { + localVarQueryParams.Add("sort", parameterToString(localVarOptionals.Sort.Value(), "csv")) + } + if localVarOptionals != nil && localVarOptionals.Filter.IsSet() { + localVarQueryParams.Add("filter", parameterToString(localVarOptionals.Filter.Value(), "csv")) + } + if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { + localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v []SystemInsightsAzureInstanceMetadata + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 400 { + var v string + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +SystemInsightsApiService List System Insights Azure Instance Tags +Valid filter fields are `system_id`. + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param optional nil or *SystemInsightsApiSysteminsightsListAzureInstanceTagsOpts - Optional Parameters: + * @param "Skip" (optional.Int32) - The offset into the records to return. + * @param "Sort" (optional.Interface of []string) - The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` + * @param "Filter" (optional.Interface of []string) - Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. + * @param "Limit" (optional.Int32) - +@return []SystemInsightsAzureInstanceTags +*/ + +type SystemInsightsApiSysteminsightsListAzureInstanceTagsOpts struct { + Skip optional.Int32 + Sort optional.Interface + Filter optional.Interface + XOrgId optional.String + Limit optional.Int32 +} + +func (a *SystemInsightsApiService) SysteminsightsListAzureInstanceTags(ctx context.Context, localVarOptionals *SystemInsightsApiSysteminsightsListAzureInstanceTagsOpts) ([]SystemInsightsAzureInstanceTags, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []SystemInsightsAzureInstanceTags + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/systeminsights/azure_instance_tags" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Skip.IsSet() { + localVarQueryParams.Add("skip", parameterToString(localVarOptionals.Skip.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Sort.IsSet() { + localVarQueryParams.Add("sort", parameterToString(localVarOptionals.Sort.Value(), "csv")) + } + if localVarOptionals != nil && localVarOptionals.Filter.IsSet() { + localVarQueryParams.Add("filter", parameterToString(localVarOptionals.Filter.Value(), "csv")) + } + if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { + localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v []SystemInsightsAzureInstanceTags + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 400 { + var v string + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +SystemInsightsApiService List System Insights Battery +Valid filter fields are `system_id` and `health`. + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param optional nil or *SystemInsightsApiSysteminsightsListBatteryOpts - Optional Parameters: + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. + * @param "Skip" (optional.Int32) - The offset into the records to return. + * @param "Sort" (optional.Interface of []string) - The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` + * @param "Filter" (optional.Interface of []string) - Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` + * @param "Limit" (optional.Int32) - +@return []SystemInsightsBattery +*/ + +type SystemInsightsApiSysteminsightsListBatteryOpts struct { + XOrgId optional.String + Skip optional.Int32 + Sort optional.Interface + Filter optional.Interface + Limit optional.Int32 +} + +func (a *SystemInsightsApiService) SysteminsightsListBattery(ctx context.Context, localVarOptionals *SystemInsightsApiSysteminsightsListBatteryOpts) ([]SystemInsightsBattery, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []SystemInsightsBattery + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/systeminsights/battery" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Skip.IsSet() { + localVarQueryParams.Add("skip", parameterToString(localVarOptionals.Skip.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Sort.IsSet() { + localVarQueryParams.Add("sort", parameterToString(localVarOptionals.Sort.Value(), "csv")) + } + if localVarOptionals != nil && localVarOptionals.Filter.IsSet() { + localVarQueryParams.Add("filter", parameterToString(localVarOptionals.Filter.Value(), "csv")) + } + if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { + localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v []SystemInsightsBattery + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +SystemInsightsApiService List System Insights Bitlocker Info +Valid filter fields are `system_id` and `protection_status`. + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param optional nil or *SystemInsightsApiSysteminsightsListBitlockerInfoOpts - Optional Parameters: + * @param "Skip" (optional.Int32) - The offset into the records to return. + * @param "Sort" (optional.Interface of []string) - The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` + * @param "Filter" (optional.Interface of []string) - Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. + * @param "Limit" (optional.Int32) - +@return []SystemInsightsBitlockerInfo +*/ + +type SystemInsightsApiSysteminsightsListBitlockerInfoOpts struct { + Skip optional.Int32 + Sort optional.Interface + Filter optional.Interface + XOrgId optional.String + Limit optional.Int32 +} + +func (a *SystemInsightsApiService) SysteminsightsListBitlockerInfo(ctx context.Context, localVarOptionals *SystemInsightsApiSysteminsightsListBitlockerInfoOpts) ([]SystemInsightsBitlockerInfo, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []SystemInsightsBitlockerInfo + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/systeminsights/bitlocker_info" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Skip.IsSet() { + localVarQueryParams.Add("skip", parameterToString(localVarOptionals.Skip.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Sort.IsSet() { + localVarQueryParams.Add("sort", parameterToString(localVarOptionals.Sort.Value(), "csv")) + } + if localVarOptionals != nil && localVarOptionals.Filter.IsSet() { + localVarQueryParams.Add("filter", parameterToString(localVarOptionals.Filter.Value(), "csv")) + } + if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { + localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v []SystemInsightsBitlockerInfo + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +SystemInsightsApiService List System Insights Browser Plugins +Valid filter fields are `system_id` and `name`. + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param optional nil or *SystemInsightsApiSysteminsightsListBrowserPluginsOpts - Optional Parameters: + * @param "Skip" (optional.Int32) - The offset into the records to return. + * @param "Sort" (optional.Interface of []string) - The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` + * @param "Filter" (optional.Interface of []string) - Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. + * @param "Limit" (optional.Int32) - +@return []SystemInsightsBrowserPlugins +*/ + +type SystemInsightsApiSysteminsightsListBrowserPluginsOpts struct { + Skip optional.Int32 + Sort optional.Interface + Filter optional.Interface + XOrgId optional.String + Limit optional.Int32 +} + +func (a *SystemInsightsApiService) SysteminsightsListBrowserPlugins(ctx context.Context, localVarOptionals *SystemInsightsApiSysteminsightsListBrowserPluginsOpts) ([]SystemInsightsBrowserPlugins, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []SystemInsightsBrowserPlugins + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/systeminsights/browser_plugins" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Skip.IsSet() { + localVarQueryParams.Add("skip", parameterToString(localVarOptionals.Skip.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Sort.IsSet() { + localVarQueryParams.Add("sort", parameterToString(localVarOptionals.Sort.Value(), "csv")) + } + if localVarOptionals != nil && localVarOptionals.Filter.IsSet() { + localVarQueryParams.Add("filter", parameterToString(localVarOptionals.Filter.Value(), "csv")) + } + if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { + localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v []SystemInsightsBrowserPlugins + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +SystemInsightsApiService List System Insights Certificates +Valid filter fields are `system_id` and `common_name`. + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param optional nil or *SystemInsightsApiSysteminsightsListCertificatesOpts - Optional Parameters: + * @param "Skip" (optional.Int32) - The offset into the records to return. + * @param "Sort" (optional.Interface of []string) - The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` + * @param "Filter" (optional.Interface of []string) - Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` Note: You can only filter by `system_id` and `common_name` + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. + * @param "Limit" (optional.Int32) - +@return []SystemInsightsCertificates +*/ + +type SystemInsightsApiSysteminsightsListCertificatesOpts struct { + Skip optional.Int32 + Sort optional.Interface + Filter optional.Interface + XOrgId optional.String + Limit optional.Int32 +} + +func (a *SystemInsightsApiService) SysteminsightsListCertificates(ctx context.Context, localVarOptionals *SystemInsightsApiSysteminsightsListCertificatesOpts) ([]SystemInsightsCertificates, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []SystemInsightsCertificates + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/systeminsights/certificates" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Skip.IsSet() { + localVarQueryParams.Add("skip", parameterToString(localVarOptionals.Skip.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Sort.IsSet() { + localVarQueryParams.Add("sort", parameterToString(localVarOptionals.Sort.Value(), "csv")) + } + if localVarOptionals != nil && localVarOptionals.Filter.IsSet() { + localVarQueryParams.Add("filter", parameterToString(localVarOptionals.Filter.Value(), "csv")) + } + if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { + localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v []SystemInsightsCertificates + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +SystemInsightsApiService List System Insights Chassis Info +Valid filter fields are `system_id`. + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param optional nil or *SystemInsightsApiSysteminsightsListChassisInfoOpts - Optional Parameters: + * @param "Skip" (optional.Int32) - The offset into the records to return. + * @param "Sort" (optional.Interface of []string) - The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` + * @param "Filter" (optional.Interface of []string) - Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. + * @param "Limit" (optional.Int32) - +@return []SystemInsightsChassisInfo +*/ + +type SystemInsightsApiSysteminsightsListChassisInfoOpts struct { + Skip optional.Int32 + Sort optional.Interface + Filter optional.Interface + XOrgId optional.String + Limit optional.Int32 +} + +func (a *SystemInsightsApiService) SysteminsightsListChassisInfo(ctx context.Context, localVarOptionals *SystemInsightsApiSysteminsightsListChassisInfoOpts) ([]SystemInsightsChassisInfo, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []SystemInsightsChassisInfo + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/systeminsights/chassis_info" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Skip.IsSet() { + localVarQueryParams.Add("skip", parameterToString(localVarOptionals.Skip.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Sort.IsSet() { + localVarQueryParams.Add("sort", parameterToString(localVarOptionals.Sort.Value(), "csv")) + } + if localVarOptionals != nil && localVarOptionals.Filter.IsSet() { + localVarQueryParams.Add("filter", parameterToString(localVarOptionals.Filter.Value(), "csv")) + } + if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { + localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v []SystemInsightsChassisInfo + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 400 { + var v string + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +SystemInsightsApiService List System Insights Chrome Extensions +Valid filter fields are `system_id` and `name`. + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param optional nil or *SystemInsightsApiSysteminsightsListChromeExtensionsOpts - Optional Parameters: + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. + * @param "Skip" (optional.Int32) - The offset into the records to return. + * @param "Sort" (optional.Interface of []string) - The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` + * @param "Filter" (optional.Interface of []string) - Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` + * @param "Limit" (optional.Int32) - +@return []SystemInsightsChromeExtensions +*/ + +type SystemInsightsApiSysteminsightsListChromeExtensionsOpts struct { + XOrgId optional.String + Skip optional.Int32 + Sort optional.Interface + Filter optional.Interface + Limit optional.Int32 +} + +func (a *SystemInsightsApiService) SysteminsightsListChromeExtensions(ctx context.Context, localVarOptionals *SystemInsightsApiSysteminsightsListChromeExtensionsOpts) ([]SystemInsightsChromeExtensions, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []SystemInsightsChromeExtensions + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/systeminsights/chrome_extensions" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Skip.IsSet() { + localVarQueryParams.Add("skip", parameterToString(localVarOptionals.Skip.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Sort.IsSet() { + localVarQueryParams.Add("sort", parameterToString(localVarOptionals.Sort.Value(), "csv")) + } + if localVarOptionals != nil && localVarOptionals.Filter.IsSet() { + localVarQueryParams.Add("filter", parameterToString(localVarOptionals.Filter.Value(), "csv")) + } + if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { + localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v []SystemInsightsChromeExtensions + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +SystemInsightsApiService List System Insights Connectivity +The only valid filter field is `system_id`. + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param optional nil or *SystemInsightsApiSysteminsightsListConnectivityOpts - Optional Parameters: + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. + * @param "Skip" (optional.Int32) - The offset into the records to return. + * @param "Sort" (optional.Interface of []string) - The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` + * @param "Filter" (optional.Interface of []string) - Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` + * @param "Limit" (optional.Int32) - +@return []SystemInsightsConnectivity +*/ + +type SystemInsightsApiSysteminsightsListConnectivityOpts struct { + XOrgId optional.String + Skip optional.Int32 + Sort optional.Interface + Filter optional.Interface + Limit optional.Int32 +} + +func (a *SystemInsightsApiService) SysteminsightsListConnectivity(ctx context.Context, localVarOptionals *SystemInsightsApiSysteminsightsListConnectivityOpts) ([]SystemInsightsConnectivity, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []SystemInsightsConnectivity + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/systeminsights/connectivity" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Skip.IsSet() { + localVarQueryParams.Add("skip", parameterToString(localVarOptionals.Skip.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Sort.IsSet() { + localVarQueryParams.Add("sort", parameterToString(localVarOptionals.Sort.Value(), "csv")) + } + if localVarOptionals != nil && localVarOptionals.Filter.IsSet() { + localVarQueryParams.Add("filter", parameterToString(localVarOptionals.Filter.Value(), "csv")) + } + if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { + localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v []SystemInsightsConnectivity + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +SystemInsightsApiService List System Insights Crashes +Valid filter fields are `system_id` and `identifier`. + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param optional nil or *SystemInsightsApiSysteminsightsListCrashesOpts - Optional Parameters: + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. + * @param "Skip" (optional.Int32) - The offset into the records to return. + * @param "Sort" (optional.Interface of []string) - The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` + * @param "Filter" (optional.Interface of []string) - Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` + * @param "Limit" (optional.Int32) - +@return []SystemInsightsCrashes +*/ + +type SystemInsightsApiSysteminsightsListCrashesOpts struct { + XOrgId optional.String + Skip optional.Int32 + Sort optional.Interface + Filter optional.Interface + Limit optional.Int32 +} + +func (a *SystemInsightsApiService) SysteminsightsListCrashes(ctx context.Context, localVarOptionals *SystemInsightsApiSysteminsightsListCrashesOpts) ([]SystemInsightsCrashes, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []SystemInsightsCrashes + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/systeminsights/crashes" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Skip.IsSet() { + localVarQueryParams.Add("skip", parameterToString(localVarOptionals.Skip.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Sort.IsSet() { + localVarQueryParams.Add("sort", parameterToString(localVarOptionals.Sort.Value(), "csv")) + } + if localVarOptionals != nil && localVarOptionals.Filter.IsSet() { + localVarQueryParams.Add("filter", parameterToString(localVarOptionals.Filter.Value(), "csv")) + } + if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { + localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v []SystemInsightsCrashes + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +SystemInsightsApiService List System Insights CUPS Destinations +Valid filter fields are `system_id` and `name`. + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param optional nil or *SystemInsightsApiSysteminsightsListCupsDestinationsOpts - Optional Parameters: + * @param "Skip" (optional.Int32) - The offset into the records to return. + * @param "Sort" (optional.Interface of []string) - The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` + * @param "Filter" (optional.Interface of []string) - Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. + * @param "Limit" (optional.Int32) - +@return []SystemInsightsCupsDestinations +*/ + +type SystemInsightsApiSysteminsightsListCupsDestinationsOpts struct { + Skip optional.Int32 + Sort optional.Interface + Filter optional.Interface + XOrgId optional.String + Limit optional.Int32 +} + +func (a *SystemInsightsApiService) SysteminsightsListCupsDestinations(ctx context.Context, localVarOptionals *SystemInsightsApiSysteminsightsListCupsDestinationsOpts) ([]SystemInsightsCupsDestinations, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []SystemInsightsCupsDestinations + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/systeminsights/cups_destinations" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Skip.IsSet() { + localVarQueryParams.Add("skip", parameterToString(localVarOptionals.Skip.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Sort.IsSet() { + localVarQueryParams.Add("sort", parameterToString(localVarOptionals.Sort.Value(), "csv")) + } + if localVarOptionals != nil && localVarOptionals.Filter.IsSet() { + localVarQueryParams.Add("filter", parameterToString(localVarOptionals.Filter.Value(), "csv")) + } + if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { + localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v []SystemInsightsCupsDestinations + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +SystemInsightsApiService List System Insights Disk Encryption +Valid filter fields are `system_id` and `encryption_status`. + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param optional nil or *SystemInsightsApiSysteminsightsListDiskEncryptionOpts - Optional Parameters: + * @param "Skip" (optional.Int32) - The offset into the records to return. + * @param "Sort" (optional.Interface of []string) - The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` + * @param "Filter" (optional.Interface of []string) - Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. + * @param "Limit" (optional.Int32) - +@return []SystemInsightsDiskEncryption +*/ + +type SystemInsightsApiSysteminsightsListDiskEncryptionOpts struct { + Skip optional.Int32 + Sort optional.Interface + Filter optional.Interface + XOrgId optional.String + Limit optional.Int32 +} + +func (a *SystemInsightsApiService) SysteminsightsListDiskEncryption(ctx context.Context, localVarOptionals *SystemInsightsApiSysteminsightsListDiskEncryptionOpts) ([]SystemInsightsDiskEncryption, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []SystemInsightsDiskEncryption + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/systeminsights/disk_encryption" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Skip.IsSet() { + localVarQueryParams.Add("skip", parameterToString(localVarOptionals.Skip.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Sort.IsSet() { + localVarQueryParams.Add("sort", parameterToString(localVarOptionals.Sort.Value(), "csv")) + } + if localVarOptionals != nil && localVarOptionals.Filter.IsSet() { + localVarQueryParams.Add("filter", parameterToString(localVarOptionals.Filter.Value(), "csv")) + } + if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { + localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v []SystemInsightsDiskEncryption + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +SystemInsightsApiService List System Insights Disk Info +Valid filter fields are `system_id` and `disk_index`. + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param optional nil or *SystemInsightsApiSysteminsightsListDiskInfoOpts - Optional Parameters: + * @param "Skip" (optional.Int32) - The offset into the records to return. + * @param "Sort" (optional.Interface of []string) - The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` + * @param "Filter" (optional.Interface of []string) - Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. + * @param "Limit" (optional.Int32) - +@return []SystemInsightsDiskInfo +*/ + +type SystemInsightsApiSysteminsightsListDiskInfoOpts struct { + Skip optional.Int32 + Sort optional.Interface + Filter optional.Interface + XOrgId optional.String + Limit optional.Int32 +} + +func (a *SystemInsightsApiService) SysteminsightsListDiskInfo(ctx context.Context, localVarOptionals *SystemInsightsApiSysteminsightsListDiskInfoOpts) ([]SystemInsightsDiskInfo, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []SystemInsightsDiskInfo + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/systeminsights/disk_info" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Skip.IsSet() { + localVarQueryParams.Add("skip", parameterToString(localVarOptionals.Skip.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Sort.IsSet() { + localVarQueryParams.Add("sort", parameterToString(localVarOptionals.Sort.Value(), "csv")) + } + if localVarOptionals != nil && localVarOptionals.Filter.IsSet() { + localVarQueryParams.Add("filter", parameterToString(localVarOptionals.Filter.Value(), "csv")) + } + if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { + localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v []SystemInsightsDiskInfo + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +SystemInsightsApiService List System Insights DNS Resolvers +Valid filter fields are `system_id` and `type`. + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param optional nil or *SystemInsightsApiSysteminsightsListDnsResolversOpts - Optional Parameters: + * @param "Skip" (optional.Int32) - The offset into the records to return. + * @param "Sort" (optional.Interface of []string) - The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` + * @param "Filter" (optional.Interface of []string) - Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. + * @param "Limit" (optional.Int32) - +@return []SystemInsightsDnsResolvers +*/ + +type SystemInsightsApiSysteminsightsListDnsResolversOpts struct { + Skip optional.Int32 + Sort optional.Interface + Filter optional.Interface + XOrgId optional.String + Limit optional.Int32 +} + +func (a *SystemInsightsApiService) SysteminsightsListDnsResolvers(ctx context.Context, localVarOptionals *SystemInsightsApiSysteminsightsListDnsResolversOpts) ([]SystemInsightsDnsResolvers, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []SystemInsightsDnsResolvers + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/systeminsights/dns_resolvers" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Skip.IsSet() { + localVarQueryParams.Add("skip", parameterToString(localVarOptionals.Skip.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Sort.IsSet() { + localVarQueryParams.Add("sort", parameterToString(localVarOptionals.Sort.Value(), "csv")) + } + if localVarOptionals != nil && localVarOptionals.Filter.IsSet() { + localVarQueryParams.Add("filter", parameterToString(localVarOptionals.Filter.Value(), "csv")) + } + if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { + localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v []SystemInsightsDnsResolvers + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +SystemInsightsApiService List System Insights Etc Hosts +Valid filter fields are `system_id` and `address`. + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param optional nil or *SystemInsightsApiSysteminsightsListEtcHostsOpts - Optional Parameters: + * @param "Skip" (optional.Int32) - The offset into the records to return. + * @param "Sort" (optional.Interface of []string) - The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` + * @param "Filter" (optional.Interface of []string) - Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. + * @param "Limit" (optional.Int32) - +@return []SystemInsightsEtcHosts +*/ + +type SystemInsightsApiSysteminsightsListEtcHostsOpts struct { + Skip optional.Int32 + Sort optional.Interface + Filter optional.Interface + XOrgId optional.String + Limit optional.Int32 +} + +func (a *SystemInsightsApiService) SysteminsightsListEtcHosts(ctx context.Context, localVarOptionals *SystemInsightsApiSysteminsightsListEtcHostsOpts) ([]SystemInsightsEtcHosts, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []SystemInsightsEtcHosts + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/systeminsights/etc_hosts" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Skip.IsSet() { + localVarQueryParams.Add("skip", parameterToString(localVarOptionals.Skip.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Sort.IsSet() { + localVarQueryParams.Add("sort", parameterToString(localVarOptionals.Sort.Value(), "csv")) + } + if localVarOptionals != nil && localVarOptionals.Filter.IsSet() { + localVarQueryParams.Add("filter", parameterToString(localVarOptionals.Filter.Value(), "csv")) + } + if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { + localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v []SystemInsightsEtcHosts + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +SystemInsightsApiService List System Insights Firefox Addons +Valid filter fields are `system_id` and `name`. + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param optional nil or *SystemInsightsApiSysteminsightsListFirefoxAddonsOpts - Optional Parameters: + * @param "Skip" (optional.Int32) - The offset into the records to return. + * @param "Sort" (optional.Interface of []string) - The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` + * @param "Filter" (optional.Interface of []string) - Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. + * @param "Limit" (optional.Int32) - +@return []SystemInsightsFirefoxAddons +*/ + +type SystemInsightsApiSysteminsightsListFirefoxAddonsOpts struct { + Skip optional.Int32 + Sort optional.Interface + Filter optional.Interface + XOrgId optional.String + Limit optional.Int32 +} + +func (a *SystemInsightsApiService) SysteminsightsListFirefoxAddons(ctx context.Context, localVarOptionals *SystemInsightsApiSysteminsightsListFirefoxAddonsOpts) ([]SystemInsightsFirefoxAddons, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []SystemInsightsFirefoxAddons + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/systeminsights/firefox_addons" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Skip.IsSet() { + localVarQueryParams.Add("skip", parameterToString(localVarOptionals.Skip.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Sort.IsSet() { + localVarQueryParams.Add("sort", parameterToString(localVarOptionals.Sort.Value(), "csv")) + } + if localVarOptionals != nil && localVarOptionals.Filter.IsSet() { + localVarQueryParams.Add("filter", parameterToString(localVarOptionals.Filter.Value(), "csv")) + } + if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { + localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v []SystemInsightsFirefoxAddons + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +SystemInsightsApiService List System Insights Groups +Valid filter fields are `system_id` and `groupname`. + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param optional nil or *SystemInsightsApiSysteminsightsListGroupsOpts - Optional Parameters: + * @param "Skip" (optional.Int32) - The offset into the records to return. + * @param "Sort" (optional.Interface of []string) - The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` + * @param "Filter" (optional.Interface of []string) - Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. + * @param "Limit" (optional.Int32) - +@return []SystemInsightsGroups +*/ + +type SystemInsightsApiSysteminsightsListGroupsOpts struct { + Skip optional.Int32 + Sort optional.Interface + Filter optional.Interface + XOrgId optional.String + Limit optional.Int32 +} + +func (a *SystemInsightsApiService) SysteminsightsListGroups(ctx context.Context, localVarOptionals *SystemInsightsApiSysteminsightsListGroupsOpts) ([]SystemInsightsGroups, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []SystemInsightsGroups + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/systeminsights/groups" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Skip.IsSet() { + localVarQueryParams.Add("skip", parameterToString(localVarOptionals.Skip.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Sort.IsSet() { + localVarQueryParams.Add("sort", parameterToString(localVarOptionals.Sort.Value(), "csv")) + } + if localVarOptionals != nil && localVarOptionals.Filter.IsSet() { + localVarQueryParams.Add("filter", parameterToString(localVarOptionals.Filter.Value(), "csv")) + } + if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { + localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v []SystemInsightsGroups + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +SystemInsightsApiService List System Insights IE Extensions +Valid filter fields are `system_id` and `name`. + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param optional nil or *SystemInsightsApiSysteminsightsListIeExtensionsOpts - Optional Parameters: + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. + * @param "Skip" (optional.Int32) - The offset into the records to return. + * @param "Sort" (optional.Interface of []string) - The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` + * @param "Filter" (optional.Interface of []string) - Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` + * @param "Limit" (optional.Int32) - +@return []SystemInsightsIeExtensions +*/ + +type SystemInsightsApiSysteminsightsListIeExtensionsOpts struct { + XOrgId optional.String + Skip optional.Int32 + Sort optional.Interface + Filter optional.Interface + Limit optional.Int32 +} + +func (a *SystemInsightsApiService) SysteminsightsListIeExtensions(ctx context.Context, localVarOptionals *SystemInsightsApiSysteminsightsListIeExtensionsOpts) ([]SystemInsightsIeExtensions, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []SystemInsightsIeExtensions + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/systeminsights/ie_extensions" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Skip.IsSet() { + localVarQueryParams.Add("skip", parameterToString(localVarOptionals.Skip.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Sort.IsSet() { + localVarQueryParams.Add("sort", parameterToString(localVarOptionals.Sort.Value(), "csv")) + } + if localVarOptionals != nil && localVarOptionals.Filter.IsSet() { + localVarQueryParams.Add("filter", parameterToString(localVarOptionals.Filter.Value(), "csv")) + } + if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { + localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v []SystemInsightsIeExtensions + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +SystemInsightsApiService List System Insights Interface Addresses +Valid filter fields are `system_id` and `address`. + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param optional nil or *SystemInsightsApiSysteminsightsListInterfaceAddressesOpts - Optional Parameters: + * @param "Skip" (optional.Int32) - The offset into the records to return. + * @param "Sort" (optional.Interface of []string) - The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` + * @param "Filter" (optional.Interface of []string) - Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. + * @param "Limit" (optional.Int32) - +@return []SystemInsightsInterfaceAddresses +*/ + +type SystemInsightsApiSysteminsightsListInterfaceAddressesOpts struct { + Skip optional.Int32 + Sort optional.Interface + Filter optional.Interface + XOrgId optional.String + Limit optional.Int32 +} + +func (a *SystemInsightsApiService) SysteminsightsListInterfaceAddresses(ctx context.Context, localVarOptionals *SystemInsightsApiSysteminsightsListInterfaceAddressesOpts) ([]SystemInsightsInterfaceAddresses, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []SystemInsightsInterfaceAddresses + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/systeminsights/interface_addresses" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Skip.IsSet() { + localVarQueryParams.Add("skip", parameterToString(localVarOptionals.Skip.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Sort.IsSet() { + localVarQueryParams.Add("sort", parameterToString(localVarOptionals.Sort.Value(), "csv")) + } + if localVarOptionals != nil && localVarOptionals.Filter.IsSet() { + localVarQueryParams.Add("filter", parameterToString(localVarOptionals.Filter.Value(), "csv")) + } + if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { + localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v []SystemInsightsInterfaceAddresses + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +SystemInsightsApiService List System Insights Interface Details +Valid filter fields are `system_id` and `interface`. + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param optional nil or *SystemInsightsApiSysteminsightsListInterfaceDetailsOpts - Optional Parameters: + * @param "Skip" (optional.Int32) - The offset into the records to return. + * @param "Sort" (optional.Interface of []string) - The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` + * @param "Filter" (optional.Interface of []string) - Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. + * @param "Limit" (optional.Int32) - +@return []SystemInsightsInterfaceDetails +*/ + +type SystemInsightsApiSysteminsightsListInterfaceDetailsOpts struct { + Skip optional.Int32 + Sort optional.Interface + Filter optional.Interface + XOrgId optional.String + Limit optional.Int32 +} + +func (a *SystemInsightsApiService) SysteminsightsListInterfaceDetails(ctx context.Context, localVarOptionals *SystemInsightsApiSysteminsightsListInterfaceDetailsOpts) ([]SystemInsightsInterfaceDetails, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []SystemInsightsInterfaceDetails + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/systeminsights/interface_details" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Skip.IsSet() { + localVarQueryParams.Add("skip", parameterToString(localVarOptionals.Skip.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Sort.IsSet() { + localVarQueryParams.Add("sort", parameterToString(localVarOptionals.Sort.Value(), "csv")) + } + if localVarOptionals != nil && localVarOptionals.Filter.IsSet() { + localVarQueryParams.Add("filter", parameterToString(localVarOptionals.Filter.Value(), "csv")) + } + if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { + localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v []SystemInsightsInterfaceDetails + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +SystemInsightsApiService List System Insights Kernel Info +Valid filter fields are `system_id` and `version`. + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param optional nil or *SystemInsightsApiSysteminsightsListKernelInfoOpts - Optional Parameters: + * @param "Skip" (optional.Int32) - The offset into the records to return. + * @param "Sort" (optional.Interface of []string) - The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` + * @param "Filter" (optional.Interface of []string) - Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. + * @param "Limit" (optional.Int32) - +@return []SystemInsightsKernelInfo +*/ + +type SystemInsightsApiSysteminsightsListKernelInfoOpts struct { + Skip optional.Int32 + Sort optional.Interface + Filter optional.Interface + XOrgId optional.String + Limit optional.Int32 +} + +func (a *SystemInsightsApiService) SysteminsightsListKernelInfo(ctx context.Context, localVarOptionals *SystemInsightsApiSysteminsightsListKernelInfoOpts) ([]SystemInsightsKernelInfo, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []SystemInsightsKernelInfo + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/systeminsights/kernel_info" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Skip.IsSet() { + localVarQueryParams.Add("skip", parameterToString(localVarOptionals.Skip.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Sort.IsSet() { + localVarQueryParams.Add("sort", parameterToString(localVarOptionals.Sort.Value(), "csv")) + } + if localVarOptionals != nil && localVarOptionals.Filter.IsSet() { + localVarQueryParams.Add("filter", parameterToString(localVarOptionals.Filter.Value(), "csv")) + } + if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { + localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v []SystemInsightsKernelInfo + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +SystemInsightsApiService List System Insights Launchd +Valid filter fields are `system_id` and `name`. + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param optional nil or *SystemInsightsApiSysteminsightsListLaunchdOpts - Optional Parameters: + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. + * @param "Skip" (optional.Int32) - The offset into the records to return. + * @param "Sort" (optional.Interface of []string) - The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` + * @param "Filter" (optional.Interface of []string) - Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` + * @param "Limit" (optional.Int32) - +@return []SystemInsightsLaunchd +*/ + +type SystemInsightsApiSysteminsightsListLaunchdOpts struct { + XOrgId optional.String + Skip optional.Int32 + Sort optional.Interface + Filter optional.Interface + Limit optional.Int32 +} + +func (a *SystemInsightsApiService) SysteminsightsListLaunchd(ctx context.Context, localVarOptionals *SystemInsightsApiSysteminsightsListLaunchdOpts) ([]SystemInsightsLaunchd, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []SystemInsightsLaunchd + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/systeminsights/launchd" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Skip.IsSet() { + localVarQueryParams.Add("skip", parameterToString(localVarOptionals.Skip.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Sort.IsSet() { + localVarQueryParams.Add("sort", parameterToString(localVarOptionals.Sort.Value(), "csv")) + } + if localVarOptionals != nil && localVarOptionals.Filter.IsSet() { + localVarQueryParams.Add("filter", parameterToString(localVarOptionals.Filter.Value(), "csv")) + } + if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { + localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v []SystemInsightsLaunchd + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +SystemInsightsApiService List System Insights Linux Packages +Lists all programs for Linux devices. For macOS devices, use [List System Insights System Apps](#operation/systeminsights_list_apps). For windows devices, use [List System Insights System Apps](#operation/systeminsights_list_programs). Valid filter fields are `name` and `package_format`. + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param optional nil or *SystemInsightsApiSysteminsightsListLinuxPackagesOpts - Optional Parameters: + * @param "Skip" (optional.Int32) - The offset into the records to return. + * @param "Sort" (optional.Interface of []string) - The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` + * @param "Filter" (optional.Interface of []string) - Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. + * @param "Limit" (optional.Int32) - +@return []SystemInsightsLinuxPackages +*/ + +type SystemInsightsApiSysteminsightsListLinuxPackagesOpts struct { + Skip optional.Int32 + Sort optional.Interface + Filter optional.Interface + XOrgId optional.String + Limit optional.Int32 +} + +func (a *SystemInsightsApiService) SysteminsightsListLinuxPackages(ctx context.Context, localVarOptionals *SystemInsightsApiSysteminsightsListLinuxPackagesOpts) ([]SystemInsightsLinuxPackages, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []SystemInsightsLinuxPackages + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/systeminsights/linux_packages" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Skip.IsSet() { + localVarQueryParams.Add("skip", parameterToString(localVarOptionals.Skip.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Sort.IsSet() { + localVarQueryParams.Add("sort", parameterToString(localVarOptionals.Sort.Value(), "csv")) + } + if localVarOptionals != nil && localVarOptionals.Filter.IsSet() { + localVarQueryParams.Add("filter", parameterToString(localVarOptionals.Filter.Value(), "csv")) + } + if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { + localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v []SystemInsightsLinuxPackages + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +SystemInsightsApiService List System Insights Logged-In Users +Valid filter fields are `system_id` and `user`. + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param optional nil or *SystemInsightsApiSysteminsightsListLoggedInUsersOpts - Optional Parameters: + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. + * @param "Skip" (optional.Int32) - The offset into the records to return. + * @param "Sort" (optional.Interface of []string) - The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` + * @param "Filter" (optional.Interface of []string) - Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` + * @param "Limit" (optional.Int32) - +@return []SystemInsightsLoggedInUsers +*/ + +type SystemInsightsApiSysteminsightsListLoggedInUsersOpts struct { + XOrgId optional.String + Skip optional.Int32 + Sort optional.Interface + Filter optional.Interface + Limit optional.Int32 +} + +func (a *SystemInsightsApiService) SysteminsightsListLoggedInUsers(ctx context.Context, localVarOptionals *SystemInsightsApiSysteminsightsListLoggedInUsersOpts) ([]SystemInsightsLoggedInUsers, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []SystemInsightsLoggedInUsers + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/systeminsights/logged_in_users" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Skip.IsSet() { + localVarQueryParams.Add("skip", parameterToString(localVarOptionals.Skip.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Sort.IsSet() { + localVarQueryParams.Add("sort", parameterToString(localVarOptionals.Sort.Value(), "csv")) + } + if localVarOptionals != nil && localVarOptionals.Filter.IsSet() { + localVarQueryParams.Add("filter", parameterToString(localVarOptionals.Filter.Value(), "csv")) + } + if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { + localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v []SystemInsightsLoggedInUsers + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +SystemInsightsApiService List System Insights Logical Drives +Valid filter fields are `system_id` and `device_id`. + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param optional nil or *SystemInsightsApiSysteminsightsListLogicalDrivesOpts - Optional Parameters: + * @param "Skip" (optional.Int32) - The offset into the records to return. + * @param "Sort" (optional.Interface of []string) - The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` + * @param "Filter" (optional.Interface of []string) - Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. + * @param "Limit" (optional.Int32) - +@return []SystemInsightsLogicalDrives +*/ + +type SystemInsightsApiSysteminsightsListLogicalDrivesOpts struct { + Skip optional.Int32 + Sort optional.Interface + Filter optional.Interface + XOrgId optional.String + Limit optional.Int32 +} + +func (a *SystemInsightsApiService) SysteminsightsListLogicalDrives(ctx context.Context, localVarOptionals *SystemInsightsApiSysteminsightsListLogicalDrivesOpts) ([]SystemInsightsLogicalDrives, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []SystemInsightsLogicalDrives + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/systeminsights/logical_drives" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Skip.IsSet() { + localVarQueryParams.Add("skip", parameterToString(localVarOptionals.Skip.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Sort.IsSet() { + localVarQueryParams.Add("sort", parameterToString(localVarOptionals.Sort.Value(), "csv")) + } + if localVarOptionals != nil && localVarOptionals.Filter.IsSet() { + localVarQueryParams.Add("filter", parameterToString(localVarOptionals.Filter.Value(), "csv")) + } + if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { + localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v []SystemInsightsLogicalDrives + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +SystemInsightsApiService List System Insights Managed Policies +Valid filter fields are `system_id` and `domain`. + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param optional nil or *SystemInsightsApiSysteminsightsListManagedPoliciesOpts - Optional Parameters: + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. + * @param "Skip" (optional.Int32) - The offset into the records to return. + * @param "Sort" (optional.Interface of []string) - The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` + * @param "Filter" (optional.Interface of []string) - Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` + * @param "Limit" (optional.Int32) - +@return []SystemInsightsManagedPolicies +*/ + +type SystemInsightsApiSysteminsightsListManagedPoliciesOpts struct { + XOrgId optional.String + Skip optional.Int32 + Sort optional.Interface + Filter optional.Interface + Limit optional.Int32 +} + +func (a *SystemInsightsApiService) SysteminsightsListManagedPolicies(ctx context.Context, localVarOptionals *SystemInsightsApiSysteminsightsListManagedPoliciesOpts) ([]SystemInsightsManagedPolicies, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []SystemInsightsManagedPolicies + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/systeminsights/managed_policies" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Skip.IsSet() { + localVarQueryParams.Add("skip", parameterToString(localVarOptionals.Skip.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Sort.IsSet() { + localVarQueryParams.Add("sort", parameterToString(localVarOptionals.Sort.Value(), "csv")) + } + if localVarOptionals != nil && localVarOptionals.Filter.IsSet() { + localVarQueryParams.Add("filter", parameterToString(localVarOptionals.Filter.Value(), "csv")) + } + if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { + localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v []SystemInsightsManagedPolicies + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +SystemInsightsApiService List System Insights Mounts +Valid filter fields are `system_id` and `path`. + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param optional nil or *SystemInsightsApiSysteminsightsListMountsOpts - Optional Parameters: + * @param "Skip" (optional.Int32) - The offset into the records to return. + * @param "Sort" (optional.Interface of []string) - The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` + * @param "Filter" (optional.Interface of []string) - Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. + * @param "Limit" (optional.Int32) - +@return []SystemInsightsMounts +*/ + +type SystemInsightsApiSysteminsightsListMountsOpts struct { + Skip optional.Int32 + Sort optional.Interface + Filter optional.Interface + XOrgId optional.String + Limit optional.Int32 +} + +func (a *SystemInsightsApiService) SysteminsightsListMounts(ctx context.Context, localVarOptionals *SystemInsightsApiSysteminsightsListMountsOpts) ([]SystemInsightsMounts, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []SystemInsightsMounts + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/systeminsights/mounts" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Skip.IsSet() { + localVarQueryParams.Add("skip", parameterToString(localVarOptionals.Skip.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Sort.IsSet() { + localVarQueryParams.Add("sort", parameterToString(localVarOptionals.Sort.Value(), "csv")) + } + if localVarOptionals != nil && localVarOptionals.Filter.IsSet() { + localVarQueryParams.Add("filter", parameterToString(localVarOptionals.Filter.Value(), "csv")) + } + if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { + localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v []SystemInsightsMounts + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +SystemInsightsApiService List System Insights OS Version +Valid filter fields are `system_id` and `version`. + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param optional nil or *SystemInsightsApiSysteminsightsListOsVersionOpts - Optional Parameters: + * @param "Skip" (optional.Int32) - The offset into the records to return. + * @param "Sort" (optional.Interface of []string) - The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` + * @param "Filter" (optional.Interface of []string) - Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. + * @param "Limit" (optional.Int32) - +@return []SystemInsightsOsVersion +*/ + +type SystemInsightsApiSysteminsightsListOsVersionOpts struct { + Skip optional.Int32 + Sort optional.Interface + Filter optional.Interface + XOrgId optional.String + Limit optional.Int32 +} + +func (a *SystemInsightsApiService) SysteminsightsListOsVersion(ctx context.Context, localVarOptionals *SystemInsightsApiSysteminsightsListOsVersionOpts) ([]SystemInsightsOsVersion, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []SystemInsightsOsVersion + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/systeminsights/os_version" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Skip.IsSet() { + localVarQueryParams.Add("skip", parameterToString(localVarOptionals.Skip.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Sort.IsSet() { + localVarQueryParams.Add("sort", parameterToString(localVarOptionals.Sort.Value(), "csv")) + } + if localVarOptionals != nil && localVarOptionals.Filter.IsSet() { + localVarQueryParams.Add("filter", parameterToString(localVarOptionals.Filter.Value(), "csv")) + } + if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { + localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v []SystemInsightsOsVersion + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +SystemInsightsApiService List System Insights Patches +Valid filter fields are `system_id` and `hotfix_id`. + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param optional nil or *SystemInsightsApiSysteminsightsListPatchesOpts - Optional Parameters: + * @param "Skip" (optional.Int32) - The offset into the records to return. + * @param "Sort" (optional.Interface of []string) - The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` + * @param "Filter" (optional.Interface of []string) - Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. + * @param "Limit" (optional.Int32) - +@return []SystemInsightsPatches +*/ + +type SystemInsightsApiSysteminsightsListPatchesOpts struct { + Skip optional.Int32 + Sort optional.Interface + Filter optional.Interface + XOrgId optional.String + Limit optional.Int32 +} + +func (a *SystemInsightsApiService) SysteminsightsListPatches(ctx context.Context, localVarOptionals *SystemInsightsApiSysteminsightsListPatchesOpts) ([]SystemInsightsPatches, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []SystemInsightsPatches + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/systeminsights/patches" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Skip.IsSet() { + localVarQueryParams.Add("skip", parameterToString(localVarOptionals.Skip.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Sort.IsSet() { + localVarQueryParams.Add("sort", parameterToString(localVarOptionals.Sort.Value(), "csv")) + } + if localVarOptionals != nil && localVarOptionals.Filter.IsSet() { + localVarQueryParams.Add("filter", parameterToString(localVarOptionals.Filter.Value(), "csv")) + } + if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { + localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v []SystemInsightsPatches + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +SystemInsightsApiService List System Insights Programs +Lists all programs for Windows devices. For macOS devices, use [List System Insights Apps](#operation/systeminsights_list_apps). Valid filter fields are `system_id` and `name`. + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param optional nil or *SystemInsightsApiSysteminsightsListProgramsOpts - Optional Parameters: + * @param "Skip" (optional.Int32) - The offset into the records to return. + * @param "Sort" (optional.Interface of []string) - The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` + * @param "Filter" (optional.Interface of []string) - Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. + * @param "Limit" (optional.Int32) - +@return []SystemInsightsPrograms +*/ + +type SystemInsightsApiSysteminsightsListProgramsOpts struct { + Skip optional.Int32 + Sort optional.Interface + Filter optional.Interface + XOrgId optional.String + Limit optional.Int32 +} + +func (a *SystemInsightsApiService) SysteminsightsListPrograms(ctx context.Context, localVarOptionals *SystemInsightsApiSysteminsightsListProgramsOpts) ([]SystemInsightsPrograms, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []SystemInsightsPrograms + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/systeminsights/programs" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Skip.IsSet() { + localVarQueryParams.Add("skip", parameterToString(localVarOptionals.Skip.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Sort.IsSet() { + localVarQueryParams.Add("sort", parameterToString(localVarOptionals.Sort.Value(), "csv")) + } + if localVarOptionals != nil && localVarOptionals.Filter.IsSet() { + localVarQueryParams.Add("filter", parameterToString(localVarOptionals.Filter.Value(), "csv")) + } + if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { + localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v []SystemInsightsPrograms + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +SystemInsightsApiService List System Insights Python Packages +Valid filter fields are `system_id` and `name`. + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param optional nil or *SystemInsightsApiSysteminsightsListPythonPackagesOpts - Optional Parameters: + * @param "Skip" (optional.Int32) - The offset into the records to return. + * @param "Sort" (optional.Interface of []string) - The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` + * @param "Filter" (optional.Interface of []string) - Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. + * @param "Limit" (optional.Int32) - +@return []SystemInsightsPythonPackages +*/ + +type SystemInsightsApiSysteminsightsListPythonPackagesOpts struct { + Skip optional.Int32 + Sort optional.Interface + Filter optional.Interface + XOrgId optional.String + Limit optional.Int32 +} + +func (a *SystemInsightsApiService) SysteminsightsListPythonPackages(ctx context.Context, localVarOptionals *SystemInsightsApiSysteminsightsListPythonPackagesOpts) ([]SystemInsightsPythonPackages, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []SystemInsightsPythonPackages + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/systeminsights/python_packages" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Skip.IsSet() { + localVarQueryParams.Add("skip", parameterToString(localVarOptionals.Skip.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Sort.IsSet() { + localVarQueryParams.Add("sort", parameterToString(localVarOptionals.Sort.Value(), "csv")) + } + if localVarOptionals != nil && localVarOptionals.Filter.IsSet() { + localVarQueryParams.Add("filter", parameterToString(localVarOptionals.Filter.Value(), "csv")) + } + if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { + localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v []SystemInsightsPythonPackages + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +SystemInsightsApiService List System Insights Safari Extensions +Valid filter fields are `system_id` and `name`. + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param optional nil or *SystemInsightsApiSysteminsightsListSafariExtensionsOpts - Optional Parameters: + * @param "Skip" (optional.Int32) - The offset into the records to return. + * @param "Sort" (optional.Interface of []string) - The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` + * @param "Filter" (optional.Interface of []string) - Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. + * @param "Limit" (optional.Int32) - +@return []SystemInsightsSafariExtensions +*/ + +type SystemInsightsApiSysteminsightsListSafariExtensionsOpts struct { + Skip optional.Int32 + Sort optional.Interface + Filter optional.Interface + XOrgId optional.String + Limit optional.Int32 +} + +func (a *SystemInsightsApiService) SysteminsightsListSafariExtensions(ctx context.Context, localVarOptionals *SystemInsightsApiSysteminsightsListSafariExtensionsOpts) ([]SystemInsightsSafariExtensions, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []SystemInsightsSafariExtensions + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/systeminsights/safari_extensions" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Skip.IsSet() { + localVarQueryParams.Add("skip", parameterToString(localVarOptionals.Skip.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Sort.IsSet() { + localVarQueryParams.Add("sort", parameterToString(localVarOptionals.Sort.Value(), "csv")) + } + if localVarOptionals != nil && localVarOptionals.Filter.IsSet() { + localVarQueryParams.Add("filter", parameterToString(localVarOptionals.Filter.Value(), "csv")) + } + if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { + localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v []SystemInsightsSafariExtensions + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +SystemInsightsApiService List System Insights Scheduled Tasks +Valid filter fields are `system_id` and `enabled`. + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param optional nil or *SystemInsightsApiSysteminsightsListScheduledTasksOpts - Optional Parameters: + * @param "Skip" (optional.Int32) - The offset into the records to return. + * @param "Sort" (optional.Interface of []string) - The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` + * @param "Filter" (optional.Interface of []string) - Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. + * @param "Limit" (optional.Int32) - +@return []SystemInsightsScheduledTasks +*/ + +type SystemInsightsApiSysteminsightsListScheduledTasksOpts struct { + Skip optional.Int32 + Sort optional.Interface + Filter optional.Interface + XOrgId optional.String + Limit optional.Int32 +} + +func (a *SystemInsightsApiService) SysteminsightsListScheduledTasks(ctx context.Context, localVarOptionals *SystemInsightsApiSysteminsightsListScheduledTasksOpts) ([]SystemInsightsScheduledTasks, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []SystemInsightsScheduledTasks + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/systeminsights/scheduled_tasks" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Skip.IsSet() { + localVarQueryParams.Add("skip", parameterToString(localVarOptionals.Skip.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Sort.IsSet() { + localVarQueryParams.Add("sort", parameterToString(localVarOptionals.Sort.Value(), "csv")) + } + if localVarOptionals != nil && localVarOptionals.Filter.IsSet() { + localVarQueryParams.Add("filter", parameterToString(localVarOptionals.Filter.Value(), "csv")) + } + if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { + localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v []SystemInsightsScheduledTasks + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +SystemInsightsApiService List System Insights Secure Boot +Valid filter fields are `system_id`. + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param optional nil or *SystemInsightsApiSysteminsightsListSecurebootOpts - Optional Parameters: + * @param "Skip" (optional.Int32) - The offset into the records to return. + * @param "Sort" (optional.Interface of []string) - The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` + * @param "Filter" (optional.Interface of []string) - Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. + * @param "Limit" (optional.Int32) - +@return []SystemInsightsSecureboot +*/ + +type SystemInsightsApiSysteminsightsListSecurebootOpts struct { + Skip optional.Int32 + Sort optional.Interface + Filter optional.Interface + XOrgId optional.String + Limit optional.Int32 +} + +func (a *SystemInsightsApiService) SysteminsightsListSecureboot(ctx context.Context, localVarOptionals *SystemInsightsApiSysteminsightsListSecurebootOpts) ([]SystemInsightsSecureboot, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []SystemInsightsSecureboot + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/systeminsights/secureboot" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Skip.IsSet() { + localVarQueryParams.Add("skip", parameterToString(localVarOptionals.Skip.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Sort.IsSet() { + localVarQueryParams.Add("sort", parameterToString(localVarOptionals.Sort.Value(), "csv")) + } + if localVarOptionals != nil && localVarOptionals.Filter.IsSet() { + localVarQueryParams.Add("filter", parameterToString(localVarOptionals.Filter.Value(), "csv")) + } + if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { + localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v []SystemInsightsSecureboot + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 400 { + var v string + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +SystemInsightsApiService List System Insights Services +Valid filter fields are `system_id` and `name`. + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param optional nil or *SystemInsightsApiSysteminsightsListServicesOpts - Optional Parameters: + * @param "Skip" (optional.Int32) - The offset into the records to return. + * @param "Sort" (optional.Interface of []string) - The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` + * @param "Filter" (optional.Interface of []string) - Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. + * @param "Limit" (optional.Int32) - +@return []SystemInsightsServices +*/ + +type SystemInsightsApiSysteminsightsListServicesOpts struct { + Skip optional.Int32 + Sort optional.Interface + Filter optional.Interface + XOrgId optional.String + Limit optional.Int32 +} + +func (a *SystemInsightsApiService) SysteminsightsListServices(ctx context.Context, localVarOptionals *SystemInsightsApiSysteminsightsListServicesOpts) ([]SystemInsightsServices, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []SystemInsightsServices + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/systeminsights/services" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Skip.IsSet() { + localVarQueryParams.Add("skip", parameterToString(localVarOptionals.Skip.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Sort.IsSet() { + localVarQueryParams.Add("sort", parameterToString(localVarOptionals.Sort.Value(), "csv")) + } + if localVarOptionals != nil && localVarOptionals.Filter.IsSet() { + localVarQueryParams.Add("filter", parameterToString(localVarOptionals.Filter.Value(), "csv")) + } + if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { + localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v []SystemInsightsServices + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +SystemInsightsApiService LIst System Insights Shadow +Valid filter fields are `system_id` and `username`. + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param optional nil or *SystemInsightsApiSysteminsightsListShadowOpts - Optional Parameters: + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. + * @param "Skip" (optional.Int32) - The offset into the records to return. + * @param "Sort" (optional.Interface of []string) - The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` + * @param "Filter" (optional.Interface of []string) - Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` + * @param "Limit" (optional.Int32) - +@return []SystemInsightsShadow +*/ + +type SystemInsightsApiSysteminsightsListShadowOpts struct { + XOrgId optional.String + Skip optional.Int32 + Sort optional.Interface + Filter optional.Interface + Limit optional.Int32 +} + +func (a *SystemInsightsApiService) SysteminsightsListShadow(ctx context.Context, localVarOptionals *SystemInsightsApiSysteminsightsListShadowOpts) ([]SystemInsightsShadow, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []SystemInsightsShadow + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/systeminsights/shadow" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Skip.IsSet() { + localVarQueryParams.Add("skip", parameterToString(localVarOptionals.Skip.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Sort.IsSet() { + localVarQueryParams.Add("sort", parameterToString(localVarOptionals.Sort.Value(), "csv")) + } + if localVarOptionals != nil && localVarOptionals.Filter.IsSet() { + localVarQueryParams.Add("filter", parameterToString(localVarOptionals.Filter.Value(), "csv")) + } + if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { + localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v []SystemInsightsShadow + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +SystemInsightsApiService List System Insights Shared Folders +Valid filter fields are `system_id` and `name`. + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param optional nil or *SystemInsightsApiSysteminsightsListSharedFoldersOpts - Optional Parameters: + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. + * @param "Skip" (optional.Int32) - The offset into the records to return. + * @param "Sort" (optional.Interface of []string) - The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` + * @param "Filter" (optional.Interface of []string) - Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` + * @param "Limit" (optional.Int32) - +@return []SystemInsightsSharedFolders +*/ + +type SystemInsightsApiSysteminsightsListSharedFoldersOpts struct { + XOrgId optional.String + Skip optional.Int32 + Sort optional.Interface + Filter optional.Interface + Limit optional.Int32 +} + +func (a *SystemInsightsApiService) SysteminsightsListSharedFolders(ctx context.Context, localVarOptionals *SystemInsightsApiSysteminsightsListSharedFoldersOpts) ([]SystemInsightsSharedFolders, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []SystemInsightsSharedFolders + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/systeminsights/shared_folders" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Skip.IsSet() { + localVarQueryParams.Add("skip", parameterToString(localVarOptionals.Skip.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Sort.IsSet() { + localVarQueryParams.Add("sort", parameterToString(localVarOptionals.Sort.Value(), "csv")) + } + if localVarOptionals != nil && localVarOptionals.Filter.IsSet() { + localVarQueryParams.Add("filter", parameterToString(localVarOptionals.Filter.Value(), "csv")) + } + if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { + localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v []SystemInsightsSharedFolders + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +SystemInsightsApiService List System Insights Shared Resources +Valid filter fields are `system_id` and `type`. + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param optional nil or *SystemInsightsApiSysteminsightsListSharedResourcesOpts - Optional Parameters: + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. + * @param "Skip" (optional.Int32) - The offset into the records to return. + * @param "Sort" (optional.Interface of []string) - The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` + * @param "Filter" (optional.Interface of []string) - Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` + * @param "Limit" (optional.Int32) - +@return []SystemInsightsSharedResources +*/ + +type SystemInsightsApiSysteminsightsListSharedResourcesOpts struct { + XOrgId optional.String + Skip optional.Int32 + Sort optional.Interface + Filter optional.Interface + Limit optional.Int32 +} + +func (a *SystemInsightsApiService) SysteminsightsListSharedResources(ctx context.Context, localVarOptionals *SystemInsightsApiSysteminsightsListSharedResourcesOpts) ([]SystemInsightsSharedResources, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []SystemInsightsSharedResources + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/systeminsights/shared_resources" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Skip.IsSet() { + localVarQueryParams.Add("skip", parameterToString(localVarOptionals.Skip.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Sort.IsSet() { + localVarQueryParams.Add("sort", parameterToString(localVarOptionals.Sort.Value(), "csv")) + } + if localVarOptionals != nil && localVarOptionals.Filter.IsSet() { + localVarQueryParams.Add("filter", parameterToString(localVarOptionals.Filter.Value(), "csv")) + } + if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { + localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v []SystemInsightsSharedResources + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +SystemInsightsApiService List System Insights Sharing Preferences +Only valid filed field is `system_id`. + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param optional nil or *SystemInsightsApiSysteminsightsListSharingPreferencesOpts - Optional Parameters: + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. + * @param "Skip" (optional.Int32) - The offset into the records to return. + * @param "Sort" (optional.Interface of []string) - The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` + * @param "Filter" (optional.Interface of []string) - Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` + * @param "Limit" (optional.Int32) - +@return []SystemInsightsSharingPreferences +*/ + +type SystemInsightsApiSysteminsightsListSharingPreferencesOpts struct { + XOrgId optional.String + Skip optional.Int32 + Sort optional.Interface + Filter optional.Interface + Limit optional.Int32 +} + +func (a *SystemInsightsApiService) SysteminsightsListSharingPreferences(ctx context.Context, localVarOptionals *SystemInsightsApiSysteminsightsListSharingPreferencesOpts) ([]SystemInsightsSharingPreferences, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []SystemInsightsSharingPreferences + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/systeminsights/sharing_preferences" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Skip.IsSet() { + localVarQueryParams.Add("skip", parameterToString(localVarOptionals.Skip.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Sort.IsSet() { + localVarQueryParams.Add("sort", parameterToString(localVarOptionals.Sort.Value(), "csv")) + } + if localVarOptionals != nil && localVarOptionals.Filter.IsSet() { + localVarQueryParams.Add("filter", parameterToString(localVarOptionals.Filter.Value(), "csv")) + } + if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { + localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v []SystemInsightsSharingPreferences + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +SystemInsightsApiService List System Insights SIP Config +Valid filter fields are `system_id` and `enabled`. + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param optional nil or *SystemInsightsApiSysteminsightsListSipConfigOpts - Optional Parameters: + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. + * @param "Skip" (optional.Int32) - The offset into the records to return. + * @param "Sort" (optional.Interface of []string) - The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` + * @param "Filter" (optional.Interface of []string) - Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` + * @param "Limit" (optional.Int32) - +@return []SystemInsightsSipConfig +*/ + +type SystemInsightsApiSysteminsightsListSipConfigOpts struct { + XOrgId optional.String + Skip optional.Int32 + Sort optional.Interface + Filter optional.Interface + Limit optional.Int32 +} + +func (a *SystemInsightsApiService) SysteminsightsListSipConfig(ctx context.Context, localVarOptionals *SystemInsightsApiSysteminsightsListSipConfigOpts) ([]SystemInsightsSipConfig, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []SystemInsightsSipConfig + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/systeminsights/sip_config" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Skip.IsSet() { + localVarQueryParams.Add("skip", parameterToString(localVarOptionals.Skip.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Sort.IsSet() { + localVarQueryParams.Add("sort", parameterToString(localVarOptionals.Sort.Value(), "csv")) + } + if localVarOptionals != nil && localVarOptionals.Filter.IsSet() { + localVarQueryParams.Add("filter", parameterToString(localVarOptionals.Filter.Value(), "csv")) + } + if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { + localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v []SystemInsightsSipConfig + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +SystemInsightsApiService List System Insights Startup Items +Valid filter fields are `system_id` and `name`. + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param optional nil or *SystemInsightsApiSysteminsightsListStartupItemsOpts - Optional Parameters: + * @param "Skip" (optional.Int32) - The offset into the records to return. + * @param "Sort" (optional.Interface of []string) - The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` + * @param "Filter" (optional.Interface of []string) - Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. + * @param "Limit" (optional.Int32) - +@return []SystemInsightsStartupItems +*/ + +type SystemInsightsApiSysteminsightsListStartupItemsOpts struct { + Skip optional.Int32 + Sort optional.Interface + Filter optional.Interface + XOrgId optional.String + Limit optional.Int32 +} + +func (a *SystemInsightsApiService) SysteminsightsListStartupItems(ctx context.Context, localVarOptionals *SystemInsightsApiSysteminsightsListStartupItemsOpts) ([]SystemInsightsStartupItems, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []SystemInsightsStartupItems + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/systeminsights/startup_items" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Skip.IsSet() { + localVarQueryParams.Add("skip", parameterToString(localVarOptionals.Skip.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Sort.IsSet() { + localVarQueryParams.Add("sort", parameterToString(localVarOptionals.Sort.Value(), "csv")) + } + if localVarOptionals != nil && localVarOptionals.Filter.IsSet() { + localVarQueryParams.Add("filter", parameterToString(localVarOptionals.Filter.Value(), "csv")) + } + if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { + localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v []SystemInsightsStartupItems + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +SystemInsightsApiService List System Insights System Control +Valid filter fields are `system_id` and `name`. + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param optional nil or *SystemInsightsApiSysteminsightsListSystemControlsOpts - Optional Parameters: + * @param "Skip" (optional.Int32) - The offset into the records to return. + * @param "Sort" (optional.Interface of []string) - The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` + * @param "Filter" (optional.Interface of []string) - Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` Note: You can only filter by `system_id` and `name` + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. + * @param "Limit" (optional.Int32) - +@return []SystemInsightsSystemControls +*/ + +type SystemInsightsApiSysteminsightsListSystemControlsOpts struct { + Skip optional.Int32 + Sort optional.Interface + Filter optional.Interface + XOrgId optional.String + Limit optional.Int32 +} + +func (a *SystemInsightsApiService) SysteminsightsListSystemControls(ctx context.Context, localVarOptionals *SystemInsightsApiSysteminsightsListSystemControlsOpts) ([]SystemInsightsSystemControls, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []SystemInsightsSystemControls + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/systeminsights/system_controls" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Skip.IsSet() { + localVarQueryParams.Add("skip", parameterToString(localVarOptionals.Skip.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Sort.IsSet() { + localVarQueryParams.Add("sort", parameterToString(localVarOptionals.Sort.Value(), "csv")) + } + if localVarOptionals != nil && localVarOptionals.Filter.IsSet() { + localVarQueryParams.Add("filter", parameterToString(localVarOptionals.Filter.Value(), "csv")) + } + if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { + localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v []SystemInsightsSystemControls + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +SystemInsightsApiService List System Insights System Info +Valid filter fields are `system_id` and `cpu_subtype`. + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param optional nil or *SystemInsightsApiSysteminsightsListSystemInfoOpts - Optional Parameters: + * @param "Skip" (optional.Int32) - The offset into the records to return. + * @param "Sort" (optional.Interface of []string) - The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` + * @param "Filter" (optional.Interface of []string) - Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. + * @param "Limit" (optional.Int32) - +@return []SystemInsightsSystemInfo +*/ + +type SystemInsightsApiSysteminsightsListSystemInfoOpts struct { + Skip optional.Int32 + Sort optional.Interface + Filter optional.Interface + XOrgId optional.String + Limit optional.Int32 +} + +func (a *SystemInsightsApiService) SysteminsightsListSystemInfo(ctx context.Context, localVarOptionals *SystemInsightsApiSysteminsightsListSystemInfoOpts) ([]SystemInsightsSystemInfo, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []SystemInsightsSystemInfo + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/systeminsights/system_info" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Skip.IsSet() { + localVarQueryParams.Add("skip", parameterToString(localVarOptionals.Skip.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Sort.IsSet() { + localVarQueryParams.Add("sort", parameterToString(localVarOptionals.Sort.Value(), "csv")) + } + if localVarOptionals != nil && localVarOptionals.Filter.IsSet() { + localVarQueryParams.Add("filter", parameterToString(localVarOptionals.Filter.Value(), "csv")) + } + if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { + localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v []SystemInsightsSystemInfo + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +SystemInsightsApiService List System Insights TPM Info +Valid filter fields are `system_id`. + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param optional nil or *SystemInsightsApiSysteminsightsListTpmInfoOpts - Optional Parameters: + * @param "Skip" (optional.Int32) - The offset into the records to return. + * @param "Sort" (optional.Interface of []string) - The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` + * @param "Filter" (optional.Interface of []string) - Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. + * @param "Limit" (optional.Int32) - +@return []SystemInsightsTpmInfo +*/ + +type SystemInsightsApiSysteminsightsListTpmInfoOpts struct { + Skip optional.Int32 + Sort optional.Interface + Filter optional.Interface + XOrgId optional.String + Limit optional.Int32 +} + +func (a *SystemInsightsApiService) SysteminsightsListTpmInfo(ctx context.Context, localVarOptionals *SystemInsightsApiSysteminsightsListTpmInfoOpts) ([]SystemInsightsTpmInfo, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []SystemInsightsTpmInfo + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/systeminsights/tpm_info" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Skip.IsSet() { + localVarQueryParams.Add("skip", parameterToString(localVarOptionals.Skip.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Sort.IsSet() { + localVarQueryParams.Add("sort", parameterToString(localVarOptionals.Sort.Value(), "csv")) + } + if localVarOptionals != nil && localVarOptionals.Filter.IsSet() { + localVarQueryParams.Add("filter", parameterToString(localVarOptionals.Filter.Value(), "csv")) + } + if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { + localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"text/html"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v []SystemInsightsTpmInfo + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 400 { + var v string + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +SystemInsightsApiService List System Insights Uptime +Valid filter fields are `system_id` and `days`. + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param optional nil or *SystemInsightsApiSysteminsightsListUptimeOpts - Optional Parameters: + * @param "Skip" (optional.Int32) - The offset into the records to return. + * @param "Sort" (optional.Interface of []string) - The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` + * @param "Filter" (optional.Interface of []string) - Supported operators are: eq, gte, in. e.g: Filter for single value: `filter=field:gte:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. + * @param "Limit" (optional.Int32) - +@return []SystemInsightsUptime +*/ + +type SystemInsightsApiSysteminsightsListUptimeOpts struct { + Skip optional.Int32 + Sort optional.Interface + Filter optional.Interface + XOrgId optional.String + Limit optional.Int32 +} + +func (a *SystemInsightsApiService) SysteminsightsListUptime(ctx context.Context, localVarOptionals *SystemInsightsApiSysteminsightsListUptimeOpts) ([]SystemInsightsUptime, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []SystemInsightsUptime + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/systeminsights/uptime" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Skip.IsSet() { + localVarQueryParams.Add("skip", parameterToString(localVarOptionals.Skip.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Sort.IsSet() { + localVarQueryParams.Add("sort", parameterToString(localVarOptionals.Sort.Value(), "csv")) + } + if localVarOptionals != nil && localVarOptionals.Filter.IsSet() { + localVarQueryParams.Add("filter", parameterToString(localVarOptionals.Filter.Value(), "csv")) + } + if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { + localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v []SystemInsightsUptime + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +SystemInsightsApiService List System Insights USB Devices +Valid filter fields are `system_id` and `model`. + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param optional nil or *SystemInsightsApiSysteminsightsListUsbDevicesOpts - Optional Parameters: + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. + * @param "Skip" (optional.Int32) - The offset into the records to return. + * @param "Sort" (optional.Interface of []string) - The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` + * @param "Filter" (optional.Interface of []string) - Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` + * @param "Limit" (optional.Int32) - +@return []SystemInsightsUsbDevices +*/ + +type SystemInsightsApiSysteminsightsListUsbDevicesOpts struct { + XOrgId optional.String + Skip optional.Int32 + Sort optional.Interface + Filter optional.Interface + Limit optional.Int32 +} + +func (a *SystemInsightsApiService) SysteminsightsListUsbDevices(ctx context.Context, localVarOptionals *SystemInsightsApiSysteminsightsListUsbDevicesOpts) ([]SystemInsightsUsbDevices, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []SystemInsightsUsbDevices + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/systeminsights/usb_devices" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Skip.IsSet() { + localVarQueryParams.Add("skip", parameterToString(localVarOptionals.Skip.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Sort.IsSet() { + localVarQueryParams.Add("sort", parameterToString(localVarOptionals.Sort.Value(), "csv")) + } + if localVarOptionals != nil && localVarOptionals.Filter.IsSet() { + localVarQueryParams.Add("filter", parameterToString(localVarOptionals.Filter.Value(), "csv")) + } + if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { + localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v []SystemInsightsUsbDevices + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +SystemInsightsApiService List System Insights User Groups +Only valid filter field is `system_id`. + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param optional nil or *SystemInsightsApiSysteminsightsListUserGroupsOpts - Optional Parameters: + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. + * @param "Skip" (optional.Int32) - The offset into the records to return. + * @param "Sort" (optional.Interface of []string) - The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` + * @param "Filter" (optional.Interface of []string) - Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` + * @param "Limit" (optional.Int32) - +@return []SystemInsightsUserGroups +*/ + +type SystemInsightsApiSysteminsightsListUserGroupsOpts struct { + XOrgId optional.String + Skip optional.Int32 + Sort optional.Interface + Filter optional.Interface + Limit optional.Int32 +} + +func (a *SystemInsightsApiService) SysteminsightsListUserGroups(ctx context.Context, localVarOptionals *SystemInsightsApiSysteminsightsListUserGroupsOpts) ([]SystemInsightsUserGroups, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []SystemInsightsUserGroups + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/systeminsights/user_groups" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Skip.IsSet() { + localVarQueryParams.Add("skip", parameterToString(localVarOptionals.Skip.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Sort.IsSet() { + localVarQueryParams.Add("sort", parameterToString(localVarOptionals.Sort.Value(), "csv")) + } + if localVarOptionals != nil && localVarOptionals.Filter.IsSet() { + localVarQueryParams.Add("filter", parameterToString(localVarOptionals.Filter.Value(), "csv")) + } + if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { + localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v []SystemInsightsUserGroups + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +SystemInsightsApiService List System Insights User SSH Keys +Valid filter fields are `system_id` and `uid`. + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param optional nil or *SystemInsightsApiSysteminsightsListUserSshKeysOpts - Optional Parameters: + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. + * @param "Skip" (optional.Int32) - The offset into the records to return. + * @param "Sort" (optional.Interface of []string) - The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` + * @param "Filter" (optional.Interface of []string) - Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` + * @param "Limit" (optional.Int32) - +@return []SystemInsightsUserSshKeys +*/ + +type SystemInsightsApiSysteminsightsListUserSshKeysOpts struct { + XOrgId optional.String + Skip optional.Int32 + Sort optional.Interface + Filter optional.Interface + Limit optional.Int32 +} + +func (a *SystemInsightsApiService) SysteminsightsListUserSshKeys(ctx context.Context, localVarOptionals *SystemInsightsApiSysteminsightsListUserSshKeysOpts) ([]SystemInsightsUserSshKeys, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []SystemInsightsUserSshKeys + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/systeminsights/user_ssh_keys" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Skip.IsSet() { + localVarQueryParams.Add("skip", parameterToString(localVarOptionals.Skip.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Sort.IsSet() { + localVarQueryParams.Add("sort", parameterToString(localVarOptionals.Sort.Value(), "csv")) + } + if localVarOptionals != nil && localVarOptionals.Filter.IsSet() { + localVarQueryParams.Add("filter", parameterToString(localVarOptionals.Filter.Value(), "csv")) + } + if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { + localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v []SystemInsightsUserSshKeys + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +SystemInsightsApiService List System Insights User Assist +Valid filter fields are `system_id`. + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param optional nil or *SystemInsightsApiSysteminsightsListUserassistOpts - Optional Parameters: + * @param "Skip" (optional.Int32) - The offset into the records to return. + * @param "Sort" (optional.Interface of []string) - The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` + * @param "Filter" (optional.Interface of []string) - Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. + * @param "Limit" (optional.Int32) - +@return []SystemInsightsUserassist +*/ + +type SystemInsightsApiSysteminsightsListUserassistOpts struct { + Skip optional.Int32 + Sort optional.Interface + Filter optional.Interface + XOrgId optional.String + Limit optional.Int32 +} + +func (a *SystemInsightsApiService) SysteminsightsListUserassist(ctx context.Context, localVarOptionals *SystemInsightsApiSysteminsightsListUserassistOpts) ([]SystemInsightsUserassist, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []SystemInsightsUserassist + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/systeminsights/userassist" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Skip.IsSet() { + localVarQueryParams.Add("skip", parameterToString(localVarOptionals.Skip.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Sort.IsSet() { + localVarQueryParams.Add("sort", parameterToString(localVarOptionals.Sort.Value(), "csv")) + } + if localVarOptionals != nil && localVarOptionals.Filter.IsSet() { + localVarQueryParams.Add("filter", parameterToString(localVarOptionals.Filter.Value(), "csv")) + } + if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { + localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v []SystemInsightsUserassist + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 400 { + var v string + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +SystemInsightsApiService List System Insights Users +Valid filter fields are `system_id` and `username`. + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param optional nil or *SystemInsightsApiSysteminsightsListUsersOpts - Optional Parameters: + * @param "Skip" (optional.Int32) - The offset into the records to return. + * @param "Sort" (optional.Interface of []string) - The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` + * @param "Filter" (optional.Interface of []string) - Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. + * @param "Limit" (optional.Int32) - +@return []SystemInsightsUsers +*/ + +type SystemInsightsApiSysteminsightsListUsersOpts struct { + Skip optional.Int32 + Sort optional.Interface + Filter optional.Interface + XOrgId optional.String + Limit optional.Int32 +} + +func (a *SystemInsightsApiService) SysteminsightsListUsers(ctx context.Context, localVarOptionals *SystemInsightsApiSysteminsightsListUsersOpts) ([]SystemInsightsUsers, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []SystemInsightsUsers + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/systeminsights/users" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Skip.IsSet() { + localVarQueryParams.Add("skip", parameterToString(localVarOptionals.Skip.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Sort.IsSet() { + localVarQueryParams.Add("sort", parameterToString(localVarOptionals.Sort.Value(), "csv")) + } + if localVarOptionals != nil && localVarOptionals.Filter.IsSet() { + localVarQueryParams.Add("filter", parameterToString(localVarOptionals.Filter.Value(), "csv")) + } + if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { + localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v []SystemInsightsUsers + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +SystemInsightsApiService List System Insights WiFi Networks +Valid filter fields are `system_id` and `security_type`. + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param optional nil or *SystemInsightsApiSysteminsightsListWifiNetworksOpts - Optional Parameters: + * @param "Skip" (optional.Int32) - The offset into the records to return. + * @param "Sort" (optional.Interface of []string) - The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` + * @param "Filter" (optional.Interface of []string) - Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. + * @param "Limit" (optional.Int32) - +@return []SystemInsightsWifiNetworks +*/ + +type SystemInsightsApiSysteminsightsListWifiNetworksOpts struct { + Skip optional.Int32 + Sort optional.Interface + Filter optional.Interface + XOrgId optional.String + Limit optional.Int32 +} + +func (a *SystemInsightsApiService) SysteminsightsListWifiNetworks(ctx context.Context, localVarOptionals *SystemInsightsApiSysteminsightsListWifiNetworksOpts) ([]SystemInsightsWifiNetworks, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []SystemInsightsWifiNetworks + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/systeminsights/wifi_networks" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Skip.IsSet() { + localVarQueryParams.Add("skip", parameterToString(localVarOptionals.Skip.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Sort.IsSet() { + localVarQueryParams.Add("sort", parameterToString(localVarOptionals.Sort.Value(), "csv")) + } + if localVarOptionals != nil && localVarOptionals.Filter.IsSet() { + localVarQueryParams.Add("filter", parameterToString(localVarOptionals.Filter.Value(), "csv")) + } + if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { + localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v []SystemInsightsWifiNetworks + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +SystemInsightsApiService List System Insights WiFi Status +Valid filter fields are `system_id` and `security_type`. + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param optional nil or *SystemInsightsApiSysteminsightsListWifiStatusOpts - Optional Parameters: + * @param "Skip" (optional.Int32) - The offset into the records to return. + * @param "Sort" (optional.Interface of []string) - The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` + * @param "Filter" (optional.Interface of []string) - Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. + * @param "Limit" (optional.Int32) - +@return []SystemInsightsWifiStatus +*/ + +type SystemInsightsApiSysteminsightsListWifiStatusOpts struct { + Skip optional.Int32 + Sort optional.Interface + Filter optional.Interface + XOrgId optional.String + Limit optional.Int32 +} + +func (a *SystemInsightsApiService) SysteminsightsListWifiStatus(ctx context.Context, localVarOptionals *SystemInsightsApiSysteminsightsListWifiStatusOpts) ([]SystemInsightsWifiStatus, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []SystemInsightsWifiStatus + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/systeminsights/wifi_status" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Skip.IsSet() { + localVarQueryParams.Add("skip", parameterToString(localVarOptionals.Skip.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Sort.IsSet() { + localVarQueryParams.Add("sort", parameterToString(localVarOptionals.Sort.Value(), "csv")) + } + if localVarOptionals != nil && localVarOptionals.Filter.IsSet() { + localVarQueryParams.Add("filter", parameterToString(localVarOptionals.Filter.Value(), "csv")) + } + if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { + localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v []SystemInsightsWifiStatus + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +SystemInsightsApiService List System Insights Windows Security Center +Valid filter fields are `system_id`. + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param optional nil or *SystemInsightsApiSysteminsightsListWindowsSecurityCenterOpts - Optional Parameters: + * @param "Skip" (optional.Int32) - The offset into the records to return. + * @param "Sort" (optional.Interface of []string) - The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` + * @param "Filter" (optional.Interface of []string) - Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. + * @param "Limit" (optional.Int32) - +@return []SystemInsightsWindowsSecurityCenter +*/ + +type SystemInsightsApiSysteminsightsListWindowsSecurityCenterOpts struct { + Skip optional.Int32 + Sort optional.Interface + Filter optional.Interface + XOrgId optional.String + Limit optional.Int32 +} + +func (a *SystemInsightsApiService) SysteminsightsListWindowsSecurityCenter(ctx context.Context, localVarOptionals *SystemInsightsApiSysteminsightsListWindowsSecurityCenterOpts) ([]SystemInsightsWindowsSecurityCenter, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []SystemInsightsWindowsSecurityCenter + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/systeminsights/windows_security_center" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Skip.IsSet() { + localVarQueryParams.Add("skip", parameterToString(localVarOptionals.Skip.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Sort.IsSet() { + localVarQueryParams.Add("sort", parameterToString(localVarOptionals.Sort.Value(), "csv")) + } + if localVarOptionals != nil && localVarOptionals.Filter.IsSet() { + localVarQueryParams.Add("filter", parameterToString(localVarOptionals.Filter.Value(), "csv")) + } + if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { + localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v []SystemInsightsWindowsSecurityCenter + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 400 { + var v string + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +SystemInsightsApiService List System Insights Windows Security Products +Valid filter fields are `system_id` and `state`. + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param optional nil or *SystemInsightsApiSysteminsightsListWindowsSecurityProductsOpts - Optional Parameters: + * @param "Skip" (optional.Int32) - The offset into the records to return. + * @param "Sort" (optional.Interface of []string) - The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` + * @param "Filter" (optional.Interface of []string) - Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. + * @param "Limit" (optional.Int32) - +@return []SystemInsightsWindowsSecurityProducts +*/ + +type SystemInsightsApiSysteminsightsListWindowsSecurityProductsOpts struct { + Skip optional.Int32 + Sort optional.Interface + Filter optional.Interface + XOrgId optional.String + Limit optional.Int32 +} + +func (a *SystemInsightsApiService) SysteminsightsListWindowsSecurityProducts(ctx context.Context, localVarOptionals *SystemInsightsApiSysteminsightsListWindowsSecurityProductsOpts) ([]SystemInsightsWindowsSecurityProducts, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []SystemInsightsWindowsSecurityProducts + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/systeminsights/windows_security_products" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Skip.IsSet() { + localVarQueryParams.Add("skip", parameterToString(localVarOptionals.Skip.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Sort.IsSet() { + localVarQueryParams.Add("sort", parameterToString(localVarOptionals.Sort.Value(), "csv")) + } + if localVarOptionals != nil && localVarOptionals.Filter.IsSet() { + localVarQueryParams.Add("filter", parameterToString(localVarOptionals.Filter.Value(), "csv")) + } + if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { + localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v []SystemInsightsWindowsSecurityProducts + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} diff --git a/jcapiv2/api_systems.go b/jcapiv2/api_systems.go new file mode 100644 index 0000000..e52a849 --- /dev/null +++ b/jcapiv2/api_systems.go @@ -0,0 +1,1346 @@ + +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +import ( + "context" + "io/ioutil" + "net/http" + "net/url" + "strings" + "fmt" + "github.com/antihax/optional" +) + +// Linger please +var ( + _ context.Context +) + +type SystemsApiService service +/* +SystemsApiService List the associations of a System +This endpoint returns the _direct_ associations of a System. A direct association can be a non-homogeneous relationship between 2 different objects, for example Systems and Users. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/systems/{System_ID}/associations?targets=user \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param systemId ObjectID of the System. + * @param targets Targets which a \"system\" can be associated to. + * @param optional nil or *SystemsApiGraphSystemAssociationsListOpts - Optional Parameters: + * @param "Limit" (optional.Int32) - The number of records to return at once. Limited to 100. + * @param "Skip" (optional.Int32) - The offset into the records to return. + * @param "Date" (optional.String) - Current date header for the System Context API + * @param "Authorization" (optional.String) - Authorization header for the System Context API + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. +@return []GraphConnection +*/ + +type SystemsApiGraphSystemAssociationsListOpts struct { + Limit optional.Int32 + Skip optional.Int32 + Date optional.String + Authorization optional.String + XOrgId optional.String +} + +func (a *SystemsApiService) GraphSystemAssociationsList(ctx context.Context, systemId string, targets []string, localVarOptionals *SystemsApiGraphSystemAssociationsListOpts) ([]GraphConnection, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []GraphConnection + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/systems/{system_id}/associations" + localVarPath = strings.Replace(localVarPath, "{"+"system_id"+"}", fmt.Sprintf("%v", systemId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + localVarQueryParams.Add("targets", parameterToString(targets, "csv")) + if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { + localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Skip.IsSet() { + localVarQueryParams.Add("skip", parameterToString(localVarOptionals.Skip.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.Date.IsSet() { + localVarHeaderParams["Date"] = parameterToString(localVarOptionals.Date.Value(), "") + } + if localVarOptionals != nil && localVarOptionals.Authorization.IsSet() { + localVarHeaderParams["Authorization"] = parameterToString(localVarOptionals.Authorization.Value(), "") + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v []GraphConnection + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +SystemsApiService Manage associations of a System +This endpoint allows you to manage the _direct_ associations of a System. A direct association can be a non-homogeneous relationship between 2 different objects, for example Systems and Users. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/systems/{System_ID}/associations \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"attributes\": { \"sudo\": { \"enabled\": true, \"withoutPassword\": false } }, \"op\": \"add\", \"type\": \"user\", \"id\": \"UserID\" }' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param systemId ObjectID of the System. + * @param optional nil or *SystemsApiGraphSystemAssociationsPostOpts - Optional Parameters: + * @param "Body" (optional.Interface of GraphOperationSystem) - + * @param "Date" (optional.String) - Current date header for the System Context API + * @param "Authorization" (optional.String) - Authorization header for the System Context API + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. + +*/ + +type SystemsApiGraphSystemAssociationsPostOpts struct { + Body optional.Interface + Date optional.String + Authorization optional.String + XOrgId optional.String +} + +func (a *SystemsApiService) GraphSystemAssociationsPost(ctx context.Context, systemId string, localVarOptionals *SystemsApiGraphSystemAssociationsPostOpts) (*http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Post") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/systems/{system_id}/associations" + localVarPath = strings.Replace(localVarPath, "{"+"system_id"+"}", fmt.Sprintf("%v", systemId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.Date.IsSet() { + localVarHeaderParams["Date"] = parameterToString(localVarOptionals.Date.Value(), "") + } + if localVarOptionals != nil && localVarOptionals.Authorization.IsSet() { + localVarHeaderParams["Authorization"] = parameterToString(localVarOptionals.Authorization.Value(), "") + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + // body params + if localVarOptionals != nil && localVarOptionals.Body.IsSet() { + + localVarOptionalBody:= localVarOptionals.Body.Value() + localVarPostBody = &localVarOptionalBody + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarHttpResponse, err + } + + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + return localVarHttpResponse, newErr + } + + return localVarHttpResponse, nil +} +/* +SystemsApiService List the parent Groups of a System +This endpoint returns all the System Groups a System is a member of. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/systems/{System_ID}/memberof \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param systemId ObjectID of the System. + * @param optional nil or *SystemsApiGraphSystemMemberOfOpts - Optional Parameters: + * @param "Filter" (optional.Interface of []string) - A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` + * @param "Limit" (optional.Int32) - The number of records to return at once. Limited to 100. + * @param "Skip" (optional.Int32) - The offset into the records to return. + * @param "Date" (optional.String) - Current date header for the System Context API + * @param "Authorization" (optional.String) - Authorization header for the System Context API + * @param "Sort" (optional.Interface of []string) - The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. +@return []GraphObjectWithPaths +*/ + +type SystemsApiGraphSystemMemberOfOpts struct { + Filter optional.Interface + Limit optional.Int32 + Skip optional.Int32 + Date optional.String + Authorization optional.String + Sort optional.Interface + XOrgId optional.String +} + +func (a *SystemsApiService) GraphSystemMemberOf(ctx context.Context, systemId string, localVarOptionals *SystemsApiGraphSystemMemberOfOpts) ([]GraphObjectWithPaths, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []GraphObjectWithPaths + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/systems/{system_id}/memberof" + localVarPath = strings.Replace(localVarPath, "{"+"system_id"+"}", fmt.Sprintf("%v", systemId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Filter.IsSet() { + localVarQueryParams.Add("filter", parameterToString(localVarOptionals.Filter.Value(), "csv")) + } + if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { + localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Skip.IsSet() { + localVarQueryParams.Add("skip", parameterToString(localVarOptionals.Skip.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Sort.IsSet() { + localVarQueryParams.Add("sort", parameterToString(localVarOptionals.Sort.Value(), "csv")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.Date.IsSet() { + localVarHeaderParams["Date"] = parameterToString(localVarOptionals.Date.Value(), "") + } + if localVarOptionals != nil && localVarOptionals.Authorization.IsSet() { + localVarHeaderParams["Authorization"] = parameterToString(localVarOptionals.Authorization.Value(), "") + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v []GraphObjectWithPaths + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +SystemsApiService List the Commands bound to a System +This endpoint will return all Commands bound to a System, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this System to the corresponding Command; this array represents all grouping and/or associations that would have to be removed to deprovision the Command from this System. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/systems/{System_ID}/commands \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param systemId ObjectID of the System. + * @param optional nil or *SystemsApiGraphSystemTraverseCommandOpts - Optional Parameters: + * @param "Limit" (optional.Int32) - The number of records to return at once. Limited to 100. + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. + * @param "Skip" (optional.Int32) - The offset into the records to return. + * @param "Filter" (optional.Interface of []string) - A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` +@return []GraphObjectWithPaths +*/ + +type SystemsApiGraphSystemTraverseCommandOpts struct { + Limit optional.Int32 + XOrgId optional.String + Skip optional.Int32 + Filter optional.Interface +} + +func (a *SystemsApiService) GraphSystemTraverseCommand(ctx context.Context, systemId string, localVarOptionals *SystemsApiGraphSystemTraverseCommandOpts) ([]GraphObjectWithPaths, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []GraphObjectWithPaths + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/systems/{system_id}/commands" + localVarPath = strings.Replace(localVarPath, "{"+"system_id"+"}", fmt.Sprintf("%v", systemId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { + localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Skip.IsSet() { + localVarQueryParams.Add("skip", parameterToString(localVarOptionals.Skip.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Filter.IsSet() { + localVarQueryParams.Add("filter", parameterToString(localVarOptionals.Filter.Value(), "csv")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v []GraphObjectWithPaths + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +SystemsApiService List the Policies bound to a System +This endpoint will return all Policies bound to a System, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this System to the corresponding Policy; this array represents all grouping and/or associations that would have to be removed to deprovision the Policy from this System. See `/members` and `/associations` endpoints to manage those collections. This endpoint is not yet public as we have finish the code. ##### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/{System_ID}/policies \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param systemId ObjectID of the System. + * @param optional nil or *SystemsApiGraphSystemTraversePolicyOpts - Optional Parameters: + * @param "Limit" (optional.Int32) - The number of records to return at once. Limited to 100. + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. + * @param "Skip" (optional.Int32) - The offset into the records to return. + * @param "Filter" (optional.Interface of []string) - A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` +@return []GraphObjectWithPaths +*/ + +type SystemsApiGraphSystemTraversePolicyOpts struct { + Limit optional.Int32 + XOrgId optional.String + Skip optional.Int32 + Filter optional.Interface +} + +func (a *SystemsApiService) GraphSystemTraversePolicy(ctx context.Context, systemId string, localVarOptionals *SystemsApiGraphSystemTraversePolicyOpts) ([]GraphObjectWithPaths, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []GraphObjectWithPaths + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/systems/{system_id}/policies" + localVarPath = strings.Replace(localVarPath, "{"+"system_id"+"}", fmt.Sprintf("%v", systemId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { + localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Skip.IsSet() { + localVarQueryParams.Add("skip", parameterToString(localVarOptionals.Skip.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Filter.IsSet() { + localVarQueryParams.Add("filter", parameterToString(localVarOptionals.Filter.Value(), "csv")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v []GraphObjectWithPaths + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +SystemsApiService List the Policy Groups bound to a System +This endpoint will return all Policy Groups bound to a System, either directly or indirectly essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this System to the corresponding Policy Group; this array represents all grouping and/or associations that would have to be removed to deprovision the Policy Group from this System. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/systems/{System_ID}/policygroups \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param systemId ObjectID of the System. + * @param optional nil or *SystemsApiGraphSystemTraversePolicyGroupOpts - Optional Parameters: + * @param "Limit" (optional.Int32) - The number of records to return at once. Limited to 100. + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. + * @param "Skip" (optional.Int32) - The offset into the records to return. + * @param "Date" (optional.String) - Current date header for the System Context API + * @param "Authorization" (optional.String) - Authorization header for the System Context API + * @param "Filter" (optional.Interface of []string) - A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` +@return []GraphObjectWithPaths +*/ + +type SystemsApiGraphSystemTraversePolicyGroupOpts struct { + Limit optional.Int32 + XOrgId optional.String + Skip optional.Int32 + Date optional.String + Authorization optional.String + Filter optional.Interface +} + +func (a *SystemsApiService) GraphSystemTraversePolicyGroup(ctx context.Context, systemId string, localVarOptionals *SystemsApiGraphSystemTraversePolicyGroupOpts) ([]GraphObjectWithPaths, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []GraphObjectWithPaths + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/systems/{system_id}/policygroups" + localVarPath = strings.Replace(localVarPath, "{"+"system_id"+"}", fmt.Sprintf("%v", systemId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { + localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Skip.IsSet() { + localVarQueryParams.Add("skip", parameterToString(localVarOptionals.Skip.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Filter.IsSet() { + localVarQueryParams.Add("filter", parameterToString(localVarOptionals.Filter.Value(), "csv")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if localVarOptionals != nil && localVarOptionals.Date.IsSet() { + localVarHeaderParams["Date"] = parameterToString(localVarOptionals.Date.Value(), "") + } + if localVarOptionals != nil && localVarOptionals.Authorization.IsSet() { + localVarHeaderParams["Authorization"] = parameterToString(localVarOptionals.Authorization.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v []GraphObjectWithPaths + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +SystemsApiService List the Users bound to a System +This endpoint will return all Users bound to a System, either directly or indirectly essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this System to the corresponding User; this array represents all grouping and/or associations that would have to be removed to deprovision the User from this System. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/systems/{System_ID}/users \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param systemId ObjectID of the System. + * @param optional nil or *SystemsApiGraphSystemTraverseUserOpts - Optional Parameters: + * @param "Limit" (optional.Int32) - The number of records to return at once. Limited to 100. + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. + * @param "Skip" (optional.Int32) - The offset into the records to return. + * @param "Date" (optional.String) - Current date header for the System Context API + * @param "Authorization" (optional.String) - Authorization header for the System Context API + * @param "Filter" (optional.Interface of []string) - A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` +@return []GraphObjectWithPaths +*/ + +type SystemsApiGraphSystemTraverseUserOpts struct { + Limit optional.Int32 + XOrgId optional.String + Skip optional.Int32 + Date optional.String + Authorization optional.String + Filter optional.Interface +} + +func (a *SystemsApiService) GraphSystemTraverseUser(ctx context.Context, systemId string, localVarOptionals *SystemsApiGraphSystemTraverseUserOpts) ([]GraphObjectWithPaths, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []GraphObjectWithPaths + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/systems/{system_id}/users" + localVarPath = strings.Replace(localVarPath, "{"+"system_id"+"}", fmt.Sprintf("%v", systemId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { + localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Skip.IsSet() { + localVarQueryParams.Add("skip", parameterToString(localVarOptionals.Skip.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Filter.IsSet() { + localVarQueryParams.Add("filter", parameterToString(localVarOptionals.Filter.Value(), "csv")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if localVarOptionals != nil && localVarOptionals.Date.IsSet() { + localVarHeaderParams["Date"] = parameterToString(localVarOptionals.Date.Value(), "") + } + if localVarOptionals != nil && localVarOptionals.Authorization.IsSet() { + localVarHeaderParams["Authorization"] = parameterToString(localVarOptionals.Authorization.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v []GraphObjectWithPaths + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +SystemsApiService List the User Groups bound to a System +This endpoint will return all User Groups bound to a System, either directly or indirectly essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this System to the corresponding User Group; this array represents all grouping and/or associations that would have to be removed to deprovision the User Group from this System. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/systems/{System_ID}/usergroups \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param systemId ObjectID of the System. + * @param optional nil or *SystemsApiGraphSystemTraverseUserGroupOpts - Optional Parameters: + * @param "Limit" (optional.Int32) - The number of records to return at once. Limited to 100. + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. + * @param "Skip" (optional.Int32) - The offset into the records to return. + * @param "Date" (optional.String) - Current date header for the System Context API + * @param "Authorization" (optional.String) - Authorization header for the System Context API + * @param "Filter" (optional.Interface of []string) - A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` +@return []GraphObjectWithPaths +*/ + +type SystemsApiGraphSystemTraverseUserGroupOpts struct { + Limit optional.Int32 + XOrgId optional.String + Skip optional.Int32 + Date optional.String + Authorization optional.String + Filter optional.Interface +} + +func (a *SystemsApiService) GraphSystemTraverseUserGroup(ctx context.Context, systemId string, localVarOptionals *SystemsApiGraphSystemTraverseUserGroupOpts) ([]GraphObjectWithPaths, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []GraphObjectWithPaths + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/systems/{system_id}/usergroups" + localVarPath = strings.Replace(localVarPath, "{"+"system_id"+"}", fmt.Sprintf("%v", systemId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { + localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Skip.IsSet() { + localVarQueryParams.Add("skip", parameterToString(localVarOptionals.Skip.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Filter.IsSet() { + localVarQueryParams.Add("filter", parameterToString(localVarOptionals.Filter.Value(), "csv")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if localVarOptionals != nil && localVarOptionals.Date.IsSet() { + localVarHeaderParams["Date"] = parameterToString(localVarOptionals.Date.Value(), "") + } + if localVarOptionals != nil && localVarOptionals.Authorization.IsSet() { + localVarHeaderParams["Authorization"] = parameterToString(localVarOptionals.Authorization.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v []GraphObjectWithPaths + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +SystemsApiService Get System FDE Key +This endpoint will return the current (latest) fde key saved for a system. + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param systemId + * @param optional nil or *SystemsApiSystemsGetFDEKeyOpts - Optional Parameters: + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. +@return Systemfdekey +*/ + +type SystemsApiSystemsGetFDEKeyOpts struct { + XOrgId optional.String +} + +func (a *SystemsApiService) SystemsGetFDEKey(ctx context.Context, systemId string, localVarOptionals *SystemsApiSystemsGetFDEKeyOpts) (Systemfdekey, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue Systemfdekey + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/systems/{system_id}/fdekey" + localVarPath = strings.Replace(localVarPath, "{"+"system_id"+"}", fmt.Sprintf("%v", systemId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v Systemfdekey + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 400 { + var v ErrorDetails + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 401 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 403 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 404 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 409 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 500 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +SystemsApiService List the associated Software Application Statuses of a System +This endpoint returns all the statuses of the associated Software Applications from the provided JumpCloud system ID. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/systems/{system_id}/softwareappstatuses \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param systemId ObjectID of the System. + * @param optional nil or *SystemsApiSystemsListSoftwareAppsWithStatusesOpts - Optional Parameters: + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. + * @param "Filter" (optional.Interface of []string) - A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` + * @param "Limit" (optional.Int32) - The number of records to return at once. Limited to 100. + * @param "Skip" (optional.Int32) - The offset into the records to return. + * @param "Sort" (optional.Interface of []string) - The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. +@return []SoftwareAppWithStatus +*/ + +type SystemsApiSystemsListSoftwareAppsWithStatusesOpts struct { + XOrgId optional.String + Filter optional.Interface + Limit optional.Int32 + Skip optional.Int32 + Sort optional.Interface +} + +func (a *SystemsApiService) SystemsListSoftwareAppsWithStatuses(ctx context.Context, systemId string, localVarOptionals *SystemsApiSystemsListSoftwareAppsWithStatusesOpts) ([]SoftwareAppWithStatus, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []SoftwareAppWithStatus + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/systems/{system_id}/softwareappstatuses" + localVarPath = strings.Replace(localVarPath, "{"+"system_id"+"}", fmt.Sprintf("%v", systemId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Filter.IsSet() { + localVarQueryParams.Add("filter", parameterToString(localVarOptionals.Filter.Value(), "csv")) + } + if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { + localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Skip.IsSet() { + localVarQueryParams.Add("skip", parameterToString(localVarOptionals.Skip.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Sort.IsSet() { + localVarQueryParams.Add("sort", parameterToString(localVarOptionals.Sort.Value(), "csv")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v []SoftwareAppWithStatus + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} diff --git a/jcapiv2/api_user_group_associations.go b/jcapiv2/api_user_group_associations.go new file mode 100644 index 0000000..14d37d4 --- /dev/null +++ b/jcapiv2/api_user_group_associations.go @@ -0,0 +1,1354 @@ + +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +import ( + "context" + "io/ioutil" + "net/http" + "net/url" + "strings" + "fmt" + "github.com/antihax/optional" +) + +// Linger please +var ( + _ context.Context +) + +type UserGroupAssociationsApiService service +/* +UserGroupAssociationsApiService List the associations of a User Group. +This endpoint returns the _direct_ associations of this User Group. A direct association can be a non-homogeneous relationship between 2 different objects, for example User Groups and Users. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/usergroups/{GroupID}/associations?targets=system \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param groupId ObjectID of the User Group. + * @param targets Targets which a \"user_group\" can be associated to. + * @param optional nil or *UserGroupAssociationsApiGraphUserGroupAssociationsListOpts - Optional Parameters: + * @param "Limit" (optional.Int32) - The number of records to return at once. Limited to 100. + * @param "Skip" (optional.Int32) - The offset into the records to return. + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. +@return []GraphConnection +*/ + +type UserGroupAssociationsApiGraphUserGroupAssociationsListOpts struct { + Limit optional.Int32 + Skip optional.Int32 + XOrgId optional.String +} + +func (a *UserGroupAssociationsApiService) GraphUserGroupAssociationsList(ctx context.Context, groupId string, targets []string, localVarOptionals *UserGroupAssociationsApiGraphUserGroupAssociationsListOpts) ([]GraphConnection, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []GraphConnection + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/usergroups/{group_id}/associations" + localVarPath = strings.Replace(localVarPath, "{"+"group_id"+"}", fmt.Sprintf("%v", groupId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + localVarQueryParams.Add("targets", parameterToString(targets, "csv")) + if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { + localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Skip.IsSet() { + localVarQueryParams.Add("skip", parameterToString(localVarOptionals.Skip.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v []GraphConnection + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +UserGroupAssociationsApiService Manage the associations of a User Group +This endpoint manages the _direct_ associations of this User Group. A direct association can be a non-homogeneous relationship between 2 different objects, for example User Groups and Users. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/usergroups/{GroupID}/associations \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"op\": \"add\", \"type\": \"system\", \"id\": \"{SystemID}\" }' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param groupId ObjectID of the User Group. + * @param optional nil or *UserGroupAssociationsApiGraphUserGroupAssociationsPostOpts - Optional Parameters: + * @param "Body" (optional.Interface of GraphOperationUserGroup) - + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. + +*/ + +type UserGroupAssociationsApiGraphUserGroupAssociationsPostOpts struct { + Body optional.Interface + XOrgId optional.String +} + +func (a *UserGroupAssociationsApiService) GraphUserGroupAssociationsPost(ctx context.Context, groupId string, localVarOptionals *UserGroupAssociationsApiGraphUserGroupAssociationsPostOpts) (*http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Post") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/usergroups/{group_id}/associations" + localVarPath = strings.Replace(localVarPath, "{"+"group_id"+"}", fmt.Sprintf("%v", groupId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + // body params + if localVarOptionals != nil && localVarOptionals.Body.IsSet() { + + localVarOptionalBody:= localVarOptionals.Body.Value() + localVarPostBody = &localVarOptionalBody + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarHttpResponse, err + } + + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + return localVarHttpResponse, newErr + } + + return localVarHttpResponse, nil +} +/* +UserGroupAssociationsApiService List the Active Directories bound to a User Group +This endpoint will return all Active Directory Instances bound to a User Group, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this User Group to the corresponding Active Directory; this array represents all grouping and/or associations that would have to be removed to deprovision the Active Directory from this User Group. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/usergroups/{GroupID}/activedirectories \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param groupId ObjectID of the User Group. + * @param optional nil or *UserGroupAssociationsApiGraphUserGroupTraverseActiveDirectoryOpts - Optional Parameters: + * @param "Limit" (optional.Int32) - The number of records to return at once. Limited to 100. + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. + * @param "Skip" (optional.Int32) - The offset into the records to return. + * @param "Filter" (optional.Interface of []string) - A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` +@return []GraphObjectWithPaths +*/ + +type UserGroupAssociationsApiGraphUserGroupTraverseActiveDirectoryOpts struct { + Limit optional.Int32 + XOrgId optional.String + Skip optional.Int32 + Filter optional.Interface +} + +func (a *UserGroupAssociationsApiService) GraphUserGroupTraverseActiveDirectory(ctx context.Context, groupId string, localVarOptionals *UserGroupAssociationsApiGraphUserGroupTraverseActiveDirectoryOpts) ([]GraphObjectWithPaths, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []GraphObjectWithPaths + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/usergroups/{group_id}/activedirectories" + localVarPath = strings.Replace(localVarPath, "{"+"group_id"+"}", fmt.Sprintf("%v", groupId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { + localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Skip.IsSet() { + localVarQueryParams.Add("skip", parameterToString(localVarOptionals.Skip.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Filter.IsSet() { + localVarQueryParams.Add("filter", parameterToString(localVarOptionals.Filter.Value(), "csv")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v []GraphObjectWithPaths + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +UserGroupAssociationsApiService List the Applications bound to a User Group +This endpoint will return all Applications bound to a User Group, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this User Group to the corresponding Application; this array represents all grouping and/or associations that would have to be removed to deprovision the Application from this User Group. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/usergroups/{GroupID}/applications \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param groupId ObjectID of the User Group. + * @param optional nil or *UserGroupAssociationsApiGraphUserGroupTraverseApplicationOpts - Optional Parameters: + * @param "Limit" (optional.Int32) - The number of records to return at once. Limited to 100. + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. + * @param "Skip" (optional.Int32) - The offset into the records to return. + * @param "Filter" (optional.Interface of []string) - A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` +@return []GraphObjectWithPaths +*/ + +type UserGroupAssociationsApiGraphUserGroupTraverseApplicationOpts struct { + Limit optional.Int32 + XOrgId optional.String + Skip optional.Int32 + Filter optional.Interface +} + +func (a *UserGroupAssociationsApiService) GraphUserGroupTraverseApplication(ctx context.Context, groupId string, localVarOptionals *UserGroupAssociationsApiGraphUserGroupTraverseApplicationOpts) ([]GraphObjectWithPaths, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []GraphObjectWithPaths + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/usergroups/{group_id}/applications" + localVarPath = strings.Replace(localVarPath, "{"+"group_id"+"}", fmt.Sprintf("%v", groupId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { + localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Skip.IsSet() { + localVarQueryParams.Add("skip", parameterToString(localVarOptionals.Skip.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Filter.IsSet() { + localVarQueryParams.Add("filter", parameterToString(localVarOptionals.Filter.Value(), "csv")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v []GraphObjectWithPaths + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +UserGroupAssociationsApiService List the Directories bound to a User Group +This endpoint will return all Directories bound to a User Group, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this User Group to the corresponding Directory; this array represents all grouping and/or associations that would have to be removed to deprovision the Directories from this User Group. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/usergroups/{GroupID}/directories \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param groupId ObjectID of the User Group. + * @param optional nil or *UserGroupAssociationsApiGraphUserGroupTraverseDirectoryOpts - Optional Parameters: + * @param "Limit" (optional.Int32) - The number of records to return at once. Limited to 100. + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. + * @param "Skip" (optional.Int32) - The offset into the records to return. + * @param "Filter" (optional.Interface of []string) - A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` +@return []GraphObjectWithPaths +*/ + +type UserGroupAssociationsApiGraphUserGroupTraverseDirectoryOpts struct { + Limit optional.Int32 + XOrgId optional.String + Skip optional.Int32 + Filter optional.Interface +} + +func (a *UserGroupAssociationsApiService) GraphUserGroupTraverseDirectory(ctx context.Context, groupId string, localVarOptionals *UserGroupAssociationsApiGraphUserGroupTraverseDirectoryOpts) ([]GraphObjectWithPaths, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []GraphObjectWithPaths + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/usergroups/{group_id}/directories" + localVarPath = strings.Replace(localVarPath, "{"+"group_id"+"}", fmt.Sprintf("%v", groupId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { + localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Skip.IsSet() { + localVarQueryParams.Add("skip", parameterToString(localVarOptionals.Skip.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Filter.IsSet() { + localVarQueryParams.Add("filter", parameterToString(localVarOptionals.Filter.Value(), "csv")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v []GraphObjectWithPaths + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +UserGroupAssociationsApiService List the G Suite instances bound to a User Group +This endpoint will return all G Suite Instances bound to a User Group, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this User Group to the corresponding G Suite instance; this array represents all grouping and/or associations that would have to be removed to deprovision the G Suite instance from this User Group. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/usergroups/{GroupID/gsuites \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param groupId ObjectID of the User Group. + * @param optional nil or *UserGroupAssociationsApiGraphUserGroupTraverseGSuiteOpts - Optional Parameters: + * @param "Limit" (optional.Int32) - The number of records to return at once. Limited to 100. + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. + * @param "Skip" (optional.Int32) - The offset into the records to return. + * @param "Filter" (optional.Interface of []string) - A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` +@return []GraphObjectWithPaths +*/ + +type UserGroupAssociationsApiGraphUserGroupTraverseGSuiteOpts struct { + Limit optional.Int32 + XOrgId optional.String + Skip optional.Int32 + Filter optional.Interface +} + +func (a *UserGroupAssociationsApiService) GraphUserGroupTraverseGSuite(ctx context.Context, groupId string, localVarOptionals *UserGroupAssociationsApiGraphUserGroupTraverseGSuiteOpts) ([]GraphObjectWithPaths, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []GraphObjectWithPaths + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/usergroups/{group_id}/gsuites" + localVarPath = strings.Replace(localVarPath, "{"+"group_id"+"}", fmt.Sprintf("%v", groupId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { + localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Skip.IsSet() { + localVarQueryParams.Add("skip", parameterToString(localVarOptionals.Skip.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Filter.IsSet() { + localVarQueryParams.Add("filter", parameterToString(localVarOptionals.Filter.Value(), "csv")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v []GraphObjectWithPaths + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +UserGroupAssociationsApiService List the LDAP Servers bound to a User Group +This endpoint will return all LDAP Servers bound to a User Group, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this User Group to the corresponding LDAP Server; this array represents all grouping and/or associations that would have to be removed to deprovision the LDAP Server from this User Group. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/usergroups/{GroupID}/ldapservers \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param groupId ObjectID of the User Group. + * @param optional nil or *UserGroupAssociationsApiGraphUserGroupTraverseLdapServerOpts - Optional Parameters: + * @param "Limit" (optional.Int32) - The number of records to return at once. Limited to 100. + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. + * @param "Skip" (optional.Int32) - The offset into the records to return. + * @param "Filter" (optional.Interface of []string) - A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` +@return []GraphObjectWithPaths +*/ + +type UserGroupAssociationsApiGraphUserGroupTraverseLdapServerOpts struct { + Limit optional.Int32 + XOrgId optional.String + Skip optional.Int32 + Filter optional.Interface +} + +func (a *UserGroupAssociationsApiService) GraphUserGroupTraverseLdapServer(ctx context.Context, groupId string, localVarOptionals *UserGroupAssociationsApiGraphUserGroupTraverseLdapServerOpts) ([]GraphObjectWithPaths, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []GraphObjectWithPaths + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/usergroups/{group_id}/ldapservers" + localVarPath = strings.Replace(localVarPath, "{"+"group_id"+"}", fmt.Sprintf("%v", groupId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { + localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Skip.IsSet() { + localVarQueryParams.Add("skip", parameterToString(localVarOptionals.Skip.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Filter.IsSet() { + localVarQueryParams.Add("filter", parameterToString(localVarOptionals.Filter.Value(), "csv")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v []GraphObjectWithPaths + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +UserGroupAssociationsApiService List the Office 365 instances bound to a User Group +This endpoint will return all Office 365 instances bound to a User Group, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this User Group to the corresponding Office 365 instance; this array represents all grouping and/or associations that would have to be removed to deprovision the Office 365 instance from this User Group. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/usergroups/{GroupID}/office365s \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param groupId ObjectID of the User Group. + * @param optional nil or *UserGroupAssociationsApiGraphUserGroupTraverseOffice365Opts - Optional Parameters: + * @param "Limit" (optional.Int32) - The number of records to return at once. Limited to 100. + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. + * @param "Skip" (optional.Int32) - The offset into the records to return. + * @param "Filter" (optional.Interface of []string) - A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` +@return []GraphObjectWithPaths +*/ + +type UserGroupAssociationsApiGraphUserGroupTraverseOffice365Opts struct { + Limit optional.Int32 + XOrgId optional.String + Skip optional.Int32 + Filter optional.Interface +} + +func (a *UserGroupAssociationsApiService) GraphUserGroupTraverseOffice365(ctx context.Context, groupId string, localVarOptionals *UserGroupAssociationsApiGraphUserGroupTraverseOffice365Opts) ([]GraphObjectWithPaths, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []GraphObjectWithPaths + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/usergroups/{group_id}/office365s" + localVarPath = strings.Replace(localVarPath, "{"+"group_id"+"}", fmt.Sprintf("%v", groupId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { + localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Skip.IsSet() { + localVarQueryParams.Add("skip", parameterToString(localVarOptionals.Skip.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Filter.IsSet() { + localVarQueryParams.Add("filter", parameterToString(localVarOptionals.Filter.Value(), "csv")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v []GraphObjectWithPaths + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +UserGroupAssociationsApiService List the RADIUS Servers bound to a User Group +This endpoint will return all RADIUS servers bound to a User Group, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this User Group to the corresponding RADIUS Server; this array represents all grouping and/or associations that would have to be removed to deprovision the RADIUS Server from this User Group. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/usergroups/{GroupID}/radiusservers \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param groupId ObjectID of the User Group. + * @param optional nil or *UserGroupAssociationsApiGraphUserGroupTraverseRadiusServerOpts - Optional Parameters: + * @param "Limit" (optional.Int32) - The number of records to return at once. Limited to 100. + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. + * @param "Skip" (optional.Int32) - The offset into the records to return. + * @param "Filter" (optional.Interface of []string) - A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` +@return []GraphObjectWithPaths +*/ + +type UserGroupAssociationsApiGraphUserGroupTraverseRadiusServerOpts struct { + Limit optional.Int32 + XOrgId optional.String + Skip optional.Int32 + Filter optional.Interface +} + +func (a *UserGroupAssociationsApiService) GraphUserGroupTraverseRadiusServer(ctx context.Context, groupId string, localVarOptionals *UserGroupAssociationsApiGraphUserGroupTraverseRadiusServerOpts) ([]GraphObjectWithPaths, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []GraphObjectWithPaths + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/usergroups/{group_id}/radiusservers" + localVarPath = strings.Replace(localVarPath, "{"+"group_id"+"}", fmt.Sprintf("%v", groupId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { + localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Skip.IsSet() { + localVarQueryParams.Add("skip", parameterToString(localVarOptionals.Skip.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Filter.IsSet() { + localVarQueryParams.Add("filter", parameterToString(localVarOptionals.Filter.Value(), "csv")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v []GraphObjectWithPaths + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +UserGroupAssociationsApiService List the Systems bound to a User Group +This endpoint will return all Systems bound to a User Group, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this User Group to the corresponding System; this array represents all grouping and/or associations that would have to be removed to deprovision the System from this User Group. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/usergroups/{GroupID}/systems \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param groupId ObjectID of the User Group. + * @param optional nil or *UserGroupAssociationsApiGraphUserGroupTraverseSystemOpts - Optional Parameters: + * @param "Limit" (optional.Int32) - The number of records to return at once. Limited to 100. + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. + * @param "Skip" (optional.Int32) - The offset into the records to return. + * @param "Filter" (optional.Interface of []string) - A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` +@return []GraphObjectWithPaths +*/ + +type UserGroupAssociationsApiGraphUserGroupTraverseSystemOpts struct { + Limit optional.Int32 + XOrgId optional.String + Skip optional.Int32 + Filter optional.Interface +} + +func (a *UserGroupAssociationsApiService) GraphUserGroupTraverseSystem(ctx context.Context, groupId string, localVarOptionals *UserGroupAssociationsApiGraphUserGroupTraverseSystemOpts) ([]GraphObjectWithPaths, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []GraphObjectWithPaths + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/usergroups/{group_id}/systems" + localVarPath = strings.Replace(localVarPath, "{"+"group_id"+"}", fmt.Sprintf("%v", groupId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { + localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Skip.IsSet() { + localVarQueryParams.Add("skip", parameterToString(localVarOptionals.Skip.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Filter.IsSet() { + localVarQueryParams.Add("filter", parameterToString(localVarOptionals.Filter.Value(), "csv")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v []GraphObjectWithPaths + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +UserGroupAssociationsApiService List the System Groups bound to User Groups +This endpoint will return all System Groups bound to a User Group, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this User Group to the corresponding System Group; this array represents all grouping and/or associations that would have to be removed to deprovision the System Group from this User Group. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/usergroups/{GroupID}/systemgroups \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param groupId ObjectID of the User Group. + * @param optional nil or *UserGroupAssociationsApiGraphUserGroupTraverseSystemGroupOpts - Optional Parameters: + * @param "Limit" (optional.Int32) - The number of records to return at once. Limited to 100. + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. + * @param "Skip" (optional.Int32) - The offset into the records to return. + * @param "Filter" (optional.Interface of []string) - A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` +@return []GraphObjectWithPaths +*/ + +type UserGroupAssociationsApiGraphUserGroupTraverseSystemGroupOpts struct { + Limit optional.Int32 + XOrgId optional.String + Skip optional.Int32 + Filter optional.Interface +} + +func (a *UserGroupAssociationsApiService) GraphUserGroupTraverseSystemGroup(ctx context.Context, groupId string, localVarOptionals *UserGroupAssociationsApiGraphUserGroupTraverseSystemGroupOpts) ([]GraphObjectWithPaths, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []GraphObjectWithPaths + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/usergroups/{group_id}/systemgroups" + localVarPath = strings.Replace(localVarPath, "{"+"group_id"+"}", fmt.Sprintf("%v", groupId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { + localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Skip.IsSet() { + localVarQueryParams.Add("skip", parameterToString(localVarOptionals.Skip.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Filter.IsSet() { + localVarQueryParams.Add("filter", parameterToString(localVarOptionals.Filter.Value(), "csv")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v []GraphObjectWithPaths + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} diff --git a/jcapiv2/api_user_group_members_membership.go b/jcapiv2/api_user_group_members_membership.go new file mode 100644 index 0000000..67f0fff --- /dev/null +++ b/jcapiv2/api_user_group_members_membership.go @@ -0,0 +1,373 @@ + +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +import ( + "context" + "io/ioutil" + "net/http" + "net/url" + "strings" + "fmt" + "github.com/antihax/optional" +) + +// Linger please +var ( + _ context.Context +) + +type UserGroupMembersMembershipApiService service +/* +UserGroupMembersMembershipApiService List the members of a User Group +This endpoint returns the user members of a User Group. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/usergroups/{GroupID}/members \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param groupId ObjectID of the User Group. + * @param optional nil or *UserGroupMembersMembershipApiGraphUserGroupMembersListOpts - Optional Parameters: + * @param "Limit" (optional.Int32) - The number of records to return at once. Limited to 100. + * @param "Skip" (optional.Int32) - The offset into the records to return. + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. +@return []GraphConnection +*/ + +type UserGroupMembersMembershipApiGraphUserGroupMembersListOpts struct { + Limit optional.Int32 + Skip optional.Int32 + XOrgId optional.String +} + +func (a *UserGroupMembersMembershipApiService) GraphUserGroupMembersList(ctx context.Context, groupId string, localVarOptionals *UserGroupMembersMembershipApiGraphUserGroupMembersListOpts) ([]GraphConnection, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []GraphConnection + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/usergroups/{group_id}/members" + localVarPath = strings.Replace(localVarPath, "{"+"group_id"+"}", fmt.Sprintf("%v", groupId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { + localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Skip.IsSet() { + localVarQueryParams.Add("skip", parameterToString(localVarOptionals.Skip.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v []GraphConnection + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +UserGroupMembersMembershipApiService Manage the members of a User Group +This endpoint allows you to manage the user members of a User Group. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/usergroups/{GroupID}/members \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"op\": \"add\", \"type\": \"user\", \"id\": \"{User_ID}\" }' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param groupId ObjectID of the User Group. + * @param optional nil or *UserGroupMembersMembershipApiGraphUserGroupMembersPostOpts - Optional Parameters: + * @param "Body" (optional.Interface of GraphOperationUserGroupMember) - + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. + +*/ + +type UserGroupMembersMembershipApiGraphUserGroupMembersPostOpts struct { + Body optional.Interface + XOrgId optional.String +} + +func (a *UserGroupMembersMembershipApiService) GraphUserGroupMembersPost(ctx context.Context, groupId string, localVarOptionals *UserGroupMembersMembershipApiGraphUserGroupMembersPostOpts) (*http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Post") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/usergroups/{group_id}/members" + localVarPath = strings.Replace(localVarPath, "{"+"group_id"+"}", fmt.Sprintf("%v", groupId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + // body params + if localVarOptionals != nil && localVarOptionals.Body.IsSet() { + + localVarOptionalBody:= localVarOptionals.Body.Value() + localVarPostBody = &localVarOptionalBody + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarHttpResponse, err + } + + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + return localVarHttpResponse, newErr + } + + return localVarHttpResponse, nil +} +/* +UserGroupMembersMembershipApiService List the User Group's membership +This endpoint returns all users members that are a member of this User Group. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/usergroups/{GroupID}/membership \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param groupId ObjectID of the User Group. + * @param optional nil or *UserGroupMembersMembershipApiGraphUserGroupMembershipOpts - Optional Parameters: + * @param "Filter" (optional.Interface of []string) - A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` + * @param "Limit" (optional.Int32) - The number of records to return at once. Limited to 100. + * @param "Skip" (optional.Int32) - The offset into the records to return. + * @param "Sort" (optional.Interface of []string) - The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. +@return []GraphObjectWithPaths +*/ + +type UserGroupMembersMembershipApiGraphUserGroupMembershipOpts struct { + Filter optional.Interface + Limit optional.Int32 + Skip optional.Int32 + Sort optional.Interface + XOrgId optional.String +} + +func (a *UserGroupMembersMembershipApiService) GraphUserGroupMembership(ctx context.Context, groupId string, localVarOptionals *UserGroupMembersMembershipApiGraphUserGroupMembershipOpts) ([]GraphObjectWithPaths, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []GraphObjectWithPaths + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/usergroups/{group_id}/membership" + localVarPath = strings.Replace(localVarPath, "{"+"group_id"+"}", fmt.Sprintf("%v", groupId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Filter.IsSet() { + localVarQueryParams.Add("filter", parameterToString(localVarOptionals.Filter.Value(), "csv")) + } + if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { + localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Skip.IsSet() { + localVarQueryParams.Add("skip", parameterToString(localVarOptionals.Skip.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Sort.IsSet() { + localVarQueryParams.Add("sort", parameterToString(localVarOptionals.Sort.Value(), "csv")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v []GraphObjectWithPaths + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} diff --git a/jcapiv2/api_user_groups.go b/jcapiv2/api_user_groups.go new file mode 100644 index 0000000..6ba0f78 --- /dev/null +++ b/jcapiv2/api_user_groups.go @@ -0,0 +1,2515 @@ + +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +import ( + "context" + "io/ioutil" + "net/http" + "net/url" + "strings" + "fmt" + "github.com/antihax/optional" +) + +// Linger please +var ( + _ context.Context +) + +type UserGroupsApiService service +/* +UserGroupsApiService List the associations of a User Group. +This endpoint returns the _direct_ associations of this User Group. A direct association can be a non-homogeneous relationship between 2 different objects, for example User Groups and Users. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/usergroups/{GroupID}/associations?targets=system \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param groupId ObjectID of the User Group. + * @param targets Targets which a \"user_group\" can be associated to. + * @param optional nil or *UserGroupsApiGraphUserGroupAssociationsListOpts - Optional Parameters: + * @param "Limit" (optional.Int32) - The number of records to return at once. Limited to 100. + * @param "Skip" (optional.Int32) - The offset into the records to return. + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. +@return []GraphConnection +*/ + +type UserGroupsApiGraphUserGroupAssociationsListOpts struct { + Limit optional.Int32 + Skip optional.Int32 + XOrgId optional.String +} + +func (a *UserGroupsApiService) GraphUserGroupAssociationsList(ctx context.Context, groupId string, targets []string, localVarOptionals *UserGroupsApiGraphUserGroupAssociationsListOpts) ([]GraphConnection, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []GraphConnection + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/usergroups/{group_id}/associations" + localVarPath = strings.Replace(localVarPath, "{"+"group_id"+"}", fmt.Sprintf("%v", groupId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + localVarQueryParams.Add("targets", parameterToString(targets, "csv")) + if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { + localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Skip.IsSet() { + localVarQueryParams.Add("skip", parameterToString(localVarOptionals.Skip.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v []GraphConnection + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +UserGroupsApiService Manage the associations of a User Group +This endpoint manages the _direct_ associations of this User Group. A direct association can be a non-homogeneous relationship between 2 different objects, for example User Groups and Users. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/usergroups/{GroupID}/associations \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"op\": \"add\", \"type\": \"system\", \"id\": \"{SystemID}\" }' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param groupId ObjectID of the User Group. + * @param optional nil or *UserGroupsApiGraphUserGroupAssociationsPostOpts - Optional Parameters: + * @param "Body" (optional.Interface of GraphOperationUserGroup) - + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. + +*/ + +type UserGroupsApiGraphUserGroupAssociationsPostOpts struct { + Body optional.Interface + XOrgId optional.String +} + +func (a *UserGroupsApiService) GraphUserGroupAssociationsPost(ctx context.Context, groupId string, localVarOptionals *UserGroupsApiGraphUserGroupAssociationsPostOpts) (*http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Post") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/usergroups/{group_id}/associations" + localVarPath = strings.Replace(localVarPath, "{"+"group_id"+"}", fmt.Sprintf("%v", groupId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + // body params + if localVarOptionals != nil && localVarOptionals.Body.IsSet() { + + localVarOptionalBody:= localVarOptionals.Body.Value() + localVarPostBody = &localVarOptionalBody + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarHttpResponse, err + } + + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + return localVarHttpResponse, newErr + } + + return localVarHttpResponse, nil +} +/* +UserGroupsApiService List the members of a User Group +This endpoint returns the user members of a User Group. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/usergroups/{GroupID}/members \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param groupId ObjectID of the User Group. + * @param optional nil or *UserGroupsApiGraphUserGroupMembersListOpts - Optional Parameters: + * @param "Limit" (optional.Int32) - The number of records to return at once. Limited to 100. + * @param "Skip" (optional.Int32) - The offset into the records to return. + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. +@return []GraphConnection +*/ + +type UserGroupsApiGraphUserGroupMembersListOpts struct { + Limit optional.Int32 + Skip optional.Int32 + XOrgId optional.String +} + +func (a *UserGroupsApiService) GraphUserGroupMembersList(ctx context.Context, groupId string, localVarOptionals *UserGroupsApiGraphUserGroupMembersListOpts) ([]GraphConnection, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []GraphConnection + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/usergroups/{group_id}/members" + localVarPath = strings.Replace(localVarPath, "{"+"group_id"+"}", fmt.Sprintf("%v", groupId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { + localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Skip.IsSet() { + localVarQueryParams.Add("skip", parameterToString(localVarOptionals.Skip.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v []GraphConnection + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +UserGroupsApiService Manage the members of a User Group +This endpoint allows you to manage the user members of a User Group. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/usergroups/{GroupID}/members \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"op\": \"add\", \"type\": \"user\", \"id\": \"{User_ID}\" }' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param groupId ObjectID of the User Group. + * @param optional nil or *UserGroupsApiGraphUserGroupMembersPostOpts - Optional Parameters: + * @param "Body" (optional.Interface of GraphOperationUserGroupMember) - + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. + +*/ + +type UserGroupsApiGraphUserGroupMembersPostOpts struct { + Body optional.Interface + XOrgId optional.String +} + +func (a *UserGroupsApiService) GraphUserGroupMembersPost(ctx context.Context, groupId string, localVarOptionals *UserGroupsApiGraphUserGroupMembersPostOpts) (*http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Post") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/usergroups/{group_id}/members" + localVarPath = strings.Replace(localVarPath, "{"+"group_id"+"}", fmt.Sprintf("%v", groupId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + // body params + if localVarOptionals != nil && localVarOptionals.Body.IsSet() { + + localVarOptionalBody:= localVarOptionals.Body.Value() + localVarPostBody = &localVarOptionalBody + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarHttpResponse, err + } + + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + return localVarHttpResponse, newErr + } + + return localVarHttpResponse, nil +} +/* +UserGroupsApiService List the User Group's membership +This endpoint returns all users members that are a member of this User Group. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/usergroups/{GroupID}/membership \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param groupId ObjectID of the User Group. + * @param optional nil or *UserGroupsApiGraphUserGroupMembershipOpts - Optional Parameters: + * @param "Filter" (optional.Interface of []string) - A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` + * @param "Limit" (optional.Int32) - The number of records to return at once. Limited to 100. + * @param "Skip" (optional.Int32) - The offset into the records to return. + * @param "Sort" (optional.Interface of []string) - The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. +@return []GraphObjectWithPaths +*/ + +type UserGroupsApiGraphUserGroupMembershipOpts struct { + Filter optional.Interface + Limit optional.Int32 + Skip optional.Int32 + Sort optional.Interface + XOrgId optional.String +} + +func (a *UserGroupsApiService) GraphUserGroupMembership(ctx context.Context, groupId string, localVarOptionals *UserGroupsApiGraphUserGroupMembershipOpts) ([]GraphObjectWithPaths, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []GraphObjectWithPaths + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/usergroups/{group_id}/membership" + localVarPath = strings.Replace(localVarPath, "{"+"group_id"+"}", fmt.Sprintf("%v", groupId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Filter.IsSet() { + localVarQueryParams.Add("filter", parameterToString(localVarOptionals.Filter.Value(), "csv")) + } + if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { + localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Skip.IsSet() { + localVarQueryParams.Add("skip", parameterToString(localVarOptionals.Skip.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Sort.IsSet() { + localVarQueryParams.Add("sort", parameterToString(localVarOptionals.Sort.Value(), "csv")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v []GraphObjectWithPaths + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +UserGroupsApiService List the Active Directories bound to a User Group +This endpoint will return all Active Directory Instances bound to a User Group, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this User Group to the corresponding Active Directory; this array represents all grouping and/or associations that would have to be removed to deprovision the Active Directory from this User Group. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/usergroups/{GroupID}/activedirectories \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param groupId ObjectID of the User Group. + * @param optional nil or *UserGroupsApiGraphUserGroupTraverseActiveDirectoryOpts - Optional Parameters: + * @param "Limit" (optional.Int32) - The number of records to return at once. Limited to 100. + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. + * @param "Skip" (optional.Int32) - The offset into the records to return. + * @param "Filter" (optional.Interface of []string) - A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` +@return []GraphObjectWithPaths +*/ + +type UserGroupsApiGraphUserGroupTraverseActiveDirectoryOpts struct { + Limit optional.Int32 + XOrgId optional.String + Skip optional.Int32 + Filter optional.Interface +} + +func (a *UserGroupsApiService) GraphUserGroupTraverseActiveDirectory(ctx context.Context, groupId string, localVarOptionals *UserGroupsApiGraphUserGroupTraverseActiveDirectoryOpts) ([]GraphObjectWithPaths, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []GraphObjectWithPaths + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/usergroups/{group_id}/activedirectories" + localVarPath = strings.Replace(localVarPath, "{"+"group_id"+"}", fmt.Sprintf("%v", groupId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { + localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Skip.IsSet() { + localVarQueryParams.Add("skip", parameterToString(localVarOptionals.Skip.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Filter.IsSet() { + localVarQueryParams.Add("filter", parameterToString(localVarOptionals.Filter.Value(), "csv")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v []GraphObjectWithPaths + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +UserGroupsApiService List the Applications bound to a User Group +This endpoint will return all Applications bound to a User Group, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this User Group to the corresponding Application; this array represents all grouping and/or associations that would have to be removed to deprovision the Application from this User Group. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/usergroups/{GroupID}/applications \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param groupId ObjectID of the User Group. + * @param optional nil or *UserGroupsApiGraphUserGroupTraverseApplicationOpts - Optional Parameters: + * @param "Limit" (optional.Int32) - The number of records to return at once. Limited to 100. + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. + * @param "Skip" (optional.Int32) - The offset into the records to return. + * @param "Filter" (optional.Interface of []string) - A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` +@return []GraphObjectWithPaths +*/ + +type UserGroupsApiGraphUserGroupTraverseApplicationOpts struct { + Limit optional.Int32 + XOrgId optional.String + Skip optional.Int32 + Filter optional.Interface +} + +func (a *UserGroupsApiService) GraphUserGroupTraverseApplication(ctx context.Context, groupId string, localVarOptionals *UserGroupsApiGraphUserGroupTraverseApplicationOpts) ([]GraphObjectWithPaths, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []GraphObjectWithPaths + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/usergroups/{group_id}/applications" + localVarPath = strings.Replace(localVarPath, "{"+"group_id"+"}", fmt.Sprintf("%v", groupId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { + localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Skip.IsSet() { + localVarQueryParams.Add("skip", parameterToString(localVarOptionals.Skip.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Filter.IsSet() { + localVarQueryParams.Add("filter", parameterToString(localVarOptionals.Filter.Value(), "csv")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v []GraphObjectWithPaths + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +UserGroupsApiService List the Directories bound to a User Group +This endpoint will return all Directories bound to a User Group, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this User Group to the corresponding Directory; this array represents all grouping and/or associations that would have to be removed to deprovision the Directories from this User Group. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/usergroups/{GroupID}/directories \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param groupId ObjectID of the User Group. + * @param optional nil or *UserGroupsApiGraphUserGroupTraverseDirectoryOpts - Optional Parameters: + * @param "Limit" (optional.Int32) - The number of records to return at once. Limited to 100. + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. + * @param "Skip" (optional.Int32) - The offset into the records to return. + * @param "Filter" (optional.Interface of []string) - A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` +@return []GraphObjectWithPaths +*/ + +type UserGroupsApiGraphUserGroupTraverseDirectoryOpts struct { + Limit optional.Int32 + XOrgId optional.String + Skip optional.Int32 + Filter optional.Interface +} + +func (a *UserGroupsApiService) GraphUserGroupTraverseDirectory(ctx context.Context, groupId string, localVarOptionals *UserGroupsApiGraphUserGroupTraverseDirectoryOpts) ([]GraphObjectWithPaths, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []GraphObjectWithPaths + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/usergroups/{group_id}/directories" + localVarPath = strings.Replace(localVarPath, "{"+"group_id"+"}", fmt.Sprintf("%v", groupId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { + localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Skip.IsSet() { + localVarQueryParams.Add("skip", parameterToString(localVarOptionals.Skip.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Filter.IsSet() { + localVarQueryParams.Add("filter", parameterToString(localVarOptionals.Filter.Value(), "csv")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v []GraphObjectWithPaths + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +UserGroupsApiService List the G Suite instances bound to a User Group +This endpoint will return all G Suite Instances bound to a User Group, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this User Group to the corresponding G Suite instance; this array represents all grouping and/or associations that would have to be removed to deprovision the G Suite instance from this User Group. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/usergroups/{GroupID/gsuites \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param groupId ObjectID of the User Group. + * @param optional nil or *UserGroupsApiGraphUserGroupTraverseGSuiteOpts - Optional Parameters: + * @param "Limit" (optional.Int32) - The number of records to return at once. Limited to 100. + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. + * @param "Skip" (optional.Int32) - The offset into the records to return. + * @param "Filter" (optional.Interface of []string) - A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` +@return []GraphObjectWithPaths +*/ + +type UserGroupsApiGraphUserGroupTraverseGSuiteOpts struct { + Limit optional.Int32 + XOrgId optional.String + Skip optional.Int32 + Filter optional.Interface +} + +func (a *UserGroupsApiService) GraphUserGroupTraverseGSuite(ctx context.Context, groupId string, localVarOptionals *UserGroupsApiGraphUserGroupTraverseGSuiteOpts) ([]GraphObjectWithPaths, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []GraphObjectWithPaths + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/usergroups/{group_id}/gsuites" + localVarPath = strings.Replace(localVarPath, "{"+"group_id"+"}", fmt.Sprintf("%v", groupId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { + localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Skip.IsSet() { + localVarQueryParams.Add("skip", parameterToString(localVarOptionals.Skip.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Filter.IsSet() { + localVarQueryParams.Add("filter", parameterToString(localVarOptionals.Filter.Value(), "csv")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v []GraphObjectWithPaths + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +UserGroupsApiService List the LDAP Servers bound to a User Group +This endpoint will return all LDAP Servers bound to a User Group, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this User Group to the corresponding LDAP Server; this array represents all grouping and/or associations that would have to be removed to deprovision the LDAP Server from this User Group. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/usergroups/{GroupID}/ldapservers \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param groupId ObjectID of the User Group. + * @param optional nil or *UserGroupsApiGraphUserGroupTraverseLdapServerOpts - Optional Parameters: + * @param "Limit" (optional.Int32) - The number of records to return at once. Limited to 100. + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. + * @param "Skip" (optional.Int32) - The offset into the records to return. + * @param "Filter" (optional.Interface of []string) - A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` +@return []GraphObjectWithPaths +*/ + +type UserGroupsApiGraphUserGroupTraverseLdapServerOpts struct { + Limit optional.Int32 + XOrgId optional.String + Skip optional.Int32 + Filter optional.Interface +} + +func (a *UserGroupsApiService) GraphUserGroupTraverseLdapServer(ctx context.Context, groupId string, localVarOptionals *UserGroupsApiGraphUserGroupTraverseLdapServerOpts) ([]GraphObjectWithPaths, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []GraphObjectWithPaths + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/usergroups/{group_id}/ldapservers" + localVarPath = strings.Replace(localVarPath, "{"+"group_id"+"}", fmt.Sprintf("%v", groupId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { + localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Skip.IsSet() { + localVarQueryParams.Add("skip", parameterToString(localVarOptionals.Skip.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Filter.IsSet() { + localVarQueryParams.Add("filter", parameterToString(localVarOptionals.Filter.Value(), "csv")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v []GraphObjectWithPaths + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +UserGroupsApiService List the Office 365 instances bound to a User Group +This endpoint will return all Office 365 instances bound to a User Group, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this User Group to the corresponding Office 365 instance; this array represents all grouping and/or associations that would have to be removed to deprovision the Office 365 instance from this User Group. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/usergroups/{GroupID}/office365s \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param groupId ObjectID of the User Group. + * @param optional nil or *UserGroupsApiGraphUserGroupTraverseOffice365Opts - Optional Parameters: + * @param "Limit" (optional.Int32) - The number of records to return at once. Limited to 100. + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. + * @param "Skip" (optional.Int32) - The offset into the records to return. + * @param "Filter" (optional.Interface of []string) - A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` +@return []GraphObjectWithPaths +*/ + +type UserGroupsApiGraphUserGroupTraverseOffice365Opts struct { + Limit optional.Int32 + XOrgId optional.String + Skip optional.Int32 + Filter optional.Interface +} + +func (a *UserGroupsApiService) GraphUserGroupTraverseOffice365(ctx context.Context, groupId string, localVarOptionals *UserGroupsApiGraphUserGroupTraverseOffice365Opts) ([]GraphObjectWithPaths, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []GraphObjectWithPaths + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/usergroups/{group_id}/office365s" + localVarPath = strings.Replace(localVarPath, "{"+"group_id"+"}", fmt.Sprintf("%v", groupId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { + localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Skip.IsSet() { + localVarQueryParams.Add("skip", parameterToString(localVarOptionals.Skip.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Filter.IsSet() { + localVarQueryParams.Add("filter", parameterToString(localVarOptionals.Filter.Value(), "csv")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v []GraphObjectWithPaths + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +UserGroupsApiService List the RADIUS Servers bound to a User Group +This endpoint will return all RADIUS servers bound to a User Group, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this User Group to the corresponding RADIUS Server; this array represents all grouping and/or associations that would have to be removed to deprovision the RADIUS Server from this User Group. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/usergroups/{GroupID}/radiusservers \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param groupId ObjectID of the User Group. + * @param optional nil or *UserGroupsApiGraphUserGroupTraverseRadiusServerOpts - Optional Parameters: + * @param "Limit" (optional.Int32) - The number of records to return at once. Limited to 100. + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. + * @param "Skip" (optional.Int32) - The offset into the records to return. + * @param "Filter" (optional.Interface of []string) - A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` +@return []GraphObjectWithPaths +*/ + +type UserGroupsApiGraphUserGroupTraverseRadiusServerOpts struct { + Limit optional.Int32 + XOrgId optional.String + Skip optional.Int32 + Filter optional.Interface +} + +func (a *UserGroupsApiService) GraphUserGroupTraverseRadiusServer(ctx context.Context, groupId string, localVarOptionals *UserGroupsApiGraphUserGroupTraverseRadiusServerOpts) ([]GraphObjectWithPaths, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []GraphObjectWithPaths + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/usergroups/{group_id}/radiusservers" + localVarPath = strings.Replace(localVarPath, "{"+"group_id"+"}", fmt.Sprintf("%v", groupId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { + localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Skip.IsSet() { + localVarQueryParams.Add("skip", parameterToString(localVarOptionals.Skip.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Filter.IsSet() { + localVarQueryParams.Add("filter", parameterToString(localVarOptionals.Filter.Value(), "csv")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v []GraphObjectWithPaths + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +UserGroupsApiService List the Systems bound to a User Group +This endpoint will return all Systems bound to a User Group, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this User Group to the corresponding System; this array represents all grouping and/or associations that would have to be removed to deprovision the System from this User Group. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/usergroups/{GroupID}/systems \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param groupId ObjectID of the User Group. + * @param optional nil or *UserGroupsApiGraphUserGroupTraverseSystemOpts - Optional Parameters: + * @param "Limit" (optional.Int32) - The number of records to return at once. Limited to 100. + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. + * @param "Skip" (optional.Int32) - The offset into the records to return. + * @param "Filter" (optional.Interface of []string) - A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` +@return []GraphObjectWithPaths +*/ + +type UserGroupsApiGraphUserGroupTraverseSystemOpts struct { + Limit optional.Int32 + XOrgId optional.String + Skip optional.Int32 + Filter optional.Interface +} + +func (a *UserGroupsApiService) GraphUserGroupTraverseSystem(ctx context.Context, groupId string, localVarOptionals *UserGroupsApiGraphUserGroupTraverseSystemOpts) ([]GraphObjectWithPaths, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []GraphObjectWithPaths + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/usergroups/{group_id}/systems" + localVarPath = strings.Replace(localVarPath, "{"+"group_id"+"}", fmt.Sprintf("%v", groupId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { + localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Skip.IsSet() { + localVarQueryParams.Add("skip", parameterToString(localVarOptionals.Skip.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Filter.IsSet() { + localVarQueryParams.Add("filter", parameterToString(localVarOptionals.Filter.Value(), "csv")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v []GraphObjectWithPaths + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +UserGroupsApiService List the System Groups bound to User Groups +This endpoint will return all System Groups bound to a User Group, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this User Group to the corresponding System Group; this array represents all grouping and/or associations that would have to be removed to deprovision the System Group from this User Group. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/usergroups/{GroupID}/systemgroups \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param groupId ObjectID of the User Group. + * @param optional nil or *UserGroupsApiGraphUserGroupTraverseSystemGroupOpts - Optional Parameters: + * @param "Limit" (optional.Int32) - The number of records to return at once. Limited to 100. + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. + * @param "Skip" (optional.Int32) - The offset into the records to return. + * @param "Filter" (optional.Interface of []string) - A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` +@return []GraphObjectWithPaths +*/ + +type UserGroupsApiGraphUserGroupTraverseSystemGroupOpts struct { + Limit optional.Int32 + XOrgId optional.String + Skip optional.Int32 + Filter optional.Interface +} + +func (a *UserGroupsApiService) GraphUserGroupTraverseSystemGroup(ctx context.Context, groupId string, localVarOptionals *UserGroupsApiGraphUserGroupTraverseSystemGroupOpts) ([]GraphObjectWithPaths, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []GraphObjectWithPaths + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/usergroups/{group_id}/systemgroups" + localVarPath = strings.Replace(localVarPath, "{"+"group_id"+"}", fmt.Sprintf("%v", groupId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { + localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Skip.IsSet() { + localVarQueryParams.Add("skip", parameterToString(localVarOptionals.Skip.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Filter.IsSet() { + localVarQueryParams.Add("filter", parameterToString(localVarOptionals.Filter.Value(), "csv")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v []GraphObjectWithPaths + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +UserGroupsApiService List Suggestions for a User Group +This endpoint returns available suggestions for a given group #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/usergroups/{GroupID}/suggestions \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param groupId ID of the group + * @param optional nil or *UserGroupsApiGroupsSuggestionsGetOpts - Optional Parameters: + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. + * @param "Limit" (optional.Int32) - The number of records to return at once. Limited to 100. + * @param "Skip" (optional.Int32) - The offset into the records to return. +@return []MemberSuggestion +*/ + +type UserGroupsApiGroupsSuggestionsGetOpts struct { + XOrgId optional.String + Limit optional.Int32 + Skip optional.Int32 +} + +func (a *UserGroupsApiService) GroupsSuggestionsGet(ctx context.Context, groupId string, localVarOptionals *UserGroupsApiGroupsSuggestionsGetOpts) ([]MemberSuggestion, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []MemberSuggestion + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/usergroups/{group_id}/suggestions" + localVarPath = strings.Replace(localVarPath, "{"+"group_id"+"}", fmt.Sprintf("%v", groupId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { + localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Skip.IsSet() { + localVarQueryParams.Add("skip", parameterToString(localVarOptionals.Skip.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v []MemberSuggestion + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +UserGroupsApiService List Suggestions for a User Group +This endpoint applies the suggestions for the specified user group. #### Sample Request ``` curl -X PUT https://console.jumpcloud.com/api/v2/usergroups/{GroupID}/suggestions \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"user_ids\": [\"212345678901234567890123\", \"123456789012345678901234\"] }' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param body + * @param groupId ID of the group + * @param optional nil or *UserGroupsApiGroupsSuggestionsPostOpts - Optional Parameters: + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. +@return interface{} +*/ + +type UserGroupsApiGroupsSuggestionsPostOpts struct { + XOrgId optional.String +} + +func (a *UserGroupsApiService) GroupsSuggestionsPost(ctx context.Context, body GroupIdSuggestionsBody, groupId string, localVarOptionals *UserGroupsApiGroupsSuggestionsPostOpts) (interface{}, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Post") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue interface{} + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/usergroups/{group_id}/suggestions" + localVarPath = strings.Replace(localVarPath, "{"+"group_id"+"}", fmt.Sprintf("%v", groupId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + // body params + localVarPostBody = &body + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v interface{} + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +UserGroupsApiService Delete a User Group +This endpoint allows you to delete a User Group. #### Sample Request ``` curl -X DELETE https://console.jumpcloud.com/api/v2/usergroups/{GroupID} \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param id ObjectID of the User Group. + * @param optional nil or *UserGroupsApiGroupsUserDeleteOpts - Optional Parameters: + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. +@return UserGroup +*/ + +type UserGroupsApiGroupsUserDeleteOpts struct { + XOrgId optional.String +} + +func (a *UserGroupsApiService) GroupsUserDelete(ctx context.Context, id string, localVarOptionals *UserGroupsApiGroupsUserDeleteOpts) (UserGroup, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Delete") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue UserGroup + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/usergroups/{id}" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v UserGroup + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +UserGroupsApiService View an individual User Group details +This endpoint returns the details of a User Group. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/usergroups/{GroupID} \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param id ObjectID of the User Group. + * @param optional nil or *UserGroupsApiGroupsUserGetOpts - Optional Parameters: + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. +@return UserGroup +*/ + +type UserGroupsApiGroupsUserGetOpts struct { + XOrgId optional.String +} + +func (a *UserGroupsApiService) GroupsUserGet(ctx context.Context, id string, localVarOptionals *UserGroupsApiGroupsUserGetOpts) (UserGroup, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue UserGroup + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/usergroups/{id}" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v UserGroup + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +UserGroupsApiService List all User Groups +This endpoint returns all User Groups. Available filter fields: - `name` - `disabled` - `type` - `suggestionCounts.add` - `suggestionCounts.remove` - `suggestionCounts.total` - `attributes.sudo.enabled` - `attributes.sudo.withoutPassword` #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/usergroups \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param optional nil or *UserGroupsApiGroupsUserListOpts - Optional Parameters: + * @param "Fields" (optional.Interface of []string) - The comma separated fields included in the returned records. If omitted, the default list of fields will be returned. + * @param "Filter" (optional.Interface of []string) - A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` + * @param "Limit" (optional.Int32) - The number of records to return at once. Limited to 100. + * @param "Skip" (optional.Int32) - The offset into the records to return. + * @param "Sort" (optional.Interface of []string) - The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. +@return []UserGroup +*/ + +type UserGroupsApiGroupsUserListOpts struct { + Fields optional.Interface + Filter optional.Interface + Limit optional.Int32 + Skip optional.Int32 + Sort optional.Interface + XOrgId optional.String +} + +func (a *UserGroupsApiService) GroupsUserList(ctx context.Context, localVarOptionals *UserGroupsApiGroupsUserListOpts) ([]UserGroup, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []UserGroup + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/usergroups" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Fields.IsSet() { + localVarQueryParams.Add("fields", parameterToString(localVarOptionals.Fields.Value(), "csv")) + } + if localVarOptionals != nil && localVarOptionals.Filter.IsSet() { + localVarQueryParams.Add("filter", parameterToString(localVarOptionals.Filter.Value(), "csv")) + } + if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { + localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Skip.IsSet() { + localVarQueryParams.Add("skip", parameterToString(localVarOptionals.Skip.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Sort.IsSet() { + localVarQueryParams.Add("sort", parameterToString(localVarOptionals.Sort.Value(), "csv")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v []UserGroup + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 0 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +UserGroupsApiService Create a new User Group +This endpoint allows you to create a new User Group. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/usergroups \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"name\": \"{Group_Name}\" }' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param optional nil or *UserGroupsApiGroupsUserPostOpts - Optional Parameters: + * @param "Body" (optional.Interface of UserGroupPost) - + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. +@return UserGroup +*/ + +type UserGroupsApiGroupsUserPostOpts struct { + Body optional.Interface + XOrgId optional.String +} + +func (a *UserGroupsApiService) GroupsUserPost(ctx context.Context, localVarOptionals *UserGroupsApiGroupsUserPostOpts) (UserGroup, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Post") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue UserGroup + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/usergroups" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + // body params + if localVarOptionals != nil && localVarOptionals.Body.IsSet() { + + localVarOptionalBody:= localVarOptionals.Body.Value() + localVarPostBody = &localVarOptionalBody + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 201 { + var v UserGroup + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +UserGroupsApiService Update a User Group +This endpoint allows you to do a full update of the User Group. #### Sample Request ``` curl -X PUT https://console.jumpcloud.com/api/v2/usergroups/{Group_ID} \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"name\": \"group_update\" }' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param id ObjectID of the User Group. + * @param optional nil or *UserGroupsApiGroupsUserPutOpts - Optional Parameters: + * @param "Body" (optional.Interface of UserGroupPut) - + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. +@return UserGroup +*/ + +type UserGroupsApiGroupsUserPutOpts struct { + Body optional.Interface + XOrgId optional.String +} + +func (a *UserGroupsApiService) GroupsUserPut(ctx context.Context, id string, localVarOptionals *UserGroupsApiGroupsUserPutOpts) (UserGroup, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Put") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue UserGroup + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/usergroups/{id}" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + // body params + if localVarOptionals != nil && localVarOptionals.Body.IsSet() { + + localVarOptionalBody:= localVarOptionals.Body.Value() + localVarPostBody = &localVarOptionalBody + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v UserGroup + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} diff --git a/jcapiv2/api_users.go b/jcapiv2/api_users.go new file mode 100644 index 0000000..e7ac2bf --- /dev/null +++ b/jcapiv2/api_users.go @@ -0,0 +1,2168 @@ + +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +import ( + "context" + "io/ioutil" + "net/http" + "net/url" + "strings" + "fmt" + "github.com/antihax/optional" +) + +// Linger please +var ( + _ context.Context +) + +type UsersApiService service +/* +UsersApiService List the associations of a User +This endpoint returns the _direct_ associations of a User. A direct association can be a non-homogeneous relationship between 2 different objects, for example Users and Systems. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/users/{UserID}/associations?targets=system_group \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param userId ObjectID of the User. + * @param targets Targets which a \"user\" can be associated to. + * @param optional nil or *UsersApiGraphUserAssociationsListOpts - Optional Parameters: + * @param "Limit" (optional.Int32) - The number of records to return at once. Limited to 100. + * @param "Skip" (optional.Int32) - The offset into the records to return. + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. +@return []GraphConnection +*/ + +type UsersApiGraphUserAssociationsListOpts struct { + Limit optional.Int32 + Skip optional.Int32 + XOrgId optional.String +} + +func (a *UsersApiService) GraphUserAssociationsList(ctx context.Context, userId string, targets []string, localVarOptionals *UsersApiGraphUserAssociationsListOpts) ([]GraphConnection, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []GraphConnection + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/users/{user_id}/associations" + localVarPath = strings.Replace(localVarPath, "{"+"user_id"+"}", fmt.Sprintf("%v", userId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + localVarQueryParams.Add("targets", parameterToString(targets, "csv")) + if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { + localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Skip.IsSet() { + localVarQueryParams.Add("skip", parameterToString(localVarOptionals.Skip.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v []GraphConnection + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +UsersApiService Manage the associations of a User +This endpoint allows you to manage the _direct_ associations of a User. A direct association can be a non-homogeneous relationship between 2 different objects, for example Users and Systems. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/users/{UserID}/associations \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"attributes\": { \"sudo\": { \"enabled\": true, \"withoutPassword\": false } }, \"op\": \"add\", \"type\": \"system_group\", \"id\": \"{GroupID}\" }' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param userId ObjectID of the User. + * @param optional nil or *UsersApiGraphUserAssociationsPostOpts - Optional Parameters: + * @param "Body" (optional.Interface of GraphOperationUser) - + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. + +*/ + +type UsersApiGraphUserAssociationsPostOpts struct { + Body optional.Interface + XOrgId optional.String +} + +func (a *UsersApiService) GraphUserAssociationsPost(ctx context.Context, userId string, localVarOptionals *UsersApiGraphUserAssociationsPostOpts) (*http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Post") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/users/{user_id}/associations" + localVarPath = strings.Replace(localVarPath, "{"+"user_id"+"}", fmt.Sprintf("%v", userId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + // body params + if localVarOptionals != nil && localVarOptionals.Body.IsSet() { + + localVarOptionalBody:= localVarOptionals.Body.Value() + localVarPostBody = &localVarOptionalBody + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarHttpResponse, err + } + + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + return localVarHttpResponse, newErr + } + + return localVarHttpResponse, nil +} +/* +UsersApiService List the parent Groups of a User +This endpoint returns all the User Groups a User is a member of. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/users/{UserID}/memberof \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param userId ObjectID of the User. + * @param optional nil or *UsersApiGraphUserMemberOfOpts - Optional Parameters: + * @param "Filter" (optional.Interface of []string) - A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` + * @param "Limit" (optional.Int32) - The number of records to return at once. Limited to 100. + * @param "Skip" (optional.Int32) - The offset into the records to return. + * @param "Sort" (optional.Interface of []string) - The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. +@return []GraphObjectWithPaths +*/ + +type UsersApiGraphUserMemberOfOpts struct { + Filter optional.Interface + Limit optional.Int32 + Skip optional.Int32 + Sort optional.Interface + XOrgId optional.String +} + +func (a *UsersApiService) GraphUserMemberOf(ctx context.Context, userId string, localVarOptionals *UsersApiGraphUserMemberOfOpts) ([]GraphObjectWithPaths, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []GraphObjectWithPaths + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/users/{user_id}/memberof" + localVarPath = strings.Replace(localVarPath, "{"+"user_id"+"}", fmt.Sprintf("%v", userId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Filter.IsSet() { + localVarQueryParams.Add("filter", parameterToString(localVarOptionals.Filter.Value(), "csv")) + } + if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { + localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Skip.IsSet() { + localVarQueryParams.Add("skip", parameterToString(localVarOptionals.Skip.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Sort.IsSet() { + localVarQueryParams.Add("sort", parameterToString(localVarOptionals.Sort.Value(), "csv")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v []GraphObjectWithPaths + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +UsersApiService List the Active Directory instances bound to a User +This endpoint will return all Active Directory Instances bound to a User, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this User to the corresponding Active Directory instance; this array represents all grouping and/or associations that would have to be removed to deprovision the Active Directory instance from this User. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/users/{UserID}/activedirectories \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param userId ObjectID of the User. + * @param optional nil or *UsersApiGraphUserTraverseActiveDirectoryOpts - Optional Parameters: + * @param "Filter" (optional.Interface of []string) - A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` + * @param "Limit" (optional.Int32) - The number of records to return at once. Limited to 100. + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. + * @param "Skip" (optional.Int32) - The offset into the records to return. +@return []GraphObjectWithPaths +*/ + +type UsersApiGraphUserTraverseActiveDirectoryOpts struct { + Filter optional.Interface + Limit optional.Int32 + XOrgId optional.String + Skip optional.Int32 +} + +func (a *UsersApiService) GraphUserTraverseActiveDirectory(ctx context.Context, userId string, localVarOptionals *UsersApiGraphUserTraverseActiveDirectoryOpts) ([]GraphObjectWithPaths, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []GraphObjectWithPaths + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/users/{user_id}/activedirectories" + localVarPath = strings.Replace(localVarPath, "{"+"user_id"+"}", fmt.Sprintf("%v", userId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Filter.IsSet() { + localVarQueryParams.Add("filter", parameterToString(localVarOptionals.Filter.Value(), "csv")) + } + if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { + localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Skip.IsSet() { + localVarQueryParams.Add("skip", parameterToString(localVarOptionals.Skip.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v []GraphObjectWithPaths + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +UsersApiService List the Applications bound to a User +This endpoint will return all Applications bound to a User, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this User to the corresponding Application; this array represents all grouping and/or associations that would have to be removed to deprovision the Application from this User. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/users/{UserID}/applications \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param userId ObjectID of the User. + * @param optional nil or *UsersApiGraphUserTraverseApplicationOpts - Optional Parameters: + * @param "Limit" (optional.Int32) - The number of records to return at once. Limited to 100. + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. + * @param "Skip" (optional.Int32) - The offset into the records to return. + * @param "Filter" (optional.Interface of []string) - A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` +@return []GraphObjectWithPaths +*/ + +type UsersApiGraphUserTraverseApplicationOpts struct { + Limit optional.Int32 + XOrgId optional.String + Skip optional.Int32 + Filter optional.Interface +} + +func (a *UsersApiService) GraphUserTraverseApplication(ctx context.Context, userId string, localVarOptionals *UsersApiGraphUserTraverseApplicationOpts) ([]GraphObjectWithPaths, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []GraphObjectWithPaths + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/users/{user_id}/applications" + localVarPath = strings.Replace(localVarPath, "{"+"user_id"+"}", fmt.Sprintf("%v", userId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { + localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Skip.IsSet() { + localVarQueryParams.Add("skip", parameterToString(localVarOptionals.Skip.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Filter.IsSet() { + localVarQueryParams.Add("filter", parameterToString(localVarOptionals.Filter.Value(), "csv")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v []GraphObjectWithPaths + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +UsersApiService List the Directories bound to a User +This endpoint will return all Directories bound to a User, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this User to the corresponding Directory; this array represents all grouping and/or associations that would have to be removed to deprovision the Directory from this User. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/users/{UserID}/directories \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param userId ObjectID of the User. + * @param optional nil or *UsersApiGraphUserTraverseDirectoryOpts - Optional Parameters: + * @param "Limit" (optional.Int32) - The number of records to return at once. Limited to 100. + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. + * @param "Skip" (optional.Int32) - The offset into the records to return. + * @param "Filter" (optional.Interface of []string) - A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` +@return []GraphObjectWithPaths +*/ + +type UsersApiGraphUserTraverseDirectoryOpts struct { + Limit optional.Int32 + XOrgId optional.String + Skip optional.Int32 + Filter optional.Interface +} + +func (a *UsersApiService) GraphUserTraverseDirectory(ctx context.Context, userId string, localVarOptionals *UsersApiGraphUserTraverseDirectoryOpts) ([]GraphObjectWithPaths, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []GraphObjectWithPaths + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/users/{user_id}/directories" + localVarPath = strings.Replace(localVarPath, "{"+"user_id"+"}", fmt.Sprintf("%v", userId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { + localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Skip.IsSet() { + localVarQueryParams.Add("skip", parameterToString(localVarOptionals.Skip.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Filter.IsSet() { + localVarQueryParams.Add("filter", parameterToString(localVarOptionals.Filter.Value(), "csv")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v []GraphObjectWithPaths + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +UsersApiService List the G Suite instances bound to a User +This endpoint will return all G-Suite Instances bound to a User, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this User to the corresponding G Suite instance; this array represents all grouping and/or associations that would have to be removed to deprovision the G Suite instance from this User. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/users/{UserID}/gsuites \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param userId ObjectID of the User. + * @param optional nil or *UsersApiGraphUserTraverseGSuiteOpts - Optional Parameters: + * @param "Limit" (optional.Int32) - The number of records to return at once. Limited to 100. + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. + * @param "Skip" (optional.Int32) - The offset into the records to return. + * @param "Filter" (optional.Interface of []string) - A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` +@return []GraphObjectWithPaths +*/ + +type UsersApiGraphUserTraverseGSuiteOpts struct { + Limit optional.Int32 + XOrgId optional.String + Skip optional.Int32 + Filter optional.Interface +} + +func (a *UsersApiService) GraphUserTraverseGSuite(ctx context.Context, userId string, localVarOptionals *UsersApiGraphUserTraverseGSuiteOpts) ([]GraphObjectWithPaths, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []GraphObjectWithPaths + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/users/{user_id}/gsuites" + localVarPath = strings.Replace(localVarPath, "{"+"user_id"+"}", fmt.Sprintf("%v", userId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { + localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Skip.IsSet() { + localVarQueryParams.Add("skip", parameterToString(localVarOptionals.Skip.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Filter.IsSet() { + localVarQueryParams.Add("filter", parameterToString(localVarOptionals.Filter.Value(), "csv")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v []GraphObjectWithPaths + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +UsersApiService List the LDAP servers bound to a User +This endpoint will return all LDAP Servers bound to a User, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this User to the corresponding LDAP Server; this array represents all grouping and/or associations that would have to be removed to deprovision the LDAP Server from this User. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/users/{UserID}/ldapservers \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param userId ObjectID of the User. + * @param optional nil or *UsersApiGraphUserTraverseLdapServerOpts - Optional Parameters: + * @param "Limit" (optional.Int32) - The number of records to return at once. Limited to 100. + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. + * @param "Skip" (optional.Int32) - The offset into the records to return. + * @param "Filter" (optional.Interface of []string) - A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` +@return []GraphObjectWithPaths +*/ + +type UsersApiGraphUserTraverseLdapServerOpts struct { + Limit optional.Int32 + XOrgId optional.String + Skip optional.Int32 + Filter optional.Interface +} + +func (a *UsersApiService) GraphUserTraverseLdapServer(ctx context.Context, userId string, localVarOptionals *UsersApiGraphUserTraverseLdapServerOpts) ([]GraphObjectWithPaths, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []GraphObjectWithPaths + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/users/{user_id}/ldapservers" + localVarPath = strings.Replace(localVarPath, "{"+"user_id"+"}", fmt.Sprintf("%v", userId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { + localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Skip.IsSet() { + localVarQueryParams.Add("skip", parameterToString(localVarOptionals.Skip.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Filter.IsSet() { + localVarQueryParams.Add("filter", parameterToString(localVarOptionals.Filter.Value(), "csv")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v []GraphObjectWithPaths + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +UsersApiService List the Office 365 instances bound to a User +This endpoint will return all Office 365 Instances bound to a User, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this User to the corresponding Office 365 instance; this array represents all grouping and/or associations that would have to be removed to deprovision the Office 365 instance from this User. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/users/{UserID}/office365s \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param userId ObjectID of the User. + * @param optional nil or *UsersApiGraphUserTraverseOffice365Opts - Optional Parameters: + * @param "Limit" (optional.Int32) - The number of records to return at once. Limited to 100. + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. + * @param "Skip" (optional.Int32) - The offset into the records to return. + * @param "Filter" (optional.Interface of []string) - A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` +@return []GraphObjectWithPaths +*/ + +type UsersApiGraphUserTraverseOffice365Opts struct { + Limit optional.Int32 + XOrgId optional.String + Skip optional.Int32 + Filter optional.Interface +} + +func (a *UsersApiService) GraphUserTraverseOffice365(ctx context.Context, userId string, localVarOptionals *UsersApiGraphUserTraverseOffice365Opts) ([]GraphObjectWithPaths, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []GraphObjectWithPaths + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/users/{user_id}/office365s" + localVarPath = strings.Replace(localVarPath, "{"+"user_id"+"}", fmt.Sprintf("%v", userId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { + localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Skip.IsSet() { + localVarQueryParams.Add("skip", parameterToString(localVarOptionals.Skip.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Filter.IsSet() { + localVarQueryParams.Add("filter", parameterToString(localVarOptionals.Filter.Value(), "csv")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v []GraphObjectWithPaths + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +UsersApiService List the RADIUS Servers bound to a User +This endpoint will return all RADIUS Servers bound to a User, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this User to the corresponding RADIUS Server; this array represents all grouping and/or associations that would have to be removed to deprovision the RADIUS Server from this User. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/users/{UserID}/radiusservers \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param userId ObjectID of the User. + * @param optional nil or *UsersApiGraphUserTraverseRadiusServerOpts - Optional Parameters: + * @param "Limit" (optional.Int32) - The number of records to return at once. Limited to 100. + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. + * @param "Skip" (optional.Int32) - The offset into the records to return. + * @param "Filter" (optional.Interface of []string) - A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` +@return []GraphObjectWithPaths +*/ + +type UsersApiGraphUserTraverseRadiusServerOpts struct { + Limit optional.Int32 + XOrgId optional.String + Skip optional.Int32 + Filter optional.Interface +} + +func (a *UsersApiService) GraphUserTraverseRadiusServer(ctx context.Context, userId string, localVarOptionals *UsersApiGraphUserTraverseRadiusServerOpts) ([]GraphObjectWithPaths, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []GraphObjectWithPaths + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/users/{user_id}/radiusservers" + localVarPath = strings.Replace(localVarPath, "{"+"user_id"+"}", fmt.Sprintf("%v", userId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { + localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Skip.IsSet() { + localVarQueryParams.Add("skip", parameterToString(localVarOptionals.Skip.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Filter.IsSet() { + localVarQueryParams.Add("filter", parameterToString(localVarOptionals.Filter.Value(), "csv")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v []GraphObjectWithPaths + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +UsersApiService List the Systems bound to a User +This endpoint will return all Systems bound to a User, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this User to the corresponding System; this array represents all grouping and/or associations that would have to be removed to deprovision the System from this User. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/users/{UserID}/systems\\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param userId ObjectID of the User. + * @param optional nil or *UsersApiGraphUserTraverseSystemOpts - Optional Parameters: + * @param "Limit" (optional.Int32) - The number of records to return at once. Limited to 100. + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. + * @param "Skip" (optional.Int32) - The offset into the records to return. + * @param "Filter" (optional.Interface of []string) - A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` +@return []GraphObjectWithPaths +*/ + +type UsersApiGraphUserTraverseSystemOpts struct { + Limit optional.Int32 + XOrgId optional.String + Skip optional.Int32 + Filter optional.Interface +} + +func (a *UsersApiService) GraphUserTraverseSystem(ctx context.Context, userId string, localVarOptionals *UsersApiGraphUserTraverseSystemOpts) ([]GraphObjectWithPaths, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []GraphObjectWithPaths + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/users/{user_id}/systems" + localVarPath = strings.Replace(localVarPath, "{"+"user_id"+"}", fmt.Sprintf("%v", userId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { + localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Skip.IsSet() { + localVarQueryParams.Add("skip", parameterToString(localVarOptionals.Skip.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Filter.IsSet() { + localVarQueryParams.Add("filter", parameterToString(localVarOptionals.Filter.Value(), "csv")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v []GraphObjectWithPaths + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +UsersApiService List the System Groups bound to a User +This endpoint will return all System Groups bound to a User, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this User to the corresponding System Group; this array represents all grouping and/or associations that would have to be removed to deprovision the System Group from this User. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/users/{UserID}/systemgroups\\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param userId ObjectID of the User. + * @param optional nil or *UsersApiGraphUserTraverseSystemGroupOpts - Optional Parameters: + * @param "Limit" (optional.Int32) - The number of records to return at once. Limited to 100. + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. + * @param "Skip" (optional.Int32) - The offset into the records to return. + * @param "Filter" (optional.Interface of []string) - A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` +@return []GraphObjectWithPaths +*/ + +type UsersApiGraphUserTraverseSystemGroupOpts struct { + Limit optional.Int32 + XOrgId optional.String + Skip optional.Int32 + Filter optional.Interface +} + +func (a *UsersApiService) GraphUserTraverseSystemGroup(ctx context.Context, userId string, localVarOptionals *UsersApiGraphUserTraverseSystemGroupOpts) ([]GraphObjectWithPaths, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []GraphObjectWithPaths + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/users/{user_id}/systemgroups" + localVarPath = strings.Replace(localVarPath, "{"+"user_id"+"}", fmt.Sprintf("%v", userId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { + localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Skip.IsSet() { + localVarQueryParams.Add("skip", parameterToString(localVarOptionals.Skip.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Filter.IsSet() { + localVarQueryParams.Add("filter", parameterToString(localVarOptionals.Filter.Value(), "csv")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v []GraphObjectWithPaths + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +UsersApiService Delete a Push Endpoint associated with a User +This endpoint will delete a push endpoint associated with a user. + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param userId + * @param pushEndpointId + * @param optional nil or *UsersApiPushEndpointsDeleteOpts - Optional Parameters: + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. +@return PushEndpointResponse +*/ + +type UsersApiPushEndpointsDeleteOpts struct { + XOrgId optional.String +} + +func (a *UsersApiService) PushEndpointsDelete(ctx context.Context, userId string, pushEndpointId string, localVarOptionals *UsersApiPushEndpointsDeleteOpts) (PushEndpointResponse, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Delete") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue PushEndpointResponse + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/users/{user_id}/pushendpoints/{push_endpoint_id}" + localVarPath = strings.Replace(localVarPath, "{"+"user_id"+"}", fmt.Sprintf("%v", userId), -1) + localVarPath = strings.Replace(localVarPath, "{"+"push_endpoint_id"+"}", fmt.Sprintf("%v", pushEndpointId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v PushEndpointResponse + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 400 { + var v ErrorDetails + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 401 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 403 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 404 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 409 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 500 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +UsersApiService Get a push endpoint associated with a User +This endpoint will retrieve a push endpoint associated with a user. + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param userId + * @param pushEndpointId + * @param optional nil or *UsersApiPushEndpointsGetOpts - Optional Parameters: + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. +@return PushEndpointResponse +*/ + +type UsersApiPushEndpointsGetOpts struct { + XOrgId optional.String +} + +func (a *UsersApiService) PushEndpointsGet(ctx context.Context, userId string, pushEndpointId string, localVarOptionals *UsersApiPushEndpointsGetOpts) (PushEndpointResponse, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue PushEndpointResponse + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/users/{user_id}/pushendpoints/{push_endpoint_id}" + localVarPath = strings.Replace(localVarPath, "{"+"user_id"+"}", fmt.Sprintf("%v", userId), -1) + localVarPath = strings.Replace(localVarPath, "{"+"push_endpoint_id"+"}", fmt.Sprintf("%v", pushEndpointId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v PushEndpointResponse + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 400 { + var v ErrorDetails + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 401 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 403 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 404 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 409 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 500 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +UsersApiService List Push Endpoints associated with a User +This endpoint returns the list of push endpoints associated with a user. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/users/{UserID}/pushendpoints \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: ${API_KEY}' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param userId + * @param optional nil or *UsersApiPushEndpointsListOpts - Optional Parameters: + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. +@return []PushEndpointResponse +*/ + +type UsersApiPushEndpointsListOpts struct { + XOrgId optional.String +} + +func (a *UsersApiService) PushEndpointsList(ctx context.Context, userId string, localVarOptionals *UsersApiPushEndpointsListOpts) ([]PushEndpointResponse, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []PushEndpointResponse + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/users/{user_id}/pushendpoints" + localVarPath = strings.Replace(localVarPath, "{"+"user_id"+"}", fmt.Sprintf("%v", userId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v []PushEndpointResponse + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 400 { + var v ErrorDetails + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 401 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 403 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 404 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 409 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 500 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +UsersApiService Update a push endpoint associated with a User +This endpoint will update a push endpoint associated with a user. + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param userId + * @param pushEndpointId + * @param optional nil or *UsersApiPushEndpointsPatchOpts - Optional Parameters: + * @param "Body" (optional.Interface of PushendpointsPushEndpointIdBody) - + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. +@return PushEndpointResponse +*/ + +type UsersApiPushEndpointsPatchOpts struct { + Body optional.Interface + XOrgId optional.String +} + +func (a *UsersApiService) PushEndpointsPatch(ctx context.Context, userId string, pushEndpointId string, localVarOptionals *UsersApiPushEndpointsPatchOpts) (PushEndpointResponse, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Patch") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue PushEndpointResponse + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/users/{user_id}/pushendpoints/{push_endpoint_id}" + localVarPath = strings.Replace(localVarPath, "{"+"user_id"+"}", fmt.Sprintf("%v", userId), -1) + localVarPath = strings.Replace(localVarPath, "{"+"push_endpoint_id"+"}", fmt.Sprintf("%v", pushEndpointId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + // body params + if localVarOptionals != nil && localVarOptionals.Body.IsSet() { + + localVarOptionalBody:= localVarOptionals.Body.Value() + localVarPostBody = &localVarOptionalBody + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v PushEndpointResponse + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 400 { + var v ErrorDetails + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 401 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 403 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 404 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 409 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + if localVarHttpResponse.StatusCode == 500 { + var v ModelError + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} diff --git a/jcapiv2/api_workday_import.go b/jcapiv2/api_workday_import.go new file mode 100644 index 0000000..7532dea --- /dev/null +++ b/jcapiv2/api_workday_import.go @@ -0,0 +1,1046 @@ + +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +import ( + "context" + "io/ioutil" + "net/http" + "net/url" + "strings" + "fmt" + "github.com/antihax/optional" +) + +// Linger please +var ( + _ context.Context +) + +type WorkdayImportApiService service +/* +WorkdayImportApiService Authorize Workday +This endpoint adds an authorization method to a workday instance. You must supply a username and password for `Basic Authentication` that is the same as your WorkDay Integrator System User. Failure to provide these credentials will result in the request being rejected. Currently `O-Auth` isn't a supported authentication protocol for WorkDay, but will be in the future. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/workdays/{WorkDayID}/auth \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"auth\":{ \"basic\": { \"username\": \"someDeveloper\", \"password\": \"notTheRealPassword\" } } }' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param workdayId + * @param optional nil or *WorkdayImportApiWorkdaysAuthorizeOpts - Optional Parameters: + * @param "Body" (optional.Interface of AuthInputObject) - + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. + +*/ + +type WorkdayImportApiWorkdaysAuthorizeOpts struct { + Body optional.Interface + XOrgId optional.String +} + +func (a *WorkdayImportApiService) WorkdaysAuthorize(ctx context.Context, workdayId string, localVarOptionals *WorkdayImportApiWorkdaysAuthorizeOpts) (*http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Post") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/workdays/{workday_id}/auth" + localVarPath = strings.Replace(localVarPath, "{"+"workday_id"+"}", fmt.Sprintf("%v", workdayId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + // body params + if localVarOptionals != nil && localVarOptionals.Body.IsSet() { + + localVarOptionalBody:= localVarOptionals.Body.Value() + localVarPostBody = &localVarOptionalBody + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarHttpResponse, err + } + + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + return localVarHttpResponse, newErr + } + + return localVarHttpResponse, nil +} +/* +WorkdayImportApiService Deauthorize Workday +Removes any and all authorization methods from the workday instance ##### Sample Request ``` curl -X DELETE https://console.jumpcloud.com/api/v2/workdays/{WorkDayID}/auth \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param workdayId + * @param optional nil or *WorkdayImportApiWorkdaysDeauthorizeOpts - Optional Parameters: + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. + +*/ + +type WorkdayImportApiWorkdaysDeauthorizeOpts struct { + XOrgId optional.String +} + +func (a *WorkdayImportApiService) WorkdaysDeauthorize(ctx context.Context, workdayId string, localVarOptionals *WorkdayImportApiWorkdaysDeauthorizeOpts) (*http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Delete") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/workdays/{workday_id}/auth" + localVarPath = strings.Replace(localVarPath, "{"+"workday_id"+"}", fmt.Sprintf("%v", workdayId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarHttpResponse, err + } + + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + return localVarHttpResponse, newErr + } + + return localVarHttpResponse, nil +} +/* +WorkdayImportApiService Get Workday +This endpoint will return all the available information about an instance of Workday. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/workdays/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param id + * @param optional nil or *WorkdayImportApiWorkdaysGetOpts - Optional Parameters: + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. +@return WorkdayOutput +*/ + +type WorkdayImportApiWorkdaysGetOpts struct { + XOrgId optional.String +} + +func (a *WorkdayImportApiService) WorkdaysGet(ctx context.Context, id string, localVarOptionals *WorkdayImportApiWorkdaysGetOpts) (WorkdayOutput, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue WorkdayOutput + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/workdays/{id}" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v WorkdayOutput + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +WorkdayImportApiService Workday Import +The endpoint allows you to create a Workday Import request. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/workdays/{WorkdayID}/import \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '[ { \"email\":\"{email}\", \"firstname\":\"{firstname}\", \"lastname\":\"{firstname}\", \"username\":\"{username}\", \"attributes\":[ {\"name\":\"EmployeeID\",\"value\":\"0000\"}, {\"name\":\"WorkdayID\",\"value\":\"name.name\"} ] } ] ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param workdayId + * @param optional nil or *WorkdayImportApiWorkdaysImportOpts - Optional Parameters: + * @param "Body" (optional.Interface of []BulkUserCreate) - + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. +@return JobId +*/ + +type WorkdayImportApiWorkdaysImportOpts struct { + Body optional.Interface + XOrgId optional.String +} + +func (a *WorkdayImportApiService) WorkdaysImport(ctx context.Context, workdayId string, localVarOptionals *WorkdayImportApiWorkdaysImportOpts) (JobId, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Post") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue JobId + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/workdays/{workday_id}/import" + localVarPath = strings.Replace(localVarPath, "{"+"workday_id"+"}", fmt.Sprintf("%v", workdayId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + // body params + if localVarOptionals != nil && localVarOptionals.Body.IsSet() { + + localVarOptionalBody:= localVarOptionals.Body.Value() + localVarPostBody = &localVarOptionalBody + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 201 { + var v JobId + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +WorkdayImportApiService List Import Results +This endpoint provides a list of job results from the workday import and will contain all imported data from Workday. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/workdays/{WorkdayID}/import/{ImportJobID}/results \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param id + * @param jobId + * @param optional nil or *WorkdayImportApiWorkdaysImportresultsOpts - Optional Parameters: + * @param "Limit" (optional.Int32) - The number of records to return at once. Limited to 100. + * @param "Skip" (optional.Int32) - The offset into the records to return. + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. +@return []JobWorkresult +*/ + +type WorkdayImportApiWorkdaysImportresultsOpts struct { + Limit optional.Int32 + Skip optional.Int32 + XOrgId optional.String +} + +func (a *WorkdayImportApiService) WorkdaysImportresults(ctx context.Context, id string, jobId string, localVarOptionals *WorkdayImportApiWorkdaysImportresultsOpts) ([]JobWorkresult, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []JobWorkresult + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/workdays/{id}/import/{job_id}/results" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1) + localVarPath = strings.Replace(localVarPath, "{"+"job_id"+"}", fmt.Sprintf("%v", jobId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { + localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Skip.IsSet() { + localVarQueryParams.Add("skip", parameterToString(localVarOptionals.Skip.Value(), "")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v []JobWorkresult + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +WorkdayImportApiService List Workdays +This endpoint will return all the available information about all your instances of Workday. ##### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/workdays/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param optional nil or *WorkdayImportApiWorkdaysListOpts - Optional Parameters: + * @param "Fields" (optional.Interface of []string) - The comma separated fields included in the returned records. If omitted, the default list of fields will be returned. + * @param "Limit" (optional.Int32) - The number of records to return at once. Limited to 100. + * @param "Skip" (optional.Int32) - The offset into the records to return. + * @param "Sort" (optional.Interface of []string) - The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. + * @param "Filter" (optional.Interface of []string) - A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. +@return []WorkdayOutput +*/ + +type WorkdayImportApiWorkdaysListOpts struct { + Fields optional.Interface + Limit optional.Int32 + Skip optional.Int32 + Sort optional.Interface + Filter optional.Interface + XOrgId optional.String +} + +func (a *WorkdayImportApiService) WorkdaysList(ctx context.Context, localVarOptionals *WorkdayImportApiWorkdaysListOpts) ([]WorkdayOutput, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []WorkdayOutput + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/workdays" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Fields.IsSet() { + localVarQueryParams.Add("fields", parameterToString(localVarOptionals.Fields.Value(), "csv")) + } + if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { + localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Skip.IsSet() { + localVarQueryParams.Add("skip", parameterToString(localVarOptionals.Skip.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Sort.IsSet() { + localVarQueryParams.Add("sort", parameterToString(localVarOptionals.Sort.Value(), "csv")) + } + if localVarOptionals != nil && localVarOptionals.Filter.IsSet() { + localVarQueryParams.Add("filter", parameterToString(localVarOptionals.Filter.Value(), "csv")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v []WorkdayOutput + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +WorkdayImportApiService Create new Workday +This endpoint allows you to create a new workday instance. You must supply a username and password for `Basic Authentication` that is the same as your WorkDay Integrator System User. Failure to provide these credentials will result in the request being rejected. Currently `O-Auth` isn't a supported authentication protocol for WorkDay, but will be in the future. Currently, only one instance is allowed and it must be `Workday Import`. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/workdays/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"name\": \"Workday2\", \"reportUrl\":\"https://workday.com/ccx/service/customreport2/gms/user/reportname?format=json\", \"auth\": { \"basic\": { \"username\": \"someDeveloper\", \"password\": \"notTheRealPassword\" } } }' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param optional nil or *WorkdayImportApiWorkdaysPostOpts - Optional Parameters: + * @param "Body" (optional.Interface of WorkdayInput) - + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. +@return WorkdayOutput +*/ + +type WorkdayImportApiWorkdaysPostOpts struct { + Body optional.Interface + XOrgId optional.String +} + +func (a *WorkdayImportApiService) WorkdaysPost(ctx context.Context, localVarOptionals *WorkdayImportApiWorkdaysPostOpts) (WorkdayOutput, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Post") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue WorkdayOutput + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/workdays" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + // body params + if localVarOptionals != nil && localVarOptionals.Body.IsSet() { + + localVarOptionalBody:= localVarOptionals.Body.Value() + localVarPostBody = &localVarOptionalBody + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 201 { + var v WorkdayOutput + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +WorkdayImportApiService Update Workday +This endpoint allows you to update the name and Custom Report URL for a Workday Instance. Currently, the name can not be changed from the default of `Workday Import`. ##### Sample Request ``` curl -X PUT https://console.jumpcloud.com/api/v2/workdays/{WorkdayID} \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"reportUrl\":\"{Report_URL}\", \"name\":\"{Name}\" } ' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param id + * @param optional nil or *WorkdayImportApiWorkdaysPutOpts - Optional Parameters: + * @param "Body" (optional.Interface of WorkdayFields) - + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. +@return WorkdayOutput +*/ + +type WorkdayImportApiWorkdaysPutOpts struct { + Body optional.Interface + XOrgId optional.String +} + +func (a *WorkdayImportApiService) WorkdaysPut(ctx context.Context, id string, localVarOptionals *WorkdayImportApiWorkdaysPutOpts) (WorkdayOutput, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Put") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue WorkdayOutput + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/workdays/{id}" + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + // body params + if localVarOptionals != nil && localVarOptionals.Body.IsSet() { + + localVarOptionalBody:= localVarOptionals.Body.Value() + localVarPostBody = &localVarOptionalBody + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v WorkdayOutput + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} +/* +WorkdayImportApiService List Workday Workers +This endpoint will return all of the data in your WorkDay Custom Report that has been associated with your WorkDay Instance in JumpCloud. ##### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/workdays/{WorkDayID}/workers \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param workdayId + * @param optional nil or *WorkdayImportApiWorkdaysWorkersOpts - Optional Parameters: + * @param "Limit" (optional.Int32) - The number of records to return at once. Limited to 100. + * @param "Skip" (optional.Int32) - The offset into the records to return. + * @param "Sort" (optional.Interface of []string) - The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. + * @param "XOrgId" (optional.String) - Organization identifier that can be obtained from console settings. +@return []WorkdayWorker +*/ + +type WorkdayImportApiWorkdaysWorkersOpts struct { + Limit optional.Int32 + Skip optional.Int32 + Sort optional.Interface + XOrgId optional.String +} + +func (a *WorkdayImportApiService) WorkdaysWorkers(ctx context.Context, workdayId string, localVarOptionals *WorkdayImportApiWorkdaysWorkersOpts) ([]WorkdayWorker, *http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Get") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + localVarReturnValue []WorkdayWorker + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/workdays/{workday_id}/workers" + localVarPath = strings.Replace(localVarPath, "{"+"workday_id"+"}", fmt.Sprintf("%v", workdayId), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if localVarOptionals != nil && localVarOptionals.Limit.IsSet() { + localVarQueryParams.Add("limit", parameterToString(localVarOptionals.Limit.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Skip.IsSet() { + localVarQueryParams.Add("skip", parameterToString(localVarOptionals.Skip.Value(), "")) + } + if localVarOptionals != nil && localVarOptionals.Sort.IsSet() { + localVarQueryParams.Add("sort", parameterToString(localVarOptionals.Sort.Value(), "csv")) + } + // to determine the Content-Type header + localVarHttpContentTypes := []string{} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.XOrgId.IsSet() { + localVarHeaderParams["x-org-id"] = parameterToString(localVarOptionals.XOrgId.Value(), "") + } + if ctx != nil { + // API Key Authentication + if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { + var key string + if auth.Prefix != "" { + key = auth.Prefix + " " + auth.Key + } else { + key = auth.Key + } + localVarHeaderParams["x-api-key"] = key + + } + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarReturnValue, localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarReturnValue, localVarHttpResponse, err + } + + if localVarHttpResponse.StatusCode < 300 { + // If we succeed, return the data, otherwise pass on to decode error. + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err == nil { + return localVarReturnValue, localVarHttpResponse, err + } + } + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + if localVarHttpResponse.StatusCode == 200 { + var v []WorkdayWorker + err = a.client.decode(&v, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHttpResponse, newErr + } + newErr.model = v + return localVarReturnValue, localVarHttpResponse, newErr + } + return localVarReturnValue, localVarHttpResponse, newErr + } + + return localVarReturnValue, localVarHttpResponse, nil +} diff --git a/jcapiv2/client.go b/jcapiv2/client.go new file mode 100644 index 0000000..2c5dccc --- /dev/null +++ b/jcapiv2/client.go @@ -0,0 +1,606 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +import ( + "bytes" + "context" + "encoding/json" + "encoding/xml" + "errors" + "fmt" + "io" + "mime/multipart" + "net/http" + "net/url" + "os" + "path/filepath" + "reflect" + "regexp" + "strconv" + "strings" + "time" + "unicode/utf8" + + "golang.org/x/oauth2" +) + +var ( + jsonCheck = regexp.MustCompile("(?i:[application|text]/json)") + xmlCheck = regexp.MustCompile("(?i:[application|text]/xml)") +) + +// APIClient manages communication with the JumpCloud API API v2.0 +// In most cases there should be only one, shared, APIClient. +type APIClient struct { + cfg *Configuration + common service // Reuse a single struct instead of allocating one for each service on the heap. + + // API Services + + ActiveDirectoryApi *ActiveDirectoryApiService + + AdministratorsApi *AdministratorsApiService + + AppleMDMApi *AppleMDMApiService + + ApplicationsApi *ApplicationsApiService + + AuthenticationPoliciesApi *AuthenticationPoliciesApiService + + BulkJobRequestsApi *BulkJobRequestsApiService + + CommandResultsApi *CommandResultsApiService + + CommandsApi *CommandsApiService + + CustomEmailsApi *CustomEmailsApiService + + DirectoriesApi *DirectoriesApiService + + DuoApi *DuoApiService + + FdeApi *FdeApiService + + GSuiteApi *GSuiteApiService + + GSuiteImportApi *GSuiteImportApiService + + GraphApi *GraphApiService + + GroupsApi *GroupsApiService + + IPListsApi *IPListsApiService + + ImageApi *ImageApiService + + LDAPServersApi *LDAPServersApiService + + LogosApi *LogosApiService + + ManagedServiceProviderApi *ManagedServiceProviderApiService + + Office365Api *Office365ApiService + + Office365ImportApi *Office365ImportApiService + + OrganizationsApi *OrganizationsApiService + + PoliciesApi *PoliciesApiService + + PolicyGroupAssociationsApi *PolicyGroupAssociationsApiService + + PolicyGroupMembersMembershipApi *PolicyGroupMembersMembershipApiService + + PolicyGroupsApi *PolicyGroupsApiService + + PolicytemplatesApi *PolicytemplatesApiService + + ProvidersApi *ProvidersApiService + + RADIUSServersApi *RADIUSServersApiService + + SCIMImportApi *SCIMImportApiService + + SambaDomainsApi *SambaDomainsApiService + + SoftwareAppsApi *SoftwareAppsApiService + + SubscriptionsApi *SubscriptionsApiService + + SystemGroupAssociationsApi *SystemGroupAssociationsApiService + + SystemGroupMembersMembershipApi *SystemGroupMembersMembershipApiService + + SystemGroupsApi *SystemGroupsApiService + + SystemInsightsApi *SystemInsightsApiService + + SystemsApi *SystemsApiService + + UserGroupAssociationsApi *UserGroupAssociationsApiService + + UserGroupMembersMembershipApi *UserGroupMembersMembershipApiService + + UserGroupsApi *UserGroupsApiService + + UsersApi *UsersApiService + + WorkdayImportApi *WorkdayImportApiService +} + +type service struct { + client *APIClient +} + +// NewAPIClient creates a new API client. Requires a userAgent string describing your application. +// optionally a custom http.Client to allow for advanced features such as caching. +func NewAPIClient(cfg *Configuration) *APIClient { + if cfg.HTTPClient == nil { + cfg.HTTPClient = http.DefaultClient + } + + c := &APIClient{} + c.cfg = cfg + c.common.client = c + + // API Services + c.ActiveDirectoryApi = (*ActiveDirectoryApiService)(&c.common) + c.AdministratorsApi = (*AdministratorsApiService)(&c.common) + c.AppleMDMApi = (*AppleMDMApiService)(&c.common) + c.ApplicationsApi = (*ApplicationsApiService)(&c.common) + c.AuthenticationPoliciesApi = (*AuthenticationPoliciesApiService)(&c.common) + c.BulkJobRequestsApi = (*BulkJobRequestsApiService)(&c.common) + c.CommandResultsApi = (*CommandResultsApiService)(&c.common) + c.CommandsApi = (*CommandsApiService)(&c.common) + c.CustomEmailsApi = (*CustomEmailsApiService)(&c.common) + c.DirectoriesApi = (*DirectoriesApiService)(&c.common) + c.DuoApi = (*DuoApiService)(&c.common) + c.FdeApi = (*FdeApiService)(&c.common) + c.GSuiteApi = (*GSuiteApiService)(&c.common) + c.GSuiteImportApi = (*GSuiteImportApiService)(&c.common) + c.GraphApi = (*GraphApiService)(&c.common) + c.GroupsApi = (*GroupsApiService)(&c.common) + c.IPListsApi = (*IPListsApiService)(&c.common) + c.ImageApi = (*ImageApiService)(&c.common) + c.LDAPServersApi = (*LDAPServersApiService)(&c.common) + c.LogosApi = (*LogosApiService)(&c.common) + c.ManagedServiceProviderApi = (*ManagedServiceProviderApiService)(&c.common) + c.Office365Api = (*Office365ApiService)(&c.common) + c.Office365ImportApi = (*Office365ImportApiService)(&c.common) + c.OrganizationsApi = (*OrganizationsApiService)(&c.common) + c.PoliciesApi = (*PoliciesApiService)(&c.common) + c.PolicyGroupAssociationsApi = (*PolicyGroupAssociationsApiService)(&c.common) + c.PolicyGroupMembersMembershipApi = (*PolicyGroupMembersMembershipApiService)(&c.common) + c.PolicyGroupsApi = (*PolicyGroupsApiService)(&c.common) + c.PolicytemplatesApi = (*PolicytemplatesApiService)(&c.common) + c.ProvidersApi = (*ProvidersApiService)(&c.common) + c.RADIUSServersApi = (*RADIUSServersApiService)(&c.common) + c.SCIMImportApi = (*SCIMImportApiService)(&c.common) + c.SambaDomainsApi = (*SambaDomainsApiService)(&c.common) + c.SoftwareAppsApi = (*SoftwareAppsApiService)(&c.common) + c.SubscriptionsApi = (*SubscriptionsApiService)(&c.common) + c.SystemGroupAssociationsApi = (*SystemGroupAssociationsApiService)(&c.common) + c.SystemGroupMembersMembershipApi = (*SystemGroupMembersMembershipApiService)(&c.common) + c.SystemGroupsApi = (*SystemGroupsApiService)(&c.common) + c.SystemInsightsApi = (*SystemInsightsApiService)(&c.common) + c.SystemsApi = (*SystemsApiService)(&c.common) + c.UserGroupAssociationsApi = (*UserGroupAssociationsApiService)(&c.common) + c.UserGroupMembersMembershipApi = (*UserGroupMembersMembershipApiService)(&c.common) + c.UserGroupsApi = (*UserGroupsApiService)(&c.common) + c.UsersApi = (*UsersApiService)(&c.common) + c.WorkdayImportApi = (*WorkdayImportApiService)(&c.common) + + return c +} + +func atoi(in string) (int, error) { + return strconv.Atoi(in) +} + +// selectHeaderContentType select a content type from the available list. +func selectHeaderContentType(contentTypes []string) string { + if len(contentTypes) == 0 { + return "" + } + if contains(contentTypes, "application/json") { + return "application/json" + } + return contentTypes[0] // use the first content type specified in 'consumes' +} + +// selectHeaderAccept join all accept types and return +func selectHeaderAccept(accepts []string) string { + if len(accepts) == 0 { + return "" + } + + if contains(accepts, "application/json") { + return "application/json" + } + + return strings.Join(accepts, ",") +} + +// contains is a case insenstive match, finding needle in a haystack +func contains(haystack []string, needle string) bool { + for _, a := range haystack { + if strings.ToLower(a) == strings.ToLower(needle) { + return true + } + } + return false +} + +// Verify optional parameters are of the correct type. +func typeCheckParameter(obj interface{}, expected string, name string) error { + // Make sure there is an object. + if obj == nil { + return nil + } + + // Check the type is as expected. + if reflect.TypeOf(obj).String() != expected { + return fmt.Errorf("Expected %s to be of type %s but received %s.", name, expected, reflect.TypeOf(obj).String()) + } + return nil +} + +// parameterToString convert interface{} parameters to string, using a delimiter if format is provided. +func parameterToString(obj interface{}, collectionFormat string) string { + var delimiter string + + switch collectionFormat { + case "pipes": + delimiter = "|" + case "ssv": + delimiter = " " + case "tsv": + delimiter = "\t" + case "csv": + delimiter = "," + } + + if reflect.TypeOf(obj).Kind() == reflect.Slice { + return strings.Trim(strings.Replace(fmt.Sprint(obj), " ", delimiter, -1), "[]") + } + + return fmt.Sprintf("%v", obj) +} + +// callAPI do the request. +func (c *APIClient) callAPI(request *http.Request) (*http.Response, error) { + return c.cfg.HTTPClient.Do(request) +} + +// Change base path to allow switching to mocks +func (c *APIClient) ChangeBasePath(path string) { + c.cfg.BasePath = path +} + +// prepareRequest build the request +func (c *APIClient) prepareRequest( + ctx context.Context, + path string, method string, + postBody interface{}, + headerParams map[string]string, + queryParams url.Values, + formParams url.Values, + fileName string, + fileBytes []byte) (localVarRequest *http.Request, err error) { + + var body *bytes.Buffer + + // Detect postBody type and post. + if postBody != nil { + contentType := headerParams["Content-Type"] + if contentType == "" { + contentType = detectContentType(postBody) + headerParams["Content-Type"] = contentType + } + + body, err = setBody(postBody, contentType) + if err != nil { + return nil, err + } + } + + // add form parameters and file if available. + if strings.HasPrefix(headerParams["Content-Type"], "multipart/form-data") && len(formParams) > 0 || (len(fileBytes) > 0 && fileName != "") { + if body != nil { + return nil, errors.New("Cannot specify postBody and multipart form at the same time.") + } + body = &bytes.Buffer{} + w := multipart.NewWriter(body) + + for k, v := range formParams { + for _, iv := range v { + if strings.HasPrefix(k, "@") { // file + err = addFile(w, k[1:], iv) + if err != nil { + return nil, err + } + } else { // form value + w.WriteField(k, iv) + } + } + } + if len(fileBytes) > 0 && fileName != "" { + w.Boundary() + //_, fileNm := filepath.Split(fileName) + part, err := w.CreateFormFile("file", filepath.Base(fileName)) + if err != nil { + return nil, err + } + _, err = part.Write(fileBytes) + if err != nil { + return nil, err + } + // Set the Boundary in the Content-Type + headerParams["Content-Type"] = w.FormDataContentType() + } + + // Set Content-Length + headerParams["Content-Length"] = fmt.Sprintf("%d", body.Len()) + w.Close() + } + + if strings.HasPrefix(headerParams["Content-Type"], "application/x-www-form-urlencoded") && len(formParams) > 0 { + if body != nil { + return nil, errors.New("Cannot specify postBody and x-www-form-urlencoded form at the same time.") + } + body = &bytes.Buffer{} + body.WriteString(formParams.Encode()) + // Set Content-Length + headerParams["Content-Length"] = fmt.Sprintf("%d", body.Len()) + } + + // Setup path and query parameters + url, err := url.Parse(path) + if err != nil { + return nil, err + } + + // Adding Query Param + query := url.Query() + for k, v := range queryParams { + for _, iv := range v { + query.Add(k, iv) + } + } + + // Encode the parameters. + url.RawQuery = query.Encode() + + // Generate a new request + if body != nil { + localVarRequest, err = http.NewRequest(method, url.String(), body) + } else { + localVarRequest, err = http.NewRequest(method, url.String(), nil) + } + if err != nil { + return nil, err + } + + // add header parameters, if any + if len(headerParams) > 0 { + headers := http.Header{} + for h, v := range headerParams { + headers.Set(h, v) + } + localVarRequest.Header = headers + } + + // Override request host, if applicable + if c.cfg.Host != "" { + localVarRequest.Host = c.cfg.Host + } + + // Add the user agent to the request. + localVarRequest.Header.Add("User-Agent", c.cfg.UserAgent) + + if ctx != nil { + // add context to the request + localVarRequest = localVarRequest.WithContext(ctx) + + // Walk through any authentication. + + // OAuth2 authentication + if tok, ok := ctx.Value(ContextOAuth2).(oauth2.TokenSource); ok { + // We were able to grab an oauth2 token from the context + var latestToken *oauth2.Token + if latestToken, err = tok.Token(); err != nil { + return nil, err + } + + latestToken.SetAuthHeader(localVarRequest) + } + + // Basic HTTP Authentication + if auth, ok := ctx.Value(ContextBasicAuth).(BasicAuth); ok { + localVarRequest.SetBasicAuth(auth.UserName, auth.Password) + } + + // AccessToken Authentication + if auth, ok := ctx.Value(ContextAccessToken).(string); ok { + localVarRequest.Header.Add("Authorization", "Bearer "+auth) + } + } + + for header, value := range c.cfg.DefaultHeader { + localVarRequest.Header.Add(header, value) + } + + return localVarRequest, nil +} + +func (c *APIClient) decode(v interface{}, b []byte, contentType string) (err error) { + if strings.Contains(contentType, "application/xml") { + if err = xml.Unmarshal(b, v); err != nil { + return err + } + return nil + } else if strings.Contains(contentType, "application/json") { + if err = json.Unmarshal(b, v); err != nil { + return err + } + return nil + } + return errors.New("undefined response type") +} + +// Add a file to the multipart request +func addFile(w *multipart.Writer, fieldName, path string) error { + file, err := os.Open(path) + if err != nil { + return err + } + defer file.Close() + + part, err := w.CreateFormFile(fieldName, filepath.Base(path)) + if err != nil { + return err + } + _, err = io.Copy(part, file) + + return err +} + +// Prevent trying to import "fmt" +func reportError(format string, a ...interface{}) error { + return fmt.Errorf(format, a...) +} + +// Set request body from an interface{} +func setBody(body interface{}, contentType string) (bodyBuf *bytes.Buffer, err error) { + if bodyBuf == nil { + bodyBuf = &bytes.Buffer{} + } + + if reader, ok := body.(io.Reader); ok { + _, err = bodyBuf.ReadFrom(reader) + } else if b, ok := body.([]byte); ok { + _, err = bodyBuf.Write(b) + } else if s, ok := body.(string); ok { + _, err = bodyBuf.WriteString(s) + } else if s, ok := body.(*string); ok { + _, err = bodyBuf.WriteString(*s) + } else if jsonCheck.MatchString(contentType) { + err = json.NewEncoder(bodyBuf).Encode(body) + } else if xmlCheck.MatchString(contentType) { + xml.NewEncoder(bodyBuf).Encode(body) + } + + if err != nil { + return nil, err + } + + if bodyBuf.Len() == 0 { + err = fmt.Errorf("Invalid body type %s\n", contentType) + return nil, err + } + return bodyBuf, nil +} + +// detectContentType method is used to figure out `Request.Body` content type for request header +func detectContentType(body interface{}) string { + contentType := "text/plain; charset=utf-8" + kind := reflect.TypeOf(body).Kind() + + switch kind { + case reflect.Struct, reflect.Map, reflect.Ptr: + contentType = "application/json; charset=utf-8" + case reflect.String: + contentType = "text/plain; charset=utf-8" + default: + if b, ok := body.([]byte); ok { + contentType = http.DetectContentType(b) + } else if kind == reflect.Slice { + contentType = "application/json; charset=utf-8" + } + } + + return contentType +} + +// Ripped from https://github.com/gregjones/httpcache/blob/master/httpcache.go +type cacheControl map[string]string + +func parseCacheControl(headers http.Header) cacheControl { + cc := cacheControl{} + ccHeader := headers.Get("Cache-Control") + for _, part := range strings.Split(ccHeader, ",") { + part = strings.Trim(part, " ") + if part == "" { + continue + } + if strings.ContainsRune(part, '=') { + keyval := strings.Split(part, "=") + cc[strings.Trim(keyval[0], " ")] = strings.Trim(keyval[1], ",") + } else { + cc[part] = "" + } + } + return cc +} + +// CacheExpires helper function to determine remaining time before repeating a request. +func CacheExpires(r *http.Response) time.Time { + // Figure out when the cache expires. + var expires time.Time + now, err := time.Parse(time.RFC1123, r.Header.Get("date")) + if err != nil { + return time.Now() + } + respCacheControl := parseCacheControl(r.Header) + + if maxAge, ok := respCacheControl["max-age"]; ok { + lifetime, err := time.ParseDuration(maxAge + "s") + if err != nil { + expires = now + } + expires = now.Add(lifetime) + } else { + expiresHeader := r.Header.Get("Expires") + if expiresHeader != "" { + expires, err = time.Parse(time.RFC1123, expiresHeader) + if err != nil { + expires = now + } + } + } + return expires +} + +func strlen(s string) int { + return utf8.RuneCountInString(s) +} + +// GenericSwaggerError Provides access to the body, error and model on returned errors. +type GenericSwaggerError struct { + body []byte + error string + model interface{} +} + +// Error returns non-empty string if there was an error. +func (e GenericSwaggerError) Error() string { + return e.error +} + +// Body returns the raw bytes of the response +func (e GenericSwaggerError) Body() []byte { + return e.body +} + +// Model returns the unpacked model of the error +func (e GenericSwaggerError) Model() interface{} { + return e.model +} diff --git a/jcapiv2/configuration.go b/jcapiv2/configuration.go new file mode 100644 index 0000000..d0383c5 --- /dev/null +++ b/jcapiv2/configuration.go @@ -0,0 +1,72 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +import ( + "net/http" +) + +// contextKeys are used to identify the type of value in the context. +// Since these are string, it is possible to get a short description of the +// context key for logging and debugging using key.String(). + +type contextKey string + +func (c contextKey) String() string { + return "auth " + string(c) +} + +var ( + // ContextOAuth2 takes a oauth2.TokenSource as authentication for the request. + ContextOAuth2 = contextKey("token") + + // ContextBasicAuth takes BasicAuth as authentication for the request. + ContextBasicAuth = contextKey("basic") + + // ContextAccessToken takes a string oauth2 access token as authentication for the request. + ContextAccessToken = contextKey("accesstoken") + + // ContextAPIKey takes an APIKey as authentication for the request + ContextAPIKey = contextKey("apikey") +) + +// BasicAuth provides basic http authentication to a request passed via context using ContextBasicAuth +type BasicAuth struct { + UserName string `json:"userName,omitempty"` + Password string `json:"password,omitempty"` +} + +// APIKey provides API key based authentication to a request passed via context using ContextAPIKey +type APIKey struct { + Key string + Prefix string +} + +type Configuration struct { + BasePath string `json:"basePath,omitempty"` + Host string `json:"host,omitempty"` + Scheme string `json:"scheme,omitempty"` + DefaultHeader map[string]string `json:"defaultHeader,omitempty"` + UserAgent string `json:"userAgent,omitempty"` + HTTPClient *http.Client +} + +func NewConfiguration() *Configuration { + cfg := &Configuration{ + BasePath: "https://console.jumpcloud.com/api/v2", + DefaultHeader: make(map[string]string), + UserAgent: "Swagger-Codegen/5.0.0/go", + } + return cfg +} + +func (c *Configuration) AddDefaultHeader(key string, value string) { + c.DefaultHeader[key] = value +} diff --git a/jcapiv2/docs/ActiveDirectoryAgentGetOutput.md b/jcapiv2/docs/ActiveDirectoryAgentGetOutput.md new file mode 100644 index 0000000..1489068 --- /dev/null +++ b/jcapiv2/docs/ActiveDirectoryAgentGetOutput.md @@ -0,0 +1,15 @@ +# ActiveDirectoryAgentGetOutput + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ConnectKey** | **string** | The connect key to use when installing the Agent on a Domain Controller. | [optional] [default to null] +**ContactAt** | **string** | | [optional] [default to null] +**Hostname** | **string** | | [optional] [default to null] +**Id** | **string** | ObjectID of this Active Directory Agent. | [default to null] +**SourceIp** | **string** | | [optional] [default to null] +**State** | **string** | | [optional] [default to null] +**Version** | **string** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/v2/docs/ActiveDirectoryAgentInput.md b/jcapiv2/docs/ActiveDirectoryAgentInput.md similarity index 99% rename from v2/docs/ActiveDirectoryAgentInput.md rename to jcapiv2/docs/ActiveDirectoryAgentInput.md index f6be8ab..109ad7c 100644 --- a/v2/docs/ActiveDirectoryAgentInput.md +++ b/jcapiv2/docs/ActiveDirectoryAgentInput.md @@ -6,4 +6,3 @@ Name | Type | Description | Notes [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/jcapiv2/docs/ActiveDirectoryAgentListOutput.md b/jcapiv2/docs/ActiveDirectoryAgentListOutput.md new file mode 100644 index 0000000..e8860ab --- /dev/null +++ b/jcapiv2/docs/ActiveDirectoryAgentListOutput.md @@ -0,0 +1,14 @@ +# ActiveDirectoryAgentListOutput + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ContactAt** | **string** | | [optional] [default to null] +**Hostname** | **string** | | [optional] [default to null] +**Id** | **string** | ObjectID of this Active Directory Agent. | [optional] [default to null] +**SourceIp** | **string** | | [optional] [default to null] +**State** | **string** | | [optional] [default to null] +**Version** | **string** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/ActiveDirectoryApi.md b/jcapiv2/docs/ActiveDirectoryApi.md new file mode 100644 index 0000000..ecae863 --- /dev/null +++ b/jcapiv2/docs/ActiveDirectoryApi.md @@ -0,0 +1,472 @@ +# {{classname}} + +All URIs are relative to *https://console.jumpcloud.com/api/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**ActivedirectoriesAgentsDelete**](ActiveDirectoryApi.md#ActivedirectoriesAgentsDelete) | **Delete** /activedirectories/{activedirectory_id}/agents/{agent_id} | Delete Active Directory Agent +[**ActivedirectoriesAgentsGet**](ActiveDirectoryApi.md#ActivedirectoriesAgentsGet) | **Get** /activedirectories/{activedirectory_id}/agents/{agent_id} | Get Active Directory Agent +[**ActivedirectoriesAgentsList**](ActiveDirectoryApi.md#ActivedirectoriesAgentsList) | **Get** /activedirectories/{activedirectory_id}/agents | List Active Directory Agents +[**ActivedirectoriesAgentsPost**](ActiveDirectoryApi.md#ActivedirectoriesAgentsPost) | **Post** /activedirectories/{activedirectory_id}/agents | Create a new Active Directory Agent +[**ActivedirectoriesDelete**](ActiveDirectoryApi.md#ActivedirectoriesDelete) | **Delete** /activedirectories/{id} | Delete an Active Directory +[**ActivedirectoriesGet**](ActiveDirectoryApi.md#ActivedirectoriesGet) | **Get** /activedirectories/{id} | Get an Active Directory +[**ActivedirectoriesList**](ActiveDirectoryApi.md#ActivedirectoriesList) | **Get** /activedirectories | List Active Directories +[**ActivedirectoriesPost**](ActiveDirectoryApi.md#ActivedirectoriesPost) | **Post** /activedirectories | Create a new Active Directory +[**GraphActiveDirectoryAssociationsList**](ActiveDirectoryApi.md#GraphActiveDirectoryAssociationsList) | **Get** /activedirectories/{activedirectory_id}/associations | List the associations of an Active Directory instance +[**GraphActiveDirectoryAssociationsPost**](ActiveDirectoryApi.md#GraphActiveDirectoryAssociationsPost) | **Post** /activedirectories/{activedirectory_id}/associations | Manage the associations of an Active Directory instance +[**GraphActiveDirectoryTraverseUser**](ActiveDirectoryApi.md#GraphActiveDirectoryTraverseUser) | **Get** /activedirectories/{activedirectory_id}/users | List the Users bound to an Active Directory instance +[**GraphActiveDirectoryTraverseUserGroup**](ActiveDirectoryApi.md#GraphActiveDirectoryTraverseUserGroup) | **Get** /activedirectories/{activedirectory_id}/usergroups | List the User Groups bound to an Active Directory instance + +# **ActivedirectoriesAgentsDelete** +> ActivedirectoriesAgentsDelete(ctx, activedirectoryId, agentId, optional) +Delete Active Directory Agent + +This endpoint deletes an Active Directory agent. #### Sample Request ``` curl -X DELETE https://console.jumpcloud.com/api/v2/activedirectories/{activedirectory_id}/agents/{agent_id} \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **activedirectoryId** | **string**| | + **agentId** | **string**| | + **optional** | ***ActiveDirectoryApiActivedirectoriesAgentsDeleteOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a ActiveDirectoryApiActivedirectoriesAgentsDeleteOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + **xOrgId** | **optional.String**| Organization identifier that can be obtained from console settings. | + +### Return type + + (empty response body) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **ActivedirectoriesAgentsGet** +> ActiveDirectoryAgentListOutput ActivedirectoriesAgentsGet(ctx, activedirectoryId, agentId, optional) +Get Active Directory Agent + +This endpoint returns an Active Directory agent. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/activedirectories/{activedirectory_id}/agents/{agent_id} \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **activedirectoryId** | **string**| | + **agentId** | **string**| | + **optional** | ***ActiveDirectoryApiActivedirectoriesAgentsGetOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a ActiveDirectoryApiActivedirectoriesAgentsGetOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + **xOrgId** | **optional.String**| Organization identifier that can be obtained from console settings. | + +### Return type + +[**ActiveDirectoryAgentListOutput**](active-directory-agent-list-output.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **ActivedirectoriesAgentsList** +> []ActiveDirectoryAgentListOutput ActivedirectoriesAgentsList(ctx, activedirectoryId, optional) +List Active Directory Agents + +This endpoint allows you to list all your Active Directory Agents for a given Instance. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/activedirectories/{activedirectory_id}/agents \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **activedirectoryId** | **string**| | + **optional** | ***ActiveDirectoryApiActivedirectoriesAgentsListOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a ActiveDirectoryApiActivedirectoriesAgentsListOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **limit** | **optional.Int32**| The number of records to return at once. Limited to 100. | [default to 10] + **skip** | **optional.Int32**| The offset into the records to return. | [default to 0] + **sort** | [**optional.Interface of []string**](string.md)| The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. | + **xOrgId** | **optional.String**| Organization identifier that can be obtained from console settings. | + +### Return type + +[**[]ActiveDirectoryAgentListOutput**](active-directory-agent-list-output.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **ActivedirectoriesAgentsPost** +> ActiveDirectoryAgentGetOutput ActivedirectoriesAgentsPost(ctx, activedirectoryId, optional) +Create a new Active Directory Agent + +This endpoint allows you to create a new Active Directory Agent. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/activedirectories/{activedirectory_id}/agents \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{}' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **activedirectoryId** | **string**| | + **optional** | ***ActiveDirectoryApiActivedirectoriesAgentsPostOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a ActiveDirectoryApiActivedirectoriesAgentsPostOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **body** | [**optional.Interface of ActiveDirectoryAgentInput**](ActiveDirectoryAgentInput.md)| | + **xOrgId** | **optional.**| Organization identifier that can be obtained from console settings. | + +### Return type + +[**ActiveDirectoryAgentGetOutput**](active-directory-agent-get-output.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **ActivedirectoriesDelete** +> ActiveDirectoryOutput ActivedirectoriesDelete(ctx, id, optional) +Delete an Active Directory + +This endpoint allows you to delete an Active Directory Instance. #### Sample Request ``` curl -X DELETE https://console.jumpcloud.com/api/v2/activedirectories/{ActiveDirectory_ID} \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **id** | **string**| ObjectID of this Active Directory instance. | + **optional** | ***ActiveDirectoryApiActivedirectoriesDeleteOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a ActiveDirectoryApiActivedirectoriesDeleteOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **xOrgId** | **optional.String**| Organization identifier that can be obtained from console settings. | + +### Return type + +[**ActiveDirectoryOutput**](active-directory-output.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **ActivedirectoriesGet** +> ActiveDirectoryOutput ActivedirectoriesGet(ctx, id, optional) +Get an Active Directory + +This endpoint returns a specific Active Directory. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/activedirectories/{ActiveDirectory_ID} \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **id** | **string**| ObjectID of this Active Directory instance. | + **optional** | ***ActiveDirectoryApiActivedirectoriesGetOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a ActiveDirectoryApiActivedirectoriesGetOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **xOrgId** | **optional.String**| Organization identifier that can be obtained from console settings. | + +### Return type + +[**ActiveDirectoryOutput**](active-directory-output.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **ActivedirectoriesList** +> []ActiveDirectoryOutput ActivedirectoriesList(ctx, optional) +List Active Directories + +This endpoint allows you to list all your Active Directory Instances. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/activedirectories/ \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **optional** | ***ActiveDirectoryApiActivedirectoriesListOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a ActiveDirectoryApiActivedirectoriesListOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **fields** | [**optional.Interface of []string**](string.md)| The comma separated fields included in the returned records. If omitted, the default list of fields will be returned. | + **filter** | [**optional.Interface of []string**](string.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | + **limit** | **optional.Int32**| The number of records to return at once. Limited to 100. | [default to 10] + **skip** | **optional.Int32**| The offset into the records to return. | [default to 0] + **sort** | [**optional.Interface of []string**](string.md)| The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. | + **xOrgId** | **optional.String**| Organization identifier that can be obtained from console settings. | + +### Return type + +[**[]ActiveDirectoryOutput**](active-directory-output.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **ActivedirectoriesPost** +> ActiveDirectoryOutput ActivedirectoriesPost(ctx, optional) +Create a new Active Directory + +This endpoint allows you to create a new Active Directory. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/activedirectories/ \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"domain\": \"{DC=AD_domain_name;DC=com}\" }' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **optional** | ***ActiveDirectoryApiActivedirectoriesPostOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a ActiveDirectoryApiActivedirectoriesPostOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**optional.Interface of ActiveDirectoryInput**](ActiveDirectoryInput.md)| | + **xOrgId** | **optional.**| Organization identifier that can be obtained from console settings. | + +### Return type + +[**ActiveDirectoryOutput**](active-directory-output.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GraphActiveDirectoryAssociationsList** +> []GraphConnection GraphActiveDirectoryAssociationsList(ctx, activedirectoryId, targets, optional) +List the associations of an Active Directory instance + +This endpoint returns the direct associations of this Active Directory instance. A direct association can be a non-homogeneous relationship between 2 different objects, for example Active Directory and Users. #### Sample Request ``` curl -X GET 'https://console.jumpcloud.com/api/v2/activedirectories/{ActiveDirectory_ID}/associations?targets=user \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **activedirectoryId** | **string**| | + **targets** | [**[]string**](string.md)| Targets which a \"active_directory\" can be associated to. | + **optional** | ***ActiveDirectoryApiGraphActiveDirectoryAssociationsListOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a ActiveDirectoryApiGraphActiveDirectoryAssociationsListOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + **limit** | **optional.Int32**| The number of records to return at once. Limited to 100. | [default to 10] + **skip** | **optional.Int32**| The offset into the records to return. | [default to 0] + **xOrgId** | **optional.String**| Organization identifier that can be obtained from console settings. | + +### Return type + +[**[]GraphConnection**](GraphConnection.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GraphActiveDirectoryAssociationsPost** +> GraphActiveDirectoryAssociationsPost(ctx, activedirectoryId, optional) +Manage the associations of an Active Directory instance + +This endpoint allows you to manage the _direct_ associations of an Active Directory instance. A direct association can be a non-homogeneous relationship between 2 different objects, for example Active Directory and Users. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/activedirectories/{AD_Instance_ID}/associations \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"op\": \"add\", \"type\": \"user\", \"id\": \"{User_ID}\" }' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **activedirectoryId** | **string**| | + **optional** | ***ActiveDirectoryApiGraphActiveDirectoryAssociationsPostOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a ActiveDirectoryApiGraphActiveDirectoryAssociationsPostOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **body** | [**optional.Interface of GraphOperationActiveDirectory**](GraphOperationActiveDirectory.md)| | + **xOrgId** | **optional.**| Organization identifier that can be obtained from console settings. | + +### Return type + + (empty response body) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GraphActiveDirectoryTraverseUser** +> []GraphObjectWithPaths GraphActiveDirectoryTraverseUser(ctx, activedirectoryId, optional) +List the Users bound to an Active Directory instance + +This endpoint will return all Users bound to an Active Directory instance, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this Active Directory instance to the corresponding User; this array represents all grouping and/or associations that would have to be removed to deprovision the User from this Active Directory instance. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/activedirectories/{ActiveDirectory_ID}/users \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **activedirectoryId** | **string**| ObjectID of the Active Directory instance. | + **optional** | ***ActiveDirectoryApiGraphActiveDirectoryTraverseUserOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a ActiveDirectoryApiGraphActiveDirectoryTraverseUserOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **filter** | [**optional.Interface of []string**](string.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | + **limit** | **optional.Int32**| The number of records to return at once. Limited to 100. | [default to 10] + **xOrgId** | **optional.String**| Organization identifier that can be obtained from console settings. | + **skip** | **optional.Int32**| The offset into the records to return. | [default to 0] + +### Return type + +[**[]GraphObjectWithPaths**](GraphObjectWithPaths.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GraphActiveDirectoryTraverseUserGroup** +> []GraphObjectWithPaths GraphActiveDirectoryTraverseUserGroup(ctx, activedirectoryId, optional) +List the User Groups bound to an Active Directory instance + +This endpoint will return all Users Groups bound to an Active Directory instance, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the group's type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this Active Directory instance to the corresponding User Group; this array represents all grouping and/or associations that would have to be removed to deprovision the User Group from this Active Directory instance. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/activedirectories/{ActiveDirectory_ID}/usergroups \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **activedirectoryId** | **string**| ObjectID of the Active Directory instance. | + **optional** | ***ActiveDirectoryApiGraphActiveDirectoryTraverseUserGroupOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a ActiveDirectoryApiGraphActiveDirectoryTraverseUserGroupOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **limit** | **optional.Int32**| The number of records to return at once. Limited to 100. | [default to 10] + **xOrgId** | **optional.String**| Organization identifier that can be obtained from console settings. | + **skip** | **optional.Int32**| The offset into the records to return. | [default to 0] + **filter** | [**optional.Interface of []string**](string.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | + +### Return type + +[**[]GraphObjectWithPaths**](GraphObjectWithPaths.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/v2/docs/ActiveDirectoryInput.md b/jcapiv2/docs/ActiveDirectoryInput.md similarity index 99% rename from v2/docs/ActiveDirectoryInput.md rename to jcapiv2/docs/ActiveDirectoryInput.md index 2078f97..20fb044 100644 --- a/v2/docs/ActiveDirectoryInput.md +++ b/jcapiv2/docs/ActiveDirectoryInput.md @@ -7,4 +7,3 @@ Name | Type | Description | Notes [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/v2/docs/ActiveDirectoryOutput.md b/jcapiv2/docs/ActiveDirectoryOutput.md similarity index 82% rename from v2/docs/ActiveDirectoryOutput.md rename to jcapiv2/docs/ActiveDirectoryOutput.md index 7453361..f7cb2d3 100644 --- a/v2/docs/ActiveDirectoryOutput.md +++ b/jcapiv2/docs/ActiveDirectoryOutput.md @@ -4,8 +4,6 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **Domain** | **string** | Domain name for this Active Directory instance. | [optional] [default to null] -**Id** | **string** | ObjectID of this Active Directory instance. | [default to null] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/jcapiv2/docs/Address.md b/jcapiv2/docs/Address.md new file mode 100644 index 0000000..0904a3c --- /dev/null +++ b/jcapiv2/docs/Address.md @@ -0,0 +1,17 @@ +# Address + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Country** | **string** | | [optional] [default to null] +**ExtendedAddress** | **string** | | [optional] [default to null] +**Id** | **string** | | [optional] [default to null] +**Locality** | **string** | | [optional] [default to null] +**PoBox** | **string** | | [optional] [default to null] +**PostalCode** | **string** | | [optional] [default to null] +**Region** | **string** | | [optional] [default to null] +**StreetAddress** | **string** | | [optional] [default to null] +**Type_** | **string** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/Ade.md b/jcapiv2/docs/Ade.md new file mode 100644 index 0000000..c61a829 --- /dev/null +++ b/jcapiv2/docs/Ade.md @@ -0,0 +1,12 @@ +# Ade + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**DefaultDeviceGroupObjectIds** | **[]string** | An array of ObjectIDs identifying the default device groups for this specific type (based on the OS family) of automated device enrollment. Currently, only a single DeviceGroupID is supported. | [optional] [default to null] +**EnableZeroTouchEnrollment** | **bool** | A toggle to determine if ADE registered devices should go through JumpCloud Zero Touch Enrollment. | [optional] [default to null] +**SetupAssistantOptions** | [**[]DepSetupAssistantOption**](DEPSetupAssistantOption.md) | | [optional] [default to null] +**WelcomeScreen** | [***DepWelcomeScreen**](DEPWelcomeScreen.md) | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/Ades.md b/jcapiv2/docs/Ades.md new file mode 100644 index 0000000..28c57b3 --- /dev/null +++ b/jcapiv2/docs/Ades.md @@ -0,0 +1,10 @@ +# Ades + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Ios** | [***Ade**](ADE.md) | | [optional] [default to null] +**Macos** | [***Ade**](ADE.md) | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/Administrator.md b/jcapiv2/docs/Administrator.md new file mode 100644 index 0000000..d80d5b4 --- /dev/null +++ b/jcapiv2/docs/Administrator.md @@ -0,0 +1,18 @@ +# Administrator + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Email** | **string** | | [optional] [default to null] +**EnableMultiFactor** | **bool** | | [optional] [default to null] +**Firstname** | **string** | | [optional] [default to null] +**Id** | **string** | | [optional] [default to null] +**Lastname** | **string** | | [optional] [default to null] +**OrganizationAccessTotal** | **float64** | | [optional] [default to null] +**Registered** | **bool** | | [optional] [default to null] +**Role** | **string** | | [optional] [default to null] +**RoleName** | **string** | | [optional] [default to null] +**Suspended** | **bool** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/AdministratorOrganizationLink.md b/jcapiv2/docs/AdministratorOrganizationLink.md new file mode 100644 index 0000000..4817a07 --- /dev/null +++ b/jcapiv2/docs/AdministratorOrganizationLink.md @@ -0,0 +1,10 @@ +# AdministratorOrganizationLink + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Administrator** | **string** | The identifier for an administrator | [optional] [default to null] +**Organization** | **string** | The identifier for an organization | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/AdministratorOrganizationLinkReq.md b/jcapiv2/docs/AdministratorOrganizationLinkReq.md new file mode 100644 index 0000000..ce0b551 --- /dev/null +++ b/jcapiv2/docs/AdministratorOrganizationLinkReq.md @@ -0,0 +1,9 @@ +# AdministratorOrganizationLinkReq + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Organization** | **string** | The identifier for an organization to link this administrator to. | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/AdministratorsApi.md b/jcapiv2/docs/AdministratorsApi.md new file mode 100644 index 0000000..a112ea2 --- /dev/null +++ b/jcapiv2/docs/AdministratorsApi.md @@ -0,0 +1,150 @@ +# {{classname}} + +All URIs are relative to *https://console.jumpcloud.com/api/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**AdministratorOrganizationsCreateByAdministrator**](AdministratorsApi.md#AdministratorOrganizationsCreateByAdministrator) | **Post** /administrators/{id}/organizationlinks | Allow Adminstrator access to an Organization. +[**AdministratorOrganizationsListByAdministrator**](AdministratorsApi.md#AdministratorOrganizationsListByAdministrator) | **Get** /administrators/{id}/organizationlinks | List the association links between an Administrator and Organizations. +[**AdministratorOrganizationsListByOrganization**](AdministratorsApi.md#AdministratorOrganizationsListByOrganization) | **Get** /organizations/{id}/administratorlinks | List the association links between an Organization and Administrators. +[**AdministratorOrganizationsRemoveByAdministrator**](AdministratorsApi.md#AdministratorOrganizationsRemoveByAdministrator) | **Delete** /administrators/{administrator_id}/organizationlinks/{id} | Remove association between an Administrator and an Organization. + +# **AdministratorOrganizationsCreateByAdministrator** +> AdministratorOrganizationLink AdministratorOrganizationsCreateByAdministrator(ctx, id, optional) +Allow Adminstrator access to an Organization. + +This endpoint allows you to grant Administrator access to an Organization. + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **id** | **string**| | + **optional** | ***AdministratorsApiAdministratorOrganizationsCreateByAdministratorOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a AdministratorsApiAdministratorOrganizationsCreateByAdministratorOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **body** | [**optional.Interface of AdministratorOrganizationLinkReq**](AdministratorOrganizationLinkReq.md)| | + +### Return type + +[**AdministratorOrganizationLink**](AdministratorOrganizationLink.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **AdministratorOrganizationsListByAdministrator** +> []AdministratorOrganizationLink AdministratorOrganizationsListByAdministrator(ctx, id, optional) +List the association links between an Administrator and Organizations. + +This endpoint returns the association links between an Administrator and Organizations. + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **id** | **string**| | + **optional** | ***AdministratorsApiAdministratorOrganizationsListByAdministratorOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a AdministratorsApiAdministratorOrganizationsListByAdministratorOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **limit** | **optional.Int32**| The number of records to return at once. Limited to 100. | [default to 10] + **skip** | **optional.Int32**| The offset into the records to return. | [default to 0] + +### Return type + +[**[]AdministratorOrganizationLink**](AdministratorOrganizationLink.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **AdministratorOrganizationsListByOrganization** +> []AdministratorOrganizationLink AdministratorOrganizationsListByOrganization(ctx, id, optional) +List the association links between an Organization and Administrators. + +This endpoint returns the association links between an Organization and Administrators. + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **id** | **string**| | + **optional** | ***AdministratorsApiAdministratorOrganizationsListByOrganizationOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a AdministratorsApiAdministratorOrganizationsListByOrganizationOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **limit** | **optional.Int32**| The number of records to return at once. Limited to 100. | [default to 10] + **skip** | **optional.Int32**| The offset into the records to return. | [default to 0] + +### Return type + +[**[]AdministratorOrganizationLink**](AdministratorOrganizationLink.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **AdministratorOrganizationsRemoveByAdministrator** +> AdministratorOrganizationsRemoveByAdministrator(ctx, administratorId, id) +Remove association between an Administrator and an Organization. + +This endpoint removes the association link between an Administrator and an Organization. + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **administratorId** | **string**| | + **id** | **string**| | + +### Return type + + (empty response body) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/AllOfAutotaskTicketingAlertConfigurationListRecordsItems.md b/jcapiv2/docs/AllOfAutotaskTicketingAlertConfigurationListRecordsItems.md new file mode 100644 index 0000000..c59f541 --- /dev/null +++ b/jcapiv2/docs/AllOfAutotaskTicketingAlertConfigurationListRecordsItems.md @@ -0,0 +1,20 @@ +# AllOfAutotaskTicketingAlertConfigurationListRecordsItems + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Category** | **string** | | [optional] [default to null] +**Description** | **string** | | [optional] [default to null] +**Destination** | **string** | | [optional] [default to null] +**DisplayName** | **string** | | [optional] [default to null] +**DueDays** | **int32** | | [optional] [default to null] +**Id** | **int32** | | [optional] [default to null] +**Priority** | [***AutotaskTicketingAlertConfigurationPriority**](AutotaskTicketingAlertConfiguration_priority.md) | | [optional] [default to null] +**Queue** | [***AutotaskTicketingAlertConfigurationPriority**](AutotaskTicketingAlertConfiguration_priority.md) | | [optional] [default to null] +**Resource** | [***AutotaskTicketingAlertConfigurationResource**](AutotaskTicketingAlertConfiguration_resource.md) | | [optional] [default to null] +**ShouldCreateTickets** | **bool** | | [optional] [default to null] +**Source** | [***AutotaskTicketingAlertConfigurationPriority**](AutotaskTicketingAlertConfiguration_priority.md) | | [optional] [default to null] +**Status** | [***AutotaskTicketingAlertConfigurationPriority**](AutotaskTicketingAlertConfiguration_priority.md) | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/AllOfConnectWiseTicketingAlertConfigurationListRecordsItems.md b/jcapiv2/docs/AllOfConnectWiseTicketingAlertConfigurationListRecordsItems.md new file mode 100644 index 0000000..7062d13 --- /dev/null +++ b/jcapiv2/docs/AllOfConnectWiseTicketingAlertConfigurationListRecordsItems.md @@ -0,0 +1,16 @@ +# AllOfConnectWiseTicketingAlertConfigurationListRecordsItems + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Category** | **string** | | [optional] [default to null] +**Description** | **string** | | [optional] [default to null] +**DisplayName** | **string** | | [optional] [default to null] +**DueDays** | **int32** | | [optional] [default to null] +**Id** | **int32** | | [optional] [default to null] +**Priority** | [***AutotaskTicketingAlertConfigurationPriority**](AutotaskTicketingAlertConfiguration_priority.md) | | [optional] [default to null] +**ShouldCreateTickets** | **bool** | | [default to null] +**Source** | [***AutotaskTicketingAlertConfigurationPriority**](AutotaskTicketingAlertConfiguration_priority.md) | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/AnyValue.md b/jcapiv2/docs/AnyValue.md new file mode 100644 index 0000000..d724fe6 --- /dev/null +++ b/jcapiv2/docs/AnyValue.md @@ -0,0 +1,8 @@ +# AnyValue + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/AppleMDMApi.md b/jcapiv2/docs/AppleMDMApi.md new file mode 100644 index 0000000..233ced0 --- /dev/null +++ b/jcapiv2/docs/AppleMDMApi.md @@ -0,0 +1,661 @@ +# {{classname}} + +All URIs are relative to *https://console.jumpcloud.com/api/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**ApplemdmsCsrget**](AppleMDMApi.md#ApplemdmsCsrget) | **Get** /applemdms/{apple_mdm_id}/csr | Get Apple MDM CSR Plist +[**ApplemdmsDelete**](AppleMDMApi.md#ApplemdmsDelete) | **Delete** /applemdms/{id} | Delete an Apple MDM +[**ApplemdmsDeletedevice**](AppleMDMApi.md#ApplemdmsDeletedevice) | **Delete** /applemdms/{apple_mdm_id}/devices/{device_id} | Remove an Apple MDM Device's Enrollment +[**ApplemdmsDepkeyget**](AppleMDMApi.md#ApplemdmsDepkeyget) | **Get** /applemdms/{apple_mdm_id}/depkey | Get Apple MDM DEP Public Key +[**ApplemdmsDevicesClearActivationLock**](AppleMDMApi.md#ApplemdmsDevicesClearActivationLock) | **Post** /applemdms/{apple_mdm_id}/devices/{device_id}/clearActivationLock | Clears the Activation Lock for a Device +[**ApplemdmsDevicesRefreshActivationLockInformation**](AppleMDMApi.md#ApplemdmsDevicesRefreshActivationLockInformation) | **Post** /applemdms/{apple_mdm_id}/devices/{device_id}/refreshActivationLockInformation | Refresh activation lock information for a device +[**ApplemdmsDeviceserase**](AppleMDMApi.md#ApplemdmsDeviceserase) | **Post** /applemdms/{apple_mdm_id}/devices/{device_id}/erase | Erase Device +[**ApplemdmsDeviceslist**](AppleMDMApi.md#ApplemdmsDeviceslist) | **Get** /applemdms/{apple_mdm_id}/devices | List AppleMDM Devices +[**ApplemdmsDeviceslock**](AppleMDMApi.md#ApplemdmsDeviceslock) | **Post** /applemdms/{apple_mdm_id}/devices/{device_id}/lock | Lock Device +[**ApplemdmsDevicesrestart**](AppleMDMApi.md#ApplemdmsDevicesrestart) | **Post** /applemdms/{apple_mdm_id}/devices/{device_id}/restart | Restart Device +[**ApplemdmsDevicesshutdown**](AppleMDMApi.md#ApplemdmsDevicesshutdown) | **Post** /applemdms/{apple_mdm_id}/devices/{device_id}/shutdown | Shut Down Device +[**ApplemdmsEnrollmentprofilesget**](AppleMDMApi.md#ApplemdmsEnrollmentprofilesget) | **Get** /applemdms/{apple_mdm_id}/enrollmentprofiles/{id} | Get an Apple MDM Enrollment Profile +[**ApplemdmsEnrollmentprofileslist**](AppleMDMApi.md#ApplemdmsEnrollmentprofileslist) | **Get** /applemdms/{apple_mdm_id}/enrollmentprofiles | List Apple MDM Enrollment Profiles +[**ApplemdmsGetdevice**](AppleMDMApi.md#ApplemdmsGetdevice) | **Get** /applemdms/{apple_mdm_id}/devices/{device_id} | Details of an AppleMDM Device +[**ApplemdmsList**](AppleMDMApi.md#ApplemdmsList) | **Get** /applemdms | List Apple MDMs +[**ApplemdmsPut**](AppleMDMApi.md#ApplemdmsPut) | **Put** /applemdms/{id} | Update an Apple MDM +[**ApplemdmsRefreshdepdevices**](AppleMDMApi.md#ApplemdmsRefreshdepdevices) | **Post** /applemdms/{apple_mdm_id}/refreshdepdevices | Refresh DEP Devices + +# **ApplemdmsCsrget** +> string ApplemdmsCsrget(ctx, appleMdmId, optional) +Get Apple MDM CSR Plist + +Retrieves an Apple MDM signed CSR Plist for an organization. The user must supply the returned plist to Apple for signing, and then provide the certificate provided by Apple back into the PUT API. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/applemdms/{APPLE_MDM_ID}/csr \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **appleMdmId** | **string**| | + **optional** | ***AppleMDMApiApplemdmsCsrgetOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a AppleMDMApiApplemdmsCsrgetOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **xOrgId** | **optional.String**| Organization identifier that can be obtained from console settings. | + +### Return type + +**string** + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/octet-stream + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **ApplemdmsDelete** +> AppleMdm ApplemdmsDelete(ctx, id, optional) +Delete an Apple MDM + +Removes an Apple MDM configuration. Warning: This is a destructive operation and will remove your Apple Push Certificates. We will no longer be able to manage your devices and the only recovery option is to re-register all devices into MDM. #### Sample Request ``` curl -X DELETE https://console.jumpcloud.com/api/v2/applemdms/{id} \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **id** | **string**| | + **optional** | ***AppleMDMApiApplemdmsDeleteOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a AppleMDMApiApplemdmsDeleteOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **xOrgId** | **optional.String**| Organization identifier that can be obtained from console settings. | + +### Return type + +[**AppleMdm**](AppleMDM.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **ApplemdmsDeletedevice** +> AppleMdmDevice ApplemdmsDeletedevice(ctx, appleMdmId, deviceId, optional) +Remove an Apple MDM Device's Enrollment + +Remove a single Apple MDM device from MDM enrollment. #### Sample Request ``` curl -X DELETE https://console.jumpcloud.com/api/v2/applemdms/{apple_mdm_id}/devices/{device_id} \\ -H 'accept: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **appleMdmId** | **string**| | + **deviceId** | **string**| | + **optional** | ***AppleMDMApiApplemdmsDeletedeviceOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a AppleMDMApiApplemdmsDeletedeviceOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + **xOrgId** | **optional.String**| Organization identifier that can be obtained from console settings. | + +### Return type + +[**AppleMdmDevice**](apple-mdm-device.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **ApplemdmsDepkeyget** +> string ApplemdmsDepkeyget(ctx, appleMdmId, optional) +Get Apple MDM DEP Public Key + +Retrieves an Apple MDM DEP Public Key. + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **appleMdmId** | **string**| | + **optional** | ***AppleMDMApiApplemdmsDepkeygetOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a AppleMDMApiApplemdmsDepkeygetOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **xOrgId** | **optional.String**| Organization identifier that can be obtained from console settings. | + +### Return type + +**string** + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/x-pem-file + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **ApplemdmsDevicesClearActivationLock** +> ApplemdmsDevicesClearActivationLock(ctx, appleMdmId, deviceId, optional) +Clears the Activation Lock for a Device + +Clears the activation lock on the specified device. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/applemdms/{apple_mdm_id}/devices/{device_id}/clearActivationLock \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{}' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **appleMdmId** | **string**| | + **deviceId** | **string**| | + **optional** | ***AppleMDMApiApplemdmsDevicesClearActivationLockOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a AppleMDMApiApplemdmsDevicesClearActivationLockOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + **xOrgId** | **optional.String**| Organization identifier that can be obtained from console settings. | + +### Return type + + (empty response body) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **ApplemdmsDevicesRefreshActivationLockInformation** +> ApplemdmsDevicesRefreshActivationLockInformation(ctx, appleMdmId, deviceId, optional) +Refresh activation lock information for a device + +Refreshes the activation lock information for a device #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/applemdms/{apple_mdm_id}/devices/{device_id}/refreshActivationLockInformation \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{}' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **appleMdmId** | **string**| | + **deviceId** | **string**| | + **optional** | ***AppleMDMApiApplemdmsDevicesRefreshActivationLockInformationOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a AppleMDMApiApplemdmsDevicesRefreshActivationLockInformationOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + **xOrgId** | **optional.String**| Organization identifier that can be obtained from console settings. | + +### Return type + + (empty response body) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **ApplemdmsDeviceserase** +> ApplemdmsDeviceserase(ctx, appleMdmId, deviceId, optional) +Erase Device + +Erases a DEP-enrolled device. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/applemdms/{apple_mdm_id}/devices/{device_id}/erase \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{}' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **appleMdmId** | **string**| | + **deviceId** | **string**| | + **optional** | ***AppleMDMApiApplemdmsDeviceseraseOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a AppleMDMApiApplemdmsDeviceseraseOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + **body** | [**optional.Interface of DeviceIdEraseBody**](DeviceIdEraseBody.md)| | + **xOrgId** | **optional.**| Organization identifier that can be obtained from console settings. | + +### Return type + + (empty response body) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **ApplemdmsDeviceslist** +> []AppleMdmDevice ApplemdmsDeviceslist(ctx, appleMdmId, optional) +List AppleMDM Devices + +Lists all Apple MDM devices. The filter and sort queries will allow the following fields: `createdAt` `depRegistered` `enrolled` `id` `osVersion` `serialNumber` `udid` #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/applemdms/{apple_mdm_id}/devices \\ -H 'accept: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{}' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **appleMdmId** | **string**| | + **optional** | ***AppleMDMApiApplemdmsDeviceslistOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a AppleMDMApiApplemdmsDeviceslistOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **limit** | **optional.Int32**| The number of records to return at once. Limited to 100. | [default to 10] + **xOrgId** | **optional.String**| Organization identifier that can be obtained from console settings. | + **skip** | **optional.Int32**| The offset into the records to return. | [default to 0] + **filter** | [**optional.Interface of []string**](string.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | + **sort** | [**optional.Interface of []string**](string.md)| The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. | + **xTotalCount** | **optional.Int32**| | + +### Return type + +[**[]AppleMdmDevice**](apple-mdm-device.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **ApplemdmsDeviceslock** +> ApplemdmsDeviceslock(ctx, appleMdmId, deviceId, optional) +Lock Device + +Locks a DEP-enrolled device. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/applemdms/{apple_mdm_id}/devices/{device_id}/lock \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{}' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **appleMdmId** | **string**| | + **deviceId** | **string**| | + **optional** | ***AppleMDMApiApplemdmsDeviceslockOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a AppleMDMApiApplemdmsDeviceslockOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + **body** | [**optional.Interface of DeviceIdLockBody**](DeviceIdLockBody.md)| | + **xOrgId** | **optional.**| Organization identifier that can be obtained from console settings. | + +### Return type + + (empty response body) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **ApplemdmsDevicesrestart** +> ApplemdmsDevicesrestart(ctx, appleMdmId, deviceId, optional) +Restart Device + +Restarts a DEP-enrolled device. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/applemdms/{apple_mdm_id}/devices/{device_id}/restart \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{\"kextPaths\": [\"Path1\", \"Path2\"]}' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **appleMdmId** | **string**| | + **deviceId** | **string**| | + **optional** | ***AppleMDMApiApplemdmsDevicesrestartOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a AppleMDMApiApplemdmsDevicesrestartOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + **body** | [**optional.Interface of DeviceIdRestartBody**](DeviceIdRestartBody.md)| | + **xOrgId** | **optional.**| Organization identifier that can be obtained from console settings. | + +### Return type + + (empty response body) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **ApplemdmsDevicesshutdown** +> ApplemdmsDevicesshutdown(ctx, appleMdmId, deviceId, optional) +Shut Down Device + +Shuts down a DEP-enrolled device. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/applemdms/{apple_mdm_id}/devices/{device_id}/shutdown \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{}' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **appleMdmId** | **string**| | + **deviceId** | **string**| | + **optional** | ***AppleMDMApiApplemdmsDevicesshutdownOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a AppleMDMApiApplemdmsDevicesshutdownOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + **xOrgId** | **optional.String**| Organization identifier that can be obtained from console settings. | + +### Return type + + (empty response body) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **ApplemdmsEnrollmentprofilesget** +> string ApplemdmsEnrollmentprofilesget(ctx, appleMdmId, id, optional) +Get an Apple MDM Enrollment Profile + +Get an enrollment profile Currently only requesting the mobileconfig is supported. #### Sample Request ``` curl https://console.jumpcloud.com/api/v2/applemdms/{APPLE_MDM_ID}/enrollmentprofiles/{ID} \\ -H 'accept: application/x-apple-aspen-config' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **appleMdmId** | **string**| | + **id** | **string**| | + **optional** | ***AppleMDMApiApplemdmsEnrollmentprofilesgetOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a AppleMDMApiApplemdmsEnrollmentprofilesgetOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + **xOrgId** | **optional.String**| Organization identifier that can be obtained from console settings. | + +### Return type + +**string** + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/x-apple-aspen-config + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **ApplemdmsEnrollmentprofileslist** +> []AppleMdm ApplemdmsEnrollmentprofileslist(ctx, appleMdmId, optional) +List Apple MDM Enrollment Profiles + +Get a list of enrollment profiles for an apple mdm. Note: currently only one enrollment profile is supported. #### Sample Request ``` curl https://console.jumpcloud.com/api/v2/applemdms/{APPLE_MDM_ID}/enrollmentprofiles \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **appleMdmId** | **string**| | + **optional** | ***AppleMDMApiApplemdmsEnrollmentprofileslistOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a AppleMDMApiApplemdmsEnrollmentprofileslistOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **xOrgId** | **optional.String**| Organization identifier that can be obtained from console settings. | + +### Return type + +[**[]AppleMdm**](AppleMDM.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **ApplemdmsGetdevice** +> AppleMdmDevice ApplemdmsGetdevice(ctx, appleMdmId, deviceId, optional) +Details of an AppleMDM Device + +Gets a single Apple MDM device. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/applemdms/{apple_mdm_id}/devices/{device_id} \\ -H 'accept: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **appleMdmId** | **string**| | + **deviceId** | **string**| | + **optional** | ***AppleMDMApiApplemdmsGetdeviceOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a AppleMDMApiApplemdmsGetdeviceOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + **xOrgId** | **optional.String**| Organization identifier that can be obtained from console settings. | + +### Return type + +[**AppleMdmDevice**](apple-mdm-device.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **ApplemdmsList** +> []AppleMdm ApplemdmsList(ctx, optional) +List Apple MDMs + +Get a list of all Apple MDM configurations. An empty topic indicates that a signed certificate from Apple has not been provided to the PUT endpoint yet. Note: currently only one MDM configuration per organization is supported. #### Sample Request ``` curl https://console.jumpcloud.com/api/v2/applemdms \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **optional** | ***AppleMDMApiApplemdmsListOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a AppleMDMApiApplemdmsListOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xOrgId** | **optional.String**| Organization identifier that can be obtained from console settings. | + +### Return type + +[**[]AppleMdm**](AppleMDM.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **ApplemdmsPut** +> AppleMdm ApplemdmsPut(ctx, id, optional) +Update an Apple MDM + +Updates an Apple MDM configuration. This endpoint is used to supply JumpCloud with a signed certificate from Apple in order to finalize the setup and allow JumpCloud to manage your devices. It may also be used to update the DEP Settings. #### Sample Request ``` curl -X PUT https://console.jumpcloud.com/api/v2/applemdms/{ID} \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"name\": \"MDM name\", \"appleSignedCert\": \"{CERTIFICATE}\", \"encryptedDepServerToken\": \"{SERVER_TOKEN}\", \"dep\": { \"welcomeScreen\": { \"title\": \"Welcome\", \"paragraph\": \"In just a few steps, you will be working securely from your Mac.\", \"button\": \"continue\", }, }, }' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **id** | **string**| | + **optional** | ***AppleMDMApiApplemdmsPutOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a AppleMDMApiApplemdmsPutOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **body** | [**optional.Interface of AppleMdmPatchInput**](AppleMdmPatchInput.md)| | + **xOrgId** | **optional.**| Organization identifier that can be obtained from console settings. | + +### Return type + +[**AppleMdm**](AppleMDM.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **ApplemdmsRefreshdepdevices** +> ApplemdmsRefreshdepdevices(ctx, appleMdmId, optional) +Refresh DEP Devices + +Refreshes the list of devices that a JumpCloud admin has added to their virtual MDM in Apple Business Manager - ABM so that they can be DEP enrolled with JumpCloud. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/applemdms/{apple_mdm_id}/refreshdepdevices \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{}' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **appleMdmId** | **string**| | + **optional** | ***AppleMDMApiApplemdmsRefreshdepdevicesOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a AppleMDMApiApplemdmsRefreshdepdevicesOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **xOrgId** | **optional.String**| Organization identifier that can be obtained from console settings. | + +### Return type + + (empty response body) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/AppleMdm.md b/jcapiv2/docs/AppleMdm.md new file mode 100644 index 0000000..405d66e --- /dev/null +++ b/jcapiv2/docs/AppleMdm.md @@ -0,0 +1,19 @@ +# AppleMdm + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Ades** | [***Ades**](ADES.md) | | [optional] [default to null] +**AllowMobileUserEnrollment** | **bool** | A toggle to allow mobile device enrollment for an organization. | [optional] [default to null] +**ApnsCertExpiry** | **string** | The expiration date and time for the APNS Certificate. | [optional] [default to null] +**ApnsPushTopic** | **string** | The push topic assigned to this enrollment by Apple after uploading the Signed CSR plist. | [optional] [default to null] +**DefaultIosUserEnrollmentDeviceGroupID** | **string** | ObjectId uniquely identifying the MDM default iOS user enrollment device group. | [optional] [default to null] +**DefaultSystemGroupID** | **string** | ObjectId uniquely identifying the MDM default System Group. | [optional] [default to null] +**Dep** | [***Dep**](DEP.md) | | [optional] [default to null] +**DepAccessTokenExpiry** | **string** | The expiration date and time for the DEP Access Token. This aligns with the DEP Server Token State. | [optional] [default to null] +**DepServerTokenState** | **string** | The state of the dep server token, presence and expiry. | [optional] [default to null] +**Id** | **string** | ObjectId uniquely identifying an MDM Enrollment, | [default to null] +**Name** | **string** | A friendly name to identify this enrollment. Not required to be unique. | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/AppleMdmDevice.md b/jcapiv2/docs/AppleMdmDevice.md new file mode 100644 index 0000000..b49a5b4 --- /dev/null +++ b/jcapiv2/docs/AppleMdmDevice.md @@ -0,0 +1,18 @@ +# AppleMdmDevice + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**CreatedAt** | **string** | | [optional] [default to null] +**DepRegistered** | **bool** | | [optional] [default to null] +**DeviceInformation** | [***AppleMdmDeviceInfo**](apple-mdm-device-info.md) | | [optional] [default to null] +**Enrolled** | **bool** | | [optional] [default to null] +**HasActivationLockBypassCodes** | **bool** | | [optional] [default to null] +**Id** | **string** | | [optional] [default to null] +**OsVersion** | **string** | | [optional] [default to null] +**SecurityInfo** | [***AppleMdmDeviceSecurityInfo**](apple-mdm-device-security-info.md) | | [optional] [default to null] +**SerialNumber** | **string** | | [optional] [default to null] +**Udid** | **string** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/AppleMdmDeviceInfo.md b/jcapiv2/docs/AppleMdmDeviceInfo.md new file mode 100644 index 0000000..a75bd3e --- /dev/null +++ b/jcapiv2/docs/AppleMdmDeviceInfo.md @@ -0,0 +1,22 @@ +# AppleMdmDeviceInfo + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ActivationLockAllowedWhileSupervised** | **bool** | | [optional] [default to null] +**AvailableDeviceCapacity** | **float64** | | [optional] [default to null] +**DeviceCapacity** | **float64** | | [optional] [default to null] +**DeviceName** | **string** | | [optional] [default to null] +**Iccid** | **string** | | [optional] [default to null] +**Imei** | **string** | | [optional] [default to null] +**IsActivationLockEnabled** | **bool** | | [optional] [default to null] +**IsSupervised** | **bool** | | [optional] [default to null] +**ModelName** | **string** | | [optional] [default to null] +**SecondIccid** | **string** | | [optional] [default to null] +**SecondImei** | **string** | | [optional] [default to null] +**SecondSubscriberCarrierNetwork** | **string** | | [optional] [default to null] +**SubscriberCarrierNetwork** | **string** | | [optional] [default to null] +**WifiMac** | **string** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/AppleMdmDeviceSecurityInfo.md b/jcapiv2/docs/AppleMdmDeviceSecurityInfo.md new file mode 100644 index 0000000..071080a --- /dev/null +++ b/jcapiv2/docs/AppleMdmDeviceSecurityInfo.md @@ -0,0 +1,13 @@ +# AppleMdmDeviceSecurityInfo + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**EnrolledViaDep** | **bool** | | [optional] [default to null] +**IsActivationLockManageable** | **bool** | | [optional] [default to null] +**IsUserEnrollment** | **bool** | | [optional] [default to null] +**PasscodePresent** | **bool** | | [optional] [default to null] +**UserApprovedEnrollment** | **bool** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/AppleMdmPatchInput.md b/jcapiv2/docs/AppleMdmPatchInput.md new file mode 100644 index 0000000..1b71866 --- /dev/null +++ b/jcapiv2/docs/AppleMdmPatchInput.md @@ -0,0 +1,16 @@ +# AppleMdmPatchInput + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Ades** | [***Ades**](ADES.md) | | [optional] [default to null] +**AllowMobileUserEnrollment** | **bool** | A toggle to allow mobile device enrollment for an organization. | [optional] [default to null] +**AppleSignedCert** | **string** | A signed certificate obtained from Apple after providing Apple with the plist file provided on POST. | [optional] [default to null] +**DefaultIosUserEnrollmentDeviceGroupID** | **string** | ObjectId uniquely identifying the MDM default iOS user enrollment device group. | [optional] [default to null] +**DefaultSystemGroupID** | **string** | ObjectId uniquely identifying the MDM default System Group. | [optional] [default to null] +**Dep** | [***Dep**](DEP.md) | | [optional] [default to null] +**EncryptedDepServerToken** | **string** | The S/MIME encoded DEP Server Token returned by Apple Business Manager when creating an MDM instance. | [optional] [default to null] +**Name** | **string** | A new name for the Apple MDM configuration. | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/ApplicationIdLogoBody.md b/jcapiv2/docs/ApplicationIdLogoBody.md new file mode 100644 index 0000000..a41be45 --- /dev/null +++ b/jcapiv2/docs/ApplicationIdLogoBody.md @@ -0,0 +1,9 @@ +# ApplicationIdLogoBody + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Image** | [****os.File**](*os.File.md) | The file to upload. | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/ApplicationsApi.md b/jcapiv2/docs/ApplicationsApi.md new file mode 100644 index 0000000..0600b98 --- /dev/null +++ b/jcapiv2/docs/ApplicationsApi.md @@ -0,0 +1,321 @@ +# {{classname}} + +All URIs are relative to *https://console.jumpcloud.com/api/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**ApplicationsDeleteLogo**](ApplicationsApi.md#ApplicationsDeleteLogo) | **Delete** /applications/{application_id}/logo | Delete application image +[**ApplicationsGet**](ApplicationsApi.md#ApplicationsGet) | **Get** /applications/{application_id} | Get an Application +[**ApplicationsPostLogo**](ApplicationsApi.md#ApplicationsPostLogo) | **Post** /applications/{application_id}/logo | +[**GraphApplicationAssociationsList**](ApplicationsApi.md#GraphApplicationAssociationsList) | **Get** /applications/{application_id}/associations | List the associations of an Application +[**GraphApplicationAssociationsPost**](ApplicationsApi.md#GraphApplicationAssociationsPost) | **Post** /applications/{application_id}/associations | Manage the associations of an Application +[**GraphApplicationTraverseUser**](ApplicationsApi.md#GraphApplicationTraverseUser) | **Get** /applications/{application_id}/users | List the Users bound to an Application +[**GraphApplicationTraverseUserGroup**](ApplicationsApi.md#GraphApplicationTraverseUserGroup) | **Get** /applications/{application_id}/usergroups | List the User Groups bound to an Application +[**ImportUsers**](ApplicationsApi.md#ImportUsers) | **Get** /applications/{application_id}/import/users | Get a list of users to import from an Application IdM service provider + +# **ApplicationsDeleteLogo** +> ApplicationsDeleteLogo(ctx, applicationId, optional) +Delete application image + +Deletes the specified image from an application + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **applicationId** | **string**| | + **optional** | ***ApplicationsApiApplicationsDeleteLogoOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a ApplicationsApiApplicationsDeleteLogoOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **xOrgId** | **optional.String**| Organization identifier that can be obtained from console settings. | + +### Return type + + (empty response body) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **ApplicationsGet** +> interface{} ApplicationsGet(ctx, applicationId, optional) +Get an Application + +The endpoint retrieves an Application. + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **applicationId** | **string**| ObjectID of the Application. | + **optional** | ***ApplicationsApiApplicationsGetOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a ApplicationsApiApplicationsGetOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **xOrgId** | **optional.String**| Organization identifier that can be obtained from console settings. | + +### Return type + +[**interface{}**](interface{}.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **ApplicationsPostLogo** +> ApplicationsPostLogo(ctx, applicationId, optional) + + +This endpoint sets the logo for an application. #### Sample Request ``` curl -X POST 'https://console.jumpcloud.com/api/v2/applications/{Application_ID}/logo \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **applicationId** | **string**| | + **optional** | ***ApplicationsApiApplicationsPostLogoOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a ApplicationsApiApplicationsPostLogoOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **image** | **optional.Interface of *os.File****optional.**| | + **xOrgId** | **optional.**| Organization identifier that can be obtained from console settings. | + +### Return type + + (empty response body) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: multipart/form-data + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GraphApplicationAssociationsList** +> []GraphConnection GraphApplicationAssociationsList(ctx, applicationId, targets, optional) +List the associations of an Application + +This endpoint will return the _direct_ associations of an Application. A direct association can be a non-homogeneous relationship between 2 different objects, for example Applications and User Groups. #### Sample Request ``` curl -X GET 'https://console.jumpcloud.com/api/v2/applications/{Application_ID}/associations?targets=user_group \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **applicationId** | **string**| ObjectID of the Application. | + **targets** | [**[]string**](string.md)| Targets which a \"application\" can be associated to. | + **optional** | ***ApplicationsApiGraphApplicationAssociationsListOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a ApplicationsApiGraphApplicationAssociationsListOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + **limit** | **optional.Int32**| The number of records to return at once. Limited to 100. | [default to 10] + **skip** | **optional.Int32**| The offset into the records to return. | [default to 0] + **xOrgId** | **optional.String**| Organization identifier that can be obtained from console settings. | + +### Return type + +[**[]GraphConnection**](GraphConnection.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GraphApplicationAssociationsPost** +> GraphApplicationAssociationsPost(ctx, applicationId, optional) +Manage the associations of an Application + +This endpoint allows you to manage the _direct_ associations of an Application. A direct association can be a non-homogeneous relationship between 2 different objects, for example Application and User Groups. #### Sample Request ``` curl -X POST 'https://console.jumpcloud.com/api/v2/applications/{Application_ID}/associations' \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"op\": \"add\", \"type\": \"user_group\", \"id\": \"{Group_ID}\" }' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **applicationId** | **string**| ObjectID of the Application. | + **optional** | ***ApplicationsApiGraphApplicationAssociationsPostOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a ApplicationsApiGraphApplicationAssociationsPostOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **body** | [**optional.Interface of GraphOperationApplication**](GraphOperationApplication.md)| | + **xOrgId** | **optional.**| Organization identifier that can be obtained from console settings. | + +### Return type + + (empty response body) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GraphApplicationTraverseUser** +> []GraphObjectWithPaths GraphApplicationTraverseUser(ctx, applicationId, optional) +List the Users bound to an Application + +This endpoint will return all Users bound to an Application, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this Application to the corresponding User; this array represents all grouping and/or associations that would have to be removed to deprovision the User from this Application. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/applications/{Application_ID}/users \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **applicationId** | **string**| ObjectID of the Application. | + **optional** | ***ApplicationsApiGraphApplicationTraverseUserOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a ApplicationsApiGraphApplicationTraverseUserOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **limit** | **optional.Int32**| The number of records to return at once. Limited to 100. | [default to 10] + **xOrgId** | **optional.String**| Organization identifier that can be obtained from console settings. | + **skip** | **optional.Int32**| The offset into the records to return. | [default to 0] + **filter** | [**optional.Interface of []string**](string.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | + +### Return type + +[**[]GraphObjectWithPaths**](GraphObjectWithPaths.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GraphApplicationTraverseUserGroup** +> []GraphObjectWithPaths GraphApplicationTraverseUserGroup(ctx, applicationId, optional) +List the User Groups bound to an Application + +This endpoint will return all Users Groups bound to an Application, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the group's type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this Application to the corresponding User Group; this array represents all grouping and/or associations that would have to be removed to deprovision the User Group from this Application. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/applications/{Application_ID}/usergroups \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **applicationId** | **string**| ObjectID of the Application. | + **optional** | ***ApplicationsApiGraphApplicationTraverseUserGroupOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a ApplicationsApiGraphApplicationTraverseUserGroupOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **limit** | **optional.Int32**| The number of records to return at once. Limited to 100. | [default to 10] + **xOrgId** | **optional.String**| Organization identifier that can be obtained from console settings. | + **skip** | **optional.Int32**| The offset into the records to return. | [default to 0] + **filter** | [**optional.Interface of []string**](string.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | + +### Return type + +[**[]GraphObjectWithPaths**](GraphObjectWithPaths.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **ImportUsers** +> ImportUsersResponse ImportUsers(ctx, applicationId, optional) +Get a list of users to import from an Application IdM service provider + +Get a list of users to import from an Application IdM service provider. + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **applicationId** | **string**| ObjectID of the Application. | + **optional** | ***ApplicationsApiImportUsersOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a ApplicationsApiImportUsersOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **filter** | **optional.String**| Filter users by a search term | + **query** | **optional.String**| URL query to merge with the service provider request | + **sort** | **optional.String**| Sort users by supported fields | + **sortOrder** | **optional.String**| | [default to asc] + **xOrgId** | **optional.String**| Organization identifier that can be obtained from console settings. | + **limit** | **optional.Int32**| The number of records to return at once. Limited to 100. | [default to 10] + **skip** | **optional.Int32**| The offset into the records to return. | [default to 0] + +### Return type + +[**ImportUsersResponse**](importUsersResponse.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/v2/docs/AuthInfo.md b/jcapiv2/docs/AuthInfo.md similarity index 99% rename from v2/docs/AuthInfo.md rename to jcapiv2/docs/AuthInfo.md index e98d466..6dc4c36 100644 --- a/v2/docs/AuthInfo.md +++ b/jcapiv2/docs/AuthInfo.md @@ -9,4 +9,3 @@ Name | Type | Description | Notes [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/v2/docs/AuthInput.md b/jcapiv2/docs/AuthInput.md similarity index 99% rename from v2/docs/AuthInput.md rename to jcapiv2/docs/AuthInput.md index 9752063..d09bc45 100644 --- a/v2/docs/AuthInput.md +++ b/jcapiv2/docs/AuthInput.md @@ -8,4 +8,3 @@ Name | Type | Description | Notes [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/v2/docs/AuthInputObject.md b/jcapiv2/docs/AuthInputObject.md similarity index 99% rename from v2/docs/AuthInputObject.md rename to jcapiv2/docs/AuthInputObject.md index 863a8b1..2386723 100644 --- a/v2/docs/AuthInputObject.md +++ b/jcapiv2/docs/AuthInputObject.md @@ -7,4 +7,3 @@ Name | Type | Description | Notes [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/jcapiv2/docs/AuthenticationPoliciesApi.md b/jcapiv2/docs/AuthenticationPoliciesApi.md new file mode 100644 index 0000000..585c631 --- /dev/null +++ b/jcapiv2/docs/AuthenticationPoliciesApi.md @@ -0,0 +1,195 @@ +# {{classname}} + +All URIs are relative to *https://console.jumpcloud.com/api/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**AuthnpoliciesDelete**](AuthenticationPoliciesApi.md#AuthnpoliciesDelete) | **Delete** /authn/policies/{id} | Delete Authentication Policy +[**AuthnpoliciesGet**](AuthenticationPoliciesApi.md#AuthnpoliciesGet) | **Get** /authn/policies/{id} | Get an authentication policy +[**AuthnpoliciesList**](AuthenticationPoliciesApi.md#AuthnpoliciesList) | **Get** /authn/policies | List Authentication Policies +[**AuthnpoliciesPatch**](AuthenticationPoliciesApi.md#AuthnpoliciesPatch) | **Patch** /authn/policies/{id} | Patch Authentication Policy +[**AuthnpoliciesPost**](AuthenticationPoliciesApi.md#AuthnpoliciesPost) | **Post** /authn/policies | Create an Authentication Policy + +# **AuthnpoliciesDelete** +> AuthnPolicy AuthnpoliciesDelete(ctx, id, optional) +Delete Authentication Policy + +Delete the specified authentication policy. #### Sample Request ``` curl -X DELETE https://console.jumpcloud.com/api/v2/authn/policies/{id} \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **id** | **string**| Unique identifier of the authentication policy | + **optional** | ***AuthenticationPoliciesApiAuthnpoliciesDeleteOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a AuthenticationPoliciesApiAuthnpoliciesDeleteOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **xOrgId** | **optional.String**| Organization identifier that can be obtained from console settings. | + +### Return type + +[**AuthnPolicy**](AuthnPolicy.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **AuthnpoliciesGet** +> AuthnPolicy AuthnpoliciesGet(ctx, id, optional) +Get an authentication policy + +Return a specific authentication policy. #### Sample Request ``` curl https://console.jumpcloud.com/api/v2/authn/policies/{id} \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **id** | **string**| Unique identifier of the authentication policy | + **optional** | ***AuthenticationPoliciesApiAuthnpoliciesGetOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a AuthenticationPoliciesApiAuthnpoliciesGetOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **xOrgId** | **optional.String**| Organization identifier that can be obtained from console settings. | + +### Return type + +[**AuthnPolicy**](AuthnPolicy.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **AuthnpoliciesList** +> []AuthnPolicy AuthnpoliciesList(ctx, optional) +List Authentication Policies + +Get a list of all authentication policies. #### Sample Request ``` curl https://console.jumpcloud.com/api/v2/authn/policies \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **optional** | ***AuthenticationPoliciesApiAuthnpoliciesListOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a AuthenticationPoliciesApiAuthnpoliciesListOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xOrgId** | **optional.String**| Organization identifier that can be obtained from console settings. | + **xTotalCount** | **optional.Int32**| | + **limit** | **optional.Int32**| The number of records to return at once. Limited to 100. | [default to 10] + **skip** | **optional.Int32**| The offset into the records to return. | [default to 0] + **filter** | [**optional.Interface of []string**](string.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | + **sort** | [**optional.Interface of []string**](string.md)| The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. | + +### Return type + +[**[]AuthnPolicy**](AuthnPolicy.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **AuthnpoliciesPatch** +> AuthnPolicy AuthnpoliciesPatch(ctx, id, optional) +Patch Authentication Policy + +Patch the specified authentication policy. #### Sample Request ``` curl -X PATCH https://console.jumpcloud.com/api/v2/authn/policies/{id} \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"disabled\": false }' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **id** | **string**| Unique identifier of the authentication policy | + **optional** | ***AuthenticationPoliciesApiAuthnpoliciesPatchOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a AuthenticationPoliciesApiAuthnpoliciesPatchOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **body** | [**optional.Interface of AuthnPolicyInput**](AuthnPolicyInput.md)| | + **xOrgId** | **optional.**| Organization identifier that can be obtained from console settings. | + +### Return type + +[**AuthnPolicy**](AuthnPolicy.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **AuthnpoliciesPost** +> AuthnPolicy AuthnpoliciesPost(ctx, optional) +Create an Authentication Policy + +Create an authentication policy. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/authn/policies \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"name\": \"Sample Policy\", \"disabled\": false, \"effect\": { \"action\": \"allow\" }, \"targets\": { \"users\": { \"inclusions\": [\"ALL\"] }, \"userGroups\": { \"exclusions\": [{USER_GROUP_ID}] }, \"resources\": [ {\"type\": \"user_portal\" } ] }, \"conditions\":{ \"ipAddressIn\": [{IP_LIST_ID}] } }' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **optional** | ***AuthenticationPoliciesApiAuthnpoliciesPostOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a AuthenticationPoliciesApiAuthnpoliciesPostOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**optional.Interface of AuthnPolicyInput**](AuthnPolicyInput.md)| | + **xOrgId** | **optional.**| Organization identifier that can be obtained from console settings. | + +### Return type + +[**AuthnPolicy**](AuthnPolicy.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/v2/docs/AuthinputBasic.md b/jcapiv2/docs/AuthinputBasic.md similarity index 99% rename from v2/docs/AuthinputBasic.md rename to jcapiv2/docs/AuthinputBasic.md index 0219921..76c2492 100644 --- a/v2/docs/AuthinputBasic.md +++ b/jcapiv2/docs/AuthinputBasic.md @@ -8,4 +8,3 @@ Name | Type | Description | Notes [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/v2/docs/AuthinputOauth.md b/jcapiv2/docs/AuthinputOauth.md similarity index 99% rename from v2/docs/AuthinputOauth.md rename to jcapiv2/docs/AuthinputOauth.md index b711b0d..a306faf 100644 --- a/v2/docs/AuthinputOauth.md +++ b/jcapiv2/docs/AuthinputOauth.md @@ -7,4 +7,3 @@ Name | Type | Description | Notes [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/jcapiv2/docs/AuthnPolicy.md b/jcapiv2/docs/AuthnPolicy.md new file mode 100644 index 0000000..ff961c8 --- /dev/null +++ b/jcapiv2/docs/AuthnPolicy.md @@ -0,0 +1,16 @@ +# AuthnPolicy + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Conditions** | [***interface{}**](interface{}.md) | | [optional] [default to null] +**Description** | **string** | | [optional] [default to null] +**Disabled** | **bool** | | [optional] [default to null] +**Effect** | [***AuthnPolicyEffect**](AuthnPolicyEffect.md) | | [optional] [default to null] +**Id** | **string** | | [optional] [default to null] +**Name** | **string** | | [optional] [default to null] +**Targets** | [***AuthnPolicyTargets**](AuthnPolicyTargets.md) | | [optional] [default to null] +**Type_** | [***AuthnPolicyType**](AuthnPolicyType.md) | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/AuthnPolicyEffect.md b/jcapiv2/docs/AuthnPolicyEffect.md new file mode 100644 index 0000000..bc6fee1 --- /dev/null +++ b/jcapiv2/docs/AuthnPolicyEffect.md @@ -0,0 +1,10 @@ +# AuthnPolicyEffect + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Action** | **string** | | [default to null] +**Obligations** | [***AuthnPolicyObligations**](AuthnPolicyObligations.md) | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/AuthnPolicyInput.md b/jcapiv2/docs/AuthnPolicyInput.md new file mode 100644 index 0000000..bd8ac14 --- /dev/null +++ b/jcapiv2/docs/AuthnPolicyInput.md @@ -0,0 +1,15 @@ +# AuthnPolicyInput + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Conditions** | [***interface{}**](interface{}.md) | | [optional] [default to null] +**Description** | **string** | | [optional] [default to null] +**Disabled** | **bool** | | [optional] [default to null] +**Effect** | [***AuthnPolicyEffect**](AuthnPolicyEffect.md) | | [optional] [default to null] +**Name** | **string** | | [optional] [default to null] +**Targets** | [***AuthnPolicyTargets**](AuthnPolicyTargets.md) | | [optional] [default to null] +**Type_** | [***AuthnPolicyType**](AuthnPolicyType.md) | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/AuthnPolicyObligations.md b/jcapiv2/docs/AuthnPolicyObligations.md new file mode 100644 index 0000000..ad74564 --- /dev/null +++ b/jcapiv2/docs/AuthnPolicyObligations.md @@ -0,0 +1,10 @@ +# AuthnPolicyObligations + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Mfa** | [***AuthnPolicyObligationsMfa**](AuthnPolicyObligations_mfa.md) | | [optional] [default to null] +**UserVerification** | [***AuthnPolicyObligationsUserVerification**](AuthnPolicyObligations_userVerification.md) | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/AuthnPolicyObligationsMfa.md b/jcapiv2/docs/AuthnPolicyObligationsMfa.md new file mode 100644 index 0000000..0bf354a --- /dev/null +++ b/jcapiv2/docs/AuthnPolicyObligationsMfa.md @@ -0,0 +1,9 @@ +# AuthnPolicyObligationsMfa + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Required** | **bool** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/AuthnPolicyObligationsUserVerification.md b/jcapiv2/docs/AuthnPolicyObligationsUserVerification.md new file mode 100644 index 0000000..e9a1765 --- /dev/null +++ b/jcapiv2/docs/AuthnPolicyObligationsUserVerification.md @@ -0,0 +1,9 @@ +# AuthnPolicyObligationsUserVerification + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Requirement** | **string** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/AuthnPolicyResourceTarget.md b/jcapiv2/docs/AuthnPolicyResourceTarget.md new file mode 100644 index 0000000..bfad6e4 --- /dev/null +++ b/jcapiv2/docs/AuthnPolicyResourceTarget.md @@ -0,0 +1,10 @@ +# AuthnPolicyResourceTarget + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Id** | **string** | Object ID of the resource target. If undefined, then all resources of the given type are targeted. | [optional] [default to null] +**Type_** | **string** | | [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/AuthnPolicyTargets.md b/jcapiv2/docs/AuthnPolicyTargets.md new file mode 100644 index 0000000..2bdc439 --- /dev/null +++ b/jcapiv2/docs/AuthnPolicyTargets.md @@ -0,0 +1,12 @@ +# AuthnPolicyTargets + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Resources** | [**[]AuthnPolicyResourceTarget**](AuthnPolicyResourceTarget.md) | | [optional] [default to null] +**UserAttributes** | [***AuthnPolicyUserAttributeTarget**](AuthnPolicyUserAttributeTarget.md) | | [optional] [default to null] +**UserGroups** | [***AuthnPolicyUserGroupTarget**](AuthnPolicyUserGroupTarget.md) | | [optional] [default to null] +**Users** | [***AuthnPolicyUserTarget**](AuthnPolicyUserTarget.md) | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/AuthnPolicyType.md b/jcapiv2/docs/AuthnPolicyType.md new file mode 100644 index 0000000..578ef3b --- /dev/null +++ b/jcapiv2/docs/AuthnPolicyType.md @@ -0,0 +1,8 @@ +# AuthnPolicyType + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/AuthnPolicyUserAttributeFilter.md b/jcapiv2/docs/AuthnPolicyUserAttributeFilter.md new file mode 100644 index 0000000..7f8556a --- /dev/null +++ b/jcapiv2/docs/AuthnPolicyUserAttributeFilter.md @@ -0,0 +1,11 @@ +# AuthnPolicyUserAttributeFilter + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Field** | **string** | The only field that is currently supported is ldap_binding_user | [optional] [default to null] +**Operator** | **string** | | [optional] [default to null] +**Value** | [***AnyValue**](AnyValue.md) | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/AuthnPolicyUserAttributeTarget.md b/jcapiv2/docs/AuthnPolicyUserAttributeTarget.md new file mode 100644 index 0000000..a3637d1 --- /dev/null +++ b/jcapiv2/docs/AuthnPolicyUserAttributeTarget.md @@ -0,0 +1,10 @@ +# AuthnPolicyUserAttributeTarget + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Exclusions** | [**[]AuthnPolicyUserAttributeFilter**](AuthnPolicyUserAttributeFilter.md) | | [optional] [default to null] +**Inclusions** | [**[]AuthnPolicyUserAttributeFilter**](AuthnPolicyUserAttributeFilter.md) | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/AuthnPolicyUserGroupTarget.md b/jcapiv2/docs/AuthnPolicyUserGroupTarget.md new file mode 100644 index 0000000..ea8219f --- /dev/null +++ b/jcapiv2/docs/AuthnPolicyUserGroupTarget.md @@ -0,0 +1,10 @@ +# AuthnPolicyUserGroupTarget + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Exclusions** | **[]string** | | [optional] [default to null] +**Inclusions** | **[]string** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/AuthnPolicyUserTarget.md b/jcapiv2/docs/AuthnPolicyUserTarget.md new file mode 100644 index 0000000..e5b662b --- /dev/null +++ b/jcapiv2/docs/AuthnPolicyUserTarget.md @@ -0,0 +1,9 @@ +# AuthnPolicyUserTarget + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Inclusions** | **[]string** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/AutotaskCompany.md b/jcapiv2/docs/AutotaskCompany.md new file mode 100644 index 0000000..cbb21dd --- /dev/null +++ b/jcapiv2/docs/AutotaskCompany.md @@ -0,0 +1,10 @@ +# AutotaskCompany + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Id** | **string** | The autotask company identifier. | [default to null] +**Name** | **string** | The autotask company name. | [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/AutotaskCompanyResp.md b/jcapiv2/docs/AutotaskCompanyResp.md new file mode 100644 index 0000000..5721d2f --- /dev/null +++ b/jcapiv2/docs/AutotaskCompanyResp.md @@ -0,0 +1,10 @@ +# AutotaskCompanyResp + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Records** | [**[]AutotaskCompany**](AutotaskCompany.md) | | [default to null] +**TotalCount** | **int32** | | [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/AutotaskCompanyTypeResp.md b/jcapiv2/docs/AutotaskCompanyTypeResp.md new file mode 100644 index 0000000..14e9b4c --- /dev/null +++ b/jcapiv2/docs/AutotaskCompanyTypeResp.md @@ -0,0 +1,10 @@ +# AutotaskCompanyTypeResp + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Records** | [**[]BillingIntegrationCompanyType**](BillingIntegrationCompanyType.md) | | [default to null] +**TotalCount** | **int32** | | [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/AutotaskContract.md b/jcapiv2/docs/AutotaskContract.md new file mode 100644 index 0000000..79f541a --- /dev/null +++ b/jcapiv2/docs/AutotaskContract.md @@ -0,0 +1,11 @@ +# AutotaskContract + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**CompanyId** | **string** | The Autotask company identifier linked to contract. | [default to null] +**Id** | **string** | The contract identifier. | [default to null] +**Name** | **string** | The contract name. | [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/AutotaskContractField.md b/jcapiv2/docs/AutotaskContractField.md new file mode 100644 index 0000000..df610c5 --- /dev/null +++ b/jcapiv2/docs/AutotaskContractField.md @@ -0,0 +1,10 @@ +# AutotaskContractField + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Name** | **string** | The contract field name. | [default to null] +**Values** | [**[]AutotaskContractFieldValues**](AutotaskContractField_values.md) | | [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/AutotaskContractFieldValues.md b/jcapiv2/docs/AutotaskContractFieldValues.md new file mode 100644 index 0000000..195281c --- /dev/null +++ b/jcapiv2/docs/AutotaskContractFieldValues.md @@ -0,0 +1,10 @@ +# AutotaskContractFieldValues + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Label** | **string** | | [optional] [default to null] +**Value** | **string** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/AutotaskIntegration.md b/jcapiv2/docs/AutotaskIntegration.md new file mode 100644 index 0000000..3ec93bf --- /dev/null +++ b/jcapiv2/docs/AutotaskIntegration.md @@ -0,0 +1,11 @@ +# AutotaskIntegration + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Id** | **string** | The identifier for this Autotask integration. | [default to null] +**IsMspAuthConfigured** | **bool** | Has the msp-api been configured with auth data yet | [optional] [default to null] +**Username** | **string** | The username for connecting to Autotask. | [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/AutotaskIntegrationPatchReq.md b/jcapiv2/docs/AutotaskIntegrationPatchReq.md new file mode 100644 index 0000000..85fbe04 --- /dev/null +++ b/jcapiv2/docs/AutotaskIntegrationPatchReq.md @@ -0,0 +1,10 @@ +# AutotaskIntegrationPatchReq + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Secret** | **string** | The secret for connecting to Autotask. | [optional] [default to null] +**Username** | **string** | The username for connecting to Autotask. | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/AutotaskIntegrationReq.md b/jcapiv2/docs/AutotaskIntegrationReq.md new file mode 100644 index 0000000..ff2289c --- /dev/null +++ b/jcapiv2/docs/AutotaskIntegrationReq.md @@ -0,0 +1,10 @@ +# AutotaskIntegrationReq + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Secret** | **string** | The secret for connecting to Autotask. | [default to null] +**Username** | **string** | The username for connecting to Autotask. | [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/AutotaskMappingRequest.md b/jcapiv2/docs/AutotaskMappingRequest.md new file mode 100644 index 0000000..60647d7 --- /dev/null +++ b/jcapiv2/docs/AutotaskMappingRequest.md @@ -0,0 +1,9 @@ +# AutotaskMappingRequest + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Data** | [**[]AutotaskMappingRequestData**](AutotaskMappingRequest_data.md) | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/AutotaskMappingRequestCompany.md b/jcapiv2/docs/AutotaskMappingRequestCompany.md new file mode 100644 index 0000000..0bc65d1 --- /dev/null +++ b/jcapiv2/docs/AutotaskMappingRequestCompany.md @@ -0,0 +1,10 @@ +# AutotaskMappingRequestCompany + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Id** | **string** | | [default to null] +**Name** | **string** | | [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/AutotaskMappingRequestContract.md b/jcapiv2/docs/AutotaskMappingRequestContract.md new file mode 100644 index 0000000..7d261a8 --- /dev/null +++ b/jcapiv2/docs/AutotaskMappingRequestContract.md @@ -0,0 +1,8 @@ +# AutotaskMappingRequestContract + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/AutotaskMappingRequestData.md b/jcapiv2/docs/AutotaskMappingRequestData.md new file mode 100644 index 0000000..b0dcc9b --- /dev/null +++ b/jcapiv2/docs/AutotaskMappingRequestData.md @@ -0,0 +1,13 @@ +# AutotaskMappingRequestData + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Company** | [***AutotaskMappingRequestCompany**](AutotaskMappingRequestCompany.md) | | [default to null] +**Contract** | [***AutotaskMappingRequestContract**](AutotaskMappingRequestContract.md) | | [default to null] +**Delete** | **bool** | | [optional] [default to null] +**Organization** | [***AutotaskMappingRequestOrganization**](AutotaskMappingRequestOrganization.md) | | [default to null] +**Service** | [***AutotaskMappingRequestService**](AutotaskMappingRequestService.md) | | [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/AutotaskMappingRequestOrganization.md b/jcapiv2/docs/AutotaskMappingRequestOrganization.md new file mode 100644 index 0000000..78707d6 --- /dev/null +++ b/jcapiv2/docs/AutotaskMappingRequestOrganization.md @@ -0,0 +1,10 @@ +# AutotaskMappingRequestOrganization + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Id** | **string** | | [default to null] +**Name** | **string** | | [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/AutotaskMappingRequestService.md b/jcapiv2/docs/AutotaskMappingRequestService.md new file mode 100644 index 0000000..40b3974 --- /dev/null +++ b/jcapiv2/docs/AutotaskMappingRequestService.md @@ -0,0 +1,8 @@ +# AutotaskMappingRequestService + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/AutotaskMappingResponse.md b/jcapiv2/docs/AutotaskMappingResponse.md new file mode 100644 index 0000000..aa0fa2f --- /dev/null +++ b/jcapiv2/docs/AutotaskMappingResponse.md @@ -0,0 +1,14 @@ +# AutotaskMappingResponse + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Company** | [***AutotaskMappingResponseCompany**](AutotaskMappingResponseCompany.md) | | [optional] [default to null] +**Contract** | [***AutotaskMappingResponseContract**](AutotaskMappingResponseContract.md) | | [optional] [default to null] +**LastSyncDateTime** | **string** | | [optional] [default to null] +**LastSyncStatus** | **string** | | [optional] [default to null] +**Organization** | [***AutotaskMappingResponseOrganization**](AutotaskMappingResponseOrganization.md) | | [optional] [default to null] +**Service** | [***AutotaskMappingResponseService**](AutotaskMappingResponseService.md) | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/AutotaskMappingResponseCompany.md b/jcapiv2/docs/AutotaskMappingResponseCompany.md new file mode 100644 index 0000000..57de3a4 --- /dev/null +++ b/jcapiv2/docs/AutotaskMappingResponseCompany.md @@ -0,0 +1,10 @@ +# AutotaskMappingResponseCompany + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Id** | **string** | | [optional] [default to null] +**Name** | **string** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/AutotaskMappingResponseContract.md b/jcapiv2/docs/AutotaskMappingResponseContract.md new file mode 100644 index 0000000..9693d27 --- /dev/null +++ b/jcapiv2/docs/AutotaskMappingResponseContract.md @@ -0,0 +1,10 @@ +# AutotaskMappingResponseContract + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Id** | **string** | | [optional] [default to null] +**Name** | **string** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/AutotaskMappingResponseOrganization.md b/jcapiv2/docs/AutotaskMappingResponseOrganization.md new file mode 100644 index 0000000..b6924fb --- /dev/null +++ b/jcapiv2/docs/AutotaskMappingResponseOrganization.md @@ -0,0 +1,10 @@ +# AutotaskMappingResponseOrganization + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Id** | **string** | | [optional] [default to null] +**Name** | **string** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/AutotaskMappingResponseService.md b/jcapiv2/docs/AutotaskMappingResponseService.md new file mode 100644 index 0000000..ee2f0ee --- /dev/null +++ b/jcapiv2/docs/AutotaskMappingResponseService.md @@ -0,0 +1,11 @@ +# AutotaskMappingResponseService + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Id** | **string** | | [optional] [default to null] +**Name** | **string** | | [optional] [default to null] +**NonBillableUsers** | **int32** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/AutotaskService.md b/jcapiv2/docs/AutotaskService.md new file mode 100644 index 0000000..d279b76 --- /dev/null +++ b/jcapiv2/docs/AutotaskService.md @@ -0,0 +1,11 @@ +# AutotaskService + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ContractId** | **string** | The autotask contract identifier linked to this contract service. | [default to null] +**Id** | **string** | The contract service identifier. | [default to null] +**Name** | **string** | The autotask service name linked to this contract service. | [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/AutotaskSettings.md b/jcapiv2/docs/AutotaskSettings.md new file mode 100644 index 0000000..be595f8 --- /dev/null +++ b/jcapiv2/docs/AutotaskSettings.md @@ -0,0 +1,10 @@ +# AutotaskSettings + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**AutomaticTicketing** | **bool** | Determine whether Autotask uses automatic ticketing | [optional] [default to null] +**CompanyTypeIds** | **[]int32** | The array of Autotask companyType IDs applicable to the Provider. | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/AutotaskSettingsPatchReq.md b/jcapiv2/docs/AutotaskSettingsPatchReq.md new file mode 100644 index 0000000..4469487 --- /dev/null +++ b/jcapiv2/docs/AutotaskSettingsPatchReq.md @@ -0,0 +1,10 @@ +# AutotaskSettingsPatchReq + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**AutomaticTicketing** | **bool** | Determine whether Autotask uses automatic ticketing | [optional] [default to null] +**CompanyTypeIds** | **[]int32** | The array of Autotask companyType IDs applicable to the Provider. | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/AutotaskTicketingAlertConfiguration.md b/jcapiv2/docs/AutotaskTicketingAlertConfiguration.md new file mode 100644 index 0000000..570bca2 --- /dev/null +++ b/jcapiv2/docs/AutotaskTicketingAlertConfiguration.md @@ -0,0 +1,20 @@ +# AutotaskTicketingAlertConfiguration + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Category** | **string** | | [optional] [default to null] +**Description** | **string** | | [optional] [default to null] +**Destination** | **string** | | [optional] [default to null] +**DisplayName** | **string** | | [optional] [default to null] +**DueDays** | **int32** | | [optional] [default to null] +**Id** | **int32** | | [optional] [default to null] +**Priority** | [***AutotaskTicketingAlertConfigurationPriority**](AutotaskTicketingAlertConfiguration_priority.md) | | [optional] [default to null] +**Queue** | [***AutotaskTicketingAlertConfigurationPriority**](AutotaskTicketingAlertConfiguration_priority.md) | | [optional] [default to null] +**Resource** | [***AutotaskTicketingAlertConfigurationResource**](AutotaskTicketingAlertConfiguration_resource.md) | | [optional] [default to null] +**ShouldCreateTickets** | **bool** | | [optional] [default to null] +**Source** | [***AutotaskTicketingAlertConfigurationPriority**](AutotaskTicketingAlertConfiguration_priority.md) | | [optional] [default to null] +**Status** | [***AutotaskTicketingAlertConfigurationPriority**](AutotaskTicketingAlertConfiguration_priority.md) | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/AutotaskTicketingAlertConfigurationList.md b/jcapiv2/docs/AutotaskTicketingAlertConfigurationList.md new file mode 100644 index 0000000..a4b0dbd --- /dev/null +++ b/jcapiv2/docs/AutotaskTicketingAlertConfigurationList.md @@ -0,0 +1,9 @@ +# AutotaskTicketingAlertConfigurationList + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Records** | [**[]AllOfAutotaskTicketingAlertConfigurationListRecordsItems**](interface{}.md) | | [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/AutotaskTicketingAlertConfigurationOption.md b/jcapiv2/docs/AutotaskTicketingAlertConfigurationOption.md new file mode 100644 index 0000000..f5141fe --- /dev/null +++ b/jcapiv2/docs/AutotaskTicketingAlertConfigurationOption.md @@ -0,0 +1,10 @@ +# AutotaskTicketingAlertConfigurationOption + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Name** | **string** | | [optional] [default to null] +**Values** | [**[]AutotaskTicketingAlertConfigurationOptionValues**](AutotaskTicketingAlertConfigurationOption_values.md) | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/AutotaskTicketingAlertConfigurationOptionValues.md b/jcapiv2/docs/AutotaskTicketingAlertConfigurationOptionValues.md new file mode 100644 index 0000000..058c750 --- /dev/null +++ b/jcapiv2/docs/AutotaskTicketingAlertConfigurationOptionValues.md @@ -0,0 +1,10 @@ +# AutotaskTicketingAlertConfigurationOptionValues + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Label** | **string** | | [optional] [default to null] +**Value** | **int32** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/AutotaskTicketingAlertConfigurationOptions.md b/jcapiv2/docs/AutotaskTicketingAlertConfigurationOptions.md new file mode 100644 index 0000000..638633e --- /dev/null +++ b/jcapiv2/docs/AutotaskTicketingAlertConfigurationOptions.md @@ -0,0 +1,10 @@ +# AutotaskTicketingAlertConfigurationOptions + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Options** | [**[]AutotaskTicketingAlertConfigurationOption**](AutotaskTicketingAlertConfigurationOption.md) | | [optional] [default to null] +**Resources** | [**[]AutotaskTicketingAlertConfigurationResource**](AutotaskTicketingAlertConfigurationResource.md) | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/AutotaskTicketingAlertConfigurationPriority.md b/jcapiv2/docs/AutotaskTicketingAlertConfigurationPriority.md new file mode 100644 index 0000000..62c6e2f --- /dev/null +++ b/jcapiv2/docs/AutotaskTicketingAlertConfigurationPriority.md @@ -0,0 +1,10 @@ +# AutotaskTicketingAlertConfigurationPriority + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Id** | **int32** | | [optional] [default to null] +**Name** | **string** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/AutotaskTicketingAlertConfigurationRequest.md b/jcapiv2/docs/AutotaskTicketingAlertConfigurationRequest.md new file mode 100644 index 0000000..c9264be --- /dev/null +++ b/jcapiv2/docs/AutotaskTicketingAlertConfigurationRequest.md @@ -0,0 +1,16 @@ +# AutotaskTicketingAlertConfigurationRequest + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Destination** | **string** | | [default to null] +**DueDays** | **int32** | | [default to null] +**Priority** | [***AutotaskTicketingAlertConfigurationPriority**](AutotaskTicketingAlertConfiguration_priority.md) | | [default to null] +**Queue** | [***AutotaskTicketingAlertConfigurationPriority**](AutotaskTicketingAlertConfiguration_priority.md) | | [optional] [default to null] +**Resource** | [***AutotaskTicketingAlertConfigurationResource**](AutotaskTicketingAlertConfiguration_resource.md) | | [optional] [default to null] +**ShouldCreateTickets** | **bool** | | [default to null] +**Source** | [***AutotaskTicketingAlertConfigurationPriority**](AutotaskTicketingAlertConfiguration_priority.md) | | [optional] [default to null] +**Status** | [***AutotaskTicketingAlertConfigurationPriority**](AutotaskTicketingAlertConfiguration_priority.md) | | [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/AutotaskTicketingAlertConfigurationResource.md b/jcapiv2/docs/AutotaskTicketingAlertConfigurationResource.md new file mode 100644 index 0000000..608c4dd --- /dev/null +++ b/jcapiv2/docs/AutotaskTicketingAlertConfigurationResource.md @@ -0,0 +1,11 @@ +# AutotaskTicketingAlertConfigurationResource + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Id** | **int32** | | [optional] [default to null] +**Name** | **string** | | [optional] [default to null] +**Role** | [***AutotaskTicketingAlertConfigurationPriority**](AutotaskTicketingAlertConfiguration_priority.md) | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/BillingIntegrationCompanyType.md b/jcapiv2/docs/BillingIntegrationCompanyType.md new file mode 100644 index 0000000..55c05b3 --- /dev/null +++ b/jcapiv2/docs/BillingIntegrationCompanyType.md @@ -0,0 +1,10 @@ +# BillingIntegrationCompanyType + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Id** | **float64** | The company type identifier. | [default to null] +**Name** | **string** | The company type name. | [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/BulkJobRequestsApi.md b/jcapiv2/docs/BulkJobRequestsApi.md new file mode 100644 index 0000000..2251bee --- /dev/null +++ b/jcapiv2/docs/BulkJobRequestsApi.md @@ -0,0 +1,269 @@ +# {{classname}} + +All URIs are relative to *https://console.jumpcloud.com/api/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**BulkUserStatesCreate**](BulkJobRequestsApi.md#BulkUserStatesCreate) | **Post** /bulk/userstates | Create Scheduled Userstate Job +[**BulkUserStatesDelete**](BulkJobRequestsApi.md#BulkUserStatesDelete) | **Delete** /bulk/userstates/{id} | Delete Scheduled Userstate Job +[**BulkUserStatesGetNextScheduled**](BulkJobRequestsApi.md#BulkUserStatesGetNextScheduled) | **Get** /bulk/userstates/eventlist/next | Gets the next scheduled state change for each user in a list of system users +[**BulkUserStatesList**](BulkJobRequestsApi.md#BulkUserStatesList) | **Get** /bulk/userstates | List Scheduled Userstate Change Jobs +[**BulkUsersCreate**](BulkJobRequestsApi.md#BulkUsersCreate) | **Post** /bulk/users | Bulk Users Create +[**BulkUsersCreateResults**](BulkJobRequestsApi.md#BulkUsersCreateResults) | **Get** /bulk/users/{job_id}/results | List Bulk Users Results +[**BulkUsersUpdate**](BulkJobRequestsApi.md#BulkUsersUpdate) | **Patch** /bulk/users | Bulk Users Update + +# **BulkUserStatesCreate** +> []ScheduledUserstateResult BulkUserStatesCreate(ctx, optional) +Create Scheduled Userstate Job + +This endpoint allows you to create scheduled statechange jobs. #### Sample Request ``` curl -X POST \"https://console.jumpcloud.com/api/v2/bulk/userstates\" \\ -H 'x-api-key: {API_KEY}' \\ -H 'Content-Type: application/json' \\ -H 'Accept: application/json' \\ -d '{ \"user_ids\": [\"{User_ID_1}\", \"{User_ID_2}\", \"{User_ID_3}\"], \"state\": \"SUSPENDED\", \"start_date\": \"2000-01-01T00:00:00.000Z\" }' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **optional** | ***BulkJobRequestsApiBulkUserStatesCreateOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a BulkJobRequestsApiBulkUserStatesCreateOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**optional.Interface of BulkScheduledStatechangeCreate**](BulkScheduledStatechangeCreate.md)| | + **xOrgId** | **optional.**| Organization identifier that can be obtained from console settings. | + +### Return type + +[**[]ScheduledUserstateResult**](scheduled-userstate-result.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **BulkUserStatesDelete** +> BulkUserStatesDelete(ctx, id, optional) +Delete Scheduled Userstate Job + +This endpoint deletes a scheduled statechange job. #### Sample Request ``` curl -X DELETE \"https://console.jumpcloud.com/api/v2/bulk/userstates/{ScheduledJob_ID}\" \\ -H 'x-api-key: {API_KEY}' \\ -H 'Content-Type: application/json' \\ -H 'Accept: application/json' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **id** | **string**| Unique identifier of the scheduled statechange job. | + **optional** | ***BulkJobRequestsApiBulkUserStatesDeleteOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a BulkJobRequestsApiBulkUserStatesDeleteOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **xOrgId** | **optional.String**| Organization identifier that can be obtained from console settings. | + +### Return type + + (empty response body) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **BulkUserStatesGetNextScheduled** +> InlineResponse200 BulkUserStatesGetNextScheduled(ctx, users, optional) +Gets the next scheduled state change for each user in a list of system users + +This endpoint is used to lookup the next upcoming scheduled state change for each user in the given list. The users parameter is limited to 100 items per request. #### Sample Request ``` curl -X GET \"https://console.jumpcloud.com/api/v2/bulk/userstates/eventlist/next?users={UserID1},{UserID2},{UserID3}\" \\ -H 'x-api-key: {API_KEY}' \\ -H 'Content-Type: application/json' \\ -H 'Accept: application/json' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **users** | [**[]string**](string.md)| A list of system user IDs | + **optional** | ***BulkJobRequestsApiBulkUserStatesGetNextScheduledOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a BulkJobRequestsApiBulkUserStatesGetNextScheduledOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **limit** | **optional.Int32**| The number of records to return at once. Limited to 100. | [default to 10] + **skip** | **optional.Int32**| The offset into the records to return. | [default to 0] + +### Return type + +[**InlineResponse200**](inline_response_200.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **BulkUserStatesList** +> []ScheduledUserstateResult BulkUserStatesList(ctx, optional) +List Scheduled Userstate Change Jobs + +The endpoint allows you to list scheduled statechange jobs. #### Sample Request ``` curl -X GET \"https://console.jumpcloud.com/api/v2/bulk/userstates\" \\ -H 'x-api-key: {API_KEY}' \\ -H 'Content-Type: application/json' \\ -H 'Accept: application/json' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **optional** | ***BulkJobRequestsApiBulkUserStatesListOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a BulkJobRequestsApiBulkUserStatesListOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **limit** | **optional.Int32**| The number of records to return at once. Limited to 100. | [default to 10] + **filter** | [**optional.Interface of []string**](string.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | + **skip** | **optional.Int32**| The offset into the records to return. | [default to 0] + **xOrgId** | **optional.String**| Organization identifier that can be obtained from console settings. | + **userid** | **optional.String**| The systemuser id to filter by. | + +### Return type + +[**[]ScheduledUserstateResult**](scheduled-userstate-result.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **BulkUsersCreate** +> JobId BulkUsersCreate(ctx, optional) +Bulk Users Create + +The endpoint allows you to create a bulk job to asynchronously create users. See [Create a System User](https://docs.jumpcloud.com/api/1.0/index.html#operation/systemusers_post) for the full list of attributes. #### Default User State The `state` of each user in the request can be explicitly passed in or omitted. If `state` is omitted, then the user will get created using the value returned from the [Get an Organization](https://docs.jumpcloud.com/api/1.0/index.html#operation/organizations_get) endpoint. The default user state for bulk created users depends on the `creation-source` header. For `creation-source:jumpcloud:bulk` the default state is stored in `settings.newSystemUserStateDefaults.csvImport`. For other `creation-source` header values, the default state is stored in `settings.newSystemUserStateDefaults.applicationImport` These default state values can be changed in the admin portal settings or by using the [Update an Organization](https://docs.jumpcloud.com/api/1.0/index.html#operation/organization_put) endpoint. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/bulk/users \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '[ { \"email\":\"{email}\", \"firstname\":\"{firstname}\", \"lastname\":\"{firstname}\", \"username\":\"{username}\", \"attributes\":[ { \"name\":\"EmployeeID\", \"value\":\"0000\" }, { \"name\":\"Custom\", \"value\":\"attribute\" } ] } ]' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **optional** | ***BulkJobRequestsApiBulkUsersCreateOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a BulkJobRequestsApiBulkUsersCreateOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**optional.Interface of []BulkUserCreate**](bulk-user-create.md)| | + **xOrgId** | **optional.**| Organization identifier that can be obtained from console settings. | + **creationSource** | **optional.**| Defines the creation-source header for gapps, o365 and workdays requests. If the header isn't sent, the default value is `jumpcloud:bulk`, if you send the header with a malformed value you receive a 400 error. | [default to jumpcloud:bulk] + +### Return type + +[**JobId**](job-id.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **BulkUsersCreateResults** +> []JobWorkresult BulkUsersCreateResults(ctx, jobId, optional) +List Bulk Users Results + +This endpoint will return the results of particular user import or update job request. #### Sample Request ``` curl -X GET \\ https://console.jumpcloud.com/api/v2/bulk/users/{ImportJobID}/results \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **jobId** | **string**| | + **optional** | ***BulkJobRequestsApiBulkUsersCreateResultsOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a BulkJobRequestsApiBulkUsersCreateResultsOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **limit** | **optional.Int32**| The number of records to return at once. Limited to 100. | [default to 10] + **skip** | **optional.Int32**| The offset into the records to return. | [default to 0] + **xOrgId** | **optional.String**| Organization identifier that can be obtained from console settings. | + +### Return type + +[**[]JobWorkresult**](job-workresult.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **BulkUsersUpdate** +> JobId BulkUsersUpdate(ctx, optional) +Bulk Users Update + +The endpoint allows you to create a bulk job to asynchronously update users. See [Update a System User](https://docs.jumpcloud.com/api/1.0/index.html#operation/systemusers_put) for full list of attributes. #### Sample Request ``` curl -X PATCH https://console.jumpcloud.com/api/v2/bulk/users \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '[ { \"id\":\"5be9fb4ddb01290001e85109\", \"firstname\":\"{UPDATED_FIRSTNAME}\", \"department\":\"{UPDATED_DEPARTMENT}\", \"attributes\":[ {\"name\":\"Custom\",\"value\":\"{ATTRIBUTE_VALUE}\"} ] }, { \"id\":\"5be9fb4ddb01290001e85109\", \"firstname\":\"{UPDATED_FIRSTNAME}\", \"costCenter\":\"{UPDATED_COST_CENTER}\", \"phoneNumbers\":[ {\"type\":\"home\",\"number\":\"{HOME_PHONE_NUMBER}\"}, {\"type\":\"work\",\"number\":\"{WORK_PHONE_NUMBER}\"} ] } ] ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **optional** | ***BulkJobRequestsApiBulkUsersUpdateOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a BulkJobRequestsApiBulkUsersUpdateOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**optional.Interface of []BulkUserUpdate**](bulk-user-update.md)| | + **xOrgId** | **optional.**| Organization identifier that can be obtained from console settings. | + +### Return type + +[**JobId**](job-id.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/BulkScheduledStatechangeCreate.md b/jcapiv2/docs/BulkScheduledStatechangeCreate.md new file mode 100644 index 0000000..3749d7f --- /dev/null +++ b/jcapiv2/docs/BulkScheduledStatechangeCreate.md @@ -0,0 +1,13 @@ +# BulkScheduledStatechangeCreate + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ActivationEmailOverride** | **string** | Send the activation or welcome email to the specified email address upon activation. Can only be used with a single user_id and scheduled activation. This field will be ignored if `send_activation_emails` is explicitly set to false. | [optional] [default to null] +**SendActivationEmails** | **bool** | Set to true to send activation or welcome email(s) to each user_id upon activation. Set to false to suppress emails. Can only be used with scheduled activation(s). | [optional] [default to null] +**StartDate** | [**time.Time**](time.Time.md) | Date and time that scheduled action should occur | [default to null] +**State** | **string** | The state to move the user(s) to | [default to null] +**UserIds** | **[]string** | Array of system user ids to schedule for a state change | [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/v2/docs/BulkUserCreate.md b/jcapiv2/docs/BulkUserCreate.md similarity index 99% rename from v2/docs/BulkUserCreate.md rename to jcapiv2/docs/BulkUserCreate.md index 49c7898..9cd139d 100644 --- a/v2/docs/BulkUserCreate.md +++ b/jcapiv2/docs/BulkUserCreate.md @@ -11,4 +11,3 @@ Name | Type | Description | Notes [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/v2/docs/BulkUserUpdate.md b/jcapiv2/docs/BulkUserUpdate.md similarity index 99% rename from v2/docs/BulkUserUpdate.md rename to jcapiv2/docs/BulkUserUpdate.md index ecb3f7d..8bbaf4a 100644 --- a/v2/docs/BulkUserUpdate.md +++ b/jcapiv2/docs/BulkUserUpdate.md @@ -12,4 +12,3 @@ Name | Type | Description | Notes [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/jcapiv2/docs/CommandResultList.md b/jcapiv2/docs/CommandResultList.md new file mode 100644 index 0000000..86eebce --- /dev/null +++ b/jcapiv2/docs/CommandResultList.md @@ -0,0 +1,10 @@ +# CommandResultList + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Results** | [**[]CommandResultListResults**](CommandResultList_results.md) | | [optional] [default to null] +**TotalCount** | **int32** | The total number of command results | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/CommandResultListResults.md b/jcapiv2/docs/CommandResultListResults.md new file mode 100644 index 0000000..4a73e61 --- /dev/null +++ b/jcapiv2/docs/CommandResultListResults.md @@ -0,0 +1,13 @@ +# CommandResultListResults + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Command** | **string** | The ID of the command, from savedAgentCommands. | [optional] [default to null] +**CompletedCount** | **int32** | The number of devices that we do have results from. | [optional] [default to null] +**Id** | **string** | The workflowInstanceId. | [optional] [default to null] +**PendingCount** | **int32** | The number of devices that we haven't received results from. | [optional] [default to null] +**System** | **string** | The ID of the device the command is bound to. | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/CommandResultsApi.md b/jcapiv2/docs/CommandResultsApi.md new file mode 100644 index 0000000..27b0000 --- /dev/null +++ b/jcapiv2/docs/CommandResultsApi.md @@ -0,0 +1,45 @@ +# {{classname}} + +All URIs are relative to *https://console.jumpcloud.com/api/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**CommandsListResultsByWorkflow**](CommandResultsApi.md#CommandsListResultsByWorkflow) | **Get** /commandresult/workflows | List all Command Results by Workflow + +# **CommandsListResultsByWorkflow** +> CommandResultList CommandsListResultsByWorkflow(ctx, optional) +List all Command Results by Workflow + +This endpoint returns all command results, grouped by workflowInstanceId. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/commandresult/workflows \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key:{API_KEY}' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **optional** | ***CommandResultsApiCommandsListResultsByWorkflowOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a CommandResultsApiCommandsListResultsByWorkflowOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xOrgId** | **optional.String**| Organization identifier that can be obtained from console settings. | + **limit** | **optional.Int32**| | [default to 10] + **filter** | [**optional.Interface of []string**](string.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | + **skip** | **optional.Int32**| The offset into the records to return. | [default to 0] + +### Return type + +[**CommandResultList**](CommandResultList.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/CommandsApi.md b/jcapiv2/docs/CommandsApi.md new file mode 100644 index 0000000..284d880 --- /dev/null +++ b/jcapiv2/docs/CommandsApi.md @@ -0,0 +1,241 @@ +# {{classname}} + +All URIs are relative to *https://console.jumpcloud.com/api/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**CommandsCancelQueuedCommandsByWorkflowInstanceId**](CommandsApi.md#CommandsCancelQueuedCommandsByWorkflowInstanceId) | **Delete** /commandqueue/{workflow_instance_id} | Cancel all queued commands for an organization by workflow instance Id +[**CommandsGetQueuedCommandsByWorkflow**](CommandsApi.md#CommandsGetQueuedCommandsByWorkflow) | **Get** /queuedcommand/workflows | Fetch the queued Commands for an Organization +[**GraphCommandAssociationsList**](CommandsApi.md#GraphCommandAssociationsList) | **Get** /commands/{command_id}/associations | List the associations of a Command +[**GraphCommandAssociationsPost**](CommandsApi.md#GraphCommandAssociationsPost) | **Post** /commands/{command_id}/associations | Manage the associations of a Command +[**GraphCommandTraverseSystem**](CommandsApi.md#GraphCommandTraverseSystem) | **Get** /commands/{command_id}/systems | List the Systems bound to a Command +[**GraphCommandTraverseSystemGroup**](CommandsApi.md#GraphCommandTraverseSystemGroup) | **Get** /commands/{command_id}/systemgroups | List the System Groups bound to a Command + +# **CommandsCancelQueuedCommandsByWorkflowInstanceId** +> CommandsCancelQueuedCommandsByWorkflowInstanceId(ctx, workflowInstanceId, optional) +Cancel all queued commands for an organization by workflow instance Id + +This endpoint allows all queued commands for one workflow instance to be canceled. #### Sample Request ``` curl -X DELETE https://console.jumpcloud.com/api/v2/commandqueue/{workflow_instance_id} \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **workflowInstanceId** | **string**| Workflow instance Id of the queued commands to cancel. | + **optional** | ***CommandsApiCommandsCancelQueuedCommandsByWorkflowInstanceIdOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a CommandsApiCommandsCancelQueuedCommandsByWorkflowInstanceIdOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **xOrgId** | **optional.String**| Organization identifier that can be obtained from console settings. | + +### Return type + + (empty response body) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **CommandsGetQueuedCommandsByWorkflow** +> QueuedCommandList CommandsGetQueuedCommandsByWorkflow(ctx, optional) +Fetch the queued Commands for an Organization + +This endpoint will return all queued Commands for an Organization. Each element will contain the workflow ID, the command name, the launch type (e.g. manual, triggered, or scheduled), the target OS, the number of assigned devices, and the number of pending devices that have not yet ran the command. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/queuedcommand/workflows \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **optional** | ***CommandsApiCommandsGetQueuedCommandsByWorkflowOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a CommandsApiCommandsGetQueuedCommandsByWorkflowOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xOrgId** | **optional.String**| Organization identifier that can be obtained from console settings. | + **limit** | **optional.Int32**| | [default to 10] + **filter** | [**optional.Interface of []string**](string.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | + **skip** | **optional.Int32**| The offset into the records to return. | [default to 0] + +### Return type + +[**QueuedCommandList**](QueuedCommandList.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GraphCommandAssociationsList** +> []GraphConnection GraphCommandAssociationsList(ctx, commandId, targets, optional) +List the associations of a Command + +This endpoint will return the _direct_ associations of this Command. A direct association can be a non-homogeneous relationship between 2 different objects, for example Commands and User Groups. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/commands/{Command_ID}/associations?targets=system_group \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **commandId** | **string**| ObjectID of the Command. | + **targets** | [**[]string**](string.md)| Targets which a \"command\" can be associated to. | + **optional** | ***CommandsApiGraphCommandAssociationsListOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a CommandsApiGraphCommandAssociationsListOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + **limit** | **optional.Int32**| The number of records to return at once. Limited to 100. | [default to 10] + **skip** | **optional.Int32**| The offset into the records to return. | [default to 0] + **xOrgId** | **optional.String**| Organization identifier that can be obtained from console settings. | + +### Return type + +[**[]GraphConnection**](GraphConnection.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GraphCommandAssociationsPost** +> GraphCommandAssociationsPost(ctx, commandId, optional) +Manage the associations of a Command + +This endpoint will allow you to manage the _direct_ associations of this Command. A direct association can be a non-homogeneous relationship between 2 different objects, for example Commands and User Groups. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/commands/{Command_ID}/associations \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"op\": \"add\", \"type\": \"system_group\", \"id\": \"Group_ID\" }' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **commandId** | **string**| ObjectID of the Command. | + **optional** | ***CommandsApiGraphCommandAssociationsPostOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a CommandsApiGraphCommandAssociationsPostOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **body** | [**optional.Interface of GraphOperationCommand**](GraphOperationCommand.md)| | + **xOrgId** | **optional.**| Organization identifier that can be obtained from console settings. | + +### Return type + + (empty response body) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GraphCommandTraverseSystem** +> []GraphObjectWithPaths GraphCommandTraverseSystem(ctx, commandId, optional) +List the Systems bound to a Command + +This endpoint will return all Systems bound to a Command, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this Command to the corresponding System; this array represents all grouping and/or associations that would have to be removed to deprovision the System from this Command. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/commands/{Command_ID}/systems \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **commandId** | **string**| ObjectID of the Command. | + **optional** | ***CommandsApiGraphCommandTraverseSystemOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a CommandsApiGraphCommandTraverseSystemOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **limit** | **optional.Int32**| The number of records to return at once. Limited to 100. | [default to 10] + **xOrgId** | **optional.String**| Organization identifier that can be obtained from console settings. | + **skip** | **optional.Int32**| The offset into the records to return. | [default to 0] + **filter** | [**optional.Interface of []string**](string.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | + +### Return type + +[**[]GraphObjectWithPaths**](GraphObjectWithPaths.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GraphCommandTraverseSystemGroup** +> []GraphObjectWithPaths GraphCommandTraverseSystemGroup(ctx, commandId, optional) +List the System Groups bound to a Command + +This endpoint will return all System Groups bound to a Command, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the group's type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this Command to the corresponding System Group; this array represents all grouping and/or associations that would have to be removed to deprovision the System Group from this Command. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/commands/{Command_ID}/systemgroups \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **commandId** | **string**| ObjectID of the Command. | + **optional** | ***CommandsApiGraphCommandTraverseSystemGroupOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a CommandsApiGraphCommandTraverseSystemGroupOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **limit** | **optional.Int32**| The number of records to return at once. Limited to 100. | [default to 10] + **xOrgId** | **optional.String**| Organization identifier that can be obtained from console settings. | + **skip** | **optional.Int32**| The offset into the records to return. | [default to 0] + **filter** | [**optional.Interface of []string**](string.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | + +### Return type + +[**[]GraphObjectWithPaths**](GraphObjectWithPaths.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/ConnectWiseMappingRequest.md b/jcapiv2/docs/ConnectWiseMappingRequest.md new file mode 100644 index 0000000..a79635d --- /dev/null +++ b/jcapiv2/docs/ConnectWiseMappingRequest.md @@ -0,0 +1,9 @@ +# ConnectWiseMappingRequest + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Data** | [**[]ConnectWiseMappingRequestData**](ConnectWiseMappingRequest_data.md) | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/ConnectWiseMappingRequestCompany.md b/jcapiv2/docs/ConnectWiseMappingRequestCompany.md new file mode 100644 index 0000000..6ec6fce --- /dev/null +++ b/jcapiv2/docs/ConnectWiseMappingRequestCompany.md @@ -0,0 +1,10 @@ +# ConnectWiseMappingRequestCompany + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Id** | **string** | | [default to null] +**Name** | **string** | | [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/ConnectWiseMappingRequestData.md b/jcapiv2/docs/ConnectWiseMappingRequestData.md new file mode 100644 index 0000000..0e0195d --- /dev/null +++ b/jcapiv2/docs/ConnectWiseMappingRequestData.md @@ -0,0 +1,13 @@ +# ConnectWiseMappingRequestData + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Addition** | [***interface{}**](interface{}.md) | | [default to null] +**Agreement** | [***interface{}**](interface{}.md) | | [default to null] +**Company** | [***ConnectWiseMappingRequestCompany**](ConnectWiseMappingRequest_company.md) | | [default to null] +**Delete** | **bool** | | [optional] [default to null] +**Organization** | [***ConnectWiseMappingRequestOrganization**](ConnectWiseMappingRequest_organization.md) | | [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/ConnectWiseMappingRequestOrganization.md b/jcapiv2/docs/ConnectWiseMappingRequestOrganization.md new file mode 100644 index 0000000..ba4aff3 --- /dev/null +++ b/jcapiv2/docs/ConnectWiseMappingRequestOrganization.md @@ -0,0 +1,10 @@ +# ConnectWiseMappingRequestOrganization + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Id** | **string** | | [default to null] +**Name** | **string** | | [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/ConnectWiseMappingResponse.md b/jcapiv2/docs/ConnectWiseMappingResponse.md new file mode 100644 index 0000000..eaa7a7d --- /dev/null +++ b/jcapiv2/docs/ConnectWiseMappingResponse.md @@ -0,0 +1,14 @@ +# ConnectWiseMappingResponse + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Addition** | [***ConnectWiseMappingResponseAddition**](ConnectWiseMappingResponse_addition.md) | | [optional] [default to null] +**Agreement** | [***ConnectWiseMappingResponseAddition**](ConnectWiseMappingResponse_addition.md) | | [optional] [default to null] +**Company** | [***ConnectWiseMappingResponseAddition**](ConnectWiseMappingResponse_addition.md) | | [optional] [default to null] +**LastSyncDateTime** | **string** | | [optional] [default to null] +**LastSyncStatus** | **string** | | [optional] [default to null] +**Organization** | [***ConnectWiseMappingResponseAddition**](ConnectWiseMappingResponse_addition.md) | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/ConnectWiseMappingResponseAddition.md b/jcapiv2/docs/ConnectWiseMappingResponseAddition.md new file mode 100644 index 0000000..870789a --- /dev/null +++ b/jcapiv2/docs/ConnectWiseMappingResponseAddition.md @@ -0,0 +1,10 @@ +# ConnectWiseMappingResponseAddition + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Id** | **string** | | [optional] [default to null] +**Name** | **string** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/ConnectWiseSettings.md b/jcapiv2/docs/ConnectWiseSettings.md new file mode 100644 index 0000000..5a9db31 --- /dev/null +++ b/jcapiv2/docs/ConnectWiseSettings.md @@ -0,0 +1,10 @@ +# ConnectWiseSettings + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**AutomaticTicketing** | **bool** | Determine whether ConnectWise uses automatic ticketing | [optional] [default to null] +**CompanyTypeIds** | **[]int32** | The array of ConnectWise companyType IDs applicable to the Provider. | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/ConnectWiseSettingsPatchReq.md b/jcapiv2/docs/ConnectWiseSettingsPatchReq.md new file mode 100644 index 0000000..4c1e5fd --- /dev/null +++ b/jcapiv2/docs/ConnectWiseSettingsPatchReq.md @@ -0,0 +1,10 @@ +# ConnectWiseSettingsPatchReq + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**AutomaticTicketing** | **bool** | Determine whether ConnectWise uses automatic ticketing | [optional] [default to null] +**CompanyTypeIds** | **[]int32** | The array of ConnectWise companyType IDs applicable to the Provider. | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/ConnectWiseTicketingAlertConfiguration.md b/jcapiv2/docs/ConnectWiseTicketingAlertConfiguration.md new file mode 100644 index 0000000..41a9c6d --- /dev/null +++ b/jcapiv2/docs/ConnectWiseTicketingAlertConfiguration.md @@ -0,0 +1,16 @@ +# ConnectWiseTicketingAlertConfiguration + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Category** | **string** | | [optional] [default to null] +**Description** | **string** | | [optional] [default to null] +**DisplayName** | **string** | | [optional] [default to null] +**DueDays** | **int32** | | [optional] [default to null] +**Id** | **int32** | | [optional] [default to null] +**Priority** | [***AutotaskTicketingAlertConfigurationPriority**](AutotaskTicketingAlertConfiguration_priority.md) | | [optional] [default to null] +**ShouldCreateTickets** | **bool** | | [default to null] +**Source** | [***AutotaskTicketingAlertConfigurationPriority**](AutotaskTicketingAlertConfiguration_priority.md) | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/ConnectWiseTicketingAlertConfigurationList.md b/jcapiv2/docs/ConnectWiseTicketingAlertConfigurationList.md new file mode 100644 index 0000000..bc28d25 --- /dev/null +++ b/jcapiv2/docs/ConnectWiseTicketingAlertConfigurationList.md @@ -0,0 +1,9 @@ +# ConnectWiseTicketingAlertConfigurationList + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Records** | [**[]AllOfConnectWiseTicketingAlertConfigurationListRecordsItems**](interface{}.md) | | [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/ConnectWiseTicketingAlertConfigurationOption.md b/jcapiv2/docs/ConnectWiseTicketingAlertConfigurationOption.md new file mode 100644 index 0000000..b981daa --- /dev/null +++ b/jcapiv2/docs/ConnectWiseTicketingAlertConfigurationOption.md @@ -0,0 +1,10 @@ +# ConnectWiseTicketingAlertConfigurationOption + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Name** | **string** | | [optional] [default to null] +**Values** | [**[]AutotaskTicketingAlertConfigurationOptionValues**](AutotaskTicketingAlertConfigurationOption_values.md) | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/ConnectWiseTicketingAlertConfigurationOptions.md b/jcapiv2/docs/ConnectWiseTicketingAlertConfigurationOptions.md new file mode 100644 index 0000000..defeefe --- /dev/null +++ b/jcapiv2/docs/ConnectWiseTicketingAlertConfigurationOptions.md @@ -0,0 +1,9 @@ +# ConnectWiseTicketingAlertConfigurationOptions + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Records** | [**[]ConnectWiseTicketingAlertConfigurationOption**](ConnectWiseTicketingAlertConfigurationOption.md) | | [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/ConnectWiseTicketingAlertConfigurationRequest.md b/jcapiv2/docs/ConnectWiseTicketingAlertConfigurationRequest.md new file mode 100644 index 0000000..d4b7997 --- /dev/null +++ b/jcapiv2/docs/ConnectWiseTicketingAlertConfigurationRequest.md @@ -0,0 +1,12 @@ +# ConnectWiseTicketingAlertConfigurationRequest + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**DueDays** | **int32** | | [optional] [default to null] +**Priority** | [***AutotaskTicketingAlertConfigurationPriority**](AutotaskTicketingAlertConfiguration_priority.md) | | [optional] [default to null] +**ShouldCreateTickets** | **bool** | | [default to null] +**Source** | [***AutotaskTicketingAlertConfigurationPriority**](AutotaskTicketingAlertConfiguration_priority.md) | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/ConnectwiseAddition.md b/jcapiv2/docs/ConnectwiseAddition.md new file mode 100644 index 0000000..2bc604a --- /dev/null +++ b/jcapiv2/docs/ConnectwiseAddition.md @@ -0,0 +1,10 @@ +# ConnectwiseAddition + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Id** | **string** | The addition identifier. | [default to null] +**Name** | **string** | The addition name. | [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/ConnectwiseAgreement.md b/jcapiv2/docs/ConnectwiseAgreement.md new file mode 100644 index 0000000..d9d1248 --- /dev/null +++ b/jcapiv2/docs/ConnectwiseAgreement.md @@ -0,0 +1,11 @@ +# ConnectwiseAgreement + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**CompanyId** | **string** | The ConnectWise company identifier linked to agreement. | [default to null] +**Id** | **string** | The agreement identifier. | [default to null] +**Name** | **string** | The agreement name. | [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/ConnectwiseCompany.md b/jcapiv2/docs/ConnectwiseCompany.md new file mode 100644 index 0000000..32b3986 --- /dev/null +++ b/jcapiv2/docs/ConnectwiseCompany.md @@ -0,0 +1,10 @@ +# ConnectwiseCompany + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Id** | **string** | The company identifier. | [default to null] +**Name** | **string** | The company name. | [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/ConnectwiseCompanyResp.md b/jcapiv2/docs/ConnectwiseCompanyResp.md new file mode 100644 index 0000000..2a76d5a --- /dev/null +++ b/jcapiv2/docs/ConnectwiseCompanyResp.md @@ -0,0 +1,10 @@ +# ConnectwiseCompanyResp + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Records** | [**[]ConnectwiseCompany**](ConnectwiseCompany.md) | | [default to null] +**TotalCount** | **int32** | | [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/ConnectwiseCompanyTypeResp.md b/jcapiv2/docs/ConnectwiseCompanyTypeResp.md new file mode 100644 index 0000000..88a30ae --- /dev/null +++ b/jcapiv2/docs/ConnectwiseCompanyTypeResp.md @@ -0,0 +1,10 @@ +# ConnectwiseCompanyTypeResp + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Records** | [**[]BillingIntegrationCompanyType**](BillingIntegrationCompanyType.md) | | [default to null] +**TotalCount** | **int32** | | [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/ConnectwiseIntegration.md b/jcapiv2/docs/ConnectwiseIntegration.md new file mode 100644 index 0000000..5a71b09 --- /dev/null +++ b/jcapiv2/docs/ConnectwiseIntegration.md @@ -0,0 +1,12 @@ +# ConnectwiseIntegration + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**CompanyId** | **string** | The ConnectWise company identifier. | [default to null] +**Id** | **string** | The identifier for this ConnectWise integration. | [default to null] +**IsMspAuthConfigured** | **bool** | Has the msp-api been configured with auth data yet | [optional] [default to null] +**Url** | **string** | The base url for connecting to ConnectWise. | [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/ConnectwiseIntegrationPatchReq.md b/jcapiv2/docs/ConnectwiseIntegrationPatchReq.md new file mode 100644 index 0000000..4eee886 --- /dev/null +++ b/jcapiv2/docs/ConnectwiseIntegrationPatchReq.md @@ -0,0 +1,12 @@ +# ConnectwiseIntegrationPatchReq + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**CompanyId** | **string** | The ConnectWise company identifier. | [optional] [default to null] +**PrivateKey** | **string** | The ConnectWise private key for authentication | [optional] [default to null] +**PublicKey** | **string** | The ConnectWise public key for authentication. | [optional] [default to null] +**Url** | **string** | The base url for connecting to ConnectWise. | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/ConnectwiseIntegrationReq.md b/jcapiv2/docs/ConnectwiseIntegrationReq.md new file mode 100644 index 0000000..f57a50a --- /dev/null +++ b/jcapiv2/docs/ConnectwiseIntegrationReq.md @@ -0,0 +1,12 @@ +# ConnectwiseIntegrationReq + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**CompanyId** | **string** | The ConnectWise company identifier. | [default to null] +**PrivateKey** | **string** | The ConnectWise private key for authentication | [default to null] +**PublicKey** | **string** | The ConnectWise public key for authentication. | [default to null] +**Url** | **string** | The base url for connecting to ConnectWise. | [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/CustomEmail.md b/jcapiv2/docs/CustomEmail.md new file mode 100644 index 0000000..487f48e --- /dev/null +++ b/jcapiv2/docs/CustomEmail.md @@ -0,0 +1,16 @@ +# CustomEmail + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Body** | **string** | | [optional] [default to null] +**Button** | **string** | | [optional] [default to null] +**Header** | **string** | | [optional] [default to null] +**Id** | **string** | | [optional] [default to null] +**NextStepContactInfo** | **string** | | [optional] [default to null] +**Subject** | **string** | | [default to null] +**Title** | **string** | | [optional] [default to null] +**Type_** | [***CustomEmailType**](CustomEmailType.md) | | [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/CustomEmailTemplate.md b/jcapiv2/docs/CustomEmailTemplate.md new file mode 100644 index 0000000..e6be10f --- /dev/null +++ b/jcapiv2/docs/CustomEmailTemplate.md @@ -0,0 +1,12 @@ +# CustomEmailTemplate + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Description** | **string** | | [optional] [default to null] +**DisplayName** | **string** | | [optional] [default to null] +**Fields** | [**[]CustomEmailTemplateField**](CustomEmailTemplateField.md) | | [optional] [default to null] +**Type_** | [***CustomEmailType**](CustomEmailType.md) | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/CustomEmailTemplateField.md b/jcapiv2/docs/CustomEmailTemplateField.md new file mode 100644 index 0000000..b65dba1 --- /dev/null +++ b/jcapiv2/docs/CustomEmailTemplateField.md @@ -0,0 +1,12 @@ +# CustomEmailTemplateField + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**DefaultValue** | **string** | | [optional] [default to null] +**DisplayName** | **string** | | [optional] [default to null] +**Field** | **string** | | [optional] [default to null] +**Multiline** | **bool** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/CustomEmailType.md b/jcapiv2/docs/CustomEmailType.md new file mode 100644 index 0000000..7f1b06a --- /dev/null +++ b/jcapiv2/docs/CustomEmailType.md @@ -0,0 +1,8 @@ +# CustomEmailType + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/CustomEmailsApi.md b/jcapiv2/docs/CustomEmailsApi.md new file mode 100644 index 0000000..5b824d1 --- /dev/null +++ b/jcapiv2/docs/CustomEmailsApi.md @@ -0,0 +1,180 @@ +# {{classname}} + +All URIs are relative to *https://console.jumpcloud.com/api/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**CustomEmailsCreate**](CustomEmailsApi.md#CustomEmailsCreate) | **Post** /customemails | Create custom email configuration +[**CustomEmailsDestroy**](CustomEmailsApi.md#CustomEmailsDestroy) | **Delete** /customemails/{custom_email_type} | Delete custom email configuration +[**CustomEmailsGetTemplates**](CustomEmailsApi.md#CustomEmailsGetTemplates) | **Get** /customemail/templates | List custom email templates +[**CustomEmailsRead**](CustomEmailsApi.md#CustomEmailsRead) | **Get** /customemails/{custom_email_type} | Get custom email configuration +[**CustomEmailsUpdate**](CustomEmailsApi.md#CustomEmailsUpdate) | **Put** /customemails/{custom_email_type} | Update custom email configuration + +# **CustomEmailsCreate** +> CustomEmail CustomEmailsCreate(ctx, optional) +Create custom email configuration + +Create the custom email configuration for the specified custom email type + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **optional** | ***CustomEmailsApiCustomEmailsCreateOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a CustomEmailsApiCustomEmailsCreateOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**optional.Interface of CustomEmail**](CustomEmail.md)| | + **xOrgId** | **optional.**| Organization identifier that can be obtained from console settings. | + +### Return type + +[**CustomEmail**](CustomEmail.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **CustomEmailsDestroy** +> CustomEmailsDestroy(ctx, customEmailType, optional) +Delete custom email configuration + +Delete the custom email configuration for the specified custom email type + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **customEmailType** | **string**| | + **optional** | ***CustomEmailsApiCustomEmailsDestroyOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a CustomEmailsApiCustomEmailsDestroyOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **xOrgId** | **optional.String**| Organization identifier that can be obtained from console settings. | + +### Return type + + (empty response body) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **CustomEmailsGetTemplates** +> []CustomEmailTemplate CustomEmailsGetTemplates(ctx, ) +List custom email templates + +Get the list of custom email templates + +### Required Parameters +This endpoint does not need any parameter. + +### Return type + +[**[]CustomEmailTemplate**](CustomEmailTemplate.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **CustomEmailsRead** +> CustomEmail CustomEmailsRead(ctx, customEmailType, optional) +Get custom email configuration + +Get the custom email configuration for the specified custom email type + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **customEmailType** | **string**| | + **optional** | ***CustomEmailsApiCustomEmailsReadOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a CustomEmailsApiCustomEmailsReadOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **xOrgId** | **optional.String**| Organization identifier that can be obtained from console settings. | + +### Return type + +[**CustomEmail**](CustomEmail.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **CustomEmailsUpdate** +> CustomEmail CustomEmailsUpdate(ctx, customEmailType, optional) +Update custom email configuration + +Update the custom email configuration for the specified custom email type + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **customEmailType** | **string**| | + **optional** | ***CustomEmailsApiCustomEmailsUpdateOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a CustomEmailsApiCustomEmailsUpdateOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **body** | [**optional.Interface of CustomEmail**](CustomEmail.md)| | + **xOrgId** | **optional.**| Organization identifier that can be obtained from console settings. | + +### Return type + +[**CustomEmail**](CustomEmail.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/Dep.md b/jcapiv2/docs/Dep.md new file mode 100644 index 0000000..6b7a640 --- /dev/null +++ b/jcapiv2/docs/Dep.md @@ -0,0 +1,11 @@ +# Dep + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**EnableZeroTouchEnrollment** | **bool** | A toggle to determine if DEP registered devices should go through JumpCloud Zero Touch Enrollment. | [optional] [default to null] +**SetupAssistantOptions** | [**[]DepSetupAssistantOption**](DEPSetupAssistantOption.md) | | [optional] [default to null] +**WelcomeScreen** | [***DepWelcomeScreen**](DEPWelcomeScreen.md) | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/DepSetupAssistantOption.md b/jcapiv2/docs/DepSetupAssistantOption.md new file mode 100644 index 0000000..7fa1d5c --- /dev/null +++ b/jcapiv2/docs/DepSetupAssistantOption.md @@ -0,0 +1,9 @@ +# DepSetupAssistantOption + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Option** | [***SetupAssistantOption**](SetupAssistantOption.md) | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/DepWelcomeScreen.md b/jcapiv2/docs/DepWelcomeScreen.md new file mode 100644 index 0000000..fe44f39 --- /dev/null +++ b/jcapiv2/docs/DepWelcomeScreen.md @@ -0,0 +1,11 @@ +# DepWelcomeScreen + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Button** | **string** | Text to display on the button on the DEP Welcome Screen. | [optional] [default to null] +**Paragraph** | **string** | A message to display on the DEP Welcome Screen. | [optional] [default to null] +**Title** | **string** | The title to display on the DEP Welcome Screen. | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/DeviceIdEraseBody.md b/jcapiv2/docs/DeviceIdEraseBody.md new file mode 100644 index 0000000..06959a0 --- /dev/null +++ b/jcapiv2/docs/DeviceIdEraseBody.md @@ -0,0 +1,9 @@ +# DeviceIdEraseBody + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Pin** | **string** | 6-digit PIN, required for MacOS, to erase the device | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/DeviceIdLockBody.md b/jcapiv2/docs/DeviceIdLockBody.md new file mode 100644 index 0000000..05441e2 --- /dev/null +++ b/jcapiv2/docs/DeviceIdLockBody.md @@ -0,0 +1,9 @@ +# DeviceIdLockBody + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Pin** | **string** | 6-digit PIN, required for MacOS, to lock the device | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/DeviceIdRestartBody.md b/jcapiv2/docs/DeviceIdRestartBody.md new file mode 100644 index 0000000..bc2fbd6 --- /dev/null +++ b/jcapiv2/docs/DeviceIdRestartBody.md @@ -0,0 +1,9 @@ +# DeviceIdRestartBody + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**KextPaths** | **[]string** | The string to pass when doing a restart and performing a RebuildKernelCache. | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/DirectoriesApi.md b/jcapiv2/docs/DirectoriesApi.md new file mode 100644 index 0000000..a47c40c --- /dev/null +++ b/jcapiv2/docs/DirectoriesApi.md @@ -0,0 +1,46 @@ +# {{classname}} + +All URIs are relative to *https://console.jumpcloud.com/api/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**DirectoriesList**](DirectoriesApi.md#DirectoriesList) | **Get** /directories | List All Directories + +# **DirectoriesList** +> []Directory DirectoriesList(ctx, optional) +List All Directories + +This endpoint returns all active directories (LDAP, O365 Suite, G-Suite). #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **optional** | ***DirectoriesApiDirectoriesListOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a DirectoriesApiDirectoriesListOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **fields** | [**optional.Interface of []string**](string.md)| The comma separated fields included in the returned records. If omitted, the default list of fields will be returned. | + **limit** | **optional.Int32**| The number of records to return at once. Limited to 100. | [default to 10] + **sort** | [**optional.Interface of []string**](string.md)| The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. | + **skip** | **optional.Int32**| The offset into the records to return. | [default to 0] + **xOrgId** | **optional.String**| Organization identifier that can be obtained from console settings. | + +### Return type + +[**[]Directory**](Directory.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/v2/docs/Directory.md b/jcapiv2/docs/Directory.md similarity index 78% rename from v2/docs/Directory.md rename to jcapiv2/docs/Directory.md index dfd9463..b7d72ac 100644 --- a/v2/docs/Directory.md +++ b/jcapiv2/docs/Directory.md @@ -5,8 +5,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **Id** | **string** | The ObjectID of the directory. | [default to null] **Name** | **string** | The name of the directory. | [default to null] +**OAuthStatus** | [***interface{}**](interface{}.md) | the expiry and error status of the bearer token | [optional] [default to null] **Type_** | **string** | The type of directory. | [default to null] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/v2/docs/DuoAccount.md b/jcapiv2/docs/DuoAccount.md similarity index 99% rename from v2/docs/DuoAccount.md rename to jcapiv2/docs/DuoAccount.md index 1948494..443cd36 100644 --- a/v2/docs/DuoAccount.md +++ b/jcapiv2/docs/DuoAccount.md @@ -8,4 +8,3 @@ Name | Type | Description | Notes [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/jcapiv2/docs/DuoApi.md b/jcapiv2/docs/DuoApi.md new file mode 100644 index 0000000..81ff7eb --- /dev/null +++ b/jcapiv2/docs/DuoApi.md @@ -0,0 +1,344 @@ +# {{classname}} + +All URIs are relative to *https://console.jumpcloud.com/api/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**DuoAccountDelete**](DuoApi.md#DuoAccountDelete) | **Delete** /duo/accounts/{id} | Delete a Duo Account +[**DuoAccountGet**](DuoApi.md#DuoAccountGet) | **Get** /duo/accounts/{id} | Get a Duo Acount +[**DuoAccountList**](DuoApi.md#DuoAccountList) | **Get** /duo/accounts | List Duo Accounts +[**DuoAccountPost**](DuoApi.md#DuoAccountPost) | **Post** /duo/accounts | Create Duo Account +[**DuoApplicationDelete**](DuoApi.md#DuoApplicationDelete) | **Delete** /duo/accounts/{account_id}/applications/{application_id} | Delete a Duo Application +[**DuoApplicationGet**](DuoApi.md#DuoApplicationGet) | **Get** /duo/accounts/{account_id}/applications/{application_id} | Get a Duo application +[**DuoApplicationList**](DuoApi.md#DuoApplicationList) | **Get** /duo/accounts/{account_id}/applications | List Duo Applications +[**DuoApplicationPost**](DuoApi.md#DuoApplicationPost) | **Post** /duo/accounts/{account_id}/applications | Create Duo Application +[**DuoApplicationUpdate**](DuoApi.md#DuoApplicationUpdate) | **Put** /duo/accounts/{account_id}/applications/{application_id} | Update Duo Application + +# **DuoAccountDelete** +> DuoAccount DuoAccountDelete(ctx, id, optional) +Delete a Duo Account + +Removes the specified Duo account, an error will be returned if the account has some Duo application used in a protected resource. #### Sample Request ``` curl -X DELETE https://console.jumpcloud.com/api/v2/duo/accounts/{id} \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **id** | **string**| ObjectID of the Duo Account | + **optional** | ***DuoApiDuoAccountDeleteOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a DuoApiDuoAccountDeleteOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **xOrgId** | **optional.String**| Organization identifier that can be obtained from console settings. | + +### Return type + +[**DuoAccount**](DuoAccount.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **DuoAccountGet** +> DuoAccount DuoAccountGet(ctx, id, optional) +Get a Duo Acount + +This endpoint returns a specific Duo account. #### Sample Request ``` curl https://console.jumpcloud.com/api/v2/duo/accounts/{id} \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **id** | **string**| ObjectID of the Duo Account | + **optional** | ***DuoApiDuoAccountGetOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a DuoApiDuoAccountGetOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **xOrgId** | **optional.String**| Organization identifier that can be obtained from console settings. | + +### Return type + +[**DuoAccount**](DuoAccount.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **DuoAccountList** +> []DuoAccount DuoAccountList(ctx, optional) +List Duo Accounts + +This endpoint returns all the Duo accounts for your organization. Note: There can currently only be one Duo account for your organization. #### Sample Request ``` curl https://console.jumpcloud.com/api/v2/duo/accounts \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **optional** | ***DuoApiDuoAccountListOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a DuoApiDuoAccountListOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xOrgId** | **optional.String**| Organization identifier that can be obtained from console settings. | + +### Return type + +[**[]DuoAccount**](DuoAccount.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **DuoAccountPost** +> DuoAccount DuoAccountPost(ctx, optional) +Create Duo Account + +Registers a Duo account for an organization. Only one Duo account will be allowed, in case an organization has a Duo account already a 409 (Conflict) code will be returned. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/duo/accounts \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{}' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **optional** | ***DuoApiDuoAccountPostOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a DuoApiDuoAccountPostOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xOrgId** | **optional.String**| Organization identifier that can be obtained from console settings. | + +### Return type + +[**DuoAccount**](DuoAccount.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **DuoApplicationDelete** +> DuoApplication DuoApplicationDelete(ctx, accountId, applicationId, optional) +Delete a Duo Application + +Deletes the specified Duo application, an error will be returned if the application is used in a protected resource. #### Sample Request ``` curl -X DELETE https://console.jumpcloud.com/api/v2/duo/accounts/{ACCOUNT_ID}/applications/{APPLICATION_ID} \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}'' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **accountId** | **string**| | + **applicationId** | **string**| | + **optional** | ***DuoApiDuoApplicationDeleteOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a DuoApiDuoApplicationDeleteOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + **xOrgId** | **optional.String**| Organization identifier that can be obtained from console settings. | + +### Return type + +[**DuoApplication**](DuoApplication.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **DuoApplicationGet** +> DuoApplication DuoApplicationGet(ctx, accountId, applicationId, optional) +Get a Duo application + +This endpoint returns a specific Duo application that is associated with the specified Duo account. #### Sample Request ``` curl https://console.jumpcloud.com/api/v2/duo/accounts/{ACCOUNT_ID}/applications/{APPLICATION_ID} \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **accountId** | **string**| | + **applicationId** | **string**| | + **optional** | ***DuoApiDuoApplicationGetOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a DuoApiDuoApplicationGetOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + **xOrgId** | **optional.String**| Organization identifier that can be obtained from console settings. | + +### Return type + +[**DuoApplication**](DuoApplication.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **DuoApplicationList** +> []DuoApplication DuoApplicationList(ctx, accountId, optional) +List Duo Applications + +This endpoint returns all the Duo applications for the specified Duo account. Note: There can currently only be one Duo application for your organization. #### Sample Request ``` curl https://console.jumpcloud.com/api/v2/duo/accounts/{ACCOUNT_ID}/applications \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **accountId** | **string**| | + **optional** | ***DuoApiDuoApplicationListOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a DuoApiDuoApplicationListOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **xOrgId** | **optional.String**| Organization identifier that can be obtained from console settings. | + +### Return type + +[**[]DuoApplication**](DuoApplication.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **DuoApplicationPost** +> DuoApplication DuoApplicationPost(ctx, accountId, optional) +Create Duo Application + +Creates a Duo application for your organization and the specified account. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/duo/accounts/{ACCOUNT_ID}/applications \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"name\": \"Application Name\", \"apiHost\": \"api-1234.duosecurity.com\", \"integrationKey\": \"1234\", \"secretKey\": \"5678\" }' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **accountId** | **string**| | + **optional** | ***DuoApiDuoApplicationPostOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a DuoApiDuoApplicationPostOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **body** | [**optional.Interface of DuoApplicationReq**](DuoApplicationReq.md)| | + **xOrgId** | **optional.**| Organization identifier that can be obtained from console settings. | + +### Return type + +[**DuoApplication**](DuoApplication.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **DuoApplicationUpdate** +> DuoApplication DuoApplicationUpdate(ctx, accountId, applicationId, optional) +Update Duo Application + +Updates the specified Duo application. #### Sample Request ``` curl -X PUT https://console.jumpcloud.com/api/v2/duo/accounts/{ACCOUNT_ID}/applications/{APPLICATION_ID} \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"name\": \"Application Name\", \"apiHost\": \"api-1234.duosecurity.com\", \"integrationKey\": \"1234\", \"secretKey\": \"5678\" }' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **accountId** | **string**| | + **applicationId** | **string**| | + **optional** | ***DuoApiDuoApplicationUpdateOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a DuoApiDuoApplicationUpdateOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + **body** | [**optional.Interface of DuoApplicationUpdateReq**](DuoApplicationUpdateReq.md)| | + **xOrgId** | **optional.**| Organization identifier that can be obtained from console settings. | + +### Return type + +[**DuoApplication**](DuoApplication.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/v2/docs/DuoApplication.md b/jcapiv2/docs/DuoApplication.md similarity index 99% rename from v2/docs/DuoApplication.md rename to jcapiv2/docs/DuoApplication.md index 215b480..a50e4a8 100644 --- a/v2/docs/DuoApplication.md +++ b/jcapiv2/docs/DuoApplication.md @@ -10,4 +10,3 @@ Name | Type | Description | Notes [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/v2/docs/DuoApplicationReq.md b/jcapiv2/docs/DuoApplicationReq.md similarity index 99% rename from v2/docs/DuoApplicationReq.md rename to jcapiv2/docs/DuoApplicationReq.md index 9fa6213..4ea5407 100644 --- a/v2/docs/DuoApplicationReq.md +++ b/jcapiv2/docs/DuoApplicationReq.md @@ -10,4 +10,3 @@ Name | Type | Description | Notes [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/jcapiv2/docs/DuoApplicationUpdateReq.md b/jcapiv2/docs/DuoApplicationUpdateReq.md new file mode 100644 index 0000000..b6c46d7 --- /dev/null +++ b/jcapiv2/docs/DuoApplicationUpdateReq.md @@ -0,0 +1,12 @@ +# DuoApplicationUpdateReq + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ApiHost** | **string** | | [default to null] +**IntegrationKey** | **string** | | [default to null] +**Name** | **string** | | [default to null] +**SecretKey** | **string** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/ErrorDetails.md b/jcapiv2/docs/ErrorDetails.md new file mode 100644 index 0000000..22cc820 --- /dev/null +++ b/jcapiv2/docs/ErrorDetails.md @@ -0,0 +1,12 @@ +# ErrorDetails + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Code** | **int32** | HTTP status code | [optional] [default to null] +**Message** | **string** | Error message | [optional] [default to null] +**Status** | **string** | HTTP status description | [optional] [default to null] +**Details** | [**[]interface{}**](interface{}.md) | Describes a list of objects with more detailed information of the given error. Each detail schema is according to one of the messages defined in Google's API: https://github.com/googleapis/googleapis/blob/master/google/rpc/error_details.proto | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/FdeApi.md b/jcapiv2/docs/FdeApi.md new file mode 100644 index 0000000..28986da --- /dev/null +++ b/jcapiv2/docs/FdeApi.md @@ -0,0 +1,44 @@ +# {{classname}} + +All URIs are relative to *https://console.jumpcloud.com/api/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**SystemsGetFDEKey**](FdeApi.md#SystemsGetFDEKey) | **Get** /systems/{system_id}/fdekey | Get System FDE Key + +# **SystemsGetFDEKey** +> Systemfdekey SystemsGetFDEKey(ctx, systemId, optional) +Get System FDE Key + +This endpoint will return the current (latest) fde key saved for a system. + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **systemId** | **string**| | + **optional** | ***FdeApiSystemsGetFDEKeyOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a FdeApiSystemsGetFDEKeyOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **xOrgId** | **optional.String**| Organization identifier that can be obtained from console settings. | + +### Return type + +[**Systemfdekey**](systemfdekey.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/Feature.md b/jcapiv2/docs/Feature.md new file mode 100644 index 0000000..f89d5a2 --- /dev/null +++ b/jcapiv2/docs/Feature.md @@ -0,0 +1,9 @@ +# Feature + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Name** | **string** | The unique identifier for this feature. | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/Filter.md b/jcapiv2/docs/Filter.md new file mode 100644 index 0000000..17ba6ba --- /dev/null +++ b/jcapiv2/docs/Filter.md @@ -0,0 +1,11 @@ +# Filter + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Field** | **string** | Name of field in filter target object. | [default to null] +**Operator** | **string** | Filter comparison operator. | [default to null] +**Value** | **string** | Filter comparison value. | [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/FilterQuery.md b/jcapiv2/docs/FilterQuery.md new file mode 100644 index 0000000..4164261 --- /dev/null +++ b/jcapiv2/docs/FilterQuery.md @@ -0,0 +1,10 @@ +# FilterQuery + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**QueryType** | **string** | | [default to null] +**Filters** | [**[]Filter**](Filter.md) | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/GSuiteApi.md b/jcapiv2/docs/GSuiteApi.md new file mode 100644 index 0000000..4af369a --- /dev/null +++ b/jcapiv2/docs/GSuiteApi.md @@ -0,0 +1,462 @@ +# {{classname}} + +All URIs are relative to *https://console.jumpcloud.com/api/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**GraphGSuiteAssociationsList**](GSuiteApi.md#GraphGSuiteAssociationsList) | **Get** /gsuites/{gsuite_id}/associations | List the associations of a G Suite instance +[**GraphGSuiteAssociationsPost**](GSuiteApi.md#GraphGSuiteAssociationsPost) | **Post** /gsuites/{gsuite_id}/associations | Manage the associations of a G Suite instance +[**GraphGSuiteTraverseUser**](GSuiteApi.md#GraphGSuiteTraverseUser) | **Get** /gsuites/{gsuite_id}/users | List the Users bound to a G Suite instance +[**GraphGSuiteTraverseUserGroup**](GSuiteApi.md#GraphGSuiteTraverseUserGroup) | **Get** /gsuites/{gsuite_id}/usergroups | List the User Groups bound to a G Suite instance +[**GsuitesGet**](GSuiteApi.md#GsuitesGet) | **Get** /gsuites/{id} | Get G Suite +[**GsuitesListImportJumpcloudUsers**](GSuiteApi.md#GsuitesListImportJumpcloudUsers) | **Get** /gsuites/{gsuite_id}/import/jumpcloudusers | Get a list of users in Jumpcloud format to import from a Google Workspace account. +[**GsuitesListImportUsers**](GSuiteApi.md#GsuitesListImportUsers) | **Get** /gsuites/{gsuite_id}/import/users | Get a list of users to import from a G Suite instance +[**GsuitesPatch**](GSuiteApi.md#GsuitesPatch) | **Patch** /gsuites/{id} | Update existing G Suite +[**TranslationRulesGSuiteDelete**](GSuiteApi.md#TranslationRulesGSuiteDelete) | **Delete** /gsuites/{gsuite_id}/translationrules/{id} | Deletes a G Suite translation rule +[**TranslationRulesGSuiteGet**](GSuiteApi.md#TranslationRulesGSuiteGet) | **Get** /gsuites/{gsuite_id}/translationrules/{id} | Gets a specific G Suite translation rule +[**TranslationRulesGSuiteList**](GSuiteApi.md#TranslationRulesGSuiteList) | **Get** /gsuites/{gsuite_id}/translationrules | List all the G Suite Translation Rules +[**TranslationRulesGSuitePost**](GSuiteApi.md#TranslationRulesGSuitePost) | **Post** /gsuites/{gsuite_id}/translationrules | Create a new G Suite Translation Rule + +# **GraphGSuiteAssociationsList** +> []GraphConnection GraphGSuiteAssociationsList(ctx, gsuiteId, targets, optional) +List the associations of a G Suite instance + +This endpoint returns the _direct_ associations of this G Suite instance. A direct association can be a non-homogeneous relationship between 2 different objects, for example G Suite and Users. #### Sample Request ``` curl -X GET 'https://console.jumpcloud.com/api/v2/gsuites/{Gsuite_ID}/associations?targets=user_group \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **gsuiteId** | **string**| ObjectID of the G Suite instance. | + **targets** | [**[]string**](string.md)| Targets which a \"g_suite\" can be associated to. | + **optional** | ***GSuiteApiGraphGSuiteAssociationsListOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a GSuiteApiGraphGSuiteAssociationsListOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + **limit** | **optional.Int32**| The number of records to return at once. Limited to 100. | [default to 10] + **skip** | **optional.Int32**| The offset into the records to return. | [default to 0] + **xOrgId** | **optional.String**| Organization identifier that can be obtained from console settings. | + +### Return type + +[**[]GraphConnection**](GraphConnection.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GraphGSuiteAssociationsPost** +> GraphGSuiteAssociationsPost(ctx, gsuiteId, optional) +Manage the associations of a G Suite instance + +This endpoint returns the _direct_ associations of this G Suite instance. A direct association can be a non-homogeneous relationship between 2 different objects, for example G Suite and Users. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/gsuites/{Gsuite_ID}/associations \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"op\": \"add\", \"type\": \"user_group\", \"id\": \"{Group_ID}\" }' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **gsuiteId** | **string**| ObjectID of the G Suite instance. | + **optional** | ***GSuiteApiGraphGSuiteAssociationsPostOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a GSuiteApiGraphGSuiteAssociationsPostOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **body** | [**optional.Interface of GraphOperationGSuite**](GraphOperationGSuite.md)| | + **xOrgId** | **optional.**| Organization identifier that can be obtained from console settings. | + +### Return type + + (empty response body) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GraphGSuiteTraverseUser** +> []GraphObjectWithPaths GraphGSuiteTraverseUser(ctx, gsuiteId, optional) +List the Users bound to a G Suite instance + +This endpoint will return all Users bound to a G Suite instance, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this G Suite instance to the corresponding User; this array represents all grouping and/or associations that would have to be removed to deprovision the User from this G Suite instance. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/gsuites/{Gsuite_ID}/users \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **gsuiteId** | **string**| ObjectID of the G Suite instance. | + **optional** | ***GSuiteApiGraphGSuiteTraverseUserOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a GSuiteApiGraphGSuiteTraverseUserOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **limit** | **optional.Int32**| The number of records to return at once. Limited to 100. | [default to 10] + **xOrgId** | **optional.String**| Organization identifier that can be obtained from console settings. | + **skip** | **optional.Int32**| The offset into the records to return. | [default to 0] + **filter** | [**optional.Interface of []string**](string.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | + +### Return type + +[**[]GraphObjectWithPaths**](GraphObjectWithPaths.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GraphGSuiteTraverseUserGroup** +> []GraphObjectWithPaths GraphGSuiteTraverseUserGroup(ctx, gsuiteId, optional) +List the User Groups bound to a G Suite instance + +This endpoint will return all User Groups bound to an G Suite instance, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the group's type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this G Suite instance to the corresponding User Group; this array represents all grouping and/or associations that would have to be removed to deprovision the User Group from this G Suite instance. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/gsuites/{GSuite_ID}/usergroups \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **gsuiteId** | **string**| ObjectID of the G Suite instance. | + **optional** | ***GSuiteApiGraphGSuiteTraverseUserGroupOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a GSuiteApiGraphGSuiteTraverseUserGroupOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **limit** | **optional.Int32**| The number of records to return at once. Limited to 100. | [default to 10] + **xOrgId** | **optional.String**| Organization identifier that can be obtained from console settings. | + **skip** | **optional.Int32**| The offset into the records to return. | [default to 0] + **filter** | [**optional.Interface of []string**](string.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | + +### Return type + +[**[]GraphObjectWithPaths**](GraphObjectWithPaths.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GsuitesGet** +> GsuiteOutput GsuitesGet(ctx, id, optional) +Get G Suite + +This endpoint returns a specific G Suite. ##### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/gsuites/{GSUITE_ID} \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **id** | **string**| Unique identifier of the GSuite. | + **optional** | ***GSuiteApiGsuitesGetOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a GSuiteApiGsuitesGetOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **xOrgId** | **optional.String**| Organization identifier that can be obtained from console settings. | + +### Return type + +[**GsuiteOutput**](gsuite-output.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GsuitesListImportJumpcloudUsers** +> InlineResponse2001 GsuitesListImportJumpcloudUsers(ctx, gsuiteId, optional) +Get a list of users in Jumpcloud format to import from a Google Workspace account. + +Lists available G Suite users for import, translated to the Jumpcloud user schema. + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **gsuiteId** | **string**| | + **optional** | ***GSuiteApiGsuitesListImportJumpcloudUsersOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a GSuiteApiGsuitesListImportJumpcloudUsersOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **maxResults** | **optional.Int32**| Google Directory API maximum number of results per page. See https://developers.google.com/admin-sdk/directory/reference/rest/v1/users/list. | + **orderBy** | **optional.String**| Google Directory API sort field parameter. See https://developers.google.com/admin-sdk/directory/reference/rest/v1/users/list. | + **pageToken** | **optional.String**| Google Directory API token used to access the next page of results. See https://developers.google.com/admin-sdk/directory/reference/rest/v1/users/list. | + **query** | **optional.String**| Google Directory API search parameter. See https://developers.google.com/admin-sdk/directory/v1/guides/search-users. | + **sortOrder** | **optional.String**| Google Directory API sort direction parameter. See https://developers.google.com/admin-sdk/directory/reference/rest/v1/users/list. | + +### Return type + +[**InlineResponse2001**](inline_response_200_1.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GsuitesListImportUsers** +> InlineResponse2002 GsuitesListImportUsers(ctx, gsuiteId, optional) +Get a list of users to import from a G Suite instance + +Lists G Suite users available for import. + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **gsuiteId** | **string**| | + **optional** | ***GSuiteApiGsuitesListImportUsersOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a GSuiteApiGsuitesListImportUsersOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **limit** | **optional.Int32**| The number of records to return at once. Limited to 100. | [default to 10] + **maxResults** | **optional.Int32**| Google Directory API maximum number of results per page. See https://developers.google.com/admin-sdk/directory/reference/rest/v1/users/list. | + **orderBy** | **optional.String**| Google Directory API sort field parameter. See https://developers.google.com/admin-sdk/directory/reference/rest/v1/users/list. | + **pageToken** | **optional.String**| Google Directory API token used to access the next page of results. See https://developers.google.com/admin-sdk/directory/reference/rest/v1/users/list. | + **query** | **optional.String**| Google Directory API search parameter. See https://developers.google.com/admin-sdk/directory/v1/guides/search-users. | + **sortOrder** | **optional.String**| Google Directory API sort direction parameter. See https://developers.google.com/admin-sdk/directory/reference/rest/v1/users/list. | + +### Return type + +[**InlineResponse2002**](inline_response_200_2.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GsuitesPatch** +> GsuiteOutput GsuitesPatch(ctx, id, optional) +Update existing G Suite + +This endpoint allows updating some attributes of a G Suite. ##### Sample Request ``` curl -X PATCH https://console.jumpcloud.com/api/v2/gsuites/{GSUITE_ID} \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"userLockoutAction\": \"suspend\", \"userPasswordExpirationAction\": \"maintain\" }' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **id** | **string**| Unique identifier of the GSuite. | + **optional** | ***GSuiteApiGsuitesPatchOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a GSuiteApiGsuitesPatchOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **body** | [**optional.Interface of GsuitePatchInput**](GsuitePatchInput.md)| | + **xOrgId** | **optional.**| Organization identifier that can be obtained from console settings. | + +### Return type + +[**GsuiteOutput**](gsuite-output.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **TranslationRulesGSuiteDelete** +> TranslationRulesGSuiteDelete(ctx, gsuiteId, id) +Deletes a G Suite translation rule + +This endpoint allows you to delete a translation rule for a specific G Suite instance. These rules specify how JumpCloud attributes translate to [G Suite Admin SDK](https://developers.google.com/admin-sdk/directory/) attributes. #### Sample Request ``` curl -X DELETE https://console.jumpcloud.com/api/v2/gsuites/{gsuite_id}/translationrules/{id} \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **gsuiteId** | **string**| | + **id** | **string**| | + +### Return type + + (empty response body) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **TranslationRulesGSuiteGet** +> GSuiteTranslationRule TranslationRulesGSuiteGet(ctx, gsuiteId, id) +Gets a specific G Suite translation rule + +This endpoint returns a specific translation rule for a specific G Suite instance. These rules specify how JumpCloud attributes translate to [G Suite Admin SDK](https://developers.google.com/admin-sdk/directory/) attributes. ###### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/gsuites/{gsuite_id}/translationrules/{id} \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **gsuiteId** | **string**| | + **id** | **string**| | + +### Return type + +[**GSuiteTranslationRule**](GSuiteTranslationRule.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **TranslationRulesGSuiteList** +> []GSuiteTranslationRule TranslationRulesGSuiteList(ctx, gsuiteId, optional) +List all the G Suite Translation Rules + +This endpoint returns all graph translation rules for a specific G Suite instance. These rules specify how JumpCloud attributes translate to [G Suite Admin SDK](https://developers.google.com/admin-sdk/directory/) attributes. ##### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/gsuites/{gsuite_id}/translationrules \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **gsuiteId** | **string**| | + **optional** | ***GSuiteApiTranslationRulesGSuiteListOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a GSuiteApiTranslationRulesGSuiteListOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **fields** | [**optional.Interface of []string**](string.md)| The comma separated fields included in the returned records. If omitted, the default list of fields will be returned. | + **filter** | [**optional.Interface of []string**](string.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | + **limit** | **optional.Int32**| The number of records to return at once. Limited to 100. | [default to 10] + **skip** | **optional.Int32**| The offset into the records to return. | [default to 0] + **sort** | [**optional.Interface of []string**](string.md)| The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. | + +### Return type + +[**[]GSuiteTranslationRule**](GSuiteTranslationRule.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **TranslationRulesGSuitePost** +> GSuiteTranslationRule TranslationRulesGSuitePost(ctx, gsuiteId, optional) +Create a new G Suite Translation Rule + +This endpoint allows you to create a translation rule for a specific G Suite instance. These rules specify how JumpCloud attributes translate to [G Suite Admin SDK](https://developers.google.com/admin-sdk/directory/) attributes. ##### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/gsuites/{gsuite_id}/translationrules \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ {Translation Rule Parameters} }' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **gsuiteId** | **string**| | + **optional** | ***GSuiteApiTranslationRulesGSuitePostOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a GSuiteApiTranslationRulesGSuitePostOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **body** | [**optional.Interface of GSuiteTranslationRuleRequest**](GSuiteTranslationRuleRequest.md)| | + +### Return type + +[**GSuiteTranslationRule**](GSuiteTranslationRule.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/v2/docs/GSuiteBuiltinTranslation.md b/jcapiv2/docs/GSuiteBuiltinTranslation.md similarity index 99% rename from v2/docs/GSuiteBuiltinTranslation.md rename to jcapiv2/docs/GSuiteBuiltinTranslation.md index 86dc314..210529c 100644 --- a/v2/docs/GSuiteBuiltinTranslation.md +++ b/jcapiv2/docs/GSuiteBuiltinTranslation.md @@ -6,4 +6,3 @@ Name | Type | Description | Notes [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/jcapiv2/docs/GSuiteDirectionTranslation.md b/jcapiv2/docs/GSuiteDirectionTranslation.md new file mode 100644 index 0000000..c5201f1 --- /dev/null +++ b/jcapiv2/docs/GSuiteDirectionTranslation.md @@ -0,0 +1,8 @@ +# GSuiteDirectionTranslation + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/GSuiteImportApi.md b/jcapiv2/docs/GSuiteImportApi.md new file mode 100644 index 0000000..bcbbfa5 --- /dev/null +++ b/jcapiv2/docs/GSuiteImportApi.md @@ -0,0 +1,90 @@ +# {{classname}} + +All URIs are relative to *https://console.jumpcloud.com/api/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**GsuitesListImportJumpcloudUsers**](GSuiteImportApi.md#GsuitesListImportJumpcloudUsers) | **Get** /gsuites/{gsuite_id}/import/jumpcloudusers | Get a list of users in Jumpcloud format to import from a Google Workspace account. +[**GsuitesListImportUsers**](GSuiteImportApi.md#GsuitesListImportUsers) | **Get** /gsuites/{gsuite_id}/import/users | Get a list of users to import from a G Suite instance + +# **GsuitesListImportJumpcloudUsers** +> InlineResponse2001 GsuitesListImportJumpcloudUsers(ctx, gsuiteId, optional) +Get a list of users in Jumpcloud format to import from a Google Workspace account. + +Lists available G Suite users for import, translated to the Jumpcloud user schema. + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **gsuiteId** | **string**| | + **optional** | ***GSuiteImportApiGsuitesListImportJumpcloudUsersOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a GSuiteImportApiGsuitesListImportJumpcloudUsersOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **maxResults** | **optional.Int32**| Google Directory API maximum number of results per page. See https://developers.google.com/admin-sdk/directory/reference/rest/v1/users/list. | + **orderBy** | **optional.String**| Google Directory API sort field parameter. See https://developers.google.com/admin-sdk/directory/reference/rest/v1/users/list. | + **pageToken** | **optional.String**| Google Directory API token used to access the next page of results. See https://developers.google.com/admin-sdk/directory/reference/rest/v1/users/list. | + **query** | **optional.String**| Google Directory API search parameter. See https://developers.google.com/admin-sdk/directory/v1/guides/search-users. | + **sortOrder** | **optional.String**| Google Directory API sort direction parameter. See https://developers.google.com/admin-sdk/directory/reference/rest/v1/users/list. | + +### Return type + +[**InlineResponse2001**](inline_response_200_1.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GsuitesListImportUsers** +> InlineResponse2002 GsuitesListImportUsers(ctx, gsuiteId, optional) +Get a list of users to import from a G Suite instance + +Lists G Suite users available for import. + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **gsuiteId** | **string**| | + **optional** | ***GSuiteImportApiGsuitesListImportUsersOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a GSuiteImportApiGsuitesListImportUsersOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **limit** | **optional.Int32**| The number of records to return at once. Limited to 100. | [default to 10] + **maxResults** | **optional.Int32**| Google Directory API maximum number of results per page. See https://developers.google.com/admin-sdk/directory/reference/rest/v1/users/list. | + **orderBy** | **optional.String**| Google Directory API sort field parameter. See https://developers.google.com/admin-sdk/directory/reference/rest/v1/users/list. | + **pageToken** | **optional.String**| Google Directory API token used to access the next page of results. See https://developers.google.com/admin-sdk/directory/reference/rest/v1/users/list. | + **query** | **optional.String**| Google Directory API search parameter. See https://developers.google.com/admin-sdk/directory/v1/guides/search-users. | + **sortOrder** | **optional.String**| Google Directory API sort direction parameter. See https://developers.google.com/admin-sdk/directory/reference/rest/v1/users/list. | + +### Return type + +[**InlineResponse2002**](inline_response_200_2.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/v2/docs/GSuiteTranslationRule.md b/jcapiv2/docs/GSuiteTranslationRule.md similarity index 81% rename from v2/docs/GSuiteTranslationRule.md rename to jcapiv2/docs/GSuiteTranslationRule.md index c9ad401..1c324ec 100644 --- a/v2/docs/GSuiteTranslationRule.md +++ b/jcapiv2/docs/GSuiteTranslationRule.md @@ -4,8 +4,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **BuiltIn** | [***GSuiteBuiltinTranslation**](GSuiteBuiltinTranslation.md) | | [optional] [default to null] +**Direction** | [***GSuiteDirectionTranslation**](GSuiteDirectionTranslation.md) | | [optional] [default to null] **Id** | **string** | ObjectId uniquely identifying a Translation Rule. | [optional] [default to null] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/v2/docs/GSuiteTranslationRuleRequest.md b/jcapiv2/docs/GSuiteTranslationRuleRequest.md similarity index 78% rename from v2/docs/GSuiteTranslationRuleRequest.md rename to jcapiv2/docs/GSuiteTranslationRuleRequest.md index fe2879f..092a587 100644 --- a/v2/docs/GSuiteTranslationRuleRequest.md +++ b/jcapiv2/docs/GSuiteTranslationRuleRequest.md @@ -4,7 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **BuiltIn** | [***GSuiteBuiltinTranslation**](GSuiteBuiltinTranslation.md) | | [optional] [default to null] +**Direction** | [***GSuiteDirectionTranslation**](GSuiteDirectionTranslation.md) | | [optional] [default to null] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/jcapiv2/docs/GraphApi.md b/jcapiv2/docs/GraphApi.md new file mode 100644 index 0000000..f374d67 --- /dev/null +++ b/jcapiv2/docs/GraphApi.md @@ -0,0 +1,3568 @@ +# {{classname}} + +All URIs are relative to *https://console.jumpcloud.com/api/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**GraphActiveDirectoryAssociationsList**](GraphApi.md#GraphActiveDirectoryAssociationsList) | **Get** /activedirectories/{activedirectory_id}/associations | List the associations of an Active Directory instance +[**GraphActiveDirectoryAssociationsPost**](GraphApi.md#GraphActiveDirectoryAssociationsPost) | **Post** /activedirectories/{activedirectory_id}/associations | Manage the associations of an Active Directory instance +[**GraphActiveDirectoryTraverseUser**](GraphApi.md#GraphActiveDirectoryTraverseUser) | **Get** /activedirectories/{activedirectory_id}/users | List the Users bound to an Active Directory instance +[**GraphActiveDirectoryTraverseUserGroup**](GraphApi.md#GraphActiveDirectoryTraverseUserGroup) | **Get** /activedirectories/{activedirectory_id}/usergroups | List the User Groups bound to an Active Directory instance +[**GraphApplicationAssociationsList**](GraphApi.md#GraphApplicationAssociationsList) | **Get** /applications/{application_id}/associations | List the associations of an Application +[**GraphApplicationAssociationsPost**](GraphApi.md#GraphApplicationAssociationsPost) | **Post** /applications/{application_id}/associations | Manage the associations of an Application +[**GraphApplicationTraverseUser**](GraphApi.md#GraphApplicationTraverseUser) | **Get** /applications/{application_id}/users | List the Users bound to an Application +[**GraphApplicationTraverseUserGroup**](GraphApi.md#GraphApplicationTraverseUserGroup) | **Get** /applications/{application_id}/usergroups | List the User Groups bound to an Application +[**GraphCommandAssociationsList**](GraphApi.md#GraphCommandAssociationsList) | **Get** /commands/{command_id}/associations | List the associations of a Command +[**GraphCommandAssociationsPost**](GraphApi.md#GraphCommandAssociationsPost) | **Post** /commands/{command_id}/associations | Manage the associations of a Command +[**GraphCommandTraverseSystem**](GraphApi.md#GraphCommandTraverseSystem) | **Get** /commands/{command_id}/systems | List the Systems bound to a Command +[**GraphCommandTraverseSystemGroup**](GraphApi.md#GraphCommandTraverseSystemGroup) | **Get** /commands/{command_id}/systemgroups | List the System Groups bound to a Command +[**GraphGSuiteAssociationsList**](GraphApi.md#GraphGSuiteAssociationsList) | **Get** /gsuites/{gsuite_id}/associations | List the associations of a G Suite instance +[**GraphGSuiteAssociationsPost**](GraphApi.md#GraphGSuiteAssociationsPost) | **Post** /gsuites/{gsuite_id}/associations | Manage the associations of a G Suite instance +[**GraphGSuiteTraverseUser**](GraphApi.md#GraphGSuiteTraverseUser) | **Get** /gsuites/{gsuite_id}/users | List the Users bound to a G Suite instance +[**GraphGSuiteTraverseUserGroup**](GraphApi.md#GraphGSuiteTraverseUserGroup) | **Get** /gsuites/{gsuite_id}/usergroups | List the User Groups bound to a G Suite instance +[**GraphLdapServerAssociationsList**](GraphApi.md#GraphLdapServerAssociationsList) | **Get** /ldapservers/{ldapserver_id}/associations | List the associations of a LDAP Server +[**GraphLdapServerAssociationsPost**](GraphApi.md#GraphLdapServerAssociationsPost) | **Post** /ldapservers/{ldapserver_id}/associations | Manage the associations of a LDAP Server +[**GraphLdapServerTraverseUser**](GraphApi.md#GraphLdapServerTraverseUser) | **Get** /ldapservers/{ldapserver_id}/users | List the Users bound to a LDAP Server +[**GraphLdapServerTraverseUserGroup**](GraphApi.md#GraphLdapServerTraverseUserGroup) | **Get** /ldapservers/{ldapserver_id}/usergroups | List the User Groups bound to a LDAP Server +[**GraphOffice365AssociationsList**](GraphApi.md#GraphOffice365AssociationsList) | **Get** /office365s/{office365_id}/associations | List the associations of an Office 365 instance +[**GraphOffice365AssociationsPost**](GraphApi.md#GraphOffice365AssociationsPost) | **Post** /office365s/{office365_id}/associations | Manage the associations of an Office 365 instance +[**GraphOffice365TraverseUser**](GraphApi.md#GraphOffice365TraverseUser) | **Get** /office365s/{office365_id}/users | List the Users bound to an Office 365 instance +[**GraphOffice365TraverseUserGroup**](GraphApi.md#GraphOffice365TraverseUserGroup) | **Get** /office365s/{office365_id}/usergroups | List the User Groups bound to an Office 365 instance +[**GraphPolicyAssociationsList**](GraphApi.md#GraphPolicyAssociationsList) | **Get** /policies/{policy_id}/associations | List the associations of a Policy +[**GraphPolicyAssociationsPost**](GraphApi.md#GraphPolicyAssociationsPost) | **Post** /policies/{policy_id}/associations | Manage the associations of a Policy +[**GraphPolicyGroupAssociationsList**](GraphApi.md#GraphPolicyGroupAssociationsList) | **Get** /policygroups/{group_id}/associations | List the associations of a Policy Group. +[**GraphPolicyGroupAssociationsPost**](GraphApi.md#GraphPolicyGroupAssociationsPost) | **Post** /policygroups/{group_id}/associations | Manage the associations of a Policy Group +[**GraphPolicyGroupMembersList**](GraphApi.md#GraphPolicyGroupMembersList) | **Get** /policygroups/{group_id}/members | List the members of a Policy Group +[**GraphPolicyGroupMembersPost**](GraphApi.md#GraphPolicyGroupMembersPost) | **Post** /policygroups/{group_id}/members | Manage the members of a Policy Group +[**GraphPolicyGroupMembership**](GraphApi.md#GraphPolicyGroupMembership) | **Get** /policygroups/{group_id}/membership | List the Policy Group's membership +[**GraphPolicyGroupTraverseSystem**](GraphApi.md#GraphPolicyGroupTraverseSystem) | **Get** /policygroups/{group_id}/systems | List the Systems bound to a Policy Group +[**GraphPolicyGroupTraverseSystemGroup**](GraphApi.md#GraphPolicyGroupTraverseSystemGroup) | **Get** /policygroups/{group_id}/systemgroups | List the System Groups bound to Policy Groups +[**GraphPolicyMemberOf**](GraphApi.md#GraphPolicyMemberOf) | **Get** /policies/{policy_id}/memberof | List the parent Groups of a Policy +[**GraphPolicyTraverseSystem**](GraphApi.md#GraphPolicyTraverseSystem) | **Get** /policies/{policy_id}/systems | List the Systems bound to a Policy +[**GraphPolicyTraverseSystemGroup**](GraphApi.md#GraphPolicyTraverseSystemGroup) | **Get** /policies/{policy_id}/systemgroups | List the System Groups bound to a Policy +[**GraphRadiusServerAssociationsList**](GraphApi.md#GraphRadiusServerAssociationsList) | **Get** /radiusservers/{radiusserver_id}/associations | List the associations of a RADIUS Server +[**GraphRadiusServerAssociationsPost**](GraphApi.md#GraphRadiusServerAssociationsPost) | **Post** /radiusservers/{radiusserver_id}/associations | Manage the associations of a RADIUS Server +[**GraphRadiusServerTraverseUser**](GraphApi.md#GraphRadiusServerTraverseUser) | **Get** /radiusservers/{radiusserver_id}/users | List the Users bound to a RADIUS Server +[**GraphRadiusServerTraverseUserGroup**](GraphApi.md#GraphRadiusServerTraverseUserGroup) | **Get** /radiusservers/{radiusserver_id}/usergroups | List the User Groups bound to a RADIUS Server +[**GraphSoftwareappsAssociationsList**](GraphApi.md#GraphSoftwareappsAssociationsList) | **Get** /softwareapps/{software_app_id}/associations | List the associations of a Software Application +[**GraphSoftwareappsAssociationsPost**](GraphApi.md#GraphSoftwareappsAssociationsPost) | **Post** /softwareapps/{software_app_id}/associations | Manage the associations of a software application. +[**GraphSoftwareappsTraverseSystem**](GraphApi.md#GraphSoftwareappsTraverseSystem) | **Get** /softwareapps/{software_app_id}/systems | List the Systems bound to a Software App. +[**GraphSoftwareappsTraverseSystemGroup**](GraphApi.md#GraphSoftwareappsTraverseSystemGroup) | **Get** /softwareapps/{software_app_id}/systemgroups | List the System Groups bound to a Software App. +[**GraphSystemAssociationsList**](GraphApi.md#GraphSystemAssociationsList) | **Get** /systems/{system_id}/associations | List the associations of a System +[**GraphSystemAssociationsPost**](GraphApi.md#GraphSystemAssociationsPost) | **Post** /systems/{system_id}/associations | Manage associations of a System +[**GraphSystemGroupAssociationsList**](GraphApi.md#GraphSystemGroupAssociationsList) | **Get** /systemgroups/{group_id}/associations | List the associations of a System Group +[**GraphSystemGroupAssociationsPost**](GraphApi.md#GraphSystemGroupAssociationsPost) | **Post** /systemgroups/{group_id}/associations | Manage the associations of a System Group +[**GraphSystemGroupMembersList**](GraphApi.md#GraphSystemGroupMembersList) | **Get** /systemgroups/{group_id}/members | List the members of a System Group +[**GraphSystemGroupMembersPost**](GraphApi.md#GraphSystemGroupMembersPost) | **Post** /systemgroups/{group_id}/members | Manage the members of a System Group +[**GraphSystemGroupMembership**](GraphApi.md#GraphSystemGroupMembership) | **Get** /systemgroups/{group_id}/membership | List the System Group's membership +[**GraphSystemGroupTraverseCommand**](GraphApi.md#GraphSystemGroupTraverseCommand) | **Get** /systemgroups/{group_id}/commands | List the Commands bound to a System Group +[**GraphSystemGroupTraversePolicy**](GraphApi.md#GraphSystemGroupTraversePolicy) | **Get** /systemgroups/{group_id}/policies | List the Policies bound to a System Group +[**GraphSystemGroupTraversePolicyGroup**](GraphApi.md#GraphSystemGroupTraversePolicyGroup) | **Get** /systemgroups/{group_id}/policygroups | List the Policy Groups bound to a System Group +[**GraphSystemGroupTraverseUser**](GraphApi.md#GraphSystemGroupTraverseUser) | **Get** /systemgroups/{group_id}/users | List the Users bound to a System Group +[**GraphSystemGroupTraverseUserGroup**](GraphApi.md#GraphSystemGroupTraverseUserGroup) | **Get** /systemgroups/{group_id}/usergroups | List the User Groups bound to a System Group +[**GraphSystemMemberOf**](GraphApi.md#GraphSystemMemberOf) | **Get** /systems/{system_id}/memberof | List the parent Groups of a System +[**GraphSystemTraverseCommand**](GraphApi.md#GraphSystemTraverseCommand) | **Get** /systems/{system_id}/commands | List the Commands bound to a System +[**GraphSystemTraversePolicy**](GraphApi.md#GraphSystemTraversePolicy) | **Get** /systems/{system_id}/policies | List the Policies bound to a System +[**GraphSystemTraversePolicyGroup**](GraphApi.md#GraphSystemTraversePolicyGroup) | **Get** /systems/{system_id}/policygroups | List the Policy Groups bound to a System +[**GraphSystemTraverseUser**](GraphApi.md#GraphSystemTraverseUser) | **Get** /systems/{system_id}/users | List the Users bound to a System +[**GraphSystemTraverseUserGroup**](GraphApi.md#GraphSystemTraverseUserGroup) | **Get** /systems/{system_id}/usergroups | List the User Groups bound to a System +[**GraphUserAssociationsList**](GraphApi.md#GraphUserAssociationsList) | **Get** /users/{user_id}/associations | List the associations of a User +[**GraphUserAssociationsPost**](GraphApi.md#GraphUserAssociationsPost) | **Post** /users/{user_id}/associations | Manage the associations of a User +[**GraphUserGroupAssociationsList**](GraphApi.md#GraphUserGroupAssociationsList) | **Get** /usergroups/{group_id}/associations | List the associations of a User Group. +[**GraphUserGroupAssociationsPost**](GraphApi.md#GraphUserGroupAssociationsPost) | **Post** /usergroups/{group_id}/associations | Manage the associations of a User Group +[**GraphUserGroupMembersList**](GraphApi.md#GraphUserGroupMembersList) | **Get** /usergroups/{group_id}/members | List the members of a User Group +[**GraphUserGroupMembersPost**](GraphApi.md#GraphUserGroupMembersPost) | **Post** /usergroups/{group_id}/members | Manage the members of a User Group +[**GraphUserGroupMembership**](GraphApi.md#GraphUserGroupMembership) | **Get** /usergroups/{group_id}/membership | List the User Group's membership +[**GraphUserGroupTraverseActiveDirectory**](GraphApi.md#GraphUserGroupTraverseActiveDirectory) | **Get** /usergroups/{group_id}/activedirectories | List the Active Directories bound to a User Group +[**GraphUserGroupTraverseApplication**](GraphApi.md#GraphUserGroupTraverseApplication) | **Get** /usergroups/{group_id}/applications | List the Applications bound to a User Group +[**GraphUserGroupTraverseDirectory**](GraphApi.md#GraphUserGroupTraverseDirectory) | **Get** /usergroups/{group_id}/directories | List the Directories bound to a User Group +[**GraphUserGroupTraverseGSuite**](GraphApi.md#GraphUserGroupTraverseGSuite) | **Get** /usergroups/{group_id}/gsuites | List the G Suite instances bound to a User Group +[**GraphUserGroupTraverseLdapServer**](GraphApi.md#GraphUserGroupTraverseLdapServer) | **Get** /usergroups/{group_id}/ldapservers | List the LDAP Servers bound to a User Group +[**GraphUserGroupTraverseOffice365**](GraphApi.md#GraphUserGroupTraverseOffice365) | **Get** /usergroups/{group_id}/office365s | List the Office 365 instances bound to a User Group +[**GraphUserGroupTraverseRadiusServer**](GraphApi.md#GraphUserGroupTraverseRadiusServer) | **Get** /usergroups/{group_id}/radiusservers | List the RADIUS Servers bound to a User Group +[**GraphUserGroupTraverseSystem**](GraphApi.md#GraphUserGroupTraverseSystem) | **Get** /usergroups/{group_id}/systems | List the Systems bound to a User Group +[**GraphUserGroupTraverseSystemGroup**](GraphApi.md#GraphUserGroupTraverseSystemGroup) | **Get** /usergroups/{group_id}/systemgroups | List the System Groups bound to User Groups +[**GraphUserMemberOf**](GraphApi.md#GraphUserMemberOf) | **Get** /users/{user_id}/memberof | List the parent Groups of a User +[**GraphUserTraverseActiveDirectory**](GraphApi.md#GraphUserTraverseActiveDirectory) | **Get** /users/{user_id}/activedirectories | List the Active Directory instances bound to a User +[**GraphUserTraverseApplication**](GraphApi.md#GraphUserTraverseApplication) | **Get** /users/{user_id}/applications | List the Applications bound to a User +[**GraphUserTraverseDirectory**](GraphApi.md#GraphUserTraverseDirectory) | **Get** /users/{user_id}/directories | List the Directories bound to a User +[**GraphUserTraverseGSuite**](GraphApi.md#GraphUserTraverseGSuite) | **Get** /users/{user_id}/gsuites | List the G Suite instances bound to a User +[**GraphUserTraverseLdapServer**](GraphApi.md#GraphUserTraverseLdapServer) | **Get** /users/{user_id}/ldapservers | List the LDAP servers bound to a User +[**GraphUserTraverseOffice365**](GraphApi.md#GraphUserTraverseOffice365) | **Get** /users/{user_id}/office365s | List the Office 365 instances bound to a User +[**GraphUserTraverseRadiusServer**](GraphApi.md#GraphUserTraverseRadiusServer) | **Get** /users/{user_id}/radiusservers | List the RADIUS Servers bound to a User +[**GraphUserTraverseSystem**](GraphApi.md#GraphUserTraverseSystem) | **Get** /users/{user_id}/systems | List the Systems bound to a User +[**GraphUserTraverseSystemGroup**](GraphApi.md#GraphUserTraverseSystemGroup) | **Get** /users/{user_id}/systemgroups | List the System Groups bound to a User +[**PolicystatusesSystemsList**](GraphApi.md#PolicystatusesSystemsList) | **Get** /systems/{system_id}/policystatuses | List the policy statuses for a system + +# **GraphActiveDirectoryAssociationsList** +> []GraphConnection GraphActiveDirectoryAssociationsList(ctx, activedirectoryId, targets, optional) +List the associations of an Active Directory instance + +This endpoint returns the direct associations of this Active Directory instance. A direct association can be a non-homogeneous relationship between 2 different objects, for example Active Directory and Users. #### Sample Request ``` curl -X GET 'https://console.jumpcloud.com/api/v2/activedirectories/{ActiveDirectory_ID}/associations?targets=user \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **activedirectoryId** | **string**| | + **targets** | [**[]string**](string.md)| Targets which a \"active_directory\" can be associated to. | + **optional** | ***GraphApiGraphActiveDirectoryAssociationsListOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a GraphApiGraphActiveDirectoryAssociationsListOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + **limit** | **optional.Int32**| The number of records to return at once. Limited to 100. | [default to 10] + **skip** | **optional.Int32**| The offset into the records to return. | [default to 0] + **xOrgId** | **optional.String**| Organization identifier that can be obtained from console settings. | + +### Return type + +[**[]GraphConnection**](GraphConnection.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GraphActiveDirectoryAssociationsPost** +> GraphActiveDirectoryAssociationsPost(ctx, activedirectoryId, optional) +Manage the associations of an Active Directory instance + +This endpoint allows you to manage the _direct_ associations of an Active Directory instance. A direct association can be a non-homogeneous relationship between 2 different objects, for example Active Directory and Users. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/activedirectories/{AD_Instance_ID}/associations \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"op\": \"add\", \"type\": \"user\", \"id\": \"{User_ID}\" }' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **activedirectoryId** | **string**| | + **optional** | ***GraphApiGraphActiveDirectoryAssociationsPostOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a GraphApiGraphActiveDirectoryAssociationsPostOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **body** | [**optional.Interface of GraphOperationActiveDirectory**](GraphOperationActiveDirectory.md)| | + **xOrgId** | **optional.**| Organization identifier that can be obtained from console settings. | + +### Return type + + (empty response body) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GraphActiveDirectoryTraverseUser** +> []GraphObjectWithPaths GraphActiveDirectoryTraverseUser(ctx, activedirectoryId, optional) +List the Users bound to an Active Directory instance + +This endpoint will return all Users bound to an Active Directory instance, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this Active Directory instance to the corresponding User; this array represents all grouping and/or associations that would have to be removed to deprovision the User from this Active Directory instance. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/activedirectories/{ActiveDirectory_ID}/users \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **activedirectoryId** | **string**| ObjectID of the Active Directory instance. | + **optional** | ***GraphApiGraphActiveDirectoryTraverseUserOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a GraphApiGraphActiveDirectoryTraverseUserOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **filter** | [**optional.Interface of []string**](string.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | + **limit** | **optional.Int32**| The number of records to return at once. Limited to 100. | [default to 10] + **xOrgId** | **optional.String**| Organization identifier that can be obtained from console settings. | + **skip** | **optional.Int32**| The offset into the records to return. | [default to 0] + +### Return type + +[**[]GraphObjectWithPaths**](GraphObjectWithPaths.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GraphActiveDirectoryTraverseUserGroup** +> []GraphObjectWithPaths GraphActiveDirectoryTraverseUserGroup(ctx, activedirectoryId, optional) +List the User Groups bound to an Active Directory instance + +This endpoint will return all Users Groups bound to an Active Directory instance, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the group's type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this Active Directory instance to the corresponding User Group; this array represents all grouping and/or associations that would have to be removed to deprovision the User Group from this Active Directory instance. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/activedirectories/{ActiveDirectory_ID}/usergroups \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **activedirectoryId** | **string**| ObjectID of the Active Directory instance. | + **optional** | ***GraphApiGraphActiveDirectoryTraverseUserGroupOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a GraphApiGraphActiveDirectoryTraverseUserGroupOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **limit** | **optional.Int32**| The number of records to return at once. Limited to 100. | [default to 10] + **xOrgId** | **optional.String**| Organization identifier that can be obtained from console settings. | + **skip** | **optional.Int32**| The offset into the records to return. | [default to 0] + **filter** | [**optional.Interface of []string**](string.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | + +### Return type + +[**[]GraphObjectWithPaths**](GraphObjectWithPaths.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GraphApplicationAssociationsList** +> []GraphConnection GraphApplicationAssociationsList(ctx, applicationId, targets, optional) +List the associations of an Application + +This endpoint will return the _direct_ associations of an Application. A direct association can be a non-homogeneous relationship between 2 different objects, for example Applications and User Groups. #### Sample Request ``` curl -X GET 'https://console.jumpcloud.com/api/v2/applications/{Application_ID}/associations?targets=user_group \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **applicationId** | **string**| ObjectID of the Application. | + **targets** | [**[]string**](string.md)| Targets which a \"application\" can be associated to. | + **optional** | ***GraphApiGraphApplicationAssociationsListOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a GraphApiGraphApplicationAssociationsListOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + **limit** | **optional.Int32**| The number of records to return at once. Limited to 100. | [default to 10] + **skip** | **optional.Int32**| The offset into the records to return. | [default to 0] + **xOrgId** | **optional.String**| Organization identifier that can be obtained from console settings. | + +### Return type + +[**[]GraphConnection**](GraphConnection.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GraphApplicationAssociationsPost** +> GraphApplicationAssociationsPost(ctx, applicationId, optional) +Manage the associations of an Application + +This endpoint allows you to manage the _direct_ associations of an Application. A direct association can be a non-homogeneous relationship between 2 different objects, for example Application and User Groups. #### Sample Request ``` curl -X POST 'https://console.jumpcloud.com/api/v2/applications/{Application_ID}/associations' \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"op\": \"add\", \"type\": \"user_group\", \"id\": \"{Group_ID}\" }' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **applicationId** | **string**| ObjectID of the Application. | + **optional** | ***GraphApiGraphApplicationAssociationsPostOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a GraphApiGraphApplicationAssociationsPostOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **body** | [**optional.Interface of GraphOperationApplication**](GraphOperationApplication.md)| | + **xOrgId** | **optional.**| Organization identifier that can be obtained from console settings. | + +### Return type + + (empty response body) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GraphApplicationTraverseUser** +> []GraphObjectWithPaths GraphApplicationTraverseUser(ctx, applicationId, optional) +List the Users bound to an Application + +This endpoint will return all Users bound to an Application, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this Application to the corresponding User; this array represents all grouping and/or associations that would have to be removed to deprovision the User from this Application. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/applications/{Application_ID}/users \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **applicationId** | **string**| ObjectID of the Application. | + **optional** | ***GraphApiGraphApplicationTraverseUserOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a GraphApiGraphApplicationTraverseUserOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **limit** | **optional.Int32**| The number of records to return at once. Limited to 100. | [default to 10] + **xOrgId** | **optional.String**| Organization identifier that can be obtained from console settings. | + **skip** | **optional.Int32**| The offset into the records to return. | [default to 0] + **filter** | [**optional.Interface of []string**](string.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | + +### Return type + +[**[]GraphObjectWithPaths**](GraphObjectWithPaths.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GraphApplicationTraverseUserGroup** +> []GraphObjectWithPaths GraphApplicationTraverseUserGroup(ctx, applicationId, optional) +List the User Groups bound to an Application + +This endpoint will return all Users Groups bound to an Application, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the group's type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this Application to the corresponding User Group; this array represents all grouping and/or associations that would have to be removed to deprovision the User Group from this Application. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/applications/{Application_ID}/usergroups \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **applicationId** | **string**| ObjectID of the Application. | + **optional** | ***GraphApiGraphApplicationTraverseUserGroupOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a GraphApiGraphApplicationTraverseUserGroupOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **limit** | **optional.Int32**| The number of records to return at once. Limited to 100. | [default to 10] + **xOrgId** | **optional.String**| Organization identifier that can be obtained from console settings. | + **skip** | **optional.Int32**| The offset into the records to return. | [default to 0] + **filter** | [**optional.Interface of []string**](string.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | + +### Return type + +[**[]GraphObjectWithPaths**](GraphObjectWithPaths.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GraphCommandAssociationsList** +> []GraphConnection GraphCommandAssociationsList(ctx, commandId, targets, optional) +List the associations of a Command + +This endpoint will return the _direct_ associations of this Command. A direct association can be a non-homogeneous relationship between 2 different objects, for example Commands and User Groups. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/commands/{Command_ID}/associations?targets=system_group \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **commandId** | **string**| ObjectID of the Command. | + **targets** | [**[]string**](string.md)| Targets which a \"command\" can be associated to. | + **optional** | ***GraphApiGraphCommandAssociationsListOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a GraphApiGraphCommandAssociationsListOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + **limit** | **optional.Int32**| The number of records to return at once. Limited to 100. | [default to 10] + **skip** | **optional.Int32**| The offset into the records to return. | [default to 0] + **xOrgId** | **optional.String**| Organization identifier that can be obtained from console settings. | + +### Return type + +[**[]GraphConnection**](GraphConnection.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GraphCommandAssociationsPost** +> GraphCommandAssociationsPost(ctx, commandId, optional) +Manage the associations of a Command + +This endpoint will allow you to manage the _direct_ associations of this Command. A direct association can be a non-homogeneous relationship between 2 different objects, for example Commands and User Groups. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/commands/{Command_ID}/associations \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"op\": \"add\", \"type\": \"system_group\", \"id\": \"Group_ID\" }' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **commandId** | **string**| ObjectID of the Command. | + **optional** | ***GraphApiGraphCommandAssociationsPostOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a GraphApiGraphCommandAssociationsPostOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **body** | [**optional.Interface of GraphOperationCommand**](GraphOperationCommand.md)| | + **xOrgId** | **optional.**| Organization identifier that can be obtained from console settings. | + +### Return type + + (empty response body) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GraphCommandTraverseSystem** +> []GraphObjectWithPaths GraphCommandTraverseSystem(ctx, commandId, optional) +List the Systems bound to a Command + +This endpoint will return all Systems bound to a Command, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this Command to the corresponding System; this array represents all grouping and/or associations that would have to be removed to deprovision the System from this Command. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/commands/{Command_ID}/systems \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **commandId** | **string**| ObjectID of the Command. | + **optional** | ***GraphApiGraphCommandTraverseSystemOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a GraphApiGraphCommandTraverseSystemOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **limit** | **optional.Int32**| The number of records to return at once. Limited to 100. | [default to 10] + **xOrgId** | **optional.String**| Organization identifier that can be obtained from console settings. | + **skip** | **optional.Int32**| The offset into the records to return. | [default to 0] + **filter** | [**optional.Interface of []string**](string.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | + +### Return type + +[**[]GraphObjectWithPaths**](GraphObjectWithPaths.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GraphCommandTraverseSystemGroup** +> []GraphObjectWithPaths GraphCommandTraverseSystemGroup(ctx, commandId, optional) +List the System Groups bound to a Command + +This endpoint will return all System Groups bound to a Command, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the group's type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this Command to the corresponding System Group; this array represents all grouping and/or associations that would have to be removed to deprovision the System Group from this Command. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/commands/{Command_ID}/systemgroups \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **commandId** | **string**| ObjectID of the Command. | + **optional** | ***GraphApiGraphCommandTraverseSystemGroupOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a GraphApiGraphCommandTraverseSystemGroupOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **limit** | **optional.Int32**| The number of records to return at once. Limited to 100. | [default to 10] + **xOrgId** | **optional.String**| Organization identifier that can be obtained from console settings. | + **skip** | **optional.Int32**| The offset into the records to return. | [default to 0] + **filter** | [**optional.Interface of []string**](string.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | + +### Return type + +[**[]GraphObjectWithPaths**](GraphObjectWithPaths.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GraphGSuiteAssociationsList** +> []GraphConnection GraphGSuiteAssociationsList(ctx, gsuiteId, targets, optional) +List the associations of a G Suite instance + +This endpoint returns the _direct_ associations of this G Suite instance. A direct association can be a non-homogeneous relationship between 2 different objects, for example G Suite and Users. #### Sample Request ``` curl -X GET 'https://console.jumpcloud.com/api/v2/gsuites/{Gsuite_ID}/associations?targets=user_group \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **gsuiteId** | **string**| ObjectID of the G Suite instance. | + **targets** | [**[]string**](string.md)| Targets which a \"g_suite\" can be associated to. | + **optional** | ***GraphApiGraphGSuiteAssociationsListOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a GraphApiGraphGSuiteAssociationsListOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + **limit** | **optional.Int32**| The number of records to return at once. Limited to 100. | [default to 10] + **skip** | **optional.Int32**| The offset into the records to return. | [default to 0] + **xOrgId** | **optional.String**| Organization identifier that can be obtained from console settings. | + +### Return type + +[**[]GraphConnection**](GraphConnection.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GraphGSuiteAssociationsPost** +> GraphGSuiteAssociationsPost(ctx, gsuiteId, optional) +Manage the associations of a G Suite instance + +This endpoint returns the _direct_ associations of this G Suite instance. A direct association can be a non-homogeneous relationship between 2 different objects, for example G Suite and Users. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/gsuites/{Gsuite_ID}/associations \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"op\": \"add\", \"type\": \"user_group\", \"id\": \"{Group_ID}\" }' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **gsuiteId** | **string**| ObjectID of the G Suite instance. | + **optional** | ***GraphApiGraphGSuiteAssociationsPostOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a GraphApiGraphGSuiteAssociationsPostOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **body** | [**optional.Interface of GraphOperationGSuite**](GraphOperationGSuite.md)| | + **xOrgId** | **optional.**| Organization identifier that can be obtained from console settings. | + +### Return type + + (empty response body) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GraphGSuiteTraverseUser** +> []GraphObjectWithPaths GraphGSuiteTraverseUser(ctx, gsuiteId, optional) +List the Users bound to a G Suite instance + +This endpoint will return all Users bound to a G Suite instance, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this G Suite instance to the corresponding User; this array represents all grouping and/or associations that would have to be removed to deprovision the User from this G Suite instance. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/gsuites/{Gsuite_ID}/users \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **gsuiteId** | **string**| ObjectID of the G Suite instance. | + **optional** | ***GraphApiGraphGSuiteTraverseUserOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a GraphApiGraphGSuiteTraverseUserOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **limit** | **optional.Int32**| The number of records to return at once. Limited to 100. | [default to 10] + **xOrgId** | **optional.String**| Organization identifier that can be obtained from console settings. | + **skip** | **optional.Int32**| The offset into the records to return. | [default to 0] + **filter** | [**optional.Interface of []string**](string.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | + +### Return type + +[**[]GraphObjectWithPaths**](GraphObjectWithPaths.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GraphGSuiteTraverseUserGroup** +> []GraphObjectWithPaths GraphGSuiteTraverseUserGroup(ctx, gsuiteId, optional) +List the User Groups bound to a G Suite instance + +This endpoint will return all User Groups bound to an G Suite instance, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the group's type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this G Suite instance to the corresponding User Group; this array represents all grouping and/or associations that would have to be removed to deprovision the User Group from this G Suite instance. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/gsuites/{GSuite_ID}/usergroups \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **gsuiteId** | **string**| ObjectID of the G Suite instance. | + **optional** | ***GraphApiGraphGSuiteTraverseUserGroupOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a GraphApiGraphGSuiteTraverseUserGroupOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **limit** | **optional.Int32**| The number of records to return at once. Limited to 100. | [default to 10] + **xOrgId** | **optional.String**| Organization identifier that can be obtained from console settings. | + **skip** | **optional.Int32**| The offset into the records to return. | [default to 0] + **filter** | [**optional.Interface of []string**](string.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | + +### Return type + +[**[]GraphObjectWithPaths**](GraphObjectWithPaths.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GraphLdapServerAssociationsList** +> []GraphConnection GraphLdapServerAssociationsList(ctx, ldapserverId, targets, optional) +List the associations of a LDAP Server + +This endpoint returns the _direct_ associations of this LDAP Server. A direct association can be a non-homogeneous relationship between 2 different objects, for example LDAP and Users. #### Sample Request ``` curl -X GET 'https://console.jumpcloud.com/api/v2/ldapservers/{LDAP_ID}/associations?targets=user_group \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **ldapserverId** | **string**| ObjectID of the LDAP Server. | + **targets** | [**[]string**](string.md)| Targets which a \"ldap_server\" can be associated to. | + **optional** | ***GraphApiGraphLdapServerAssociationsListOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a GraphApiGraphLdapServerAssociationsListOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + **limit** | **optional.Int32**| The number of records to return at once. Limited to 100. | [default to 10] + **skip** | **optional.Int32**| The offset into the records to return. | [default to 0] + **xOrgId** | **optional.String**| Organization identifier that can be obtained from console settings. | + +### Return type + +[**[]GraphConnection**](GraphConnection.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GraphLdapServerAssociationsPost** +> GraphLdapServerAssociationsPost(ctx, ldapserverId, optional) +Manage the associations of a LDAP Server + +This endpoint allows you to manage the _direct_ associations of a LDAP Server. A direct association can be a non-homogeneous relationship between 2 different objects, for example LDAP and Users. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/ldapservers/{LDAP_ID}/associations \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"op\": \"add\", \"type\": \"user\", \"id\": \"{User_ID}\" }' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **ldapserverId** | **string**| ObjectID of the LDAP Server. | + **optional** | ***GraphApiGraphLdapServerAssociationsPostOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a GraphApiGraphLdapServerAssociationsPostOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **body** | [**optional.Interface of GraphOperationLdapServer**](GraphOperationLdapServer.md)| | + **xOrgId** | **optional.**| Organization identifier that can be obtained from console settings. | + +### Return type + + (empty response body) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GraphLdapServerTraverseUser** +> []GraphObjectWithPaths GraphLdapServerTraverseUser(ctx, ldapserverId, optional) +List the Users bound to a LDAP Server + +This endpoint will return all Users bound to an LDAP Server, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this LDAP server instance to the corresponding User; this array represents all grouping and/or associations that would have to be removed to deprovision the User from this LDAP server instance. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/ldapservers/{LDAP_ID}/users \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **ldapserverId** | **string**| ObjectID of the LDAP Server. | + **optional** | ***GraphApiGraphLdapServerTraverseUserOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a GraphApiGraphLdapServerTraverseUserOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **limit** | **optional.Int32**| The number of records to return at once. Limited to 100. | [default to 10] + **xOrgId** | **optional.String**| Organization identifier that can be obtained from console settings. | + **skip** | **optional.Int32**| The offset into the records to return. | [default to 0] + **filter** | [**optional.Interface of []string**](string.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | + +### Return type + +[**[]GraphObjectWithPaths**](GraphObjectWithPaths.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GraphLdapServerTraverseUserGroup** +> []GraphObjectWithPaths GraphLdapServerTraverseUserGroup(ctx, ldapserverId, optional) +List the User Groups bound to a LDAP Server + +This endpoint will return all Users Groups bound to a LDAP Server, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the group's type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this LDAP server instance to the corresponding User Group; this array represents all grouping and/or associations that would have to be removed to deprovision the User Group from this LDAP server instance. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/ldapservers/{LDAP_ID}/usergroups \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **ldapserverId** | **string**| ObjectID of the LDAP Server. | + **optional** | ***GraphApiGraphLdapServerTraverseUserGroupOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a GraphApiGraphLdapServerTraverseUserGroupOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **limit** | **optional.Int32**| The number of records to return at once. Limited to 100. | [default to 10] + **xOrgId** | **optional.String**| Organization identifier that can be obtained from console settings. | + **skip** | **optional.Int32**| The offset into the records to return. | [default to 0] + **filter** | [**optional.Interface of []string**](string.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | + +### Return type + +[**[]GraphObjectWithPaths**](GraphObjectWithPaths.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GraphOffice365AssociationsList** +> []GraphConnection GraphOffice365AssociationsList(ctx, office365Id, targets, optional) +List the associations of an Office 365 instance + +This endpoint returns _direct_ associations of an Office 365 instance. A direct association can be a non-homogeneous relationship between 2 different objects, for example Office 365 and Users. #### Sample Request ``` curl -X GET 'https://console.jumpcloud.com/api/v2/office365s/{OFFICE365_ID}/associations?targets=user_group' \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **office365Id** | **string**| ObjectID of the Office 365 instance. | + **targets** | [**[]string**](string.md)| Targets which a \"office_365\" can be associated to. | + **optional** | ***GraphApiGraphOffice365AssociationsListOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a GraphApiGraphOffice365AssociationsListOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + **limit** | **optional.Int32**| The number of records to return at once. Limited to 100. | [default to 10] + **skip** | **optional.Int32**| The offset into the records to return. | [default to 0] + **xOrgId** | **optional.String**| Organization identifier that can be obtained from console settings. | + +### Return type + +[**[]GraphConnection**](GraphConnection.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GraphOffice365AssociationsPost** +> GraphOffice365AssociationsPost(ctx, office365Id, optional) +Manage the associations of an Office 365 instance + +This endpoint allows you to manage the _direct_ associations of a Office 365 instance. A direct association can be a non-homogeneous relationship between 2 different objects, for example Office 365 and Users. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/office365s/{OFFICE365_ID}/associations \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"op\": \"add\", \"type\": \"user_group\", \"id\": \"{Group_ID}\" }' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **office365Id** | **string**| ObjectID of the Office 365 instance. | + **optional** | ***GraphApiGraphOffice365AssociationsPostOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a GraphApiGraphOffice365AssociationsPostOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **body** | [**optional.Interface of GraphOperationOffice365**](GraphOperationOffice365.md)| | + **xOrgId** | **optional.**| Organization identifier that can be obtained from console settings. | + +### Return type + + (empty response body) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GraphOffice365TraverseUser** +> []GraphObjectWithPaths GraphOffice365TraverseUser(ctx, office365Id, optional) +List the Users bound to an Office 365 instance + +This endpoint will return all Users bound to an Office 365 instance, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this Office 365 instance to the corresponding User; this array represents all grouping and/or associations that would have to be removed to deprovision the User from this Office 365 instance. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/office365s/{OFFICE365_ID}/users \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **office365Id** | **string**| ObjectID of the Office 365 suite. | + **optional** | ***GraphApiGraphOffice365TraverseUserOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a GraphApiGraphOffice365TraverseUserOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **limit** | **optional.Int32**| The number of records to return at once. Limited to 100. | [default to 10] + **xOrgId** | **optional.String**| Organization identifier that can be obtained from console settings. | + **skip** | **optional.Int32**| The offset into the records to return. | [default to 0] + **filter** | [**optional.Interface of []string**](string.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | + +### Return type + +[**[]GraphObjectWithPaths**](GraphObjectWithPaths.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GraphOffice365TraverseUserGroup** +> []GraphObjectWithPaths GraphOffice365TraverseUserGroup(ctx, office365Id, optional) +List the User Groups bound to an Office 365 instance + +This endpoint will return all Users Groups bound to an Office 365 instance, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the group's type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this Office 365 instance to the corresponding User Group; this array represents all grouping and/or associations that would have to be removed to deprovision the User Group from this Office 365 instance. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/office365s/{OFFICE365_ID/usergroups \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **office365Id** | **string**| ObjectID of the Office 365 suite. | + **optional** | ***GraphApiGraphOffice365TraverseUserGroupOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a GraphApiGraphOffice365TraverseUserGroupOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **limit** | **optional.Int32**| The number of records to return at once. Limited to 100. | [default to 10] + **xOrgId** | **optional.String**| Organization identifier that can be obtained from console settings. | + **skip** | **optional.Int32**| The offset into the records to return. | [default to 0] + **filter** | [**optional.Interface of []string**](string.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | + +### Return type + +[**[]GraphObjectWithPaths**](GraphObjectWithPaths.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GraphPolicyAssociationsList** +> []GraphConnection GraphPolicyAssociationsList(ctx, policyId, targets, optional) +List the associations of a Policy + +This endpoint returns the _direct_ associations of a Policy. A direct association can be a non-homogeneous relationship between 2 different objects, for example Policies and Systems. #### Sample Request ``` curl -X GET 'https://console.jumpcloud.com/api/v2/policies/{Policy_ID}/associations?targets=system_group \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **policyId** | **string**| ObjectID of the Policy. | + **targets** | [**[]string**](string.md)| Targets which a \"policy\" can be associated to. | + **optional** | ***GraphApiGraphPolicyAssociationsListOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a GraphApiGraphPolicyAssociationsListOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + **limit** | **optional.Int32**| The number of records to return at once. Limited to 100. | [default to 10] + **skip** | **optional.Int32**| The offset into the records to return. | [default to 0] + **xOrgId** | **optional.String**| Organization identifier that can be obtained from console settings. | + +### Return type + +[**[]GraphConnection**](GraphConnection.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GraphPolicyAssociationsPost** +> GraphPolicyAssociationsPost(ctx, policyId, optional) +Manage the associations of a Policy + +This endpoint allows you to manage the _direct_ associations of a Policy. A direct association can be a non-homogeneous relationship between 2 different objects, for example Policies and Systems. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/policies/{Policy_ID}/associations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"op\": \"add\", \"type\": \"system_group\", \"id\": \"{Group_ID}\" }' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **policyId** | **string**| ObjectID of the Policy. | + **optional** | ***GraphApiGraphPolicyAssociationsPostOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a GraphApiGraphPolicyAssociationsPostOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **body** | [**optional.Interface of GraphOperationPolicy**](GraphOperationPolicy.md)| | + **xOrgId** | **optional.**| Organization identifier that can be obtained from console settings. | + +### Return type + + (empty response body) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GraphPolicyGroupAssociationsList** +> []GraphConnection GraphPolicyGroupAssociationsList(ctx, groupId, targets, optional) +List the associations of a Policy Group. + +This endpoint returns the _direct_ associations of this Policy Group. A direct association can be a non-homogeneous relationship between 2 different objects, for example Policy Groups and Policies. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/policygroups/{GroupID}/associations?targets=system \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **groupId** | **string**| ObjectID of the Policy Group. | + **targets** | [**[]string**](string.md)| Targets which a \"policy_group\" can be associated to. | + **optional** | ***GraphApiGraphPolicyGroupAssociationsListOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a GraphApiGraphPolicyGroupAssociationsListOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + **limit** | **optional.Int32**| The number of records to return at once. Limited to 100. | [default to 10] + **skip** | **optional.Int32**| The offset into the records to return. | [default to 0] + **xOrgId** | **optional.String**| Organization identifier that can be obtained from console settings. | + +### Return type + +[**[]GraphConnection**](GraphConnection.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GraphPolicyGroupAssociationsPost** +> GraphPolicyGroupAssociationsPost(ctx, groupId, optional) +Manage the associations of a Policy Group + +This endpoint manages the _direct_ associations of this Policy Group. A direct association can be a non-homogeneous relationship between 2 different objects, for example Policy Groups and Policies. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/policygroups/{GroupID}/associations \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"op\": \"add\", \"type\": \"system\", \"id\": \"{SystemID}\" }' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **groupId** | **string**| ObjectID of the Policy Group. | + **optional** | ***GraphApiGraphPolicyGroupAssociationsPostOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a GraphApiGraphPolicyGroupAssociationsPostOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **body** | [**optional.Interface of GraphOperationPolicyGroup**](GraphOperationPolicyGroup.md)| | + **xOrgId** | **optional.**| Organization identifier that can be obtained from console settings. | + +### Return type + + (empty response body) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GraphPolicyGroupMembersList** +> []GraphConnection GraphPolicyGroupMembersList(ctx, groupId, optional) +List the members of a Policy Group + +This endpoint returns the Policy members of a Policy Group. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/policygroups/{GroupID}/members \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **groupId** | **string**| ObjectID of the Policy Group. | + **optional** | ***GraphApiGraphPolicyGroupMembersListOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a GraphApiGraphPolicyGroupMembersListOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **limit** | **optional.Int32**| The number of records to return at once. Limited to 100. | [default to 10] + **skip** | **optional.Int32**| The offset into the records to return. | [default to 0] + **xOrgId** | **optional.String**| Organization identifier that can be obtained from console settings. | + +### Return type + +[**[]GraphConnection**](GraphConnection.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GraphPolicyGroupMembersPost** +> GraphPolicyGroupMembersPost(ctx, groupId, optional) +Manage the members of a Policy Group + +This endpoint allows you to manage the Policy members of a Policy Group. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/policygroups/{GroupID}/members \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"op\": \"add\", \"type\": \"policy\", \"id\": \"{Policy_ID}\" }' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **groupId** | **string**| ObjectID of the Policy Group. | + **optional** | ***GraphApiGraphPolicyGroupMembersPostOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a GraphApiGraphPolicyGroupMembersPostOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **body** | [**optional.Interface of GraphOperationPolicyGroupMember**](GraphOperationPolicyGroupMember.md)| | + **xOrgId** | **optional.**| Organization identifier that can be obtained from console settings. | + +### Return type + + (empty response body) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GraphPolicyGroupMembership** +> []GraphObjectWithPaths GraphPolicyGroupMembership(ctx, groupId, optional) +List the Policy Group's membership + +This endpoint returns all Policy members that are a member of this Policy Group. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/policygroups/{GroupID}/membership \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **groupId** | **string**| ObjectID of the Policy Group. | + **optional** | ***GraphApiGraphPolicyGroupMembershipOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a GraphApiGraphPolicyGroupMembershipOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **filter** | [**optional.Interface of []string**](string.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | + **limit** | **optional.Int32**| The number of records to return at once. Limited to 100. | [default to 10] + **skip** | **optional.Int32**| The offset into the records to return. | [default to 0] + **sort** | [**optional.Interface of []string**](string.md)| The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. | + **xOrgId** | **optional.String**| Organization identifier that can be obtained from console settings. | + +### Return type + +[**[]GraphObjectWithPaths**](GraphObjectWithPaths.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GraphPolicyGroupTraverseSystem** +> []GraphObjectWithPaths GraphPolicyGroupTraverseSystem(ctx, groupId, optional) +List the Systems bound to a Policy Group + +This endpoint will return all Systems bound to a Policy Group, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this Policy Group to the corresponding System; this array represents all grouping and/or associations that would have to be removed to deprovision the System from this Policy Group. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/policygroups/{GroupID}/systems \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **groupId** | **string**| ObjectID of the Policy Group. | + **optional** | ***GraphApiGraphPolicyGroupTraverseSystemOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a GraphApiGraphPolicyGroupTraverseSystemOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **limit** | **optional.Int32**| The number of records to return at once. Limited to 100. | [default to 10] + **xOrgId** | **optional.String**| Organization identifier that can be obtained from console settings. | + **skip** | **optional.Int32**| The offset into the records to return. | [default to 0] + **filter** | [**optional.Interface of []string**](string.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | + +### Return type + +[**[]GraphObjectWithPaths**](GraphObjectWithPaths.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GraphPolicyGroupTraverseSystemGroup** +> []GraphObjectWithPaths GraphPolicyGroupTraverseSystemGroup(ctx, groupId, optional) +List the System Groups bound to Policy Groups + +This endpoint will return all System Groups bound to a Policy Group, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this Policy Group to the corresponding System Group; this array represents all grouping and/or associations that would have to be removed to deprovision the System Group from this Policy Group. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/policygroups/{GroupID}/systemgroups \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **groupId** | **string**| ObjectID of the Policy Group. | + **optional** | ***GraphApiGraphPolicyGroupTraverseSystemGroupOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a GraphApiGraphPolicyGroupTraverseSystemGroupOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **limit** | **optional.Int32**| The number of records to return at once. Limited to 100. | [default to 10] + **xOrgId** | **optional.String**| Organization identifier that can be obtained from console settings. | + **skip** | **optional.Int32**| The offset into the records to return. | [default to 0] + **filter** | [**optional.Interface of []string**](string.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | + +### Return type + +[**[]GraphObjectWithPaths**](GraphObjectWithPaths.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GraphPolicyMemberOf** +> []GraphObjectWithPaths GraphPolicyMemberOf(ctx, policyId, optional) +List the parent Groups of a Policy + +This endpoint returns all the Policy Groups a Policy is a member of. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/policies/{Policy_ID}/memberof \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **policyId** | **string**| ObjectID of the Policy. | + **optional** | ***GraphApiGraphPolicyMemberOfOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a GraphApiGraphPolicyMemberOfOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **filter** | [**optional.Interface of []string**](string.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | + **limit** | **optional.Int32**| The number of records to return at once. Limited to 100. | [default to 10] + **skip** | **optional.Int32**| The offset into the records to return. | [default to 0] + **date** | **optional.String**| Current date header for the System Context API | + **authorization** | **optional.String**| Authorization header for the System Context API | + **sort** | [**optional.Interface of []string**](string.md)| The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. | + **xOrgId** | **optional.String**| Organization identifier that can be obtained from console settings. | + +### Return type + +[**[]GraphObjectWithPaths**](GraphObjectWithPaths.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GraphPolicyTraverseSystem** +> []GraphObjectWithPaths GraphPolicyTraverseSystem(ctx, policyId, optional) +List the Systems bound to a Policy + +This endpoint will return all Systems bound to a Policy, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this Policy to the corresponding System; this array represents all grouping and/or associations that would have to be removed to deprovision the System from this Policy. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/policies/{Policy_ID}/systems \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **policyId** | **string**| ObjectID of the Command. | + **optional** | ***GraphApiGraphPolicyTraverseSystemOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a GraphApiGraphPolicyTraverseSystemOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **limit** | **optional.Int32**| The number of records to return at once. Limited to 100. | [default to 10] + **xOrgId** | **optional.String**| Organization identifier that can be obtained from console settings. | + **skip** | **optional.Int32**| The offset into the records to return. | [default to 0] + **filter** | [**optional.Interface of []string**](string.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | + +### Return type + +[**[]GraphObjectWithPaths**](GraphObjectWithPaths.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GraphPolicyTraverseSystemGroup** +> []GraphObjectWithPaths GraphPolicyTraverseSystemGroup(ctx, policyId, optional) +List the System Groups bound to a Policy + +This endpoint will return all Systems Groups bound to a Policy, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the group's type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this Policy to the corresponding System Group; this array represents all grouping and/or associations that would have to be removed to deprovision the System Group from this Policy. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/policies/{Policy_ID}/systemgroups \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **policyId** | **string**| ObjectID of the Command. | + **optional** | ***GraphApiGraphPolicyTraverseSystemGroupOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a GraphApiGraphPolicyTraverseSystemGroupOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **limit** | **optional.Int32**| The number of records to return at once. Limited to 100. | [default to 10] + **xOrgId** | **optional.String**| Organization identifier that can be obtained from console settings. | + **skip** | **optional.Int32**| The offset into the records to return. | [default to 0] + **filter** | [**optional.Interface of []string**](string.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | + +### Return type + +[**[]GraphObjectWithPaths**](GraphObjectWithPaths.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GraphRadiusServerAssociationsList** +> []GraphConnection GraphRadiusServerAssociationsList(ctx, radiusserverId, targets, optional) +List the associations of a RADIUS Server + +This endpoint returns the _direct_ associations of a Radius Server. A direct association can be a non-homogeneous relationship between 2 different objects, for example Radius Servers and Users. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/radiusservers/{RADIUS_ID}/associations?targets=user_group \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **radiusserverId** | **string**| ObjectID of the Radius Server. | + **targets** | [**[]string**](string.md)| Targets which a \"radius_server\" can be associated to. | + **optional** | ***GraphApiGraphRadiusServerAssociationsListOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a GraphApiGraphRadiusServerAssociationsListOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + **limit** | **optional.Int32**| The number of records to return at once. Limited to 100. | [default to 10] + **skip** | **optional.Int32**| The offset into the records to return. | [default to 0] + **xOrgId** | **optional.String**| Organization identifier that can be obtained from console settings. | + +### Return type + +[**[]GraphConnection**](GraphConnection.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GraphRadiusServerAssociationsPost** +> GraphRadiusServerAssociationsPost(ctx, radiusserverId, optional) +Manage the associations of a RADIUS Server + +This endpoint allows you to manage the _direct_ associations of a Radius Server. A direct association can be a non-homogeneous relationship between 2 different objects, for example Radius Servers and Users. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/radiusservers/{RADIUS_ID}/associations \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"type\":\"user\", \"id\":\"{USER_ID}\", \"op\":\"add\" }' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **radiusserverId** | **string**| ObjectID of the Radius Server. | + **optional** | ***GraphApiGraphRadiusServerAssociationsPostOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a GraphApiGraphRadiusServerAssociationsPostOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **body** | [**optional.Interface of GraphOperationRadiusServer**](GraphOperationRadiusServer.md)| | + **xOrgId** | **optional.**| Organization identifier that can be obtained from console settings. | + +### Return type + + (empty response body) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GraphRadiusServerTraverseUser** +> []GraphObjectWithPaths GraphRadiusServerTraverseUser(ctx, radiusserverId, optional) +List the Users bound to a RADIUS Server + +This endpoint will return all Users bound to a RADIUS Server, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this RADIUS server instance to the corresponding User; this array represents all grouping and/or associations that would have to be removed to deprovision the User from this RADIUS server instance. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/ldapservers/{LDAP_ID}/users \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **radiusserverId** | **string**| ObjectID of the Radius Server. | + **optional** | ***GraphApiGraphRadiusServerTraverseUserOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a GraphApiGraphRadiusServerTraverseUserOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **limit** | **optional.Int32**| The number of records to return at once. Limited to 100. | [default to 10] + **xOrgId** | **optional.String**| Organization identifier that can be obtained from console settings. | + **skip** | **optional.Int32**| The offset into the records to return. | [default to 0] + **filter** | [**optional.Interface of []string**](string.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | + +### Return type + +[**[]GraphObjectWithPaths**](GraphObjectWithPaths.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GraphRadiusServerTraverseUserGroup** +> []GraphObjectWithPaths GraphRadiusServerTraverseUserGroup(ctx, radiusserverId, optional) +List the User Groups bound to a RADIUS Server + +This endpoint will return all Users Groups bound to a RADIUS Server, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the group's type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this RADIUS server instance to the corresponding User Group; this array represents all grouping and/or associations that would have to be removed to deprovision the User Group from this RADIUS server instance. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/radiusservers/{RADIUS_ID}/usergroups \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **radiusserverId** | **string**| ObjectID of the Radius Server. | + **optional** | ***GraphApiGraphRadiusServerTraverseUserGroupOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a GraphApiGraphRadiusServerTraverseUserGroupOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **limit** | **optional.Int32**| The number of records to return at once. Limited to 100. | [default to 10] + **xOrgId** | **optional.String**| Organization identifier that can be obtained from console settings. | + **skip** | **optional.Int32**| The offset into the records to return. | [default to 0] + **filter** | [**optional.Interface of []string**](string.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | + +### Return type + +[**[]GraphObjectWithPaths**](GraphObjectWithPaths.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GraphSoftwareappsAssociationsList** +> []GraphConnection GraphSoftwareappsAssociationsList(ctx, softwareAppId, targets, optional) +List the associations of a Software Application + +This endpoint will return the _direct_ associations of a Software Application. A direct association can be a non-homogeneous relationship between 2 different objects, for example Software Application and System Groups. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/softwareapps/{software_app_id}/associations?targets=system_group \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **softwareAppId** | **string**| ObjectID of the Software App. | + **targets** | [**[]string**](string.md)| Targets which a \"software_app\" can be associated to. | + **optional** | ***GraphApiGraphSoftwareappsAssociationsListOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a GraphApiGraphSoftwareappsAssociationsListOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + **limit** | **optional.Int32**| The number of records to return at once. Limited to 100. | [default to 10] + **skip** | **optional.Int32**| The offset into the records to return. | [default to 0] + **xOrgId** | **optional.String**| Organization identifier that can be obtained from console settings. | + +### Return type + +[**[]GraphConnection**](GraphConnection.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GraphSoftwareappsAssociationsPost** +> GraphSoftwareappsAssociationsPost(ctx, softwareAppId, optional) +Manage the associations of a software application. + +This endpoint allows you to associate or disassociate a software application to a system or system group. #### Sample Request ``` $ curl -X POST https://console.jumpcloud.com/api/v2/softwareapps/{software_app_id}/associations \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"id\": \"\", \"op\": \"add\", \"type\": \"system\" }' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **softwareAppId** | **string**| ObjectID of the Software App. | + **optional** | ***GraphApiGraphSoftwareappsAssociationsPostOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a GraphApiGraphSoftwareappsAssociationsPostOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **body** | [**optional.Interface of GraphOperationSoftwareApp**](GraphOperationSoftwareApp.md)| | + **xOrgId** | **optional.**| Organization identifier that can be obtained from console settings. | + +### Return type + + (empty response body) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GraphSoftwareappsTraverseSystem** +> []GraphObjectWithPaths GraphSoftwareappsTraverseSystem(ctx, softwareAppId, optional) +List the Systems bound to a Software App. + +This endpoint will return all Systems bound to a Software App, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this Software App to the corresponding System; this array represents all grouping and/or associations that would have to be removed to deprovision the System from this Software App. See `/associations` endpoint to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/softwareapps/{software_app_id}/systems \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **softwareAppId** | **string**| ObjectID of the Software App. | + **optional** | ***GraphApiGraphSoftwareappsTraverseSystemOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a GraphApiGraphSoftwareappsTraverseSystemOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **limit** | **optional.Int32**| The number of records to return at once. Limited to 100. | [default to 10] + **xOrgId** | **optional.String**| Organization identifier that can be obtained from console settings. | + **skip** | **optional.Int32**| The offset into the records to return. | [default to 0] + **filter** | [**optional.Interface of []string**](string.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | + +### Return type + +[**[]GraphObjectWithPaths**](GraphObjectWithPaths.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GraphSoftwareappsTraverseSystemGroup** +> []GraphObjectWithPaths GraphSoftwareappsTraverseSystemGroup(ctx, softwareAppId, optional) +List the System Groups bound to a Software App. + +This endpoint will return all Systems Groups bound to a Software App, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the group's type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this Software App to the corresponding System Group; this array represents all grouping and/or associations that would have to be removed to deprovision the System Group from this Software App. See `/associations` endpoint to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/softwareapps/{software_app_id}/systemgroups \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **softwareAppId** | **string**| ObjectID of the Software App. | + **optional** | ***GraphApiGraphSoftwareappsTraverseSystemGroupOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a GraphApiGraphSoftwareappsTraverseSystemGroupOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **limit** | **optional.Int32**| The number of records to return at once. Limited to 100. | [default to 10] + **xOrgId** | **optional.String**| Organization identifier that can be obtained from console settings. | + **skip** | **optional.Int32**| The offset into the records to return. | [default to 0] + **filter** | [**optional.Interface of []string**](string.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | + +### Return type + +[**[]GraphObjectWithPaths**](GraphObjectWithPaths.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GraphSystemAssociationsList** +> []GraphConnection GraphSystemAssociationsList(ctx, systemId, targets, optional) +List the associations of a System + +This endpoint returns the _direct_ associations of a System. A direct association can be a non-homogeneous relationship between 2 different objects, for example Systems and Users. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/systems/{System_ID}/associations?targets=user \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **systemId** | **string**| ObjectID of the System. | + **targets** | [**[]string**](string.md)| Targets which a \"system\" can be associated to. | + **optional** | ***GraphApiGraphSystemAssociationsListOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a GraphApiGraphSystemAssociationsListOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + **limit** | **optional.Int32**| The number of records to return at once. Limited to 100. | [default to 10] + **skip** | **optional.Int32**| The offset into the records to return. | [default to 0] + **date** | **optional.String**| Current date header for the System Context API | + **authorization** | **optional.String**| Authorization header for the System Context API | + **xOrgId** | **optional.String**| Organization identifier that can be obtained from console settings. | + +### Return type + +[**[]GraphConnection**](GraphConnection.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GraphSystemAssociationsPost** +> GraphSystemAssociationsPost(ctx, systemId, optional) +Manage associations of a System + +This endpoint allows you to manage the _direct_ associations of a System. A direct association can be a non-homogeneous relationship between 2 different objects, for example Systems and Users. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/systems/{System_ID}/associations \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"attributes\": { \"sudo\": { \"enabled\": true, \"withoutPassword\": false } }, \"op\": \"add\", \"type\": \"user\", \"id\": \"UserID\" }' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **systemId** | **string**| ObjectID of the System. | + **optional** | ***GraphApiGraphSystemAssociationsPostOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a GraphApiGraphSystemAssociationsPostOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **body** | [**optional.Interface of GraphOperationSystem**](GraphOperationSystem.md)| | + **date** | **optional.**| Current date header for the System Context API | + **authorization** | **optional.**| Authorization header for the System Context API | + **xOrgId** | **optional.**| Organization identifier that can be obtained from console settings. | + +### Return type + + (empty response body) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GraphSystemGroupAssociationsList** +> []GraphConnection GraphSystemGroupAssociationsList(ctx, groupId, targets, optional) +List the associations of a System Group + +This endpoint returns the _direct_ associations of a System Group. A direct association can be a non-homogeneous relationship between 2 different objects, for example System Groups and Users. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/systemgroups/{GroupID}/associations?targets=user \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **groupId** | **string**| ObjectID of the System Group. | + **targets** | [**[]string**](string.md)| Targets which a \"system_group\" can be associated to. | + **optional** | ***GraphApiGraphSystemGroupAssociationsListOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a GraphApiGraphSystemGroupAssociationsListOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + **limit** | **optional.Int32**| The number of records to return at once. Limited to 100. | [default to 10] + **skip** | **optional.Int32**| The offset into the records to return. | [default to 0] + **xOrgId** | **optional.String**| Organization identifier that can be obtained from console settings. | + +### Return type + +[**[]GraphConnection**](GraphConnection.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GraphSystemGroupAssociationsPost** +> GraphSystemGroupAssociationsPost(ctx, groupId, optional) +Manage the associations of a System Group + +This endpoint allows you to manage the _direct_ associations of a System Group. A direct association can be a non-homogeneous relationship between 2 different objects, for example System Groups and Users. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/systemgroups/{GroupID}/associations \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"op\": \"add\", \"type\": \"user\", \"id\": \"{UserID}\" }' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **groupId** | **string**| ObjectID of the System Group. | + **optional** | ***GraphApiGraphSystemGroupAssociationsPostOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a GraphApiGraphSystemGroupAssociationsPostOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **body** | [**optional.Interface of GraphOperationSystemGroup**](GraphOperationSystemGroup.md)| | + **xOrgId** | **optional.**| Organization identifier that can be obtained from console settings. | + +### Return type + + (empty response body) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GraphSystemGroupMembersList** +> []GraphConnection GraphSystemGroupMembersList(ctx, groupId, optional) +List the members of a System Group + +This endpoint returns the system members of a System Group. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/systemgroups/{Group_ID}/members \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **groupId** | **string**| ObjectID of the System Group. | + **optional** | ***GraphApiGraphSystemGroupMembersListOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a GraphApiGraphSystemGroupMembersListOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **limit** | **optional.Int32**| The number of records to return at once. Limited to 100. | [default to 10] + **skip** | **optional.Int32**| The offset into the records to return. | [default to 0] + **xOrgId** | **optional.String**| Organization identifier that can be obtained from console settings. | + +### Return type + +[**[]GraphConnection**](GraphConnection.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GraphSystemGroupMembersPost** +> GraphSystemGroupMembersPost(ctx, groupId, optional) +Manage the members of a System Group + +This endpoint allows you to manage the system members of a System Group. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/systemgroups/{Group_ID}/members \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"op\": \"add\", \"type\": \"system\", \"id\": \"{System_ID}\" }' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **groupId** | **string**| ObjectID of the System Group. | + **optional** | ***GraphApiGraphSystemGroupMembersPostOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a GraphApiGraphSystemGroupMembersPostOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **body** | [**optional.Interface of GraphOperationSystemGroupMember**](GraphOperationSystemGroupMember.md)| | + **date** | **optional.**| Current date header for the System Context API | + **authorization** | **optional.**| Authorization header for the System Context API | + **xOrgId** | **optional.**| Organization identifier that can be obtained from console settings. | + +### Return type + + (empty response body) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GraphSystemGroupMembership** +> []GraphObjectWithPaths GraphSystemGroupMembership(ctx, groupId, optional) +List the System Group's membership + +This endpoint returns all Systems that are a member of this System Group. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/systemgroups/{Group_ID/membership \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **groupId** | **string**| ObjectID of the System Group. | + **optional** | ***GraphApiGraphSystemGroupMembershipOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a GraphApiGraphSystemGroupMembershipOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **limit** | **optional.Int32**| The number of records to return at once. Limited to 100. | [default to 10] + **skip** | **optional.Int32**| The offset into the records to return. | [default to 0] + **sort** | [**optional.Interface of []string**](string.md)| The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. | + **filter** | [**optional.Interface of []string**](string.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | + **xOrgId** | **optional.String**| Organization identifier that can be obtained from console settings. | + +### Return type + +[**[]GraphObjectWithPaths**](GraphObjectWithPaths.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GraphSystemGroupTraverseCommand** +> []GraphObjectWithPaths GraphSystemGroupTraverseCommand(ctx, groupId, optional) +List the Commands bound to a System Group + +This endpoint will return all Commands bound to a System Group, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the group's type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this System Group to the corresponding Command; this array represents all grouping and/or associations that would have to be removed to deprovision the Command from this System Group. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/systemgroups/{GroupID}/commands \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **groupId** | **string**| ObjectID of the System Group. | + **optional** | ***GraphApiGraphSystemGroupTraverseCommandOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a GraphApiGraphSystemGroupTraverseCommandOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **limit** | **optional.Int32**| The number of records to return at once. Limited to 100. | [default to 10] + **xOrgId** | **optional.String**| Organization identifier that can be obtained from console settings. | + **skip** | **optional.Int32**| The offset into the records to return. | [default to 0] + **filter** | [**optional.Interface of []string**](string.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | + +### Return type + +[**[]GraphObjectWithPaths**](GraphObjectWithPaths.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GraphSystemGroupTraversePolicy** +> []GraphObjectWithPaths GraphSystemGroupTraversePolicy(ctx, groupId, optional) +List the Policies bound to a System Group + +This endpoint will return all Policies bound to a System Group, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this System Group to the corresponding Policy; this array represents all grouping and/or associations that would have to be removed to deprovision the Policy from this System Group. See `/members` and `/associations` endpoints to manage those collections. This endpoint is not public yet as we haven't finished the code. ##### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/systemgroups/{GroupID}/policies \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **groupId** | **string**| ObjectID of the System Group. | + **optional** | ***GraphApiGraphSystemGroupTraversePolicyOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a GraphApiGraphSystemGroupTraversePolicyOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **limit** | **optional.Int32**| The number of records to return at once. Limited to 100. | [default to 10] + **xOrgId** | **optional.String**| Organization identifier that can be obtained from console settings. | + **skip** | **optional.Int32**| The offset into the records to return. | [default to 0] + **filter** | [**optional.Interface of []string**](string.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | + +### Return type + +[**[]GraphObjectWithPaths**](GraphObjectWithPaths.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GraphSystemGroupTraversePolicyGroup** +> []GraphObjectWithPaths GraphSystemGroupTraversePolicyGroup(ctx, groupId, optional) +List the Policy Groups bound to a System Group + +This endpoint will return all Policy Groups bound to a System Group, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this System Group to the corresponding Policy Group; this array represents all grouping and/or associations that would have to be removed to deprovision the Policy Group from this System Group. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/systemgroups/{GroupID}/policygroups \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **groupId** | **string**| ObjectID of the System Group. | + **optional** | ***GraphApiGraphSystemGroupTraversePolicyGroupOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a GraphApiGraphSystemGroupTraversePolicyGroupOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **limit** | **optional.Int32**| The number of records to return at once. Limited to 100. | [default to 10] + **xOrgId** | **optional.String**| Organization identifier that can be obtained from console settings. | + **skip** | **optional.Int32**| The offset into the records to return. | [default to 0] + **filter** | [**optional.Interface of []string**](string.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | + +### Return type + +[**[]GraphObjectWithPaths**](GraphObjectWithPaths.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GraphSystemGroupTraverseUser** +> []GraphObjectWithPaths GraphSystemGroupTraverseUser(ctx, groupId, optional) +List the Users bound to a System Group + +This endpoint will return all Users bound to a System Group, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this System Group to the corresponding User; this array represents all grouping and/or associations that would have to be removed to deprovision the User from this System Group. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/systemgroups/{GroupID}/users \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **groupId** | **string**| ObjectID of the System Group. | + **optional** | ***GraphApiGraphSystemGroupTraverseUserOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a GraphApiGraphSystemGroupTraverseUserOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **limit** | **optional.Int32**| The number of records to return at once. Limited to 100. | [default to 10] + **xOrgId** | **optional.String**| Organization identifier that can be obtained from console settings. | + **skip** | **optional.Int32**| The offset into the records to return. | [default to 0] + **filter** | [**optional.Interface of []string**](string.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | + +### Return type + +[**[]GraphObjectWithPaths**](GraphObjectWithPaths.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GraphSystemGroupTraverseUserGroup** +> []GraphObjectWithPaths GraphSystemGroupTraverseUserGroup(ctx, groupId, optional) +List the User Groups bound to a System Group + +This endpoint will return all User Groups bound to a System Group, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this System Group to the corresponding User Group; this array represents all grouping and/or associations that would have to be removed to deprovision the User Group from this System Group. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/systemgroups/{GroupID}/usergroups \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **groupId** | **string**| ObjectID of the System Group. | + **optional** | ***GraphApiGraphSystemGroupTraverseUserGroupOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a GraphApiGraphSystemGroupTraverseUserGroupOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **limit** | **optional.Int32**| The number of records to return at once. Limited to 100. | [default to 10] + **xOrgId** | **optional.String**| Organization identifier that can be obtained from console settings. | + **skip** | **optional.Int32**| The offset into the records to return. | [default to 0] + **filter** | [**optional.Interface of []string**](string.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | + +### Return type + +[**[]GraphObjectWithPaths**](GraphObjectWithPaths.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GraphSystemMemberOf** +> []GraphObjectWithPaths GraphSystemMemberOf(ctx, systemId, optional) +List the parent Groups of a System + +This endpoint returns all the System Groups a System is a member of. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/systems/{System_ID}/memberof \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **systemId** | **string**| ObjectID of the System. | + **optional** | ***GraphApiGraphSystemMemberOfOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a GraphApiGraphSystemMemberOfOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **filter** | [**optional.Interface of []string**](string.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | + **limit** | **optional.Int32**| The number of records to return at once. Limited to 100. | [default to 10] + **skip** | **optional.Int32**| The offset into the records to return. | [default to 0] + **date** | **optional.String**| Current date header for the System Context API | + **authorization** | **optional.String**| Authorization header for the System Context API | + **sort** | [**optional.Interface of []string**](string.md)| The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. | + **xOrgId** | **optional.String**| Organization identifier that can be obtained from console settings. | + +### Return type + +[**[]GraphObjectWithPaths**](GraphObjectWithPaths.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GraphSystemTraverseCommand** +> []GraphObjectWithPaths GraphSystemTraverseCommand(ctx, systemId, optional) +List the Commands bound to a System + +This endpoint will return all Commands bound to a System, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this System to the corresponding Command; this array represents all grouping and/or associations that would have to be removed to deprovision the Command from this System. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/systems/{System_ID}/commands \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **systemId** | **string**| ObjectID of the System. | + **optional** | ***GraphApiGraphSystemTraverseCommandOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a GraphApiGraphSystemTraverseCommandOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **limit** | **optional.Int32**| The number of records to return at once. Limited to 100. | [default to 10] + **xOrgId** | **optional.String**| Organization identifier that can be obtained from console settings. | + **skip** | **optional.Int32**| The offset into the records to return. | [default to 0] + **filter** | [**optional.Interface of []string**](string.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | + +### Return type + +[**[]GraphObjectWithPaths**](GraphObjectWithPaths.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GraphSystemTraversePolicy** +> []GraphObjectWithPaths GraphSystemTraversePolicy(ctx, systemId, optional) +List the Policies bound to a System + +This endpoint will return all Policies bound to a System, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this System to the corresponding Policy; this array represents all grouping and/or associations that would have to be removed to deprovision the Policy from this System. See `/members` and `/associations` endpoints to manage those collections. This endpoint is not yet public as we have finish the code. ##### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/{System_ID}/policies \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **systemId** | **string**| ObjectID of the System. | + **optional** | ***GraphApiGraphSystemTraversePolicyOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a GraphApiGraphSystemTraversePolicyOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **limit** | **optional.Int32**| The number of records to return at once. Limited to 100. | [default to 10] + **xOrgId** | **optional.String**| Organization identifier that can be obtained from console settings. | + **skip** | **optional.Int32**| The offset into the records to return. | [default to 0] + **filter** | [**optional.Interface of []string**](string.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | + +### Return type + +[**[]GraphObjectWithPaths**](GraphObjectWithPaths.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GraphSystemTraversePolicyGroup** +> []GraphObjectWithPaths GraphSystemTraversePolicyGroup(ctx, systemId, optional) +List the Policy Groups bound to a System + +This endpoint will return all Policy Groups bound to a System, either directly or indirectly essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this System to the corresponding Policy Group; this array represents all grouping and/or associations that would have to be removed to deprovision the Policy Group from this System. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/systems/{System_ID}/policygroups \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **systemId** | **string**| ObjectID of the System. | + **optional** | ***GraphApiGraphSystemTraversePolicyGroupOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a GraphApiGraphSystemTraversePolicyGroupOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **limit** | **optional.Int32**| The number of records to return at once. Limited to 100. | [default to 10] + **xOrgId** | **optional.String**| Organization identifier that can be obtained from console settings. | + **skip** | **optional.Int32**| The offset into the records to return. | [default to 0] + **date** | **optional.String**| Current date header for the System Context API | + **authorization** | **optional.String**| Authorization header for the System Context API | + **filter** | [**optional.Interface of []string**](string.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | + +### Return type + +[**[]GraphObjectWithPaths**](GraphObjectWithPaths.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GraphSystemTraverseUser** +> []GraphObjectWithPaths GraphSystemTraverseUser(ctx, systemId, optional) +List the Users bound to a System + +This endpoint will return all Users bound to a System, either directly or indirectly essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this System to the corresponding User; this array represents all grouping and/or associations that would have to be removed to deprovision the User from this System. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/systems/{System_ID}/users \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **systemId** | **string**| ObjectID of the System. | + **optional** | ***GraphApiGraphSystemTraverseUserOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a GraphApiGraphSystemTraverseUserOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **limit** | **optional.Int32**| The number of records to return at once. Limited to 100. | [default to 10] + **xOrgId** | **optional.String**| Organization identifier that can be obtained from console settings. | + **skip** | **optional.Int32**| The offset into the records to return. | [default to 0] + **date** | **optional.String**| Current date header for the System Context API | + **authorization** | **optional.String**| Authorization header for the System Context API | + **filter** | [**optional.Interface of []string**](string.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | + +### Return type + +[**[]GraphObjectWithPaths**](GraphObjectWithPaths.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GraphSystemTraverseUserGroup** +> []GraphObjectWithPaths GraphSystemTraverseUserGroup(ctx, systemId, optional) +List the User Groups bound to a System + +This endpoint will return all User Groups bound to a System, either directly or indirectly essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this System to the corresponding User Group; this array represents all grouping and/or associations that would have to be removed to deprovision the User Group from this System. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/systems/{System_ID}/usergroups \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **systemId** | **string**| ObjectID of the System. | + **optional** | ***GraphApiGraphSystemTraverseUserGroupOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a GraphApiGraphSystemTraverseUserGroupOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **limit** | **optional.Int32**| The number of records to return at once. Limited to 100. | [default to 10] + **xOrgId** | **optional.String**| Organization identifier that can be obtained from console settings. | + **skip** | **optional.Int32**| The offset into the records to return. | [default to 0] + **date** | **optional.String**| Current date header for the System Context API | + **authorization** | **optional.String**| Authorization header for the System Context API | + **filter** | [**optional.Interface of []string**](string.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | + +### Return type + +[**[]GraphObjectWithPaths**](GraphObjectWithPaths.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GraphUserAssociationsList** +> []GraphConnection GraphUserAssociationsList(ctx, userId, targets, optional) +List the associations of a User + +This endpoint returns the _direct_ associations of a User. A direct association can be a non-homogeneous relationship between 2 different objects, for example Users and Systems. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/users/{UserID}/associations?targets=system_group \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **userId** | **string**| ObjectID of the User. | + **targets** | [**[]string**](string.md)| Targets which a \"user\" can be associated to. | + **optional** | ***GraphApiGraphUserAssociationsListOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a GraphApiGraphUserAssociationsListOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + **limit** | **optional.Int32**| The number of records to return at once. Limited to 100. | [default to 10] + **skip** | **optional.Int32**| The offset into the records to return. | [default to 0] + **xOrgId** | **optional.String**| Organization identifier that can be obtained from console settings. | + +### Return type + +[**[]GraphConnection**](GraphConnection.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GraphUserAssociationsPost** +> GraphUserAssociationsPost(ctx, userId, optional) +Manage the associations of a User + +This endpoint allows you to manage the _direct_ associations of a User. A direct association can be a non-homogeneous relationship between 2 different objects, for example Users and Systems. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/users/{UserID}/associations \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"attributes\": { \"sudo\": { \"enabled\": true, \"withoutPassword\": false } }, \"op\": \"add\", \"type\": \"system_group\", \"id\": \"{GroupID}\" }' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **userId** | **string**| ObjectID of the User. | + **optional** | ***GraphApiGraphUserAssociationsPostOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a GraphApiGraphUserAssociationsPostOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **body** | [**optional.Interface of GraphOperationUser**](GraphOperationUser.md)| | + **xOrgId** | **optional.**| Organization identifier that can be obtained from console settings. | + +### Return type + + (empty response body) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GraphUserGroupAssociationsList** +> []GraphConnection GraphUserGroupAssociationsList(ctx, groupId, targets, optional) +List the associations of a User Group. + +This endpoint returns the _direct_ associations of this User Group. A direct association can be a non-homogeneous relationship between 2 different objects, for example User Groups and Users. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/usergroups/{GroupID}/associations?targets=system \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **groupId** | **string**| ObjectID of the User Group. | + **targets** | [**[]string**](string.md)| Targets which a \"user_group\" can be associated to. | + **optional** | ***GraphApiGraphUserGroupAssociationsListOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a GraphApiGraphUserGroupAssociationsListOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + **limit** | **optional.Int32**| The number of records to return at once. Limited to 100. | [default to 10] + **skip** | **optional.Int32**| The offset into the records to return. | [default to 0] + **xOrgId** | **optional.String**| Organization identifier that can be obtained from console settings. | + +### Return type + +[**[]GraphConnection**](GraphConnection.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GraphUserGroupAssociationsPost** +> GraphUserGroupAssociationsPost(ctx, groupId, optional) +Manage the associations of a User Group + +This endpoint manages the _direct_ associations of this User Group. A direct association can be a non-homogeneous relationship between 2 different objects, for example User Groups and Users. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/usergroups/{GroupID}/associations \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"op\": \"add\", \"type\": \"system\", \"id\": \"{SystemID}\" }' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **groupId** | **string**| ObjectID of the User Group. | + **optional** | ***GraphApiGraphUserGroupAssociationsPostOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a GraphApiGraphUserGroupAssociationsPostOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **body** | [**optional.Interface of GraphOperationUserGroup**](GraphOperationUserGroup.md)| | + **xOrgId** | **optional.**| Organization identifier that can be obtained from console settings. | + +### Return type + + (empty response body) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GraphUserGroupMembersList** +> []GraphConnection GraphUserGroupMembersList(ctx, groupId, optional) +List the members of a User Group + +This endpoint returns the user members of a User Group. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/usergroups/{GroupID}/members \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **groupId** | **string**| ObjectID of the User Group. | + **optional** | ***GraphApiGraphUserGroupMembersListOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a GraphApiGraphUserGroupMembersListOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **limit** | **optional.Int32**| The number of records to return at once. Limited to 100. | [default to 10] + **skip** | **optional.Int32**| The offset into the records to return. | [default to 0] + **xOrgId** | **optional.String**| Organization identifier that can be obtained from console settings. | + +### Return type + +[**[]GraphConnection**](GraphConnection.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GraphUserGroupMembersPost** +> GraphUserGroupMembersPost(ctx, groupId, optional) +Manage the members of a User Group + +This endpoint allows you to manage the user members of a User Group. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/usergroups/{GroupID}/members \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"op\": \"add\", \"type\": \"user\", \"id\": \"{User_ID}\" }' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **groupId** | **string**| ObjectID of the User Group. | + **optional** | ***GraphApiGraphUserGroupMembersPostOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a GraphApiGraphUserGroupMembersPostOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **body** | [**optional.Interface of GraphOperationUserGroupMember**](GraphOperationUserGroupMember.md)| | + **xOrgId** | **optional.**| Organization identifier that can be obtained from console settings. | + +### Return type + + (empty response body) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GraphUserGroupMembership** +> []GraphObjectWithPaths GraphUserGroupMembership(ctx, groupId, optional) +List the User Group's membership + +This endpoint returns all users members that are a member of this User Group. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/usergroups/{GroupID}/membership \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **groupId** | **string**| ObjectID of the User Group. | + **optional** | ***GraphApiGraphUserGroupMembershipOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a GraphApiGraphUserGroupMembershipOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **filter** | [**optional.Interface of []string**](string.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | + **limit** | **optional.Int32**| The number of records to return at once. Limited to 100. | [default to 10] + **skip** | **optional.Int32**| The offset into the records to return. | [default to 0] + **sort** | [**optional.Interface of []string**](string.md)| The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. | + **xOrgId** | **optional.String**| Organization identifier that can be obtained from console settings. | + +### Return type + +[**[]GraphObjectWithPaths**](GraphObjectWithPaths.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GraphUserGroupTraverseActiveDirectory** +> []GraphObjectWithPaths GraphUserGroupTraverseActiveDirectory(ctx, groupId, optional) +List the Active Directories bound to a User Group + +This endpoint will return all Active Directory Instances bound to a User Group, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this User Group to the corresponding Active Directory; this array represents all grouping and/or associations that would have to be removed to deprovision the Active Directory from this User Group. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/usergroups/{GroupID}/activedirectories \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **groupId** | **string**| ObjectID of the User Group. | + **optional** | ***GraphApiGraphUserGroupTraverseActiveDirectoryOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a GraphApiGraphUserGroupTraverseActiveDirectoryOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **limit** | **optional.Int32**| The number of records to return at once. Limited to 100. | [default to 10] + **xOrgId** | **optional.String**| Organization identifier that can be obtained from console settings. | + **skip** | **optional.Int32**| The offset into the records to return. | [default to 0] + **filter** | [**optional.Interface of []string**](string.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | + +### Return type + +[**[]GraphObjectWithPaths**](GraphObjectWithPaths.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GraphUserGroupTraverseApplication** +> []GraphObjectWithPaths GraphUserGroupTraverseApplication(ctx, groupId, optional) +List the Applications bound to a User Group + +This endpoint will return all Applications bound to a User Group, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this User Group to the corresponding Application; this array represents all grouping and/or associations that would have to be removed to deprovision the Application from this User Group. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/usergroups/{GroupID}/applications \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **groupId** | **string**| ObjectID of the User Group. | + **optional** | ***GraphApiGraphUserGroupTraverseApplicationOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a GraphApiGraphUserGroupTraverseApplicationOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **limit** | **optional.Int32**| The number of records to return at once. Limited to 100. | [default to 10] + **xOrgId** | **optional.String**| Organization identifier that can be obtained from console settings. | + **skip** | **optional.Int32**| The offset into the records to return. | [default to 0] + **filter** | [**optional.Interface of []string**](string.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | + +### Return type + +[**[]GraphObjectWithPaths**](GraphObjectWithPaths.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GraphUserGroupTraverseDirectory** +> []GraphObjectWithPaths GraphUserGroupTraverseDirectory(ctx, groupId, optional) +List the Directories bound to a User Group + +This endpoint will return all Directories bound to a User Group, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this User Group to the corresponding Directory; this array represents all grouping and/or associations that would have to be removed to deprovision the Directories from this User Group. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/usergroups/{GroupID}/directories \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **groupId** | **string**| ObjectID of the User Group. | + **optional** | ***GraphApiGraphUserGroupTraverseDirectoryOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a GraphApiGraphUserGroupTraverseDirectoryOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **limit** | **optional.Int32**| The number of records to return at once. Limited to 100. | [default to 10] + **xOrgId** | **optional.String**| Organization identifier that can be obtained from console settings. | + **skip** | **optional.Int32**| The offset into the records to return. | [default to 0] + **filter** | [**optional.Interface of []string**](string.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | + +### Return type + +[**[]GraphObjectWithPaths**](GraphObjectWithPaths.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GraphUserGroupTraverseGSuite** +> []GraphObjectWithPaths GraphUserGroupTraverseGSuite(ctx, groupId, optional) +List the G Suite instances bound to a User Group + +This endpoint will return all G Suite Instances bound to a User Group, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this User Group to the corresponding G Suite instance; this array represents all grouping and/or associations that would have to be removed to deprovision the G Suite instance from this User Group. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/usergroups/{GroupID/gsuites \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **groupId** | **string**| ObjectID of the User Group. | + **optional** | ***GraphApiGraphUserGroupTraverseGSuiteOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a GraphApiGraphUserGroupTraverseGSuiteOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **limit** | **optional.Int32**| The number of records to return at once. Limited to 100. | [default to 10] + **xOrgId** | **optional.String**| Organization identifier that can be obtained from console settings. | + **skip** | **optional.Int32**| The offset into the records to return. | [default to 0] + **filter** | [**optional.Interface of []string**](string.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | + +### Return type + +[**[]GraphObjectWithPaths**](GraphObjectWithPaths.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GraphUserGroupTraverseLdapServer** +> []GraphObjectWithPaths GraphUserGroupTraverseLdapServer(ctx, groupId, optional) +List the LDAP Servers bound to a User Group + +This endpoint will return all LDAP Servers bound to a User Group, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this User Group to the corresponding LDAP Server; this array represents all grouping and/or associations that would have to be removed to deprovision the LDAP Server from this User Group. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/usergroups/{GroupID}/ldapservers \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **groupId** | **string**| ObjectID of the User Group. | + **optional** | ***GraphApiGraphUserGroupTraverseLdapServerOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a GraphApiGraphUserGroupTraverseLdapServerOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **limit** | **optional.Int32**| The number of records to return at once. Limited to 100. | [default to 10] + **xOrgId** | **optional.String**| Organization identifier that can be obtained from console settings. | + **skip** | **optional.Int32**| The offset into the records to return. | [default to 0] + **filter** | [**optional.Interface of []string**](string.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | + +### Return type + +[**[]GraphObjectWithPaths**](GraphObjectWithPaths.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GraphUserGroupTraverseOffice365** +> []GraphObjectWithPaths GraphUserGroupTraverseOffice365(ctx, groupId, optional) +List the Office 365 instances bound to a User Group + +This endpoint will return all Office 365 instances bound to a User Group, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this User Group to the corresponding Office 365 instance; this array represents all grouping and/or associations that would have to be removed to deprovision the Office 365 instance from this User Group. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/usergroups/{GroupID}/office365s \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **groupId** | **string**| ObjectID of the User Group. | + **optional** | ***GraphApiGraphUserGroupTraverseOffice365Opts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a GraphApiGraphUserGroupTraverseOffice365Opts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **limit** | **optional.Int32**| The number of records to return at once. Limited to 100. | [default to 10] + **xOrgId** | **optional.String**| Organization identifier that can be obtained from console settings. | + **skip** | **optional.Int32**| The offset into the records to return. | [default to 0] + **filter** | [**optional.Interface of []string**](string.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | + +### Return type + +[**[]GraphObjectWithPaths**](GraphObjectWithPaths.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GraphUserGroupTraverseRadiusServer** +> []GraphObjectWithPaths GraphUserGroupTraverseRadiusServer(ctx, groupId, optional) +List the RADIUS Servers bound to a User Group + +This endpoint will return all RADIUS servers bound to a User Group, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this User Group to the corresponding RADIUS Server; this array represents all grouping and/or associations that would have to be removed to deprovision the RADIUS Server from this User Group. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/usergroups/{GroupID}/radiusservers \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **groupId** | **string**| ObjectID of the User Group. | + **optional** | ***GraphApiGraphUserGroupTraverseRadiusServerOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a GraphApiGraphUserGroupTraverseRadiusServerOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **limit** | **optional.Int32**| The number of records to return at once. Limited to 100. | [default to 10] + **xOrgId** | **optional.String**| Organization identifier that can be obtained from console settings. | + **skip** | **optional.Int32**| The offset into the records to return. | [default to 0] + **filter** | [**optional.Interface of []string**](string.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | + +### Return type + +[**[]GraphObjectWithPaths**](GraphObjectWithPaths.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GraphUserGroupTraverseSystem** +> []GraphObjectWithPaths GraphUserGroupTraverseSystem(ctx, groupId, optional) +List the Systems bound to a User Group + +This endpoint will return all Systems bound to a User Group, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this User Group to the corresponding System; this array represents all grouping and/or associations that would have to be removed to deprovision the System from this User Group. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/usergroups/{GroupID}/systems \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **groupId** | **string**| ObjectID of the User Group. | + **optional** | ***GraphApiGraphUserGroupTraverseSystemOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a GraphApiGraphUserGroupTraverseSystemOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **limit** | **optional.Int32**| The number of records to return at once. Limited to 100. | [default to 10] + **xOrgId** | **optional.String**| Organization identifier that can be obtained from console settings. | + **skip** | **optional.Int32**| The offset into the records to return. | [default to 0] + **filter** | [**optional.Interface of []string**](string.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | + +### Return type + +[**[]GraphObjectWithPaths**](GraphObjectWithPaths.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GraphUserGroupTraverseSystemGroup** +> []GraphObjectWithPaths GraphUserGroupTraverseSystemGroup(ctx, groupId, optional) +List the System Groups bound to User Groups + +This endpoint will return all System Groups bound to a User Group, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this User Group to the corresponding System Group; this array represents all grouping and/or associations that would have to be removed to deprovision the System Group from this User Group. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/usergroups/{GroupID}/systemgroups \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **groupId** | **string**| ObjectID of the User Group. | + **optional** | ***GraphApiGraphUserGroupTraverseSystemGroupOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a GraphApiGraphUserGroupTraverseSystemGroupOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **limit** | **optional.Int32**| The number of records to return at once. Limited to 100. | [default to 10] + **xOrgId** | **optional.String**| Organization identifier that can be obtained from console settings. | + **skip** | **optional.Int32**| The offset into the records to return. | [default to 0] + **filter** | [**optional.Interface of []string**](string.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | + +### Return type + +[**[]GraphObjectWithPaths**](GraphObjectWithPaths.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GraphUserMemberOf** +> []GraphObjectWithPaths GraphUserMemberOf(ctx, userId, optional) +List the parent Groups of a User + +This endpoint returns all the User Groups a User is a member of. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/users/{UserID}/memberof \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **userId** | **string**| ObjectID of the User. | + **optional** | ***GraphApiGraphUserMemberOfOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a GraphApiGraphUserMemberOfOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **filter** | [**optional.Interface of []string**](string.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | + **limit** | **optional.Int32**| The number of records to return at once. Limited to 100. | [default to 10] + **skip** | **optional.Int32**| The offset into the records to return. | [default to 0] + **sort** | [**optional.Interface of []string**](string.md)| The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. | + **xOrgId** | **optional.String**| Organization identifier that can be obtained from console settings. | + +### Return type + +[**[]GraphObjectWithPaths**](GraphObjectWithPaths.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GraphUserTraverseActiveDirectory** +> []GraphObjectWithPaths GraphUserTraverseActiveDirectory(ctx, userId, optional) +List the Active Directory instances bound to a User + +This endpoint will return all Active Directory Instances bound to a User, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this User to the corresponding Active Directory instance; this array represents all grouping and/or associations that would have to be removed to deprovision the Active Directory instance from this User. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/users/{UserID}/activedirectories \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **userId** | **string**| ObjectID of the User. | + **optional** | ***GraphApiGraphUserTraverseActiveDirectoryOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a GraphApiGraphUserTraverseActiveDirectoryOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **filter** | [**optional.Interface of []string**](string.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | + **limit** | **optional.Int32**| The number of records to return at once. Limited to 100. | [default to 10] + **xOrgId** | **optional.String**| Organization identifier that can be obtained from console settings. | + **skip** | **optional.Int32**| The offset into the records to return. | [default to 0] + +### Return type + +[**[]GraphObjectWithPaths**](GraphObjectWithPaths.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GraphUserTraverseApplication** +> []GraphObjectWithPaths GraphUserTraverseApplication(ctx, userId, optional) +List the Applications bound to a User + +This endpoint will return all Applications bound to a User, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this User to the corresponding Application; this array represents all grouping and/or associations that would have to be removed to deprovision the Application from this User. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/users/{UserID}/applications \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **userId** | **string**| ObjectID of the User. | + **optional** | ***GraphApiGraphUserTraverseApplicationOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a GraphApiGraphUserTraverseApplicationOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **limit** | **optional.Int32**| The number of records to return at once. Limited to 100. | [default to 10] + **xOrgId** | **optional.String**| Organization identifier that can be obtained from console settings. | + **skip** | **optional.Int32**| The offset into the records to return. | [default to 0] + **filter** | [**optional.Interface of []string**](string.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | + +### Return type + +[**[]GraphObjectWithPaths**](GraphObjectWithPaths.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GraphUserTraverseDirectory** +> []GraphObjectWithPaths GraphUserTraverseDirectory(ctx, userId, optional) +List the Directories bound to a User + +This endpoint will return all Directories bound to a User, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this User to the corresponding Directory; this array represents all grouping and/or associations that would have to be removed to deprovision the Directory from this User. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/users/{UserID}/directories \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **userId** | **string**| ObjectID of the User. | + **optional** | ***GraphApiGraphUserTraverseDirectoryOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a GraphApiGraphUserTraverseDirectoryOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **limit** | **optional.Int32**| The number of records to return at once. Limited to 100. | [default to 10] + **xOrgId** | **optional.String**| Organization identifier that can be obtained from console settings. | + **skip** | **optional.Int32**| The offset into the records to return. | [default to 0] + **filter** | [**optional.Interface of []string**](string.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | + +### Return type + +[**[]GraphObjectWithPaths**](GraphObjectWithPaths.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GraphUserTraverseGSuite** +> []GraphObjectWithPaths GraphUserTraverseGSuite(ctx, userId, optional) +List the G Suite instances bound to a User + +This endpoint will return all G-Suite Instances bound to a User, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this User to the corresponding G Suite instance; this array represents all grouping and/or associations that would have to be removed to deprovision the G Suite instance from this User. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/users/{UserID}/gsuites \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **userId** | **string**| ObjectID of the User. | + **optional** | ***GraphApiGraphUserTraverseGSuiteOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a GraphApiGraphUserTraverseGSuiteOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **limit** | **optional.Int32**| The number of records to return at once. Limited to 100. | [default to 10] + **xOrgId** | **optional.String**| Organization identifier that can be obtained from console settings. | + **skip** | **optional.Int32**| The offset into the records to return. | [default to 0] + **filter** | [**optional.Interface of []string**](string.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | + +### Return type + +[**[]GraphObjectWithPaths**](GraphObjectWithPaths.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GraphUserTraverseLdapServer** +> []GraphObjectWithPaths GraphUserTraverseLdapServer(ctx, userId, optional) +List the LDAP servers bound to a User + +This endpoint will return all LDAP Servers bound to a User, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this User to the corresponding LDAP Server; this array represents all grouping and/or associations that would have to be removed to deprovision the LDAP Server from this User. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/users/{UserID}/ldapservers \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **userId** | **string**| ObjectID of the User. | + **optional** | ***GraphApiGraphUserTraverseLdapServerOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a GraphApiGraphUserTraverseLdapServerOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **limit** | **optional.Int32**| The number of records to return at once. Limited to 100. | [default to 10] + **xOrgId** | **optional.String**| Organization identifier that can be obtained from console settings. | + **skip** | **optional.Int32**| The offset into the records to return. | [default to 0] + **filter** | [**optional.Interface of []string**](string.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | + +### Return type + +[**[]GraphObjectWithPaths**](GraphObjectWithPaths.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GraphUserTraverseOffice365** +> []GraphObjectWithPaths GraphUserTraverseOffice365(ctx, userId, optional) +List the Office 365 instances bound to a User + +This endpoint will return all Office 365 Instances bound to a User, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this User to the corresponding Office 365 instance; this array represents all grouping and/or associations that would have to be removed to deprovision the Office 365 instance from this User. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/users/{UserID}/office365s \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **userId** | **string**| ObjectID of the User. | + **optional** | ***GraphApiGraphUserTraverseOffice365Opts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a GraphApiGraphUserTraverseOffice365Opts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **limit** | **optional.Int32**| The number of records to return at once. Limited to 100. | [default to 10] + **xOrgId** | **optional.String**| Organization identifier that can be obtained from console settings. | + **skip** | **optional.Int32**| The offset into the records to return. | [default to 0] + **filter** | [**optional.Interface of []string**](string.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | + +### Return type + +[**[]GraphObjectWithPaths**](GraphObjectWithPaths.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GraphUserTraverseRadiusServer** +> []GraphObjectWithPaths GraphUserTraverseRadiusServer(ctx, userId, optional) +List the RADIUS Servers bound to a User + +This endpoint will return all RADIUS Servers bound to a User, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this User to the corresponding RADIUS Server; this array represents all grouping and/or associations that would have to be removed to deprovision the RADIUS Server from this User. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/users/{UserID}/radiusservers \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **userId** | **string**| ObjectID of the User. | + **optional** | ***GraphApiGraphUserTraverseRadiusServerOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a GraphApiGraphUserTraverseRadiusServerOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **limit** | **optional.Int32**| The number of records to return at once. Limited to 100. | [default to 10] + **xOrgId** | **optional.String**| Organization identifier that can be obtained from console settings. | + **skip** | **optional.Int32**| The offset into the records to return. | [default to 0] + **filter** | [**optional.Interface of []string**](string.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | + +### Return type + +[**[]GraphObjectWithPaths**](GraphObjectWithPaths.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GraphUserTraverseSystem** +> []GraphObjectWithPaths GraphUserTraverseSystem(ctx, userId, optional) +List the Systems bound to a User + +This endpoint will return all Systems bound to a User, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this User to the corresponding System; this array represents all grouping and/or associations that would have to be removed to deprovision the System from this User. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/users/{UserID}/systems\\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **userId** | **string**| ObjectID of the User. | + **optional** | ***GraphApiGraphUserTraverseSystemOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a GraphApiGraphUserTraverseSystemOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **limit** | **optional.Int32**| The number of records to return at once. Limited to 100. | [default to 10] + **xOrgId** | **optional.String**| Organization identifier that can be obtained from console settings. | + **skip** | **optional.Int32**| The offset into the records to return. | [default to 0] + **filter** | [**optional.Interface of []string**](string.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | + +### Return type + +[**[]GraphObjectWithPaths**](GraphObjectWithPaths.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GraphUserTraverseSystemGroup** +> []GraphObjectWithPaths GraphUserTraverseSystemGroup(ctx, userId, optional) +List the System Groups bound to a User + +This endpoint will return all System Groups bound to a User, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this User to the corresponding System Group; this array represents all grouping and/or associations that would have to be removed to deprovision the System Group from this User. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/users/{UserID}/systemgroups\\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **userId** | **string**| ObjectID of the User. | + **optional** | ***GraphApiGraphUserTraverseSystemGroupOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a GraphApiGraphUserTraverseSystemGroupOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **limit** | **optional.Int32**| The number of records to return at once. Limited to 100. | [default to 10] + **xOrgId** | **optional.String**| Organization identifier that can be obtained from console settings. | + **skip** | **optional.Int32**| The offset into the records to return. | [default to 0] + **filter** | [**optional.Interface of []string**](string.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | + +### Return type + +[**[]GraphObjectWithPaths**](GraphObjectWithPaths.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **PolicystatusesSystemsList** +> []PolicyResult PolicystatusesSystemsList(ctx, systemId, optional) +List the policy statuses for a system + +This endpoint returns the policy results for a particular system. ##### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/systems/{System_ID}/policystatuses \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **systemId** | **string**| ObjectID of the System. | + **optional** | ***GraphApiPolicystatusesSystemsListOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a GraphApiPolicystatusesSystemsListOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **fields** | [**optional.Interface of []string**](string.md)| The comma separated fields included in the returned records. If omitted, the default list of fields will be returned. | + **filter** | [**optional.Interface of []string**](string.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | + **limit** | **optional.Int32**| The number of records to return at once. Limited to 100. | [default to 10] + **skip** | **optional.Int32**| The offset into the records to return. | [default to 0] + **sort** | [**optional.Interface of []string**](string.md)| The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. | + **xOrgId** | **optional.String**| Organization identifier that can be obtained from console settings. | + +### Return type + +[**[]PolicyResult**](PolicyResult.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/GraphAttributeLdapGroups.md b/jcapiv2/docs/GraphAttributeLdapGroups.md new file mode 100644 index 0000000..9bfa5a3 --- /dev/null +++ b/jcapiv2/docs/GraphAttributeLdapGroups.md @@ -0,0 +1,9 @@ +# GraphAttributeLdapGroups + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**LdapGroups** | [**[]LdapGroup**](LdapGroup.md) | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/GraphAttributePosixGroups.md b/jcapiv2/docs/GraphAttributePosixGroups.md new file mode 100644 index 0000000..92889a7 --- /dev/null +++ b/jcapiv2/docs/GraphAttributePosixGroups.md @@ -0,0 +1,9 @@ +# GraphAttributePosixGroups + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**PosixGroups** | [**[]GraphAttributePosixGroupsPosixGroups**](GraphAttributePosixGroups_posixGroups.md) | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/GraphAttributePosixGroupsPosixGroups.md b/jcapiv2/docs/GraphAttributePosixGroupsPosixGroups.md new file mode 100644 index 0000000..de7b976 --- /dev/null +++ b/jcapiv2/docs/GraphAttributePosixGroupsPosixGroups.md @@ -0,0 +1,10 @@ +# GraphAttributePosixGroupsPosixGroups + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Id** | **int32** | | [default to null] +**Name** | **string** | | [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/GraphAttributeRadius.md b/jcapiv2/docs/GraphAttributeRadius.md new file mode 100644 index 0000000..9fc40bf --- /dev/null +++ b/jcapiv2/docs/GraphAttributeRadius.md @@ -0,0 +1,9 @@ +# GraphAttributeRadius + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Radius** | [***GraphAttributeRadiusRadius**](GraphAttributeRadius_radius.md) | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/GraphAttributeRadiusRadius.md b/jcapiv2/docs/GraphAttributeRadiusRadius.md new file mode 100644 index 0000000..ce4e8d3 --- /dev/null +++ b/jcapiv2/docs/GraphAttributeRadiusRadius.md @@ -0,0 +1,9 @@ +# GraphAttributeRadiusRadius + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Reply** | [**[]GraphAttributeRadiusRadiusReply**](GraphAttributeRadius_radius_reply.md) | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/GraphAttributeRadiusRadiusReply.md b/jcapiv2/docs/GraphAttributeRadiusRadiusReply.md new file mode 100644 index 0000000..af28352 --- /dev/null +++ b/jcapiv2/docs/GraphAttributeRadiusRadiusReply.md @@ -0,0 +1,10 @@ +# GraphAttributeRadiusRadiusReply + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Name** | **string** | | [default to null] +**Value** | **string** | | [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/GraphAttributeSambaEnabled.md b/jcapiv2/docs/GraphAttributeSambaEnabled.md new file mode 100644 index 0000000..b564e1c --- /dev/null +++ b/jcapiv2/docs/GraphAttributeSambaEnabled.md @@ -0,0 +1,9 @@ +# GraphAttributeSambaEnabled + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**SambaEnabled** | **bool** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/GraphAttributeSudo.md b/jcapiv2/docs/GraphAttributeSudo.md new file mode 100644 index 0000000..60a1d9a --- /dev/null +++ b/jcapiv2/docs/GraphAttributeSudo.md @@ -0,0 +1,9 @@ +# GraphAttributeSudo + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Sudo** | [***GraphAttributeSudoSudo**](GraphAttributeSudo_sudo.md) | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/GraphAttributeSudoSudo.md b/jcapiv2/docs/GraphAttributeSudoSudo.md new file mode 100644 index 0000000..cff8d05 --- /dev/null +++ b/jcapiv2/docs/GraphAttributeSudoSudo.md @@ -0,0 +1,10 @@ +# GraphAttributeSudoSudo + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Enabled** | **bool** | Enables sudo | [default to null] +**WithoutPassword** | **bool** | Enable sudo without password (requires 'enabled' to be true) | [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/GraphAttributes.md b/jcapiv2/docs/GraphAttributes.md new file mode 100644 index 0000000..f3b28e6 --- /dev/null +++ b/jcapiv2/docs/GraphAttributes.md @@ -0,0 +1,8 @@ +# GraphAttributes + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/v2/docs/GraphConnection.md b/jcapiv2/docs/GraphConnection.md similarity index 82% rename from v2/docs/GraphConnection.md rename to jcapiv2/docs/GraphConnection.md index c7aacca..acca10f 100644 --- a/v2/docs/GraphConnection.md +++ b/jcapiv2/docs/GraphConnection.md @@ -3,9 +3,9 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- +**Attributes** | [***GraphAttributes**](GraphAttributes.md) | | [optional] [default to null] **From** | [***GraphObject**](GraphObject.md) | | [optional] [default to null] **To** | [***GraphObject**](GraphObject.md) | | [default to null] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/v2/docs/GraphObject.md b/jcapiv2/docs/GraphObject.md similarity index 82% rename from v2/docs/GraphObject.md rename to jcapiv2/docs/GraphObject.md index c5a460f..974ffb7 100644 --- a/v2/docs/GraphObject.md +++ b/jcapiv2/docs/GraphObject.md @@ -3,9 +3,9 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- +**Attributes** | [***GraphAttributes**](GraphAttributes.md) | | [optional] [default to null] **Id** | **string** | The ObjectID of the graph object. | [default to null] **Type_** | **string** | The type of graph object. | [default to null] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/v2/docs/GraphObjectWithPaths.md b/jcapiv2/docs/GraphObjectWithPaths.md similarity index 84% rename from v2/docs/GraphObjectWithPaths.md rename to jcapiv2/docs/GraphObjectWithPaths.md index 38ad590..52c4209 100644 --- a/v2/docs/GraphObjectWithPaths.md +++ b/jcapiv2/docs/GraphObjectWithPaths.md @@ -3,10 +3,10 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- +**CompiledAttributes** | [***GraphAttributes**](GraphAttributes.md) | | [optional] [default to null] **Id** | **string** | Object ID of this graph object. | [default to null] **Paths** | [**[][]GraphConnection**](array.md) | A path through the graph between two graph objects. | [default to null] **Type_** | [***GraphType**](GraphType.md) | | [default to null] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/jcapiv2/docs/GraphOperation.md b/jcapiv2/docs/GraphOperation.md new file mode 100644 index 0000000..a6d7a96 --- /dev/null +++ b/jcapiv2/docs/GraphOperation.md @@ -0,0 +1,10 @@ +# GraphOperation + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Id** | **string** | The ObjectID of graph object being added or removed as an association. | [default to null] +**Op** | **string** | How to modify the graph connection. | [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/GraphOperationActiveDirectory.md b/jcapiv2/docs/GraphOperationActiveDirectory.md new file mode 100644 index 0000000..2c018c0 --- /dev/null +++ b/jcapiv2/docs/GraphOperationActiveDirectory.md @@ -0,0 +1,12 @@ +# GraphOperationActiveDirectory + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Id** | **string** | The ObjectID of graph object being added or removed as an association. | [default to null] +**Op** | **string** | How to modify the graph connection. | [default to null] +**Attributes** | [***GraphAttributes**](GraphAttributes.md) | | [optional] [default to null] +**Type_** | **string** | Targets which a \"active_directory\" can be associated to. | [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/GraphOperationApplication.md b/jcapiv2/docs/GraphOperationApplication.md new file mode 100644 index 0000000..df724a0 --- /dev/null +++ b/jcapiv2/docs/GraphOperationApplication.md @@ -0,0 +1,12 @@ +# GraphOperationApplication + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Id** | **string** | The ObjectID of graph object being added or removed as an association. | [default to null] +**Op** | **string** | How to modify the graph connection. | [default to null] +**Attributes** | [***GraphAttributes**](GraphAttributes.md) | | [optional] [default to null] +**Type_** | **string** | Targets which a \"application\" can be associated to. | [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/GraphOperationCommand.md b/jcapiv2/docs/GraphOperationCommand.md new file mode 100644 index 0000000..1c61dc2 --- /dev/null +++ b/jcapiv2/docs/GraphOperationCommand.md @@ -0,0 +1,12 @@ +# GraphOperationCommand + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Id** | **string** | The ObjectID of graph object being added or removed as an association. | [default to null] +**Op** | **string** | How to modify the graph connection. | [default to null] +**Attributes** | [***GraphAttributes**](GraphAttributes.md) | | [optional] [default to null] +**Type_** | **string** | Targets which a \"command\" can be associated to. | [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/GraphOperationGSuite.md b/jcapiv2/docs/GraphOperationGSuite.md new file mode 100644 index 0000000..5420cf7 --- /dev/null +++ b/jcapiv2/docs/GraphOperationGSuite.md @@ -0,0 +1,12 @@ +# GraphOperationGSuite + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Id** | **string** | The ObjectID of graph object being added or removed as an association. | [default to null] +**Op** | **string** | How to modify the graph connection. | [default to null] +**Attributes** | [***GraphAttributes**](GraphAttributes.md) | | [optional] [default to null] +**Type_** | **string** | Targets which a \"g_suite\" can be associated to. | [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/GraphOperationLdapServer.md b/jcapiv2/docs/GraphOperationLdapServer.md new file mode 100644 index 0000000..a068137 --- /dev/null +++ b/jcapiv2/docs/GraphOperationLdapServer.md @@ -0,0 +1,12 @@ +# GraphOperationLdapServer + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Id** | **string** | The ObjectID of graph object being added or removed as an association. | [default to null] +**Op** | **string** | How to modify the graph connection. | [default to null] +**Attributes** | [***GraphAttributes**](GraphAttributes.md) | | [optional] [default to null] +**Type_** | **string** | Targets which a \"ldap_server\" can be associated to. | [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/GraphOperationOffice365.md b/jcapiv2/docs/GraphOperationOffice365.md new file mode 100644 index 0000000..93be7cc --- /dev/null +++ b/jcapiv2/docs/GraphOperationOffice365.md @@ -0,0 +1,12 @@ +# GraphOperationOffice365 + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Id** | **string** | The ObjectID of graph object being added or removed as an association. | [default to null] +**Op** | **string** | How to modify the graph connection. | [default to null] +**Attributes** | [***GraphAttributes**](GraphAttributes.md) | | [optional] [default to null] +**Type_** | **string** | Targets which a \"office_365\" can be associated to. | [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/GraphOperationPolicy.md b/jcapiv2/docs/GraphOperationPolicy.md new file mode 100644 index 0000000..dee3553 --- /dev/null +++ b/jcapiv2/docs/GraphOperationPolicy.md @@ -0,0 +1,12 @@ +# GraphOperationPolicy + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Id** | **string** | The ObjectID of graph object being added or removed as an association. | [default to null] +**Op** | **string** | How to modify the graph connection. | [default to null] +**Attributes** | [***GraphAttributes**](GraphAttributes.md) | | [optional] [default to null] +**Type_** | **string** | Targets which a \"policy\" can be associated to. | [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/GraphOperationPolicyGroup.md b/jcapiv2/docs/GraphOperationPolicyGroup.md new file mode 100644 index 0000000..7d60756 --- /dev/null +++ b/jcapiv2/docs/GraphOperationPolicyGroup.md @@ -0,0 +1,12 @@ +# GraphOperationPolicyGroup + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Id** | **string** | The ObjectID of graph object being added or removed as an association. | [default to null] +**Op** | **string** | How to modify the graph connection. | [default to null] +**Attributes** | [***GraphAttributes**](GraphAttributes.md) | | [optional] [default to null] +**Type_** | **string** | Targets which a \"policy_group\" can be associated to. | [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/GraphOperationPolicyGroupMember.md b/jcapiv2/docs/GraphOperationPolicyGroupMember.md new file mode 100644 index 0000000..d14e551 --- /dev/null +++ b/jcapiv2/docs/GraphOperationPolicyGroupMember.md @@ -0,0 +1,12 @@ +# GraphOperationPolicyGroupMember + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Id** | **string** | The ObjectID of graph object being added or removed as an association. | [default to null] +**Op** | **string** | How to modify the graph connection. | [default to null] +**Attributes** | [***GraphAttributes**](GraphAttributes.md) | | [optional] [default to null] +**Type_** | **string** | The member type. | [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/GraphOperationRadiusServer.md b/jcapiv2/docs/GraphOperationRadiusServer.md new file mode 100644 index 0000000..a19eb02 --- /dev/null +++ b/jcapiv2/docs/GraphOperationRadiusServer.md @@ -0,0 +1,12 @@ +# GraphOperationRadiusServer + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Id** | **string** | The ObjectID of graph object being added or removed as an association. | [default to null] +**Op** | **string** | How to modify the graph connection. | [default to null] +**Attributes** | [***GraphAttributes**](GraphAttributes.md) | | [optional] [default to null] +**Type_** | **string** | Targets which a \"radius_server\" can be associated to. | [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/GraphOperationSoftwareApp.md b/jcapiv2/docs/GraphOperationSoftwareApp.md new file mode 100644 index 0000000..3e1dce3 --- /dev/null +++ b/jcapiv2/docs/GraphOperationSoftwareApp.md @@ -0,0 +1,12 @@ +# GraphOperationSoftwareApp + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Id** | **string** | The ObjectID of graph object being added or removed as an association. | [default to null] +**Op** | **string** | How to modify the graph connection. | [default to null] +**Attributes** | [***GraphAttributes**](GraphAttributes.md) | | [optional] [default to null] +**Type_** | **string** | Targets which a \"software_app\" can be associated to. | [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/GraphOperationSystem.md b/jcapiv2/docs/GraphOperationSystem.md new file mode 100644 index 0000000..41d5cce --- /dev/null +++ b/jcapiv2/docs/GraphOperationSystem.md @@ -0,0 +1,12 @@ +# GraphOperationSystem + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Id** | **string** | The ObjectID of graph object being added or removed as an association. | [default to null] +**Op** | **string** | How to modify the graph connection. | [default to null] +**Attributes** | [***interface{}**](interface{}.md) | | [optional] [default to null] +**Type_** | **string** | Targets which a \"system\" can be associated to. | [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/GraphOperationSystemGroup.md b/jcapiv2/docs/GraphOperationSystemGroup.md new file mode 100644 index 0000000..3b24443 --- /dev/null +++ b/jcapiv2/docs/GraphOperationSystemGroup.md @@ -0,0 +1,12 @@ +# GraphOperationSystemGroup + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Id** | **string** | The ObjectID of graph object being added or removed as an association. | [default to null] +**Op** | **string** | How to modify the graph connection. | [default to null] +**Attributes** | [***GraphAttributes**](GraphAttributes.md) | | [optional] [default to null] +**Type_** | **string** | Targets which a \"system_group\" can be associated to. | [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/GraphOperationSystemGroupMember.md b/jcapiv2/docs/GraphOperationSystemGroupMember.md new file mode 100644 index 0000000..92a5030 --- /dev/null +++ b/jcapiv2/docs/GraphOperationSystemGroupMember.md @@ -0,0 +1,12 @@ +# GraphOperationSystemGroupMember + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Id** | **string** | The ObjectID of graph object being added or removed as an association. | [default to null] +**Op** | **string** | How to modify the graph connection. | [default to null] +**Attributes** | [***GraphAttributes**](GraphAttributes.md) | | [optional] [default to null] +**Type_** | **string** | The member type. | [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/GraphOperationUser.md b/jcapiv2/docs/GraphOperationUser.md new file mode 100644 index 0000000..7ce4561 --- /dev/null +++ b/jcapiv2/docs/GraphOperationUser.md @@ -0,0 +1,12 @@ +# GraphOperationUser + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Id** | **string** | The ObjectID of graph object being added or removed as an association. | [default to null] +**Op** | **string** | How to modify the graph connection. | [default to null] +**Attributes** | [***interface{}**](interface{}.md) | | [optional] [default to null] +**Type_** | **string** | Targets which a \"user\" can be associated to. | [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/GraphOperationUserGroup.md b/jcapiv2/docs/GraphOperationUserGroup.md new file mode 100644 index 0000000..25763d5 --- /dev/null +++ b/jcapiv2/docs/GraphOperationUserGroup.md @@ -0,0 +1,12 @@ +# GraphOperationUserGroup + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Id** | **string** | The ObjectID of graph object being added or removed as an association. | [default to null] +**Op** | **string** | How to modify the graph connection. | [default to null] +**Attributes** | [***GraphAttributes**](GraphAttributes.md) | | [optional] [default to null] +**Type_** | **string** | Targets which a \"user_group\" can be associated to. | [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/GraphOperationUserGroupMember.md b/jcapiv2/docs/GraphOperationUserGroupMember.md new file mode 100644 index 0000000..892c677 --- /dev/null +++ b/jcapiv2/docs/GraphOperationUserGroupMember.md @@ -0,0 +1,12 @@ +# GraphOperationUserGroupMember + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Id** | **string** | The ObjectID of graph object being added or removed as an association. | [default to null] +**Op** | **string** | How to modify the graph connection. | [default to null] +**Attributes** | [***GraphAttributes**](GraphAttributes.md) | | [optional] [default to null] +**Type_** | **string** | The member type. | [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/v2/docs/GraphType.md b/jcapiv2/docs/GraphType.md similarity index 99% rename from v2/docs/GraphType.md rename to jcapiv2/docs/GraphType.md index e505470..bc471ff 100644 --- a/v2/docs/GraphType.md +++ b/jcapiv2/docs/GraphType.md @@ -6,4 +6,3 @@ Name | Type | Description | Notes [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/jcapiv2/docs/Group.md b/jcapiv2/docs/Group.md new file mode 100644 index 0000000..4924080 --- /dev/null +++ b/jcapiv2/docs/Group.md @@ -0,0 +1,14 @@ +# Group + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Attributes** | [***GraphAttributes**](GraphAttributes.md) | | [optional] [default to null] +**Description** | **string** | Description of a Group | [optional] [default to null] +**Email** | **string** | E-mail address associated with a Group | [optional] [default to null] +**Id** | **string** | ObjectId uniquely identifying a Group. | [optional] [default to null] +**Name** | **string** | Display name of a Group. | [optional] [default to null] +**Type_** | [***GroupType**](GroupType.md) | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/GroupAttributesUserGroup.md b/jcapiv2/docs/GroupAttributesUserGroup.md new file mode 100644 index 0000000..ce09bb8 --- /dev/null +++ b/jcapiv2/docs/GroupAttributesUserGroup.md @@ -0,0 +1,13 @@ +# GroupAttributesUserGroup + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Sudo** | [***GraphAttributeSudoSudo**](GraphAttributeSudo_sudo.md) | | [optional] [default to null] +**LdapGroups** | [**[]LdapGroup**](LdapGroup.md) | | [optional] [default to null] +**PosixGroups** | [**[]GraphAttributePosixGroupsPosixGroups**](GraphAttributePosixGroups_posixGroups.md) | | [optional] [default to null] +**Radius** | [***GraphAttributeRadiusRadius**](GraphAttributeRadius_radius.md) | | [optional] [default to null] +**SambaEnabled** | **bool** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/GroupIdSuggestionsBody.md b/jcapiv2/docs/GroupIdSuggestionsBody.md new file mode 100644 index 0000000..742ba1d --- /dev/null +++ b/jcapiv2/docs/GroupIdSuggestionsBody.md @@ -0,0 +1,9 @@ +# GroupIdSuggestionsBody + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**UserIds** | **[]string** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/v2/docs/GroupType.md b/jcapiv2/docs/GroupType.md similarity index 99% rename from v2/docs/GroupType.md rename to jcapiv2/docs/GroupType.md index 02d2c1c..303c2b0 100644 --- a/v2/docs/GroupType.md +++ b/jcapiv2/docs/GroupType.md @@ -6,4 +6,3 @@ Name | Type | Description | Notes [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/jcapiv2/docs/GroupsApi.md b/jcapiv2/docs/GroupsApi.md new file mode 100644 index 0000000..2fa360d --- /dev/null +++ b/jcapiv2/docs/GroupsApi.md @@ -0,0 +1,48 @@ +# {{classname}} + +All URIs are relative to *https://console.jumpcloud.com/api/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**GroupsList**](GroupsApi.md#GroupsList) | **Get** /groups | List All Groups + +# **GroupsList** +> []Group GroupsList(ctx, optional) +List All Groups + +This endpoint returns all Groups that exist in your organization. #### Available filter fields: - `name` - `disabled` - `type` #### Sample Request ``` curl -X GET \\ https://console.jumpcloud.com/api/v2/groups \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **optional** | ***GroupsApiGroupsListOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a GroupsApiGroupsListOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **fields** | [**optional.Interface of []string**](string.md)| The comma separated fields included in the returned records. If omitted, the default list of fields will be returned. | + **filter** | [**optional.Interface of []string**](string.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | + **limit** | **optional.Int32**| The number of records to return at once. Limited to 100. | [default to 10] + **skip** | **optional.Int32**| The offset into the records to return. | [default to 0] + **sort** | [**optional.Interface of []string**](string.md)| The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. | + **xOrgId** | **optional.String**| Organization identifier that can be obtained from console settings. | + **xUnfilteredTotalCount** | **optional.Int32**| If provided in the request with any non-empty value, this header will be returned on the response populated with the total count of objects without filters taken into account | + +### Return type + +[**[]Group**](Group.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/v2/docs/GsuiteOutput.md b/jcapiv2/docs/GsuiteOutput.md similarity index 80% rename from v2/docs/GsuiteOutput.md rename to jcapiv2/docs/GsuiteOutput.md index d3e4af7..00a5eb3 100644 --- a/v2/docs/GsuiteOutput.md +++ b/jcapiv2/docs/GsuiteOutput.md @@ -3,10 +3,11 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- +**GroupsEnabled** | **bool** | | [optional] [default to null] **Id** | **string** | | [optional] [default to null] +**Name** | **string** | | [optional] [default to null] **UserLockoutAction** | **string** | | [optional] [default to null] **UserPasswordExpirationAction** | **string** | | [optional] [default to null] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/v2/docs/GsuitePatchInput.md b/jcapiv2/docs/GsuitePatchInput.md similarity index 78% rename from v2/docs/GsuitePatchInput.md rename to jcapiv2/docs/GsuitePatchInput.md index b401cb5..ba0a837 100644 --- a/v2/docs/GsuitePatchInput.md +++ b/jcapiv2/docs/GsuitePatchInput.md @@ -3,9 +3,10 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- +**GroupsEnabled** | **bool** | | [optional] [default to null] +**Name** | **string** | | [optional] [default to null] **UserLockoutAction** | **string** | | [optional] [default to null] **UserPasswordExpirationAction** | **string** | | [optional] [default to null] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/jcapiv2/docs/IPListsApi.md b/jcapiv2/docs/IPListsApi.md new file mode 100644 index 0000000..3ca43d0 --- /dev/null +++ b/jcapiv2/docs/IPListsApi.md @@ -0,0 +1,233 @@ +# {{classname}} + +All URIs are relative to *https://console.jumpcloud.com/api/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**IplistsDelete**](IPListsApi.md#IplistsDelete) | **Delete** /iplists/{id} | Delete an IP list +[**IplistsGet**](IPListsApi.md#IplistsGet) | **Get** /iplists/{id} | Get an IP list +[**IplistsList**](IPListsApi.md#IplistsList) | **Get** /iplists | List IP Lists +[**IplistsPatch**](IPListsApi.md#IplistsPatch) | **Patch** /iplists/{id} | Update an IP list +[**IplistsPost**](IPListsApi.md#IplistsPost) | **Post** /iplists | Create IP List +[**IplistsPut**](IPListsApi.md#IplistsPut) | **Put** /iplists/{id} | Replace an IP list + +# **IplistsDelete** +> IpList IplistsDelete(ctx, id, optional) +Delete an IP list + +Delete a specific IP list. #### Sample Request ``` curl -X DELETE https://console.jumpcloud.com/api/v2/iplists/{id} \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **id** | **string**| | + **optional** | ***IPListsApiIplistsDeleteOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a IPListsApiIplistsDeleteOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **xOrgId** | **optional.String**| Organization identifier that can be obtained from console settings. | + +### Return type + +[**IpList**](IPList.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **IplistsGet** +> IpList IplistsGet(ctx, id, optional) +Get an IP list + +Return a specific IP list. #### Sample Request ``` curl https://console.jumpcloud.com/api/v2/iplists/{id} \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **id** | **string**| | + **optional** | ***IPListsApiIplistsGetOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a IPListsApiIplistsGetOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **xOrgId** | **optional.String**| Organization identifier that can be obtained from console settings. | + +### Return type + +[**IpList**](IPList.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **IplistsList** +> []IpList IplistsList(ctx, optional) +List IP Lists + +Retrieve all IP lists. #### Sample Request ``` curl https://console.jumpcloud.com/api/v2/iplists \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **optional** | ***IPListsApiIplistsListOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a IPListsApiIplistsListOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xOrgId** | **optional.String**| Organization identifier that can be obtained from console settings. | + **xTotalCount** | **optional.Int32**| | + **limit** | **optional.Int32**| The number of records to return at once. Limited to 100. | [default to 10] + **skip** | **optional.Int32**| The offset into the records to return. | [default to 0] + **filter** | [**optional.Interface of []string**](string.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | + **sort** | [**optional.Interface of []string**](string.md)| The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. | + +### Return type + +[**[]IpList**](IPList.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **IplistsPatch** +> IpList IplistsPatch(ctx, id, optional) +Update an IP list + +Update a specific IP list. #### Sample Request ``` curl -X PATCH https://console.jumpcloud.com/api/v2/iplists/{id} \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{\"name\": \"New IP List Name\"}' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **id** | **string**| | + **optional** | ***IPListsApiIplistsPatchOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a IPListsApiIplistsPatchOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **body** | [**optional.Interface of IpListRequest**](IpListRequest.md)| | + **xOrgId** | **optional.**| Organization identifier that can be obtained from console settings. | + +### Return type + +[**IpList**](IPList.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **IplistsPost** +> IpList IplistsPost(ctx, optional) +Create IP List + +Create an IP list. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/iplists \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"name\": \"Sample IP List\", \"ips\": [ \"192.168.10.12\", \"192.168.10.20 - 192.168.10.30\", \"123.225.10.0/32\" ] }' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **optional** | ***IPListsApiIplistsPostOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a IPListsApiIplistsPostOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**optional.Interface of IpListRequest**](IpListRequest.md)| | + **xOrgId** | **optional.**| Organization identifier that can be obtained from console settings. | + +### Return type + +[**IpList**](IPList.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **IplistsPut** +> IpList IplistsPut(ctx, id, optional) +Replace an IP list + +Replace a specific IP list. #### Sample Request ``` curl -X PUT https://console.jumpcloud.com/api/v2/iplists/{id} \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"name\": \"Sample IP List\", \"ips\": [ \"192.168.10.10\" ] }' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **id** | **string**| | + **optional** | ***IPListsApiIplistsPutOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a IPListsApiIplistsPutOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **body** | [**optional.Interface of IpListRequest**](IpListRequest.md)| | + **xOrgId** | **optional.**| Organization identifier that can be obtained from console settings. | + +### Return type + +[**IpList**](IPList.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/ImageApi.md b/jcapiv2/docs/ImageApi.md new file mode 100644 index 0000000..922dde3 --- /dev/null +++ b/jcapiv2/docs/ImageApi.md @@ -0,0 +1,44 @@ +# {{classname}} + +All URIs are relative to *https://console.jumpcloud.com/api/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**ApplicationsDeleteLogo**](ImageApi.md#ApplicationsDeleteLogo) | **Delete** /applications/{application_id}/logo | Delete application image + +# **ApplicationsDeleteLogo** +> ApplicationsDeleteLogo(ctx, applicationId, optional) +Delete application image + +Deletes the specified image from an application + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **applicationId** | **string**| | + **optional** | ***ImageApiApplicationsDeleteLogoOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a ImageApiApplicationsDeleteLogoOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **xOrgId** | **optional.String**| Organization identifier that can be obtained from console settings. | + +### Return type + + (empty response body) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/ImportUser.md b/jcapiv2/docs/ImportUser.md new file mode 100644 index 0000000..423a3e7 --- /dev/null +++ b/jcapiv2/docs/ImportUser.md @@ -0,0 +1,25 @@ +# ImportUser + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Addresses** | [**[]ImportUserAddress**](importUserAddress.md) | | [optional] [default to null] +**Company** | **string** | | [optional] [default to null] +**CostCenter** | **string** | | [optional] [default to null] +**Department** | **string** | | [optional] [default to null] +**Displayname** | **string** | | [optional] [default to null] +**Email** | **string** | | [optional] [default to null] +**EmployeeIdentifier** | **string** | | [optional] [default to null] +**EmployeeType** | **string** | | [optional] [default to null] +**Firstname** | **string** | | [optional] [default to null] +**Id** | **string** | | [optional] [default to null] +**JobTitle** | **string** | | [optional] [default to null] +**Lastname** | **string** | | [optional] [default to null] +**Location** | **string** | | [optional] [default to null] +**Manager** | **string** | | [optional] [default to null] +**Middlename** | **string** | | [optional] [default to null] +**PhoneNumbers** | [**[]ImportUserPhoneNumber**](importUserPhoneNumber.md) | | [optional] [default to null] +**Username** | **string** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/ImportUserAddress.md b/jcapiv2/docs/ImportUserAddress.md new file mode 100644 index 0000000..8a2fe42 --- /dev/null +++ b/jcapiv2/docs/ImportUserAddress.md @@ -0,0 +1,14 @@ +# ImportUserAddress + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Country** | **string** | | [optional] [default to null] +**Locality** | **string** | | [optional] [default to null] +**PostalCode** | **string** | | [optional] [default to null] +**Region** | **string** | | [optional] [default to null] +**StreetAddress** | **string** | | [optional] [default to null] +**Type_** | **string** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/ImportUserPhoneNumber.md b/jcapiv2/docs/ImportUserPhoneNumber.md new file mode 100644 index 0000000..566290a --- /dev/null +++ b/jcapiv2/docs/ImportUserPhoneNumber.md @@ -0,0 +1,10 @@ +# ImportUserPhoneNumber + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Type_** | **string** | | [optional] [default to null] +**Value** | **string** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/ImportUsersResponse.md b/jcapiv2/docs/ImportUsersResponse.md new file mode 100644 index 0000000..2a4d7b3 --- /dev/null +++ b/jcapiv2/docs/ImportUsersResponse.md @@ -0,0 +1,10 @@ +# ImportUsersResponse + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**TotalCount** | **float64** | | [optional] [default to null] +**Users** | [**[]ImportUser**](importUser.md) | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/InlineResponse200.md b/jcapiv2/docs/InlineResponse200.md new file mode 100644 index 0000000..177d6ad --- /dev/null +++ b/jcapiv2/docs/InlineResponse200.md @@ -0,0 +1,10 @@ +# InlineResponse200 + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**EventsCount** | **int32** | | [optional] [default to null] +**Results** | [**[]ScheduledUserstateResult**](scheduled-userstate-result.md) | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/InlineResponse2001.md b/jcapiv2/docs/InlineResponse2001.md new file mode 100644 index 0000000..44a3978 --- /dev/null +++ b/jcapiv2/docs/InlineResponse2001.md @@ -0,0 +1,10 @@ +# InlineResponse2001 + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**NextPageToken** | **string** | | [optional] [default to null] +**Users** | [**[]User**](User.md) | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/InlineResponse20010.md b/jcapiv2/docs/InlineResponse20010.md new file mode 100644 index 0000000..1f7b1c5 --- /dev/null +++ b/jcapiv2/docs/InlineResponse20010.md @@ -0,0 +1,12 @@ +# InlineResponse20010 + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Id** | **string** | | [optional] [default to null] +**Name** | **string** | | [optional] [default to null] +**UserLockoutAction** | [***LdapServerAction**](LdapServerAction.md) | | [optional] [default to null] +**UserPasswordExpirationAction** | [***LdapServerAction**](LdapServerAction.md) | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/InlineResponse20011.md b/jcapiv2/docs/InlineResponse20011.md new file mode 100644 index 0000000..065c316 --- /dev/null +++ b/jcapiv2/docs/InlineResponse20011.md @@ -0,0 +1,11 @@ +# InlineResponse20011 + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**SkipToken** | **string** | | [optional] [default to null] +**Top** | **int32** | | [optional] [default to null] +**Users** | [**[]InlineResponse20011Users**](inline_response_200_11_users.md) | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/InlineResponse20011Users.md b/jcapiv2/docs/InlineResponse20011Users.md new file mode 100644 index 0000000..42969d3 --- /dev/null +++ b/jcapiv2/docs/InlineResponse20011Users.md @@ -0,0 +1,12 @@ +# InlineResponse20011Users + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**GivenName** | **string** | | [optional] [default to null] +**Id** | **string** | | [optional] [default to null] +**Surname** | **string** | | [optional] [default to null] +**UserPrincipalName** | **string** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/InlineResponse20012.md b/jcapiv2/docs/InlineResponse20012.md new file mode 100644 index 0000000..c6ce8a5 --- /dev/null +++ b/jcapiv2/docs/InlineResponse20012.md @@ -0,0 +1,10 @@ +# InlineResponse20012 + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Results** | [**[]Administrator**](Administrator.md) | | [optional] [default to null] +**TotalCount** | **int32** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/InlineResponse20013.md b/jcapiv2/docs/InlineResponse20013.md new file mode 100644 index 0000000..c5afc02 --- /dev/null +++ b/jcapiv2/docs/InlineResponse20013.md @@ -0,0 +1,10 @@ +# InlineResponse20013 + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Results** | [**[]Organization**](Organization.md) | | [optional] [default to null] +**TotalCount** | **int32** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/InlineResponse2002.md b/jcapiv2/docs/InlineResponse2002.md new file mode 100644 index 0000000..b56657a --- /dev/null +++ b/jcapiv2/docs/InlineResponse2002.md @@ -0,0 +1,10 @@ +# InlineResponse2002 + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**NextPageToken** | **string** | | [optional] [default to null] +**Users** | [**[]InlineResponse2002Users**](inline_response_200_2_users.md) | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/InlineResponse2002Users.md b/jcapiv2/docs/InlineResponse2002Users.md new file mode 100644 index 0000000..9a01f4e --- /dev/null +++ b/jcapiv2/docs/InlineResponse2002Users.md @@ -0,0 +1,13 @@ +# InlineResponse2002Users + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**FamilyName** | **string** | | [optional] [default to null] +**GivenName** | **string** | | [optional] [default to null] +**Id** | **string** | | [optional] [default to null] +**PrimaryEmail** | **string** | | [optional] [default to null] +**ThumbnailPhotoUrl** | **string** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/InlineResponse2003.md b/jcapiv2/docs/InlineResponse2003.md new file mode 100644 index 0000000..b12c32b --- /dev/null +++ b/jcapiv2/docs/InlineResponse2003.md @@ -0,0 +1,10 @@ +# InlineResponse2003 + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Results** | [**[]AutotaskContract**](AutotaskContract.md) | | [optional] [default to null] +**TotalCount** | **int32** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/InlineResponse2004.md b/jcapiv2/docs/InlineResponse2004.md new file mode 100644 index 0000000..202613c --- /dev/null +++ b/jcapiv2/docs/InlineResponse2004.md @@ -0,0 +1,10 @@ +# InlineResponse2004 + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Results** | [**[]AutotaskContractField**](AutotaskContractField.md) | | [optional] [default to null] +**TotalCount** | **int32** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/InlineResponse2005.md b/jcapiv2/docs/InlineResponse2005.md new file mode 100644 index 0000000..9823ea1 --- /dev/null +++ b/jcapiv2/docs/InlineResponse2005.md @@ -0,0 +1,10 @@ +# InlineResponse2005 + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Results** | [**[]AutotaskService**](AutotaskService.md) | | [optional] [default to null] +**TotalCount** | **int32** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/InlineResponse2006.md b/jcapiv2/docs/InlineResponse2006.md new file mode 100644 index 0000000..337bb8f --- /dev/null +++ b/jcapiv2/docs/InlineResponse2006.md @@ -0,0 +1,10 @@ +# InlineResponse2006 + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Records** | [**[]AutotaskMappingResponse**](AutotaskMappingResponse.md) | | [optional] [default to null] +**TotalCount** | **float64** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/InlineResponse2007.md b/jcapiv2/docs/InlineResponse2007.md new file mode 100644 index 0000000..09677bc --- /dev/null +++ b/jcapiv2/docs/InlineResponse2007.md @@ -0,0 +1,10 @@ +# InlineResponse2007 + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Results** | [**[]ConnectwiseAgreement**](ConnectwiseAgreement.md) | | [optional] [default to null] +**TotalCount** | **int32** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/InlineResponse2008.md b/jcapiv2/docs/InlineResponse2008.md new file mode 100644 index 0000000..3b993c4 --- /dev/null +++ b/jcapiv2/docs/InlineResponse2008.md @@ -0,0 +1,10 @@ +# InlineResponse2008 + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Results** | [**[]ConnectwiseAddition**](ConnectwiseAddition.md) | | [optional] [default to null] +**TotalCount** | **int32** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/InlineResponse2009.md b/jcapiv2/docs/InlineResponse2009.md new file mode 100644 index 0000000..5575500 --- /dev/null +++ b/jcapiv2/docs/InlineResponse2009.md @@ -0,0 +1,10 @@ +# InlineResponse2009 + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Records** | [**[]ConnectWiseMappingResponse**](ConnectWiseMappingResponse.md) | | [optional] [default to null] +**TotalCount** | **float64** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/InlineResponse201.md b/jcapiv2/docs/InlineResponse201.md new file mode 100644 index 0000000..ab7692b --- /dev/null +++ b/jcapiv2/docs/InlineResponse201.md @@ -0,0 +1,9 @@ +# InlineResponse201 + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**IntegrationId** | **string** | The identifier of the created integration | [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/v2/docs/InlineResponse400.md b/jcapiv2/docs/InlineResponse400.md similarity index 99% rename from v2/docs/InlineResponse400.md rename to jcapiv2/docs/InlineResponse400.md index a0dcf45..67d4ed1 100644 --- a/v2/docs/InlineResponse400.md +++ b/jcapiv2/docs/InlineResponse400.md @@ -7,4 +7,3 @@ Name | Type | Description | Notes [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/jcapiv2/docs/Integration.md b/jcapiv2/docs/Integration.md new file mode 100644 index 0000000..4f5f8d8 --- /dev/null +++ b/jcapiv2/docs/Integration.md @@ -0,0 +1,10 @@ +# Integration + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**IntegrationId** | **string** | Unique identifier for this integration | [optional] [default to null] +**Type_** | [***IntegrationType**](IntegrationType.md) | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/IntegrationSyncError.md b/jcapiv2/docs/IntegrationSyncError.md new file mode 100644 index 0000000..4d7c6ca --- /dev/null +++ b/jcapiv2/docs/IntegrationSyncError.md @@ -0,0 +1,12 @@ +# IntegrationSyncError + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ErrorType** | **string** | | [default to null] +**Message** | **string** | | [default to null] +**OrgId** | **string** | | [default to null] +**Timestamp** | **string** | | [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/IntegrationSyncErrorResp.md b/jcapiv2/docs/IntegrationSyncErrorResp.md new file mode 100644 index 0000000..0272688 --- /dev/null +++ b/jcapiv2/docs/IntegrationSyncErrorResp.md @@ -0,0 +1,10 @@ +# IntegrationSyncErrorResp + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Records** | [**[]IntegrationSyncError**](IntegrationSyncError.md) | | [default to null] +**TotalCount** | **int32** | | [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/IntegrationType.md b/jcapiv2/docs/IntegrationType.md new file mode 100644 index 0000000..7637921 --- /dev/null +++ b/jcapiv2/docs/IntegrationType.md @@ -0,0 +1,8 @@ +# IntegrationType + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/IntegrationsResponse.md b/jcapiv2/docs/IntegrationsResponse.md new file mode 100644 index 0000000..44626e3 --- /dev/null +++ b/jcapiv2/docs/IntegrationsResponse.md @@ -0,0 +1,10 @@ +# IntegrationsResponse + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Records** | [**[]Integration**](Integration.md) | | [optional] [default to null] +**TotalCount** | **int32** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/IpList.md b/jcapiv2/docs/IpList.md new file mode 100644 index 0000000..fd9234d --- /dev/null +++ b/jcapiv2/docs/IpList.md @@ -0,0 +1,12 @@ +# IpList + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Description** | **string** | | [optional] [default to null] +**Id** | **string** | | [optional] [default to null] +**Ips** | **[]string** | | [optional] [default to null] +**Name** | **string** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/IpListRequest.md b/jcapiv2/docs/IpListRequest.md new file mode 100644 index 0000000..3abb4c0 --- /dev/null +++ b/jcapiv2/docs/IpListRequest.md @@ -0,0 +1,11 @@ +# IpListRequest + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Description** | **string** | | [optional] [default to null] +**Ips** | **[]string** | | [optional] [default to null] +**Name** | **string** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/v2/docs/JobId.md b/jcapiv2/docs/JobId.md similarity index 99% rename from v2/docs/JobId.md rename to jcapiv2/docs/JobId.md index 93daa59..d410e74 100644 --- a/v2/docs/JobId.md +++ b/jcapiv2/docs/JobId.md @@ -7,4 +7,3 @@ Name | Type | Description | Notes [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/jcapiv2/docs/JobWorkresult.md b/jcapiv2/docs/JobWorkresult.md new file mode 100644 index 0000000..e6b7c19 --- /dev/null +++ b/jcapiv2/docs/JobWorkresult.md @@ -0,0 +1,15 @@ +# JobWorkresult + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**CreatedAt** | **string** | | [optional] [default to null] +**Id** | **string** | | [optional] [default to null] +**Meta** | [***interface{}**](interface{}.md) | | [optional] [default to null] +**PersistedFields** | [***interface{}**](interface{}.md) | | [optional] [default to null] +**Status** | **string** | | [optional] [default to null] +**StatusMsg** | **string** | | [optional] [default to null] +**UpdatedAt** | **string** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/LDAPServersApi.md b/jcapiv2/docs/LDAPServersApi.md new file mode 100644 index 0000000..a1f0315 --- /dev/null +++ b/jcapiv2/docs/LDAPServersApi.md @@ -0,0 +1,281 @@ +# {{classname}} + +All URIs are relative to *https://console.jumpcloud.com/api/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**GraphLdapServerAssociationsList**](LDAPServersApi.md#GraphLdapServerAssociationsList) | **Get** /ldapservers/{ldapserver_id}/associations | List the associations of a LDAP Server +[**GraphLdapServerAssociationsPost**](LDAPServersApi.md#GraphLdapServerAssociationsPost) | **Post** /ldapservers/{ldapserver_id}/associations | Manage the associations of a LDAP Server +[**GraphLdapServerTraverseUser**](LDAPServersApi.md#GraphLdapServerTraverseUser) | **Get** /ldapservers/{ldapserver_id}/users | List the Users bound to a LDAP Server +[**GraphLdapServerTraverseUserGroup**](LDAPServersApi.md#GraphLdapServerTraverseUserGroup) | **Get** /ldapservers/{ldapserver_id}/usergroups | List the User Groups bound to a LDAP Server +[**LdapserversGet**](LDAPServersApi.md#LdapserversGet) | **Get** /ldapservers/{id} | Get LDAP Server +[**LdapserversList**](LDAPServersApi.md#LdapserversList) | **Get** /ldapservers | List LDAP Servers +[**LdapserversPatch**](LDAPServersApi.md#LdapserversPatch) | **Patch** /ldapservers/{id} | Update existing LDAP server + +# **GraphLdapServerAssociationsList** +> []GraphConnection GraphLdapServerAssociationsList(ctx, ldapserverId, targets, optional) +List the associations of a LDAP Server + +This endpoint returns the _direct_ associations of this LDAP Server. A direct association can be a non-homogeneous relationship between 2 different objects, for example LDAP and Users. #### Sample Request ``` curl -X GET 'https://console.jumpcloud.com/api/v2/ldapservers/{LDAP_ID}/associations?targets=user_group \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **ldapserverId** | **string**| ObjectID of the LDAP Server. | + **targets** | [**[]string**](string.md)| Targets which a \"ldap_server\" can be associated to. | + **optional** | ***LDAPServersApiGraphLdapServerAssociationsListOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a LDAPServersApiGraphLdapServerAssociationsListOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + **limit** | **optional.Int32**| The number of records to return at once. Limited to 100. | [default to 10] + **skip** | **optional.Int32**| The offset into the records to return. | [default to 0] + **xOrgId** | **optional.String**| Organization identifier that can be obtained from console settings. | + +### Return type + +[**[]GraphConnection**](GraphConnection.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GraphLdapServerAssociationsPost** +> GraphLdapServerAssociationsPost(ctx, ldapserverId, optional) +Manage the associations of a LDAP Server + +This endpoint allows you to manage the _direct_ associations of a LDAP Server. A direct association can be a non-homogeneous relationship between 2 different objects, for example LDAP and Users. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/ldapservers/{LDAP_ID}/associations \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"op\": \"add\", \"type\": \"user\", \"id\": \"{User_ID}\" }' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **ldapserverId** | **string**| ObjectID of the LDAP Server. | + **optional** | ***LDAPServersApiGraphLdapServerAssociationsPostOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a LDAPServersApiGraphLdapServerAssociationsPostOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **body** | [**optional.Interface of GraphOperationLdapServer**](GraphOperationLdapServer.md)| | + **xOrgId** | **optional.**| Organization identifier that can be obtained from console settings. | + +### Return type + + (empty response body) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GraphLdapServerTraverseUser** +> []GraphObjectWithPaths GraphLdapServerTraverseUser(ctx, ldapserverId, optional) +List the Users bound to a LDAP Server + +This endpoint will return all Users bound to an LDAP Server, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this LDAP server instance to the corresponding User; this array represents all grouping and/or associations that would have to be removed to deprovision the User from this LDAP server instance. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/ldapservers/{LDAP_ID}/users \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **ldapserverId** | **string**| ObjectID of the LDAP Server. | + **optional** | ***LDAPServersApiGraphLdapServerTraverseUserOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a LDAPServersApiGraphLdapServerTraverseUserOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **limit** | **optional.Int32**| The number of records to return at once. Limited to 100. | [default to 10] + **xOrgId** | **optional.String**| Organization identifier that can be obtained from console settings. | + **skip** | **optional.Int32**| The offset into the records to return. | [default to 0] + **filter** | [**optional.Interface of []string**](string.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | + +### Return type + +[**[]GraphObjectWithPaths**](GraphObjectWithPaths.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GraphLdapServerTraverseUserGroup** +> []GraphObjectWithPaths GraphLdapServerTraverseUserGroup(ctx, ldapserverId, optional) +List the User Groups bound to a LDAP Server + +This endpoint will return all Users Groups bound to a LDAP Server, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the group's type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this LDAP server instance to the corresponding User Group; this array represents all grouping and/or associations that would have to be removed to deprovision the User Group from this LDAP server instance. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/ldapservers/{LDAP_ID}/usergroups \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **ldapserverId** | **string**| ObjectID of the LDAP Server. | + **optional** | ***LDAPServersApiGraphLdapServerTraverseUserGroupOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a LDAPServersApiGraphLdapServerTraverseUserGroupOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **limit** | **optional.Int32**| The number of records to return at once. Limited to 100. | [default to 10] + **xOrgId** | **optional.String**| Organization identifier that can be obtained from console settings. | + **skip** | **optional.Int32**| The offset into the records to return. | [default to 0] + **filter** | [**optional.Interface of []string**](string.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | + +### Return type + +[**[]GraphObjectWithPaths**](GraphObjectWithPaths.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **LdapserversGet** +> LdapServerOutput LdapserversGet(ctx, id, optional) +Get LDAP Server + +This endpoint returns a specific LDAP server. ##### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/ldapservers/{LDAP_ID} \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **id** | **string**| Unique identifier of the LDAP server. | + **optional** | ***LDAPServersApiLdapserversGetOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a LDAPServersApiLdapserversGetOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **xOrgId** | **optional.String**| Organization identifier that can be obtained from console settings. | + +### Return type + +[**LdapServerOutput**](ldap-server-output.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **LdapserversList** +> []LdapServerOutput LdapserversList(ctx, optional) +List LDAP Servers + +This endpoint returns the object IDs of your LDAP servers. ##### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/ldapservers/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **optional** | ***LDAPServersApiLdapserversListOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a LDAPServersApiLdapserversListOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **fields** | [**optional.Interface of []string**](string.md)| The comma separated fields included in the returned records. If omitted, the default list of fields will be returned. | + **filter** | [**optional.Interface of []string**](string.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | + **limit** | **optional.Int32**| The number of records to return at once. Limited to 100. | [default to 10] + **skip** | **optional.Int32**| The offset into the records to return. | [default to 0] + **sort** | [**optional.Interface of []string**](string.md)| The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. | + **xOrgId** | **optional.String**| Organization identifier that can be obtained from console settings. | + +### Return type + +[**[]LdapServerOutput**](ldap-server-output.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **LdapserversPatch** +> InlineResponse20010 LdapserversPatch(ctx, id, optional) +Update existing LDAP server + +This endpoint allows updating some attributes of an LDAP server. Sample Request ``` curl -X PATCH https://console.jumpcloud.com/api/v2/ldapservers/{LDAP_ID} \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"userLockoutAction\": \"remove\", \"userPasswordExpirationAction\": \"disable\" }' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **id** | **string**| Unique identifier of the LDAP server. | + **optional** | ***LDAPServersApiLdapserversPatchOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a LDAPServersApiLdapserversPatchOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **body** | [**optional.Interface of LdapserversIdBody**](LdapserversIdBody.md)| | + **xOrgId** | **optional.**| Organization identifier that can be obtained from console settings. | + +### Return type + +[**InlineResponse20010**](inline_response_200_10.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/LdapGroup.md b/jcapiv2/docs/LdapGroup.md new file mode 100644 index 0000000..8b15082 --- /dev/null +++ b/jcapiv2/docs/LdapGroup.md @@ -0,0 +1,9 @@ +# LdapGroup + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Name** | **string** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/v2/docs/LdapServerAction.md b/jcapiv2/docs/LdapServerAction.md similarity index 99% rename from v2/docs/LdapServerAction.md rename to jcapiv2/docs/LdapServerAction.md index 54f1baa..a2a9056 100644 --- a/v2/docs/LdapServerAction.md +++ b/jcapiv2/docs/LdapServerAction.md @@ -6,4 +6,3 @@ Name | Type | Description | Notes [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/jcapiv2/docs/LdapServerInput.md b/jcapiv2/docs/LdapServerInput.md new file mode 100644 index 0000000..2683cc0 --- /dev/null +++ b/jcapiv2/docs/LdapServerInput.md @@ -0,0 +1,11 @@ +# LdapServerInput + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Name** | **string** | The name of this LDAP server | [optional] [default to null] +**UserLockoutAction** | **string** | action to take; one of 'remove' or 'disable' | [optional] [default to null] +**UserPasswordExpirationAction** | **string** | action to take; one of 'remove' or 'disable' | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/LdapServerOutput.md b/jcapiv2/docs/LdapServerOutput.md new file mode 100644 index 0000000..f4bcdf2 --- /dev/null +++ b/jcapiv2/docs/LdapServerOutput.md @@ -0,0 +1,11 @@ +# LdapServerOutput + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Name** | **string** | The name of this LDAP server | [optional] [default to null] +**UserLockoutAction** | **string** | action to take; one of 'remove' or 'disable' | [optional] [default to null] +**UserPasswordExpirationAction** | **string** | action to take; one of 'remove' or 'disable' | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/LdapserversIdBody.md b/jcapiv2/docs/LdapserversIdBody.md new file mode 100644 index 0000000..6b09b33 --- /dev/null +++ b/jcapiv2/docs/LdapserversIdBody.md @@ -0,0 +1,11 @@ +# LdapserversIdBody + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Id** | **string** | | [optional] [default to null] +**UserLockoutAction** | [***LdapServerAction**](LdapServerAction.md) | | [optional] [default to null] +**UserPasswordExpirationAction** | [***LdapServerAction**](LdapServerAction.md) | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/LogosApi.md b/jcapiv2/docs/LogosApi.md new file mode 100644 index 0000000..ddbc59c --- /dev/null +++ b/jcapiv2/docs/LogosApi.md @@ -0,0 +1,36 @@ +# {{classname}} + +All URIs are relative to *https://console.jumpcloud.com/api/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**LogosGet**](LogosApi.md#LogosGet) | **Get** /logos/{id} | Get the logo associated with the specified id + +# **LogosGet** +> *os.File LogosGet(ctx, id) +Get the logo associated with the specified id + +Return the logo image associated with the specified id + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **id** | **string**| | + +### Return type + +[***os.File**](*os.File.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: image/gif, image/jpeg, image/png + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/ManagedServiceProviderApi.md b/jcapiv2/docs/ManagedServiceProviderApi.md new file mode 100644 index 0000000..18f6447 --- /dev/null +++ b/jcapiv2/docs/ManagedServiceProviderApi.md @@ -0,0 +1,414 @@ +# {{classname}} + +All URIs are relative to *https://console.jumpcloud.com/api/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**AdministratorOrganizationsCreateByAdministrator**](ManagedServiceProviderApi.md#AdministratorOrganizationsCreateByAdministrator) | **Post** /administrators/{id}/organizationlinks | Allow Adminstrator access to an Organization. +[**AdministratorOrganizationsListByAdministrator**](ManagedServiceProviderApi.md#AdministratorOrganizationsListByAdministrator) | **Get** /administrators/{id}/organizationlinks | List the association links between an Administrator and Organizations. +[**AdministratorOrganizationsListByOrganization**](ManagedServiceProviderApi.md#AdministratorOrganizationsListByOrganization) | **Get** /organizations/{id}/administratorlinks | List the association links between an Organization and Administrators. +[**AdministratorOrganizationsRemoveByAdministrator**](ManagedServiceProviderApi.md#AdministratorOrganizationsRemoveByAdministrator) | **Delete** /administrators/{administrator_id}/organizationlinks/{id} | Remove association between an Administrator and an Organization. +[**ProviderOrganizationsUpdateOrg**](ManagedServiceProviderApi.md#ProviderOrganizationsUpdateOrg) | **Put** /providers/{provider_id}/organizations/{id} | Update Provider Organization +[**ProvidersGetProvider**](ManagedServiceProviderApi.md#ProvidersGetProvider) | **Get** /providers/{provider_id} | Retrieve Provider +[**ProvidersListAdministrators**](ManagedServiceProviderApi.md#ProvidersListAdministrators) | **Get** /providers/{provider_id}/administrators | List Provider Administrators +[**ProvidersListOrganizations**](ManagedServiceProviderApi.md#ProvidersListOrganizations) | **Get** /providers/{provider_id}/organizations | List Provider Organizations +[**ProvidersPostAdmins**](ManagedServiceProviderApi.md#ProvidersPostAdmins) | **Post** /providers/{provider_id}/administrators | Create a new Provider Administrator +[**ProvidersRetrieveInvoice**](ManagedServiceProviderApi.md#ProvidersRetrieveInvoice) | **Get** /providers/{provider_id}/invoices/{ID} | Download a provider's invoice. +[**ProvidersRetrieveInvoices**](ManagedServiceProviderApi.md#ProvidersRetrieveInvoices) | **Get** /providers/{provider_id}/invoices | List a provider's invoices. + +# **AdministratorOrganizationsCreateByAdministrator** +> AdministratorOrganizationLink AdministratorOrganizationsCreateByAdministrator(ctx, id, optional) +Allow Adminstrator access to an Organization. + +This endpoint allows you to grant Administrator access to an Organization. + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **id** | **string**| | + **optional** | ***ManagedServiceProviderApiAdministratorOrganizationsCreateByAdministratorOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a ManagedServiceProviderApiAdministratorOrganizationsCreateByAdministratorOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **body** | [**optional.Interface of AdministratorOrganizationLinkReq**](AdministratorOrganizationLinkReq.md)| | + +### Return type + +[**AdministratorOrganizationLink**](AdministratorOrganizationLink.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **AdministratorOrganizationsListByAdministrator** +> []AdministratorOrganizationLink AdministratorOrganizationsListByAdministrator(ctx, id, optional) +List the association links between an Administrator and Organizations. + +This endpoint returns the association links between an Administrator and Organizations. + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **id** | **string**| | + **optional** | ***ManagedServiceProviderApiAdministratorOrganizationsListByAdministratorOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a ManagedServiceProviderApiAdministratorOrganizationsListByAdministratorOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **limit** | **optional.Int32**| The number of records to return at once. Limited to 100. | [default to 10] + **skip** | **optional.Int32**| The offset into the records to return. | [default to 0] + +### Return type + +[**[]AdministratorOrganizationLink**](AdministratorOrganizationLink.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **AdministratorOrganizationsListByOrganization** +> []AdministratorOrganizationLink AdministratorOrganizationsListByOrganization(ctx, id, optional) +List the association links between an Organization and Administrators. + +This endpoint returns the association links between an Organization and Administrators. + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **id** | **string**| | + **optional** | ***ManagedServiceProviderApiAdministratorOrganizationsListByOrganizationOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a ManagedServiceProviderApiAdministratorOrganizationsListByOrganizationOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **limit** | **optional.Int32**| The number of records to return at once. Limited to 100. | [default to 10] + **skip** | **optional.Int32**| The offset into the records to return. | [default to 0] + +### Return type + +[**[]AdministratorOrganizationLink**](AdministratorOrganizationLink.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **AdministratorOrganizationsRemoveByAdministrator** +> AdministratorOrganizationsRemoveByAdministrator(ctx, administratorId, id) +Remove association between an Administrator and an Organization. + +This endpoint removes the association link between an Administrator and an Organization. + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **administratorId** | **string**| | + **id** | **string**| | + +### Return type + + (empty response body) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **ProviderOrganizationsUpdateOrg** +> Organization ProviderOrganizationsUpdateOrg(ctx, providerId, id, optional) +Update Provider Organization + +This endpoint updates a provider's organization + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **providerId** | **string**| | + **id** | **string**| | + **optional** | ***ManagedServiceProviderApiProviderOrganizationsUpdateOrgOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a ManagedServiceProviderApiProviderOrganizationsUpdateOrgOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + **body** | [**optional.Interface of Organization**](Organization.md)| | + +### Return type + +[**Organization**](Organization.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **ProvidersGetProvider** +> Provider ProvidersGetProvider(ctx, providerId, optional) +Retrieve Provider + +This endpoint returns details about a provider + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **providerId** | **string**| | + **optional** | ***ManagedServiceProviderApiProvidersGetProviderOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a ManagedServiceProviderApiProvidersGetProviderOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **fields** | [**optional.Interface of []string**](string.md)| The comma separated fields included in the returned records. If omitted, the default list of fields will be returned. | + +### Return type + +[**Provider**](Provider.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **ProvidersListAdministrators** +> InlineResponse20012 ProvidersListAdministrators(ctx, providerId, optional) +List Provider Administrators + +This endpoint returns a list of the Administrators associated with the Provider. You must be associated with the provider to use this route. + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **providerId** | **string**| | + **optional** | ***ManagedServiceProviderApiProvidersListAdministratorsOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a ManagedServiceProviderApiProvidersListAdministratorsOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **fields** | [**optional.Interface of []string**](string.md)| The comma separated fields included in the returned records. If omitted, the default list of fields will be returned. | + **filter** | [**optional.Interface of []string**](string.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | + **limit** | **optional.Int32**| The number of records to return at once. Limited to 100. | [default to 10] + **skip** | **optional.Int32**| The offset into the records to return. | [default to 0] + **sort** | [**optional.Interface of []string**](string.md)| The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. | + +### Return type + +[**InlineResponse20012**](inline_response_200_12.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **ProvidersListOrganizations** +> InlineResponse20013 ProvidersListOrganizations(ctx, providerId, optional) +List Provider Organizations + +This endpoint returns a list of the Organizations associated with the Provider. You must be associated with the provider to use this route. + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **providerId** | **string**| | + **optional** | ***ManagedServiceProviderApiProvidersListOrganizationsOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a ManagedServiceProviderApiProvidersListOrganizationsOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **fields** | [**optional.Interface of []string**](string.md)| The comma separated fields included in the returned records. If omitted, the default list of fields will be returned. | + **filter** | [**optional.Interface of []string**](string.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | + **limit** | **optional.Int32**| The number of records to return at once. Limited to 100. | [default to 10] + **skip** | **optional.Int32**| The offset into the records to return. | [default to 0] + **sort** | [**optional.Interface of []string**](string.md)| The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. | + +### Return type + +[**InlineResponse20013**](inline_response_200_13.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **ProvidersPostAdmins** +> Administrator ProvidersPostAdmins(ctx, providerId, optional) +Create a new Provider Administrator + +This endpoint allows you to create a provider administrator. You must be associated with the provider to use this route. You must provide either `role` or `roleName`. + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **providerId** | **string**| | + **optional** | ***ManagedServiceProviderApiProvidersPostAdminsOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a ManagedServiceProviderApiProvidersPostAdminsOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **body** | [**optional.Interface of ProviderAdminReq**](ProviderAdminReq.md)| | + +### Return type + +[**Administrator**](Administrator.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **ProvidersRetrieveInvoice** +> *os.File ProvidersRetrieveInvoice(ctx, providerId, iD) +Download a provider's invoice. + +Retrieves an invoice for this provider. You must be associated to the provider to use this endpoint. + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **providerId** | **string**| | + **iD** | **string**| | + +### Return type + +[***os.File**](*os.File.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/pdf + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **ProvidersRetrieveInvoices** +> ProviderInvoiceResponse ProvidersRetrieveInvoices(ctx, providerId, optional) +List a provider's invoices. + +Retrieves a list of invoices for this provider. You must be associated to the provider to use this endpoint. + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **providerId** | **string**| | + **optional** | ***ManagedServiceProviderApiProvidersRetrieveInvoicesOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a ManagedServiceProviderApiProvidersRetrieveInvoicesOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **skip** | **optional.Int32**| The offset into the records to return. | [default to 0] + **sort** | [**optional.Interface of []string**](string.md)| The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. | + **limit** | **optional.Int32**| The number of records to return at once. Limited to 100. | [default to 10] + +### Return type + +[**ProviderInvoiceResponse**](ProviderInvoiceResponse.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/MemberSuggestion.md b/jcapiv2/docs/MemberSuggestion.md new file mode 100644 index 0000000..dc8fa60 --- /dev/null +++ b/jcapiv2/docs/MemberSuggestion.md @@ -0,0 +1,10 @@ +# MemberSuggestion + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Object** | [***GraphObject**](GraphObject.md) | | [optional] [default to null] +**Op** | **string** | How to modify group membership. | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/MemberSuggestionsPostResult.md b/jcapiv2/docs/MemberSuggestionsPostResult.md new file mode 100644 index 0000000..e48ee7a --- /dev/null +++ b/jcapiv2/docs/MemberSuggestionsPostResult.md @@ -0,0 +1,10 @@ +# MemberSuggestionsPostResult + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**SuggestionsFound** | **[]string** | | [optional] [default to null] +**SuggestionsNotFound** | **[]string** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/ModelError.md b/jcapiv2/docs/ModelError.md new file mode 100644 index 0000000..55e4d31 --- /dev/null +++ b/jcapiv2/docs/ModelError.md @@ -0,0 +1,11 @@ +# ModelError + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Code** | **int32** | HTTP status code | [optional] [default to null] +**Message** | **string** | Error message | [optional] [default to null] +**Status** | **string** | HTTP status description | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/Office365Api.md b/jcapiv2/docs/Office365Api.md new file mode 100644 index 0000000..27a8f47 --- /dev/null +++ b/jcapiv2/docs/Office365Api.md @@ -0,0 +1,422 @@ +# {{classname}} + +All URIs are relative to *https://console.jumpcloud.com/api/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**GraphOffice365AssociationsList**](Office365Api.md#GraphOffice365AssociationsList) | **Get** /office365s/{office365_id}/associations | List the associations of an Office 365 instance +[**GraphOffice365AssociationsPost**](Office365Api.md#GraphOffice365AssociationsPost) | **Post** /office365s/{office365_id}/associations | Manage the associations of an Office 365 instance +[**GraphOffice365TraverseUser**](Office365Api.md#GraphOffice365TraverseUser) | **Get** /office365s/{office365_id}/users | List the Users bound to an Office 365 instance +[**GraphOffice365TraverseUserGroup**](Office365Api.md#GraphOffice365TraverseUserGroup) | **Get** /office365s/{office365_id}/usergroups | List the User Groups bound to an Office 365 instance +[**Office365sGet**](Office365Api.md#Office365sGet) | **Get** /office365s/{office365_id} | Get Office 365 instance +[**Office365sListImportUsers**](Office365Api.md#Office365sListImportUsers) | **Get** /office365s/{office365_id}/import/users | Get a list of users to import from an Office 365 instance +[**Office365sPatch**](Office365Api.md#Office365sPatch) | **Patch** /office365s/{office365_id} | Update existing Office 365 instance. +[**TranslationRulesOffice365Delete**](Office365Api.md#TranslationRulesOffice365Delete) | **Delete** /office365s/{office365_id}/translationrules/{id} | Deletes a Office 365 translation rule +[**TranslationRulesOffice365Get**](Office365Api.md#TranslationRulesOffice365Get) | **Get** /office365s/{office365_id}/translationrules/{id} | Gets a specific Office 365 translation rule +[**TranslationRulesOffice365List**](Office365Api.md#TranslationRulesOffice365List) | **Get** /office365s/{office365_id}/translationrules | List all the Office 365 Translation Rules +[**TranslationRulesOffice365Post**](Office365Api.md#TranslationRulesOffice365Post) | **Post** /office365s/{office365_id}/translationrules | Create a new Office 365 Translation Rule + +# **GraphOffice365AssociationsList** +> []GraphConnection GraphOffice365AssociationsList(ctx, office365Id, targets, optional) +List the associations of an Office 365 instance + +This endpoint returns _direct_ associations of an Office 365 instance. A direct association can be a non-homogeneous relationship between 2 different objects, for example Office 365 and Users. #### Sample Request ``` curl -X GET 'https://console.jumpcloud.com/api/v2/office365s/{OFFICE365_ID}/associations?targets=user_group' \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **office365Id** | **string**| ObjectID of the Office 365 instance. | + **targets** | [**[]string**](string.md)| Targets which a \"office_365\" can be associated to. | + **optional** | ***Office365ApiGraphOffice365AssociationsListOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a Office365ApiGraphOffice365AssociationsListOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + **limit** | **optional.Int32**| The number of records to return at once. Limited to 100. | [default to 10] + **skip** | **optional.Int32**| The offset into the records to return. | [default to 0] + **xOrgId** | **optional.String**| Organization identifier that can be obtained from console settings. | + +### Return type + +[**[]GraphConnection**](GraphConnection.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GraphOffice365AssociationsPost** +> GraphOffice365AssociationsPost(ctx, office365Id, optional) +Manage the associations of an Office 365 instance + +This endpoint allows you to manage the _direct_ associations of a Office 365 instance. A direct association can be a non-homogeneous relationship between 2 different objects, for example Office 365 and Users. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/office365s/{OFFICE365_ID}/associations \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"op\": \"add\", \"type\": \"user_group\", \"id\": \"{Group_ID}\" }' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **office365Id** | **string**| ObjectID of the Office 365 instance. | + **optional** | ***Office365ApiGraphOffice365AssociationsPostOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a Office365ApiGraphOffice365AssociationsPostOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **body** | [**optional.Interface of GraphOperationOffice365**](GraphOperationOffice365.md)| | + **xOrgId** | **optional.**| Organization identifier that can be obtained from console settings. | + +### Return type + + (empty response body) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GraphOffice365TraverseUser** +> []GraphObjectWithPaths GraphOffice365TraverseUser(ctx, office365Id, optional) +List the Users bound to an Office 365 instance + +This endpoint will return all Users bound to an Office 365 instance, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this Office 365 instance to the corresponding User; this array represents all grouping and/or associations that would have to be removed to deprovision the User from this Office 365 instance. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/office365s/{OFFICE365_ID}/users \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **office365Id** | **string**| ObjectID of the Office 365 suite. | + **optional** | ***Office365ApiGraphOffice365TraverseUserOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a Office365ApiGraphOffice365TraverseUserOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **limit** | **optional.Int32**| The number of records to return at once. Limited to 100. | [default to 10] + **xOrgId** | **optional.String**| Organization identifier that can be obtained from console settings. | + **skip** | **optional.Int32**| The offset into the records to return. | [default to 0] + **filter** | [**optional.Interface of []string**](string.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | + +### Return type + +[**[]GraphObjectWithPaths**](GraphObjectWithPaths.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GraphOffice365TraverseUserGroup** +> []GraphObjectWithPaths GraphOffice365TraverseUserGroup(ctx, office365Id, optional) +List the User Groups bound to an Office 365 instance + +This endpoint will return all Users Groups bound to an Office 365 instance, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the group's type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this Office 365 instance to the corresponding User Group; this array represents all grouping and/or associations that would have to be removed to deprovision the User Group from this Office 365 instance. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/office365s/{OFFICE365_ID/usergroups \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **office365Id** | **string**| ObjectID of the Office 365 suite. | + **optional** | ***Office365ApiGraphOffice365TraverseUserGroupOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a Office365ApiGraphOffice365TraverseUserGroupOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **limit** | **optional.Int32**| The number of records to return at once. Limited to 100. | [default to 10] + **xOrgId** | **optional.String**| Organization identifier that can be obtained from console settings. | + **skip** | **optional.Int32**| The offset into the records to return. | [default to 0] + **filter** | [**optional.Interface of []string**](string.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | + +### Return type + +[**[]GraphObjectWithPaths**](GraphObjectWithPaths.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **Office365sGet** +> Office365Output Office365sGet(ctx, office365Id, optional) +Get Office 365 instance + +This endpoint returns a specific Office 365 instance. ##### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/office365s/{OFFICE365_ID} \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **office365Id** | **string**| ObjectID of the Office 365 instance. | + **optional** | ***Office365ApiOffice365sGetOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a Office365ApiOffice365sGetOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **xOrgId** | **optional.String**| Organization identifier that can be obtained from console settings. | + +### Return type + +[**Office365Output**](office365-output.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **Office365sListImportUsers** +> InlineResponse20011 Office365sListImportUsers(ctx, office365Id, optional) +Get a list of users to import from an Office 365 instance + +Lists Office 365 users available for import. + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **office365Id** | **string**| | + **optional** | ***Office365ApiOffice365sListImportUsersOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a Office365ApiOffice365sListImportUsersOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **consistencyLevel** | **optional.String**| Defines the consistency header for O365 requests. See https://docs.microsoft.com/en-us/graph/api/user-list?view=graph-rest-1.0&tabs=http#request-headers | + **top** | **optional.Int32**| Office 365 API maximum number of results per page. See https://docs.microsoft.com/en-us/graph/paging. | + **skipToken** | **optional.String**| Office 365 API token used to access the next page of results. See https://docs.microsoft.com/en-us/graph/paging. | + **filter** | **optional.String**| Office 365 API filter parameter. See https://docs.microsoft.com/en-us/graph/api/user-list?view=graph-rest-1.0&tabs=http#optional-query-parameters. | + **search** | **optional.String**| Office 365 API search parameter. See https://docs.microsoft.com/en-us/graph/api/user-list?view=graph-rest-1.0&tabs=http#optional-query-parameters. | + **orderby** | **optional.String**| Office 365 API orderby parameter. See https://docs.microsoft.com/en-us/graph/api/user-list?view=graph-rest-1.0&tabs=http#optional-query-parameters. | + **count** | **optional.Bool**| Office 365 API count parameter. See https://docs.microsoft.com/en-us/graph/api/user-list?view=graph-rest-1.0&tabs=http#optional-query-parameters. | + +### Return type + +[**InlineResponse20011**](inline_response_200_11.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **Office365sPatch** +> Office365Output Office365sPatch(ctx, office365Id, optional) +Update existing Office 365 instance. + +This endpoint allows updating some attributes of an Office 365 instance. ##### Sample Request ``` curl -X PATCH https://console.jumpcloud.com/api/v2/office365s/{OFFICE365_ID} \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"userLockoutAction\": \"maintain\", \"userPasswordExpirationAction\": \"suspend\" }' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **office365Id** | **string**| ObjectID of the Office 365 instance. | + **optional** | ***Office365ApiOffice365sPatchOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a Office365ApiOffice365sPatchOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **body** | [**optional.Interface of Office365PatchInput**](Office365PatchInput.md)| | + **xOrgId** | **optional.**| Organization identifier that can be obtained from console settings. | + +### Return type + +[**Office365Output**](office365-output.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **TranslationRulesOffice365Delete** +> TranslationRulesOffice365Delete(ctx, office365Id, id) +Deletes a Office 365 translation rule + +This endpoint allows you to delete a translation rule for a specific Office 365 instance. These rules specify how JumpCloud attributes translate to [Microsoft Graph](https://developer.microsoft.com/en-us/graph) attributes. #### Sample Request ``` curl -X DELETE https://console.jumpcloud.com/api/v2/office365s/{office365_id}/translationrules/{id} \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **office365Id** | **string**| | + **id** | **string**| | + +### Return type + + (empty response body) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **TranslationRulesOffice365Get** +> Office365TranslationRule TranslationRulesOffice365Get(ctx, office365Id, id) +Gets a specific Office 365 translation rule + +This endpoint returns a specific translation rule for a specific Office 365 instance. These rules specify how JumpCloud attributes translate to [Microsoft Graph](https://developer.microsoft.com/en-us/graph) attributes. ###### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/office365s/{office365_id}/translationrules/{id} \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **office365Id** | **string**| | + **id** | **string**| | + +### Return type + +[**Office365TranslationRule**](Office365TranslationRule.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **TranslationRulesOffice365List** +> []Office365TranslationRule TranslationRulesOffice365List(ctx, office365Id, optional) +List all the Office 365 Translation Rules + +This endpoint returns all translation rules for a specific Office 365 instance. These rules specify how JumpCloud attributes translate to [Microsoft Graph](https://developer.microsoft.com/en-us/graph) attributes. ##### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/office365s/{office365_id}/translationrules \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **office365Id** | **string**| | + **optional** | ***Office365ApiTranslationRulesOffice365ListOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a Office365ApiTranslationRulesOffice365ListOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **fields** | [**optional.Interface of []string**](string.md)| The comma separated fields included in the returned records. If omitted, the default list of fields will be returned. | + **filter** | [**optional.Interface of []string**](string.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | + **limit** | **optional.Int32**| The number of records to return at once. Limited to 100. | [default to 10] + **skip** | **optional.Int32**| The offset into the records to return. | [default to 0] + **sort** | [**optional.Interface of []string**](string.md)| The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. | + +### Return type + +[**[]Office365TranslationRule**](Office365TranslationRule.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **TranslationRulesOffice365Post** +> Office365TranslationRule TranslationRulesOffice365Post(ctx, office365Id, optional) +Create a new Office 365 Translation Rule + +This endpoint allows you to create a translation rule for a specific Office 365 instance. These rules specify how JumpCloud attributes translate to [Microsoft Graph](https://developer.microsoft.com/en-us/graph) attributes. ##### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/office365s/{office365_id}/translationrules \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ {Translation Rule Parameters} }' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **office365Id** | **string**| | + **optional** | ***Office365ApiTranslationRulesOffice365PostOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a Office365ApiTranslationRulesOffice365PostOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **body** | [**optional.Interface of Office365TranslationRuleRequest**](Office365TranslationRuleRequest.md)| | + +### Return type + +[**Office365TranslationRule**](Office365TranslationRule.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/v2/docs/Office365BuiltinTranslation.md b/jcapiv2/docs/Office365BuiltinTranslation.md similarity index 99% rename from v2/docs/Office365BuiltinTranslation.md rename to jcapiv2/docs/Office365BuiltinTranslation.md index 8a1c834..85c43f4 100644 --- a/v2/docs/Office365BuiltinTranslation.md +++ b/jcapiv2/docs/Office365BuiltinTranslation.md @@ -6,4 +6,3 @@ Name | Type | Description | Notes [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/jcapiv2/docs/Office365DirectionTranslation.md b/jcapiv2/docs/Office365DirectionTranslation.md new file mode 100644 index 0000000..dd1d2f3 --- /dev/null +++ b/jcapiv2/docs/Office365DirectionTranslation.md @@ -0,0 +1,8 @@ +# Office365DirectionTranslation + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/Office365ImportApi.md b/jcapiv2/docs/Office365ImportApi.md new file mode 100644 index 0000000..c25171f --- /dev/null +++ b/jcapiv2/docs/Office365ImportApi.md @@ -0,0 +1,50 @@ +# {{classname}} + +All URIs are relative to *https://console.jumpcloud.com/api/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**Office365sListImportUsers**](Office365ImportApi.md#Office365sListImportUsers) | **Get** /office365s/{office365_id}/import/users | Get a list of users to import from an Office 365 instance + +# **Office365sListImportUsers** +> InlineResponse20011 Office365sListImportUsers(ctx, office365Id, optional) +Get a list of users to import from an Office 365 instance + +Lists Office 365 users available for import. + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **office365Id** | **string**| | + **optional** | ***Office365ImportApiOffice365sListImportUsersOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a Office365ImportApiOffice365sListImportUsersOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **consistencyLevel** | **optional.String**| Defines the consistency header for O365 requests. See https://docs.microsoft.com/en-us/graph/api/user-list?view=graph-rest-1.0&tabs=http#request-headers | + **top** | **optional.Int32**| Office 365 API maximum number of results per page. See https://docs.microsoft.com/en-us/graph/paging. | + **skipToken** | **optional.String**| Office 365 API token used to access the next page of results. See https://docs.microsoft.com/en-us/graph/paging. | + **filter** | **optional.String**| Office 365 API filter parameter. See https://docs.microsoft.com/en-us/graph/api/user-list?view=graph-rest-1.0&tabs=http#optional-query-parameters. | + **search** | **optional.String**| Office 365 API search parameter. See https://docs.microsoft.com/en-us/graph/api/user-list?view=graph-rest-1.0&tabs=http#optional-query-parameters. | + **orderby** | **optional.String**| Office 365 API orderby parameter. See https://docs.microsoft.com/en-us/graph/api/user-list?view=graph-rest-1.0&tabs=http#optional-query-parameters. | + **count** | **optional.Bool**| Office 365 API count parameter. See https://docs.microsoft.com/en-us/graph/api/user-list?view=graph-rest-1.0&tabs=http#optional-query-parameters. | + +### Return type + +[**InlineResponse20011**](inline_response_200_11.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/Office365Output.md b/jcapiv2/docs/Office365Output.md new file mode 100644 index 0000000..4b76e6f --- /dev/null +++ b/jcapiv2/docs/Office365Output.md @@ -0,0 +1,13 @@ +# Office365Output + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**GroupsEnabled** | **bool** | | [optional] [default to null] +**Id** | **string** | | [default to null] +**Name** | **string** | | [optional] [default to null] +**UserLockoutAction** | **string** | | [default to null] +**UserPasswordExpirationAction** | **string** | | [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/Office365PatchInput.md b/jcapiv2/docs/Office365PatchInput.md new file mode 100644 index 0000000..9e04818 --- /dev/null +++ b/jcapiv2/docs/Office365PatchInput.md @@ -0,0 +1,12 @@ +# Office365PatchInput + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**GroupsEnabled** | **bool** | | [optional] [default to null] +**Name** | **string** | | [optional] [default to null] +**UserLockoutAction** | **string** | | [optional] [default to null] +**UserPasswordExpirationAction** | **string** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/v2/docs/Office365TranslationRule.md b/jcapiv2/docs/Office365TranslationRule.md similarity index 81% rename from v2/docs/Office365TranslationRule.md rename to jcapiv2/docs/Office365TranslationRule.md index 4c3af60..82b9eb7 100644 --- a/v2/docs/Office365TranslationRule.md +++ b/jcapiv2/docs/Office365TranslationRule.md @@ -4,8 +4,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **BuiltIn** | [***Office365BuiltinTranslation**](Office365BuiltinTranslation.md) | | [optional] [default to null] +**Direction** | [***Office365DirectionTranslation**](Office365DirectionTranslation.md) | | [optional] [default to null] **Id** | **string** | ObjectId uniquely identifying a Translation Rule. | [optional] [default to null] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/v2/docs/Office365TranslationRuleRequest.md b/jcapiv2/docs/Office365TranslationRuleRequest.md similarity index 77% rename from v2/docs/Office365TranslationRuleRequest.md rename to jcapiv2/docs/Office365TranslationRuleRequest.md index f2edfd9..fc17e9e 100644 --- a/v2/docs/Office365TranslationRuleRequest.md +++ b/jcapiv2/docs/Office365TranslationRuleRequest.md @@ -4,7 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **BuiltIn** | [***Office365BuiltinTranslation**](Office365BuiltinTranslation.md) | | [optional] [default to null] +**Direction** | [***Office365DirectionTranslation**](Office365DirectionTranslation.md) | | [optional] [default to null] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/jcapiv2/docs/Organization.md b/jcapiv2/docs/Organization.md new file mode 100644 index 0000000..de608a1 --- /dev/null +++ b/jcapiv2/docs/Organization.md @@ -0,0 +1,11 @@ +# Organization + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Id** | **string** | | [optional] [default to null] +**MaxSystemUsers** | **int32** | The maximum number of users allowed in this organization. Requires organizations.billing scope to modify. | [optional] [default to null] +**Name** | **string** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/OrganizationCase.md b/jcapiv2/docs/OrganizationCase.md new file mode 100644 index 0000000..c23e09e --- /dev/null +++ b/jcapiv2/docs/OrganizationCase.md @@ -0,0 +1,16 @@ +# OrganizationCase + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**CaseNumber** | **string** | | [optional] [default to null] +**Date** | **string** | | [optional] [default to null] +**Description** | **string** | | [optional] [default to null] +**Label** | **string** | | [optional] [default to null] +**Reporter** | **string** | | [optional] [default to null] +**ReporterEmail** | **string** | | [optional] [default to null] +**Status** | **string** | | [optional] [default to null] +**Subject** | **string** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/OrganizationCasesResponse.md b/jcapiv2/docs/OrganizationCasesResponse.md new file mode 100644 index 0000000..2bdf440 --- /dev/null +++ b/jcapiv2/docs/OrganizationCasesResponse.md @@ -0,0 +1,10 @@ +# OrganizationCasesResponse + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Results** | [**[]OrganizationCase**](OrganizationCase.md) | | [optional] [default to null] +**TotalCount** | **int32** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/OrganizationsApi.md b/jcapiv2/docs/OrganizationsApi.md new file mode 100644 index 0000000..814fb93 --- /dev/null +++ b/jcapiv2/docs/OrganizationsApi.md @@ -0,0 +1,187 @@ +# {{classname}} + +All URIs are relative to *https://console.jumpcloud.com/api/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**AdministratorOrganizationsCreateByAdministrator**](OrganizationsApi.md#AdministratorOrganizationsCreateByAdministrator) | **Post** /administrators/{id}/organizationlinks | Allow Adminstrator access to an Organization. +[**AdministratorOrganizationsListByAdministrator**](OrganizationsApi.md#AdministratorOrganizationsListByAdministrator) | **Get** /administrators/{id}/organizationlinks | List the association links between an Administrator and Organizations. +[**AdministratorOrganizationsListByOrganization**](OrganizationsApi.md#AdministratorOrganizationsListByOrganization) | **Get** /organizations/{id}/administratorlinks | List the association links between an Organization and Administrators. +[**AdministratorOrganizationsRemoveByAdministrator**](OrganizationsApi.md#AdministratorOrganizationsRemoveByAdministrator) | **Delete** /administrators/{administrator_id}/organizationlinks/{id} | Remove association between an Administrator and an Organization. +[**OrganizationsListCases**](OrganizationsApi.md#OrganizationsListCases) | **Get** /organizations/cases | Get all cases (Support/Feature requests) for organization + +# **AdministratorOrganizationsCreateByAdministrator** +> AdministratorOrganizationLink AdministratorOrganizationsCreateByAdministrator(ctx, id, optional) +Allow Adminstrator access to an Organization. + +This endpoint allows you to grant Administrator access to an Organization. + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **id** | **string**| | + **optional** | ***OrganizationsApiAdministratorOrganizationsCreateByAdministratorOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a OrganizationsApiAdministratorOrganizationsCreateByAdministratorOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **body** | [**optional.Interface of AdministratorOrganizationLinkReq**](AdministratorOrganizationLinkReq.md)| | + +### Return type + +[**AdministratorOrganizationLink**](AdministratorOrganizationLink.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **AdministratorOrganizationsListByAdministrator** +> []AdministratorOrganizationLink AdministratorOrganizationsListByAdministrator(ctx, id, optional) +List the association links between an Administrator and Organizations. + +This endpoint returns the association links between an Administrator and Organizations. + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **id** | **string**| | + **optional** | ***OrganizationsApiAdministratorOrganizationsListByAdministratorOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a OrganizationsApiAdministratorOrganizationsListByAdministratorOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **limit** | **optional.Int32**| The number of records to return at once. Limited to 100. | [default to 10] + **skip** | **optional.Int32**| The offset into the records to return. | [default to 0] + +### Return type + +[**[]AdministratorOrganizationLink**](AdministratorOrganizationLink.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **AdministratorOrganizationsListByOrganization** +> []AdministratorOrganizationLink AdministratorOrganizationsListByOrganization(ctx, id, optional) +List the association links between an Organization and Administrators. + +This endpoint returns the association links between an Organization and Administrators. + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **id** | **string**| | + **optional** | ***OrganizationsApiAdministratorOrganizationsListByOrganizationOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a OrganizationsApiAdministratorOrganizationsListByOrganizationOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **limit** | **optional.Int32**| The number of records to return at once. Limited to 100. | [default to 10] + **skip** | **optional.Int32**| The offset into the records to return. | [default to 0] + +### Return type + +[**[]AdministratorOrganizationLink**](AdministratorOrganizationLink.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **AdministratorOrganizationsRemoveByAdministrator** +> AdministratorOrganizationsRemoveByAdministrator(ctx, administratorId, id) +Remove association between an Administrator and an Organization. + +This endpoint removes the association link between an Administrator and an Organization. + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **administratorId** | **string**| | + **id** | **string**| | + +### Return type + + (empty response body) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **OrganizationsListCases** +> OrganizationCasesResponse OrganizationsListCases(ctx, optional) +Get all cases (Support/Feature requests) for organization + +This endpoint returns the cases (Support/Feature requests) for the organization + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **optional** | ***OrganizationsApiOrganizationsListCasesOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a OrganizationsApiOrganizationsListCasesOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **skip** | **optional.Int32**| The offset into the records to return. | [default to 0] + **sort** | [**optional.Interface of []string**](string.md)| The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. | + **limit** | **optional.Int32**| The number of records to return at once. Limited to 100. | [default to 10] + +### Return type + +[**OrganizationCasesResponse**](OrganizationCasesResponse.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/OsRestriction.md b/jcapiv2/docs/OsRestriction.md new file mode 100644 index 0000000..57e5f71 --- /dev/null +++ b/jcapiv2/docs/OsRestriction.md @@ -0,0 +1,13 @@ +# OsRestriction + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**AppleRestrictions** | [***OsRestrictionAppleRestrictions**](OSRestriction_appleRestrictions.md) | | [optional] [default to null] +**DeprecatedVersion** | **string** | The version of the OS in which the policy was deprecated | [optional] [default to null] +**EarliestVersion** | **string** | The earliest version of the OS in which the policy can be applied | [optional] [default to null] +**OsName** | **string** | The name of the OS in which this restriction applies | [optional] [default to null] +**SupportedEnrollmentTypes** | **[]string** | This field is deprecated and will be ignored. Use appleRestrictions.supportedEnrollmentTypes instead | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/OsRestrictionAppleRestrictions.md b/jcapiv2/docs/OsRestrictionAppleRestrictions.md new file mode 100644 index 0000000..1497cd0 --- /dev/null +++ b/jcapiv2/docs/OsRestrictionAppleRestrictions.md @@ -0,0 +1,10 @@ +# OsRestrictionAppleRestrictions + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**RequiresSupervision** | **bool** | Boolean representing if the policy requires the Apple devices to be MDM supervised | [optional] [default to null] +**SupportedEnrollmentTypes** | **[]string** | The supported Apple enrollment types for this policy | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/PhoneNumber.md b/jcapiv2/docs/PhoneNumber.md new file mode 100644 index 0000000..5f0bf9a --- /dev/null +++ b/jcapiv2/docs/PhoneNumber.md @@ -0,0 +1,11 @@ +# PhoneNumber + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Id** | **string** | | [optional] [default to null] +**Number** | **string** | | [optional] [default to null] +**Type_** | **string** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/PoliciesApi.md b/jcapiv2/docs/PoliciesApi.md new file mode 100644 index 0000000..9bf1be8 --- /dev/null +++ b/jcapiv2/docs/PoliciesApi.md @@ -0,0 +1,677 @@ +# {{classname}} + +All URIs are relative to *https://console.jumpcloud.com/api/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**GraphPolicyAssociationsList**](PoliciesApi.md#GraphPolicyAssociationsList) | **Get** /policies/{policy_id}/associations | List the associations of a Policy +[**GraphPolicyAssociationsPost**](PoliciesApi.md#GraphPolicyAssociationsPost) | **Post** /policies/{policy_id}/associations | Manage the associations of a Policy +[**GraphPolicyMemberOf**](PoliciesApi.md#GraphPolicyMemberOf) | **Get** /policies/{policy_id}/memberof | List the parent Groups of a Policy +[**GraphPolicyTraverseSystem**](PoliciesApi.md#GraphPolicyTraverseSystem) | **Get** /policies/{policy_id}/systems | List the Systems bound to a Policy +[**GraphPolicyTraverseSystemGroup**](PoliciesApi.md#GraphPolicyTraverseSystemGroup) | **Get** /policies/{policy_id}/systemgroups | List the System Groups bound to a Policy +[**PoliciesDelete**](PoliciesApi.md#PoliciesDelete) | **Delete** /policies/{id} | Deletes a Policy +[**PoliciesGet**](PoliciesApi.md#PoliciesGet) | **Get** /policies/{id} | Gets a specific Policy. +[**PoliciesList**](PoliciesApi.md#PoliciesList) | **Get** /policies | Lists all the Policies +[**PoliciesPost**](PoliciesApi.md#PoliciesPost) | **Post** /policies | Create a new Policy +[**PoliciesPut**](PoliciesApi.md#PoliciesPut) | **Put** /policies/{id} | Update an existing Policy +[**PolicyresultsGet**](PoliciesApi.md#PolicyresultsGet) | **Get** /policyresults/{id} | Get a specific Policy Result. +[**PolicyresultsList**](PoliciesApi.md#PolicyresultsList) | **Get** /policies/{policy_id}/policyresults | Lists all the policy results of a policy. +[**PolicyresultsOrgList**](PoliciesApi.md#PolicyresultsOrgList) | **Get** /policyresults | Lists all of the policy results for an organization. +[**PolicystatusesPoliciesList**](PoliciesApi.md#PolicystatusesPoliciesList) | **Get** /policies/{policy_id}/policystatuses | Lists the latest policy results of a policy. +[**PolicystatusesSystemsList**](PoliciesApi.md#PolicystatusesSystemsList) | **Get** /systems/{system_id}/policystatuses | List the policy statuses for a system +[**PolicytemplatesGet**](PoliciesApi.md#PolicytemplatesGet) | **Get** /policytemplates/{id} | Get a specific Policy Template +[**PolicytemplatesList**](PoliciesApi.md#PolicytemplatesList) | **Get** /policytemplates | Lists all of the Policy Templates + +# **GraphPolicyAssociationsList** +> []GraphConnection GraphPolicyAssociationsList(ctx, policyId, targets, optional) +List the associations of a Policy + +This endpoint returns the _direct_ associations of a Policy. A direct association can be a non-homogeneous relationship between 2 different objects, for example Policies and Systems. #### Sample Request ``` curl -X GET 'https://console.jumpcloud.com/api/v2/policies/{Policy_ID}/associations?targets=system_group \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **policyId** | **string**| ObjectID of the Policy. | + **targets** | [**[]string**](string.md)| Targets which a \"policy\" can be associated to. | + **optional** | ***PoliciesApiGraphPolicyAssociationsListOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a PoliciesApiGraphPolicyAssociationsListOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + **limit** | **optional.Int32**| The number of records to return at once. Limited to 100. | [default to 10] + **skip** | **optional.Int32**| The offset into the records to return. | [default to 0] + **xOrgId** | **optional.String**| Organization identifier that can be obtained from console settings. | + +### Return type + +[**[]GraphConnection**](GraphConnection.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GraphPolicyAssociationsPost** +> GraphPolicyAssociationsPost(ctx, policyId, optional) +Manage the associations of a Policy + +This endpoint allows you to manage the _direct_ associations of a Policy. A direct association can be a non-homogeneous relationship between 2 different objects, for example Policies and Systems. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/policies/{Policy_ID}/associations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"op\": \"add\", \"type\": \"system_group\", \"id\": \"{Group_ID}\" }' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **policyId** | **string**| ObjectID of the Policy. | + **optional** | ***PoliciesApiGraphPolicyAssociationsPostOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a PoliciesApiGraphPolicyAssociationsPostOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **body** | [**optional.Interface of GraphOperationPolicy**](GraphOperationPolicy.md)| | + **xOrgId** | **optional.**| Organization identifier that can be obtained from console settings. | + +### Return type + + (empty response body) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GraphPolicyMemberOf** +> []GraphObjectWithPaths GraphPolicyMemberOf(ctx, policyId, optional) +List the parent Groups of a Policy + +This endpoint returns all the Policy Groups a Policy is a member of. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/policies/{Policy_ID}/memberof \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **policyId** | **string**| ObjectID of the Policy. | + **optional** | ***PoliciesApiGraphPolicyMemberOfOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a PoliciesApiGraphPolicyMemberOfOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **filter** | [**optional.Interface of []string**](string.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | + **limit** | **optional.Int32**| The number of records to return at once. Limited to 100. | [default to 10] + **skip** | **optional.Int32**| The offset into the records to return. | [default to 0] + **date** | **optional.String**| Current date header for the System Context API | + **authorization** | **optional.String**| Authorization header for the System Context API | + **sort** | [**optional.Interface of []string**](string.md)| The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. | + **xOrgId** | **optional.String**| Organization identifier that can be obtained from console settings. | + +### Return type + +[**[]GraphObjectWithPaths**](GraphObjectWithPaths.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GraphPolicyTraverseSystem** +> []GraphObjectWithPaths GraphPolicyTraverseSystem(ctx, policyId, optional) +List the Systems bound to a Policy + +This endpoint will return all Systems bound to a Policy, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this Policy to the corresponding System; this array represents all grouping and/or associations that would have to be removed to deprovision the System from this Policy. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/policies/{Policy_ID}/systems \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **policyId** | **string**| ObjectID of the Command. | + **optional** | ***PoliciesApiGraphPolicyTraverseSystemOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a PoliciesApiGraphPolicyTraverseSystemOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **limit** | **optional.Int32**| The number of records to return at once. Limited to 100. | [default to 10] + **xOrgId** | **optional.String**| Organization identifier that can be obtained from console settings. | + **skip** | **optional.Int32**| The offset into the records to return. | [default to 0] + **filter** | [**optional.Interface of []string**](string.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | + +### Return type + +[**[]GraphObjectWithPaths**](GraphObjectWithPaths.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GraphPolicyTraverseSystemGroup** +> []GraphObjectWithPaths GraphPolicyTraverseSystemGroup(ctx, policyId, optional) +List the System Groups bound to a Policy + +This endpoint will return all Systems Groups bound to a Policy, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the group's type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this Policy to the corresponding System Group; this array represents all grouping and/or associations that would have to be removed to deprovision the System Group from this Policy. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/policies/{Policy_ID}/systemgroups \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **policyId** | **string**| ObjectID of the Command. | + **optional** | ***PoliciesApiGraphPolicyTraverseSystemGroupOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a PoliciesApiGraphPolicyTraverseSystemGroupOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **limit** | **optional.Int32**| The number of records to return at once. Limited to 100. | [default to 10] + **xOrgId** | **optional.String**| Organization identifier that can be obtained from console settings. | + **skip** | **optional.Int32**| The offset into the records to return. | [default to 0] + **filter** | [**optional.Interface of []string**](string.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | + +### Return type + +[**[]GraphObjectWithPaths**](GraphObjectWithPaths.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **PoliciesDelete** +> PoliciesDelete(ctx, id, optional) +Deletes a Policy + +This endpoint allows you to delete a policy. #### Sample Request ``` curl -X DELETE https://console.jumpcloud.com/api/v2/policies/5a837ecd232e110d4291e6b9 \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **id** | **string**| ObjectID of the Policy object. | + **optional** | ***PoliciesApiPoliciesDeleteOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a PoliciesApiPoliciesDeleteOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **xOrgId** | **optional.String**| Organization identifier that can be obtained from console settings. | + +### Return type + + (empty response body) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **PoliciesGet** +> PolicyWithDetails PoliciesGet(ctx, id, optional) +Gets a specific Policy. + +This endpoint returns a specific policy. ###### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/policies/{PolicyID} \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **id** | **string**| ObjectID of the Policy object. | + **optional** | ***PoliciesApiPoliciesGetOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a PoliciesApiPoliciesGetOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **xOrgId** | **optional.String**| Organization identifier that can be obtained from console settings. | + +### Return type + +[**PolicyWithDetails**](PolicyWithDetails.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **PoliciesList** +> []Policy PoliciesList(ctx, optional) +Lists all the Policies + +This endpoint returns all policies. ##### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/policies \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **optional** | ***PoliciesApiPoliciesListOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a PoliciesApiPoliciesListOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **fields** | [**optional.Interface of []string**](string.md)| The comma separated fields included in the returned records. If omitted, the default list of fields will be returned. | + **filter** | [**optional.Interface of []string**](string.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | + **limit** | **optional.Int32**| The number of records to return at once. Limited to 100. | [default to 10] + **skip** | **optional.Int32**| The offset into the records to return. | [default to 0] + **sort** | [**optional.Interface of []string**](string.md)| The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. | + **xOrgId** | **optional.String**| Organization identifier that can be obtained from console settings. | + +### Return type + +[**[]Policy**](Policy.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **PoliciesPost** +> PolicyWithDetails PoliciesPost(ctx, optional) +Create a new Policy + +This endpoint allows you to create a policy. Given the amount of configurable parameters required to create a Policy, we suggest you use the JumpCloud Admin Console to create new policies. ##### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/policies \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ {Policy_Parameters} }' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **optional** | ***PoliciesApiPoliciesPostOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a PoliciesApiPoliciesPostOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**optional.Interface of PolicyRequest**](PolicyRequest.md)| | + **xOrgId** | **optional.**| Organization identifier that can be obtained from console settings. | + +### Return type + +[**PolicyWithDetails**](PolicyWithDetails.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **PoliciesPut** +> Policy PoliciesPut(ctx, id, optional) +Update an existing Policy + +This endpoint allows you to update a policy. Given the amount of configurable parameters required to update a Policy, we suggest you use the JumpCloud Admin Console to create new policies. ##### Sample Request ``` curl -X PUT https://console.jumpcloud.com/api/v2/policies/59fced45c9118022172547ff \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ {Policy_Parameters} }' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **id** | **string**| ObjectID of the Policy object. | + **optional** | ***PoliciesApiPoliciesPutOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a PoliciesApiPoliciesPutOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **body** | [**optional.Interface of PolicyRequest**](PolicyRequest.md)| | + **xOrgId** | **optional.**| Organization identifier that can be obtained from console settings. | + +### Return type + +[**Policy**](Policy.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **PolicyresultsGet** +> PolicyResult PolicyresultsGet(ctx, id, optional) +Get a specific Policy Result. + +This endpoint will return the policy results for a specific policy. ##### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/policyresults/{Policy_ID} \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **id** | **string**| ObjectID of the Policy Result. | + **optional** | ***PoliciesApiPolicyresultsGetOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a PoliciesApiPolicyresultsGetOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **xOrgId** | **optional.String**| Organization identifier that can be obtained from console settings. | + +### Return type + +[**PolicyResult**](PolicyResult.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **PolicyresultsList** +> []PolicyResult PolicyresultsList(ctx, policyId, optional) +Lists all the policy results of a policy. + +This endpoint returns all policies results for a specific policy. ##### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/policies/{Policy_ID}/policyresults \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **policyId** | **string**| | + **optional** | ***PoliciesApiPolicyresultsListOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a PoliciesApiPolicyresultsListOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **fields** | [**optional.Interface of []string**](string.md)| The comma separated fields included in the returned records. If omitted, the default list of fields will be returned. | + **filter** | [**optional.Interface of []string**](string.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | + **limit** | **optional.Int32**| The number of records to return at once. Limited to 100. | [default to 10] + **xOrgId** | **optional.String**| Organization identifier that can be obtained from console settings. | + **skip** | **optional.Int32**| The offset into the records to return. | [default to 0] + **sort** | [**optional.Interface of []string**](string.md)| The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. | + +### Return type + +[**[]PolicyResult**](PolicyResult.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **PolicyresultsOrgList** +> []PolicyResult PolicyresultsOrgList(ctx, optional) +Lists all of the policy results for an organization. + +This endpoint returns all policy results for an organization. ##### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/policyresults \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **optional** | ***PoliciesApiPolicyresultsOrgListOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a PoliciesApiPolicyresultsOrgListOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **fields** | [**optional.Interface of []string**](string.md)| The comma separated fields included in the returned records. If omitted, the default list of fields will be returned. | + **filter** | [**optional.Interface of []string**](string.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | + **limit** | **optional.Int32**| The number of records to return at once. Limited to 100. | [default to 10] + **xOrgId** | **optional.String**| Organization identifier that can be obtained from console settings. | + **skip** | **optional.Int32**| The offset into the records to return. | [default to 0] + **sort** | [**optional.Interface of []string**](string.md)| The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. | + +### Return type + +[**[]PolicyResult**](PolicyResult.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **PolicystatusesPoliciesList** +> []PolicyResult PolicystatusesPoliciesList(ctx, policyId, optional) +Lists the latest policy results of a policy. + +This endpoint returns the latest policy results for a specific policy. ##### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/policies/{Policy_ID}/policystatuses \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **policyId** | **string**| | + **optional** | ***PoliciesApiPolicystatusesPoliciesListOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a PoliciesApiPolicystatusesPoliciesListOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **fields** | [**optional.Interface of []string**](string.md)| The comma separated fields included in the returned records. If omitted, the default list of fields will be returned. | + **filter** | [**optional.Interface of []string**](string.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | + **limit** | **optional.Int32**| The number of records to return at once. Limited to 100. | [default to 10] + **skip** | **optional.Int32**| The offset into the records to return. | [default to 0] + **sort** | [**optional.Interface of []string**](string.md)| The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. | + **xOrgId** | **optional.String**| Organization identifier that can be obtained from console settings. | + +### Return type + +[**[]PolicyResult**](PolicyResult.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **PolicystatusesSystemsList** +> []PolicyResult PolicystatusesSystemsList(ctx, systemId, optional) +List the policy statuses for a system + +This endpoint returns the policy results for a particular system. ##### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/systems/{System_ID}/policystatuses \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **systemId** | **string**| ObjectID of the System. | + **optional** | ***PoliciesApiPolicystatusesSystemsListOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a PoliciesApiPolicystatusesSystemsListOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **fields** | [**optional.Interface of []string**](string.md)| The comma separated fields included in the returned records. If omitted, the default list of fields will be returned. | + **filter** | [**optional.Interface of []string**](string.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | + **limit** | **optional.Int32**| The number of records to return at once. Limited to 100. | [default to 10] + **skip** | **optional.Int32**| The offset into the records to return. | [default to 0] + **sort** | [**optional.Interface of []string**](string.md)| The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. | + **xOrgId** | **optional.String**| Organization identifier that can be obtained from console settings. | + +### Return type + +[**[]PolicyResult**](PolicyResult.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **PolicytemplatesGet** +> PolicyTemplateWithDetails PolicytemplatesGet(ctx, id, optional) +Get a specific Policy Template + +This endpoint returns a specific policy template. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/policytemplates/{Policy_Template_ID}\\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **id** | **string**| ObjectID of the Policy Template. | + **optional** | ***PoliciesApiPolicytemplatesGetOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a PoliciesApiPolicytemplatesGetOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **xOrgId** | **optional.String**| Organization identifier that can be obtained from console settings. | + +### Return type + +[**PolicyTemplateWithDetails**](PolicyTemplateWithDetails.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **PolicytemplatesList** +> []PolicyTemplate PolicytemplatesList(ctx, optional) +Lists all of the Policy Templates + +This endpoint returns all policy templates. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/policytemplates \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **optional** | ***PoliciesApiPolicytemplatesListOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a PoliciesApiPolicytemplatesListOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **fields** | [**optional.Interface of []string**](string.md)| The comma separated fields included in the returned records. If omitted, the default list of fields will be returned. | + **filter** | [**optional.Interface of []string**](string.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | + **limit** | **optional.Int32**| The number of records to return at once. Limited to 100. | [default to 10] + **skip** | **optional.Int32**| The offset into the records to return. | [default to 0] + **sort** | [**optional.Interface of []string**](string.md)| The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. | + **xOrgId** | **optional.String**| Organization identifier that can be obtained from console settings. | + +### Return type + +[**[]PolicyTemplate**](PolicyTemplate.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/v2/docs/Policy.md b/jcapiv2/docs/Policy.md similarity index 99% rename from v2/docs/Policy.md rename to jcapiv2/docs/Policy.md index 211b081..6885649 100644 --- a/v2/docs/Policy.md +++ b/jcapiv2/docs/Policy.md @@ -9,4 +9,3 @@ Name | Type | Description | Notes [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/jcapiv2/docs/PolicyGroup.md b/jcapiv2/docs/PolicyGroup.md new file mode 100644 index 0000000..2589ae9 --- /dev/null +++ b/jcapiv2/docs/PolicyGroup.md @@ -0,0 +1,14 @@ +# PolicyGroup + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Attributes** | [***GraphAttributes**](GraphAttributes.md) | | [optional] [default to null] +**Description** | **string** | Description of a Policy Group | [optional] [default to null] +**Email** | **string** | E-mail address associated with a Policy Group | [optional] [default to null] +**Id** | **string** | ObjectId uniquely identifying a Policy Group. | [optional] [default to null] +**Name** | **string** | Display name of a Policy Group. | [optional] [default to null] +**Type_** | **string** | The type of the group; always 'policy' for a Policy Group. | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/PolicyGroupAssociationsApi.md b/jcapiv2/docs/PolicyGroupAssociationsApi.md new file mode 100644 index 0000000..994e6ef --- /dev/null +++ b/jcapiv2/docs/PolicyGroupAssociationsApi.md @@ -0,0 +1,166 @@ +# {{classname}} + +All URIs are relative to *https://console.jumpcloud.com/api/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**GraphPolicyGroupAssociationsList**](PolicyGroupAssociationsApi.md#GraphPolicyGroupAssociationsList) | **Get** /policygroups/{group_id}/associations | List the associations of a Policy Group. +[**GraphPolicyGroupAssociationsPost**](PolicyGroupAssociationsApi.md#GraphPolicyGroupAssociationsPost) | **Post** /policygroups/{group_id}/associations | Manage the associations of a Policy Group +[**GraphPolicyGroupTraverseSystem**](PolicyGroupAssociationsApi.md#GraphPolicyGroupTraverseSystem) | **Get** /policygroups/{group_id}/systems | List the Systems bound to a Policy Group +[**GraphPolicyGroupTraverseSystemGroup**](PolicyGroupAssociationsApi.md#GraphPolicyGroupTraverseSystemGroup) | **Get** /policygroups/{group_id}/systemgroups | List the System Groups bound to Policy Groups + +# **GraphPolicyGroupAssociationsList** +> []GraphConnection GraphPolicyGroupAssociationsList(ctx, groupId, targets, optional) +List the associations of a Policy Group. + +This endpoint returns the _direct_ associations of this Policy Group. A direct association can be a non-homogeneous relationship between 2 different objects, for example Policy Groups and Policies. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/policygroups/{GroupID}/associations?targets=system \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **groupId** | **string**| ObjectID of the Policy Group. | + **targets** | [**[]string**](string.md)| Targets which a \"policy_group\" can be associated to. | + **optional** | ***PolicyGroupAssociationsApiGraphPolicyGroupAssociationsListOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a PolicyGroupAssociationsApiGraphPolicyGroupAssociationsListOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + **limit** | **optional.Int32**| The number of records to return at once. Limited to 100. | [default to 10] + **skip** | **optional.Int32**| The offset into the records to return. | [default to 0] + **xOrgId** | **optional.String**| Organization identifier that can be obtained from console settings. | + +### Return type + +[**[]GraphConnection**](GraphConnection.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GraphPolicyGroupAssociationsPost** +> GraphPolicyGroupAssociationsPost(ctx, groupId, optional) +Manage the associations of a Policy Group + +This endpoint manages the _direct_ associations of this Policy Group. A direct association can be a non-homogeneous relationship between 2 different objects, for example Policy Groups and Policies. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/policygroups/{GroupID}/associations \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"op\": \"add\", \"type\": \"system\", \"id\": \"{SystemID}\" }' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **groupId** | **string**| ObjectID of the Policy Group. | + **optional** | ***PolicyGroupAssociationsApiGraphPolicyGroupAssociationsPostOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a PolicyGroupAssociationsApiGraphPolicyGroupAssociationsPostOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **body** | [**optional.Interface of GraphOperationPolicyGroup**](GraphOperationPolicyGroup.md)| | + **xOrgId** | **optional.**| Organization identifier that can be obtained from console settings. | + +### Return type + + (empty response body) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GraphPolicyGroupTraverseSystem** +> []GraphObjectWithPaths GraphPolicyGroupTraverseSystem(ctx, groupId, optional) +List the Systems bound to a Policy Group + +This endpoint will return all Systems bound to a Policy Group, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this Policy Group to the corresponding System; this array represents all grouping and/or associations that would have to be removed to deprovision the System from this Policy Group. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/policygroups/{GroupID}/systems \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **groupId** | **string**| ObjectID of the Policy Group. | + **optional** | ***PolicyGroupAssociationsApiGraphPolicyGroupTraverseSystemOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a PolicyGroupAssociationsApiGraphPolicyGroupTraverseSystemOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **limit** | **optional.Int32**| The number of records to return at once. Limited to 100. | [default to 10] + **xOrgId** | **optional.String**| Organization identifier that can be obtained from console settings. | + **skip** | **optional.Int32**| The offset into the records to return. | [default to 0] + **filter** | [**optional.Interface of []string**](string.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | + +### Return type + +[**[]GraphObjectWithPaths**](GraphObjectWithPaths.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GraphPolicyGroupTraverseSystemGroup** +> []GraphObjectWithPaths GraphPolicyGroupTraverseSystemGroup(ctx, groupId, optional) +List the System Groups bound to Policy Groups + +This endpoint will return all System Groups bound to a Policy Group, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this Policy Group to the corresponding System Group; this array represents all grouping and/or associations that would have to be removed to deprovision the System Group from this Policy Group. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/policygroups/{GroupID}/systemgroups \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **groupId** | **string**| ObjectID of the Policy Group. | + **optional** | ***PolicyGroupAssociationsApiGraphPolicyGroupTraverseSystemGroupOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a PolicyGroupAssociationsApiGraphPolicyGroupTraverseSystemGroupOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **limit** | **optional.Int32**| The number of records to return at once. Limited to 100. | [default to 10] + **xOrgId** | **optional.String**| Organization identifier that can be obtained from console settings. | + **skip** | **optional.Int32**| The offset into the records to return. | [default to 0] + **filter** | [**optional.Interface of []string**](string.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | + +### Return type + +[**[]GraphObjectWithPaths**](GraphObjectWithPaths.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/PolicyGroupData.md b/jcapiv2/docs/PolicyGroupData.md new file mode 100644 index 0000000..ea1e753 --- /dev/null +++ b/jcapiv2/docs/PolicyGroupData.md @@ -0,0 +1,9 @@ +# PolicyGroupData + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Name** | **string** | Display name of a Policy Group. | [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/PolicyGroupMembersMembershipApi.md b/jcapiv2/docs/PolicyGroupMembersMembershipApi.md new file mode 100644 index 0000000..8c01787 --- /dev/null +++ b/jcapiv2/docs/PolicyGroupMembersMembershipApi.md @@ -0,0 +1,125 @@ +# {{classname}} + +All URIs are relative to *https://console.jumpcloud.com/api/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**GraphPolicyGroupMembersList**](PolicyGroupMembersMembershipApi.md#GraphPolicyGroupMembersList) | **Get** /policygroups/{group_id}/members | List the members of a Policy Group +[**GraphPolicyGroupMembersPost**](PolicyGroupMembersMembershipApi.md#GraphPolicyGroupMembersPost) | **Post** /policygroups/{group_id}/members | Manage the members of a Policy Group +[**GraphPolicyGroupMembership**](PolicyGroupMembersMembershipApi.md#GraphPolicyGroupMembership) | **Get** /policygroups/{group_id}/membership | List the Policy Group's membership + +# **GraphPolicyGroupMembersList** +> []GraphConnection GraphPolicyGroupMembersList(ctx, groupId, optional) +List the members of a Policy Group + +This endpoint returns the Policy members of a Policy Group. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/policygroups/{GroupID}/members \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **groupId** | **string**| ObjectID of the Policy Group. | + **optional** | ***PolicyGroupMembersMembershipApiGraphPolicyGroupMembersListOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a PolicyGroupMembersMembershipApiGraphPolicyGroupMembersListOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **limit** | **optional.Int32**| The number of records to return at once. Limited to 100. | [default to 10] + **skip** | **optional.Int32**| The offset into the records to return. | [default to 0] + **xOrgId** | **optional.String**| Organization identifier that can be obtained from console settings. | + +### Return type + +[**[]GraphConnection**](GraphConnection.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GraphPolicyGroupMembersPost** +> GraphPolicyGroupMembersPost(ctx, groupId, optional) +Manage the members of a Policy Group + +This endpoint allows you to manage the Policy members of a Policy Group. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/policygroups/{GroupID}/members \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"op\": \"add\", \"type\": \"policy\", \"id\": \"{Policy_ID}\" }' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **groupId** | **string**| ObjectID of the Policy Group. | + **optional** | ***PolicyGroupMembersMembershipApiGraphPolicyGroupMembersPostOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a PolicyGroupMembersMembershipApiGraphPolicyGroupMembersPostOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **body** | [**optional.Interface of GraphOperationPolicyGroupMember**](GraphOperationPolicyGroupMember.md)| | + **xOrgId** | **optional.**| Organization identifier that can be obtained from console settings. | + +### Return type + + (empty response body) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GraphPolicyGroupMembership** +> []GraphObjectWithPaths GraphPolicyGroupMembership(ctx, groupId, optional) +List the Policy Group's membership + +This endpoint returns all Policy members that are a member of this Policy Group. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/policygroups/{GroupID}/membership \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **groupId** | **string**| ObjectID of the Policy Group. | + **optional** | ***PolicyGroupMembersMembershipApiGraphPolicyGroupMembershipOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a PolicyGroupMembersMembershipApiGraphPolicyGroupMembershipOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **filter** | [**optional.Interface of []string**](string.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | + **limit** | **optional.Int32**| The number of records to return at once. Limited to 100. | [default to 10] + **skip** | **optional.Int32**| The offset into the records to return. | [default to 0] + **sort** | [**optional.Interface of []string**](string.md)| The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. | + **xOrgId** | **optional.String**| Organization identifier that can be obtained from console settings. | + +### Return type + +[**[]GraphObjectWithPaths**](GraphObjectWithPaths.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/PolicyGroupsApi.md b/jcapiv2/docs/PolicyGroupsApi.md new file mode 100644 index 0000000..7ee7205 --- /dev/null +++ b/jcapiv2/docs/PolicyGroupsApi.md @@ -0,0 +1,472 @@ +# {{classname}} + +All URIs are relative to *https://console.jumpcloud.com/api/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**GraphPolicyGroupAssociationsList**](PolicyGroupsApi.md#GraphPolicyGroupAssociationsList) | **Get** /policygroups/{group_id}/associations | List the associations of a Policy Group. +[**GraphPolicyGroupAssociationsPost**](PolicyGroupsApi.md#GraphPolicyGroupAssociationsPost) | **Post** /policygroups/{group_id}/associations | Manage the associations of a Policy Group +[**GraphPolicyGroupMembersList**](PolicyGroupsApi.md#GraphPolicyGroupMembersList) | **Get** /policygroups/{group_id}/members | List the members of a Policy Group +[**GraphPolicyGroupMembersPost**](PolicyGroupsApi.md#GraphPolicyGroupMembersPost) | **Post** /policygroups/{group_id}/members | Manage the members of a Policy Group +[**GraphPolicyGroupMembership**](PolicyGroupsApi.md#GraphPolicyGroupMembership) | **Get** /policygroups/{group_id}/membership | List the Policy Group's membership +[**GraphPolicyGroupTraverseSystem**](PolicyGroupsApi.md#GraphPolicyGroupTraverseSystem) | **Get** /policygroups/{group_id}/systems | List the Systems bound to a Policy Group +[**GraphPolicyGroupTraverseSystemGroup**](PolicyGroupsApi.md#GraphPolicyGroupTraverseSystemGroup) | **Get** /policygroups/{group_id}/systemgroups | List the System Groups bound to Policy Groups +[**GroupsPolicyDelete**](PolicyGroupsApi.md#GroupsPolicyDelete) | **Delete** /policygroups/{id} | Delete a Policy Group +[**GroupsPolicyGet**](PolicyGroupsApi.md#GroupsPolicyGet) | **Get** /policygroups/{id} | View an individual Policy Group details +[**GroupsPolicyList**](PolicyGroupsApi.md#GroupsPolicyList) | **Get** /policygroups | List all Policy Groups +[**GroupsPolicyPost**](PolicyGroupsApi.md#GroupsPolicyPost) | **Post** /policygroups | Create a new Policy Group +[**GroupsPolicyPut**](PolicyGroupsApi.md#GroupsPolicyPut) | **Put** /policygroups/{id} | Update a Policy Group + +# **GraphPolicyGroupAssociationsList** +> []GraphConnection GraphPolicyGroupAssociationsList(ctx, groupId, targets, optional) +List the associations of a Policy Group. + +This endpoint returns the _direct_ associations of this Policy Group. A direct association can be a non-homogeneous relationship between 2 different objects, for example Policy Groups and Policies. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/policygroups/{GroupID}/associations?targets=system \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **groupId** | **string**| ObjectID of the Policy Group. | + **targets** | [**[]string**](string.md)| Targets which a \"policy_group\" can be associated to. | + **optional** | ***PolicyGroupsApiGraphPolicyGroupAssociationsListOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a PolicyGroupsApiGraphPolicyGroupAssociationsListOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + **limit** | **optional.Int32**| The number of records to return at once. Limited to 100. | [default to 10] + **skip** | **optional.Int32**| The offset into the records to return. | [default to 0] + **xOrgId** | **optional.String**| Organization identifier that can be obtained from console settings. | + +### Return type + +[**[]GraphConnection**](GraphConnection.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GraphPolicyGroupAssociationsPost** +> GraphPolicyGroupAssociationsPost(ctx, groupId, optional) +Manage the associations of a Policy Group + +This endpoint manages the _direct_ associations of this Policy Group. A direct association can be a non-homogeneous relationship between 2 different objects, for example Policy Groups and Policies. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/policygroups/{GroupID}/associations \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"op\": \"add\", \"type\": \"system\", \"id\": \"{SystemID}\" }' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **groupId** | **string**| ObjectID of the Policy Group. | + **optional** | ***PolicyGroupsApiGraphPolicyGroupAssociationsPostOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a PolicyGroupsApiGraphPolicyGroupAssociationsPostOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **body** | [**optional.Interface of GraphOperationPolicyGroup**](GraphOperationPolicyGroup.md)| | + **xOrgId** | **optional.**| Organization identifier that can be obtained from console settings. | + +### Return type + + (empty response body) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GraphPolicyGroupMembersList** +> []GraphConnection GraphPolicyGroupMembersList(ctx, groupId, optional) +List the members of a Policy Group + +This endpoint returns the Policy members of a Policy Group. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/policygroups/{GroupID}/members \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **groupId** | **string**| ObjectID of the Policy Group. | + **optional** | ***PolicyGroupsApiGraphPolicyGroupMembersListOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a PolicyGroupsApiGraphPolicyGroupMembersListOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **limit** | **optional.Int32**| The number of records to return at once. Limited to 100. | [default to 10] + **skip** | **optional.Int32**| The offset into the records to return. | [default to 0] + **xOrgId** | **optional.String**| Organization identifier that can be obtained from console settings. | + +### Return type + +[**[]GraphConnection**](GraphConnection.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GraphPolicyGroupMembersPost** +> GraphPolicyGroupMembersPost(ctx, groupId, optional) +Manage the members of a Policy Group + +This endpoint allows you to manage the Policy members of a Policy Group. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/policygroups/{GroupID}/members \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"op\": \"add\", \"type\": \"policy\", \"id\": \"{Policy_ID}\" }' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **groupId** | **string**| ObjectID of the Policy Group. | + **optional** | ***PolicyGroupsApiGraphPolicyGroupMembersPostOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a PolicyGroupsApiGraphPolicyGroupMembersPostOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **body** | [**optional.Interface of GraphOperationPolicyGroupMember**](GraphOperationPolicyGroupMember.md)| | + **xOrgId** | **optional.**| Organization identifier that can be obtained from console settings. | + +### Return type + + (empty response body) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GraphPolicyGroupMembership** +> []GraphObjectWithPaths GraphPolicyGroupMembership(ctx, groupId, optional) +List the Policy Group's membership + +This endpoint returns all Policy members that are a member of this Policy Group. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/policygroups/{GroupID}/membership \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **groupId** | **string**| ObjectID of the Policy Group. | + **optional** | ***PolicyGroupsApiGraphPolicyGroupMembershipOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a PolicyGroupsApiGraphPolicyGroupMembershipOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **filter** | [**optional.Interface of []string**](string.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | + **limit** | **optional.Int32**| The number of records to return at once. Limited to 100. | [default to 10] + **skip** | **optional.Int32**| The offset into the records to return. | [default to 0] + **sort** | [**optional.Interface of []string**](string.md)| The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. | + **xOrgId** | **optional.String**| Organization identifier that can be obtained from console settings. | + +### Return type + +[**[]GraphObjectWithPaths**](GraphObjectWithPaths.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GraphPolicyGroupTraverseSystem** +> []GraphObjectWithPaths GraphPolicyGroupTraverseSystem(ctx, groupId, optional) +List the Systems bound to a Policy Group + +This endpoint will return all Systems bound to a Policy Group, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this Policy Group to the corresponding System; this array represents all grouping and/or associations that would have to be removed to deprovision the System from this Policy Group. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/policygroups/{GroupID}/systems \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **groupId** | **string**| ObjectID of the Policy Group. | + **optional** | ***PolicyGroupsApiGraphPolicyGroupTraverseSystemOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a PolicyGroupsApiGraphPolicyGroupTraverseSystemOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **limit** | **optional.Int32**| The number of records to return at once. Limited to 100. | [default to 10] + **xOrgId** | **optional.String**| Organization identifier that can be obtained from console settings. | + **skip** | **optional.Int32**| The offset into the records to return. | [default to 0] + **filter** | [**optional.Interface of []string**](string.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | + +### Return type + +[**[]GraphObjectWithPaths**](GraphObjectWithPaths.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GraphPolicyGroupTraverseSystemGroup** +> []GraphObjectWithPaths GraphPolicyGroupTraverseSystemGroup(ctx, groupId, optional) +List the System Groups bound to Policy Groups + +This endpoint will return all System Groups bound to a Policy Group, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this Policy Group to the corresponding System Group; this array represents all grouping and/or associations that would have to be removed to deprovision the System Group from this Policy Group. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/policygroups/{GroupID}/systemgroups \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **groupId** | **string**| ObjectID of the Policy Group. | + **optional** | ***PolicyGroupsApiGraphPolicyGroupTraverseSystemGroupOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a PolicyGroupsApiGraphPolicyGroupTraverseSystemGroupOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **limit** | **optional.Int32**| The number of records to return at once. Limited to 100. | [default to 10] + **xOrgId** | **optional.String**| Organization identifier that can be obtained from console settings. | + **skip** | **optional.Int32**| The offset into the records to return. | [default to 0] + **filter** | [**optional.Interface of []string**](string.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | + +### Return type + +[**[]GraphObjectWithPaths**](GraphObjectWithPaths.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GroupsPolicyDelete** +> PolicyGroup GroupsPolicyDelete(ctx, id, optional) +Delete a Policy Group + +This endpoint allows you to delete a Policy Group. #### Sample Request ``` curl -X DELETE https://console.jumpcloud.com/api/v2/policygroups/{GroupID} \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **id** | **string**| ObjectID of the Policy Group. | + **optional** | ***PolicyGroupsApiGroupsPolicyDeleteOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a PolicyGroupsApiGroupsPolicyDeleteOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **xOrgId** | **optional.String**| Organization identifier that can be obtained from console settings. | + +### Return type + +[**PolicyGroup**](PolicyGroup.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GroupsPolicyGet** +> PolicyGroup GroupsPolicyGet(ctx, id, optional) +View an individual Policy Group details + +This endpoint returns the details of a Policy Group. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/policygroups/{GroupID} \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **id** | **string**| ObjectID of the Policy Group. | + **optional** | ***PolicyGroupsApiGroupsPolicyGetOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a PolicyGroupsApiGroupsPolicyGetOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **xOrgId** | **optional.String**| Organization identifier that can be obtained from console settings. | + +### Return type + +[**PolicyGroup**](PolicyGroup.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GroupsPolicyList** +> []PolicyGroup GroupsPolicyList(ctx, optional) +List all Policy Groups + +This endpoint returns all Policy Groups. Available filter fields: - `name` - `disabled` - `type` #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/policygroups \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **optional** | ***PolicyGroupsApiGroupsPolicyListOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a PolicyGroupsApiGroupsPolicyListOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **fields** | [**optional.Interface of []string**](string.md)| The comma separated fields included in the returned records. If omitted, the default list of fields will be returned. | + **filter** | [**optional.Interface of []string**](string.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | + **limit** | **optional.Int32**| The number of records to return at once. Limited to 100. | [default to 10] + **skip** | **optional.Int32**| The offset into the records to return. | [default to 0] + **sort** | [**optional.Interface of []string**](string.md)| The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. | + **xOrgId** | **optional.String**| Organization identifier that can be obtained from console settings. | + +### Return type + +[**[]PolicyGroup**](PolicyGroup.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GroupsPolicyPost** +> PolicyGroup GroupsPolicyPost(ctx, optional) +Create a new Policy Group + +This endpoint allows you to create a new Policy Group. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/policygroups \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"name\": \"{Group_Name}\" }' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **optional** | ***PolicyGroupsApiGroupsPolicyPostOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a PolicyGroupsApiGroupsPolicyPostOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**optional.Interface of PolicyGroupData**](PolicyGroupData.md)| | + **xOrgId** | **optional.**| Organization identifier that can be obtained from console settings. | + +### Return type + +[**PolicyGroup**](PolicyGroup.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GroupsPolicyPut** +> PolicyGroup GroupsPolicyPut(ctx, id, optional) +Update a Policy Group + +This endpoint allows you to do a full update of the Policy Group. #### Sample Request ``` curl -X PUT https://console.jumpcloud.com/api/v2/policygroups/{Group_ID} \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"name\": \"group_update\" }' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **id** | **string**| ObjectID of the Policy Group. | + **optional** | ***PolicyGroupsApiGroupsPolicyPutOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a PolicyGroupsApiGroupsPolicyPutOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **body** | [**optional.Interface of PolicyGroupData**](PolicyGroupData.md)| | + **xOrgId** | **optional.**| Organization identifier that can be obtained from console settings. | + +### Return type + +[**PolicyGroup**](PolicyGroup.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/v2/docs/PolicyRequest.md b/jcapiv2/docs/PolicyRequest.md similarity index 99% rename from v2/docs/PolicyRequest.md rename to jcapiv2/docs/PolicyRequest.md index 4f438d8..11d97a6 100644 --- a/v2/docs/PolicyRequest.md +++ b/jcapiv2/docs/PolicyRequest.md @@ -9,4 +9,3 @@ Name | Type | Description | Notes [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/v2/docs/PolicyRequestTemplate.md b/jcapiv2/docs/PolicyRequestTemplate.md similarity index 99% rename from v2/docs/PolicyRequestTemplate.md rename to jcapiv2/docs/PolicyRequestTemplate.md index 437814b..d6cbf92 100644 --- a/v2/docs/PolicyRequestTemplate.md +++ b/jcapiv2/docs/PolicyRequestTemplate.md @@ -7,4 +7,3 @@ Name | Type | Description | Notes [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/v2/docs/PolicyResult.md b/jcapiv2/docs/PolicyResult.md similarity index 99% rename from v2/docs/PolicyResult.md rename to jcapiv2/docs/PolicyResult.md index 32b7393..b1ee2b5 100644 --- a/v2/docs/PolicyResult.md +++ b/jcapiv2/docs/PolicyResult.md @@ -17,4 +17,3 @@ Name | Type | Description | Notes [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/jcapiv2/docs/PolicyTemplate.md b/jcapiv2/docs/PolicyTemplate.md new file mode 100644 index 0000000..aba7395 --- /dev/null +++ b/jcapiv2/docs/PolicyTemplate.md @@ -0,0 +1,20 @@ +# PolicyTemplate + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Activation** | **string** | Requirements before the policy can be activated. | [optional] [default to null] +**Alert** | **string** | Text to describe any risk associated with this policy. | [optional] [default to null] +**Behavior** | **string** | Specifics about the behavior of the policy. | [optional] [default to null] +**DeliveryTypes** | **[]string** | The supported delivery mechanisms for this policy template. | [optional] [default to null] +**Description** | **string** | The default description for the Policy. | [optional] [default to null] +**DisplayName** | **string** | The default display name for the Policy. | [optional] [default to null] +**Id** | **string** | ObjectId uniquely identifying a Policy Template. | [optional] [default to null] +**Name** | **string** | The unique name for the Policy Template. | [optional] [default to null] +**OsMetaFamily** | **string** | | [optional] [default to null] +**OsRestrictions** | [**[]OsRestriction**](OSRestriction.md) | | [optional] [default to null] +**Reference** | **string** | URL to visit for further information. | [optional] [default to null] +**State** | **string** | String describing the release status of the policy template. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/PolicyTemplateConfigField.md b/jcapiv2/docs/PolicyTemplateConfigField.md new file mode 100644 index 0000000..8001a5e --- /dev/null +++ b/jcapiv2/docs/PolicyTemplateConfigField.md @@ -0,0 +1,19 @@ +# PolicyTemplateConfigField + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**DefaultValue** | **string** | The default value for this field. | [optional] [default to null] +**DisplayOptions** | [***interface{}**](interface{}.md) | The options that correspond to the display_type. | [optional] [default to null] +**DisplayType** | **string** | The default rendering for this field. | [optional] [default to null] +**Id** | **string** | ObjectId uniquely identifying a Policy Template Configuration Field | [default to null] +**Label** | **string** | The default label for this field. | [optional] [default to null] +**Name** | **string** | A unique name identifying this config field. | [default to null] +**Position** | **float64** | The default position to render this field. | [optional] [default to null] +**ReadOnly** | **bool** | If an admin is allowed to modify this field. | [optional] [default to null] +**Required** | **bool** | If this field is required for this field. | [optional] [default to null] +**Sensitive** | **bool** | Defines if the policy template config field is sensitive or not. | [optional] [default to null] +**Tooltip** | [***PolicyTemplateConfigFieldTooltip**](PolicyTemplateConfigField_tooltip.md) | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/v2/docs/PolicyTemplateConfigFieldTooltip.md b/jcapiv2/docs/PolicyTemplateConfigFieldTooltip.md similarity index 99% rename from v2/docs/PolicyTemplateConfigFieldTooltip.md rename to jcapiv2/docs/PolicyTemplateConfigFieldTooltip.md index a9d36d2..12cbb9f 100644 --- a/v2/docs/PolicyTemplateConfigFieldTooltip.md +++ b/jcapiv2/docs/PolicyTemplateConfigFieldTooltip.md @@ -8,4 +8,3 @@ Name | Type | Description | Notes [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/v2/docs/PolicyTemplateConfigFieldTooltipVariables.md b/jcapiv2/docs/PolicyTemplateConfigFieldTooltipVariables.md similarity index 99% rename from v2/docs/PolicyTemplateConfigFieldTooltipVariables.md rename to jcapiv2/docs/PolicyTemplateConfigFieldTooltipVariables.md index e917e81..ec25d5b 100644 --- a/v2/docs/PolicyTemplateConfigFieldTooltipVariables.md +++ b/jcapiv2/docs/PolicyTemplateConfigFieldTooltipVariables.md @@ -8,4 +8,3 @@ Name | Type | Description | Notes [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/v2/docs/PolicyTemplateWithDetails.md b/jcapiv2/docs/PolicyTemplateWithDetails.md similarity index 92% rename from v2/docs/PolicyTemplateWithDetails.md rename to jcapiv2/docs/PolicyTemplateWithDetails.md index a87159e..2dad2c7 100644 --- a/v2/docs/PolicyTemplateWithDetails.md +++ b/jcapiv2/docs/PolicyTemplateWithDetails.md @@ -11,7 +11,7 @@ Name | Type | Description | Notes **Id** | **string** | ObjectId uniquely identifying a Policy Template. | [optional] [default to null] **Name** | **string** | The unique name for the Policy Template. | [optional] [default to null] **OsMetaFamily** | **string** | | [optional] [default to null] +**OsRestrictions** | [**[]OsRestriction**](OSRestriction.md) | | [optional] [default to null] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/jcapiv2/docs/PolicyValue.md b/jcapiv2/docs/PolicyValue.md new file mode 100644 index 0000000..53e70b8 --- /dev/null +++ b/jcapiv2/docs/PolicyValue.md @@ -0,0 +1,11 @@ +# PolicyValue + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ConfigFieldID** | **string** | The ObjectId of the corresponding Policy Template configuration field. | [optional] [default to null] +**Sensitive** | **bool** | Defines if the value is sensitive or not. | [optional] [default to null] +**Value** | **string** | The value for the configuration field for this Policy instance. | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/v2/docs/PolicyWithDetails.md b/jcapiv2/docs/PolicyWithDetails.md similarity index 99% rename from v2/docs/PolicyWithDetails.md rename to jcapiv2/docs/PolicyWithDetails.md index 7d7451e..7db0f9f 100644 --- a/v2/docs/PolicyWithDetails.md +++ b/jcapiv2/docs/PolicyWithDetails.md @@ -11,4 +11,3 @@ Name | Type | Description | Notes [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/jcapiv2/docs/PolicytemplatesApi.md b/jcapiv2/docs/PolicytemplatesApi.md new file mode 100644 index 0000000..baeb78b --- /dev/null +++ b/jcapiv2/docs/PolicytemplatesApi.md @@ -0,0 +1,84 @@ +# {{classname}} + +All URIs are relative to *https://console.jumpcloud.com/api/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**PolicytemplatesGet**](PolicytemplatesApi.md#PolicytemplatesGet) | **Get** /policytemplates/{id} | Get a specific Policy Template +[**PolicytemplatesList**](PolicytemplatesApi.md#PolicytemplatesList) | **Get** /policytemplates | Lists all of the Policy Templates + +# **PolicytemplatesGet** +> PolicyTemplateWithDetails PolicytemplatesGet(ctx, id, optional) +Get a specific Policy Template + +This endpoint returns a specific policy template. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/policytemplates/{Policy_Template_ID}\\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **id** | **string**| ObjectID of the Policy Template. | + **optional** | ***PolicytemplatesApiPolicytemplatesGetOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a PolicytemplatesApiPolicytemplatesGetOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **xOrgId** | **optional.String**| Organization identifier that can be obtained from console settings. | + +### Return type + +[**PolicyTemplateWithDetails**](PolicyTemplateWithDetails.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **PolicytemplatesList** +> []PolicyTemplate PolicytemplatesList(ctx, optional) +Lists all of the Policy Templates + +This endpoint returns all policy templates. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/policytemplates \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **optional** | ***PolicytemplatesApiPolicytemplatesListOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a PolicytemplatesApiPolicytemplatesListOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **fields** | [**optional.Interface of []string**](string.md)| The comma separated fields included in the returned records. If omitted, the default list of fields will be returned. | + **filter** | [**optional.Interface of []string**](string.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | + **limit** | **optional.Int32**| The number of records to return at once. Limited to 100. | [default to 10] + **skip** | **optional.Int32**| The offset into the records to return. | [default to 0] + **sort** | [**optional.Interface of []string**](string.md)| The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. | + **xOrgId** | **optional.String**| Organization identifier that can be obtained from console settings. | + +### Return type + +[**[]PolicyTemplate**](PolicyTemplate.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/Provider.md b/jcapiv2/docs/Provider.md new file mode 100644 index 0000000..879ff79 --- /dev/null +++ b/jcapiv2/docs/Provider.md @@ -0,0 +1,10 @@ +# Provider + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**DisallowOrgCreation** | **bool** | | [optional] [default to null] +**Id** | **string** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/ProviderAdminReq.md b/jcapiv2/docs/ProviderAdminReq.md new file mode 100644 index 0000000..2b2af05 --- /dev/null +++ b/jcapiv2/docs/ProviderAdminReq.md @@ -0,0 +1,15 @@ +# ProviderAdminReq + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**BindNoOrgs** | **bool** | | [optional] [default to false] +**Email** | **string** | | [default to null] +**EnableMultiFactor** | **bool** | | [optional] [default to null] +**Firstname** | **string** | | [optional] [default to null] +**Lastname** | **string** | | [optional] [default to null] +**Role** | **string** | | [optional] [default to null] +**RoleName** | **string** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/ProviderInvoice.md b/jcapiv2/docs/ProviderInvoice.md new file mode 100644 index 0000000..b63523b --- /dev/null +++ b/jcapiv2/docs/ProviderInvoice.md @@ -0,0 +1,15 @@ +# ProviderInvoice + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**AmountBilled** | **string** | | [optional] [default to null] +**AmountPaid** | **string** | | [optional] [default to null] +**AmountRemaining** | **string** | | [optional] [default to null] +**Currency** | **string** | | [optional] [default to null] +**DueDate** | **string** | | [optional] [default to null] +**Id** | **string** | | [optional] [default to null] +**Status** | **string** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/ProviderInvoiceResponse.md b/jcapiv2/docs/ProviderInvoiceResponse.md new file mode 100644 index 0000000..45d0486 --- /dev/null +++ b/jcapiv2/docs/ProviderInvoiceResponse.md @@ -0,0 +1,10 @@ +# ProviderInvoiceResponse + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Records** | [**[]ProviderInvoice**](ProviderInvoice.md) | | [optional] [default to null] +**TotalCount** | **int32** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/ProvidersApi.md b/jcapiv2/docs/ProvidersApi.md new file mode 100644 index 0000000..a0b4e82 --- /dev/null +++ b/jcapiv2/docs/ProvidersApi.md @@ -0,0 +1,1481 @@ +# {{classname}} + +All URIs are relative to *https://console.jumpcloud.com/api/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**AutotaskCreateConfiguration**](ProvidersApi.md#AutotaskCreateConfiguration) | **Post** /providers/{provider_id}/integrations/autotask | Creates a new Autotask integration for the provider +[**AutotaskDeleteConfiguration**](ProvidersApi.md#AutotaskDeleteConfiguration) | **Delete** /integrations/autotask/{UUID} | Delete Autotask Integration +[**AutotaskGetConfiguration**](ProvidersApi.md#AutotaskGetConfiguration) | **Get** /integrations/autotask/{UUID} | Retrieve Autotask Integration Configuration +[**AutotaskPatchMappings**](ProvidersApi.md#AutotaskPatchMappings) | **Patch** /integrations/autotask/{UUID}/mappings | Create, edit, and/or delete Autotask Mappings +[**AutotaskPatchSettings**](ProvidersApi.md#AutotaskPatchSettings) | **Patch** /integrations/autotask/{UUID}/settings | Create, edit, and/or delete Autotask Integration settings +[**AutotaskRetrieveAllAlertConfigurationOptions**](ProvidersApi.md#AutotaskRetrieveAllAlertConfigurationOptions) | **Get** /providers/{provider_id}/integrations/autotask/alerts/configuration/options | Get all Autotask ticketing alert configuration options for a provider +[**AutotaskRetrieveAllAlertConfigurations**](ProvidersApi.md#AutotaskRetrieveAllAlertConfigurations) | **Get** /providers/{provider_id}/integrations/autotask/alerts/configuration | Get all Autotask ticketing alert configurations for a provider +[**AutotaskRetrieveCompanies**](ProvidersApi.md#AutotaskRetrieveCompanies) | **Get** /integrations/autotask/{UUID}/companies | Retrieve Autotask Companies +[**AutotaskRetrieveCompanyTypes**](ProvidersApi.md#AutotaskRetrieveCompanyTypes) | **Get** /integrations/autotask/{UUID}/companytypes | Retrieve Autotask Company Types +[**AutotaskRetrieveContracts**](ProvidersApi.md#AutotaskRetrieveContracts) | **Get** /integrations/autotask/{UUID}/contracts | Retrieve Autotask Contracts +[**AutotaskRetrieveContractsFields**](ProvidersApi.md#AutotaskRetrieveContractsFields) | **Get** /integrations/autotask/{UUID}/contracts/fields | Retrieve Autotask Contract Fields +[**AutotaskRetrieveMappings**](ProvidersApi.md#AutotaskRetrieveMappings) | **Get** /integrations/autotask/{UUID}/mappings | Retrieve Autotask mappings +[**AutotaskRetrieveServices**](ProvidersApi.md#AutotaskRetrieveServices) | **Get** /integrations/autotask/{UUID}/contracts/services | Retrieve Autotask Contract Services +[**AutotaskRetrieveSettings**](ProvidersApi.md#AutotaskRetrieveSettings) | **Get** /integrations/autotask/{UUID}/settings | Retrieve Autotask Integration settings +[**AutotaskUpdateAlertConfiguration**](ProvidersApi.md#AutotaskUpdateAlertConfiguration) | **Put** /providers/{provider_id}/integrations/autotask/alerts/{alert_UUID}/configuration | Update an Autotask ticketing alert's configuration +[**AutotaskUpdateConfiguration**](ProvidersApi.md#AutotaskUpdateConfiguration) | **Patch** /integrations/autotask/{UUID} | Update Autotask Integration configuration +[**ConnectwiseCreateConfiguration**](ProvidersApi.md#ConnectwiseCreateConfiguration) | **Post** /providers/{provider_id}/integrations/connectwise | Creates a new ConnectWise integration for the provider +[**ConnectwiseDeleteConfiguration**](ProvidersApi.md#ConnectwiseDeleteConfiguration) | **Delete** /integrations/connectwise/{UUID} | Delete ConnectWise Integration +[**ConnectwiseGetConfiguration**](ProvidersApi.md#ConnectwiseGetConfiguration) | **Get** /integrations/connectwise/{UUID} | Retrieve ConnectWise Integration Configuration +[**ConnectwisePatchMappings**](ProvidersApi.md#ConnectwisePatchMappings) | **Patch** /integrations/connectwise/{UUID}/mappings | Create, edit, and/or delete ConnectWise Mappings +[**ConnectwisePatchSettings**](ProvidersApi.md#ConnectwisePatchSettings) | **Patch** /integrations/connectwise/{UUID}/settings | Create, edit, and/or delete ConnectWise Integration settings +[**ConnectwiseRetrieveAdditions**](ProvidersApi.md#ConnectwiseRetrieveAdditions) | **Get** /integrations/connectwise/{UUID}/agreements/{agreement_ID}/additions | Retrieve ConnectWise Additions +[**ConnectwiseRetrieveAgreements**](ProvidersApi.md#ConnectwiseRetrieveAgreements) | **Get** /integrations/connectwise/{UUID}/agreements | Retrieve ConnectWise Agreements +[**ConnectwiseRetrieveAllAlertConfigurationOptions**](ProvidersApi.md#ConnectwiseRetrieveAllAlertConfigurationOptions) | **Get** /providers/{provider_id}/integrations/connectwise/alerts/configuration/options | Get all ConnectWise ticketing alert configuration options for a provider +[**ConnectwiseRetrieveAllAlertConfigurations**](ProvidersApi.md#ConnectwiseRetrieveAllAlertConfigurations) | **Get** /providers/{provider_id}/integrations/connectwise/alerts/configuration | Get all ConnectWise ticketing alert configurations for a provider +[**ConnectwiseRetrieveCompanies**](ProvidersApi.md#ConnectwiseRetrieveCompanies) | **Get** /integrations/connectwise/{UUID}/companies | Retrieve ConnectWise Companies +[**ConnectwiseRetrieveCompanyTypes**](ProvidersApi.md#ConnectwiseRetrieveCompanyTypes) | **Get** /integrations/connectwise/{UUID}/companytypes | Retrieve ConnectWise Company Types +[**ConnectwiseRetrieveMappings**](ProvidersApi.md#ConnectwiseRetrieveMappings) | **Get** /integrations/connectwise/{UUID}/mappings | Retrieve ConnectWise mappings +[**ConnectwiseRetrieveSettings**](ProvidersApi.md#ConnectwiseRetrieveSettings) | **Get** /integrations/connectwise/{UUID}/settings | Retrieve ConnectWise Integration settings +[**ConnectwiseUpdateAlertConfiguration**](ProvidersApi.md#ConnectwiseUpdateAlertConfiguration) | **Put** /providers/{provider_id}/integrations/connectwise/alerts/{alert_UUID}/configuration | Update a ConnectWise ticketing alert's configuration +[**ConnectwiseUpdateConfiguration**](ProvidersApi.md#ConnectwiseUpdateConfiguration) | **Patch** /integrations/connectwise/{UUID} | Update ConnectWise Integration configuration +[**MtpIntegrationRetrieveAlerts**](ProvidersApi.md#MtpIntegrationRetrieveAlerts) | **Get** /providers/{provider_id}/integrations/ticketing/alerts | Get all ticketing alerts available for a provider's ticketing integration. +[**MtpIntegrationRetrieveSyncErrors**](ProvidersApi.md#MtpIntegrationRetrieveSyncErrors) | **Get** /integrations/{integration_type}/{UUID}/errors | Retrieve Recent Integration Sync Errors +[**ProviderOrganizationsUpdateOrg**](ProvidersApi.md#ProviderOrganizationsUpdateOrg) | **Put** /providers/{provider_id}/organizations/{id} | Update Provider Organization +[**ProvidersGetProvider**](ProvidersApi.md#ProvidersGetProvider) | **Get** /providers/{provider_id} | Retrieve Provider +[**ProvidersListAdministrators**](ProvidersApi.md#ProvidersListAdministrators) | **Get** /providers/{provider_id}/administrators | List Provider Administrators +[**ProvidersListOrganizations**](ProvidersApi.md#ProvidersListOrganizations) | **Get** /providers/{provider_id}/organizations | List Provider Organizations +[**ProvidersPostAdmins**](ProvidersApi.md#ProvidersPostAdmins) | **Post** /providers/{provider_id}/administrators | Create a new Provider Administrator +[**ProvidersRemoveAdministrator**](ProvidersApi.md#ProvidersRemoveAdministrator) | **Delete** /providers/{provider_id}/administrators/{id} | Delete Provider Administrator +[**ProvidersRetrieveIntegrations**](ProvidersApi.md#ProvidersRetrieveIntegrations) | **Get** /providers/{provider_id}/integrations | Retrieve Integrations for Provider +[**ProvidersRetrieveInvoice**](ProvidersApi.md#ProvidersRetrieveInvoice) | **Get** /providers/{provider_id}/invoices/{ID} | Download a provider's invoice. +[**ProvidersRetrieveInvoices**](ProvidersApi.md#ProvidersRetrieveInvoices) | **Get** /providers/{provider_id}/invoices | List a provider's invoices. + +# **AutotaskCreateConfiguration** +> InlineResponse201 AutotaskCreateConfiguration(ctx, providerId, optional) +Creates a new Autotask integration for the provider + +Creates a new Autotask integration for the provider. You must be associated with the provider to use this route. A 422 Unprocessable Entity response means the server failed to validate with Autotask. + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **providerId** | **string**| | + **optional** | ***ProvidersApiAutotaskCreateConfigurationOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a ProvidersApiAutotaskCreateConfigurationOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **body** | [**optional.Interface of AutotaskIntegrationReq**](AutotaskIntegrationReq.md)| | + +### Return type + +[**InlineResponse201**](inline_response_201.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **AutotaskDeleteConfiguration** +> AutotaskDeleteConfiguration(ctx, uUID) +Delete Autotask Integration + +Removes a Autotask integration. + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **uUID** | **string**| | + +### Return type + + (empty response body) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **AutotaskGetConfiguration** +> AutotaskIntegration AutotaskGetConfiguration(ctx, uUID) +Retrieve Autotask Integration Configuration + +Retrieves configuration for given Autotask integration id. You must be associated to the provider the integration is tied to in order to use this api. + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **uUID** | **string**| | + +### Return type + +[**AutotaskIntegration**](AutotaskIntegration.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **AutotaskPatchMappings** +> AutotaskMappingResponse AutotaskPatchMappings(ctx, uUID, optional) +Create, edit, and/or delete Autotask Mappings + +Create, edit, and/or delete mappings between Jumpcloud organizations and Autotask companies/contracts/services. You must be associated to the same provider as the Autotask integration to use this api. + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **uUID** | **string**| | + **optional** | ***ProvidersApiAutotaskPatchMappingsOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a ProvidersApiAutotaskPatchMappingsOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **body** | [**optional.Interface of AutotaskMappingRequest**](AutotaskMappingRequest.md)| | + +### Return type + +[**AutotaskMappingResponse**](AutotaskMappingResponse.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **AutotaskPatchSettings** +> AutotaskSettings AutotaskPatchSettings(ctx, uUID, optional) +Create, edit, and/or delete Autotask Integration settings + +Create, edit, and/or delete Autotask settings. You must be associated to the same provider as the Autotask integration to use this endpoint. + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **uUID** | **string**| | + **optional** | ***ProvidersApiAutotaskPatchSettingsOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a ProvidersApiAutotaskPatchSettingsOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **body** | [**optional.Interface of AutotaskSettingsPatchReq**](AutotaskSettingsPatchReq.md)| | + +### Return type + +[**AutotaskSettings**](AutotaskSettings.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **AutotaskRetrieveAllAlertConfigurationOptions** +> AutotaskTicketingAlertConfigurationOptions AutotaskRetrieveAllAlertConfigurationOptions(ctx, providerId) +Get all Autotask ticketing alert configuration options for a provider + +Get all Autotask ticketing alert configuration options for a provider. + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **providerId** | **string**| | + +### Return type + +[**AutotaskTicketingAlertConfigurationOptions**](AutotaskTicketingAlertConfigurationOptions.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **AutotaskRetrieveAllAlertConfigurations** +> AutotaskTicketingAlertConfigurationList AutotaskRetrieveAllAlertConfigurations(ctx, providerId) +Get all Autotask ticketing alert configurations for a provider + +Get all Autotask ticketing alert configurations for a provider. + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **providerId** | **string**| | + +### Return type + +[**AutotaskTicketingAlertConfigurationList**](AutotaskTicketingAlertConfigurationList.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **AutotaskRetrieveCompanies** +> AutotaskCompanyResp AutotaskRetrieveCompanies(ctx, uUID, optional) +Retrieve Autotask Companies + +Retrieves a list of Autotask companies for the given Autotask id. You must be associated to the same provider as the Autotask integration to use this endpoint. + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **uUID** | **string**| | + **optional** | ***ProvidersApiAutotaskRetrieveCompaniesOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a ProvidersApiAutotaskRetrieveCompaniesOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **fields** | [**optional.Interface of []string**](string.md)| The comma separated fields included in the returned records. If omitted, the default list of fields will be returned. | + **filter** | [**optional.Interface of []string**](string.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | + **limit** | **optional.Int32**| The number of records to return at once. Limited to 100. | [default to 10] + **skip** | **optional.Int32**| The offset into the records to return. | [default to 0] + **sort** | [**optional.Interface of []string**](string.md)| The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. | + +### Return type + +[**AutotaskCompanyResp**](AutotaskCompanyResp.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **AutotaskRetrieveCompanyTypes** +> AutotaskCompanyTypeResp AutotaskRetrieveCompanyTypes(ctx, uUID) +Retrieve Autotask Company Types + +Retrieves a list of user defined company types from Autotask for the given Autotask id. + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **uUID** | **string**| | + +### Return type + +[**AutotaskCompanyTypeResp**](AutotaskCompanyTypeResp.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **AutotaskRetrieveContracts** +> InlineResponse2003 AutotaskRetrieveContracts(ctx, uUID, optional) +Retrieve Autotask Contracts + +Retrieves a list of Autotask contracts for the given Autotask integration id. You must be associated to the same provider as the Autotask integration to use this endpoint. + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **uUID** | **string**| | + **optional** | ***ProvidersApiAutotaskRetrieveContractsOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a ProvidersApiAutotaskRetrieveContractsOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **fields** | [**optional.Interface of []string**](string.md)| The comma separated fields included in the returned records. If omitted, the default list of fields will be returned. | + **filter** | [**optional.Interface of []string**](string.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | + **limit** | **optional.Int32**| The number of records to return at once. Limited to 100. | [default to 10] + **skip** | **optional.Int32**| The offset into the records to return. | [default to 0] + **sort** | [**optional.Interface of []string**](string.md)| The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. | + +### Return type + +[**InlineResponse2003**](inline_response_200_3.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **AutotaskRetrieveContractsFields** +> InlineResponse2004 AutotaskRetrieveContractsFields(ctx, uUID) +Retrieve Autotask Contract Fields + +Retrieves a list of Autotask contract fields for the given Autotask integration id. You must be associated to the same provider as the Autotask integration to use this endpoint. + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **uUID** | **string**| | + +### Return type + +[**InlineResponse2004**](inline_response_200_4.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **AutotaskRetrieveMappings** +> InlineResponse2006 AutotaskRetrieveMappings(ctx, uUID, optional) +Retrieve Autotask mappings + +Retrieves the list of mappings for this Autotask integration. You must be associated to the same provider as the Autotask integration to use this api. + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **uUID** | **string**| | + **optional** | ***ProvidersApiAutotaskRetrieveMappingsOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a ProvidersApiAutotaskRetrieveMappingsOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **fields** | [**optional.Interface of []string**](string.md)| The comma separated fields included in the returned records. If omitted, the default list of fields will be returned. | + **filter** | [**optional.Interface of []string**](string.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | + **limit** | **optional.Int32**| The number of records to return at once. Limited to 100. | [default to 10] + **skip** | **optional.Int32**| The offset into the records to return. | [default to 0] + **sort** | [**optional.Interface of []string**](string.md)| The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. | + +### Return type + +[**InlineResponse2006**](inline_response_200_6.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **AutotaskRetrieveServices** +> InlineResponse2005 AutotaskRetrieveServices(ctx, uUID, optional) +Retrieve Autotask Contract Services + +Retrieves a list of Autotask contract services for the given Autotask integration id. You must be associated to the same provider as the Autotask integration to use this endpoint. + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **uUID** | **string**| | + **optional** | ***ProvidersApiAutotaskRetrieveServicesOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a ProvidersApiAutotaskRetrieveServicesOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **fields** | [**optional.Interface of []string**](string.md)| The comma separated fields included in the returned records. If omitted, the default list of fields will be returned. | + **filter** | [**optional.Interface of []string**](string.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | + **limit** | **optional.Int32**| The number of records to return at once. Limited to 100. | [default to 10] + **skip** | **optional.Int32**| The offset into the records to return. | [default to 0] + **sort** | [**optional.Interface of []string**](string.md)| The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. | + +### Return type + +[**InlineResponse2005**](inline_response_200_5.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **AutotaskRetrieveSettings** +> AutotaskSettings AutotaskRetrieveSettings(ctx, uUID) +Retrieve Autotask Integration settings + +Retrieve the Autotask integration settings. You must be associated to the same provider as the Autotask integration to use this endpoint. + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **uUID** | **string**| | + +### Return type + +[**AutotaskSettings**](AutotaskSettings.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **AutotaskUpdateAlertConfiguration** +> AutotaskTicketingAlertConfiguration AutotaskUpdateAlertConfiguration(ctx, providerId, alertUUID, optional) +Update an Autotask ticketing alert's configuration + +Update an Autotask ticketing alert's configuration + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **providerId** | **string**| | + **alertUUID** | **string**| | + **optional** | ***ProvidersApiAutotaskUpdateAlertConfigurationOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a ProvidersApiAutotaskUpdateAlertConfigurationOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + **body** | [**optional.Interface of AutotaskTicketingAlertConfigurationRequest**](AutotaskTicketingAlertConfigurationRequest.md)| | + +### Return type + +[**AutotaskTicketingAlertConfiguration**](AutotaskTicketingAlertConfiguration.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **AutotaskUpdateConfiguration** +> AutotaskIntegration AutotaskUpdateConfiguration(ctx, uUID, optional) +Update Autotask Integration configuration + +Update the Autotask integration configuration. A 422 Unprocessable Entity response means the server failed to validate with Autotask. + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **uUID** | **string**| | + **optional** | ***ProvidersApiAutotaskUpdateConfigurationOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a ProvidersApiAutotaskUpdateConfigurationOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **body** | [**optional.Interface of AutotaskIntegrationPatchReq**](AutotaskIntegrationPatchReq.md)| | + +### Return type + +[**AutotaskIntegration**](AutotaskIntegration.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **ConnectwiseCreateConfiguration** +> InlineResponse201 ConnectwiseCreateConfiguration(ctx, providerId, optional) +Creates a new ConnectWise integration for the provider + +Creates a new ConnectWise integration for the provider. You must be associated with the provider to use this route. A 422 Unprocessable Entity response means the server failed to validate with ConnectWise. + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **providerId** | **string**| | + **optional** | ***ProvidersApiConnectwiseCreateConfigurationOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a ProvidersApiConnectwiseCreateConfigurationOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **body** | [**optional.Interface of ConnectwiseIntegrationReq**](ConnectwiseIntegrationReq.md)| | + +### Return type + +[**InlineResponse201**](inline_response_201.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **ConnectwiseDeleteConfiguration** +> ConnectwiseDeleteConfiguration(ctx, uUID) +Delete ConnectWise Integration + +Removes a ConnectWise integration. + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **uUID** | **string**| | + +### Return type + + (empty response body) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **ConnectwiseGetConfiguration** +> ConnectwiseIntegration ConnectwiseGetConfiguration(ctx, uUID) +Retrieve ConnectWise Integration Configuration + +Retrieves configuration for given ConnectWise integration id. You must be associated to the provider the integration is tied to in order to use this api. + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **uUID** | **string**| | + +### Return type + +[**ConnectwiseIntegration**](ConnectwiseIntegration.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **ConnectwisePatchMappings** +> ConnectWiseMappingRequest ConnectwisePatchMappings(ctx, uUID, optional) +Create, edit, and/or delete ConnectWise Mappings + +Create, edit, and/or delete mappings between Jumpcloud organizations and ConnectWise companies/agreements/additions. You must be associated to the same provider as the ConnectWise integration to use this api. + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **uUID** | **string**| | + **optional** | ***ProvidersApiConnectwisePatchMappingsOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a ProvidersApiConnectwisePatchMappingsOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **body** | [**optional.Interface of ConnectWiseMappingRequest**](ConnectWiseMappingRequest.md)| | + +### Return type + +[**ConnectWiseMappingRequest**](ConnectWiseMappingRequest.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **ConnectwisePatchSettings** +> ConnectWiseSettings ConnectwisePatchSettings(ctx, uUID, optional) +Create, edit, and/or delete ConnectWise Integration settings + +Create, edit, and/or delete ConnectWiseIntegration settings. You must be associated to the same provider as the ConnectWise integration to use this endpoint. + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **uUID** | **string**| | + **optional** | ***ProvidersApiConnectwisePatchSettingsOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a ProvidersApiConnectwisePatchSettingsOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **body** | [**optional.Interface of ConnectWiseSettingsPatchReq**](ConnectWiseSettingsPatchReq.md)| | + +### Return type + +[**ConnectWiseSettings**](ConnectWiseSettings.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **ConnectwiseRetrieveAdditions** +> InlineResponse2008 ConnectwiseRetrieveAdditions(ctx, uUID, agreementID, optional) +Retrieve ConnectWise Additions + +Retrieves a list of ConnectWise additions for the given ConnectWise id and Agreement id. You must be associated to the same provider as the ConnectWise integration to use this endpoint. + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **uUID** | **string**| | + **agreementID** | **string**| | + **optional** | ***ProvidersApiConnectwiseRetrieveAdditionsOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a ProvidersApiConnectwiseRetrieveAdditionsOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + **fields** | [**optional.Interface of []string**](string.md)| The comma separated fields included in the returned records. If omitted, the default list of fields will be returned. | + **filter** | [**optional.Interface of []string**](string.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | + **limit** | **optional.Int32**| The number of records to return at once. Limited to 100. | [default to 10] + **skip** | **optional.Int32**| The offset into the records to return. | [default to 0] + **sort** | [**optional.Interface of []string**](string.md)| The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. | + +### Return type + +[**InlineResponse2008**](inline_response_200_8.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **ConnectwiseRetrieveAgreements** +> InlineResponse2007 ConnectwiseRetrieveAgreements(ctx, uUID, optional) +Retrieve ConnectWise Agreements + +Retrieves a list of ConnectWise agreements for the given ConnectWise id. You must be associated to the same provider as the ConnectWise integration to use this endpoint. + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **uUID** | **string**| | + **optional** | ***ProvidersApiConnectwiseRetrieveAgreementsOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a ProvidersApiConnectwiseRetrieveAgreementsOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **fields** | [**optional.Interface of []string**](string.md)| The comma separated fields included in the returned records. If omitted, the default list of fields will be returned. | + **filter** | [**optional.Interface of []string**](string.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | + **limit** | **optional.Int32**| The number of records to return at once. Limited to 100. | [default to 10] + **skip** | **optional.Int32**| The offset into the records to return. | [default to 0] + **sort** | [**optional.Interface of []string**](string.md)| The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. | + +### Return type + +[**InlineResponse2007**](inline_response_200_7.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **ConnectwiseRetrieveAllAlertConfigurationOptions** +> ConnectWiseTicketingAlertConfigurationOptions ConnectwiseRetrieveAllAlertConfigurationOptions(ctx, providerId) +Get all ConnectWise ticketing alert configuration options for a provider + +Get all ConnectWise ticketing alert configuration options for a provider. + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **providerId** | **string**| | + +### Return type + +[**ConnectWiseTicketingAlertConfigurationOptions**](ConnectWiseTicketingAlertConfigurationOptions.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **ConnectwiseRetrieveAllAlertConfigurations** +> ConnectWiseTicketingAlertConfigurationList ConnectwiseRetrieveAllAlertConfigurations(ctx, providerId) +Get all ConnectWise ticketing alert configurations for a provider + +Get all ConnectWise ticketing alert configurations for a provider. + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **providerId** | **string**| | + +### Return type + +[**ConnectWiseTicketingAlertConfigurationList**](ConnectWiseTicketingAlertConfigurationList.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **ConnectwiseRetrieveCompanies** +> ConnectwiseCompanyResp ConnectwiseRetrieveCompanies(ctx, uUID, optional) +Retrieve ConnectWise Companies + +Retrieves a list of ConnectWise companies for the given ConnectWise id. You must be associated to the same provider as the ConnectWise integration to use this endpoint. + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **uUID** | **string**| | + **optional** | ***ProvidersApiConnectwiseRetrieveCompaniesOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a ProvidersApiConnectwiseRetrieveCompaniesOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **fields** | [**optional.Interface of []string**](string.md)| The comma separated fields included in the returned records. If omitted, the default list of fields will be returned. | + **filter** | [**optional.Interface of []string**](string.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | + **limit** | **optional.Int32**| The number of records to return at once. Limited to 100. | [default to 10] + **skip** | **optional.Int32**| The offset into the records to return. | [default to 0] + **sort** | [**optional.Interface of []string**](string.md)| The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. | + +### Return type + +[**ConnectwiseCompanyResp**](ConnectwiseCompanyResp.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **ConnectwiseRetrieveCompanyTypes** +> ConnectwiseCompanyTypeResp ConnectwiseRetrieveCompanyTypes(ctx, uUID) +Retrieve ConnectWise Company Types + +Retrieves a list of user defined company types from ConnectWise for the given ConnectWise id. + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **uUID** | **string**| | + +### Return type + +[**ConnectwiseCompanyTypeResp**](ConnectwiseCompanyTypeResp.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **ConnectwiseRetrieveMappings** +> InlineResponse2009 ConnectwiseRetrieveMappings(ctx, uUID, optional) +Retrieve ConnectWise mappings + +Retrieves the list of mappings for this ConnectWise integration. You must be associated to the same provider as the ConnectWise integration to use this api. + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **uUID** | **string**| | + **optional** | ***ProvidersApiConnectwiseRetrieveMappingsOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a ProvidersApiConnectwiseRetrieveMappingsOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **fields** | [**optional.Interface of []string**](string.md)| The comma separated fields included in the returned records. If omitted, the default list of fields will be returned. | + **filter** | [**optional.Interface of []string**](string.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | + **limit** | **optional.Int32**| The number of records to return at once. Limited to 100. | [default to 10] + **skip** | **optional.Int32**| The offset into the records to return. | [default to 0] + **sort** | [**optional.Interface of []string**](string.md)| The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. | + +### Return type + +[**InlineResponse2009**](inline_response_200_9.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **ConnectwiseRetrieveSettings** +> ConnectWiseSettings ConnectwiseRetrieveSettings(ctx, uUID) +Retrieve ConnectWise Integration settings + +Retrieve the ConnectWise integration settings. You must be associated to the same provider as the ConnectWise integration to use this endpoint. + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **uUID** | **string**| | + +### Return type + +[**ConnectWiseSettings**](ConnectWiseSettings.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **ConnectwiseUpdateAlertConfiguration** +> ConnectWiseTicketingAlertConfiguration ConnectwiseUpdateAlertConfiguration(ctx, providerId, alertUUID, optional) +Update a ConnectWise ticketing alert's configuration + +Update a ConnectWise ticketing alert's configuration. + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **providerId** | **string**| | + **alertUUID** | **string**| | + **optional** | ***ProvidersApiConnectwiseUpdateAlertConfigurationOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a ProvidersApiConnectwiseUpdateAlertConfigurationOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + **body** | [**optional.Interface of ConnectWiseTicketingAlertConfigurationRequest**](ConnectWiseTicketingAlertConfigurationRequest.md)| | + +### Return type + +[**ConnectWiseTicketingAlertConfiguration**](ConnectWiseTicketingAlertConfiguration.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **ConnectwiseUpdateConfiguration** +> ConnectwiseIntegration ConnectwiseUpdateConfiguration(ctx, uUID, optional) +Update ConnectWise Integration configuration + +Update the ConnectWise integration configuration. A 422 Unprocessable Entity response means the server failed to validate with ConnectWise. + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **uUID** | **string**| | + **optional** | ***ProvidersApiConnectwiseUpdateConfigurationOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a ProvidersApiConnectwiseUpdateConfigurationOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **body** | [**optional.Interface of ConnectwiseIntegrationPatchReq**](ConnectwiseIntegrationPatchReq.md)| | + +### Return type + +[**ConnectwiseIntegration**](ConnectwiseIntegration.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **MtpIntegrationRetrieveAlerts** +> TicketingIntegrationAlertsResp MtpIntegrationRetrieveAlerts(ctx, providerId) +Get all ticketing alerts available for a provider's ticketing integration. + +Get all ticketing alerts available for a provider's ticketing integration. + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **providerId** | **string**| | + +### Return type + +[**TicketingIntegrationAlertsResp**](TicketingIntegrationAlertsResp.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **MtpIntegrationRetrieveSyncErrors** +> IntegrationSyncErrorResp MtpIntegrationRetrieveSyncErrors(ctx, uUID, integrationType) +Retrieve Recent Integration Sync Errors + +Retrieves recent sync errors for given integration type and integration id. You must be associated to the provider the integration is tied to in order to use this api. + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **uUID** | **string**| | + **integrationType** | **string**| | + +### Return type + +[**IntegrationSyncErrorResp**](IntegrationSyncErrorResp.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **ProviderOrganizationsUpdateOrg** +> Organization ProviderOrganizationsUpdateOrg(ctx, providerId, id, optional) +Update Provider Organization + +This endpoint updates a provider's organization + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **providerId** | **string**| | + **id** | **string**| | + **optional** | ***ProvidersApiProviderOrganizationsUpdateOrgOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a ProvidersApiProviderOrganizationsUpdateOrgOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + **body** | [**optional.Interface of Organization**](Organization.md)| | + +### Return type + +[**Organization**](Organization.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **ProvidersGetProvider** +> Provider ProvidersGetProvider(ctx, providerId, optional) +Retrieve Provider + +This endpoint returns details about a provider + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **providerId** | **string**| | + **optional** | ***ProvidersApiProvidersGetProviderOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a ProvidersApiProvidersGetProviderOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **fields** | [**optional.Interface of []string**](string.md)| The comma separated fields included in the returned records. If omitted, the default list of fields will be returned. | + +### Return type + +[**Provider**](Provider.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **ProvidersListAdministrators** +> InlineResponse20012 ProvidersListAdministrators(ctx, providerId, optional) +List Provider Administrators + +This endpoint returns a list of the Administrators associated with the Provider. You must be associated with the provider to use this route. + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **providerId** | **string**| | + **optional** | ***ProvidersApiProvidersListAdministratorsOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a ProvidersApiProvidersListAdministratorsOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **fields** | [**optional.Interface of []string**](string.md)| The comma separated fields included in the returned records. If omitted, the default list of fields will be returned. | + **filter** | [**optional.Interface of []string**](string.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | + **limit** | **optional.Int32**| The number of records to return at once. Limited to 100. | [default to 10] + **skip** | **optional.Int32**| The offset into the records to return. | [default to 0] + **sort** | [**optional.Interface of []string**](string.md)| The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. | + +### Return type + +[**InlineResponse20012**](inline_response_200_12.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **ProvidersListOrganizations** +> InlineResponse20013 ProvidersListOrganizations(ctx, providerId, optional) +List Provider Organizations + +This endpoint returns a list of the Organizations associated with the Provider. You must be associated with the provider to use this route. + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **providerId** | **string**| | + **optional** | ***ProvidersApiProvidersListOrganizationsOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a ProvidersApiProvidersListOrganizationsOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **fields** | [**optional.Interface of []string**](string.md)| The comma separated fields included in the returned records. If omitted, the default list of fields will be returned. | + **filter** | [**optional.Interface of []string**](string.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | + **limit** | **optional.Int32**| The number of records to return at once. Limited to 100. | [default to 10] + **skip** | **optional.Int32**| The offset into the records to return. | [default to 0] + **sort** | [**optional.Interface of []string**](string.md)| The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. | + +### Return type + +[**InlineResponse20013**](inline_response_200_13.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **ProvidersPostAdmins** +> Administrator ProvidersPostAdmins(ctx, providerId, optional) +Create a new Provider Administrator + +This endpoint allows you to create a provider administrator. You must be associated with the provider to use this route. You must provide either `role` or `roleName`. + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **providerId** | **string**| | + **optional** | ***ProvidersApiProvidersPostAdminsOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a ProvidersApiProvidersPostAdminsOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **body** | [**optional.Interface of ProviderAdminReq**](ProviderAdminReq.md)| | + +### Return type + +[**Administrator**](Administrator.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **ProvidersRemoveAdministrator** +> ProvidersRemoveAdministrator(ctx, providerId, id) +Delete Provider Administrator + +This endpoint removes an Administrator associated with the Provider. You must be associated with the provider to use this route. + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **providerId** | **string**| | + **id** | **string**| | + +### Return type + + (empty response body) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **ProvidersRetrieveIntegrations** +> IntegrationsResponse ProvidersRetrieveIntegrations(ctx, providerId, optional) +Retrieve Integrations for Provider + +Retrieves a list of integrations this provider has configured. You must be associated to the provider to use this endpoint. + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **providerId** | **string**| | + **optional** | ***ProvidersApiProvidersRetrieveIntegrationsOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a ProvidersApiProvidersRetrieveIntegrationsOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **filter** | [**optional.Interface of []string**](string.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | + **limit** | **optional.Int32**| The number of records to return at once. Limited to 100. | [default to 10] + **skip** | **optional.Int32**| The offset into the records to return. | [default to 0] + **sort** | [**optional.Interface of []string**](string.md)| The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. | + +### Return type + +[**IntegrationsResponse**](IntegrationsResponse.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **ProvidersRetrieveInvoice** +> *os.File ProvidersRetrieveInvoice(ctx, providerId, iD) +Download a provider's invoice. + +Retrieves an invoice for this provider. You must be associated to the provider to use this endpoint. + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **providerId** | **string**| | + **iD** | **string**| | + +### Return type + +[***os.File**](*os.File.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/pdf + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **ProvidersRetrieveInvoices** +> ProviderInvoiceResponse ProvidersRetrieveInvoices(ctx, providerId, optional) +List a provider's invoices. + +Retrieves a list of invoices for this provider. You must be associated to the provider to use this endpoint. + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **providerId** | **string**| | + **optional** | ***ProvidersApiProvidersRetrieveInvoicesOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a ProvidersApiProvidersRetrieveInvoicesOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **skip** | **optional.Int32**| The offset into the records to return. | [default to 0] + **sort** | [**optional.Interface of []string**](string.md)| The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. | + **limit** | **optional.Int32**| The number of records to return at once. Limited to 100. | [default to 10] + +### Return type + +[**ProviderInvoiceResponse**](ProviderInvoiceResponse.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/PushEndpointResponse.md b/jcapiv2/docs/PushEndpointResponse.md new file mode 100644 index 0000000..9090eb5 --- /dev/null +++ b/jcapiv2/docs/PushEndpointResponse.md @@ -0,0 +1,14 @@ +# PushEndpointResponse + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Device** | [***PushEndpointResponseDevice**](PushEndpointResponse_device.md) | | [optional] [default to null] +**EnrollmentDate** | [**time.Time**](time.Time.md) | | [optional] [default to null] +**Id** | **string** | | [optional] [default to null] +**LastUsedDate** | [**time.Time**](time.Time.md) | | [optional] [default to null] +**Name** | **string** | | [optional] [default to null] +**State** | **string** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/PushEndpointResponseDevice.md b/jcapiv2/docs/PushEndpointResponseDevice.md new file mode 100644 index 0000000..ca1a219 --- /dev/null +++ b/jcapiv2/docs/PushEndpointResponseDevice.md @@ -0,0 +1,14 @@ +# PushEndpointResponseDevice + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**AppVersion** | **string** | | [optional] [default to null] +**Make** | **string** | | [optional] [default to null] +**Model** | **string** | | [optional] [default to null] +**Os** | **string** | | [optional] [default to null] +**OsVersion** | **string** | | [optional] [default to null] +**UvEnabled** | **bool** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/PushendpointsPushEndpointIdBody.md b/jcapiv2/docs/PushendpointsPushEndpointIdBody.md new file mode 100644 index 0000000..e2bdb91 --- /dev/null +++ b/jcapiv2/docs/PushendpointsPushEndpointIdBody.md @@ -0,0 +1,10 @@ +# PushendpointsPushEndpointIdBody + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Name** | **string** | | [optional] [default to null] +**State** | **string** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/PwmAllUsers.md b/jcapiv2/docs/PwmAllUsers.md new file mode 100644 index 0000000..57c58b3 --- /dev/null +++ b/jcapiv2/docs/PwmAllUsers.md @@ -0,0 +1,10 @@ +# PwmAllUsers + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Results** | [**[]PwmAllUsersResults**](PwmAllUsers_results.md) | | [default to null] +**TotalCount** | **int32** | | [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/PwmAllUsersGroups.md b/jcapiv2/docs/PwmAllUsersGroups.md new file mode 100644 index 0000000..1436165 --- /dev/null +++ b/jcapiv2/docs/PwmAllUsersGroups.md @@ -0,0 +1,10 @@ +# PwmAllUsersGroups + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Id** | **string** | | [default to null] +**Name** | **string** | | [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/PwmAllUsersResults.md b/jcapiv2/docs/PwmAllUsersResults.md new file mode 100644 index 0000000..f2d1616 --- /dev/null +++ b/jcapiv2/docs/PwmAllUsersResults.md @@ -0,0 +1,13 @@ +# PwmAllUsersResults + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Email** | **string** | | [default to null] +**Groups** | [**[]PwmAllUsersGroups**](PwmAllUsers_groups.md) | | [optional] [default to null] +**Id** | **string** | | [default to null] +**Name** | **string** | | [default to null] +**Status** | **string** | | [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/PwmOverviewAppVersions.md b/jcapiv2/docs/PwmOverviewAppVersions.md new file mode 100644 index 0000000..c9fb238 --- /dev/null +++ b/jcapiv2/docs/PwmOverviewAppVersions.md @@ -0,0 +1,10 @@ +# PwmOverviewAppVersions + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Results** | [**[]PwmOverviewAppVersionsResults**](PwmOverviewAppVersions_results.md) | | [default to null] +**TotalCount** | **int32** | | [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/PwmOverviewAppVersionsResults.md b/jcapiv2/docs/PwmOverviewAppVersionsResults.md new file mode 100644 index 0000000..762d12c --- /dev/null +++ b/jcapiv2/docs/PwmOverviewAppVersionsResults.md @@ -0,0 +1,10 @@ +# PwmOverviewAppVersionsResults + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**UsersCount** | **int32** | | [optional] [default to null] +**Version** | **string** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/PwmOverviewMain.md b/jcapiv2/docs/PwmOverviewMain.md new file mode 100644 index 0000000..d4dbd12 --- /dev/null +++ b/jcapiv2/docs/PwmOverviewMain.md @@ -0,0 +1,12 @@ +# PwmOverviewMain + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Devices** | [**[]PwmOverviewMainDevices**](PwmOverviewMain_devices.md) | | [default to null] +**PendingInvites** | **int32** | | [default to null] +**SharedFolders** | **int32** | | [default to null] +**TotalUsers** | **int32** | | [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/PwmOverviewMainDevices.md b/jcapiv2/docs/PwmOverviewMainDevices.md new file mode 100644 index 0000000..1d7bcc6 --- /dev/null +++ b/jcapiv2/docs/PwmOverviewMainDevices.md @@ -0,0 +1,11 @@ +# PwmOverviewMainDevices + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Count** | **int32** | | [optional] [default to null] +**Id** | **int32** | | [optional] [default to null] +**Name** | **string** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/Query.md b/jcapiv2/docs/Query.md new file mode 100644 index 0000000..2d9cb98 --- /dev/null +++ b/jcapiv2/docs/Query.md @@ -0,0 +1,9 @@ +# Query + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**QueryType** | **string** | | [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/QueuedCommandList.md b/jcapiv2/docs/QueuedCommandList.md new file mode 100644 index 0000000..0f8d746 --- /dev/null +++ b/jcapiv2/docs/QueuedCommandList.md @@ -0,0 +1,10 @@ +# QueuedCommandList + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Results** | [**[]QueuedCommandListResults**](QueuedCommandList_results.md) | | [optional] [default to null] +**TotalCount** | **int32** | The total number of queued command results. | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/QueuedCommandListResults.md b/jcapiv2/docs/QueuedCommandListResults.md new file mode 100644 index 0000000..4373fcd --- /dev/null +++ b/jcapiv2/docs/QueuedCommandListResults.md @@ -0,0 +1,12 @@ +# QueuedCommandListResults + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Command** | **string** | The ID of the command, from savedAgentCommands. | [optional] [default to null] +**Id** | **string** | The workflowInstanceId. | [optional] [default to null] +**PendingCount** | **int32** | The number of devices that still haven't received the directive. | [optional] [default to null] +**System** | **string** | The ID of the device the command is bound to. | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/RADIUSServersApi.md b/jcapiv2/docs/RADIUSServersApi.md new file mode 100644 index 0000000..4e853f2 --- /dev/null +++ b/jcapiv2/docs/RADIUSServersApi.md @@ -0,0 +1,166 @@ +# {{classname}} + +All URIs are relative to *https://console.jumpcloud.com/api/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**GraphRadiusServerAssociationsList**](RADIUSServersApi.md#GraphRadiusServerAssociationsList) | **Get** /radiusservers/{radiusserver_id}/associations | List the associations of a RADIUS Server +[**GraphRadiusServerAssociationsPost**](RADIUSServersApi.md#GraphRadiusServerAssociationsPost) | **Post** /radiusservers/{radiusserver_id}/associations | Manage the associations of a RADIUS Server +[**GraphRadiusServerTraverseUser**](RADIUSServersApi.md#GraphRadiusServerTraverseUser) | **Get** /radiusservers/{radiusserver_id}/users | List the Users bound to a RADIUS Server +[**GraphRadiusServerTraverseUserGroup**](RADIUSServersApi.md#GraphRadiusServerTraverseUserGroup) | **Get** /radiusservers/{radiusserver_id}/usergroups | List the User Groups bound to a RADIUS Server + +# **GraphRadiusServerAssociationsList** +> []GraphConnection GraphRadiusServerAssociationsList(ctx, radiusserverId, targets, optional) +List the associations of a RADIUS Server + +This endpoint returns the _direct_ associations of a Radius Server. A direct association can be a non-homogeneous relationship between 2 different objects, for example Radius Servers and Users. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/radiusservers/{RADIUS_ID}/associations?targets=user_group \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **radiusserverId** | **string**| ObjectID of the Radius Server. | + **targets** | [**[]string**](string.md)| Targets which a \"radius_server\" can be associated to. | + **optional** | ***RADIUSServersApiGraphRadiusServerAssociationsListOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a RADIUSServersApiGraphRadiusServerAssociationsListOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + **limit** | **optional.Int32**| The number of records to return at once. Limited to 100. | [default to 10] + **skip** | **optional.Int32**| The offset into the records to return. | [default to 0] + **xOrgId** | **optional.String**| Organization identifier that can be obtained from console settings. | + +### Return type + +[**[]GraphConnection**](GraphConnection.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GraphRadiusServerAssociationsPost** +> GraphRadiusServerAssociationsPost(ctx, radiusserverId, optional) +Manage the associations of a RADIUS Server + +This endpoint allows you to manage the _direct_ associations of a Radius Server. A direct association can be a non-homogeneous relationship between 2 different objects, for example Radius Servers and Users. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/radiusservers/{RADIUS_ID}/associations \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"type\":\"user\", \"id\":\"{USER_ID}\", \"op\":\"add\" }' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **radiusserverId** | **string**| ObjectID of the Radius Server. | + **optional** | ***RADIUSServersApiGraphRadiusServerAssociationsPostOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a RADIUSServersApiGraphRadiusServerAssociationsPostOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **body** | [**optional.Interface of GraphOperationRadiusServer**](GraphOperationRadiusServer.md)| | + **xOrgId** | **optional.**| Organization identifier that can be obtained from console settings. | + +### Return type + + (empty response body) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GraphRadiusServerTraverseUser** +> []GraphObjectWithPaths GraphRadiusServerTraverseUser(ctx, radiusserverId, optional) +List the Users bound to a RADIUS Server + +This endpoint will return all Users bound to a RADIUS Server, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this RADIUS server instance to the corresponding User; this array represents all grouping and/or associations that would have to be removed to deprovision the User from this RADIUS server instance. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/ldapservers/{LDAP_ID}/users \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **radiusserverId** | **string**| ObjectID of the Radius Server. | + **optional** | ***RADIUSServersApiGraphRadiusServerTraverseUserOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a RADIUSServersApiGraphRadiusServerTraverseUserOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **limit** | **optional.Int32**| The number of records to return at once. Limited to 100. | [default to 10] + **xOrgId** | **optional.String**| Organization identifier that can be obtained from console settings. | + **skip** | **optional.Int32**| The offset into the records to return. | [default to 0] + **filter** | [**optional.Interface of []string**](string.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | + +### Return type + +[**[]GraphObjectWithPaths**](GraphObjectWithPaths.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GraphRadiusServerTraverseUserGroup** +> []GraphObjectWithPaths GraphRadiusServerTraverseUserGroup(ctx, radiusserverId, optional) +List the User Groups bound to a RADIUS Server + +This endpoint will return all Users Groups bound to a RADIUS Server, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the group's type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this RADIUS server instance to the corresponding User Group; this array represents all grouping and/or associations that would have to be removed to deprovision the User Group from this RADIUS server instance. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/radiusservers/{RADIUS_ID}/usergroups \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **radiusserverId** | **string**| ObjectID of the Radius Server. | + **optional** | ***RADIUSServersApiGraphRadiusServerTraverseUserGroupOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a RADIUSServersApiGraphRadiusServerTraverseUserGroupOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **limit** | **optional.Int32**| The number of records to return at once. Limited to 100. | [default to 10] + **xOrgId** | **optional.String**| Organization identifier that can be obtained from console settings. | + **skip** | **optional.Int32**| The offset into the records to return. | [default to 0] + **filter** | [**optional.Interface of []string**](string.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | + +### Return type + +[**[]GraphObjectWithPaths**](GraphObjectWithPaths.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/SCIMImportApi.md b/jcapiv2/docs/SCIMImportApi.md new file mode 100644 index 0000000..8fa08f4 --- /dev/null +++ b/jcapiv2/docs/SCIMImportApi.md @@ -0,0 +1,50 @@ +# {{classname}} + +All URIs are relative to *https://console.jumpcloud.com/api/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**ImportUsers**](SCIMImportApi.md#ImportUsers) | **Get** /applications/{application_id}/import/users | Get a list of users to import from an Application IdM service provider + +# **ImportUsers** +> ImportUsersResponse ImportUsers(ctx, applicationId, optional) +Get a list of users to import from an Application IdM service provider + +Get a list of users to import from an Application IdM service provider. + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **applicationId** | **string**| ObjectID of the Application. | + **optional** | ***SCIMImportApiImportUsersOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a SCIMImportApiImportUsersOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **filter** | **optional.String**| Filter users by a search term | + **query** | **optional.String**| URL query to merge with the service provider request | + **sort** | **optional.String**| Sort users by supported fields | + **sortOrder** | **optional.String**| | [default to asc] + **xOrgId** | **optional.String**| Organization identifier that can be obtained from console settings. | + **limit** | **optional.Int32**| The number of records to return at once. Limited to 100. | [default to 10] + **skip** | **optional.Int32**| The offset into the records to return. | [default to 0] + +### Return type + +[**ImportUsersResponse**](importUsersResponse.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/v2/docs/SambaDomainInput.md b/jcapiv2/docs/SambaDomainInput.md similarity index 82% rename from v2/docs/SambaDomainInput.md rename to jcapiv2/docs/SambaDomainInput.md index cfa48f3..d805692 100644 --- a/v2/docs/SambaDomainInput.md +++ b/jcapiv2/docs/SambaDomainInput.md @@ -3,9 +3,8 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Name** | **string** | Name of this domain's WorkGroup | [default to null] +**Name** | **string** | Name of this domain's WorkGroup | [default to null] **Sid** | **string** | Security identifier of this domain | [default to null] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/jcapiv2/docs/SambaDomainOutput.md b/jcapiv2/docs/SambaDomainOutput.md new file mode 100644 index 0000000..0540961 --- /dev/null +++ b/jcapiv2/docs/SambaDomainOutput.md @@ -0,0 +1,10 @@ +# SambaDomainOutput + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Name** | **string** | Name of this domain's WorkGroup | [default to null] +**Sid** | **string** | Security identifier of this domain | [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/SambaDomainsApi.md b/jcapiv2/docs/SambaDomainsApi.md new file mode 100644 index 0000000..ee720a3 --- /dev/null +++ b/jcapiv2/docs/SambaDomainsApi.md @@ -0,0 +1,204 @@ +# {{classname}} + +All URIs are relative to *https://console.jumpcloud.com/api/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**LdapserversSambaDomainsDelete**](SambaDomainsApi.md#LdapserversSambaDomainsDelete) | **Delete** /ldapservers/{ldapserver_id}/sambadomains/{id} | Delete Samba Domain +[**LdapserversSambaDomainsGet**](SambaDomainsApi.md#LdapserversSambaDomainsGet) | **Get** /ldapservers/{ldapserver_id}/sambadomains/{id} | Get Samba Domain +[**LdapserversSambaDomainsList**](SambaDomainsApi.md#LdapserversSambaDomainsList) | **Get** /ldapservers/{ldapserver_id}/sambadomains | List Samba Domains +[**LdapserversSambaDomainsPost**](SambaDomainsApi.md#LdapserversSambaDomainsPost) | **Post** /ldapservers/{ldapserver_id}/sambadomains | Create Samba Domain +[**LdapserversSambaDomainsPut**](SambaDomainsApi.md#LdapserversSambaDomainsPut) | **Put** /ldapservers/{ldapserver_id}/sambadomains/{id} | Update Samba Domain + +# **LdapserversSambaDomainsDelete** +> string LdapserversSambaDomainsDelete(ctx, ldapserverId, id, optional) +Delete Samba Domain + +This endpoint allows you to delete a samba domain from an LDAP server. ##### Sample Request ``` curl -X DELETE https://console.jumpcloud.com/api/v2/ldapservers/{LDAP_ID}/sambadomains/{SAMBA_ID} \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **ldapserverId** | **string**| Unique identifier of the LDAP server. | + **id** | **string**| Unique identifier of the samba domain. | + **optional** | ***SambaDomainsApiLdapserversSambaDomainsDeleteOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a SambaDomainsApiLdapserversSambaDomainsDeleteOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + **xOrgId** | **optional.String**| Organization identifier that can be obtained from console settings. | + +### Return type + +**string** + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **LdapserversSambaDomainsGet** +> SambaDomainOutput LdapserversSambaDomainsGet(ctx, ldapserverId, id, optional) +Get Samba Domain + +This endpoint returns a specific samba domain for an LDAP server. ##### Sample Request ``` curl -X GET \\ https://console.jumpcloud.com/api/v2/ldapservers/ldapservers/{LDAP_ID}/sambadomains/{SAMBA_ID} \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **ldapserverId** | **string**| Unique identifier of the LDAP server. | + **id** | **string**| Unique identifier of the samba domain. | + **optional** | ***SambaDomainsApiLdapserversSambaDomainsGetOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a SambaDomainsApiLdapserversSambaDomainsGetOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + **xOrgId** | **optional.String**| Organization identifier that can be obtained from console settings. | + +### Return type + +[**SambaDomainOutput**](samba-domain-output.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **LdapserversSambaDomainsList** +> []SambaDomainOutput LdapserversSambaDomainsList(ctx, ldapserverId, optional) +List Samba Domains + +This endpoint returns all samba domains for an LDAP server. ##### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/ldapservers/{LDAP_ID}/sambadomains \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **ldapserverId** | **string**| Unique identifier of the LDAP server. | + **optional** | ***SambaDomainsApiLdapserversSambaDomainsListOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a SambaDomainsApiLdapserversSambaDomainsListOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **fields** | [**optional.Interface of []string**](string.md)| The comma separated fields included in the returned records. If omitted, the default list of fields will be returned. | + **filter** | [**optional.Interface of []string**](string.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | + **limit** | **optional.Int32**| The number of records to return at once. Limited to 100. | [default to 10] + **skip** | **optional.Int32**| The offset into the records to return. | [default to 0] + **sort** | [**optional.Interface of []string**](string.md)| The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. | + **xOrgId** | **optional.String**| Organization identifier that can be obtained from console settings. | + +### Return type + +[**[]SambaDomainOutput**](samba-domain-output.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **LdapserversSambaDomainsPost** +> SambaDomainOutput LdapserversSambaDomainsPost(ctx, ldapserverId, optional) +Create Samba Domain + +This endpoint allows you to create a samba domain for an LDAP server. ##### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/ldapservers/{LDAP_ID}/sambadomains \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"sid\":\"{SID_ID}\", \"name\":\"{WORKGROUP_NAME}\" }' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **ldapserverId** | **string**| Unique identifier of the LDAP server. | + **optional** | ***SambaDomainsApiLdapserversSambaDomainsPostOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a SambaDomainsApiLdapserversSambaDomainsPostOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **body** | [**optional.Interface of SambaDomainInput**](SambaDomainInput.md)| | + **xOrgId** | **optional.**| Organization identifier that can be obtained from console settings. | + +### Return type + +[**SambaDomainOutput**](samba-domain-output.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **LdapserversSambaDomainsPut** +> SambaDomainOutput LdapserversSambaDomainsPut(ctx, ldapserverId, id, optional) +Update Samba Domain + +This endpoint allows you to update the samba domain information for an LDAP server. ##### Sample Request ``` curl -X PUT https://console.jumpcloud.com/api/v2/ldapservers/{LDAP_ID}/sambadomains/{SAMBA_ID} \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"sid\":\"{SID_ID}\", \"name\":\"{WORKGROUP_NAME}\" }' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **ldapserverId** | **string**| Unique identifier of the LDAP server. | + **id** | **string**| Unique identifier of the samba domain. | + **optional** | ***SambaDomainsApiLdapserversSambaDomainsPutOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a SambaDomainsApiLdapserversSambaDomainsPutOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + **body** | [**optional.Interface of SambaDomainInput**](SambaDomainInput.md)| | + +### Return type + +[**SambaDomainOutput**](samba-domain-output.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/ScheduledUserstateResult.md b/jcapiv2/docs/ScheduledUserstateResult.md new file mode 100644 index 0000000..3674bfe --- /dev/null +++ b/jcapiv2/docs/ScheduledUserstateResult.md @@ -0,0 +1,12 @@ +# ScheduledUserstateResult + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ScheduledDate** | **string** | | [optional] [default to null] +**ScheduledJobId** | **string** | | [optional] [default to null] +**State** | **string** | | [optional] [default to null] +**SystemUserId** | **string** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/SetupAssistantOption.md b/jcapiv2/docs/SetupAssistantOption.md new file mode 100644 index 0000000..0990a24 --- /dev/null +++ b/jcapiv2/docs/SetupAssistantOption.md @@ -0,0 +1,8 @@ +# SetupAssistantOption + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/SharedFolderAccessLevels.md b/jcapiv2/docs/SharedFolderAccessLevels.md new file mode 100644 index 0000000..69ddce1 --- /dev/null +++ b/jcapiv2/docs/SharedFolderAccessLevels.md @@ -0,0 +1,9 @@ +# SharedFolderAccessLevels + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Results** | [**[]SharedFolderAccessLevelsResults**](SharedFolderAccessLevels_results.md) | | [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/SharedFolderAccessLevelsResults.md b/jcapiv2/docs/SharedFolderAccessLevelsResults.md new file mode 100644 index 0000000..13c54ab --- /dev/null +++ b/jcapiv2/docs/SharedFolderAccessLevelsResults.md @@ -0,0 +1,11 @@ +# SharedFolderAccessLevelsResults + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Description** | **string** | | [optional] [default to null] +**Id** | **string** | | [default to null] +**Name** | **string** | | [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/SharedFolderDetails.md b/jcapiv2/docs/SharedFolderDetails.md new file mode 100644 index 0000000..1d070b9 --- /dev/null +++ b/jcapiv2/docs/SharedFolderDetails.md @@ -0,0 +1,13 @@ +# SharedFolderDetails + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**CreatedAt** | **string** | | [default to null] +**ItemsInFolder** | **int32** | | [default to null] +**Name** | **string** | | [default to null] +**UsersWithAccess** | **int32** | | [default to null] +**Uuid** | **string** | | [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/SharedFolderUsers.md b/jcapiv2/docs/SharedFolderUsers.md new file mode 100644 index 0000000..36aaf52 --- /dev/null +++ b/jcapiv2/docs/SharedFolderUsers.md @@ -0,0 +1,10 @@ +# SharedFolderUsers + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Results** | [**[]SharedFolderUsersResults**](SharedFolderUsers_results.md) | | [default to null] +**TotalCount** | **int32** | | [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/SharedFolderUsersResults.md b/jcapiv2/docs/SharedFolderUsersResults.md new file mode 100644 index 0000000..221ffa4 --- /dev/null +++ b/jcapiv2/docs/SharedFolderUsersResults.md @@ -0,0 +1,14 @@ +# SharedFolderUsersResults + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**AccessLevelId** | **string** | | [default to null] +**AccessLevelName** | **string** | | [default to null] +**Email** | **string** | | [default to null] +**Id** | **string** | | [default to null] +**Name** | **string** | | [default to null] +**Status** | **string** | | [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/SharedFoldersList.md b/jcapiv2/docs/SharedFoldersList.md new file mode 100644 index 0000000..70f26f9 --- /dev/null +++ b/jcapiv2/docs/SharedFoldersList.md @@ -0,0 +1,10 @@ +# SharedFoldersList + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Results** | [**[]SharedFoldersListResults**](SharedFoldersList_results.md) | | [default to null] +**TotalCount** | **int32** | | [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/SharedFoldersListResults.md b/jcapiv2/docs/SharedFoldersListResults.md new file mode 100644 index 0000000..33073c5 --- /dev/null +++ b/jcapiv2/docs/SharedFoldersListResults.md @@ -0,0 +1,13 @@ +# SharedFoldersListResults + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**CreatedAt** | **string** | | [default to null] +**ItemsInFolder** | **int32** | | [default to null] +**Name** | **string** | | [default to null] +**UsersWithAccess** | **int32** | | [default to null] +**Uuid** | **string** | | [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/SoftwareApp.md b/jcapiv2/docs/SoftwareApp.md new file mode 100644 index 0000000..97b4cdf --- /dev/null +++ b/jcapiv2/docs/SoftwareApp.md @@ -0,0 +1,11 @@ +# SoftwareApp + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**DisplayName** | **string** | | [optional] [default to null] +**Id** | **string** | | [optional] [default to null] +**Settings** | [**[]SoftwareAppSettings**](software-app-settings.md) | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/SoftwareAppAppleVpp.md b/jcapiv2/docs/SoftwareAppAppleVpp.md new file mode 100644 index 0000000..d5193ba --- /dev/null +++ b/jcapiv2/docs/SoftwareAppAppleVpp.md @@ -0,0 +1,15 @@ +# SoftwareAppAppleVpp + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**AppConfiguration** | **string** | Text sent to configure the application, the text should be a valid plist. Returned only by 'GET /softwareapps/{id}'. | [optional] [default to null] +**AssignedLicenses** | **int32** | | [optional] [default to null] +**AvailableLicenses** | **int32** | | [optional] [default to null] +**Details** | [***interface{}**](interface{}.md) | App details returned by iTunes API. See example. The properties in this field are out of our control and we cannot guarantee consistency, so it should be checked by the client and manage the details accordingly. | [optional] [default to null] +**IsConfigEnabled** | **bool** | Denotes if configuration has been enabled for the application. Returned only by ''GET /softwareapps/{id}''. | [optional] [default to null] +**SupportedDeviceFamilies** | **[]string** | The supported device families for this VPP Application. | [optional] [default to null] +**TotalLicenses** | **int32** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/SoftwareAppReclaimLicenses.md b/jcapiv2/docs/SoftwareAppReclaimLicenses.md new file mode 100644 index 0000000..2379bc0 --- /dev/null +++ b/jcapiv2/docs/SoftwareAppReclaimLicenses.md @@ -0,0 +1,12 @@ +# SoftwareAppReclaimLicenses + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**AssignedLicenses** | **int32** | | [optional] [default to null] +**AvailableLicenses** | **int32** | | [optional] [default to null] +**ReclaimedLicenses** | **int32** | | [optional] [default to null] +**TotalLicenses** | **int32** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/SoftwareAppSettings.md b/jcapiv2/docs/SoftwareAppSettings.md new file mode 100644 index 0000000..03dd088 --- /dev/null +++ b/jcapiv2/docs/SoftwareAppSettings.md @@ -0,0 +1,23 @@ +# SoftwareAppSettings + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**AllowUpdateDelay** | **bool** | | [optional] [default to false] +**AppleVpp** | [***SoftwareAppAppleVpp**](software-app-apple-vpp.md) | | [optional] [default to null] +**AssetKind** | **string** | The manifest asset kind (ex: software). | [optional] [default to null] +**AssetSha256Size** | **int32** | The incremental size to use for summing the package as it is downloaded. | [optional] [default to null] +**AssetSha256Strings** | **[]string** | The array of checksums, one each for the hash size up to the total size of the package. | [optional] [default to null] +**AutoUpdate** | **bool** | | [optional] [default to false] +**Description** | **string** | The software app description. | [optional] [default to null] +**DesiredState** | **string** | State of Install or Uninstall | [optional] [default to null] +**Location** | **string** | Repository where the app is located within the package manager | [optional] [default to null] +**LocationObjectId** | **string** | ID of the repository where the app is located within the package manager | [optional] [default to null] +**PackageId** | **string** | | [optional] [default to null] +**PackageKind** | **string** | The package manifest kind (ex: software-package). | [optional] [default to null] +**PackageManager** | **string** | App store serving the app: APPLE_VPP, CHOCOLATEY, etc. | [optional] [default to null] +**PackageSubtitle** | **string** | The package manifest subtitle. | [optional] [default to null] +**PackageVersion** | **string** | The package manifest version. | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/SoftwareAppStatus.md b/jcapiv2/docs/SoftwareAppStatus.md new file mode 100644 index 0000000..40c3225 --- /dev/null +++ b/jcapiv2/docs/SoftwareAppStatus.md @@ -0,0 +1,16 @@ +# SoftwareAppStatus + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Code** | **int32** | | [optional] [default to null] +**Details** | **string** | | [optional] [default to null] +**Id** | **string** | | [optional] [default to null] +**SoftwareAppId** | **string** | | [optional] [default to null] +**State** | **string** | | [optional] [default to null] +**SystemId** | **string** | | [optional] [default to null] +**Timestamp** | **string** | | [optional] [default to null] +**Version** | **string** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/SoftwareAppWithStatus.md b/jcapiv2/docs/SoftwareAppWithStatus.md new file mode 100644 index 0000000..620b1e8 --- /dev/null +++ b/jcapiv2/docs/SoftwareAppWithStatus.md @@ -0,0 +1,10 @@ +# SoftwareAppWithStatus + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**App** | [***SoftwareApp**](software-app.md) | | [optional] [default to null] +**Status** | [***SoftwareAppStatus**](software-app-status.md) | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/SoftwareAppsApi.md b/jcapiv2/docs/SoftwareAppsApi.md new file mode 100644 index 0000000..8471825 --- /dev/null +++ b/jcapiv2/docs/SoftwareAppsApi.md @@ -0,0 +1,453 @@ +# {{classname}} + +All URIs are relative to *https://console.jumpcloud.com/api/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**GraphSoftwareappsAssociationsList**](SoftwareAppsApi.md#GraphSoftwareappsAssociationsList) | **Get** /softwareapps/{software_app_id}/associations | List the associations of a Software Application +[**GraphSoftwareappsAssociationsPost**](SoftwareAppsApi.md#GraphSoftwareappsAssociationsPost) | **Post** /softwareapps/{software_app_id}/associations | Manage the associations of a software application. +[**GraphSoftwareappsTraverseSystem**](SoftwareAppsApi.md#GraphSoftwareappsTraverseSystem) | **Get** /softwareapps/{software_app_id}/systems | List the Systems bound to a Software App. +[**GraphSoftwareappsTraverseSystemGroup**](SoftwareAppsApi.md#GraphSoftwareappsTraverseSystemGroup) | **Get** /softwareapps/{software_app_id}/systemgroups | List the System Groups bound to a Software App. +[**SoftwareAppStatusesList**](SoftwareAppsApi.md#SoftwareAppStatusesList) | **Get** /softwareapps/{software_app_id}/statuses | Get the status of the provided Software Application +[**SoftwareAppsDelete**](SoftwareAppsApi.md#SoftwareAppsDelete) | **Delete** /softwareapps/{id} | Delete a configured Software Application +[**SoftwareAppsGet**](SoftwareAppsApi.md#SoftwareAppsGet) | **Get** /softwareapps/{id} | Retrieve a configured Software Application. +[**SoftwareAppsList**](SoftwareAppsApi.md#SoftwareAppsList) | **Get** /softwareapps | Get all configured Software Applications. +[**SoftwareAppsPost**](SoftwareAppsApi.md#SoftwareAppsPost) | **Post** /softwareapps | Create a Software Application that will be managed by JumpCloud. +[**SoftwareAppsReclaimLicenses**](SoftwareAppsApi.md#SoftwareAppsReclaimLicenses) | **Post** /softwareapps/{software_app_id}/reclaim-licenses | Reclaim Licenses for a Software Application. +[**SoftwareAppsRetryInstallation**](SoftwareAppsApi.md#SoftwareAppsRetryInstallation) | **Post** /softwareapps/{software_app_id}/retry-installation | Retry Installation for a Software Application +[**SoftwareAppsUpdate**](SoftwareAppsApi.md#SoftwareAppsUpdate) | **Put** /softwareapps/{id} | Update a Software Application Configuration. + +# **GraphSoftwareappsAssociationsList** +> []GraphConnection GraphSoftwareappsAssociationsList(ctx, softwareAppId, targets, optional) +List the associations of a Software Application + +This endpoint will return the _direct_ associations of a Software Application. A direct association can be a non-homogeneous relationship between 2 different objects, for example Software Application and System Groups. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/softwareapps/{software_app_id}/associations?targets=system_group \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **softwareAppId** | **string**| ObjectID of the Software App. | + **targets** | [**[]string**](string.md)| Targets which a \"software_app\" can be associated to. | + **optional** | ***SoftwareAppsApiGraphSoftwareappsAssociationsListOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a SoftwareAppsApiGraphSoftwareappsAssociationsListOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + **limit** | **optional.Int32**| The number of records to return at once. Limited to 100. | [default to 10] + **skip** | **optional.Int32**| The offset into the records to return. | [default to 0] + **xOrgId** | **optional.String**| Organization identifier that can be obtained from console settings. | + +### Return type + +[**[]GraphConnection**](GraphConnection.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GraphSoftwareappsAssociationsPost** +> GraphSoftwareappsAssociationsPost(ctx, softwareAppId, optional) +Manage the associations of a software application. + +This endpoint allows you to associate or disassociate a software application to a system or system group. #### Sample Request ``` $ curl -X POST https://console.jumpcloud.com/api/v2/softwareapps/{software_app_id}/associations \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"id\": \"\", \"op\": \"add\", \"type\": \"system\" }' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **softwareAppId** | **string**| ObjectID of the Software App. | + **optional** | ***SoftwareAppsApiGraphSoftwareappsAssociationsPostOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a SoftwareAppsApiGraphSoftwareappsAssociationsPostOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **body** | [**optional.Interface of GraphOperationSoftwareApp**](GraphOperationSoftwareApp.md)| | + **xOrgId** | **optional.**| Organization identifier that can be obtained from console settings. | + +### Return type + + (empty response body) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GraphSoftwareappsTraverseSystem** +> []GraphObjectWithPaths GraphSoftwareappsTraverseSystem(ctx, softwareAppId, optional) +List the Systems bound to a Software App. + +This endpoint will return all Systems bound to a Software App, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this Software App to the corresponding System; this array represents all grouping and/or associations that would have to be removed to deprovision the System from this Software App. See `/associations` endpoint to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/softwareapps/{software_app_id}/systems \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **softwareAppId** | **string**| ObjectID of the Software App. | + **optional** | ***SoftwareAppsApiGraphSoftwareappsTraverseSystemOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a SoftwareAppsApiGraphSoftwareappsTraverseSystemOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **limit** | **optional.Int32**| The number of records to return at once. Limited to 100. | [default to 10] + **xOrgId** | **optional.String**| Organization identifier that can be obtained from console settings. | + **skip** | **optional.Int32**| The offset into the records to return. | [default to 0] + **filter** | [**optional.Interface of []string**](string.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | + +### Return type + +[**[]GraphObjectWithPaths**](GraphObjectWithPaths.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GraphSoftwareappsTraverseSystemGroup** +> []GraphObjectWithPaths GraphSoftwareappsTraverseSystemGroup(ctx, softwareAppId, optional) +List the System Groups bound to a Software App. + +This endpoint will return all Systems Groups bound to a Software App, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the group's type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this Software App to the corresponding System Group; this array represents all grouping and/or associations that would have to be removed to deprovision the System Group from this Software App. See `/associations` endpoint to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/softwareapps/{software_app_id}/systemgroups \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **softwareAppId** | **string**| ObjectID of the Software App. | + **optional** | ***SoftwareAppsApiGraphSoftwareappsTraverseSystemGroupOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a SoftwareAppsApiGraphSoftwareappsTraverseSystemGroupOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **limit** | **optional.Int32**| The number of records to return at once. Limited to 100. | [default to 10] + **xOrgId** | **optional.String**| Organization identifier that can be obtained from console settings. | + **skip** | **optional.Int32**| The offset into the records to return. | [default to 0] + **filter** | [**optional.Interface of []string**](string.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | + +### Return type + +[**[]GraphObjectWithPaths**](GraphObjectWithPaths.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **SoftwareAppStatusesList** +> []SoftwareAppStatus SoftwareAppStatusesList(ctx, softwareAppId, optional) +Get the status of the provided Software Application + +This endpoint allows you to get the status of the provided Software Application on associated JumpCloud systems. #### Sample Request ``` $ curl -X GET https://console.jumpcloud.com/api/v2/softwareapps/{software_app_id}/statuses \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **softwareAppId** | **string**| ObjectID of the Software App. | + **optional** | ***SoftwareAppsApiSoftwareAppStatusesListOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a SoftwareAppsApiSoftwareAppStatusesListOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **xOrgId** | **optional.String**| Organization identifier that can be obtained from console settings. | + **filter** | [**optional.Interface of []string**](string.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | + **limit** | **optional.Int32**| The number of records to return at once. Limited to 100. | [default to 10] + **skip** | **optional.Int32**| The offset into the records to return. | [default to 0] + **sort** | [**optional.Interface of []string**](string.md)| The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. | + +### Return type + +[**[]SoftwareAppStatus**](software-app-status.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **SoftwareAppsDelete** +> SoftwareAppsDelete(ctx, id, optional) +Delete a configured Software Application + +Removes a Software Application configuration. Warning: This is a destructive operation and will unmanage the application on all affected systems. #### Sample Request ``` curl -X DELETE https://console.jumpcloud.com/api/v2/softwareapps/{id} \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **id** | **string**| | + **optional** | ***SoftwareAppsApiSoftwareAppsDeleteOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a SoftwareAppsApiSoftwareAppsDeleteOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **xOrgId** | **optional.String**| Organization identifier that can be obtained from console settings. | + +### Return type + + (empty response body) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **SoftwareAppsGet** +> SoftwareApp SoftwareAppsGet(ctx, id, optional) +Retrieve a configured Software Application. + +Retrieves a Software Application. The optional isConfigEnabled and appConfiguration apple_vpp attributes are populated in this response. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/softwareapps/{id} \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **id** | **string**| | + **optional** | ***SoftwareAppsApiSoftwareAppsGetOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a SoftwareAppsApiSoftwareAppsGetOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **xOrgId** | **optional.String**| Organization identifier that can be obtained from console settings. | + +### Return type + +[**SoftwareApp**](software-app.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **SoftwareAppsList** +> []SoftwareApp SoftwareAppsList(ctx, optional) +Get all configured Software Applications. + +This endpoint allows you to get all configured Software Applications that will be managed by JumpCloud on associated JumpCloud systems. The optional isConfigEnabled and appConfiguration apple_vpp attributes are not included in the response. #### Sample Request ``` $ curl -X GET https://console.jumpcloud.com/api/v2/softwareapps \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **optional** | ***SoftwareAppsApiSoftwareAppsListOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a SoftwareAppsApiSoftwareAppsListOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xOrgId** | **optional.String**| Organization identifier that can be obtained from console settings. | + **filter** | [**optional.Interface of []string**](string.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | + **limit** | **optional.Int32**| The number of records to return at once. Limited to 100. | [default to 10] + **skip** | **optional.Int32**| The offset into the records to return. | [default to 0] + **sort** | [**optional.Interface of []string**](string.md)| The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. | + +### Return type + +[**[]SoftwareApp**](software-app.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **SoftwareAppsPost** +> SoftwareApp SoftwareAppsPost(ctx, optional) +Create a Software Application that will be managed by JumpCloud. + +This endpoint allows you to create a Software Application that will be managed by JumpCloud on associated JumpCloud systems. The optional isConfigEnabled and appConfiguration apple_vpp attributes are not included in the response. #### Sample Request ``` $ curl -X POST https://console.jumpcloud.com/api/v2/softwareapps \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"displayName\": \"Adobe Reader\", \"settings\": [{\"packageId\": \"adobereader\"}] }' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **optional** | ***SoftwareAppsApiSoftwareAppsPostOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a SoftwareAppsApiSoftwareAppsPostOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**optional.Interface of SoftwareApp**](SoftwareApp.md)| | + **xOrgId** | **optional.**| Organization identifier that can be obtained from console settings. | + +### Return type + +[**SoftwareApp**](software-app.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **SoftwareAppsReclaimLicenses** +> SoftwareAppReclaimLicenses SoftwareAppsReclaimLicenses(ctx, softwareAppId) +Reclaim Licenses for a Software Application. + +This endpoint allows you to reclaim the licenses from a software app associated with devices that are deleted. #### Sample Request ``` $ curl -X POST https://console.jumpcloud.com/api/v2/softwareapps/{software_app_id}/reclaim-licenses \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{}' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **softwareAppId** | **string**| | + +### Return type + +[**SoftwareAppReclaimLicenses**](software-app-reclaim-licenses.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **SoftwareAppsRetryInstallation** +> SoftwareAppsRetryInstallation(ctx, body, softwareAppId) +Retry Installation for a Software Application + +This endpoints initiates an installation retry of an Apple VPP App for the provided system IDs #### Sample Request ``` $ curl -X POST https://console.jumpcloud.com/api/v2/softwareapps/{software_app_id}/retry-installation \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{\"system_ids\": \"{, , ...}\"}' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **body** | [**SoftwareAppsRetryInstallationRequest**](SoftwareAppsRetryInstallationRequest.md)| | + **softwareAppId** | **string**| | + +### Return type + + (empty response body) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **SoftwareAppsUpdate** +> SoftwareApp SoftwareAppsUpdate(ctx, id, optional) +Update a Software Application Configuration. + +This endpoint updates a specific Software Application configuration for the organization. displayName can be changed alone if no settings are provided. If a setting is provided, it should include all its information since this endpoint will update all the settings' fields. The optional isConfigEnabled and appConfiguration apple_vpp attributes are not included in the response. #### Sample Request - displayName only ``` curl -X PUT https://console.jumpcloud.com/api/v2/softwareapps/{id} \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"displayName\": \"My Software App\" }' ``` #### Sample Request - all attributes ``` curl -X PUT https://console.jumpcloud.com/api/v2/softwareapps/{id} \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"displayName\": \"My Software App\", \"settings\": [ { \"packageId\": \"123456\", \"autoUpdate\": false, \"allowUpdateDelay\": false, \"packageManager\": \"APPLE_VPP\", \"locationObjectId\": \"123456789012123456789012\", \"location\": \"123456\", \"desiredState\": \"Install\", \"appleVpp\": { \"appConfiguration\": \"MyKeyMy String\", \"assignedLicenses\": 20, \"availableLicenses\": 10, \"details\": {}, \"isConfigEnabled\": true, \"supportedDeviceFamilies\": [ \"IPAD\", \"MAC\" ], \"totalLicenses\": 30 }, \"packageSubtitle\": \"My package subtitle\", \"packageVersion\": \"1.2.3\", \"packageKind\": \"software-package\", \"assetKind\": \"software\", \"assetSha256Size\": 256, \"assetSha256Strings\": [ \"a123b123c123d123\" ], \"description\": \"My app description\" } ] }' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **id** | **string**| | + **optional** | ***SoftwareAppsApiSoftwareAppsUpdateOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a SoftwareAppsApiSoftwareAppsUpdateOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **body** | [**optional.Interface of SoftwareApp**](SoftwareApp.md)| | + **xOrgId** | **optional.**| Organization identifier that can be obtained from console settings. | + +### Return type + +[**SoftwareApp**](software-app.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/SoftwareAppsRetryInstallationRequest.md b/jcapiv2/docs/SoftwareAppsRetryInstallationRequest.md new file mode 100644 index 0000000..b77ec5d --- /dev/null +++ b/jcapiv2/docs/SoftwareAppsRetryInstallationRequest.md @@ -0,0 +1,9 @@ +# SoftwareAppsRetryInstallationRequest + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**SystemIds** | **[]string** | An array of system IDs to retry the software application installation. | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/Subscription.md b/jcapiv2/docs/Subscription.md new file mode 100644 index 0000000..93973d7 --- /dev/null +++ b/jcapiv2/docs/Subscription.md @@ -0,0 +1,13 @@ +# Subscription + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**AnnualPrice** | **float64** | The annual (discounted) price of this subscription. | [default to null] +**DisplayName** | **string** | The display name of this subscription. | [default to null] +**Features** | [**[]Feature**](feature.md) | Array of the features included in the subscription. | [default to null] +**ListPrice** | **float64** | The list price of this subscription. | [default to null] +**ProductCode** | **string** | Unique identifier corresponding to this subscription. | [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/SubscriptionsApi.md b/jcapiv2/docs/SubscriptionsApi.md new file mode 100644 index 0000000..84035d2 --- /dev/null +++ b/jcapiv2/docs/SubscriptionsApi.md @@ -0,0 +1,32 @@ +# {{classname}} + +All URIs are relative to *https://console.jumpcloud.com/api/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**SubscriptionsGet**](SubscriptionsApi.md#SubscriptionsGet) | **Get** /subscriptions | Lists all the Pricing & Packaging Subscriptions + +# **SubscriptionsGet** +> []Subscription SubscriptionsGet(ctx, ) +Lists all the Pricing & Packaging Subscriptions + +This endpoint returns all pricing & packaging subscriptions. ##### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/subscriptions \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + +### Required Parameters +This endpoint does not need any parameter. + +### Return type + +[**[]Subscription**](subscription.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/SuggestionCounts.md b/jcapiv2/docs/SuggestionCounts.md new file mode 100644 index 0000000..27d13c7 --- /dev/null +++ b/jcapiv2/docs/SuggestionCounts.md @@ -0,0 +1,11 @@ +# SuggestionCounts + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Add** | **int32** | | [optional] [default to null] +**Remove** | **int32** | | [optional] [default to null] +**Total** | **int32** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/SystemGroup.md b/jcapiv2/docs/SystemGroup.md new file mode 100644 index 0000000..fdfeb3f --- /dev/null +++ b/jcapiv2/docs/SystemGroup.md @@ -0,0 +1,14 @@ +# SystemGroup + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Attributes** | [***GraphAttributes**](GraphAttributes.md) | | [optional] [default to null] +**Description** | **string** | Description of a System Group | [optional] [default to null] +**Email** | **string** | E-mail address associated with a System Group | [optional] [default to null] +**Id** | **string** | ObjectId uniquely identifying a System Group. | [optional] [default to null] +**Name** | **string** | Display name of a System Group. | [optional] [default to null] +**Type_** | **string** | The type of the group; always 'system' for a System Group. | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/SystemGroupAssociationsApi.md b/jcapiv2/docs/SystemGroupAssociationsApi.md new file mode 100644 index 0000000..2f7928c --- /dev/null +++ b/jcapiv2/docs/SystemGroupAssociationsApi.md @@ -0,0 +1,286 @@ +# {{classname}} + +All URIs are relative to *https://console.jumpcloud.com/api/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**GraphSystemGroupAssociationsList**](SystemGroupAssociationsApi.md#GraphSystemGroupAssociationsList) | **Get** /systemgroups/{group_id}/associations | List the associations of a System Group +[**GraphSystemGroupAssociationsPost**](SystemGroupAssociationsApi.md#GraphSystemGroupAssociationsPost) | **Post** /systemgroups/{group_id}/associations | Manage the associations of a System Group +[**GraphSystemGroupTraverseCommand**](SystemGroupAssociationsApi.md#GraphSystemGroupTraverseCommand) | **Get** /systemgroups/{group_id}/commands | List the Commands bound to a System Group +[**GraphSystemGroupTraversePolicy**](SystemGroupAssociationsApi.md#GraphSystemGroupTraversePolicy) | **Get** /systemgroups/{group_id}/policies | List the Policies bound to a System Group +[**GraphSystemGroupTraversePolicyGroup**](SystemGroupAssociationsApi.md#GraphSystemGroupTraversePolicyGroup) | **Get** /systemgroups/{group_id}/policygroups | List the Policy Groups bound to a System Group +[**GraphSystemGroupTraverseUser**](SystemGroupAssociationsApi.md#GraphSystemGroupTraverseUser) | **Get** /systemgroups/{group_id}/users | List the Users bound to a System Group +[**GraphSystemGroupTraverseUserGroup**](SystemGroupAssociationsApi.md#GraphSystemGroupTraverseUserGroup) | **Get** /systemgroups/{group_id}/usergroups | List the User Groups bound to a System Group + +# **GraphSystemGroupAssociationsList** +> []GraphConnection GraphSystemGroupAssociationsList(ctx, groupId, targets, optional) +List the associations of a System Group + +This endpoint returns the _direct_ associations of a System Group. A direct association can be a non-homogeneous relationship between 2 different objects, for example System Groups and Users. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/systemgroups/{GroupID}/associations?targets=user \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **groupId** | **string**| ObjectID of the System Group. | + **targets** | [**[]string**](string.md)| Targets which a \"system_group\" can be associated to. | + **optional** | ***SystemGroupAssociationsApiGraphSystemGroupAssociationsListOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a SystemGroupAssociationsApiGraphSystemGroupAssociationsListOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + **limit** | **optional.Int32**| The number of records to return at once. Limited to 100. | [default to 10] + **skip** | **optional.Int32**| The offset into the records to return. | [default to 0] + **xOrgId** | **optional.String**| Organization identifier that can be obtained from console settings. | + +### Return type + +[**[]GraphConnection**](GraphConnection.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GraphSystemGroupAssociationsPost** +> GraphSystemGroupAssociationsPost(ctx, groupId, optional) +Manage the associations of a System Group + +This endpoint allows you to manage the _direct_ associations of a System Group. A direct association can be a non-homogeneous relationship between 2 different objects, for example System Groups and Users. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/systemgroups/{GroupID}/associations \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"op\": \"add\", \"type\": \"user\", \"id\": \"{UserID}\" }' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **groupId** | **string**| ObjectID of the System Group. | + **optional** | ***SystemGroupAssociationsApiGraphSystemGroupAssociationsPostOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a SystemGroupAssociationsApiGraphSystemGroupAssociationsPostOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **body** | [**optional.Interface of GraphOperationSystemGroup**](GraphOperationSystemGroup.md)| | + **xOrgId** | **optional.**| Organization identifier that can be obtained from console settings. | + +### Return type + + (empty response body) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GraphSystemGroupTraverseCommand** +> []GraphObjectWithPaths GraphSystemGroupTraverseCommand(ctx, groupId, optional) +List the Commands bound to a System Group + +This endpoint will return all Commands bound to a System Group, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the group's type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this System Group to the corresponding Command; this array represents all grouping and/or associations that would have to be removed to deprovision the Command from this System Group. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/systemgroups/{GroupID}/commands \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **groupId** | **string**| ObjectID of the System Group. | + **optional** | ***SystemGroupAssociationsApiGraphSystemGroupTraverseCommandOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a SystemGroupAssociationsApiGraphSystemGroupTraverseCommandOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **limit** | **optional.Int32**| The number of records to return at once. Limited to 100. | [default to 10] + **xOrgId** | **optional.String**| Organization identifier that can be obtained from console settings. | + **skip** | **optional.Int32**| The offset into the records to return. | [default to 0] + **filter** | [**optional.Interface of []string**](string.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | + +### Return type + +[**[]GraphObjectWithPaths**](GraphObjectWithPaths.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GraphSystemGroupTraversePolicy** +> []GraphObjectWithPaths GraphSystemGroupTraversePolicy(ctx, groupId, optional) +List the Policies bound to a System Group + +This endpoint will return all Policies bound to a System Group, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this System Group to the corresponding Policy; this array represents all grouping and/or associations that would have to be removed to deprovision the Policy from this System Group. See `/members` and `/associations` endpoints to manage those collections. This endpoint is not public yet as we haven't finished the code. ##### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/systemgroups/{GroupID}/policies \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **groupId** | **string**| ObjectID of the System Group. | + **optional** | ***SystemGroupAssociationsApiGraphSystemGroupTraversePolicyOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a SystemGroupAssociationsApiGraphSystemGroupTraversePolicyOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **limit** | **optional.Int32**| The number of records to return at once. Limited to 100. | [default to 10] + **xOrgId** | **optional.String**| Organization identifier that can be obtained from console settings. | + **skip** | **optional.Int32**| The offset into the records to return. | [default to 0] + **filter** | [**optional.Interface of []string**](string.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | + +### Return type + +[**[]GraphObjectWithPaths**](GraphObjectWithPaths.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GraphSystemGroupTraversePolicyGroup** +> []GraphObjectWithPaths GraphSystemGroupTraversePolicyGroup(ctx, groupId, optional) +List the Policy Groups bound to a System Group + +This endpoint will return all Policy Groups bound to a System Group, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this System Group to the corresponding Policy Group; this array represents all grouping and/or associations that would have to be removed to deprovision the Policy Group from this System Group. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/systemgroups/{GroupID}/policygroups \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **groupId** | **string**| ObjectID of the System Group. | + **optional** | ***SystemGroupAssociationsApiGraphSystemGroupTraversePolicyGroupOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a SystemGroupAssociationsApiGraphSystemGroupTraversePolicyGroupOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **limit** | **optional.Int32**| The number of records to return at once. Limited to 100. | [default to 10] + **xOrgId** | **optional.String**| Organization identifier that can be obtained from console settings. | + **skip** | **optional.Int32**| The offset into the records to return. | [default to 0] + **filter** | [**optional.Interface of []string**](string.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | + +### Return type + +[**[]GraphObjectWithPaths**](GraphObjectWithPaths.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GraphSystemGroupTraverseUser** +> []GraphObjectWithPaths GraphSystemGroupTraverseUser(ctx, groupId, optional) +List the Users bound to a System Group + +This endpoint will return all Users bound to a System Group, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this System Group to the corresponding User; this array represents all grouping and/or associations that would have to be removed to deprovision the User from this System Group. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/systemgroups/{GroupID}/users \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **groupId** | **string**| ObjectID of the System Group. | + **optional** | ***SystemGroupAssociationsApiGraphSystemGroupTraverseUserOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a SystemGroupAssociationsApiGraphSystemGroupTraverseUserOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **limit** | **optional.Int32**| The number of records to return at once. Limited to 100. | [default to 10] + **xOrgId** | **optional.String**| Organization identifier that can be obtained from console settings. | + **skip** | **optional.Int32**| The offset into the records to return. | [default to 0] + **filter** | [**optional.Interface of []string**](string.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | + +### Return type + +[**[]GraphObjectWithPaths**](GraphObjectWithPaths.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GraphSystemGroupTraverseUserGroup** +> []GraphObjectWithPaths GraphSystemGroupTraverseUserGroup(ctx, groupId, optional) +List the User Groups bound to a System Group + +This endpoint will return all User Groups bound to a System Group, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this System Group to the corresponding User Group; this array represents all grouping and/or associations that would have to be removed to deprovision the User Group from this System Group. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/systemgroups/{GroupID}/usergroups \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **groupId** | **string**| ObjectID of the System Group. | + **optional** | ***SystemGroupAssociationsApiGraphSystemGroupTraverseUserGroupOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a SystemGroupAssociationsApiGraphSystemGroupTraverseUserGroupOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **limit** | **optional.Int32**| The number of records to return at once. Limited to 100. | [default to 10] + **xOrgId** | **optional.String**| Organization identifier that can be obtained from console settings. | + **skip** | **optional.Int32**| The offset into the records to return. | [default to 0] + **filter** | [**optional.Interface of []string**](string.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | + +### Return type + +[**[]GraphObjectWithPaths**](GraphObjectWithPaths.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/v2/docs/SystemGroupData.md b/jcapiv2/docs/SystemGroupData.md similarity index 99% rename from v2/docs/SystemGroupData.md rename to jcapiv2/docs/SystemGroupData.md index 94c38be..88b6cf5 100644 --- a/v2/docs/SystemGroupData.md +++ b/jcapiv2/docs/SystemGroupData.md @@ -7,4 +7,3 @@ Name | Type | Description | Notes [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/jcapiv2/docs/SystemGroupMembersMembershipApi.md b/jcapiv2/docs/SystemGroupMembersMembershipApi.md new file mode 100644 index 0000000..7860f56 --- /dev/null +++ b/jcapiv2/docs/SystemGroupMembersMembershipApi.md @@ -0,0 +1,127 @@ +# {{classname}} + +All URIs are relative to *https://console.jumpcloud.com/api/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**GraphSystemGroupMembersList**](SystemGroupMembersMembershipApi.md#GraphSystemGroupMembersList) | **Get** /systemgroups/{group_id}/members | List the members of a System Group +[**GraphSystemGroupMembersPost**](SystemGroupMembersMembershipApi.md#GraphSystemGroupMembersPost) | **Post** /systemgroups/{group_id}/members | Manage the members of a System Group +[**GraphSystemGroupMembership**](SystemGroupMembersMembershipApi.md#GraphSystemGroupMembership) | **Get** /systemgroups/{group_id}/membership | List the System Group's membership + +# **GraphSystemGroupMembersList** +> []GraphConnection GraphSystemGroupMembersList(ctx, groupId, optional) +List the members of a System Group + +This endpoint returns the system members of a System Group. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/systemgroups/{Group_ID}/members \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **groupId** | **string**| ObjectID of the System Group. | + **optional** | ***SystemGroupMembersMembershipApiGraphSystemGroupMembersListOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a SystemGroupMembersMembershipApiGraphSystemGroupMembersListOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **limit** | **optional.Int32**| The number of records to return at once. Limited to 100. | [default to 10] + **skip** | **optional.Int32**| The offset into the records to return. | [default to 0] + **xOrgId** | **optional.String**| Organization identifier that can be obtained from console settings. | + +### Return type + +[**[]GraphConnection**](GraphConnection.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GraphSystemGroupMembersPost** +> GraphSystemGroupMembersPost(ctx, groupId, optional) +Manage the members of a System Group + +This endpoint allows you to manage the system members of a System Group. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/systemgroups/{Group_ID}/members \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"op\": \"add\", \"type\": \"system\", \"id\": \"{System_ID}\" }' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **groupId** | **string**| ObjectID of the System Group. | + **optional** | ***SystemGroupMembersMembershipApiGraphSystemGroupMembersPostOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a SystemGroupMembersMembershipApiGraphSystemGroupMembersPostOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **body** | [**optional.Interface of GraphOperationSystemGroupMember**](GraphOperationSystemGroupMember.md)| | + **date** | **optional.**| Current date header for the System Context API | + **authorization** | **optional.**| Authorization header for the System Context API | + **xOrgId** | **optional.**| Organization identifier that can be obtained from console settings. | + +### Return type + + (empty response body) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GraphSystemGroupMembership** +> []GraphObjectWithPaths GraphSystemGroupMembership(ctx, groupId, optional) +List the System Group's membership + +This endpoint returns all Systems that are a member of this System Group. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/systemgroups/{Group_ID/membership \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **groupId** | **string**| ObjectID of the System Group. | + **optional** | ***SystemGroupMembersMembershipApiGraphSystemGroupMembershipOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a SystemGroupMembersMembershipApiGraphSystemGroupMembershipOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **limit** | **optional.Int32**| The number of records to return at once. Limited to 100. | [default to 10] + **skip** | **optional.Int32**| The offset into the records to return. | [default to 0] + **sort** | [**optional.Interface of []string**](string.md)| The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. | + **filter** | [**optional.Interface of []string**](string.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | + **xOrgId** | **optional.String**| Organization identifier that can be obtained from console settings. | + +### Return type + +[**[]GraphObjectWithPaths**](GraphObjectWithPaths.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/SystemGroupsApi.md b/jcapiv2/docs/SystemGroupsApi.md new file mode 100644 index 0000000..5edc58b --- /dev/null +++ b/jcapiv2/docs/SystemGroupsApi.md @@ -0,0 +1,554 @@ +# {{classname}} + +All URIs are relative to *https://console.jumpcloud.com/api/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**GraphSystemGroupAssociationsList**](SystemGroupsApi.md#GraphSystemGroupAssociationsList) | **Get** /systemgroups/{group_id}/associations | List the associations of a System Group +[**GraphSystemGroupAssociationsPost**](SystemGroupsApi.md#GraphSystemGroupAssociationsPost) | **Post** /systemgroups/{group_id}/associations | Manage the associations of a System Group +[**GraphSystemGroupMembersList**](SystemGroupsApi.md#GraphSystemGroupMembersList) | **Get** /systemgroups/{group_id}/members | List the members of a System Group +[**GraphSystemGroupMembersPost**](SystemGroupsApi.md#GraphSystemGroupMembersPost) | **Post** /systemgroups/{group_id}/members | Manage the members of a System Group +[**GraphSystemGroupMembership**](SystemGroupsApi.md#GraphSystemGroupMembership) | **Get** /systemgroups/{group_id}/membership | List the System Group's membership +[**GraphSystemGroupTraversePolicy**](SystemGroupsApi.md#GraphSystemGroupTraversePolicy) | **Get** /systemgroups/{group_id}/policies | List the Policies bound to a System Group +[**GraphSystemGroupTraversePolicyGroup**](SystemGroupsApi.md#GraphSystemGroupTraversePolicyGroup) | **Get** /systemgroups/{group_id}/policygroups | List the Policy Groups bound to a System Group +[**GraphSystemGroupTraverseUser**](SystemGroupsApi.md#GraphSystemGroupTraverseUser) | **Get** /systemgroups/{group_id}/users | List the Users bound to a System Group +[**GraphSystemGroupTraverseUserGroup**](SystemGroupsApi.md#GraphSystemGroupTraverseUserGroup) | **Get** /systemgroups/{group_id}/usergroups | List the User Groups bound to a System Group +[**GroupsSystemDelete**](SystemGroupsApi.md#GroupsSystemDelete) | **Delete** /systemgroups/{id} | Delete a System Group +[**GroupsSystemGet**](SystemGroupsApi.md#GroupsSystemGet) | **Get** /systemgroups/{id} | View an individual System Group details +[**GroupsSystemList**](SystemGroupsApi.md#GroupsSystemList) | **Get** /systemgroups | List all System Groups +[**GroupsSystemPost**](SystemGroupsApi.md#GroupsSystemPost) | **Post** /systemgroups | Create a new System Group +[**GroupsSystemPut**](SystemGroupsApi.md#GroupsSystemPut) | **Put** /systemgroups/{id} | Update a System Group + +# **GraphSystemGroupAssociationsList** +> []GraphConnection GraphSystemGroupAssociationsList(ctx, groupId, targets, optional) +List the associations of a System Group + +This endpoint returns the _direct_ associations of a System Group. A direct association can be a non-homogeneous relationship between 2 different objects, for example System Groups and Users. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/systemgroups/{GroupID}/associations?targets=user \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **groupId** | **string**| ObjectID of the System Group. | + **targets** | [**[]string**](string.md)| Targets which a \"system_group\" can be associated to. | + **optional** | ***SystemGroupsApiGraphSystemGroupAssociationsListOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a SystemGroupsApiGraphSystemGroupAssociationsListOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + **limit** | **optional.Int32**| The number of records to return at once. Limited to 100. | [default to 10] + **skip** | **optional.Int32**| The offset into the records to return. | [default to 0] + **xOrgId** | **optional.String**| Organization identifier that can be obtained from console settings. | + +### Return type + +[**[]GraphConnection**](GraphConnection.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GraphSystemGroupAssociationsPost** +> GraphSystemGroupAssociationsPost(ctx, groupId, optional) +Manage the associations of a System Group + +This endpoint allows you to manage the _direct_ associations of a System Group. A direct association can be a non-homogeneous relationship between 2 different objects, for example System Groups and Users. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/systemgroups/{GroupID}/associations \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"op\": \"add\", \"type\": \"user\", \"id\": \"{UserID}\" }' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **groupId** | **string**| ObjectID of the System Group. | + **optional** | ***SystemGroupsApiGraphSystemGroupAssociationsPostOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a SystemGroupsApiGraphSystemGroupAssociationsPostOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **body** | [**optional.Interface of GraphOperationSystemGroup**](GraphOperationSystemGroup.md)| | + **xOrgId** | **optional.**| Organization identifier that can be obtained from console settings. | + +### Return type + + (empty response body) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GraphSystemGroupMembersList** +> []GraphConnection GraphSystemGroupMembersList(ctx, groupId, optional) +List the members of a System Group + +This endpoint returns the system members of a System Group. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/systemgroups/{Group_ID}/members \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **groupId** | **string**| ObjectID of the System Group. | + **optional** | ***SystemGroupsApiGraphSystemGroupMembersListOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a SystemGroupsApiGraphSystemGroupMembersListOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **limit** | **optional.Int32**| The number of records to return at once. Limited to 100. | [default to 10] + **skip** | **optional.Int32**| The offset into the records to return. | [default to 0] + **xOrgId** | **optional.String**| Organization identifier that can be obtained from console settings. | + +### Return type + +[**[]GraphConnection**](GraphConnection.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GraphSystemGroupMembersPost** +> GraphSystemGroupMembersPost(ctx, groupId, optional) +Manage the members of a System Group + +This endpoint allows you to manage the system members of a System Group. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/systemgroups/{Group_ID}/members \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"op\": \"add\", \"type\": \"system\", \"id\": \"{System_ID}\" }' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **groupId** | **string**| ObjectID of the System Group. | + **optional** | ***SystemGroupsApiGraphSystemGroupMembersPostOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a SystemGroupsApiGraphSystemGroupMembersPostOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **body** | [**optional.Interface of GraphOperationSystemGroupMember**](GraphOperationSystemGroupMember.md)| | + **date** | **optional.**| Current date header for the System Context API | + **authorization** | **optional.**| Authorization header for the System Context API | + **xOrgId** | **optional.**| Organization identifier that can be obtained from console settings. | + +### Return type + + (empty response body) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GraphSystemGroupMembership** +> []GraphObjectWithPaths GraphSystemGroupMembership(ctx, groupId, optional) +List the System Group's membership + +This endpoint returns all Systems that are a member of this System Group. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/systemgroups/{Group_ID/membership \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **groupId** | **string**| ObjectID of the System Group. | + **optional** | ***SystemGroupsApiGraphSystemGroupMembershipOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a SystemGroupsApiGraphSystemGroupMembershipOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **limit** | **optional.Int32**| The number of records to return at once. Limited to 100. | [default to 10] + **skip** | **optional.Int32**| The offset into the records to return. | [default to 0] + **sort** | [**optional.Interface of []string**](string.md)| The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. | + **filter** | [**optional.Interface of []string**](string.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | + **xOrgId** | **optional.String**| Organization identifier that can be obtained from console settings. | + +### Return type + +[**[]GraphObjectWithPaths**](GraphObjectWithPaths.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GraphSystemGroupTraversePolicy** +> []GraphObjectWithPaths GraphSystemGroupTraversePolicy(ctx, groupId, optional) +List the Policies bound to a System Group + +This endpoint will return all Policies bound to a System Group, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this System Group to the corresponding Policy; this array represents all grouping and/or associations that would have to be removed to deprovision the Policy from this System Group. See `/members` and `/associations` endpoints to manage those collections. This endpoint is not public yet as we haven't finished the code. ##### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/systemgroups/{GroupID}/policies \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **groupId** | **string**| ObjectID of the System Group. | + **optional** | ***SystemGroupsApiGraphSystemGroupTraversePolicyOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a SystemGroupsApiGraphSystemGroupTraversePolicyOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **limit** | **optional.Int32**| The number of records to return at once. Limited to 100. | [default to 10] + **xOrgId** | **optional.String**| Organization identifier that can be obtained from console settings. | + **skip** | **optional.Int32**| The offset into the records to return. | [default to 0] + **filter** | [**optional.Interface of []string**](string.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | + +### Return type + +[**[]GraphObjectWithPaths**](GraphObjectWithPaths.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GraphSystemGroupTraversePolicyGroup** +> []GraphObjectWithPaths GraphSystemGroupTraversePolicyGroup(ctx, groupId, optional) +List the Policy Groups bound to a System Group + +This endpoint will return all Policy Groups bound to a System Group, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this System Group to the corresponding Policy Group; this array represents all grouping and/or associations that would have to be removed to deprovision the Policy Group from this System Group. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/systemgroups/{GroupID}/policygroups \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **groupId** | **string**| ObjectID of the System Group. | + **optional** | ***SystemGroupsApiGraphSystemGroupTraversePolicyGroupOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a SystemGroupsApiGraphSystemGroupTraversePolicyGroupOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **limit** | **optional.Int32**| The number of records to return at once. Limited to 100. | [default to 10] + **xOrgId** | **optional.String**| Organization identifier that can be obtained from console settings. | + **skip** | **optional.Int32**| The offset into the records to return. | [default to 0] + **filter** | [**optional.Interface of []string**](string.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | + +### Return type + +[**[]GraphObjectWithPaths**](GraphObjectWithPaths.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GraphSystemGroupTraverseUser** +> []GraphObjectWithPaths GraphSystemGroupTraverseUser(ctx, groupId, optional) +List the Users bound to a System Group + +This endpoint will return all Users bound to a System Group, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this System Group to the corresponding User; this array represents all grouping and/or associations that would have to be removed to deprovision the User from this System Group. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/systemgroups/{GroupID}/users \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **groupId** | **string**| ObjectID of the System Group. | + **optional** | ***SystemGroupsApiGraphSystemGroupTraverseUserOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a SystemGroupsApiGraphSystemGroupTraverseUserOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **limit** | **optional.Int32**| The number of records to return at once. Limited to 100. | [default to 10] + **xOrgId** | **optional.String**| Organization identifier that can be obtained from console settings. | + **skip** | **optional.Int32**| The offset into the records to return. | [default to 0] + **filter** | [**optional.Interface of []string**](string.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | + +### Return type + +[**[]GraphObjectWithPaths**](GraphObjectWithPaths.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GraphSystemGroupTraverseUserGroup** +> []GraphObjectWithPaths GraphSystemGroupTraverseUserGroup(ctx, groupId, optional) +List the User Groups bound to a System Group + +This endpoint will return all User Groups bound to a System Group, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this System Group to the corresponding User Group; this array represents all grouping and/or associations that would have to be removed to deprovision the User Group from this System Group. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/systemgroups/{GroupID}/usergroups \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **groupId** | **string**| ObjectID of the System Group. | + **optional** | ***SystemGroupsApiGraphSystemGroupTraverseUserGroupOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a SystemGroupsApiGraphSystemGroupTraverseUserGroupOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **limit** | **optional.Int32**| The number of records to return at once. Limited to 100. | [default to 10] + **xOrgId** | **optional.String**| Organization identifier that can be obtained from console settings. | + **skip** | **optional.Int32**| The offset into the records to return. | [default to 0] + **filter** | [**optional.Interface of []string**](string.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | + +### Return type + +[**[]GraphObjectWithPaths**](GraphObjectWithPaths.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GroupsSystemDelete** +> SystemGroup GroupsSystemDelete(ctx, id, optional) +Delete a System Group + +This endpoint allows you to delete a System Group. #### Sample Request ``` curl -X DELETE https://console.jumpcloud.com/api/v2/systemgroups/{Group_ID} \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **id** | **string**| ObjectID of the System Group. | + **optional** | ***SystemGroupsApiGroupsSystemDeleteOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a SystemGroupsApiGroupsSystemDeleteOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **xOrgId** | **optional.String**| Organization identifier that can be obtained from console settings. | + +### Return type + +[**SystemGroup**](SystemGroup.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GroupsSystemGet** +> SystemGroup GroupsSystemGet(ctx, id, optional) +View an individual System Group details + +This endpoint returns the details of a System Group. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/systemgroups/{Group_ID} \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **id** | **string**| ObjectID of the System Group. | + **optional** | ***SystemGroupsApiGroupsSystemGetOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a SystemGroupsApiGroupsSystemGetOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **xOrgId** | **optional.String**| Organization identifier that can be obtained from console settings. | + +### Return type + +[**SystemGroup**](SystemGroup.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GroupsSystemList** +> []SystemGroup GroupsSystemList(ctx, optional) +List all System Groups + +This endpoint returns all System Groups. Available filter fields: - `name` - `disabled` - `type` #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/systemgroups \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **optional** | ***SystemGroupsApiGroupsSystemListOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a SystemGroupsApiGroupsSystemListOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **fields** | [**optional.Interface of []string**](string.md)| The comma separated fields included in the returned records. If omitted, the default list of fields will be returned. | + **filter** | [**optional.Interface of []string**](string.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | + **limit** | **optional.Int32**| The number of records to return at once. Limited to 100. | [default to 10] + **skip** | **optional.Int32**| The offset into the records to return. | [default to 0] + **sort** | [**optional.Interface of []string**](string.md)| The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. | + **xOrgId** | **optional.String**| Organization identifier that can be obtained from console settings. | + +### Return type + +[**[]SystemGroup**](SystemGroup.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GroupsSystemPost** +> SystemGroup GroupsSystemPost(ctx, optional) +Create a new System Group + +This endpoint allows you to create a new System Group. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/systemgroups \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"name\": \"{Group_Name}\" }' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **optional** | ***SystemGroupsApiGroupsSystemPostOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a SystemGroupsApiGroupsSystemPostOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**optional.Interface of SystemGroupData**](SystemGroupData.md)| | + **xOrgId** | **optional.**| Organization identifier that can be obtained from console settings. | + +### Return type + +[**SystemGroup**](SystemGroup.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GroupsSystemPut** +> SystemGroup GroupsSystemPut(ctx, id, optional) +Update a System Group + +This endpoint allows you to do a full update of the System Group. #### Sample Request ``` curl -X PUT https://console.jumpcloud.com/api/v2/systemgroups/{Group_ID} \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"name\": \"Name_Update\" }' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **id** | **string**| ObjectID of the System Group. | + **optional** | ***SystemGroupsApiGroupsSystemPutOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a SystemGroupsApiGroupsSystemPutOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **body** | [**optional.Interface of SystemGroupData**](SystemGroupData.md)| | + **xOrgId** | **optional.**| Organization identifier that can be obtained from console settings. | + +### Return type + +[**SystemGroup**](SystemGroup.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/SystemInsightsAlf.md b/jcapiv2/docs/SystemInsightsAlf.md new file mode 100644 index 0000000..7e07de1 --- /dev/null +++ b/jcapiv2/docs/SystemInsightsAlf.md @@ -0,0 +1,17 @@ +# SystemInsightsAlf + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**AllowSignedEnabled** | **int32** | | [optional] [default to null] +**CollectionTime** | **string** | | [optional] [default to null] +**FirewallUnload** | **int32** | | [optional] [default to null] +**GlobalState** | **int32** | | [optional] [default to null] +**LoggingEnabled** | **int32** | | [optional] [default to null] +**LoggingOption** | **int32** | | [optional] [default to null] +**StealthEnabled** | **int32** | | [optional] [default to null] +**SystemId** | **string** | | [optional] [default to null] +**Version** | **string** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/SystemInsightsAlfExceptions.md b/jcapiv2/docs/SystemInsightsAlfExceptions.md new file mode 100644 index 0000000..e9ae6a1 --- /dev/null +++ b/jcapiv2/docs/SystemInsightsAlfExceptions.md @@ -0,0 +1,12 @@ +# SystemInsightsAlfExceptions + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**CollectionTime** | **string** | | [optional] [default to null] +**Path** | **string** | | [optional] [default to null] +**State** | **float64** | | [optional] [default to null] +**SystemId** | **string** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/SystemInsightsAlfExplicitAuths.md b/jcapiv2/docs/SystemInsightsAlfExplicitAuths.md new file mode 100644 index 0000000..380459b --- /dev/null +++ b/jcapiv2/docs/SystemInsightsAlfExplicitAuths.md @@ -0,0 +1,11 @@ +# SystemInsightsAlfExplicitAuths + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**CollectionTime** | **string** | | [optional] [default to null] +**Process** | **string** | | [optional] [default to null] +**SystemId** | **string** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/SystemInsightsApi.md b/jcapiv2/docs/SystemInsightsApi.md new file mode 100644 index 0000000..623aadb --- /dev/null +++ b/jcapiv2/docs/SystemInsightsApi.md @@ -0,0 +1,2347 @@ +# {{classname}} + +All URIs are relative to *https://console.jumpcloud.com/api/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**SysteminsightsListAlf**](SystemInsightsApi.md#SysteminsightsListAlf) | **Get** /systeminsights/alf | List System Insights ALF +[**SysteminsightsListAlfExceptions**](SystemInsightsApi.md#SysteminsightsListAlfExceptions) | **Get** /systeminsights/alf_exceptions | List System Insights ALF Exceptions +[**SysteminsightsListAlfExplicitAuths**](SystemInsightsApi.md#SysteminsightsListAlfExplicitAuths) | **Get** /systeminsights/alf_explicit_auths | List System Insights ALF Explicit Authentications +[**SysteminsightsListAppcompatShims**](SystemInsightsApi.md#SysteminsightsListAppcompatShims) | **Get** /systeminsights/appcompat_shims | List System Insights Application Compatibility Shims +[**SysteminsightsListApps**](SystemInsightsApi.md#SysteminsightsListApps) | **Get** /systeminsights/apps | List System Insights Apps +[**SysteminsightsListAuthorizedKeys**](SystemInsightsApi.md#SysteminsightsListAuthorizedKeys) | **Get** /systeminsights/authorized_keys | List System Insights Authorized Keys +[**SysteminsightsListAzureInstanceMetadata**](SystemInsightsApi.md#SysteminsightsListAzureInstanceMetadata) | **Get** /systeminsights/azure_instance_metadata | List System Insights Azure Instance Metadata +[**SysteminsightsListAzureInstanceTags**](SystemInsightsApi.md#SysteminsightsListAzureInstanceTags) | **Get** /systeminsights/azure_instance_tags | List System Insights Azure Instance Tags +[**SysteminsightsListBattery**](SystemInsightsApi.md#SysteminsightsListBattery) | **Get** /systeminsights/battery | List System Insights Battery +[**SysteminsightsListBitlockerInfo**](SystemInsightsApi.md#SysteminsightsListBitlockerInfo) | **Get** /systeminsights/bitlocker_info | List System Insights Bitlocker Info +[**SysteminsightsListBrowserPlugins**](SystemInsightsApi.md#SysteminsightsListBrowserPlugins) | **Get** /systeminsights/browser_plugins | List System Insights Browser Plugins +[**SysteminsightsListCertificates**](SystemInsightsApi.md#SysteminsightsListCertificates) | **Get** /systeminsights/certificates | List System Insights Certificates +[**SysteminsightsListChassisInfo**](SystemInsightsApi.md#SysteminsightsListChassisInfo) | **Get** /systeminsights/chassis_info | List System Insights Chassis Info +[**SysteminsightsListChromeExtensions**](SystemInsightsApi.md#SysteminsightsListChromeExtensions) | **Get** /systeminsights/chrome_extensions | List System Insights Chrome Extensions +[**SysteminsightsListConnectivity**](SystemInsightsApi.md#SysteminsightsListConnectivity) | **Get** /systeminsights/connectivity | List System Insights Connectivity +[**SysteminsightsListCrashes**](SystemInsightsApi.md#SysteminsightsListCrashes) | **Get** /systeminsights/crashes | List System Insights Crashes +[**SysteminsightsListCupsDestinations**](SystemInsightsApi.md#SysteminsightsListCupsDestinations) | **Get** /systeminsights/cups_destinations | List System Insights CUPS Destinations +[**SysteminsightsListDiskEncryption**](SystemInsightsApi.md#SysteminsightsListDiskEncryption) | **Get** /systeminsights/disk_encryption | List System Insights Disk Encryption +[**SysteminsightsListDiskInfo**](SystemInsightsApi.md#SysteminsightsListDiskInfo) | **Get** /systeminsights/disk_info | List System Insights Disk Info +[**SysteminsightsListDnsResolvers**](SystemInsightsApi.md#SysteminsightsListDnsResolvers) | **Get** /systeminsights/dns_resolvers | List System Insights DNS Resolvers +[**SysteminsightsListEtcHosts**](SystemInsightsApi.md#SysteminsightsListEtcHosts) | **Get** /systeminsights/etc_hosts | List System Insights Etc Hosts +[**SysteminsightsListFirefoxAddons**](SystemInsightsApi.md#SysteminsightsListFirefoxAddons) | **Get** /systeminsights/firefox_addons | List System Insights Firefox Addons +[**SysteminsightsListGroups**](SystemInsightsApi.md#SysteminsightsListGroups) | **Get** /systeminsights/groups | List System Insights Groups +[**SysteminsightsListIeExtensions**](SystemInsightsApi.md#SysteminsightsListIeExtensions) | **Get** /systeminsights/ie_extensions | List System Insights IE Extensions +[**SysteminsightsListInterfaceAddresses**](SystemInsightsApi.md#SysteminsightsListInterfaceAddresses) | **Get** /systeminsights/interface_addresses | List System Insights Interface Addresses +[**SysteminsightsListInterfaceDetails**](SystemInsightsApi.md#SysteminsightsListInterfaceDetails) | **Get** /systeminsights/interface_details | List System Insights Interface Details +[**SysteminsightsListKernelInfo**](SystemInsightsApi.md#SysteminsightsListKernelInfo) | **Get** /systeminsights/kernel_info | List System Insights Kernel Info +[**SysteminsightsListLaunchd**](SystemInsightsApi.md#SysteminsightsListLaunchd) | **Get** /systeminsights/launchd | List System Insights Launchd +[**SysteminsightsListLinuxPackages**](SystemInsightsApi.md#SysteminsightsListLinuxPackages) | **Get** /systeminsights/linux_packages | List System Insights Linux Packages +[**SysteminsightsListLoggedInUsers**](SystemInsightsApi.md#SysteminsightsListLoggedInUsers) | **Get** /systeminsights/logged_in_users | List System Insights Logged-In Users +[**SysteminsightsListLogicalDrives**](SystemInsightsApi.md#SysteminsightsListLogicalDrives) | **Get** /systeminsights/logical_drives | List System Insights Logical Drives +[**SysteminsightsListManagedPolicies**](SystemInsightsApi.md#SysteminsightsListManagedPolicies) | **Get** /systeminsights/managed_policies | List System Insights Managed Policies +[**SysteminsightsListMounts**](SystemInsightsApi.md#SysteminsightsListMounts) | **Get** /systeminsights/mounts | List System Insights Mounts +[**SysteminsightsListOsVersion**](SystemInsightsApi.md#SysteminsightsListOsVersion) | **Get** /systeminsights/os_version | List System Insights OS Version +[**SysteminsightsListPatches**](SystemInsightsApi.md#SysteminsightsListPatches) | **Get** /systeminsights/patches | List System Insights Patches +[**SysteminsightsListPrograms**](SystemInsightsApi.md#SysteminsightsListPrograms) | **Get** /systeminsights/programs | List System Insights Programs +[**SysteminsightsListPythonPackages**](SystemInsightsApi.md#SysteminsightsListPythonPackages) | **Get** /systeminsights/python_packages | List System Insights Python Packages +[**SysteminsightsListSafariExtensions**](SystemInsightsApi.md#SysteminsightsListSafariExtensions) | **Get** /systeminsights/safari_extensions | List System Insights Safari Extensions +[**SysteminsightsListScheduledTasks**](SystemInsightsApi.md#SysteminsightsListScheduledTasks) | **Get** /systeminsights/scheduled_tasks | List System Insights Scheduled Tasks +[**SysteminsightsListSecureboot**](SystemInsightsApi.md#SysteminsightsListSecureboot) | **Get** /systeminsights/secureboot | List System Insights Secure Boot +[**SysteminsightsListServices**](SystemInsightsApi.md#SysteminsightsListServices) | **Get** /systeminsights/services | List System Insights Services +[**SysteminsightsListShadow**](SystemInsightsApi.md#SysteminsightsListShadow) | **Get** /systeminsights/shadow | LIst System Insights Shadow +[**SysteminsightsListSharedFolders**](SystemInsightsApi.md#SysteminsightsListSharedFolders) | **Get** /systeminsights/shared_folders | List System Insights Shared Folders +[**SysteminsightsListSharedResources**](SystemInsightsApi.md#SysteminsightsListSharedResources) | **Get** /systeminsights/shared_resources | List System Insights Shared Resources +[**SysteminsightsListSharingPreferences**](SystemInsightsApi.md#SysteminsightsListSharingPreferences) | **Get** /systeminsights/sharing_preferences | List System Insights Sharing Preferences +[**SysteminsightsListSipConfig**](SystemInsightsApi.md#SysteminsightsListSipConfig) | **Get** /systeminsights/sip_config | List System Insights SIP Config +[**SysteminsightsListStartupItems**](SystemInsightsApi.md#SysteminsightsListStartupItems) | **Get** /systeminsights/startup_items | List System Insights Startup Items +[**SysteminsightsListSystemControls**](SystemInsightsApi.md#SysteminsightsListSystemControls) | **Get** /systeminsights/system_controls | List System Insights System Control +[**SysteminsightsListSystemInfo**](SystemInsightsApi.md#SysteminsightsListSystemInfo) | **Get** /systeminsights/system_info | List System Insights System Info +[**SysteminsightsListTpmInfo**](SystemInsightsApi.md#SysteminsightsListTpmInfo) | **Get** /systeminsights/tpm_info | List System Insights TPM Info +[**SysteminsightsListUptime**](SystemInsightsApi.md#SysteminsightsListUptime) | **Get** /systeminsights/uptime | List System Insights Uptime +[**SysteminsightsListUsbDevices**](SystemInsightsApi.md#SysteminsightsListUsbDevices) | **Get** /systeminsights/usb_devices | List System Insights USB Devices +[**SysteminsightsListUserGroups**](SystemInsightsApi.md#SysteminsightsListUserGroups) | **Get** /systeminsights/user_groups | List System Insights User Groups +[**SysteminsightsListUserSshKeys**](SystemInsightsApi.md#SysteminsightsListUserSshKeys) | **Get** /systeminsights/user_ssh_keys | List System Insights User SSH Keys +[**SysteminsightsListUserassist**](SystemInsightsApi.md#SysteminsightsListUserassist) | **Get** /systeminsights/userassist | List System Insights User Assist +[**SysteminsightsListUsers**](SystemInsightsApi.md#SysteminsightsListUsers) | **Get** /systeminsights/users | List System Insights Users +[**SysteminsightsListWifiNetworks**](SystemInsightsApi.md#SysteminsightsListWifiNetworks) | **Get** /systeminsights/wifi_networks | List System Insights WiFi Networks +[**SysteminsightsListWifiStatus**](SystemInsightsApi.md#SysteminsightsListWifiStatus) | **Get** /systeminsights/wifi_status | List System Insights WiFi Status +[**SysteminsightsListWindowsSecurityCenter**](SystemInsightsApi.md#SysteminsightsListWindowsSecurityCenter) | **Get** /systeminsights/windows_security_center | List System Insights Windows Security Center +[**SysteminsightsListWindowsSecurityProducts**](SystemInsightsApi.md#SysteminsightsListWindowsSecurityProducts) | **Get** /systeminsights/windows_security_products | List System Insights Windows Security Products + +# **SysteminsightsListAlf** +> []SystemInsightsAlf SysteminsightsListAlf(ctx, optional) +List System Insights ALF + +Valid filter fields are `system_id` and `global_state`. + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **optional** | ***SystemInsightsApiSysteminsightsListAlfOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a SystemInsightsApiSysteminsightsListAlfOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xOrgId** | **optional.String**| Organization identifier that can be obtained from console settings. | + **filter** | [**optional.Interface of []string**](string.md)| Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` | + **skip** | **optional.Int32**| The offset into the records to return. | [default to 0] + **sort** | [**optional.Interface of []string**](string.md)| The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` | + **limit** | **optional.Int32**| | [default to 10] + +### Return type + +[**[]SystemInsightsAlf**](system-insights-alf.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **SysteminsightsListAlfExceptions** +> []SystemInsightsAlfExceptions SysteminsightsListAlfExceptions(ctx, optional) +List System Insights ALF Exceptions + +Valid filter fields are `system_id` and `state`. + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **optional** | ***SystemInsightsApiSysteminsightsListAlfExceptionsOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a SystemInsightsApiSysteminsightsListAlfExceptionsOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xOrgId** | **optional.String**| Organization identifier that can be obtained from console settings. | + **filter** | [**optional.Interface of []string**](string.md)| Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` | + **skip** | **optional.Int32**| The offset into the records to return. | [default to 0] + **sort** | [**optional.Interface of []string**](string.md)| The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` | + **limit** | **optional.Int32**| | [default to 10] + +### Return type + +[**[]SystemInsightsAlfExceptions**](system-insights-alf-exceptions.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **SysteminsightsListAlfExplicitAuths** +> []SystemInsightsAlfExplicitAuths SysteminsightsListAlfExplicitAuths(ctx, optional) +List System Insights ALF Explicit Authentications + +Valid filter fields are `system_id` and `process`. + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **optional** | ***SystemInsightsApiSysteminsightsListAlfExplicitAuthsOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a SystemInsightsApiSysteminsightsListAlfExplicitAuthsOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xOrgId** | **optional.String**| Organization identifier that can be obtained from console settings. | + **filter** | [**optional.Interface of []string**](string.md)| Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` | + **skip** | **optional.Int32**| The offset into the records to return. | [default to 0] + **sort** | [**optional.Interface of []string**](string.md)| The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` | + **limit** | **optional.Int32**| | [default to 10] + +### Return type + +[**[]SystemInsightsAlfExplicitAuths**](system-insights-alf-explicit-auths.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **SysteminsightsListAppcompatShims** +> []SystemInsightsAppcompatShims SysteminsightsListAppcompatShims(ctx, optional) +List System Insights Application Compatibility Shims + +Valid filter fields are `system_id` and `enabled`. + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **optional** | ***SystemInsightsApiSysteminsightsListAppcompatShimsOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a SystemInsightsApiSysteminsightsListAppcompatShimsOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xOrgId** | **optional.String**| Organization identifier that can be obtained from console settings. | + **skip** | **optional.Int32**| The offset into the records to return. | [default to 0] + **sort** | [**optional.Interface of []string**](string.md)| The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` | + **filter** | [**optional.Interface of []string**](string.md)| Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` | + **limit** | **optional.Int32**| | [default to 10] + +### Return type + +[**[]SystemInsightsAppcompatShims**](system-insights-appcompat-shims.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **SysteminsightsListApps** +> []SystemInsightsApps SysteminsightsListApps(ctx, optional) +List System Insights Apps + +Lists all apps for macOS devices. For Windows devices, use [List System Insights Programs](#operation/systeminsights_list_programs). Valid filter fields are `system_id` and `bundle_name`. + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **optional** | ***SystemInsightsApiSysteminsightsListAppsOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a SystemInsightsApiSysteminsightsListAppsOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xOrgId** | **optional.String**| Organization identifier that can be obtained from console settings. | + **skip** | **optional.Int32**| The offset into the records to return. | [default to 0] + **sort** | [**optional.Interface of []string**](string.md)| The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` | + **filter** | [**optional.Interface of []string**](string.md)| Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` | + **limit** | **optional.Int32**| | [default to 10] + +### Return type + +[**[]SystemInsightsApps**](system-insights-apps.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **SysteminsightsListAuthorizedKeys** +> []SystemInsightsAuthorizedKeys SysteminsightsListAuthorizedKeys(ctx, optional) +List System Insights Authorized Keys + +Valid filter fields are `system_id` and `uid`. + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **optional** | ***SystemInsightsApiSysteminsightsListAuthorizedKeysOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a SystemInsightsApiSysteminsightsListAuthorizedKeysOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xOrgId** | **optional.String**| Organization identifier that can be obtained from console settings. | + **skip** | **optional.Int32**| The offset into the records to return. | [default to 0] + **sort** | [**optional.Interface of []string**](string.md)| The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` | + **filter** | [**optional.Interface of []string**](string.md)| Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` | + **limit** | **optional.Int32**| | [default to 10] + +### Return type + +[**[]SystemInsightsAuthorizedKeys**](system-insights-authorized-keys.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **SysteminsightsListAzureInstanceMetadata** +> []SystemInsightsAzureInstanceMetadata SysteminsightsListAzureInstanceMetadata(ctx, optional) +List System Insights Azure Instance Metadata + +Valid filter fields are `system_id`. + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **optional** | ***SystemInsightsApiSysteminsightsListAzureInstanceMetadataOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a SystemInsightsApiSysteminsightsListAzureInstanceMetadataOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **skip** | **optional.Int32**| The offset into the records to return. | [default to 0] + **sort** | [**optional.Interface of []string**](string.md)| The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` | + **filter** | [**optional.Interface of []string**](string.md)| Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` | + **xOrgId** | **optional.String**| Organization identifier that can be obtained from console settings. | + **limit** | **optional.Int32**| | [default to 10] + +### Return type + +[**[]SystemInsightsAzureInstanceMetadata**](system-insights-azure-instance-metadata.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **SysteminsightsListAzureInstanceTags** +> []SystemInsightsAzureInstanceTags SysteminsightsListAzureInstanceTags(ctx, optional) +List System Insights Azure Instance Tags + +Valid filter fields are `system_id`. + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **optional** | ***SystemInsightsApiSysteminsightsListAzureInstanceTagsOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a SystemInsightsApiSysteminsightsListAzureInstanceTagsOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **skip** | **optional.Int32**| The offset into the records to return. | [default to 0] + **sort** | [**optional.Interface of []string**](string.md)| The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` | + **filter** | [**optional.Interface of []string**](string.md)| Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` | + **xOrgId** | **optional.String**| Organization identifier that can be obtained from console settings. | + **limit** | **optional.Int32**| | [default to 10] + +### Return type + +[**[]SystemInsightsAzureInstanceTags**](system-insights-azure-instance-tags.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **SysteminsightsListBattery** +> []SystemInsightsBattery SysteminsightsListBattery(ctx, optional) +List System Insights Battery + +Valid filter fields are `system_id` and `health`. + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **optional** | ***SystemInsightsApiSysteminsightsListBatteryOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a SystemInsightsApiSysteminsightsListBatteryOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xOrgId** | **optional.String**| Organization identifier that can be obtained from console settings. | + **skip** | **optional.Int32**| The offset into the records to return. | [default to 0] + **sort** | [**optional.Interface of []string**](string.md)| The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` | + **filter** | [**optional.Interface of []string**](string.md)| Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` | + **limit** | **optional.Int32**| | [default to 10] + +### Return type + +[**[]SystemInsightsBattery**](system-insights-battery.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **SysteminsightsListBitlockerInfo** +> []SystemInsightsBitlockerInfo SysteminsightsListBitlockerInfo(ctx, optional) +List System Insights Bitlocker Info + +Valid filter fields are `system_id` and `protection_status`. + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **optional** | ***SystemInsightsApiSysteminsightsListBitlockerInfoOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a SystemInsightsApiSysteminsightsListBitlockerInfoOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **skip** | **optional.Int32**| The offset into the records to return. | [default to 0] + **sort** | [**optional.Interface of []string**](string.md)| The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` | + **filter** | [**optional.Interface of []string**](string.md)| Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` | + **xOrgId** | **optional.String**| Organization identifier that can be obtained from console settings. | + **limit** | **optional.Int32**| | [default to 10] + +### Return type + +[**[]SystemInsightsBitlockerInfo**](system-insights-bitlocker-info.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **SysteminsightsListBrowserPlugins** +> []SystemInsightsBrowserPlugins SysteminsightsListBrowserPlugins(ctx, optional) +List System Insights Browser Plugins + +Valid filter fields are `system_id` and `name`. + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **optional** | ***SystemInsightsApiSysteminsightsListBrowserPluginsOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a SystemInsightsApiSysteminsightsListBrowserPluginsOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **skip** | **optional.Int32**| The offset into the records to return. | [default to 0] + **sort** | [**optional.Interface of []string**](string.md)| The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` | + **filter** | [**optional.Interface of []string**](string.md)| Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` | + **xOrgId** | **optional.String**| Organization identifier that can be obtained from console settings. | + **limit** | **optional.Int32**| | [default to 10] + +### Return type + +[**[]SystemInsightsBrowserPlugins**](system-insights-browser-plugins.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **SysteminsightsListCertificates** +> []SystemInsightsCertificates SysteminsightsListCertificates(ctx, optional) +List System Insights Certificates + +Valid filter fields are `system_id` and `common_name`. + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **optional** | ***SystemInsightsApiSysteminsightsListCertificatesOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a SystemInsightsApiSysteminsightsListCertificatesOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **skip** | **optional.Int32**| The offset into the records to return. | [default to 0] + **sort** | [**optional.Interface of []string**](string.md)| The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` | + **filter** | [**optional.Interface of []string**](string.md)| Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` Note: You can only filter by `system_id` and `common_name` | + **xOrgId** | **optional.String**| Organization identifier that can be obtained from console settings. | + **limit** | **optional.Int32**| | [default to 10] + +### Return type + +[**[]SystemInsightsCertificates**](system-insights-certificates.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **SysteminsightsListChassisInfo** +> []SystemInsightsChassisInfo SysteminsightsListChassisInfo(ctx, optional) +List System Insights Chassis Info + +Valid filter fields are `system_id`. + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **optional** | ***SystemInsightsApiSysteminsightsListChassisInfoOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a SystemInsightsApiSysteminsightsListChassisInfoOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **skip** | **optional.Int32**| The offset into the records to return. | [default to 0] + **sort** | [**optional.Interface of []string**](string.md)| The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` | + **filter** | [**optional.Interface of []string**](string.md)| Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` | + **xOrgId** | **optional.String**| Organization identifier that can be obtained from console settings. | + **limit** | **optional.Int32**| | [default to 10] + +### Return type + +[**[]SystemInsightsChassisInfo**](system-insights-chassis-info.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **SysteminsightsListChromeExtensions** +> []SystemInsightsChromeExtensions SysteminsightsListChromeExtensions(ctx, optional) +List System Insights Chrome Extensions + +Valid filter fields are `system_id` and `name`. + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **optional** | ***SystemInsightsApiSysteminsightsListChromeExtensionsOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a SystemInsightsApiSysteminsightsListChromeExtensionsOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xOrgId** | **optional.String**| Organization identifier that can be obtained from console settings. | + **skip** | **optional.Int32**| The offset into the records to return. | [default to 0] + **sort** | [**optional.Interface of []string**](string.md)| The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` | + **filter** | [**optional.Interface of []string**](string.md)| Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` | + **limit** | **optional.Int32**| | [default to 10] + +### Return type + +[**[]SystemInsightsChromeExtensions**](system-insights-chrome-extensions.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **SysteminsightsListConnectivity** +> []SystemInsightsConnectivity SysteminsightsListConnectivity(ctx, optional) +List System Insights Connectivity + +The only valid filter field is `system_id`. + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **optional** | ***SystemInsightsApiSysteminsightsListConnectivityOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a SystemInsightsApiSysteminsightsListConnectivityOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xOrgId** | **optional.String**| Organization identifier that can be obtained from console settings. | + **skip** | **optional.Int32**| The offset into the records to return. | [default to 0] + **sort** | [**optional.Interface of []string**](string.md)| The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` | + **filter** | [**optional.Interface of []string**](string.md)| Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` | + **limit** | **optional.Int32**| | [default to 10] + +### Return type + +[**[]SystemInsightsConnectivity**](system-insights-connectivity.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **SysteminsightsListCrashes** +> []SystemInsightsCrashes SysteminsightsListCrashes(ctx, optional) +List System Insights Crashes + +Valid filter fields are `system_id` and `identifier`. + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **optional** | ***SystemInsightsApiSysteminsightsListCrashesOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a SystemInsightsApiSysteminsightsListCrashesOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xOrgId** | **optional.String**| Organization identifier that can be obtained from console settings. | + **skip** | **optional.Int32**| The offset into the records to return. | [default to 0] + **sort** | [**optional.Interface of []string**](string.md)| The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` | + **filter** | [**optional.Interface of []string**](string.md)| Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` | + **limit** | **optional.Int32**| | [default to 10] + +### Return type + +[**[]SystemInsightsCrashes**](system-insights-crashes.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **SysteminsightsListCupsDestinations** +> []SystemInsightsCupsDestinations SysteminsightsListCupsDestinations(ctx, optional) +List System Insights CUPS Destinations + +Valid filter fields are `system_id` and `name`. + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **optional** | ***SystemInsightsApiSysteminsightsListCupsDestinationsOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a SystemInsightsApiSysteminsightsListCupsDestinationsOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **skip** | **optional.Int32**| The offset into the records to return. | [default to 0] + **sort** | [**optional.Interface of []string**](string.md)| The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` | + **filter** | [**optional.Interface of []string**](string.md)| Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` | + **xOrgId** | **optional.String**| Organization identifier that can be obtained from console settings. | + **limit** | **optional.Int32**| | [default to 10] + +### Return type + +[**[]SystemInsightsCupsDestinations**](system-insights-cups-destinations.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **SysteminsightsListDiskEncryption** +> []SystemInsightsDiskEncryption SysteminsightsListDiskEncryption(ctx, optional) +List System Insights Disk Encryption + +Valid filter fields are `system_id` and `encryption_status`. + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **optional** | ***SystemInsightsApiSysteminsightsListDiskEncryptionOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a SystemInsightsApiSysteminsightsListDiskEncryptionOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **skip** | **optional.Int32**| The offset into the records to return. | [default to 0] + **sort** | [**optional.Interface of []string**](string.md)| The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` | + **filter** | [**optional.Interface of []string**](string.md)| Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` | + **xOrgId** | **optional.String**| Organization identifier that can be obtained from console settings. | + **limit** | **optional.Int32**| | [default to 10] + +### Return type + +[**[]SystemInsightsDiskEncryption**](system-insights-disk-encryption.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **SysteminsightsListDiskInfo** +> []SystemInsightsDiskInfo SysteminsightsListDiskInfo(ctx, optional) +List System Insights Disk Info + +Valid filter fields are `system_id` and `disk_index`. + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **optional** | ***SystemInsightsApiSysteminsightsListDiskInfoOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a SystemInsightsApiSysteminsightsListDiskInfoOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **skip** | **optional.Int32**| The offset into the records to return. | [default to 0] + **sort** | [**optional.Interface of []string**](string.md)| The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` | + **filter** | [**optional.Interface of []string**](string.md)| Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` | + **xOrgId** | **optional.String**| Organization identifier that can be obtained from console settings. | + **limit** | **optional.Int32**| | [default to 10] + +### Return type + +[**[]SystemInsightsDiskInfo**](system-insights-disk-info.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **SysteminsightsListDnsResolvers** +> []SystemInsightsDnsResolvers SysteminsightsListDnsResolvers(ctx, optional) +List System Insights DNS Resolvers + +Valid filter fields are `system_id` and `type`. + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **optional** | ***SystemInsightsApiSysteminsightsListDnsResolversOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a SystemInsightsApiSysteminsightsListDnsResolversOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **skip** | **optional.Int32**| The offset into the records to return. | [default to 0] + **sort** | [**optional.Interface of []string**](string.md)| The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` | + **filter** | [**optional.Interface of []string**](string.md)| Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` | + **xOrgId** | **optional.String**| Organization identifier that can be obtained from console settings. | + **limit** | **optional.Int32**| | [default to 10] + +### Return type + +[**[]SystemInsightsDnsResolvers**](system-insights-dns-resolvers.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **SysteminsightsListEtcHosts** +> []SystemInsightsEtcHosts SysteminsightsListEtcHosts(ctx, optional) +List System Insights Etc Hosts + +Valid filter fields are `system_id` and `address`. + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **optional** | ***SystemInsightsApiSysteminsightsListEtcHostsOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a SystemInsightsApiSysteminsightsListEtcHostsOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **skip** | **optional.Int32**| The offset into the records to return. | [default to 0] + **sort** | [**optional.Interface of []string**](string.md)| The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` | + **filter** | [**optional.Interface of []string**](string.md)| Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` | + **xOrgId** | **optional.String**| Organization identifier that can be obtained from console settings. | + **limit** | **optional.Int32**| | [default to 10] + +### Return type + +[**[]SystemInsightsEtcHosts**](system-insights-etc-hosts.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **SysteminsightsListFirefoxAddons** +> []SystemInsightsFirefoxAddons SysteminsightsListFirefoxAddons(ctx, optional) +List System Insights Firefox Addons + +Valid filter fields are `system_id` and `name`. + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **optional** | ***SystemInsightsApiSysteminsightsListFirefoxAddonsOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a SystemInsightsApiSysteminsightsListFirefoxAddonsOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **skip** | **optional.Int32**| The offset into the records to return. | [default to 0] + **sort** | [**optional.Interface of []string**](string.md)| The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` | + **filter** | [**optional.Interface of []string**](string.md)| Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` | + **xOrgId** | **optional.String**| Organization identifier that can be obtained from console settings. | + **limit** | **optional.Int32**| | [default to 10] + +### Return type + +[**[]SystemInsightsFirefoxAddons**](system-insights-firefox-addons.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **SysteminsightsListGroups** +> []SystemInsightsGroups SysteminsightsListGroups(ctx, optional) +List System Insights Groups + +Valid filter fields are `system_id` and `groupname`. + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **optional** | ***SystemInsightsApiSysteminsightsListGroupsOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a SystemInsightsApiSysteminsightsListGroupsOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **skip** | **optional.Int32**| The offset into the records to return. | [default to 0] + **sort** | [**optional.Interface of []string**](string.md)| The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` | + **filter** | [**optional.Interface of []string**](string.md)| Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` | + **xOrgId** | **optional.String**| Organization identifier that can be obtained from console settings. | + **limit** | **optional.Int32**| | [default to 10] + +### Return type + +[**[]SystemInsightsGroups**](system-insights-groups.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **SysteminsightsListIeExtensions** +> []SystemInsightsIeExtensions SysteminsightsListIeExtensions(ctx, optional) +List System Insights IE Extensions + +Valid filter fields are `system_id` and `name`. + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **optional** | ***SystemInsightsApiSysteminsightsListIeExtensionsOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a SystemInsightsApiSysteminsightsListIeExtensionsOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xOrgId** | **optional.String**| Organization identifier that can be obtained from console settings. | + **skip** | **optional.Int32**| The offset into the records to return. | [default to 0] + **sort** | [**optional.Interface of []string**](string.md)| The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` | + **filter** | [**optional.Interface of []string**](string.md)| Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` | + **limit** | **optional.Int32**| | [default to 10] + +### Return type + +[**[]SystemInsightsIeExtensions**](system-insights-ie-extensions.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **SysteminsightsListInterfaceAddresses** +> []SystemInsightsInterfaceAddresses SysteminsightsListInterfaceAddresses(ctx, optional) +List System Insights Interface Addresses + +Valid filter fields are `system_id` and `address`. + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **optional** | ***SystemInsightsApiSysteminsightsListInterfaceAddressesOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a SystemInsightsApiSysteminsightsListInterfaceAddressesOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **skip** | **optional.Int32**| The offset into the records to return. | [default to 0] + **sort** | [**optional.Interface of []string**](string.md)| The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` | + **filter** | [**optional.Interface of []string**](string.md)| Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` | + **xOrgId** | **optional.String**| Organization identifier that can be obtained from console settings. | + **limit** | **optional.Int32**| | [default to 10] + +### Return type + +[**[]SystemInsightsInterfaceAddresses**](system-insights-interface-addresses.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **SysteminsightsListInterfaceDetails** +> []SystemInsightsInterfaceDetails SysteminsightsListInterfaceDetails(ctx, optional) +List System Insights Interface Details + +Valid filter fields are `system_id` and `interface`. + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **optional** | ***SystemInsightsApiSysteminsightsListInterfaceDetailsOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a SystemInsightsApiSysteminsightsListInterfaceDetailsOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **skip** | **optional.Int32**| The offset into the records to return. | [default to 0] + **sort** | [**optional.Interface of []string**](string.md)| The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` | + **filter** | [**optional.Interface of []string**](string.md)| Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` | + **xOrgId** | **optional.String**| Organization identifier that can be obtained from console settings. | + **limit** | **optional.Int32**| | [default to 10] + +### Return type + +[**[]SystemInsightsInterfaceDetails**](system-insights-interface-details.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **SysteminsightsListKernelInfo** +> []SystemInsightsKernelInfo SysteminsightsListKernelInfo(ctx, optional) +List System Insights Kernel Info + +Valid filter fields are `system_id` and `version`. + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **optional** | ***SystemInsightsApiSysteminsightsListKernelInfoOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a SystemInsightsApiSysteminsightsListKernelInfoOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **skip** | **optional.Int32**| The offset into the records to return. | [default to 0] + **sort** | [**optional.Interface of []string**](string.md)| The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` | + **filter** | [**optional.Interface of []string**](string.md)| Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` | + **xOrgId** | **optional.String**| Organization identifier that can be obtained from console settings. | + **limit** | **optional.Int32**| | [default to 10] + +### Return type + +[**[]SystemInsightsKernelInfo**](system-insights-kernel-info.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **SysteminsightsListLaunchd** +> []SystemInsightsLaunchd SysteminsightsListLaunchd(ctx, optional) +List System Insights Launchd + +Valid filter fields are `system_id` and `name`. + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **optional** | ***SystemInsightsApiSysteminsightsListLaunchdOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a SystemInsightsApiSysteminsightsListLaunchdOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xOrgId** | **optional.String**| Organization identifier that can be obtained from console settings. | + **skip** | **optional.Int32**| The offset into the records to return. | [default to 0] + **sort** | [**optional.Interface of []string**](string.md)| The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` | + **filter** | [**optional.Interface of []string**](string.md)| Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` | + **limit** | **optional.Int32**| | [default to 10] + +### Return type + +[**[]SystemInsightsLaunchd**](system-insights-launchd.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **SysteminsightsListLinuxPackages** +> []SystemInsightsLinuxPackages SysteminsightsListLinuxPackages(ctx, optional) +List System Insights Linux Packages + +Lists all programs for Linux devices. For macOS devices, use [List System Insights System Apps](#operation/systeminsights_list_apps). For windows devices, use [List System Insights System Apps](#operation/systeminsights_list_programs). Valid filter fields are `name` and `package_format`. + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **optional** | ***SystemInsightsApiSysteminsightsListLinuxPackagesOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a SystemInsightsApiSysteminsightsListLinuxPackagesOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **skip** | **optional.Int32**| The offset into the records to return. | [default to 0] + **sort** | [**optional.Interface of []string**](string.md)| The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` | + **filter** | [**optional.Interface of []string**](string.md)| Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` | + **xOrgId** | **optional.String**| Organization identifier that can be obtained from console settings. | + **limit** | **optional.Int32**| | [default to 10] + +### Return type + +[**[]SystemInsightsLinuxPackages**](system-insights-linux-packages.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **SysteminsightsListLoggedInUsers** +> []SystemInsightsLoggedInUsers SysteminsightsListLoggedInUsers(ctx, optional) +List System Insights Logged-In Users + +Valid filter fields are `system_id` and `user`. + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **optional** | ***SystemInsightsApiSysteminsightsListLoggedInUsersOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a SystemInsightsApiSysteminsightsListLoggedInUsersOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xOrgId** | **optional.String**| Organization identifier that can be obtained from console settings. | + **skip** | **optional.Int32**| The offset into the records to return. | [default to 0] + **sort** | [**optional.Interface of []string**](string.md)| The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` | + **filter** | [**optional.Interface of []string**](string.md)| Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` | + **limit** | **optional.Int32**| | [default to 10] + +### Return type + +[**[]SystemInsightsLoggedInUsers**](system-insights-logged-in-users.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **SysteminsightsListLogicalDrives** +> []SystemInsightsLogicalDrives SysteminsightsListLogicalDrives(ctx, optional) +List System Insights Logical Drives + +Valid filter fields are `system_id` and `device_id`. + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **optional** | ***SystemInsightsApiSysteminsightsListLogicalDrivesOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a SystemInsightsApiSysteminsightsListLogicalDrivesOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **skip** | **optional.Int32**| The offset into the records to return. | [default to 0] + **sort** | [**optional.Interface of []string**](string.md)| The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` | + **filter** | [**optional.Interface of []string**](string.md)| Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` | + **xOrgId** | **optional.String**| Organization identifier that can be obtained from console settings. | + **limit** | **optional.Int32**| | [default to 10] + +### Return type + +[**[]SystemInsightsLogicalDrives**](system-insights-logical-drives.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **SysteminsightsListManagedPolicies** +> []SystemInsightsManagedPolicies SysteminsightsListManagedPolicies(ctx, optional) +List System Insights Managed Policies + +Valid filter fields are `system_id` and `domain`. + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **optional** | ***SystemInsightsApiSysteminsightsListManagedPoliciesOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a SystemInsightsApiSysteminsightsListManagedPoliciesOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xOrgId** | **optional.String**| Organization identifier that can be obtained from console settings. | + **skip** | **optional.Int32**| The offset into the records to return. | [default to 0] + **sort** | [**optional.Interface of []string**](string.md)| The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` | + **filter** | [**optional.Interface of []string**](string.md)| Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` | + **limit** | **optional.Int32**| | [default to 10] + +### Return type + +[**[]SystemInsightsManagedPolicies**](system-insights-managed-policies.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **SysteminsightsListMounts** +> []SystemInsightsMounts SysteminsightsListMounts(ctx, optional) +List System Insights Mounts + +Valid filter fields are `system_id` and `path`. + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **optional** | ***SystemInsightsApiSysteminsightsListMountsOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a SystemInsightsApiSysteminsightsListMountsOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **skip** | **optional.Int32**| The offset into the records to return. | [default to 0] + **sort** | [**optional.Interface of []string**](string.md)| The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` | + **filter** | [**optional.Interface of []string**](string.md)| Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` | + **xOrgId** | **optional.String**| Organization identifier that can be obtained from console settings. | + **limit** | **optional.Int32**| | [default to 10] + +### Return type + +[**[]SystemInsightsMounts**](system-insights-mounts.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **SysteminsightsListOsVersion** +> []SystemInsightsOsVersion SysteminsightsListOsVersion(ctx, optional) +List System Insights OS Version + +Valid filter fields are `system_id` and `version`. + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **optional** | ***SystemInsightsApiSysteminsightsListOsVersionOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a SystemInsightsApiSysteminsightsListOsVersionOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **skip** | **optional.Int32**| The offset into the records to return. | [default to 0] + **sort** | [**optional.Interface of []string**](string.md)| The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` | + **filter** | [**optional.Interface of []string**](string.md)| Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` | + **xOrgId** | **optional.String**| Organization identifier that can be obtained from console settings. | + **limit** | **optional.Int32**| | [default to 10] + +### Return type + +[**[]SystemInsightsOsVersion**](system-insights-os-version.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **SysteminsightsListPatches** +> []SystemInsightsPatches SysteminsightsListPatches(ctx, optional) +List System Insights Patches + +Valid filter fields are `system_id` and `hotfix_id`. + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **optional** | ***SystemInsightsApiSysteminsightsListPatchesOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a SystemInsightsApiSysteminsightsListPatchesOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **skip** | **optional.Int32**| The offset into the records to return. | [default to 0] + **sort** | [**optional.Interface of []string**](string.md)| The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` | + **filter** | [**optional.Interface of []string**](string.md)| Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` | + **xOrgId** | **optional.String**| Organization identifier that can be obtained from console settings. | + **limit** | **optional.Int32**| | [default to 10] + +### Return type + +[**[]SystemInsightsPatches**](system-insights-patches.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **SysteminsightsListPrograms** +> []SystemInsightsPrograms SysteminsightsListPrograms(ctx, optional) +List System Insights Programs + +Lists all programs for Windows devices. For macOS devices, use [List System Insights Apps](#operation/systeminsights_list_apps). Valid filter fields are `system_id` and `name`. + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **optional** | ***SystemInsightsApiSysteminsightsListProgramsOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a SystemInsightsApiSysteminsightsListProgramsOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **skip** | **optional.Int32**| The offset into the records to return. | [default to 0] + **sort** | [**optional.Interface of []string**](string.md)| The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` | + **filter** | [**optional.Interface of []string**](string.md)| Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` | + **xOrgId** | **optional.String**| Organization identifier that can be obtained from console settings. | + **limit** | **optional.Int32**| | [default to 10] + +### Return type + +[**[]SystemInsightsPrograms**](system-insights-programs.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **SysteminsightsListPythonPackages** +> []SystemInsightsPythonPackages SysteminsightsListPythonPackages(ctx, optional) +List System Insights Python Packages + +Valid filter fields are `system_id` and `name`. + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **optional** | ***SystemInsightsApiSysteminsightsListPythonPackagesOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a SystemInsightsApiSysteminsightsListPythonPackagesOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **skip** | **optional.Int32**| The offset into the records to return. | [default to 0] + **sort** | [**optional.Interface of []string**](string.md)| The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` | + **filter** | [**optional.Interface of []string**](string.md)| Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` | + **xOrgId** | **optional.String**| Organization identifier that can be obtained from console settings. | + **limit** | **optional.Int32**| | [default to 10] + +### Return type + +[**[]SystemInsightsPythonPackages**](system-insights-python-packages.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **SysteminsightsListSafariExtensions** +> []SystemInsightsSafariExtensions SysteminsightsListSafariExtensions(ctx, optional) +List System Insights Safari Extensions + +Valid filter fields are `system_id` and `name`. + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **optional** | ***SystemInsightsApiSysteminsightsListSafariExtensionsOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a SystemInsightsApiSysteminsightsListSafariExtensionsOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **skip** | **optional.Int32**| The offset into the records to return. | [default to 0] + **sort** | [**optional.Interface of []string**](string.md)| The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` | + **filter** | [**optional.Interface of []string**](string.md)| Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` | + **xOrgId** | **optional.String**| Organization identifier that can be obtained from console settings. | + **limit** | **optional.Int32**| | [default to 10] + +### Return type + +[**[]SystemInsightsSafariExtensions**](system-insights-safari-extensions.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **SysteminsightsListScheduledTasks** +> []SystemInsightsScheduledTasks SysteminsightsListScheduledTasks(ctx, optional) +List System Insights Scheduled Tasks + +Valid filter fields are `system_id` and `enabled`. + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **optional** | ***SystemInsightsApiSysteminsightsListScheduledTasksOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a SystemInsightsApiSysteminsightsListScheduledTasksOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **skip** | **optional.Int32**| The offset into the records to return. | [default to 0] + **sort** | [**optional.Interface of []string**](string.md)| The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` | + **filter** | [**optional.Interface of []string**](string.md)| Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` | + **xOrgId** | **optional.String**| Organization identifier that can be obtained from console settings. | + **limit** | **optional.Int32**| | [default to 10] + +### Return type + +[**[]SystemInsightsScheduledTasks**](system-insights-scheduled-tasks.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **SysteminsightsListSecureboot** +> []SystemInsightsSecureboot SysteminsightsListSecureboot(ctx, optional) +List System Insights Secure Boot + +Valid filter fields are `system_id`. + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **optional** | ***SystemInsightsApiSysteminsightsListSecurebootOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a SystemInsightsApiSysteminsightsListSecurebootOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **skip** | **optional.Int32**| The offset into the records to return. | [default to 0] + **sort** | [**optional.Interface of []string**](string.md)| The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` | + **filter** | [**optional.Interface of []string**](string.md)| Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` | + **xOrgId** | **optional.String**| Organization identifier that can be obtained from console settings. | + **limit** | **optional.Int32**| | [default to 10] + +### Return type + +[**[]SystemInsightsSecureboot**](system-insights-secureboot.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **SysteminsightsListServices** +> []SystemInsightsServices SysteminsightsListServices(ctx, optional) +List System Insights Services + +Valid filter fields are `system_id` and `name`. + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **optional** | ***SystemInsightsApiSysteminsightsListServicesOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a SystemInsightsApiSysteminsightsListServicesOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **skip** | **optional.Int32**| The offset into the records to return. | [default to 0] + **sort** | [**optional.Interface of []string**](string.md)| The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` | + **filter** | [**optional.Interface of []string**](string.md)| Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` | + **xOrgId** | **optional.String**| Organization identifier that can be obtained from console settings. | + **limit** | **optional.Int32**| | [default to 10] + +### Return type + +[**[]SystemInsightsServices**](system-insights-services.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **SysteminsightsListShadow** +> []SystemInsightsShadow SysteminsightsListShadow(ctx, optional) +LIst System Insights Shadow + +Valid filter fields are `system_id` and `username`. + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **optional** | ***SystemInsightsApiSysteminsightsListShadowOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a SystemInsightsApiSysteminsightsListShadowOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xOrgId** | **optional.String**| Organization identifier that can be obtained from console settings. | + **skip** | **optional.Int32**| The offset into the records to return. | [default to 0] + **sort** | [**optional.Interface of []string**](string.md)| The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` | + **filter** | [**optional.Interface of []string**](string.md)| Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` | + **limit** | **optional.Int32**| | [default to 10] + +### Return type + +[**[]SystemInsightsShadow**](system-insights-shadow.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **SysteminsightsListSharedFolders** +> []SystemInsightsSharedFolders SysteminsightsListSharedFolders(ctx, optional) +List System Insights Shared Folders + +Valid filter fields are `system_id` and `name`. + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **optional** | ***SystemInsightsApiSysteminsightsListSharedFoldersOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a SystemInsightsApiSysteminsightsListSharedFoldersOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xOrgId** | **optional.String**| Organization identifier that can be obtained from console settings. | + **skip** | **optional.Int32**| The offset into the records to return. | [default to 0] + **sort** | [**optional.Interface of []string**](string.md)| The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` | + **filter** | [**optional.Interface of []string**](string.md)| Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` | + **limit** | **optional.Int32**| | [default to 10] + +### Return type + +[**[]SystemInsightsSharedFolders**](system-insights-shared-folders.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **SysteminsightsListSharedResources** +> []SystemInsightsSharedResources SysteminsightsListSharedResources(ctx, optional) +List System Insights Shared Resources + +Valid filter fields are `system_id` and `type`. + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **optional** | ***SystemInsightsApiSysteminsightsListSharedResourcesOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a SystemInsightsApiSysteminsightsListSharedResourcesOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xOrgId** | **optional.String**| Organization identifier that can be obtained from console settings. | + **skip** | **optional.Int32**| The offset into the records to return. | [default to 0] + **sort** | [**optional.Interface of []string**](string.md)| The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` | + **filter** | [**optional.Interface of []string**](string.md)| Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` | + **limit** | **optional.Int32**| | [default to 10] + +### Return type + +[**[]SystemInsightsSharedResources**](system-insights-shared-resources.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **SysteminsightsListSharingPreferences** +> []SystemInsightsSharingPreferences SysteminsightsListSharingPreferences(ctx, optional) +List System Insights Sharing Preferences + +Only valid filed field is `system_id`. + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **optional** | ***SystemInsightsApiSysteminsightsListSharingPreferencesOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a SystemInsightsApiSysteminsightsListSharingPreferencesOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xOrgId** | **optional.String**| Organization identifier that can be obtained from console settings. | + **skip** | **optional.Int32**| The offset into the records to return. | [default to 0] + **sort** | [**optional.Interface of []string**](string.md)| The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` | + **filter** | [**optional.Interface of []string**](string.md)| Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` | + **limit** | **optional.Int32**| | [default to 10] + +### Return type + +[**[]SystemInsightsSharingPreferences**](system-insights-sharing-preferences.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **SysteminsightsListSipConfig** +> []SystemInsightsSipConfig SysteminsightsListSipConfig(ctx, optional) +List System Insights SIP Config + +Valid filter fields are `system_id` and `enabled`. + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **optional** | ***SystemInsightsApiSysteminsightsListSipConfigOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a SystemInsightsApiSysteminsightsListSipConfigOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xOrgId** | **optional.String**| Organization identifier that can be obtained from console settings. | + **skip** | **optional.Int32**| The offset into the records to return. | [default to 0] + **sort** | [**optional.Interface of []string**](string.md)| The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` | + **filter** | [**optional.Interface of []string**](string.md)| Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` | + **limit** | **optional.Int32**| | [default to 10] + +### Return type + +[**[]SystemInsightsSipConfig**](system-insights-sip-config.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **SysteminsightsListStartupItems** +> []SystemInsightsStartupItems SysteminsightsListStartupItems(ctx, optional) +List System Insights Startup Items + +Valid filter fields are `system_id` and `name`. + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **optional** | ***SystemInsightsApiSysteminsightsListStartupItemsOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a SystemInsightsApiSysteminsightsListStartupItemsOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **skip** | **optional.Int32**| The offset into the records to return. | [default to 0] + **sort** | [**optional.Interface of []string**](string.md)| The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` | + **filter** | [**optional.Interface of []string**](string.md)| Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` | + **xOrgId** | **optional.String**| Organization identifier that can be obtained from console settings. | + **limit** | **optional.Int32**| | [default to 10] + +### Return type + +[**[]SystemInsightsStartupItems**](system-insights-startup-items.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **SysteminsightsListSystemControls** +> []SystemInsightsSystemControls SysteminsightsListSystemControls(ctx, optional) +List System Insights System Control + +Valid filter fields are `system_id` and `name`. + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **optional** | ***SystemInsightsApiSysteminsightsListSystemControlsOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a SystemInsightsApiSysteminsightsListSystemControlsOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **skip** | **optional.Int32**| The offset into the records to return. | [default to 0] + **sort** | [**optional.Interface of []string**](string.md)| The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` | + **filter** | [**optional.Interface of []string**](string.md)| Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` Note: You can only filter by `system_id` and `name` | + **xOrgId** | **optional.String**| Organization identifier that can be obtained from console settings. | + **limit** | **optional.Int32**| | [default to 10] + +### Return type + +[**[]SystemInsightsSystemControls**](system-insights-system-controls.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **SysteminsightsListSystemInfo** +> []SystemInsightsSystemInfo SysteminsightsListSystemInfo(ctx, optional) +List System Insights System Info + +Valid filter fields are `system_id` and `cpu_subtype`. + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **optional** | ***SystemInsightsApiSysteminsightsListSystemInfoOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a SystemInsightsApiSysteminsightsListSystemInfoOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **skip** | **optional.Int32**| The offset into the records to return. | [default to 0] + **sort** | [**optional.Interface of []string**](string.md)| The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` | + **filter** | [**optional.Interface of []string**](string.md)| Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` | + **xOrgId** | **optional.String**| Organization identifier that can be obtained from console settings. | + **limit** | **optional.Int32**| | [default to 10] + +### Return type + +[**[]SystemInsightsSystemInfo**](system-insights-system-info.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **SysteminsightsListTpmInfo** +> []SystemInsightsTpmInfo SysteminsightsListTpmInfo(ctx, optional) +List System Insights TPM Info + +Valid filter fields are `system_id`. + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **optional** | ***SystemInsightsApiSysteminsightsListTpmInfoOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a SystemInsightsApiSysteminsightsListTpmInfoOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **skip** | **optional.Int32**| The offset into the records to return. | [default to 0] + **sort** | [**optional.Interface of []string**](string.md)| The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` | + **filter** | [**optional.Interface of []string**](string.md)| Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` | + **xOrgId** | **optional.String**| Organization identifier that can be obtained from console settings. | + **limit** | **optional.Int32**| | [default to 10] + +### Return type + +[**[]SystemInsightsTpmInfo**](system-insights-tpm-info.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: text/html + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **SysteminsightsListUptime** +> []SystemInsightsUptime SysteminsightsListUptime(ctx, optional) +List System Insights Uptime + +Valid filter fields are `system_id` and `days`. + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **optional** | ***SystemInsightsApiSysteminsightsListUptimeOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a SystemInsightsApiSysteminsightsListUptimeOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **skip** | **optional.Int32**| The offset into the records to return. | [default to 0] + **sort** | [**optional.Interface of []string**](string.md)| The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` | + **filter** | [**optional.Interface of []string**](string.md)| Supported operators are: eq, gte, in. e.g: Filter for single value: `filter=field:gte:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` | + **xOrgId** | **optional.String**| Organization identifier that can be obtained from console settings. | + **limit** | **optional.Int32**| | [default to 10] + +### Return type + +[**[]SystemInsightsUptime**](system-insights-uptime.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **SysteminsightsListUsbDevices** +> []SystemInsightsUsbDevices SysteminsightsListUsbDevices(ctx, optional) +List System Insights USB Devices + +Valid filter fields are `system_id` and `model`. + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **optional** | ***SystemInsightsApiSysteminsightsListUsbDevicesOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a SystemInsightsApiSysteminsightsListUsbDevicesOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xOrgId** | **optional.String**| Organization identifier that can be obtained from console settings. | + **skip** | **optional.Int32**| The offset into the records to return. | [default to 0] + **sort** | [**optional.Interface of []string**](string.md)| The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` | + **filter** | [**optional.Interface of []string**](string.md)| Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` | + **limit** | **optional.Int32**| | [default to 10] + +### Return type + +[**[]SystemInsightsUsbDevices**](system-insights-usb-devices.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **SysteminsightsListUserGroups** +> []SystemInsightsUserGroups SysteminsightsListUserGroups(ctx, optional) +List System Insights User Groups + +Only valid filter field is `system_id`. + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **optional** | ***SystemInsightsApiSysteminsightsListUserGroupsOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a SystemInsightsApiSysteminsightsListUserGroupsOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xOrgId** | **optional.String**| Organization identifier that can be obtained from console settings. | + **skip** | **optional.Int32**| The offset into the records to return. | [default to 0] + **sort** | [**optional.Interface of []string**](string.md)| The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` | + **filter** | [**optional.Interface of []string**](string.md)| Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` | + **limit** | **optional.Int32**| | [default to 10] + +### Return type + +[**[]SystemInsightsUserGroups**](system-insights-user-groups.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **SysteminsightsListUserSshKeys** +> []SystemInsightsUserSshKeys SysteminsightsListUserSshKeys(ctx, optional) +List System Insights User SSH Keys + +Valid filter fields are `system_id` and `uid`. + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **optional** | ***SystemInsightsApiSysteminsightsListUserSshKeysOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a SystemInsightsApiSysteminsightsListUserSshKeysOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **xOrgId** | **optional.String**| Organization identifier that can be obtained from console settings. | + **skip** | **optional.Int32**| The offset into the records to return. | [default to 0] + **sort** | [**optional.Interface of []string**](string.md)| The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` | + **filter** | [**optional.Interface of []string**](string.md)| Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` | + **limit** | **optional.Int32**| | [default to 10] + +### Return type + +[**[]SystemInsightsUserSshKeys**](system-insights-user-ssh-keys.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **SysteminsightsListUserassist** +> []SystemInsightsUserassist SysteminsightsListUserassist(ctx, optional) +List System Insights User Assist + +Valid filter fields are `system_id`. + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **optional** | ***SystemInsightsApiSysteminsightsListUserassistOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a SystemInsightsApiSysteminsightsListUserassistOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **skip** | **optional.Int32**| The offset into the records to return. | [default to 0] + **sort** | [**optional.Interface of []string**](string.md)| The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` | + **filter** | [**optional.Interface of []string**](string.md)| Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` | + **xOrgId** | **optional.String**| Organization identifier that can be obtained from console settings. | + **limit** | **optional.Int32**| | [default to 10] + +### Return type + +[**[]SystemInsightsUserassist**](system-insights-userassist.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **SysteminsightsListUsers** +> []SystemInsightsUsers SysteminsightsListUsers(ctx, optional) +List System Insights Users + +Valid filter fields are `system_id` and `username`. + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **optional** | ***SystemInsightsApiSysteminsightsListUsersOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a SystemInsightsApiSysteminsightsListUsersOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **skip** | **optional.Int32**| The offset into the records to return. | [default to 0] + **sort** | [**optional.Interface of []string**](string.md)| The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` | + **filter** | [**optional.Interface of []string**](string.md)| Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` | + **xOrgId** | **optional.String**| Organization identifier that can be obtained from console settings. | + **limit** | **optional.Int32**| | [default to 10] + +### Return type + +[**[]SystemInsightsUsers**](system-insights-users.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **SysteminsightsListWifiNetworks** +> []SystemInsightsWifiNetworks SysteminsightsListWifiNetworks(ctx, optional) +List System Insights WiFi Networks + +Valid filter fields are `system_id` and `security_type`. + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **optional** | ***SystemInsightsApiSysteminsightsListWifiNetworksOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a SystemInsightsApiSysteminsightsListWifiNetworksOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **skip** | **optional.Int32**| The offset into the records to return. | [default to 0] + **sort** | [**optional.Interface of []string**](string.md)| The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` | + **filter** | [**optional.Interface of []string**](string.md)| Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` | + **xOrgId** | **optional.String**| Organization identifier that can be obtained from console settings. | + **limit** | **optional.Int32**| | [default to 10] + +### Return type + +[**[]SystemInsightsWifiNetworks**](system-insights-wifi-networks.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **SysteminsightsListWifiStatus** +> []SystemInsightsWifiStatus SysteminsightsListWifiStatus(ctx, optional) +List System Insights WiFi Status + +Valid filter fields are `system_id` and `security_type`. + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **optional** | ***SystemInsightsApiSysteminsightsListWifiStatusOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a SystemInsightsApiSysteminsightsListWifiStatusOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **skip** | **optional.Int32**| The offset into the records to return. | [default to 0] + **sort** | [**optional.Interface of []string**](string.md)| The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` | + **filter** | [**optional.Interface of []string**](string.md)| Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` | + **xOrgId** | **optional.String**| Organization identifier that can be obtained from console settings. | + **limit** | **optional.Int32**| | [default to 10] + +### Return type + +[**[]SystemInsightsWifiStatus**](system-insights-wifi-status.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **SysteminsightsListWindowsSecurityCenter** +> []SystemInsightsWindowsSecurityCenter SysteminsightsListWindowsSecurityCenter(ctx, optional) +List System Insights Windows Security Center + +Valid filter fields are `system_id`. + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **optional** | ***SystemInsightsApiSysteminsightsListWindowsSecurityCenterOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a SystemInsightsApiSysteminsightsListWindowsSecurityCenterOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **skip** | **optional.Int32**| The offset into the records to return. | [default to 0] + **sort** | [**optional.Interface of []string**](string.md)| The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` | + **filter** | [**optional.Interface of []string**](string.md)| Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` | + **xOrgId** | **optional.String**| Organization identifier that can be obtained from console settings. | + **limit** | **optional.Int32**| | [default to 10] + +### Return type + +[**[]SystemInsightsWindowsSecurityCenter**](system-insights-windows-security-center.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **SysteminsightsListWindowsSecurityProducts** +> []SystemInsightsWindowsSecurityProducts SysteminsightsListWindowsSecurityProducts(ctx, optional) +List System Insights Windows Security Products + +Valid filter fields are `system_id` and `state`. + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **optional** | ***SystemInsightsApiSysteminsightsListWindowsSecurityProductsOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a SystemInsightsApiSysteminsightsListWindowsSecurityProductsOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **skip** | **optional.Int32**| The offset into the records to return. | [default to 0] + **sort** | [**optional.Interface of []string**](string.md)| The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. e.g: Sort by single field: `sort=field` Sort descending by single field: `sort=-field` Sort by multiple fields: `sort=field1,-field2,field3` | + **filter** | [**optional.Interface of []string**](string.md)| Supported operators are: eq, in. e.g: Filter for single value: `filter=field:eq:value` Filter for any value in a list: (note \"pipe\" character: `|` separating values) `filter=field:in:value1|value2|value3` | + **xOrgId** | **optional.String**| Organization identifier that can be obtained from console settings. | + **limit** | **optional.Int32**| | [default to 10] + +### Return type + +[**[]SystemInsightsWindowsSecurityProducts**](system-insights-windows-security-products.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/SystemInsightsAppcompatShims.md b/jcapiv2/docs/SystemInsightsAppcompatShims.md new file mode 100644 index 0000000..ad29e5a --- /dev/null +++ b/jcapiv2/docs/SystemInsightsAppcompatShims.md @@ -0,0 +1,16 @@ +# SystemInsightsAppcompatShims + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**CollectionTime** | **string** | | [optional] [default to null] +**Description** | **string** | | [optional] [default to null] +**Executable** | **string** | | [optional] [default to null] +**InstallTime** | **float64** | | [optional] [default to null] +**Path** | **string** | | [optional] [default to null] +**SdbId** | **string** | | [optional] [default to null] +**SystemId** | **string** | | [optional] [default to null] +**Type_** | **string** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/v2/docs/SystemInsightsApps.md b/jcapiv2/docs/SystemInsightsApps.md similarity index 96% rename from v2/docs/SystemInsightsApps.md rename to jcapiv2/docs/SystemInsightsApps.md index b74662f..98549ee 100644 --- a/v2/docs/SystemInsightsApps.md +++ b/jcapiv2/docs/SystemInsightsApps.md @@ -19,7 +19,7 @@ Name | Type | Description | Notes **Element** | **string** | | [optional] [default to null] **Environment** | **string** | | [optional] [default to null] **InfoString** | **string** | | [optional] [default to null] -**LastOpenedTime** | **float32** | | [optional] [default to null] +**LastOpenedTime** | **float64** | | [optional] [default to null] **MinimumSystemVersion** | **string** | | [optional] [default to null] **Name** | **string** | | [optional] [default to null] **Path** | **string** | | [optional] [default to null] @@ -27,4 +27,3 @@ Name | Type | Description | Notes [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/jcapiv2/docs/SystemInsightsAuthorizedKeys.md b/jcapiv2/docs/SystemInsightsAuthorizedKeys.md new file mode 100644 index 0000000..1982683 --- /dev/null +++ b/jcapiv2/docs/SystemInsightsAuthorizedKeys.md @@ -0,0 +1,14 @@ +# SystemInsightsAuthorizedKeys + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Algorithm** | **string** | | [optional] [default to null] +**CollectionTime** | **string** | | [optional] [default to null] +**Key** | **string** | | [optional] [default to null] +**KeyFile** | **string** | | [optional] [default to null] +**SystemId** | **string** | | [optional] [default to null] +**Uid** | **string** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/SystemInsightsAzureInstanceMetadata.md b/jcapiv2/docs/SystemInsightsAzureInstanceMetadata.md new file mode 100644 index 0000000..6636a09 --- /dev/null +++ b/jcapiv2/docs/SystemInsightsAzureInstanceMetadata.md @@ -0,0 +1,26 @@ +# SystemInsightsAzureInstanceMetadata + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**CollectionTime** | **string** | | [optional] [default to null] +**Location** | **string** | | [optional] [default to null] +**Name** | **string** | | [optional] [default to null] +**Offer** | **string** | | [optional] [default to null] +**OsType** | **string** | | [optional] [default to null] +**PlacementGroupId** | **string** | | [optional] [default to null] +**PlatformFaultDomain** | **string** | | [optional] [default to null] +**PlatformUpdateDomain** | **string** | | [optional] [default to null] +**Publisher** | **string** | | [optional] [default to null] +**ResourceGroupName** | **string** | | [optional] [default to null] +**Sku** | **string** | | [optional] [default to null] +**SubscriptionId** | **string** | | [optional] [default to null] +**SystemId** | **string** | | [optional] [default to null] +**Version** | **string** | | [optional] [default to null] +**VmId** | **string** | | [optional] [default to null] +**VmScaleSetName** | **string** | | [optional] [default to null] +**VmSize** | **string** | | [optional] [default to null] +**Zone** | **string** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/SystemInsightsAzureInstanceTags.md b/jcapiv2/docs/SystemInsightsAzureInstanceTags.md new file mode 100644 index 0000000..9db58ec --- /dev/null +++ b/jcapiv2/docs/SystemInsightsAzureInstanceTags.md @@ -0,0 +1,13 @@ +# SystemInsightsAzureInstanceTags + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**CollectionTime** | **string** | | [optional] [default to null] +**Key** | **string** | | [optional] [default to null] +**SystemId** | **string** | | [optional] [default to null] +**Value** | **string** | | [optional] [default to null] +**VmId** | **string** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/v2/docs/SystemInsightsBattery.md b/jcapiv2/docs/SystemInsightsBattery.md similarity index 96% rename from v2/docs/SystemInsightsBattery.md rename to jcapiv2/docs/SystemInsightsBattery.md index cee9c58..e54a19b 100644 --- a/v2/docs/SystemInsightsBattery.md +++ b/jcapiv2/docs/SystemInsightsBattery.md @@ -3,7 +3,7 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**Amgerage** | **int32** | | [optional] [default to null] +**Amperage** | **int32** | | [optional] [default to null] **Charged** | **int32** | | [optional] [default to null] **Charging** | **int32** | | [optional] [default to null] **CollectionTime** | **string** | | [optional] [default to null] @@ -26,4 +26,3 @@ Name | Type | Description | Notes [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/v2/docs/SystemInsightsBitlockerInfo.md b/jcapiv2/docs/SystemInsightsBitlockerInfo.md similarity index 99% rename from v2/docs/SystemInsightsBitlockerInfo.md rename to jcapiv2/docs/SystemInsightsBitlockerInfo.md index 773dac7..a731f1a 100644 --- a/v2/docs/SystemInsightsBitlockerInfo.md +++ b/jcapiv2/docs/SystemInsightsBitlockerInfo.md @@ -14,4 +14,3 @@ Name | Type | Description | Notes [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/v2/docs/SystemInsightsBrowserPlugins.md b/jcapiv2/docs/SystemInsightsBrowserPlugins.md similarity index 99% rename from v2/docs/SystemInsightsBrowserPlugins.md rename to jcapiv2/docs/SystemInsightsBrowserPlugins.md index b68dcc3..9e9bd19 100644 --- a/v2/docs/SystemInsightsBrowserPlugins.md +++ b/jcapiv2/docs/SystemInsightsBrowserPlugins.md @@ -18,4 +18,3 @@ Name | Type | Description | Notes [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/jcapiv2/docs/SystemInsightsCertificates.md b/jcapiv2/docs/SystemInsightsCertificates.md new file mode 100644 index 0000000..c9b0d11 --- /dev/null +++ b/jcapiv2/docs/SystemInsightsCertificates.md @@ -0,0 +1,30 @@ +# SystemInsightsCertificates + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**AuthorityKeyId** | **string** | | [optional] [default to null] +**Ca** | **int32** | | [optional] [default to null] +**CommonName** | **string** | | [optional] [default to null] +**Issuer** | **string** | | [optional] [default to null] +**KeyAlgorithm** | **string** | | [optional] [default to null] +**KeyStrength** | **string** | | [optional] [default to null] +**KeyUsage** | **string** | | [optional] [default to null] +**NotValidAfter** | **string** | | [optional] [default to null] +**NotValidBefore** | **string** | | [optional] [default to null] +**Path** | **string** | | [optional] [default to null] +**SelfSigned** | **int32** | | [optional] [default to null] +**Serial** | **string** | | [optional] [default to null] +**Sha1** | **string** | | [optional] [default to null] +**Sid** | **string** | | [optional] [default to null] +**SigningAlgorithm** | **string** | | [optional] [default to null] +**Store** | **string** | | [optional] [default to null] +**StoreId** | **string** | | [optional] [default to null] +**StoreLocation** | **string** | | [optional] [default to null] +**Subject** | **string** | | [optional] [default to null] +**SubjectKeyId** | **string** | | [optional] [default to null] +**SystemId** | **string** | | [optional] [default to null] +**Username** | **string** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/SystemInsightsChassisInfo.md b/jcapiv2/docs/SystemInsightsChassisInfo.md new file mode 100644 index 0000000..ddb6ad3 --- /dev/null +++ b/jcapiv2/docs/SystemInsightsChassisInfo.md @@ -0,0 +1,23 @@ +# SystemInsightsChassisInfo + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**AudibleAlarm** | **string** | | [optional] [default to null] +**BreachDescription** | **string** | | [optional] [default to null] +**ChassisTypes** | **string** | | [optional] [default to null] +**CollectionTime** | **string** | | [optional] [default to null] +**Description** | **string** | | [optional] [default to null] +**Lock** | **string** | | [optional] [default to null] +**Manufacturer** | **string** | | [optional] [default to null] +**Model** | **string** | | [optional] [default to null] +**SecurityBreach** | **string** | | [optional] [default to null] +**Serial** | **string** | | [optional] [default to null] +**Sku** | **string** | | [optional] [default to null] +**SmbiosTag** | **string** | | [optional] [default to null] +**Status** | **string** | | [optional] [default to null] +**SystemId** | **string** | | [optional] [default to null] +**VisibleAlarm** | **string** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/v2/docs/SystemInsightsChromeExtensions.md b/jcapiv2/docs/SystemInsightsChromeExtensions.md similarity index 99% rename from v2/docs/SystemInsightsChromeExtensions.md rename to jcapiv2/docs/SystemInsightsChromeExtensions.md index 98febd0..fb821d5 100644 --- a/v2/docs/SystemInsightsChromeExtensions.md +++ b/jcapiv2/docs/SystemInsightsChromeExtensions.md @@ -19,4 +19,3 @@ Name | Type | Description | Notes [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/jcapiv2/docs/SystemInsightsConnectivity.md b/jcapiv2/docs/SystemInsightsConnectivity.md new file mode 100644 index 0000000..0197c4a --- /dev/null +++ b/jcapiv2/docs/SystemInsightsConnectivity.md @@ -0,0 +1,19 @@ +# SystemInsightsConnectivity + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**CollectionTime** | **string** | | [optional] [default to null] +**Disconnected** | **int32** | | [optional] [default to null] +**Ipv4Internet** | **int32** | | [optional] [default to null] +**Ipv4LocalNetwork** | **int32** | | [optional] [default to null] +**Ipv4NoTraffic** | **int32** | | [optional] [default to null] +**Ipv4Subnet** | **int32** | | [optional] [default to null] +**Ipv6Internet** | **int32** | | [optional] [default to null] +**Ipv6LocalNetwork** | **int32** | | [optional] [default to null] +**Ipv6NoTraffic** | **int32** | | [optional] [default to null] +**Ipv6Subnet** | **int32** | | [optional] [default to null] +**SystemId** | **string** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/v2/docs/SystemInsightsCrashes.md b/jcapiv2/docs/SystemInsightsCrashes.md similarity index 90% rename from v2/docs/SystemInsightsCrashes.md rename to jcapiv2/docs/SystemInsightsCrashes.md index 4fbb3e8..d0a2f96 100644 --- a/v2/docs/SystemInsightsCrashes.md +++ b/jcapiv2/docs/SystemInsightsCrashes.md @@ -3,6 +3,7 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- +**CollectionTime** | **string** | | [optional] [default to null] **CrashPath** | **string** | | [optional] [default to null] **CrashedThread** | **string** | | [optional] [default to null] **Datetime** | **string** | | [optional] [default to null] @@ -16,10 +17,10 @@ Name | Type | Description | Notes **Registers** | **string** | | [optional] [default to null] **Responsible** | **string** | | [optional] [default to null] **StackTrace** | **string** | | [optional] [default to null] +**SystemId** | **string** | | [optional] [default to null] **Type_** | **string** | | [optional] [default to null] **Uid** | **int32** | | [optional] [default to null] **Version** | **string** | | [optional] [default to null] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/jcapiv2/docs/SystemInsightsCupsDestinations.md b/jcapiv2/docs/SystemInsightsCupsDestinations.md new file mode 100644 index 0000000..fc96080 --- /dev/null +++ b/jcapiv2/docs/SystemInsightsCupsDestinations.md @@ -0,0 +1,12 @@ +# SystemInsightsCupsDestinations + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Name** | **string** | | [optional] [default to null] +**OptionName** | **string** | | [optional] [default to null] +**OptionValue** | **string** | | [optional] [default to null] +**SystemId** | **string** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/v2/docs/SystemInsightsDiskEncryption.md b/jcapiv2/docs/SystemInsightsDiskEncryption.md similarity index 99% rename from v2/docs/SystemInsightsDiskEncryption.md rename to jcapiv2/docs/SystemInsightsDiskEncryption.md index ab4d9ae..bdd2c15 100644 --- a/v2/docs/SystemInsightsDiskEncryption.md +++ b/jcapiv2/docs/SystemInsightsDiskEncryption.md @@ -15,4 +15,3 @@ Name | Type | Description | Notes [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/v2/docs/SystemInsightsDiskInfo.md b/jcapiv2/docs/SystemInsightsDiskInfo.md similarity index 99% rename from v2/docs/SystemInsightsDiskInfo.md rename to jcapiv2/docs/SystemInsightsDiskInfo.md index ef1814a..59bf707 100644 --- a/v2/docs/SystemInsightsDiskInfo.md +++ b/jcapiv2/docs/SystemInsightsDiskInfo.md @@ -19,4 +19,3 @@ Name | Type | Description | Notes [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/jcapiv2/docs/SystemInsightsDnsResolvers.md b/jcapiv2/docs/SystemInsightsDnsResolvers.md new file mode 100644 index 0000000..bffef4a --- /dev/null +++ b/jcapiv2/docs/SystemInsightsDnsResolvers.md @@ -0,0 +1,15 @@ +# SystemInsightsDnsResolvers + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Address** | **string** | | [optional] [default to null] +**CollectionTime** | **string** | | [optional] [default to null] +**Id** | **float64** | | [optional] [default to null] +**Netmask** | **string** | | [optional] [default to null] +**Options** | **string** | | [optional] [default to null] +**SystemId** | **string** | | [optional] [default to null] +**Type_** | **string** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/v2/docs/SystemInsightsEtcHosts.md b/jcapiv2/docs/SystemInsightsEtcHosts.md similarity index 99% rename from v2/docs/SystemInsightsEtcHosts.md rename to jcapiv2/docs/SystemInsightsEtcHosts.md index 09e3449..c93b7d2 100644 --- a/v2/docs/SystemInsightsEtcHosts.md +++ b/jcapiv2/docs/SystemInsightsEtcHosts.md @@ -10,4 +10,3 @@ Name | Type | Description | Notes [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/v2/docs/SystemInsightsFirefoxAddons.md b/jcapiv2/docs/SystemInsightsFirefoxAddons.md similarity index 99% rename from v2/docs/SystemInsightsFirefoxAddons.md rename to jcapiv2/docs/SystemInsightsFirefoxAddons.md index 26d172b..4f8b0f3 100644 --- a/v2/docs/SystemInsightsFirefoxAddons.md +++ b/jcapiv2/docs/SystemInsightsFirefoxAddons.md @@ -22,4 +22,3 @@ Name | Type | Description | Notes [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/v2/docs/SystemInsightsGroups.md b/jcapiv2/docs/SystemInsightsGroups.md similarity index 99% rename from v2/docs/SystemInsightsGroups.md rename to jcapiv2/docs/SystemInsightsGroups.md index a1d6215..01d7aa0 100644 --- a/v2/docs/SystemInsightsGroups.md +++ b/jcapiv2/docs/SystemInsightsGroups.md @@ -13,4 +13,3 @@ Name | Type | Description | Notes [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/v2/docs/SystemInsightsIeExtensions.md b/jcapiv2/docs/SystemInsightsIeExtensions.md similarity index 99% rename from v2/docs/SystemInsightsIeExtensions.md rename to jcapiv2/docs/SystemInsightsIeExtensions.md index b3a398f..bebf2e0 100644 --- a/v2/docs/SystemInsightsIeExtensions.md +++ b/jcapiv2/docs/SystemInsightsIeExtensions.md @@ -12,4 +12,3 @@ Name | Type | Description | Notes [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/v2/docs/SystemInsightsInterfaceAddresses.md b/jcapiv2/docs/SystemInsightsInterfaceAddresses.md similarity index 99% rename from v2/docs/SystemInsightsInterfaceAddresses.md rename to jcapiv2/docs/SystemInsightsInterfaceAddresses.md index fe4d81d..08faf05 100644 --- a/v2/docs/SystemInsightsInterfaceAddresses.md +++ b/jcapiv2/docs/SystemInsightsInterfaceAddresses.md @@ -15,4 +15,3 @@ Name | Type | Description | Notes [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/jcapiv2/docs/SystemInsightsInterfaceDetails.md b/jcapiv2/docs/SystemInsightsInterfaceDetails.md new file mode 100644 index 0000000..96173f5 --- /dev/null +++ b/jcapiv2/docs/SystemInsightsInterfaceDetails.md @@ -0,0 +1,44 @@ +# SystemInsightsInterfaceDetails + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Collisions** | **string** | | [optional] [default to null] +**ConnectionId** | **string** | | [optional] [default to null] +**ConnectionStatus** | **string** | | [optional] [default to null] +**Description** | **string** | | [optional] [default to null] +**DhcpEnabled** | **int32** | | [optional] [default to null] +**DhcpLeaseExpires** | **string** | | [optional] [default to null] +**DhcpLeaseObtained** | **string** | | [optional] [default to null] +**DhcpServer** | **string** | | [optional] [default to null] +**DnsDomain** | **string** | | [optional] [default to null] +**DnsDomainSuffixSearchOrder** | **string** | | [optional] [default to null] +**DnsHostName** | **string** | | [optional] [default to null] +**DnsServerSearchOrder** | **string** | | [optional] [default to null] +**Enabled** | **int32** | | [optional] [default to null] +**Flags** | **int32** | | [optional] [default to null] +**FriendlyName** | **string** | | [optional] [default to null] +**Ibytes** | **string** | | [optional] [default to null] +**Idrops** | **string** | | [optional] [default to null] +**Ierrors** | **string** | | [optional] [default to null] +**Interface_** | **string** | | [optional] [default to null] +**Ipackets** | **string** | | [optional] [default to null] +**LastChange** | **string** | | [optional] [default to null] +**LinkSpeed** | **string** | | [optional] [default to null] +**Mac** | **string** | | [optional] [default to null] +**Manufacturer** | **string** | | [optional] [default to null] +**Metric** | **int32** | | [optional] [default to null] +**Mtu** | **int32** | | [optional] [default to null] +**Obytes** | **string** | | [optional] [default to null] +**Odrops** | **string** | | [optional] [default to null] +**Oerrors** | **string** | | [optional] [default to null] +**Opackets** | **string** | | [optional] [default to null] +**PciSlot** | **string** | | [optional] [default to null] +**PhysicalAdapter** | **int32** | | [optional] [default to null] +**Service** | **string** | | [optional] [default to null] +**Speed** | **int32** | | [optional] [default to null] +**SystemId** | **string** | | [optional] [default to null] +**Type_** | **int32** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/v2/docs/SystemInsightsKernelInfo.md b/jcapiv2/docs/SystemInsightsKernelInfo.md similarity index 99% rename from v2/docs/SystemInsightsKernelInfo.md rename to jcapiv2/docs/SystemInsightsKernelInfo.md index 9e34fea..7bf60a5 100644 --- a/v2/docs/SystemInsightsKernelInfo.md +++ b/jcapiv2/docs/SystemInsightsKernelInfo.md @@ -12,4 +12,3 @@ Name | Type | Description | Notes [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/v2/docs/SystemInsightsLaunchd.md b/jcapiv2/docs/SystemInsightsLaunchd.md similarity index 99% rename from v2/docs/SystemInsightsLaunchd.md rename to jcapiv2/docs/SystemInsightsLaunchd.md index 46ce22f..9e3634f 100644 --- a/v2/docs/SystemInsightsLaunchd.md +++ b/jcapiv2/docs/SystemInsightsLaunchd.md @@ -29,4 +29,3 @@ Name | Type | Description | Notes [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/jcapiv2/docs/SystemInsightsLinuxPackages.md b/jcapiv2/docs/SystemInsightsLinuxPackages.md new file mode 100644 index 0000000..e428fd9 --- /dev/null +++ b/jcapiv2/docs/SystemInsightsLinuxPackages.md @@ -0,0 +1,20 @@ +# SystemInsightsLinuxPackages + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Arch** | **string** | | [optional] [default to null] +**InstallTime** | **int32** | | [optional] [default to null] +**MaintainerOrVendor** | **string** | | [optional] [default to null] +**MountNamespaceId** | **string** | | [optional] [default to null] +**Name** | **string** | | [optional] [default to null] +**PackageFormat** | **string** | | [optional] [default to null] +**PackageGroupOrSection** | **string** | | [optional] [default to null] +**PidWithNamespace** | **int32** | | [optional] [default to null] +**ReleaseOrRevision** | **string** | | [optional] [default to null] +**Size** | **string** | | [optional] [default to null] +**SystemId** | **string** | | [optional] [default to null] +**Version** | **string** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/v2/docs/SystemInsightsLoggedInUsers.md b/jcapiv2/docs/SystemInsightsLoggedInUsers.md similarity index 99% rename from v2/docs/SystemInsightsLoggedInUsers.md rename to jcapiv2/docs/SystemInsightsLoggedInUsers.md index 6c34d1b..44d8d39 100644 --- a/v2/docs/SystemInsightsLoggedInUsers.md +++ b/jcapiv2/docs/SystemInsightsLoggedInUsers.md @@ -14,4 +14,3 @@ Name | Type | Description | Notes [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/jcapiv2/docs/SystemInsightsLogicalDrives.md b/jcapiv2/docs/SystemInsightsLogicalDrives.md new file mode 100644 index 0000000..461e684 --- /dev/null +++ b/jcapiv2/docs/SystemInsightsLogicalDrives.md @@ -0,0 +1,16 @@ +# SystemInsightsLogicalDrives + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**BootPartition** | **int32** | | [optional] [default to null] +**CollectionTime** | **string** | | [optional] [default to null] +**DeviceId** | **string** | | [optional] [default to null] +**FileSystem** | **string** | | [optional] [default to null] +**FreeSpace** | **string** | | [optional] [default to null] +**Size** | **string** | | [optional] [default to null] +**SystemId** | **string** | | [optional] [default to null] +**Type_** | **string** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/SystemInsightsManagedPolicies.md b/jcapiv2/docs/SystemInsightsManagedPolicies.md new file mode 100644 index 0000000..54c7f90 --- /dev/null +++ b/jcapiv2/docs/SystemInsightsManagedPolicies.md @@ -0,0 +1,16 @@ +# SystemInsightsManagedPolicies + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**CollectionTime** | **string** | | [optional] [default to null] +**Domain** | **string** | | [optional] [default to null] +**Manual** | **int32** | | [optional] [default to null] +**Name** | **string** | | [optional] [default to null] +**SystemId** | **string** | | [optional] [default to null] +**Username** | **string** | | [optional] [default to null] +**Uuid** | **string** | | [optional] [default to null] +**Value** | **string** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/v2/docs/SystemInsightsMounts.md b/jcapiv2/docs/SystemInsightsMounts.md similarity index 99% rename from v2/docs/SystemInsightsMounts.md rename to jcapiv2/docs/SystemInsightsMounts.md index b66323c..27de30c 100644 --- a/v2/docs/SystemInsightsMounts.md +++ b/jcapiv2/docs/SystemInsightsMounts.md @@ -19,4 +19,3 @@ Name | Type | Description | Notes [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/v2/docs/SystemInsightsOsVersion.md b/jcapiv2/docs/SystemInsightsOsVersion.md similarity index 99% rename from v2/docs/SystemInsightsOsVersion.md rename to jcapiv2/docs/SystemInsightsOsVersion.md index d4f48bf..df1913e 100644 --- a/v2/docs/SystemInsightsOsVersion.md +++ b/jcapiv2/docs/SystemInsightsOsVersion.md @@ -18,4 +18,3 @@ Name | Type | Description | Notes [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/v2/docs/SystemInsightsPatches.md b/jcapiv2/docs/SystemInsightsPatches.md similarity index 99% rename from v2/docs/SystemInsightsPatches.md rename to jcapiv2/docs/SystemInsightsPatches.md index f9ceede..b7270ef 100644 --- a/v2/docs/SystemInsightsPatches.md +++ b/jcapiv2/docs/SystemInsightsPatches.md @@ -16,4 +16,3 @@ Name | Type | Description | Notes [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/v2/docs/SystemInsightsPrograms.md b/jcapiv2/docs/SystemInsightsPrograms.md similarity index 99% rename from v2/docs/SystemInsightsPrograms.md rename to jcapiv2/docs/SystemInsightsPrograms.md index f49189a..9d5ce0d 100644 --- a/v2/docs/SystemInsightsPrograms.md +++ b/jcapiv2/docs/SystemInsightsPrograms.md @@ -17,4 +17,3 @@ Name | Type | Description | Notes [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/jcapiv2/docs/SystemInsightsPythonPackages.md b/jcapiv2/docs/SystemInsightsPythonPackages.md new file mode 100644 index 0000000..a985b98 --- /dev/null +++ b/jcapiv2/docs/SystemInsightsPythonPackages.md @@ -0,0 +1,16 @@ +# SystemInsightsPythonPackages + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Auther** | **string** | | [optional] [default to null] +**Directory** | **string** | | [optional] [default to null] +**License** | **string** | | [optional] [default to null] +**Name** | **string** | | [optional] [default to null] +**Path** | **string** | | [optional] [default to null] +**Summary** | **string** | | [optional] [default to null] +**SystemId** | **string** | | [optional] [default to null] +**Version** | **string** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/v2/docs/SystemInsightsSafariExtensions.md b/jcapiv2/docs/SystemInsightsSafariExtensions.md similarity index 99% rename from v2/docs/SystemInsightsSafariExtensions.md rename to jcapiv2/docs/SystemInsightsSafariExtensions.md index 1c0028f..d4334dc 100644 --- a/v2/docs/SystemInsightsSafariExtensions.md +++ b/jcapiv2/docs/SystemInsightsSafariExtensions.md @@ -18,4 +18,3 @@ Name | Type | Description | Notes [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/jcapiv2/docs/SystemInsightsScheduledTasks.md b/jcapiv2/docs/SystemInsightsScheduledTasks.md new file mode 100644 index 0000000..99381f9 --- /dev/null +++ b/jcapiv2/docs/SystemInsightsScheduledTasks.md @@ -0,0 +1,19 @@ +# SystemInsightsScheduledTasks + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Action** | **string** | | [optional] [default to null] +**Enabled** | **int32** | | [optional] [default to null] +**Hidden** | **int32** | | [optional] [default to null] +**LastRunCode** | **string** | | [optional] [default to null] +**LastRunMessage** | **string** | | [optional] [default to null] +**LastRunTime** | **string** | | [optional] [default to null] +**Name** | **string** | | [optional] [default to null] +**NextRunTime** | **string** | | [optional] [default to null] +**Path** | **string** | | [optional] [default to null] +**State** | **string** | | [optional] [default to null] +**SystemId** | **string** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/SystemInsightsSecureboot.md b/jcapiv2/docs/SystemInsightsSecureboot.md new file mode 100644 index 0000000..3a6a7da --- /dev/null +++ b/jcapiv2/docs/SystemInsightsSecureboot.md @@ -0,0 +1,12 @@ +# SystemInsightsSecureboot + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**CollectionTime** | **string** | | [optional] [default to null] +**SecureBoot** | **float64** | | [optional] [default to null] +**SetupMode** | **float64** | | [optional] [default to null] +**SystemId** | **string** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/SystemInsightsServices.md b/jcapiv2/docs/SystemInsightsServices.md new file mode 100644 index 0000000..e6c0b1e --- /dev/null +++ b/jcapiv2/docs/SystemInsightsServices.md @@ -0,0 +1,21 @@ +# SystemInsightsServices + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Description** | **string** | | [optional] [default to null] +**DisplayName** | **string** | | [optional] [default to null] +**ModulePath** | **string** | | [optional] [default to null] +**Name** | **string** | | [optional] [default to null] +**Path** | **string** | | [optional] [default to null] +**Pid** | **int32** | | [optional] [default to null] +**ServiceExitCode** | **int32** | | [optional] [default to null] +**ServiceType** | **string** | | [optional] [default to null] +**StartType** | **string** | | [optional] [default to null] +**Status** | **string** | | [optional] [default to null] +**SystemId** | **string** | | [optional] [default to null] +**UserAccount** | **string** | | [optional] [default to null] +**Win32ExitCode** | **int32** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/SystemInsightsShadow.md b/jcapiv2/docs/SystemInsightsShadow.md new file mode 100644 index 0000000..07aa00b --- /dev/null +++ b/jcapiv2/docs/SystemInsightsShadow.md @@ -0,0 +1,20 @@ +# SystemInsightsShadow + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**CollectionTime** | **string** | | [optional] [default to null] +**Expire** | **string** | | [optional] [default to null] +**Flag** | **string** | | [optional] [default to null] +**HashAlg** | **string** | | [optional] [default to null] +**Inactive** | **string** | | [optional] [default to null] +**LastChange** | **string** | | [optional] [default to null] +**Max** | **string** | | [optional] [default to null] +**Min** | **string** | | [optional] [default to null] +**PasswordStatus** | **string** | | [optional] [default to null] +**SystemId** | **string** | | [optional] [default to null] +**Username** | **string** | | [optional] [default to null] +**Warning** | **string** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/SystemInsightsSharedFolders.md b/jcapiv2/docs/SystemInsightsSharedFolders.md new file mode 100644 index 0000000..b2540b3 --- /dev/null +++ b/jcapiv2/docs/SystemInsightsSharedFolders.md @@ -0,0 +1,12 @@ +# SystemInsightsSharedFolders + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**CollectionTime** | **string** | | [optional] [default to null] +**Name** | **string** | | [optional] [default to null] +**Path** | **string** | | [optional] [default to null] +**SystemId** | **string** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/SystemInsightsSharedResources.md b/jcapiv2/docs/SystemInsightsSharedResources.md new file mode 100644 index 0000000..0d8a381 --- /dev/null +++ b/jcapiv2/docs/SystemInsightsSharedResources.md @@ -0,0 +1,18 @@ +# SystemInsightsSharedResources + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**AllowMaximum** | **int32** | | [optional] [default to null] +**CollectionTime** | **string** | | [optional] [default to null] +**Description** | **string** | | [optional] [default to null] +**InstallDate** | **string** | | [optional] [default to null] +**MaximumAllowed** | **int32** | | [optional] [default to null] +**Name** | **string** | | [optional] [default to null] +**Path** | **string** | | [optional] [default to null] +**Status** | **string** | | [optional] [default to null] +**SystemId** | **string** | | [optional] [default to null] +**Type_** | **int32** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/SystemInsightsSharingPreferences.md b/jcapiv2/docs/SystemInsightsSharingPreferences.md new file mode 100644 index 0000000..e3854f6 --- /dev/null +++ b/jcapiv2/docs/SystemInsightsSharingPreferences.md @@ -0,0 +1,20 @@ +# SystemInsightsSharingPreferences + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**BluetoothSharing** | **int32** | | [optional] [default to null] +**CollectionTime** | **string** | | [optional] [default to null] +**ContentCaching** | **int32** | | [optional] [default to null] +**DiscSharing** | **int32** | | [optional] [default to null] +**FileSharing** | **int32** | | [optional] [default to null] +**InternetSharing** | **int32** | | [optional] [default to null] +**PrinterSharing** | **int32** | | [optional] [default to null] +**RemoteAppleEvents** | **int32** | | [optional] [default to null] +**RemoteLogin** | **int32** | | [optional] [default to null] +**RemoteManagement** | **int32** | | [optional] [default to null] +**ScreenSharing** | **int32** | | [optional] [default to null] +**SystemId** | **string** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/SystemInsightsSipConfig.md b/jcapiv2/docs/SystemInsightsSipConfig.md new file mode 100644 index 0000000..f87cca7 --- /dev/null +++ b/jcapiv2/docs/SystemInsightsSipConfig.md @@ -0,0 +1,13 @@ +# SystemInsightsSipConfig + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**CollectionTime** | **string** | | [optional] [default to null] +**ConfigFlag** | **string** | | [optional] [default to null] +**Enabled** | **int32** | | [optional] [default to null] +**EnabledNvram** | **int32** | | [optional] [default to null] +**SystemId** | **string** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/SystemInsightsStartupItems.md b/jcapiv2/docs/SystemInsightsStartupItems.md new file mode 100644 index 0000000..2bac92f --- /dev/null +++ b/jcapiv2/docs/SystemInsightsStartupItems.md @@ -0,0 +1,16 @@ +# SystemInsightsStartupItems + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Args** | **string** | | [optional] [default to null] +**Name** | **string** | | [optional] [default to null] +**Path** | **string** | | [optional] [default to null] +**Source** | **string** | | [optional] [default to null] +**Status** | **string** | | [optional] [default to null] +**SystemId** | **string** | | [optional] [default to null] +**Type_** | **string** | | [optional] [default to null] +**Username** | **string** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/v2/docs/SystemInsightsSystemControls.md b/jcapiv2/docs/SystemInsightsSystemControls.md similarity index 99% rename from v2/docs/SystemInsightsSystemControls.md rename to jcapiv2/docs/SystemInsightsSystemControls.md index e76995f..8ab2993 100644 --- a/v2/docs/SystemInsightsSystemControls.md +++ b/jcapiv2/docs/SystemInsightsSystemControls.md @@ -15,4 +15,3 @@ Name | Type | Description | Notes [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/v2/docs/SystemInsightsSystemInfo.md b/jcapiv2/docs/SystemInsightsSystemInfo.md similarity index 99% rename from v2/docs/SystemInsightsSystemInfo.md rename to jcapiv2/docs/SystemInsightsSystemInfo.md index 77b310b..11c1ba3 100644 --- a/v2/docs/SystemInsightsSystemInfo.md +++ b/jcapiv2/docs/SystemInsightsSystemInfo.md @@ -23,4 +23,3 @@ Name | Type | Description | Notes [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/jcapiv2/docs/SystemInsightsTpmInfo.md b/jcapiv2/docs/SystemInsightsTpmInfo.md new file mode 100644 index 0000000..85ac002 --- /dev/null +++ b/jcapiv2/docs/SystemInsightsTpmInfo.md @@ -0,0 +1,19 @@ +# SystemInsightsTpmInfo + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Activated** | **float64** | | [optional] [default to null] +**CollectionTime** | **string** | | [optional] [default to null] +**Enabled** | **float64** | | [optional] [default to null] +**ManufacturerId** | **float64** | | [optional] [default to null] +**ManufacturerName** | **string** | | [optional] [default to null] +**ManufacturerVersion** | **string** | | [optional] [default to null] +**Owned** | **float64** | | [optional] [default to null] +**PhysicalPresenceVersion** | **string** | | [optional] [default to null] +**ProductName** | **string** | | [optional] [default to null] +**SpecVersion** | **string** | | [optional] [default to null] +**SystemId** | **string** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/v2/docs/SystemInsightsUptime.md b/jcapiv2/docs/SystemInsightsUptime.md similarity index 99% rename from v2/docs/SystemInsightsUptime.md rename to jcapiv2/docs/SystemInsightsUptime.md index daee250..f7ee46d 100644 --- a/v2/docs/SystemInsightsUptime.md +++ b/jcapiv2/docs/SystemInsightsUptime.md @@ -13,4 +13,3 @@ Name | Type | Description | Notes [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/v2/docs/SystemInsightsUsbDevices.md b/jcapiv2/docs/SystemInsightsUsbDevices.md similarity index 99% rename from v2/docs/SystemInsightsUsbDevices.md rename to jcapiv2/docs/SystemInsightsUsbDevices.md index 070f23e..1adec27 100644 --- a/v2/docs/SystemInsightsUsbDevices.md +++ b/jcapiv2/docs/SystemInsightsUsbDevices.md @@ -20,4 +20,3 @@ Name | Type | Description | Notes [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/v2/docs/SystemInsightsUserGroups.md b/jcapiv2/docs/SystemInsightsUserGroups.md similarity index 99% rename from v2/docs/SystemInsightsUserGroups.md rename to jcapiv2/docs/SystemInsightsUserGroups.md index b97692d..b3c3865 100644 --- a/v2/docs/SystemInsightsUserGroups.md +++ b/jcapiv2/docs/SystemInsightsUserGroups.md @@ -10,4 +10,3 @@ Name | Type | Description | Notes [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/jcapiv2/docs/SystemInsightsUserSshKeys.md b/jcapiv2/docs/SystemInsightsUserSshKeys.md new file mode 100644 index 0000000..21d7716 --- /dev/null +++ b/jcapiv2/docs/SystemInsightsUserSshKeys.md @@ -0,0 +1,13 @@ +# SystemInsightsUserSshKeys + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**CollectionTime** | **string** | | [optional] [default to null] +**Encrypted** | **int32** | | [optional] [default to null] +**Path** | **string** | | [optional] [default to null] +**SystemId** | **string** | | [optional] [default to null] +**Uid** | **string** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/SystemInsightsUserassist.md b/jcapiv2/docs/SystemInsightsUserassist.md new file mode 100644 index 0000000..333005d --- /dev/null +++ b/jcapiv2/docs/SystemInsightsUserassist.md @@ -0,0 +1,14 @@ +# SystemInsightsUserassist + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**CollectionTime** | **string** | | [optional] [default to null] +**Count** | **float64** | | [optional] [default to null] +**LastExecutionTime** | **float64** | | [optional] [default to null] +**Path** | **string** | | [optional] [default to null] +**Sid** | **string** | | [optional] [default to null] +**SystemId** | **string** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/SystemInsightsUsers.md b/jcapiv2/docs/SystemInsightsUsers.md new file mode 100644 index 0000000..4487d16 --- /dev/null +++ b/jcapiv2/docs/SystemInsightsUsers.md @@ -0,0 +1,26 @@ +# SystemInsightsUsers + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**AdManaged** | **bool** | Indicates this account belongs to a AD-managed user | [optional] [default to null] +**Admin** | **bool** | Indicates this account has local administrator privileges | [optional] [default to null] +**CollectionTime** | **string** | | [optional] [default to null] +**Description** | **string** | | [optional] [default to null] +**Directory** | **string** | | [optional] [default to null] +**Gid** | **string** | | [optional] [default to null] +**GidSigned** | **string** | | [optional] [default to null] +**LastLogin** | **string** | A Unix timestamp showing the last time this user logged in | [optional] [default to null] +**Managed** | **bool** | Indicates this account belongs to a JumpCloud-managed user | [optional] [default to null] +**RealUser** | **bool** | Indicates this account represents an interactive user account vs. a system or daemon account | [optional] [default to null] +**Shell** | **string** | | [optional] [default to null] +**Suspended** | **bool** | Indicates this account is suspended or locked out | [optional] [default to null] +**SystemId** | **string** | | [optional] [default to null] +**Type_** | **string** | | [optional] [default to null] +**Uid** | **string** | | [optional] [default to null] +**UidSigned** | **string** | | [optional] [default to null] +**Username** | **string** | | [optional] [default to null] +**Uuid** | **string** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/SystemInsightsWifiNetworks.md b/jcapiv2/docs/SystemInsightsWifiNetworks.md new file mode 100644 index 0000000..3ad5e13 --- /dev/null +++ b/jcapiv2/docs/SystemInsightsWifiNetworks.md @@ -0,0 +1,22 @@ +# SystemInsightsWifiNetworks + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**AutoLogin** | **float64** | | [optional] [default to null] +**CaptivePortal** | **float64** | | [optional] [default to null] +**CollectionTime** | **string** | | [optional] [default to null] +**Disabled** | **float64** | | [optional] [default to null] +**LastConnected** | **float64** | | [optional] [default to null] +**NetworkName** | **string** | | [optional] [default to null] +**Passpoint** | **float64** | | [optional] [default to null] +**PossiblyHidden** | **float64** | | [optional] [default to null] +**Roaming** | **float64** | | [optional] [default to null] +**RoamingProfile** | **string** | | [optional] [default to null] +**SecurityType** | **string** | | [optional] [default to null] +**Ssid** | **string** | | [optional] [default to null] +**SystemId** | **string** | | [optional] [default to null] +**TemporarilyDisabled** | **float64** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/SystemInsightsWifiStatus.md b/jcapiv2/docs/SystemInsightsWifiStatus.md new file mode 100644 index 0000000..36e4dd5 --- /dev/null +++ b/jcapiv2/docs/SystemInsightsWifiStatus.md @@ -0,0 +1,23 @@ +# SystemInsightsWifiStatus + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Bssid** | **string** | | [optional] [default to null] +**Channel** | **float64** | | [optional] [default to null] +**ChannelBand** | **float64** | | [optional] [default to null] +**ChannelWidth** | **float64** | | [optional] [default to null] +**CollectionTime** | **string** | | [optional] [default to null] +**CountryCode** | **string** | | [optional] [default to null] +**Interface_** | **string** | | [optional] [default to null] +**Mode** | **string** | | [optional] [default to null] +**NetworkName** | **string** | | [optional] [default to null] +**Noise** | **float64** | | [optional] [default to null] +**Rssi** | **float64** | | [optional] [default to null] +**SecurityType** | **string** | | [optional] [default to null] +**Ssid** | **string** | | [optional] [default to null] +**SystemId** | **string** | | [optional] [default to null] +**TransmitRate** | **string** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/SystemInsightsWindowsSecurityCenter.md b/jcapiv2/docs/SystemInsightsWindowsSecurityCenter.md new file mode 100644 index 0000000..464d5f9 --- /dev/null +++ b/jcapiv2/docs/SystemInsightsWindowsSecurityCenter.md @@ -0,0 +1,17 @@ +# SystemInsightsWindowsSecurityCenter + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Antispyware** | **string** | | [optional] [default to null] +**Antivirus** | **string** | | [optional] [default to null] +**Autoupdate** | **string** | | [optional] [default to null] +**CollectionTime** | **string** | | [optional] [default to null] +**Firewall** | **string** | | [optional] [default to null] +**InternetSettings** | **string** | | [optional] [default to null] +**SystemId** | **string** | | [optional] [default to null] +**UserAccountControl** | **string** | | [optional] [default to null] +**WindowsSecurityCenterService** | **string** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/SystemInsightsWindowsSecurityProducts.md b/jcapiv2/docs/SystemInsightsWindowsSecurityProducts.md new file mode 100644 index 0000000..8f3aed3 --- /dev/null +++ b/jcapiv2/docs/SystemInsightsWindowsSecurityProducts.md @@ -0,0 +1,16 @@ +# SystemInsightsWindowsSecurityProducts + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**CollectionTime** | **string** | | [optional] [default to null] +**Name** | **string** | | [optional] [default to null] +**RemediationPath** | **string** | | [optional] [default to null] +**SignaturesUpToDate** | **float64** | | [optional] [default to null] +**State** | **string** | | [optional] [default to null] +**StateTimestamp** | **string** | | [optional] [default to null] +**SystemId** | **string** | | [optional] [default to null] +**Type_** | **string** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/v2/docs/Systemfdekey.md b/jcapiv2/docs/Systemfdekey.md similarity index 99% rename from v2/docs/Systemfdekey.md rename to jcapiv2/docs/Systemfdekey.md index 190e8c5..e0af001 100644 --- a/v2/docs/Systemfdekey.md +++ b/jcapiv2/docs/Systemfdekey.md @@ -7,4 +7,3 @@ Name | Type | Description | Notes [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/jcapiv2/docs/SystemsApi.md b/jcapiv2/docs/SystemsApi.md new file mode 100644 index 0000000..730ce72 --- /dev/null +++ b/jcapiv2/docs/SystemsApi.md @@ -0,0 +1,417 @@ +# {{classname}} + +All URIs are relative to *https://console.jumpcloud.com/api/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**GraphSystemAssociationsList**](SystemsApi.md#GraphSystemAssociationsList) | **Get** /systems/{system_id}/associations | List the associations of a System +[**GraphSystemAssociationsPost**](SystemsApi.md#GraphSystemAssociationsPost) | **Post** /systems/{system_id}/associations | Manage associations of a System +[**GraphSystemMemberOf**](SystemsApi.md#GraphSystemMemberOf) | **Get** /systems/{system_id}/memberof | List the parent Groups of a System +[**GraphSystemTraverseCommand**](SystemsApi.md#GraphSystemTraverseCommand) | **Get** /systems/{system_id}/commands | List the Commands bound to a System +[**GraphSystemTraversePolicy**](SystemsApi.md#GraphSystemTraversePolicy) | **Get** /systems/{system_id}/policies | List the Policies bound to a System +[**GraphSystemTraversePolicyGroup**](SystemsApi.md#GraphSystemTraversePolicyGroup) | **Get** /systems/{system_id}/policygroups | List the Policy Groups bound to a System +[**GraphSystemTraverseUser**](SystemsApi.md#GraphSystemTraverseUser) | **Get** /systems/{system_id}/users | List the Users bound to a System +[**GraphSystemTraverseUserGroup**](SystemsApi.md#GraphSystemTraverseUserGroup) | **Get** /systems/{system_id}/usergroups | List the User Groups bound to a System +[**SystemsGetFDEKey**](SystemsApi.md#SystemsGetFDEKey) | **Get** /systems/{system_id}/fdekey | Get System FDE Key +[**SystemsListSoftwareAppsWithStatuses**](SystemsApi.md#SystemsListSoftwareAppsWithStatuses) | **Get** /systems/{system_id}/softwareappstatuses | List the associated Software Application Statuses of a System + +# **GraphSystemAssociationsList** +> []GraphConnection GraphSystemAssociationsList(ctx, systemId, targets, optional) +List the associations of a System + +This endpoint returns the _direct_ associations of a System. A direct association can be a non-homogeneous relationship between 2 different objects, for example Systems and Users. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/systems/{System_ID}/associations?targets=user \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **systemId** | **string**| ObjectID of the System. | + **targets** | [**[]string**](string.md)| Targets which a \"system\" can be associated to. | + **optional** | ***SystemsApiGraphSystemAssociationsListOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a SystemsApiGraphSystemAssociationsListOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + **limit** | **optional.Int32**| The number of records to return at once. Limited to 100. | [default to 10] + **skip** | **optional.Int32**| The offset into the records to return. | [default to 0] + **date** | **optional.String**| Current date header for the System Context API | + **authorization** | **optional.String**| Authorization header for the System Context API | + **xOrgId** | **optional.String**| Organization identifier that can be obtained from console settings. | + +### Return type + +[**[]GraphConnection**](GraphConnection.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GraphSystemAssociationsPost** +> GraphSystemAssociationsPost(ctx, systemId, optional) +Manage associations of a System + +This endpoint allows you to manage the _direct_ associations of a System. A direct association can be a non-homogeneous relationship between 2 different objects, for example Systems and Users. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/systems/{System_ID}/associations \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"attributes\": { \"sudo\": { \"enabled\": true, \"withoutPassword\": false } }, \"op\": \"add\", \"type\": \"user\", \"id\": \"UserID\" }' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **systemId** | **string**| ObjectID of the System. | + **optional** | ***SystemsApiGraphSystemAssociationsPostOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a SystemsApiGraphSystemAssociationsPostOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **body** | [**optional.Interface of GraphOperationSystem**](GraphOperationSystem.md)| | + **date** | **optional.**| Current date header for the System Context API | + **authorization** | **optional.**| Authorization header for the System Context API | + **xOrgId** | **optional.**| Organization identifier that can be obtained from console settings. | + +### Return type + + (empty response body) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GraphSystemMemberOf** +> []GraphObjectWithPaths GraphSystemMemberOf(ctx, systemId, optional) +List the parent Groups of a System + +This endpoint returns all the System Groups a System is a member of. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/systems/{System_ID}/memberof \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **systemId** | **string**| ObjectID of the System. | + **optional** | ***SystemsApiGraphSystemMemberOfOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a SystemsApiGraphSystemMemberOfOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **filter** | [**optional.Interface of []string**](string.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | + **limit** | **optional.Int32**| The number of records to return at once. Limited to 100. | [default to 10] + **skip** | **optional.Int32**| The offset into the records to return. | [default to 0] + **date** | **optional.String**| Current date header for the System Context API | + **authorization** | **optional.String**| Authorization header for the System Context API | + **sort** | [**optional.Interface of []string**](string.md)| The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. | + **xOrgId** | **optional.String**| Organization identifier that can be obtained from console settings. | + +### Return type + +[**[]GraphObjectWithPaths**](GraphObjectWithPaths.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GraphSystemTraverseCommand** +> []GraphObjectWithPaths GraphSystemTraverseCommand(ctx, systemId, optional) +List the Commands bound to a System + +This endpoint will return all Commands bound to a System, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this System to the corresponding Command; this array represents all grouping and/or associations that would have to be removed to deprovision the Command from this System. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/systems/{System_ID}/commands \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **systemId** | **string**| ObjectID of the System. | + **optional** | ***SystemsApiGraphSystemTraverseCommandOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a SystemsApiGraphSystemTraverseCommandOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **limit** | **optional.Int32**| The number of records to return at once. Limited to 100. | [default to 10] + **xOrgId** | **optional.String**| Organization identifier that can be obtained from console settings. | + **skip** | **optional.Int32**| The offset into the records to return. | [default to 0] + **filter** | [**optional.Interface of []string**](string.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | + +### Return type + +[**[]GraphObjectWithPaths**](GraphObjectWithPaths.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GraphSystemTraversePolicy** +> []GraphObjectWithPaths GraphSystemTraversePolicy(ctx, systemId, optional) +List the Policies bound to a System + +This endpoint will return all Policies bound to a System, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this System to the corresponding Policy; this array represents all grouping and/or associations that would have to be removed to deprovision the Policy from this System. See `/members` and `/associations` endpoints to manage those collections. This endpoint is not yet public as we have finish the code. ##### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/{System_ID}/policies \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **systemId** | **string**| ObjectID of the System. | + **optional** | ***SystemsApiGraphSystemTraversePolicyOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a SystemsApiGraphSystemTraversePolicyOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **limit** | **optional.Int32**| The number of records to return at once. Limited to 100. | [default to 10] + **xOrgId** | **optional.String**| Organization identifier that can be obtained from console settings. | + **skip** | **optional.Int32**| The offset into the records to return. | [default to 0] + **filter** | [**optional.Interface of []string**](string.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | + +### Return type + +[**[]GraphObjectWithPaths**](GraphObjectWithPaths.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GraphSystemTraversePolicyGroup** +> []GraphObjectWithPaths GraphSystemTraversePolicyGroup(ctx, systemId, optional) +List the Policy Groups bound to a System + +This endpoint will return all Policy Groups bound to a System, either directly or indirectly essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this System to the corresponding Policy Group; this array represents all grouping and/or associations that would have to be removed to deprovision the Policy Group from this System. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/systems/{System_ID}/policygroups \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **systemId** | **string**| ObjectID of the System. | + **optional** | ***SystemsApiGraphSystemTraversePolicyGroupOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a SystemsApiGraphSystemTraversePolicyGroupOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **limit** | **optional.Int32**| The number of records to return at once. Limited to 100. | [default to 10] + **xOrgId** | **optional.String**| Organization identifier that can be obtained from console settings. | + **skip** | **optional.Int32**| The offset into the records to return. | [default to 0] + **date** | **optional.String**| Current date header for the System Context API | + **authorization** | **optional.String**| Authorization header for the System Context API | + **filter** | [**optional.Interface of []string**](string.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | + +### Return type + +[**[]GraphObjectWithPaths**](GraphObjectWithPaths.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GraphSystemTraverseUser** +> []GraphObjectWithPaths GraphSystemTraverseUser(ctx, systemId, optional) +List the Users bound to a System + +This endpoint will return all Users bound to a System, either directly or indirectly essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this System to the corresponding User; this array represents all grouping and/or associations that would have to be removed to deprovision the User from this System. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/systems/{System_ID}/users \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **systemId** | **string**| ObjectID of the System. | + **optional** | ***SystemsApiGraphSystemTraverseUserOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a SystemsApiGraphSystemTraverseUserOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **limit** | **optional.Int32**| The number of records to return at once. Limited to 100. | [default to 10] + **xOrgId** | **optional.String**| Organization identifier that can be obtained from console settings. | + **skip** | **optional.Int32**| The offset into the records to return. | [default to 0] + **date** | **optional.String**| Current date header for the System Context API | + **authorization** | **optional.String**| Authorization header for the System Context API | + **filter** | [**optional.Interface of []string**](string.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | + +### Return type + +[**[]GraphObjectWithPaths**](GraphObjectWithPaths.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GraphSystemTraverseUserGroup** +> []GraphObjectWithPaths GraphSystemTraverseUserGroup(ctx, systemId, optional) +List the User Groups bound to a System + +This endpoint will return all User Groups bound to a System, either directly or indirectly essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this System to the corresponding User Group; this array represents all grouping and/or associations that would have to be removed to deprovision the User Group from this System. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/systems/{System_ID}/usergroups \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **systemId** | **string**| ObjectID of the System. | + **optional** | ***SystemsApiGraphSystemTraverseUserGroupOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a SystemsApiGraphSystemTraverseUserGroupOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **limit** | **optional.Int32**| The number of records to return at once. Limited to 100. | [default to 10] + **xOrgId** | **optional.String**| Organization identifier that can be obtained from console settings. | + **skip** | **optional.Int32**| The offset into the records to return. | [default to 0] + **date** | **optional.String**| Current date header for the System Context API | + **authorization** | **optional.String**| Authorization header for the System Context API | + **filter** | [**optional.Interface of []string**](string.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | + +### Return type + +[**[]GraphObjectWithPaths**](GraphObjectWithPaths.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **SystemsGetFDEKey** +> Systemfdekey SystemsGetFDEKey(ctx, systemId, optional) +Get System FDE Key + +This endpoint will return the current (latest) fde key saved for a system. + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **systemId** | **string**| | + **optional** | ***SystemsApiSystemsGetFDEKeyOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a SystemsApiSystemsGetFDEKeyOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **xOrgId** | **optional.String**| Organization identifier that can be obtained from console settings. | + +### Return type + +[**Systemfdekey**](systemfdekey.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **SystemsListSoftwareAppsWithStatuses** +> []SoftwareAppWithStatus SystemsListSoftwareAppsWithStatuses(ctx, systemId, optional) +List the associated Software Application Statuses of a System + +This endpoint returns all the statuses of the associated Software Applications from the provided JumpCloud system ID. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/systems/{system_id}/softwareappstatuses \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **systemId** | **string**| ObjectID of the System. | + **optional** | ***SystemsApiSystemsListSoftwareAppsWithStatusesOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a SystemsApiSystemsListSoftwareAppsWithStatusesOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **xOrgId** | **optional.String**| Organization identifier that can be obtained from console settings. | + **filter** | [**optional.Interface of []string**](string.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | + **limit** | **optional.Int32**| The number of records to return at once. Limited to 100. | [default to 10] + **skip** | **optional.Int32**| The offset into the records to return. | [default to 0] + **sort** | [**optional.Interface of []string**](string.md)| The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. | + +### Return type + +[**[]SoftwareAppWithStatus**](software-app-with-status.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/TicketingIntegrationAlert.md b/jcapiv2/docs/TicketingIntegrationAlert.md new file mode 100644 index 0000000..3f671c9 --- /dev/null +++ b/jcapiv2/docs/TicketingIntegrationAlert.md @@ -0,0 +1,12 @@ +# TicketingIntegrationAlert + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Category** | **string** | | [optional] [default to null] +**Description** | **string** | | [optional] [default to null] +**Id** | **int32** | | [optional] [default to null] +**Name** | **string** | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/TicketingIntegrationAlertsResp.md b/jcapiv2/docs/TicketingIntegrationAlertsResp.md new file mode 100644 index 0000000..875c263 --- /dev/null +++ b/jcapiv2/docs/TicketingIntegrationAlertsResp.md @@ -0,0 +1,9 @@ +# TicketingIntegrationAlertsResp + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Records** | [**[]TicketingIntegrationAlert**](TicketingIntegrationAlert.md) | | [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/User.md b/jcapiv2/docs/User.md new file mode 100644 index 0000000..e94fe6d --- /dev/null +++ b/jcapiv2/docs/User.md @@ -0,0 +1,21 @@ +# User + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Addresses** | [**[]Address**](Address.md) | | [optional] [default to null] +**AlternateEmail** | **string** | | [optional] [default to null] +**Company** | **string** | | [optional] [default to null] +**CostCenter** | **string** | | [optional] [default to null] +**Department** | **string** | | [optional] [default to null] +**Email** | **string** | | [optional] [default to null] +**EmployeeIdentifier** | **string** | Must be unique per user. | [optional] [default to null] +**EmployeeType** | **string** | | [optional] [default to null] +**Firstname** | **string** | | [optional] [default to null] +**JobTitle** | **string** | | [optional] [default to null] +**Lastname** | **string** | | [optional] [default to null] +**Location** | **string** | | [optional] [default to null] +**PhoneNumbers** | [**[]PhoneNumber**](PhoneNumber.md) | | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/UserGroup.md b/jcapiv2/docs/UserGroup.md new file mode 100644 index 0000000..734541f --- /dev/null +++ b/jcapiv2/docs/UserGroup.md @@ -0,0 +1,19 @@ +# UserGroup + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Attributes** | [***GroupAttributesUserGroup**](GroupAttributes-UserGroup.md) | | [optional] [default to null] +**Description** | **string** | Description of a User Group | [optional] [default to null] +**Email** | **string** | Email address of a User Group | [optional] [default to null] +**Id** | **string** | ObjectId uniquely identifying a User Group. | [optional] [default to null] +**MemberQuery** | [***FilterQuery**](FilterQuery.md) | | [optional] [default to null] +**MemberQueryExemptions** | [**[]GraphObject**](GraphObject.md) | Array of GraphObjects exempted from the query | [optional] [default to null] +**MemberSuggestionsNotify** | **bool** | True if notification emails are to be sent for membership suggestions. | [optional] [default to null] +**MembershipAutomated** | **bool** | True if membership of this group is automatically updated based on the Member Query and Member Query Exemptions, if configured | [optional] [default to null] +**Name** | **string** | Display name of a User Group. | [optional] [default to null] +**SuggestionCounts** | [***SuggestionCounts**](SuggestionCounts.md) | | [optional] [default to null] +**Type_** | **string** | The type of the group. | [optional] [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/UserGroupAssociationsApi.md b/jcapiv2/docs/UserGroupAssociationsApi.md new file mode 100644 index 0000000..262b185 --- /dev/null +++ b/jcapiv2/docs/UserGroupAssociationsApi.md @@ -0,0 +1,446 @@ +# {{classname}} + +All URIs are relative to *https://console.jumpcloud.com/api/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**GraphUserGroupAssociationsList**](UserGroupAssociationsApi.md#GraphUserGroupAssociationsList) | **Get** /usergroups/{group_id}/associations | List the associations of a User Group. +[**GraphUserGroupAssociationsPost**](UserGroupAssociationsApi.md#GraphUserGroupAssociationsPost) | **Post** /usergroups/{group_id}/associations | Manage the associations of a User Group +[**GraphUserGroupTraverseActiveDirectory**](UserGroupAssociationsApi.md#GraphUserGroupTraverseActiveDirectory) | **Get** /usergroups/{group_id}/activedirectories | List the Active Directories bound to a User Group +[**GraphUserGroupTraverseApplication**](UserGroupAssociationsApi.md#GraphUserGroupTraverseApplication) | **Get** /usergroups/{group_id}/applications | List the Applications bound to a User Group +[**GraphUserGroupTraverseDirectory**](UserGroupAssociationsApi.md#GraphUserGroupTraverseDirectory) | **Get** /usergroups/{group_id}/directories | List the Directories bound to a User Group +[**GraphUserGroupTraverseGSuite**](UserGroupAssociationsApi.md#GraphUserGroupTraverseGSuite) | **Get** /usergroups/{group_id}/gsuites | List the G Suite instances bound to a User Group +[**GraphUserGroupTraverseLdapServer**](UserGroupAssociationsApi.md#GraphUserGroupTraverseLdapServer) | **Get** /usergroups/{group_id}/ldapservers | List the LDAP Servers bound to a User Group +[**GraphUserGroupTraverseOffice365**](UserGroupAssociationsApi.md#GraphUserGroupTraverseOffice365) | **Get** /usergroups/{group_id}/office365s | List the Office 365 instances bound to a User Group +[**GraphUserGroupTraverseRadiusServer**](UserGroupAssociationsApi.md#GraphUserGroupTraverseRadiusServer) | **Get** /usergroups/{group_id}/radiusservers | List the RADIUS Servers bound to a User Group +[**GraphUserGroupTraverseSystem**](UserGroupAssociationsApi.md#GraphUserGroupTraverseSystem) | **Get** /usergroups/{group_id}/systems | List the Systems bound to a User Group +[**GraphUserGroupTraverseSystemGroup**](UserGroupAssociationsApi.md#GraphUserGroupTraverseSystemGroup) | **Get** /usergroups/{group_id}/systemgroups | List the System Groups bound to User Groups + +# **GraphUserGroupAssociationsList** +> []GraphConnection GraphUserGroupAssociationsList(ctx, groupId, targets, optional) +List the associations of a User Group. + +This endpoint returns the _direct_ associations of this User Group. A direct association can be a non-homogeneous relationship between 2 different objects, for example User Groups and Users. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/usergroups/{GroupID}/associations?targets=system \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **groupId** | **string**| ObjectID of the User Group. | + **targets** | [**[]string**](string.md)| Targets which a \"user_group\" can be associated to. | + **optional** | ***UserGroupAssociationsApiGraphUserGroupAssociationsListOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a UserGroupAssociationsApiGraphUserGroupAssociationsListOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + **limit** | **optional.Int32**| The number of records to return at once. Limited to 100. | [default to 10] + **skip** | **optional.Int32**| The offset into the records to return. | [default to 0] + **xOrgId** | **optional.String**| Organization identifier that can be obtained from console settings. | + +### Return type + +[**[]GraphConnection**](GraphConnection.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GraphUserGroupAssociationsPost** +> GraphUserGroupAssociationsPost(ctx, groupId, optional) +Manage the associations of a User Group + +This endpoint manages the _direct_ associations of this User Group. A direct association can be a non-homogeneous relationship between 2 different objects, for example User Groups and Users. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/usergroups/{GroupID}/associations \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"op\": \"add\", \"type\": \"system\", \"id\": \"{SystemID}\" }' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **groupId** | **string**| ObjectID of the User Group. | + **optional** | ***UserGroupAssociationsApiGraphUserGroupAssociationsPostOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a UserGroupAssociationsApiGraphUserGroupAssociationsPostOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **body** | [**optional.Interface of GraphOperationUserGroup**](GraphOperationUserGroup.md)| | + **xOrgId** | **optional.**| Organization identifier that can be obtained from console settings. | + +### Return type + + (empty response body) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GraphUserGroupTraverseActiveDirectory** +> []GraphObjectWithPaths GraphUserGroupTraverseActiveDirectory(ctx, groupId, optional) +List the Active Directories bound to a User Group + +This endpoint will return all Active Directory Instances bound to a User Group, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this User Group to the corresponding Active Directory; this array represents all grouping and/or associations that would have to be removed to deprovision the Active Directory from this User Group. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/usergroups/{GroupID}/activedirectories \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **groupId** | **string**| ObjectID of the User Group. | + **optional** | ***UserGroupAssociationsApiGraphUserGroupTraverseActiveDirectoryOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a UserGroupAssociationsApiGraphUserGroupTraverseActiveDirectoryOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **limit** | **optional.Int32**| The number of records to return at once. Limited to 100. | [default to 10] + **xOrgId** | **optional.String**| Organization identifier that can be obtained from console settings. | + **skip** | **optional.Int32**| The offset into the records to return. | [default to 0] + **filter** | [**optional.Interface of []string**](string.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | + +### Return type + +[**[]GraphObjectWithPaths**](GraphObjectWithPaths.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GraphUserGroupTraverseApplication** +> []GraphObjectWithPaths GraphUserGroupTraverseApplication(ctx, groupId, optional) +List the Applications bound to a User Group + +This endpoint will return all Applications bound to a User Group, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this User Group to the corresponding Application; this array represents all grouping and/or associations that would have to be removed to deprovision the Application from this User Group. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/usergroups/{GroupID}/applications \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **groupId** | **string**| ObjectID of the User Group. | + **optional** | ***UserGroupAssociationsApiGraphUserGroupTraverseApplicationOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a UserGroupAssociationsApiGraphUserGroupTraverseApplicationOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **limit** | **optional.Int32**| The number of records to return at once. Limited to 100. | [default to 10] + **xOrgId** | **optional.String**| Organization identifier that can be obtained from console settings. | + **skip** | **optional.Int32**| The offset into the records to return. | [default to 0] + **filter** | [**optional.Interface of []string**](string.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | + +### Return type + +[**[]GraphObjectWithPaths**](GraphObjectWithPaths.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GraphUserGroupTraverseDirectory** +> []GraphObjectWithPaths GraphUserGroupTraverseDirectory(ctx, groupId, optional) +List the Directories bound to a User Group + +This endpoint will return all Directories bound to a User Group, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this User Group to the corresponding Directory; this array represents all grouping and/or associations that would have to be removed to deprovision the Directories from this User Group. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/usergroups/{GroupID}/directories \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **groupId** | **string**| ObjectID of the User Group. | + **optional** | ***UserGroupAssociationsApiGraphUserGroupTraverseDirectoryOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a UserGroupAssociationsApiGraphUserGroupTraverseDirectoryOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **limit** | **optional.Int32**| The number of records to return at once. Limited to 100. | [default to 10] + **xOrgId** | **optional.String**| Organization identifier that can be obtained from console settings. | + **skip** | **optional.Int32**| The offset into the records to return. | [default to 0] + **filter** | [**optional.Interface of []string**](string.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | + +### Return type + +[**[]GraphObjectWithPaths**](GraphObjectWithPaths.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GraphUserGroupTraverseGSuite** +> []GraphObjectWithPaths GraphUserGroupTraverseGSuite(ctx, groupId, optional) +List the G Suite instances bound to a User Group + +This endpoint will return all G Suite Instances bound to a User Group, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this User Group to the corresponding G Suite instance; this array represents all grouping and/or associations that would have to be removed to deprovision the G Suite instance from this User Group. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/usergroups/{GroupID/gsuites \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **groupId** | **string**| ObjectID of the User Group. | + **optional** | ***UserGroupAssociationsApiGraphUserGroupTraverseGSuiteOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a UserGroupAssociationsApiGraphUserGroupTraverseGSuiteOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **limit** | **optional.Int32**| The number of records to return at once. Limited to 100. | [default to 10] + **xOrgId** | **optional.String**| Organization identifier that can be obtained from console settings. | + **skip** | **optional.Int32**| The offset into the records to return. | [default to 0] + **filter** | [**optional.Interface of []string**](string.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | + +### Return type + +[**[]GraphObjectWithPaths**](GraphObjectWithPaths.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GraphUserGroupTraverseLdapServer** +> []GraphObjectWithPaths GraphUserGroupTraverseLdapServer(ctx, groupId, optional) +List the LDAP Servers bound to a User Group + +This endpoint will return all LDAP Servers bound to a User Group, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this User Group to the corresponding LDAP Server; this array represents all grouping and/or associations that would have to be removed to deprovision the LDAP Server from this User Group. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/usergroups/{GroupID}/ldapservers \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **groupId** | **string**| ObjectID of the User Group. | + **optional** | ***UserGroupAssociationsApiGraphUserGroupTraverseLdapServerOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a UserGroupAssociationsApiGraphUserGroupTraverseLdapServerOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **limit** | **optional.Int32**| The number of records to return at once. Limited to 100. | [default to 10] + **xOrgId** | **optional.String**| Organization identifier that can be obtained from console settings. | + **skip** | **optional.Int32**| The offset into the records to return. | [default to 0] + **filter** | [**optional.Interface of []string**](string.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | + +### Return type + +[**[]GraphObjectWithPaths**](GraphObjectWithPaths.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GraphUserGroupTraverseOffice365** +> []GraphObjectWithPaths GraphUserGroupTraverseOffice365(ctx, groupId, optional) +List the Office 365 instances bound to a User Group + +This endpoint will return all Office 365 instances bound to a User Group, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this User Group to the corresponding Office 365 instance; this array represents all grouping and/or associations that would have to be removed to deprovision the Office 365 instance from this User Group. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/usergroups/{GroupID}/office365s \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **groupId** | **string**| ObjectID of the User Group. | + **optional** | ***UserGroupAssociationsApiGraphUserGroupTraverseOffice365Opts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a UserGroupAssociationsApiGraphUserGroupTraverseOffice365Opts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **limit** | **optional.Int32**| The number of records to return at once. Limited to 100. | [default to 10] + **xOrgId** | **optional.String**| Organization identifier that can be obtained from console settings. | + **skip** | **optional.Int32**| The offset into the records to return. | [default to 0] + **filter** | [**optional.Interface of []string**](string.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | + +### Return type + +[**[]GraphObjectWithPaths**](GraphObjectWithPaths.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GraphUserGroupTraverseRadiusServer** +> []GraphObjectWithPaths GraphUserGroupTraverseRadiusServer(ctx, groupId, optional) +List the RADIUS Servers bound to a User Group + +This endpoint will return all RADIUS servers bound to a User Group, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this User Group to the corresponding RADIUS Server; this array represents all grouping and/or associations that would have to be removed to deprovision the RADIUS Server from this User Group. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/usergroups/{GroupID}/radiusservers \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **groupId** | **string**| ObjectID of the User Group. | + **optional** | ***UserGroupAssociationsApiGraphUserGroupTraverseRadiusServerOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a UserGroupAssociationsApiGraphUserGroupTraverseRadiusServerOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **limit** | **optional.Int32**| The number of records to return at once. Limited to 100. | [default to 10] + **xOrgId** | **optional.String**| Organization identifier that can be obtained from console settings. | + **skip** | **optional.Int32**| The offset into the records to return. | [default to 0] + **filter** | [**optional.Interface of []string**](string.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | + +### Return type + +[**[]GraphObjectWithPaths**](GraphObjectWithPaths.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GraphUserGroupTraverseSystem** +> []GraphObjectWithPaths GraphUserGroupTraverseSystem(ctx, groupId, optional) +List the Systems bound to a User Group + +This endpoint will return all Systems bound to a User Group, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this User Group to the corresponding System; this array represents all grouping and/or associations that would have to be removed to deprovision the System from this User Group. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/usergroups/{GroupID}/systems \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **groupId** | **string**| ObjectID of the User Group. | + **optional** | ***UserGroupAssociationsApiGraphUserGroupTraverseSystemOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a UserGroupAssociationsApiGraphUserGroupTraverseSystemOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **limit** | **optional.Int32**| The number of records to return at once. Limited to 100. | [default to 10] + **xOrgId** | **optional.String**| Organization identifier that can be obtained from console settings. | + **skip** | **optional.Int32**| The offset into the records to return. | [default to 0] + **filter** | [**optional.Interface of []string**](string.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | + +### Return type + +[**[]GraphObjectWithPaths**](GraphObjectWithPaths.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GraphUserGroupTraverseSystemGroup** +> []GraphObjectWithPaths GraphUserGroupTraverseSystemGroup(ctx, groupId, optional) +List the System Groups bound to User Groups + +This endpoint will return all System Groups bound to a User Group, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this User Group to the corresponding System Group; this array represents all grouping and/or associations that would have to be removed to deprovision the System Group from this User Group. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/usergroups/{GroupID}/systemgroups \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **groupId** | **string**| ObjectID of the User Group. | + **optional** | ***UserGroupAssociationsApiGraphUserGroupTraverseSystemGroupOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a UserGroupAssociationsApiGraphUserGroupTraverseSystemGroupOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **limit** | **optional.Int32**| The number of records to return at once. Limited to 100. | [default to 10] + **xOrgId** | **optional.String**| Organization identifier that can be obtained from console settings. | + **skip** | **optional.Int32**| The offset into the records to return. | [default to 0] + **filter** | [**optional.Interface of []string**](string.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | + +### Return type + +[**[]GraphObjectWithPaths**](GraphObjectWithPaths.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/UserGroupMembersMembershipApi.md b/jcapiv2/docs/UserGroupMembersMembershipApi.md new file mode 100644 index 0000000..c5b243d --- /dev/null +++ b/jcapiv2/docs/UserGroupMembersMembershipApi.md @@ -0,0 +1,125 @@ +# {{classname}} + +All URIs are relative to *https://console.jumpcloud.com/api/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**GraphUserGroupMembersList**](UserGroupMembersMembershipApi.md#GraphUserGroupMembersList) | **Get** /usergroups/{group_id}/members | List the members of a User Group +[**GraphUserGroupMembersPost**](UserGroupMembersMembershipApi.md#GraphUserGroupMembersPost) | **Post** /usergroups/{group_id}/members | Manage the members of a User Group +[**GraphUserGroupMembership**](UserGroupMembersMembershipApi.md#GraphUserGroupMembership) | **Get** /usergroups/{group_id}/membership | List the User Group's membership + +# **GraphUserGroupMembersList** +> []GraphConnection GraphUserGroupMembersList(ctx, groupId, optional) +List the members of a User Group + +This endpoint returns the user members of a User Group. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/usergroups/{GroupID}/members \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **groupId** | **string**| ObjectID of the User Group. | + **optional** | ***UserGroupMembersMembershipApiGraphUserGroupMembersListOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a UserGroupMembersMembershipApiGraphUserGroupMembersListOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **limit** | **optional.Int32**| The number of records to return at once. Limited to 100. | [default to 10] + **skip** | **optional.Int32**| The offset into the records to return. | [default to 0] + **xOrgId** | **optional.String**| Organization identifier that can be obtained from console settings. | + +### Return type + +[**[]GraphConnection**](GraphConnection.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GraphUserGroupMembersPost** +> GraphUserGroupMembersPost(ctx, groupId, optional) +Manage the members of a User Group + +This endpoint allows you to manage the user members of a User Group. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/usergroups/{GroupID}/members \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"op\": \"add\", \"type\": \"user\", \"id\": \"{User_ID}\" }' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **groupId** | **string**| ObjectID of the User Group. | + **optional** | ***UserGroupMembersMembershipApiGraphUserGroupMembersPostOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a UserGroupMembersMembershipApiGraphUserGroupMembersPostOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **body** | [**optional.Interface of GraphOperationUserGroupMember**](GraphOperationUserGroupMember.md)| | + **xOrgId** | **optional.**| Organization identifier that can be obtained from console settings. | + +### Return type + + (empty response body) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GraphUserGroupMembership** +> []GraphObjectWithPaths GraphUserGroupMembership(ctx, groupId, optional) +List the User Group's membership + +This endpoint returns all users members that are a member of this User Group. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/usergroups/{GroupID}/membership \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **groupId** | **string**| ObjectID of the User Group. | + **optional** | ***UserGroupMembersMembershipApiGraphUserGroupMembershipOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a UserGroupMembersMembershipApiGraphUserGroupMembershipOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **filter** | [**optional.Interface of []string**](string.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | + **limit** | **optional.Int32**| The number of records to return at once. Limited to 100. | [default to 10] + **skip** | **optional.Int32**| The offset into the records to return. | [default to 0] + **sort** | [**optional.Interface of []string**](string.md)| The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. | + **xOrgId** | **optional.String**| Organization identifier that can be obtained from console settings. | + +### Return type + +[**[]GraphObjectWithPaths**](GraphObjectWithPaths.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/UserGroupPost.md b/jcapiv2/docs/UserGroupPost.md new file mode 100644 index 0000000..8f5fd74 --- /dev/null +++ b/jcapiv2/docs/UserGroupPost.md @@ -0,0 +1,16 @@ +# UserGroupPost + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Attributes** | [***GroupAttributesUserGroup**](GroupAttributes-UserGroup.md) | | [optional] [default to null] +**Description** | **string** | Description of a User Group | [optional] [default to null] +**Email** | **string** | Email address of a User Group | [optional] [default to null] +**MemberQuery** | [***FilterQuery**](FilterQuery.md) | | [optional] [default to null] +**MemberQueryExemptions** | [**[]GraphObject**](GraphObject.md) | Array of GraphObjects exempted from the query | [optional] [default to null] +**MemberSuggestionsNotify** | **bool** | True if notification emails are to be sent for membership suggestions. | [optional] [default to null] +**MembershipAutomated** | **bool** | True if membership of this group is automatically updated based on the Member Query and Member Query Exemptions, if configured | [optional] [default to null] +**Name** | **string** | Display name of a User Group. | [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/UserGroupPut.md b/jcapiv2/docs/UserGroupPut.md new file mode 100644 index 0000000..b0fe0c4 --- /dev/null +++ b/jcapiv2/docs/UserGroupPut.md @@ -0,0 +1,16 @@ +# UserGroupPut + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**Attributes** | [***GroupAttributesUserGroup**](GroupAttributes-UserGroup.md) | | [optional] [default to null] +**Description** | **string** | Description of a User Group | [optional] [default to null] +**Email** | **string** | Email address of a User Group | [optional] [default to null] +**MemberQuery** | [***FilterQuery**](FilterQuery.md) | | [optional] [default to null] +**MemberQueryExemptions** | [**[]GraphObject**](GraphObject.md) | Array of GraphObjects exempted from the query | [optional] [default to null] +**MemberSuggestionsNotify** | **bool** | True if notification emails are to be sent for membership suggestions. | [optional] [default to null] +**MembershipAutomated** | **bool** | True if membership of this group is automatically updated based on the Member Query and Member Query Exemptions, if configured | [optional] [default to null] +**Name** | **string** | Display name of a User Group. | [default to null] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/UserGroupsApi.md b/jcapiv2/docs/UserGroupsApi.md new file mode 100644 index 0000000..ca2368c --- /dev/null +++ b/jcapiv2/docs/UserGroupsApi.md @@ -0,0 +1,830 @@ +# {{classname}} + +All URIs are relative to *https://console.jumpcloud.com/api/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**GraphUserGroupAssociationsList**](UserGroupsApi.md#GraphUserGroupAssociationsList) | **Get** /usergroups/{group_id}/associations | List the associations of a User Group. +[**GraphUserGroupAssociationsPost**](UserGroupsApi.md#GraphUserGroupAssociationsPost) | **Post** /usergroups/{group_id}/associations | Manage the associations of a User Group +[**GraphUserGroupMembersList**](UserGroupsApi.md#GraphUserGroupMembersList) | **Get** /usergroups/{group_id}/members | List the members of a User Group +[**GraphUserGroupMembersPost**](UserGroupsApi.md#GraphUserGroupMembersPost) | **Post** /usergroups/{group_id}/members | Manage the members of a User Group +[**GraphUserGroupMembership**](UserGroupsApi.md#GraphUserGroupMembership) | **Get** /usergroups/{group_id}/membership | List the User Group's membership +[**GraphUserGroupTraverseActiveDirectory**](UserGroupsApi.md#GraphUserGroupTraverseActiveDirectory) | **Get** /usergroups/{group_id}/activedirectories | List the Active Directories bound to a User Group +[**GraphUserGroupTraverseApplication**](UserGroupsApi.md#GraphUserGroupTraverseApplication) | **Get** /usergroups/{group_id}/applications | List the Applications bound to a User Group +[**GraphUserGroupTraverseDirectory**](UserGroupsApi.md#GraphUserGroupTraverseDirectory) | **Get** /usergroups/{group_id}/directories | List the Directories bound to a User Group +[**GraphUserGroupTraverseGSuite**](UserGroupsApi.md#GraphUserGroupTraverseGSuite) | **Get** /usergroups/{group_id}/gsuites | List the G Suite instances bound to a User Group +[**GraphUserGroupTraverseLdapServer**](UserGroupsApi.md#GraphUserGroupTraverseLdapServer) | **Get** /usergroups/{group_id}/ldapservers | List the LDAP Servers bound to a User Group +[**GraphUserGroupTraverseOffice365**](UserGroupsApi.md#GraphUserGroupTraverseOffice365) | **Get** /usergroups/{group_id}/office365s | List the Office 365 instances bound to a User Group +[**GraphUserGroupTraverseRadiusServer**](UserGroupsApi.md#GraphUserGroupTraverseRadiusServer) | **Get** /usergroups/{group_id}/radiusservers | List the RADIUS Servers bound to a User Group +[**GraphUserGroupTraverseSystem**](UserGroupsApi.md#GraphUserGroupTraverseSystem) | **Get** /usergroups/{group_id}/systems | List the Systems bound to a User Group +[**GraphUserGroupTraverseSystemGroup**](UserGroupsApi.md#GraphUserGroupTraverseSystemGroup) | **Get** /usergroups/{group_id}/systemgroups | List the System Groups bound to User Groups +[**GroupsSuggestionsGet**](UserGroupsApi.md#GroupsSuggestionsGet) | **Get** /usergroups/{group_id}/suggestions | List Suggestions for a User Group +[**GroupsSuggestionsPost**](UserGroupsApi.md#GroupsSuggestionsPost) | **Post** /usergroups/{group_id}/suggestions | List Suggestions for a User Group +[**GroupsUserDelete**](UserGroupsApi.md#GroupsUserDelete) | **Delete** /usergroups/{id} | Delete a User Group +[**GroupsUserGet**](UserGroupsApi.md#GroupsUserGet) | **Get** /usergroups/{id} | View an individual User Group details +[**GroupsUserList**](UserGroupsApi.md#GroupsUserList) | **Get** /usergroups | List all User Groups +[**GroupsUserPost**](UserGroupsApi.md#GroupsUserPost) | **Post** /usergroups | Create a new User Group +[**GroupsUserPut**](UserGroupsApi.md#GroupsUserPut) | **Put** /usergroups/{id} | Update a User Group + +# **GraphUserGroupAssociationsList** +> []GraphConnection GraphUserGroupAssociationsList(ctx, groupId, targets, optional) +List the associations of a User Group. + +This endpoint returns the _direct_ associations of this User Group. A direct association can be a non-homogeneous relationship between 2 different objects, for example User Groups and Users. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/usergroups/{GroupID}/associations?targets=system \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **groupId** | **string**| ObjectID of the User Group. | + **targets** | [**[]string**](string.md)| Targets which a \"user_group\" can be associated to. | + **optional** | ***UserGroupsApiGraphUserGroupAssociationsListOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a UserGroupsApiGraphUserGroupAssociationsListOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + **limit** | **optional.Int32**| The number of records to return at once. Limited to 100. | [default to 10] + **skip** | **optional.Int32**| The offset into the records to return. | [default to 0] + **xOrgId** | **optional.String**| Organization identifier that can be obtained from console settings. | + +### Return type + +[**[]GraphConnection**](GraphConnection.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GraphUserGroupAssociationsPost** +> GraphUserGroupAssociationsPost(ctx, groupId, optional) +Manage the associations of a User Group + +This endpoint manages the _direct_ associations of this User Group. A direct association can be a non-homogeneous relationship between 2 different objects, for example User Groups and Users. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/usergroups/{GroupID}/associations \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"op\": \"add\", \"type\": \"system\", \"id\": \"{SystemID}\" }' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **groupId** | **string**| ObjectID of the User Group. | + **optional** | ***UserGroupsApiGraphUserGroupAssociationsPostOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a UserGroupsApiGraphUserGroupAssociationsPostOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **body** | [**optional.Interface of GraphOperationUserGroup**](GraphOperationUserGroup.md)| | + **xOrgId** | **optional.**| Organization identifier that can be obtained from console settings. | + +### Return type + + (empty response body) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GraphUserGroupMembersList** +> []GraphConnection GraphUserGroupMembersList(ctx, groupId, optional) +List the members of a User Group + +This endpoint returns the user members of a User Group. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/usergroups/{GroupID}/members \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **groupId** | **string**| ObjectID of the User Group. | + **optional** | ***UserGroupsApiGraphUserGroupMembersListOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a UserGroupsApiGraphUserGroupMembersListOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **limit** | **optional.Int32**| The number of records to return at once. Limited to 100. | [default to 10] + **skip** | **optional.Int32**| The offset into the records to return. | [default to 0] + **xOrgId** | **optional.String**| Organization identifier that can be obtained from console settings. | + +### Return type + +[**[]GraphConnection**](GraphConnection.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GraphUserGroupMembersPost** +> GraphUserGroupMembersPost(ctx, groupId, optional) +Manage the members of a User Group + +This endpoint allows you to manage the user members of a User Group. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/usergroups/{GroupID}/members \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"op\": \"add\", \"type\": \"user\", \"id\": \"{User_ID}\" }' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **groupId** | **string**| ObjectID of the User Group. | + **optional** | ***UserGroupsApiGraphUserGroupMembersPostOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a UserGroupsApiGraphUserGroupMembersPostOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **body** | [**optional.Interface of GraphOperationUserGroupMember**](GraphOperationUserGroupMember.md)| | + **xOrgId** | **optional.**| Organization identifier that can be obtained from console settings. | + +### Return type + + (empty response body) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GraphUserGroupMembership** +> []GraphObjectWithPaths GraphUserGroupMembership(ctx, groupId, optional) +List the User Group's membership + +This endpoint returns all users members that are a member of this User Group. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/usergroups/{GroupID}/membership \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **groupId** | **string**| ObjectID of the User Group. | + **optional** | ***UserGroupsApiGraphUserGroupMembershipOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a UserGroupsApiGraphUserGroupMembershipOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **filter** | [**optional.Interface of []string**](string.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | + **limit** | **optional.Int32**| The number of records to return at once. Limited to 100. | [default to 10] + **skip** | **optional.Int32**| The offset into the records to return. | [default to 0] + **sort** | [**optional.Interface of []string**](string.md)| The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. | + **xOrgId** | **optional.String**| Organization identifier that can be obtained from console settings. | + +### Return type + +[**[]GraphObjectWithPaths**](GraphObjectWithPaths.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GraphUserGroupTraverseActiveDirectory** +> []GraphObjectWithPaths GraphUserGroupTraverseActiveDirectory(ctx, groupId, optional) +List the Active Directories bound to a User Group + +This endpoint will return all Active Directory Instances bound to a User Group, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this User Group to the corresponding Active Directory; this array represents all grouping and/or associations that would have to be removed to deprovision the Active Directory from this User Group. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/usergroups/{GroupID}/activedirectories \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **groupId** | **string**| ObjectID of the User Group. | + **optional** | ***UserGroupsApiGraphUserGroupTraverseActiveDirectoryOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a UserGroupsApiGraphUserGroupTraverseActiveDirectoryOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **limit** | **optional.Int32**| The number of records to return at once. Limited to 100. | [default to 10] + **xOrgId** | **optional.String**| Organization identifier that can be obtained from console settings. | + **skip** | **optional.Int32**| The offset into the records to return. | [default to 0] + **filter** | [**optional.Interface of []string**](string.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | + +### Return type + +[**[]GraphObjectWithPaths**](GraphObjectWithPaths.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GraphUserGroupTraverseApplication** +> []GraphObjectWithPaths GraphUserGroupTraverseApplication(ctx, groupId, optional) +List the Applications bound to a User Group + +This endpoint will return all Applications bound to a User Group, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this User Group to the corresponding Application; this array represents all grouping and/or associations that would have to be removed to deprovision the Application from this User Group. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/usergroups/{GroupID}/applications \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **groupId** | **string**| ObjectID of the User Group. | + **optional** | ***UserGroupsApiGraphUserGroupTraverseApplicationOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a UserGroupsApiGraphUserGroupTraverseApplicationOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **limit** | **optional.Int32**| The number of records to return at once. Limited to 100. | [default to 10] + **xOrgId** | **optional.String**| Organization identifier that can be obtained from console settings. | + **skip** | **optional.Int32**| The offset into the records to return. | [default to 0] + **filter** | [**optional.Interface of []string**](string.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | + +### Return type + +[**[]GraphObjectWithPaths**](GraphObjectWithPaths.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GraphUserGroupTraverseDirectory** +> []GraphObjectWithPaths GraphUserGroupTraverseDirectory(ctx, groupId, optional) +List the Directories bound to a User Group + +This endpoint will return all Directories bound to a User Group, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this User Group to the corresponding Directory; this array represents all grouping and/or associations that would have to be removed to deprovision the Directories from this User Group. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/usergroups/{GroupID}/directories \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **groupId** | **string**| ObjectID of the User Group. | + **optional** | ***UserGroupsApiGraphUserGroupTraverseDirectoryOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a UserGroupsApiGraphUserGroupTraverseDirectoryOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **limit** | **optional.Int32**| The number of records to return at once. Limited to 100. | [default to 10] + **xOrgId** | **optional.String**| Organization identifier that can be obtained from console settings. | + **skip** | **optional.Int32**| The offset into the records to return. | [default to 0] + **filter** | [**optional.Interface of []string**](string.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | + +### Return type + +[**[]GraphObjectWithPaths**](GraphObjectWithPaths.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GraphUserGroupTraverseGSuite** +> []GraphObjectWithPaths GraphUserGroupTraverseGSuite(ctx, groupId, optional) +List the G Suite instances bound to a User Group + +This endpoint will return all G Suite Instances bound to a User Group, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this User Group to the corresponding G Suite instance; this array represents all grouping and/or associations that would have to be removed to deprovision the G Suite instance from this User Group. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/usergroups/{GroupID/gsuites \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **groupId** | **string**| ObjectID of the User Group. | + **optional** | ***UserGroupsApiGraphUserGroupTraverseGSuiteOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a UserGroupsApiGraphUserGroupTraverseGSuiteOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **limit** | **optional.Int32**| The number of records to return at once. Limited to 100. | [default to 10] + **xOrgId** | **optional.String**| Organization identifier that can be obtained from console settings. | + **skip** | **optional.Int32**| The offset into the records to return. | [default to 0] + **filter** | [**optional.Interface of []string**](string.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | + +### Return type + +[**[]GraphObjectWithPaths**](GraphObjectWithPaths.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GraphUserGroupTraverseLdapServer** +> []GraphObjectWithPaths GraphUserGroupTraverseLdapServer(ctx, groupId, optional) +List the LDAP Servers bound to a User Group + +This endpoint will return all LDAP Servers bound to a User Group, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this User Group to the corresponding LDAP Server; this array represents all grouping and/or associations that would have to be removed to deprovision the LDAP Server from this User Group. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/usergroups/{GroupID}/ldapservers \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **groupId** | **string**| ObjectID of the User Group. | + **optional** | ***UserGroupsApiGraphUserGroupTraverseLdapServerOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a UserGroupsApiGraphUserGroupTraverseLdapServerOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **limit** | **optional.Int32**| The number of records to return at once. Limited to 100. | [default to 10] + **xOrgId** | **optional.String**| Organization identifier that can be obtained from console settings. | + **skip** | **optional.Int32**| The offset into the records to return. | [default to 0] + **filter** | [**optional.Interface of []string**](string.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | + +### Return type + +[**[]GraphObjectWithPaths**](GraphObjectWithPaths.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GraphUserGroupTraverseOffice365** +> []GraphObjectWithPaths GraphUserGroupTraverseOffice365(ctx, groupId, optional) +List the Office 365 instances bound to a User Group + +This endpoint will return all Office 365 instances bound to a User Group, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this User Group to the corresponding Office 365 instance; this array represents all grouping and/or associations that would have to be removed to deprovision the Office 365 instance from this User Group. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/usergroups/{GroupID}/office365s \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **groupId** | **string**| ObjectID of the User Group. | + **optional** | ***UserGroupsApiGraphUserGroupTraverseOffice365Opts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a UserGroupsApiGraphUserGroupTraverseOffice365Opts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **limit** | **optional.Int32**| The number of records to return at once. Limited to 100. | [default to 10] + **xOrgId** | **optional.String**| Organization identifier that can be obtained from console settings. | + **skip** | **optional.Int32**| The offset into the records to return. | [default to 0] + **filter** | [**optional.Interface of []string**](string.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | + +### Return type + +[**[]GraphObjectWithPaths**](GraphObjectWithPaths.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GraphUserGroupTraverseRadiusServer** +> []GraphObjectWithPaths GraphUserGroupTraverseRadiusServer(ctx, groupId, optional) +List the RADIUS Servers bound to a User Group + +This endpoint will return all RADIUS servers bound to a User Group, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this User Group to the corresponding RADIUS Server; this array represents all grouping and/or associations that would have to be removed to deprovision the RADIUS Server from this User Group. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/usergroups/{GroupID}/radiusservers \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **groupId** | **string**| ObjectID of the User Group. | + **optional** | ***UserGroupsApiGraphUserGroupTraverseRadiusServerOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a UserGroupsApiGraphUserGroupTraverseRadiusServerOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **limit** | **optional.Int32**| The number of records to return at once. Limited to 100. | [default to 10] + **xOrgId** | **optional.String**| Organization identifier that can be obtained from console settings. | + **skip** | **optional.Int32**| The offset into the records to return. | [default to 0] + **filter** | [**optional.Interface of []string**](string.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | + +### Return type + +[**[]GraphObjectWithPaths**](GraphObjectWithPaths.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GraphUserGroupTraverseSystem** +> []GraphObjectWithPaths GraphUserGroupTraverseSystem(ctx, groupId, optional) +List the Systems bound to a User Group + +This endpoint will return all Systems bound to a User Group, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this User Group to the corresponding System; this array represents all grouping and/or associations that would have to be removed to deprovision the System from this User Group. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/usergroups/{GroupID}/systems \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **groupId** | **string**| ObjectID of the User Group. | + **optional** | ***UserGroupsApiGraphUserGroupTraverseSystemOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a UserGroupsApiGraphUserGroupTraverseSystemOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **limit** | **optional.Int32**| The number of records to return at once. Limited to 100. | [default to 10] + **xOrgId** | **optional.String**| Organization identifier that can be obtained from console settings. | + **skip** | **optional.Int32**| The offset into the records to return. | [default to 0] + **filter** | [**optional.Interface of []string**](string.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | + +### Return type + +[**[]GraphObjectWithPaths**](GraphObjectWithPaths.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GraphUserGroupTraverseSystemGroup** +> []GraphObjectWithPaths GraphUserGroupTraverseSystemGroup(ctx, groupId, optional) +List the System Groups bound to User Groups + +This endpoint will return all System Groups bound to a User Group, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this User Group to the corresponding System Group; this array represents all grouping and/or associations that would have to be removed to deprovision the System Group from this User Group. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/usergroups/{GroupID}/systemgroups \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **groupId** | **string**| ObjectID of the User Group. | + **optional** | ***UserGroupsApiGraphUserGroupTraverseSystemGroupOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a UserGroupsApiGraphUserGroupTraverseSystemGroupOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **limit** | **optional.Int32**| The number of records to return at once. Limited to 100. | [default to 10] + **xOrgId** | **optional.String**| Organization identifier that can be obtained from console settings. | + **skip** | **optional.Int32**| The offset into the records to return. | [default to 0] + **filter** | [**optional.Interface of []string**](string.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | + +### Return type + +[**[]GraphObjectWithPaths**](GraphObjectWithPaths.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GroupsSuggestionsGet** +> []MemberSuggestion GroupsSuggestionsGet(ctx, groupId, optional) +List Suggestions for a User Group + +This endpoint returns available suggestions for a given group #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/usergroups/{GroupID}/suggestions \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **groupId** | **string**| ID of the group | + **optional** | ***UserGroupsApiGroupsSuggestionsGetOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a UserGroupsApiGroupsSuggestionsGetOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **xOrgId** | **optional.String**| Organization identifier that can be obtained from console settings. | + **limit** | **optional.Int32**| The number of records to return at once. Limited to 100. | [default to 10] + **skip** | **optional.Int32**| The offset into the records to return. | [default to 0] + +### Return type + +[**[]MemberSuggestion**](MemberSuggestion.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GroupsSuggestionsPost** +> interface{} GroupsSuggestionsPost(ctx, body, groupId, optional) +List Suggestions for a User Group + +This endpoint applies the suggestions for the specified user group. #### Sample Request ``` curl -X PUT https://console.jumpcloud.com/api/v2/usergroups/{GroupID}/suggestions \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"user_ids\": [\"212345678901234567890123\", \"123456789012345678901234\"] }' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **body** | [**GroupIdSuggestionsBody**](GroupIdSuggestionsBody.md)| | + **groupId** | **string**| ID of the group | + **optional** | ***UserGroupsApiGroupsSuggestionsPostOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a UserGroupsApiGroupsSuggestionsPostOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + **xOrgId** | **optional.**| Organization identifier that can be obtained from console settings. | + +### Return type + +[**interface{}**](interface{}.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GroupsUserDelete** +> UserGroup GroupsUserDelete(ctx, id, optional) +Delete a User Group + +This endpoint allows you to delete a User Group. #### Sample Request ``` curl -X DELETE https://console.jumpcloud.com/api/v2/usergroups/{GroupID} \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **id** | **string**| ObjectID of the User Group. | + **optional** | ***UserGroupsApiGroupsUserDeleteOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a UserGroupsApiGroupsUserDeleteOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **xOrgId** | **optional.String**| Organization identifier that can be obtained from console settings. | + +### Return type + +[**UserGroup**](UserGroup.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GroupsUserGet** +> UserGroup GroupsUserGet(ctx, id, optional) +View an individual User Group details + +This endpoint returns the details of a User Group. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/usergroups/{GroupID} \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **id** | **string**| ObjectID of the User Group. | + **optional** | ***UserGroupsApiGroupsUserGetOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a UserGroupsApiGroupsUserGetOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **xOrgId** | **optional.String**| Organization identifier that can be obtained from console settings. | + +### Return type + +[**UserGroup**](UserGroup.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GroupsUserList** +> []UserGroup GroupsUserList(ctx, optional) +List all User Groups + +This endpoint returns all User Groups. Available filter fields: - `name` - `disabled` - `type` - `suggestionCounts.add` - `suggestionCounts.remove` - `suggestionCounts.total` - `attributes.sudo.enabled` - `attributes.sudo.withoutPassword` #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/usergroups \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **optional** | ***UserGroupsApiGroupsUserListOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a UserGroupsApiGroupsUserListOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **fields** | [**optional.Interface of []string**](string.md)| The comma separated fields included in the returned records. If omitted, the default list of fields will be returned. | + **filter** | [**optional.Interface of []string**](string.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | + **limit** | **optional.Int32**| The number of records to return at once. Limited to 100. | [default to 10] + **skip** | **optional.Int32**| The offset into the records to return. | [default to 0] + **sort** | [**optional.Interface of []string**](string.md)| The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. | + **xOrgId** | **optional.String**| Organization identifier that can be obtained from console settings. | + +### Return type + +[**[]UserGroup**](UserGroup.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GroupsUserPost** +> UserGroup GroupsUserPost(ctx, optional) +Create a new User Group + +This endpoint allows you to create a new User Group. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/usergroups \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"name\": \"{Group_Name}\" }' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **optional** | ***UserGroupsApiGroupsUserPostOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a UserGroupsApiGroupsUserPostOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**optional.Interface of UserGroupPost**](UserGroupPost.md)| | + **xOrgId** | **optional.**| Organization identifier that can be obtained from console settings. | + +### Return type + +[**UserGroup**](UserGroup.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GroupsUserPut** +> UserGroup GroupsUserPut(ctx, id, optional) +Update a User Group + +This endpoint allows you to do a full update of the User Group. #### Sample Request ``` curl -X PUT https://console.jumpcloud.com/api/v2/usergroups/{Group_ID} \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"name\": \"group_update\" }' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **id** | **string**| ObjectID of the User Group. | + **optional** | ***UserGroupsApiGroupsUserPutOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a UserGroupsApiGroupsUserPutOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **body** | [**optional.Interface of UserGroupPut**](UserGroupPut.md)| | + **xOrgId** | **optional.**| Organization identifier that can be obtained from console settings. | + +### Return type + +[**UserGroup**](UserGroup.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/jcapiv2/docs/UsersApi.md b/jcapiv2/docs/UsersApi.md new file mode 100644 index 0000000..fc10e1e --- /dev/null +++ b/jcapiv2/docs/UsersApi.md @@ -0,0 +1,642 @@ +# {{classname}} + +All URIs are relative to *https://console.jumpcloud.com/api/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**GraphUserAssociationsList**](UsersApi.md#GraphUserAssociationsList) | **Get** /users/{user_id}/associations | List the associations of a User +[**GraphUserAssociationsPost**](UsersApi.md#GraphUserAssociationsPost) | **Post** /users/{user_id}/associations | Manage the associations of a User +[**GraphUserMemberOf**](UsersApi.md#GraphUserMemberOf) | **Get** /users/{user_id}/memberof | List the parent Groups of a User +[**GraphUserTraverseActiveDirectory**](UsersApi.md#GraphUserTraverseActiveDirectory) | **Get** /users/{user_id}/activedirectories | List the Active Directory instances bound to a User +[**GraphUserTraverseApplication**](UsersApi.md#GraphUserTraverseApplication) | **Get** /users/{user_id}/applications | List the Applications bound to a User +[**GraphUserTraverseDirectory**](UsersApi.md#GraphUserTraverseDirectory) | **Get** /users/{user_id}/directories | List the Directories bound to a User +[**GraphUserTraverseGSuite**](UsersApi.md#GraphUserTraverseGSuite) | **Get** /users/{user_id}/gsuites | List the G Suite instances bound to a User +[**GraphUserTraverseLdapServer**](UsersApi.md#GraphUserTraverseLdapServer) | **Get** /users/{user_id}/ldapservers | List the LDAP servers bound to a User +[**GraphUserTraverseOffice365**](UsersApi.md#GraphUserTraverseOffice365) | **Get** /users/{user_id}/office365s | List the Office 365 instances bound to a User +[**GraphUserTraverseRadiusServer**](UsersApi.md#GraphUserTraverseRadiusServer) | **Get** /users/{user_id}/radiusservers | List the RADIUS Servers bound to a User +[**GraphUserTraverseSystem**](UsersApi.md#GraphUserTraverseSystem) | **Get** /users/{user_id}/systems | List the Systems bound to a User +[**GraphUserTraverseSystemGroup**](UsersApi.md#GraphUserTraverseSystemGroup) | **Get** /users/{user_id}/systemgroups | List the System Groups bound to a User +[**PushEndpointsDelete**](UsersApi.md#PushEndpointsDelete) | **Delete** /users/{user_id}/pushendpoints/{push_endpoint_id} | Delete a Push Endpoint associated with a User +[**PushEndpointsGet**](UsersApi.md#PushEndpointsGet) | **Get** /users/{user_id}/pushendpoints/{push_endpoint_id} | Get a push endpoint associated with a User +[**PushEndpointsList**](UsersApi.md#PushEndpointsList) | **Get** /users/{user_id}/pushendpoints | List Push Endpoints associated with a User +[**PushEndpointsPatch**](UsersApi.md#PushEndpointsPatch) | **Patch** /users/{user_id}/pushendpoints/{push_endpoint_id} | Update a push endpoint associated with a User + +# **GraphUserAssociationsList** +> []GraphConnection GraphUserAssociationsList(ctx, userId, targets, optional) +List the associations of a User + +This endpoint returns the _direct_ associations of a User. A direct association can be a non-homogeneous relationship between 2 different objects, for example Users and Systems. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/users/{UserID}/associations?targets=system_group \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **userId** | **string**| ObjectID of the User. | + **targets** | [**[]string**](string.md)| Targets which a \"user\" can be associated to. | + **optional** | ***UsersApiGraphUserAssociationsListOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a UsersApiGraphUserAssociationsListOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + **limit** | **optional.Int32**| The number of records to return at once. Limited to 100. | [default to 10] + **skip** | **optional.Int32**| The offset into the records to return. | [default to 0] + **xOrgId** | **optional.String**| Organization identifier that can be obtained from console settings. | + +### Return type + +[**[]GraphConnection**](GraphConnection.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GraphUserAssociationsPost** +> GraphUserAssociationsPost(ctx, userId, optional) +Manage the associations of a User + +This endpoint allows you to manage the _direct_ associations of a User. A direct association can be a non-homogeneous relationship between 2 different objects, for example Users and Systems. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/users/{UserID}/associations \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"attributes\": { \"sudo\": { \"enabled\": true, \"withoutPassword\": false } }, \"op\": \"add\", \"type\": \"system_group\", \"id\": \"{GroupID}\" }' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **userId** | **string**| ObjectID of the User. | + **optional** | ***UsersApiGraphUserAssociationsPostOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a UsersApiGraphUserAssociationsPostOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **body** | [**optional.Interface of GraphOperationUser**](GraphOperationUser.md)| | + **xOrgId** | **optional.**| Organization identifier that can be obtained from console settings. | + +### Return type + + (empty response body) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GraphUserMemberOf** +> []GraphObjectWithPaths GraphUserMemberOf(ctx, userId, optional) +List the parent Groups of a User + +This endpoint returns all the User Groups a User is a member of. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/users/{UserID}/memberof \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **userId** | **string**| ObjectID of the User. | + **optional** | ***UsersApiGraphUserMemberOfOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a UsersApiGraphUserMemberOfOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **filter** | [**optional.Interface of []string**](string.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | + **limit** | **optional.Int32**| The number of records to return at once. Limited to 100. | [default to 10] + **skip** | **optional.Int32**| The offset into the records to return. | [default to 0] + **sort** | [**optional.Interface of []string**](string.md)| The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. | + **xOrgId** | **optional.String**| Organization identifier that can be obtained from console settings. | + +### Return type + +[**[]GraphObjectWithPaths**](GraphObjectWithPaths.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GraphUserTraverseActiveDirectory** +> []GraphObjectWithPaths GraphUserTraverseActiveDirectory(ctx, userId, optional) +List the Active Directory instances bound to a User + +This endpoint will return all Active Directory Instances bound to a User, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this User to the corresponding Active Directory instance; this array represents all grouping and/or associations that would have to be removed to deprovision the Active Directory instance from this User. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/users/{UserID}/activedirectories \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **userId** | **string**| ObjectID of the User. | + **optional** | ***UsersApiGraphUserTraverseActiveDirectoryOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a UsersApiGraphUserTraverseActiveDirectoryOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **filter** | [**optional.Interface of []string**](string.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | + **limit** | **optional.Int32**| The number of records to return at once. Limited to 100. | [default to 10] + **xOrgId** | **optional.String**| Organization identifier that can be obtained from console settings. | + **skip** | **optional.Int32**| The offset into the records to return. | [default to 0] + +### Return type + +[**[]GraphObjectWithPaths**](GraphObjectWithPaths.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GraphUserTraverseApplication** +> []GraphObjectWithPaths GraphUserTraverseApplication(ctx, userId, optional) +List the Applications bound to a User + +This endpoint will return all Applications bound to a User, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this User to the corresponding Application; this array represents all grouping and/or associations that would have to be removed to deprovision the Application from this User. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/users/{UserID}/applications \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **userId** | **string**| ObjectID of the User. | + **optional** | ***UsersApiGraphUserTraverseApplicationOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a UsersApiGraphUserTraverseApplicationOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **limit** | **optional.Int32**| The number of records to return at once. Limited to 100. | [default to 10] + **xOrgId** | **optional.String**| Organization identifier that can be obtained from console settings. | + **skip** | **optional.Int32**| The offset into the records to return. | [default to 0] + **filter** | [**optional.Interface of []string**](string.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | + +### Return type + +[**[]GraphObjectWithPaths**](GraphObjectWithPaths.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GraphUserTraverseDirectory** +> []GraphObjectWithPaths GraphUserTraverseDirectory(ctx, userId, optional) +List the Directories bound to a User + +This endpoint will return all Directories bound to a User, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this User to the corresponding Directory; this array represents all grouping and/or associations that would have to be removed to deprovision the Directory from this User. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/users/{UserID}/directories \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **userId** | **string**| ObjectID of the User. | + **optional** | ***UsersApiGraphUserTraverseDirectoryOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a UsersApiGraphUserTraverseDirectoryOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **limit** | **optional.Int32**| The number of records to return at once. Limited to 100. | [default to 10] + **xOrgId** | **optional.String**| Organization identifier that can be obtained from console settings. | + **skip** | **optional.Int32**| The offset into the records to return. | [default to 0] + **filter** | [**optional.Interface of []string**](string.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | + +### Return type + +[**[]GraphObjectWithPaths**](GraphObjectWithPaths.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GraphUserTraverseGSuite** +> []GraphObjectWithPaths GraphUserTraverseGSuite(ctx, userId, optional) +List the G Suite instances bound to a User + +This endpoint will return all G-Suite Instances bound to a User, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this User to the corresponding G Suite instance; this array represents all grouping and/or associations that would have to be removed to deprovision the G Suite instance from this User. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/users/{UserID}/gsuites \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **userId** | **string**| ObjectID of the User. | + **optional** | ***UsersApiGraphUserTraverseGSuiteOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a UsersApiGraphUserTraverseGSuiteOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **limit** | **optional.Int32**| The number of records to return at once. Limited to 100. | [default to 10] + **xOrgId** | **optional.String**| Organization identifier that can be obtained from console settings. | + **skip** | **optional.Int32**| The offset into the records to return. | [default to 0] + **filter** | [**optional.Interface of []string**](string.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | + +### Return type + +[**[]GraphObjectWithPaths**](GraphObjectWithPaths.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GraphUserTraverseLdapServer** +> []GraphObjectWithPaths GraphUserTraverseLdapServer(ctx, userId, optional) +List the LDAP servers bound to a User + +This endpoint will return all LDAP Servers bound to a User, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this User to the corresponding LDAP Server; this array represents all grouping and/or associations that would have to be removed to deprovision the LDAP Server from this User. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/users/{UserID}/ldapservers \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **userId** | **string**| ObjectID of the User. | + **optional** | ***UsersApiGraphUserTraverseLdapServerOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a UsersApiGraphUserTraverseLdapServerOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **limit** | **optional.Int32**| The number of records to return at once. Limited to 100. | [default to 10] + **xOrgId** | **optional.String**| Organization identifier that can be obtained from console settings. | + **skip** | **optional.Int32**| The offset into the records to return. | [default to 0] + **filter** | [**optional.Interface of []string**](string.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | + +### Return type + +[**[]GraphObjectWithPaths**](GraphObjectWithPaths.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GraphUserTraverseOffice365** +> []GraphObjectWithPaths GraphUserTraverseOffice365(ctx, userId, optional) +List the Office 365 instances bound to a User + +This endpoint will return all Office 365 Instances bound to a User, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this User to the corresponding Office 365 instance; this array represents all grouping and/or associations that would have to be removed to deprovision the Office 365 instance from this User. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/users/{UserID}/office365s \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **userId** | **string**| ObjectID of the User. | + **optional** | ***UsersApiGraphUserTraverseOffice365Opts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a UsersApiGraphUserTraverseOffice365Opts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **limit** | **optional.Int32**| The number of records to return at once. Limited to 100. | [default to 10] + **xOrgId** | **optional.String**| Organization identifier that can be obtained from console settings. | + **skip** | **optional.Int32**| The offset into the records to return. | [default to 0] + **filter** | [**optional.Interface of []string**](string.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | + +### Return type + +[**[]GraphObjectWithPaths**](GraphObjectWithPaths.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GraphUserTraverseRadiusServer** +> []GraphObjectWithPaths GraphUserTraverseRadiusServer(ctx, userId, optional) +List the RADIUS Servers bound to a User + +This endpoint will return all RADIUS Servers bound to a User, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this User to the corresponding RADIUS Server; this array represents all grouping and/or associations that would have to be removed to deprovision the RADIUS Server from this User. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/users/{UserID}/radiusservers \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **userId** | **string**| ObjectID of the User. | + **optional** | ***UsersApiGraphUserTraverseRadiusServerOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a UsersApiGraphUserTraverseRadiusServerOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **limit** | **optional.Int32**| The number of records to return at once. Limited to 100. | [default to 10] + **xOrgId** | **optional.String**| Organization identifier that can be obtained from console settings. | + **skip** | **optional.Int32**| The offset into the records to return. | [default to 0] + **filter** | [**optional.Interface of []string**](string.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | + +### Return type + +[**[]GraphObjectWithPaths**](GraphObjectWithPaths.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GraphUserTraverseSystem** +> []GraphObjectWithPaths GraphUserTraverseSystem(ctx, userId, optional) +List the Systems bound to a User + +This endpoint will return all Systems bound to a User, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this User to the corresponding System; this array represents all grouping and/or associations that would have to be removed to deprovision the System from this User. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/users/{UserID}/systems\\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **userId** | **string**| ObjectID of the User. | + **optional** | ***UsersApiGraphUserTraverseSystemOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a UsersApiGraphUserTraverseSystemOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **limit** | **optional.Int32**| The number of records to return at once. Limited to 100. | [default to 10] + **xOrgId** | **optional.String**| Organization identifier that can be obtained from console settings. | + **skip** | **optional.Int32**| The offset into the records to return. | [default to 0] + **filter** | [**optional.Interface of []string**](string.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | + +### Return type + +[**[]GraphObjectWithPaths**](GraphObjectWithPaths.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **GraphUserTraverseSystemGroup** +> []GraphObjectWithPaths GraphUserTraverseSystemGroup(ctx, userId, optional) +List the System Groups bound to a User + +This endpoint will return all System Groups bound to a User, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this User to the corresponding System Group; this array represents all grouping and/or associations that would have to be removed to deprovision the System Group from this User. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/users/{UserID}/systemgroups\\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **userId** | **string**| ObjectID of the User. | + **optional** | ***UsersApiGraphUserTraverseSystemGroupOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a UsersApiGraphUserTraverseSystemGroupOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **limit** | **optional.Int32**| The number of records to return at once. Limited to 100. | [default to 10] + **xOrgId** | **optional.String**| Organization identifier that can be obtained from console settings. | + **skip** | **optional.Int32**| The offset into the records to return. | [default to 0] + **filter** | [**optional.Interface of []string**](string.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | + +### Return type + +[**[]GraphObjectWithPaths**](GraphObjectWithPaths.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **PushEndpointsDelete** +> PushEndpointResponse PushEndpointsDelete(ctx, userId, pushEndpointId, optional) +Delete a Push Endpoint associated with a User + +This endpoint will delete a push endpoint associated with a user. + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **userId** | **string**| | + **pushEndpointId** | **string**| | + **optional** | ***UsersApiPushEndpointsDeleteOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a UsersApiPushEndpointsDeleteOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + **xOrgId** | **optional.String**| Organization identifier that can be obtained from console settings. | + +### Return type + +[**PushEndpointResponse**](PushEndpointResponse.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **PushEndpointsGet** +> PushEndpointResponse PushEndpointsGet(ctx, userId, pushEndpointId, optional) +Get a push endpoint associated with a User + +This endpoint will retrieve a push endpoint associated with a user. + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **userId** | **string**| | + **pushEndpointId** | **string**| | + **optional** | ***UsersApiPushEndpointsGetOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a UsersApiPushEndpointsGetOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + **xOrgId** | **optional.String**| Organization identifier that can be obtained from console settings. | + +### Return type + +[**PushEndpointResponse**](PushEndpointResponse.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **PushEndpointsList** +> []PushEndpointResponse PushEndpointsList(ctx, userId, optional) +List Push Endpoints associated with a User + +This endpoint returns the list of push endpoints associated with a user. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/users/{UserID}/pushendpoints \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: ${API_KEY}' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **userId** | **string**| | + **optional** | ***UsersApiPushEndpointsListOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a UsersApiPushEndpointsListOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **xOrgId** | **optional.String**| Organization identifier that can be obtained from console settings. | + +### Return type + +[**[]PushEndpointResponse**](PushEndpointResponse.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **PushEndpointsPatch** +> PushEndpointResponse PushEndpointsPatch(ctx, userId, pushEndpointId, optional) +Update a push endpoint associated with a User + +This endpoint will update a push endpoint associated with a user. + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **userId** | **string**| | + **pushEndpointId** | **string**| | + **optional** | ***UsersApiPushEndpointsPatchOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a UsersApiPushEndpointsPatchOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + **body** | [**optional.Interface of PushendpointsPushEndpointIdBody**](PushendpointsPushEndpointIdBody.md)| | + **xOrgId** | **optional.**| Organization identifier that can be obtained from console settings. | + +### Return type + +[**PushEndpointResponse**](PushEndpointResponse.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/v2/docs/WorkdayFields.md b/jcapiv2/docs/WorkdayFields.md similarity index 99% rename from v2/docs/WorkdayFields.md rename to jcapiv2/docs/WorkdayFields.md index 75e0b58..da34541 100644 --- a/v2/docs/WorkdayFields.md +++ b/jcapiv2/docs/WorkdayFields.md @@ -8,4 +8,3 @@ Name | Type | Description | Notes [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/jcapiv2/docs/WorkdayImportApi.md b/jcapiv2/docs/WorkdayImportApi.md new file mode 100644 index 0000000..66c7488 --- /dev/null +++ b/jcapiv2/docs/WorkdayImportApi.md @@ -0,0 +1,352 @@ +# {{classname}} + +All URIs are relative to *https://console.jumpcloud.com/api/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**WorkdaysAuthorize**](WorkdayImportApi.md#WorkdaysAuthorize) | **Post** /workdays/{workday_id}/auth | Authorize Workday +[**WorkdaysDeauthorize**](WorkdayImportApi.md#WorkdaysDeauthorize) | **Delete** /workdays/{workday_id}/auth | Deauthorize Workday +[**WorkdaysGet**](WorkdayImportApi.md#WorkdaysGet) | **Get** /workdays/{id} | Get Workday +[**WorkdaysImport**](WorkdayImportApi.md#WorkdaysImport) | **Post** /workdays/{workday_id}/import | Workday Import +[**WorkdaysImportresults**](WorkdayImportApi.md#WorkdaysImportresults) | **Get** /workdays/{id}/import/{job_id}/results | List Import Results +[**WorkdaysList**](WorkdayImportApi.md#WorkdaysList) | **Get** /workdays | List Workdays +[**WorkdaysPost**](WorkdayImportApi.md#WorkdaysPost) | **Post** /workdays | Create new Workday +[**WorkdaysPut**](WorkdayImportApi.md#WorkdaysPut) | **Put** /workdays/{id} | Update Workday +[**WorkdaysWorkers**](WorkdayImportApi.md#WorkdaysWorkers) | **Get** /workdays/{workday_id}/workers | List Workday Workers + +# **WorkdaysAuthorize** +> WorkdaysAuthorize(ctx, workdayId, optional) +Authorize Workday + +This endpoint adds an authorization method to a workday instance. You must supply a username and password for `Basic Authentication` that is the same as your WorkDay Integrator System User. Failure to provide these credentials will result in the request being rejected. Currently `O-Auth` isn't a supported authentication protocol for WorkDay, but will be in the future. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/workdays/{WorkDayID}/auth \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"auth\":{ \"basic\": { \"username\": \"someDeveloper\", \"password\": \"notTheRealPassword\" } } }' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **workdayId** | **string**| | + **optional** | ***WorkdayImportApiWorkdaysAuthorizeOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a WorkdayImportApiWorkdaysAuthorizeOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **body** | [**optional.Interface of AuthInputObject**](AuthInputObject.md)| | + **xOrgId** | **optional.**| Organization identifier that can be obtained from console settings. | + +### Return type + + (empty response body) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **WorkdaysDeauthorize** +> WorkdaysDeauthorize(ctx, workdayId, optional) +Deauthorize Workday + +Removes any and all authorization methods from the workday instance ##### Sample Request ``` curl -X DELETE https://console.jumpcloud.com/api/v2/workdays/{WorkDayID}/auth \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **workdayId** | **string**| | + **optional** | ***WorkdayImportApiWorkdaysDeauthorizeOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a WorkdayImportApiWorkdaysDeauthorizeOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **xOrgId** | **optional.String**| Organization identifier that can be obtained from console settings. | + +### Return type + + (empty response body) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **WorkdaysGet** +> WorkdayOutput WorkdaysGet(ctx, id, optional) +Get Workday + +This endpoint will return all the available information about an instance of Workday. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/workdays/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **id** | **string**| | + **optional** | ***WorkdayImportApiWorkdaysGetOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a WorkdayImportApiWorkdaysGetOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **xOrgId** | **optional.String**| Organization identifier that can be obtained from console settings. | + +### Return type + +[**WorkdayOutput**](workday-output.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **WorkdaysImport** +> JobId WorkdaysImport(ctx, workdayId, optional) +Workday Import + +The endpoint allows you to create a Workday Import request. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/workdays/{WorkdayID}/import \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '[ { \"email\":\"{email}\", \"firstname\":\"{firstname}\", \"lastname\":\"{firstname}\", \"username\":\"{username}\", \"attributes\":[ {\"name\":\"EmployeeID\",\"value\":\"0000\"}, {\"name\":\"WorkdayID\",\"value\":\"name.name\"} ] } ] ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **workdayId** | **string**| | + **optional** | ***WorkdayImportApiWorkdaysImportOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a WorkdayImportApiWorkdaysImportOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **body** | [**optional.Interface of []BulkUserCreate**](bulk-user-create.md)| | + **xOrgId** | **optional.**| Organization identifier that can be obtained from console settings. | + +### Return type + +[**JobId**](job-id.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **WorkdaysImportresults** +> []JobWorkresult WorkdaysImportresults(ctx, id, jobId, optional) +List Import Results + +This endpoint provides a list of job results from the workday import and will contain all imported data from Workday. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/workdays/{WorkdayID}/import/{ImportJobID}/results \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **id** | **string**| | + **jobId** | **string**| | + **optional** | ***WorkdayImportApiWorkdaysImportresultsOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a WorkdayImportApiWorkdaysImportresultsOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + + **limit** | **optional.Int32**| The number of records to return at once. Limited to 100. | [default to 10] + **skip** | **optional.Int32**| The offset into the records to return. | [default to 0] + **xOrgId** | **optional.String**| Organization identifier that can be obtained from console settings. | + +### Return type + +[**[]JobWorkresult**](job-workresult.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **WorkdaysList** +> []WorkdayOutput WorkdaysList(ctx, optional) +List Workdays + +This endpoint will return all the available information about all your instances of Workday. ##### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/workdays/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **optional** | ***WorkdayImportApiWorkdaysListOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a WorkdayImportApiWorkdaysListOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **fields** | [**optional.Interface of []string**](string.md)| The comma separated fields included in the returned records. If omitted, the default list of fields will be returned. | + **limit** | **optional.Int32**| The number of records to return at once. Limited to 100. | [default to 10] + **skip** | **optional.Int32**| The offset into the records to return. | [default to 0] + **sort** | [**optional.Interface of []string**](string.md)| The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. | + **filter** | [**optional.Interface of []string**](string.md)| A filter to apply to the query. **Filter structure**: `<field>:<operator>:<value>`. **field** = Populate with a valid field from an endpoint response. **operator** = Supported operators are: eq, ne, gt, ge, lt, le, between, search, in. _Note: v1 operators differ from v2 operators._ **value** = Populate with the value you want to search for. Is case sensitive. Supports wild cards. **EX:** `GET /api/v2/groups?filter=name:eq:Test+Group` | + **xOrgId** | **optional.String**| Organization identifier that can be obtained from console settings. | + +### Return type + +[**[]WorkdayOutput**](workday-output.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **WorkdaysPost** +> WorkdayOutput WorkdaysPost(ctx, optional) +Create new Workday + +This endpoint allows you to create a new workday instance. You must supply a username and password for `Basic Authentication` that is the same as your WorkDay Integrator System User. Failure to provide these credentials will result in the request being rejected. Currently `O-Auth` isn't a supported authentication protocol for WorkDay, but will be in the future. Currently, only one instance is allowed and it must be `Workday Import`. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/workdays/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"name\": \"Workday2\", \"reportUrl\":\"https://workday.com/ccx/service/customreport2/gms/user/reportname?format=json\", \"auth\": { \"basic\": { \"username\": \"someDeveloper\", \"password\": \"notTheRealPassword\" } } }' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **optional** | ***WorkdayImportApiWorkdaysPostOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a WorkdayImportApiWorkdaysPostOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**optional.Interface of WorkdayInput**](WorkdayInput.md)| | + **xOrgId** | **optional.**| Organization identifier that can be obtained from console settings. | + +### Return type + +[**WorkdayOutput**](workday-output.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **WorkdaysPut** +> WorkdayOutput WorkdaysPut(ctx, id, optional) +Update Workday + +This endpoint allows you to update the name and Custom Report URL for a Workday Instance. Currently, the name can not be changed from the default of `Workday Import`. ##### Sample Request ``` curl -X PUT https://console.jumpcloud.com/api/v2/workdays/{WorkdayID} \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"reportUrl\":\"{Report_URL}\", \"name\":\"{Name}\" } ' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **id** | **string**| | + **optional** | ***WorkdayImportApiWorkdaysPutOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a WorkdayImportApiWorkdaysPutOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **body** | [**optional.Interface of WorkdayFields**](WorkdayFields.md)| | + **xOrgId** | **optional.**| Organization identifier that can be obtained from console settings. | + +### Return type + +[**WorkdayOutput**](workday-output.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **WorkdaysWorkers** +> []WorkdayWorker WorkdaysWorkers(ctx, workdayId, optional) +List Workday Workers + +This endpoint will return all of the data in your WorkDay Custom Report that has been associated with your WorkDay Instance in JumpCloud. ##### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/workdays/{WorkDayID}/workers \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` + +### Required Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. + **workdayId** | **string**| | + **optional** | ***WorkdayImportApiWorkdaysWorkersOpts** | optional parameters | nil if no parameters + +### Optional Parameters +Optional parameters are passed through a pointer to a WorkdayImportApiWorkdaysWorkersOpts struct +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + + **limit** | **optional.Int32**| The number of records to return at once. Limited to 100. | [default to 10] + **skip** | **optional.Int32**| The offset into the records to return. | [default to 0] + **sort** | [**optional.Interface of []string**](string.md)| The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. | + **xOrgId** | **optional.String**| Organization identifier that can be obtained from console settings. | + +### Return type + +[**[]WorkdayWorker**](workday-worker.md) + +### Authorization + +[x-api-key](../README.md#x-api-key) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/v2/docs/WorkdayInput.md b/jcapiv2/docs/WorkdayInput.md similarity index 99% rename from v2/docs/WorkdayInput.md rename to jcapiv2/docs/WorkdayInput.md index c8d7a5e..9e2e35b 100644 --- a/v2/docs/WorkdayInput.md +++ b/jcapiv2/docs/WorkdayInput.md @@ -9,4 +9,3 @@ Name | Type | Description | Notes [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/v2/docs/WorkdayOutput.md b/jcapiv2/docs/WorkdayOutput.md similarity index 99% rename from v2/docs/WorkdayOutput.md rename to jcapiv2/docs/WorkdayOutput.md index a6a6178..c20bb8c 100644 --- a/v2/docs/WorkdayOutput.md +++ b/jcapiv2/docs/WorkdayOutput.md @@ -11,4 +11,3 @@ Name | Type | Description | Notes [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/v2/docs/WorkdayWorker.md b/jcapiv2/docs/WorkdayWorker.md similarity index 99% rename from v2/docs/WorkdayWorker.md rename to jcapiv2/docs/WorkdayWorker.md index 7890476..ec12bf4 100644 --- a/v2/docs/WorkdayWorker.md +++ b/jcapiv2/docs/WorkdayWorker.md @@ -11,4 +11,3 @@ Name | Type | Description | Notes [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/v2/docs/WorkdayoutputAuth.md b/jcapiv2/docs/WorkdayoutputAuth.md similarity index 99% rename from v2/docs/WorkdayoutputAuth.md rename to jcapiv2/docs/WorkdayoutputAuth.md index 3e85954..8ad22e4 100644 --- a/v2/docs/WorkdayoutputAuth.md +++ b/jcapiv2/docs/WorkdayoutputAuth.md @@ -8,4 +8,3 @@ Name | Type | Description | Notes [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/v2/git_push.sh b/jcapiv2/git_push.sh similarity index 100% rename from v2/git_push.sh rename to jcapiv2/git_push.sh diff --git a/jcapiv2/model_active_directory_agent_get_output.go b/jcapiv2/model_active_directory_agent_get_output.go new file mode 100644 index 0000000..2f9e672 --- /dev/null +++ b/jcapiv2/model_active_directory_agent_get_output.go @@ -0,0 +1,22 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +type ActiveDirectoryAgentGetOutput struct { + // The connect key to use when installing the Agent on a Domain Controller. + ConnectKey string `json:"connectKey,omitempty"` + ContactAt string `json:"contactAt,omitempty"` + Hostname string `json:"hostname,omitempty"` + // ObjectID of this Active Directory Agent. + Id string `json:"id"` + SourceIp string `json:"source_ip,omitempty"` + State string `json:"state,omitempty"` + Version string `json:"version,omitempty"` +} diff --git a/jcapiv2/model_active_directory_agent_input.go b/jcapiv2/model_active_directory_agent_input.go new file mode 100644 index 0000000..f03c61c --- /dev/null +++ b/jcapiv2/model_active_directory_agent_input.go @@ -0,0 +1,13 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +type ActiveDirectoryAgentInput struct { +} diff --git a/jcapiv2/model_active_directory_agent_list_output.go b/jcapiv2/model_active_directory_agent_list_output.go new file mode 100644 index 0000000..1175cb6 --- /dev/null +++ b/jcapiv2/model_active_directory_agent_list_output.go @@ -0,0 +1,20 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +type ActiveDirectoryAgentListOutput struct { + ContactAt string `json:"contactAt,omitempty"` + Hostname string `json:"hostname,omitempty"` + // ObjectID of this Active Directory Agent. + Id string `json:"id,omitempty"` + SourceIp string `json:"source_ip,omitempty"` + State string `json:"state,omitempty"` + Version string `json:"version,omitempty"` +} diff --git a/jcapiv2/model_active_directory_input.go b/jcapiv2/model_active_directory_input.go new file mode 100644 index 0000000..67f5137 --- /dev/null +++ b/jcapiv2/model_active_directory_input.go @@ -0,0 +1,15 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +type ActiveDirectoryInput struct { + // Domain name for this Active Directory instance. + Domain string `json:"domain,omitempty"` +} diff --git a/jcapiv2/model_active_directory_output.go b/jcapiv2/model_active_directory_output.go new file mode 100644 index 0000000..e3b3aa8 --- /dev/null +++ b/jcapiv2/model_active_directory_output.go @@ -0,0 +1,15 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +type ActiveDirectoryOutput struct { + // Domain name for this Active Directory instance. + Domain string `json:"domain,omitempty"` +} diff --git a/jcapiv2/model_address.go b/jcapiv2/model_address.go new file mode 100644 index 0000000..5d6ad55 --- /dev/null +++ b/jcapiv2/model_address.go @@ -0,0 +1,22 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +type Address struct { + Country string `json:"country,omitempty"` + ExtendedAddress string `json:"extendedAddress,omitempty"` + Id string `json:"id,omitempty"` + Locality string `json:"locality,omitempty"` + PoBox string `json:"poBox,omitempty"` + PostalCode string `json:"postalCode,omitempty"` + Region string `json:"region,omitempty"` + StreetAddress string `json:"streetAddress,omitempty"` + Type_ string `json:"type,omitempty"` +} diff --git a/jcapiv2/model_ade.go b/jcapiv2/model_ade.go new file mode 100644 index 0000000..ed32a9f --- /dev/null +++ b/jcapiv2/model_ade.go @@ -0,0 +1,19 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +type Ade struct { + // An array of ObjectIDs identifying the default device groups for this specific type (based on the OS family) of automated device enrollment. Currently, only a single DeviceGroupID is supported. + DefaultDeviceGroupObjectIds []string `json:"defaultDeviceGroupObjectIds,omitempty"` + // A toggle to determine if ADE registered devices should go through JumpCloud Zero Touch Enrollment. + EnableZeroTouchEnrollment bool `json:"enableZeroTouchEnrollment,omitempty"` + SetupAssistantOptions []DepSetupAssistantOption `json:"setupAssistantOptions,omitempty"` + WelcomeScreen *DepWelcomeScreen `json:"welcomeScreen,omitempty"` +} diff --git a/jcapiv2/model_ades.go b/jcapiv2/model_ades.go new file mode 100644 index 0000000..a0f220d --- /dev/null +++ b/jcapiv2/model_ades.go @@ -0,0 +1,15 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +type Ades struct { + Ios *Ade `json:"ios,omitempty"` + Macos *Ade `json:"macos,omitempty"` +} diff --git a/jcapiv2/model_administrator.go b/jcapiv2/model_administrator.go new file mode 100644 index 0000000..19f87ee --- /dev/null +++ b/jcapiv2/model_administrator.go @@ -0,0 +1,23 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +type Administrator struct { + Email string `json:"email,omitempty"` + EnableMultiFactor bool `json:"enableMultiFactor,omitempty"` + Firstname string `json:"firstname,omitempty"` + Id string `json:"id,omitempty"` + Lastname string `json:"lastname,omitempty"` + OrganizationAccessTotal float64 `json:"organizationAccessTotal,omitempty"` + Registered bool `json:"registered,omitempty"` + Role string `json:"role,omitempty"` + RoleName string `json:"roleName,omitempty"` + Suspended bool `json:"suspended,omitempty"` +} diff --git a/jcapiv2/model_administrator_organization_link.go b/jcapiv2/model_administrator_organization_link.go new file mode 100644 index 0000000..ebbb55d --- /dev/null +++ b/jcapiv2/model_administrator_organization_link.go @@ -0,0 +1,17 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +type AdministratorOrganizationLink struct { + // The identifier for an administrator + Administrator string `json:"administrator,omitempty"` + // The identifier for an organization + Organization string `json:"organization,omitempty"` +} diff --git a/jcapiv2/model_administrator_organization_link_req.go b/jcapiv2/model_administrator_organization_link_req.go new file mode 100644 index 0000000..978f91e --- /dev/null +++ b/jcapiv2/model_administrator_organization_link_req.go @@ -0,0 +1,15 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +type AdministratorOrganizationLinkReq struct { + // The identifier for an organization to link this administrator to. + Organization string `json:"organization,omitempty"` +} diff --git a/jcapiv2/model_all_of_autotask_ticketing_alert_configuration_list_records_items.go b/jcapiv2/model_all_of_autotask_ticketing_alert_configuration_list_records_items.go new file mode 100644 index 0000000..f9f204f --- /dev/null +++ b/jcapiv2/model_all_of_autotask_ticketing_alert_configuration_list_records_items.go @@ -0,0 +1,25 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +type AllOfAutotaskTicketingAlertConfigurationListRecordsItems struct { + Category string `json:"category,omitempty"` + Description string `json:"description,omitempty"` + Destination string `json:"destination,omitempty"` + DisplayName string `json:"displayName,omitempty"` + DueDays int32 `json:"dueDays,omitempty"` + Id int32 `json:"id,omitempty"` + Priority *AutotaskTicketingAlertConfigurationPriority `json:"priority,omitempty"` + Queue *AutotaskTicketingAlertConfigurationPriority `json:"queue,omitempty"` + Resource *AutotaskTicketingAlertConfigurationResource `json:"resource,omitempty"` + ShouldCreateTickets bool `json:"shouldCreateTickets,omitempty"` + Source *AutotaskTicketingAlertConfigurationPriority `json:"source,omitempty"` + Status *AutotaskTicketingAlertConfigurationPriority `json:"status,omitempty"` +} diff --git a/jcapiv2/model_all_of_connect_wise_ticketing_alert_configuration_list_records_items.go b/jcapiv2/model_all_of_connect_wise_ticketing_alert_configuration_list_records_items.go new file mode 100644 index 0000000..bd486d7 --- /dev/null +++ b/jcapiv2/model_all_of_connect_wise_ticketing_alert_configuration_list_records_items.go @@ -0,0 +1,21 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +type AllOfConnectWiseTicketingAlertConfigurationListRecordsItems struct { + Category string `json:"category,omitempty"` + Description string `json:"description,omitempty"` + DisplayName string `json:"displayName,omitempty"` + DueDays int32 `json:"dueDays,omitempty"` + Id int32 `json:"id,omitempty"` + Priority *AutotaskTicketingAlertConfigurationPriority `json:"priority,omitempty"` + ShouldCreateTickets bool `json:"shouldCreateTickets"` + Source *AutotaskTicketingAlertConfigurationPriority `json:"source,omitempty"` +} diff --git a/jcapiv2/model_any_value.go b/jcapiv2/model_any_value.go new file mode 100644 index 0000000..481a8b6 --- /dev/null +++ b/jcapiv2/model_any_value.go @@ -0,0 +1,14 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +// Can be any value - string, number, boolean, array or object. +type AnyValue struct { +} diff --git a/jcapiv2/model_apple_mdm.go b/jcapiv2/model_apple_mdm.go new file mode 100644 index 0000000..8520c8b --- /dev/null +++ b/jcapiv2/model_apple_mdm.go @@ -0,0 +1,33 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +type AppleMdm struct { + Ades *Ades `json:"ades,omitempty"` + // A toggle to allow mobile device enrollment for an organization. + AllowMobileUserEnrollment bool `json:"allowMobileUserEnrollment,omitempty"` + // The expiration date and time for the APNS Certificate. + ApnsCertExpiry string `json:"apnsCertExpiry,omitempty"` + // The push topic assigned to this enrollment by Apple after uploading the Signed CSR plist. + ApnsPushTopic string `json:"apnsPushTopic,omitempty"` + // ObjectId uniquely identifying the MDM default iOS user enrollment device group. + DefaultIosUserEnrollmentDeviceGroupID string `json:"defaultIosUserEnrollmentDeviceGroupID,omitempty"` + // ObjectId uniquely identifying the MDM default System Group. + DefaultSystemGroupID string `json:"defaultSystemGroupID,omitempty"` + Dep *Dep `json:"dep,omitempty"` + // The expiration date and time for the DEP Access Token. This aligns with the DEP Server Token State. + DepAccessTokenExpiry string `json:"depAccessTokenExpiry,omitempty"` + // The state of the dep server token, presence and expiry. + DepServerTokenState string `json:"depServerTokenState,omitempty"` + // ObjectId uniquely identifying an MDM Enrollment, + Id string `json:"id"` + // A friendly name to identify this enrollment. Not required to be unique. + Name string `json:"name,omitempty"` +} diff --git a/jcapiv2/model_apple_mdm_device.go b/jcapiv2/model_apple_mdm_device.go new file mode 100644 index 0000000..56e7998 --- /dev/null +++ b/jcapiv2/model_apple_mdm_device.go @@ -0,0 +1,23 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +type AppleMdmDevice struct { + CreatedAt string `json:"createdAt,omitempty"` + DepRegistered bool `json:"depRegistered,omitempty"` + DeviceInformation *AppleMdmDeviceInfo `json:"deviceInformation,omitempty"` + Enrolled bool `json:"enrolled,omitempty"` + HasActivationLockBypassCodes bool `json:"hasActivationLockBypassCodes,omitempty"` + Id string `json:"id,omitempty"` + OsVersion string `json:"osVersion,omitempty"` + SecurityInfo *AppleMdmDeviceSecurityInfo `json:"securityInfo,omitempty"` + SerialNumber string `json:"serialNumber,omitempty"` + Udid string `json:"udid,omitempty"` +} diff --git a/jcapiv2/model_apple_mdm_device_info.go b/jcapiv2/model_apple_mdm_device_info.go new file mode 100644 index 0000000..5e23625 --- /dev/null +++ b/jcapiv2/model_apple_mdm_device_info.go @@ -0,0 +1,28 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +// Apple MDM device information +type AppleMdmDeviceInfo struct { + ActivationLockAllowedWhileSupervised bool `json:"activationLockAllowedWhileSupervised,omitempty"` + AvailableDeviceCapacity float64 `json:"availableDeviceCapacity,omitempty"` + DeviceCapacity float64 `json:"deviceCapacity,omitempty"` + DeviceName string `json:"deviceName,omitempty"` + Iccid string `json:"iccid,omitempty"` + Imei string `json:"imei,omitempty"` + IsActivationLockEnabled bool `json:"isActivationLockEnabled,omitempty"` + IsSupervised bool `json:"isSupervised,omitempty"` + ModelName string `json:"modelName,omitempty"` + SecondIccid string `json:"secondIccid,omitempty"` + SecondImei string `json:"secondImei,omitempty"` + SecondSubscriberCarrierNetwork string `json:"secondSubscriberCarrierNetwork,omitempty"` + SubscriberCarrierNetwork string `json:"subscriberCarrierNetwork,omitempty"` + WifiMac string `json:"wifiMac,omitempty"` +} diff --git a/jcapiv2/model_apple_mdm_device_security_info.go b/jcapiv2/model_apple_mdm_device_security_info.go new file mode 100644 index 0000000..bc0ac69 --- /dev/null +++ b/jcapiv2/model_apple_mdm_device_security_info.go @@ -0,0 +1,19 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +// Apple MDM device security information +type AppleMdmDeviceSecurityInfo struct { + EnrolledViaDep bool `json:"enrolledViaDep,omitempty"` + IsActivationLockManageable bool `json:"isActivationLockManageable,omitempty"` + IsUserEnrollment bool `json:"isUserEnrollment,omitempty"` + PasscodePresent bool `json:"passcodePresent,omitempty"` + UserApprovedEnrollment bool `json:"userApprovedEnrollment,omitempty"` +} diff --git a/jcapiv2/model_apple_mdm_patch_input.go b/jcapiv2/model_apple_mdm_patch_input.go new file mode 100644 index 0000000..a7a202b --- /dev/null +++ b/jcapiv2/model_apple_mdm_patch_input.go @@ -0,0 +1,27 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +type AppleMdmPatchInput struct { + Ades *Ades `json:"ades,omitempty"` + // A toggle to allow mobile device enrollment for an organization. + AllowMobileUserEnrollment bool `json:"allowMobileUserEnrollment,omitempty"` + // A signed certificate obtained from Apple after providing Apple with the plist file provided on POST. + AppleSignedCert string `json:"appleSignedCert,omitempty"` + // ObjectId uniquely identifying the MDM default iOS user enrollment device group. + DefaultIosUserEnrollmentDeviceGroupID string `json:"defaultIosUserEnrollmentDeviceGroupID,omitempty"` + // ObjectId uniquely identifying the MDM default System Group. + DefaultSystemGroupID string `json:"defaultSystemGroupID,omitempty"` + Dep *Dep `json:"dep,omitempty"` + // The S/MIME encoded DEP Server Token returned by Apple Business Manager when creating an MDM instance. + EncryptedDepServerToken string `json:"encryptedDepServerToken,omitempty"` + // A new name for the Apple MDM configuration. + Name string `json:"name,omitempty"` +} diff --git a/jcapiv2/model_application_id_logo_body.go b/jcapiv2/model_application_id_logo_body.go new file mode 100644 index 0000000..994a7e5 --- /dev/null +++ b/jcapiv2/model_application_id_logo_body.go @@ -0,0 +1,18 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 +import ( + "os" +) + +type ApplicationIdLogoBody struct { + // The file to upload. + Image **os.File `json:"image,omitempty"` +} diff --git a/jcapiv2/model_auth_info.go b/jcapiv2/model_auth_info.go new file mode 100644 index 0000000..ae91228 --- /dev/null +++ b/jcapiv2/model_auth_info.go @@ -0,0 +1,16 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +type AuthInfo struct { + Expiry string `json:"expiry,omitempty"` + IsValid bool `json:"isValid,omitempty"` + Message string `json:"message,omitempty"` +} diff --git a/jcapiv2/model_auth_input.go b/jcapiv2/model_auth_input.go new file mode 100644 index 0000000..64bce93 --- /dev/null +++ b/jcapiv2/model_auth_input.go @@ -0,0 +1,15 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +type AuthInput struct { + Basic *AuthinputBasic `json:"basic,omitempty"` + Oauth *AuthinputOauth `json:"oauth,omitempty"` +} diff --git a/jcapiv2/model_auth_input_object.go b/jcapiv2/model_auth_input_object.go new file mode 100644 index 0000000..79eba97 --- /dev/null +++ b/jcapiv2/model_auth_input_object.go @@ -0,0 +1,14 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +type AuthInputObject struct { + Auth *AuthInput `json:"auth,omitempty"` +} diff --git a/jcapiv2/model_authinput_basic.go b/jcapiv2/model_authinput_basic.go new file mode 100644 index 0000000..e24820d --- /dev/null +++ b/jcapiv2/model_authinput_basic.go @@ -0,0 +1,15 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +type AuthinputBasic struct { + Password string `json:"password,omitempty"` + Username string `json:"username,omitempty"` +} diff --git a/jcapiv2/model_authinput_oauth.go b/jcapiv2/model_authinput_oauth.go new file mode 100644 index 0000000..6ab5338 --- /dev/null +++ b/jcapiv2/model_authinput_oauth.go @@ -0,0 +1,14 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +type AuthinputOauth struct { + Code string `json:"code,omitempty"` +} diff --git a/jcapiv2/model_authn_policy.go b/jcapiv2/model_authn_policy.go new file mode 100644 index 0000000..1b105ff --- /dev/null +++ b/jcapiv2/model_authn_policy.go @@ -0,0 +1,22 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +// This represents an authentication policy. See the details of each field for valid values and restrictions. Conditions may be added to an authentication policy using the following conditional language: ``` ::= ::= | | | | | ::= { \"ipAddressIn\": [ , ... ] } ::= { \"deviceManaged\": } ::= { \"locationIn\": { \"countries\": [ , ... ] } } ::= { \"not\": } ::= { \"all\": [ , ... ] } ::= { \"any\": [ , ... ] } ``` For example, to add a condition that applies to IP address in a given list the following condition can be added: `{\"ipAddressIn\": [ ]}` If you would rather exclude IP addresses in the given lists, the following condition could be added: `{ \"not\": { \"ipAddressIn\": [ , ] } }` You may also include more than one condition and choose whether \"all\" or \"any\" of them must be met for the policy to apply. `{ \"all\": [ { \"ipAddressIn\": [ , ... ] }, { \"deviceManaged\": true }, { \"locationIn\": { countries: [ , ... ] } } ] }` +type AuthnPolicy struct { + Conditions *interface{} `json:"conditions,omitempty"` + Description string `json:"description,omitempty"` + Disabled bool `json:"disabled,omitempty"` + Effect *AuthnPolicyEffect `json:"effect,omitempty"` + Id string `json:"id,omitempty"` + Name string `json:"name,omitempty"` + Targets *AuthnPolicyTargets `json:"targets,omitempty"` + Type_ *AuthnPolicyType `json:"type,omitempty"` +} diff --git a/jcapiv2/model_authn_policy_effect.go b/jcapiv2/model_authn_policy_effect.go new file mode 100644 index 0000000..962bcfe --- /dev/null +++ b/jcapiv2/model_authn_policy_effect.go @@ -0,0 +1,15 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +type AuthnPolicyEffect struct { + Action string `json:"action"` + Obligations *AuthnPolicyObligations `json:"obligations,omitempty"` +} diff --git a/jcapiv2/model_authn_policy_input.go b/jcapiv2/model_authn_policy_input.go new file mode 100644 index 0000000..96f6cf5 --- /dev/null +++ b/jcapiv2/model_authn_policy_input.go @@ -0,0 +1,20 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +type AuthnPolicyInput struct { + Conditions *interface{} `json:"conditions,omitempty"` + Description string `json:"description,omitempty"` + Disabled bool `json:"disabled,omitempty"` + Effect *AuthnPolicyEffect `json:"effect,omitempty"` + Name string `json:"name,omitempty"` + Targets *AuthnPolicyTargets `json:"targets,omitempty"` + Type_ *AuthnPolicyType `json:"type,omitempty"` +} diff --git a/jcapiv2/model_authn_policy_obligations.go b/jcapiv2/model_authn_policy_obligations.go new file mode 100644 index 0000000..8186148 --- /dev/null +++ b/jcapiv2/model_authn_policy_obligations.go @@ -0,0 +1,15 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +type AuthnPolicyObligations struct { + Mfa *AuthnPolicyObligationsMfa `json:"mfa,omitempty"` + UserVerification *AuthnPolicyObligationsUserVerification `json:"userVerification,omitempty"` +} diff --git a/jcapiv2/model_authn_policy_obligations_mfa.go b/jcapiv2/model_authn_policy_obligations_mfa.go new file mode 100644 index 0000000..86e45e8 --- /dev/null +++ b/jcapiv2/model_authn_policy_obligations_mfa.go @@ -0,0 +1,14 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +type AuthnPolicyObligationsMfa struct { + Required bool `json:"required,omitempty"` +} diff --git a/jcapiv2/model_authn_policy_obligations_user_verification.go b/jcapiv2/model_authn_policy_obligations_user_verification.go new file mode 100644 index 0000000..52dc8b7 --- /dev/null +++ b/jcapiv2/model_authn_policy_obligations_user_verification.go @@ -0,0 +1,14 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +type AuthnPolicyObligationsUserVerification struct { + Requirement string `json:"requirement,omitempty"` +} diff --git a/jcapiv2/model_authn_policy_resource_target.go b/jcapiv2/model_authn_policy_resource_target.go new file mode 100644 index 0000000..a64a7c9 --- /dev/null +++ b/jcapiv2/model_authn_policy_resource_target.go @@ -0,0 +1,16 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +type AuthnPolicyResourceTarget struct { + // Object ID of the resource target. If undefined, then all resources of the given type are targeted. + Id string `json:"id,omitempty"` + Type_ string `json:"type"` +} diff --git a/jcapiv2/model_authn_policy_targets.go b/jcapiv2/model_authn_policy_targets.go new file mode 100644 index 0000000..03df605 --- /dev/null +++ b/jcapiv2/model_authn_policy_targets.go @@ -0,0 +1,17 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +type AuthnPolicyTargets struct { + Resources []AuthnPolicyResourceTarget `json:"resources,omitempty"` + UserAttributes *AuthnPolicyUserAttributeTarget `json:"userAttributes,omitempty"` + UserGroups *AuthnPolicyUserGroupTarget `json:"userGroups,omitempty"` + Users *AuthnPolicyUserTarget `json:"users,omitempty"` +} diff --git a/jcapiv2/model_authn_policy_type.go b/jcapiv2/model_authn_policy_type.go new file mode 100644 index 0000000..7b3d126 --- /dev/null +++ b/jcapiv2/model_authn_policy_type.go @@ -0,0 +1,19 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +type AuthnPolicyType string + +// List of AuthnPolicyType +const ( + USER_PORTAL_AuthnPolicyType AuthnPolicyType = "user_portal" + APPLICATION_AuthnPolicyType AuthnPolicyType = "application" + LDAP_AuthnPolicyType AuthnPolicyType = "ldap" +) diff --git a/jcapiv2/model_authn_policy_user_attribute_filter.go b/jcapiv2/model_authn_policy_user_attribute_filter.go new file mode 100644 index 0000000..8abee2a --- /dev/null +++ b/jcapiv2/model_authn_policy_user_attribute_filter.go @@ -0,0 +1,17 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +type AuthnPolicyUserAttributeFilter struct { + // The only field that is currently supported is ldap_binding_user + Field string `json:"field,omitempty"` + Operator string `json:"operator,omitempty"` + Value *AnyValue `json:"value,omitempty"` +} diff --git a/jcapiv2/model_authn_policy_user_attribute_target.go b/jcapiv2/model_authn_policy_user_attribute_target.go new file mode 100644 index 0000000..7b32571 --- /dev/null +++ b/jcapiv2/model_authn_policy_user_attribute_target.go @@ -0,0 +1,16 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +// User attribute targets are currently only supported for LDAP policies. +type AuthnPolicyUserAttributeTarget struct { + Exclusions []AuthnPolicyUserAttributeFilter `json:"exclusions,omitempty"` + Inclusions []AuthnPolicyUserAttributeFilter `json:"inclusions,omitempty"` +} diff --git a/jcapiv2/model_authn_policy_user_group_target.go b/jcapiv2/model_authn_policy_user_group_target.go new file mode 100644 index 0000000..5490cda --- /dev/null +++ b/jcapiv2/model_authn_policy_user_group_target.go @@ -0,0 +1,15 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +type AuthnPolicyUserGroupTarget struct { + Exclusions []string `json:"exclusions,omitempty"` + Inclusions []string `json:"inclusions,omitempty"` +} diff --git a/jcapiv2/model_authn_policy_user_target.go b/jcapiv2/model_authn_policy_user_target.go new file mode 100644 index 0000000..bfcc694 --- /dev/null +++ b/jcapiv2/model_authn_policy_user_target.go @@ -0,0 +1,14 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +type AuthnPolicyUserTarget struct { + Inclusions []string `json:"inclusions,omitempty"` +} diff --git a/jcapiv2/model_autotask_company.go b/jcapiv2/model_autotask_company.go new file mode 100644 index 0000000..eb653f9 --- /dev/null +++ b/jcapiv2/model_autotask_company.go @@ -0,0 +1,18 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +// Autotask company details +type AutotaskCompany struct { + // The autotask company identifier. + Id string `json:"id"` + // The autotask company name. + Name string `json:"name"` +} diff --git a/jcapiv2/model_autotask_company_resp.go b/jcapiv2/model_autotask_company_resp.go new file mode 100644 index 0000000..a6043a4 --- /dev/null +++ b/jcapiv2/model_autotask_company_resp.go @@ -0,0 +1,16 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +// Response for retrieving Autotask companies +type AutotaskCompanyResp struct { + Records []AutotaskCompany `json:"records"` + TotalCount int32 `json:"totalCount"` +} diff --git a/jcapiv2/model_autotask_company_type_resp.go b/jcapiv2/model_autotask_company_type_resp.go new file mode 100644 index 0000000..ea12ff2 --- /dev/null +++ b/jcapiv2/model_autotask_company_type_resp.go @@ -0,0 +1,16 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +// Response for retrieving Autotask company types +type AutotaskCompanyTypeResp struct { + Records []BillingIntegrationCompanyType `json:"records"` + TotalCount int32 `json:"totalCount"` +} diff --git a/jcapiv2/model_autotask_contract.go b/jcapiv2/model_autotask_contract.go new file mode 100644 index 0000000..c6228c5 --- /dev/null +++ b/jcapiv2/model_autotask_contract.go @@ -0,0 +1,20 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +// Autotask contract details +type AutotaskContract struct { + // The Autotask company identifier linked to contract. + CompanyId string `json:"companyId"` + // The contract identifier. + Id string `json:"id"` + // The contract name. + Name string `json:"name"` +} diff --git a/jcapiv2/model_autotask_contract_field.go b/jcapiv2/model_autotask_contract_field.go new file mode 100644 index 0000000..46c406d --- /dev/null +++ b/jcapiv2/model_autotask_contract_field.go @@ -0,0 +1,17 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +// Autotask contract field details +type AutotaskContractField struct { + // The contract field name. + Name string `json:"name"` + Values []AutotaskContractFieldValues `json:"values"` +} diff --git a/jcapiv2/model_autotask_contract_field_values.go b/jcapiv2/model_autotask_contract_field_values.go new file mode 100644 index 0000000..2453799 --- /dev/null +++ b/jcapiv2/model_autotask_contract_field_values.go @@ -0,0 +1,15 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +type AutotaskContractFieldValues struct { + Label string `json:"label,omitempty"` + Value string `json:"value,omitempty"` +} diff --git a/jcapiv2/model_autotask_integration.go b/jcapiv2/model_autotask_integration.go new file mode 100644 index 0000000..428c5bd --- /dev/null +++ b/jcapiv2/model_autotask_integration.go @@ -0,0 +1,20 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +// Autotask integration configuration details +type AutotaskIntegration struct { + // The identifier for this Autotask integration. + Id string `json:"id"` + // Has the msp-api been configured with auth data yet + IsMspAuthConfigured bool `json:"isMspAuthConfigured,omitempty"` + // The username for connecting to Autotask. + Username string `json:"username"` +} diff --git a/jcapiv2/model_autotask_integration_patch_req.go b/jcapiv2/model_autotask_integration_patch_req.go new file mode 100644 index 0000000..b663253 --- /dev/null +++ b/jcapiv2/model_autotask_integration_patch_req.go @@ -0,0 +1,18 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +// Request for updating a Autotask integration +type AutotaskIntegrationPatchReq struct { + // The secret for connecting to Autotask. + Secret string `json:"secret,omitempty"` + // The username for connecting to Autotask. + Username string `json:"username,omitempty"` +} diff --git a/jcapiv2/model_autotask_integration_req.go b/jcapiv2/model_autotask_integration_req.go new file mode 100644 index 0000000..b008bac --- /dev/null +++ b/jcapiv2/model_autotask_integration_req.go @@ -0,0 +1,18 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +// Request for creating a Autotask integration +type AutotaskIntegrationReq struct { + // The secret for connecting to Autotask. + Secret string `json:"secret"` + // The username for connecting to Autotask. + Username string `json:"username"` +} diff --git a/jcapiv2/model_autotask_mapping_request.go b/jcapiv2/model_autotask_mapping_request.go new file mode 100644 index 0000000..9ae359c --- /dev/null +++ b/jcapiv2/model_autotask_mapping_request.go @@ -0,0 +1,15 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +// Request object for creating Autotask mappings +type AutotaskMappingRequest struct { + Data []AutotaskMappingRequestData `json:"data,omitempty"` +} diff --git a/jcapiv2/model_autotask_mapping_request_company.go b/jcapiv2/model_autotask_mapping_request_company.go new file mode 100644 index 0000000..d18f1bd --- /dev/null +++ b/jcapiv2/model_autotask_mapping_request_company.go @@ -0,0 +1,15 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +type AutotaskMappingRequestCompany struct { + Id string `json:"id"` + Name string `json:"name"` +} diff --git a/jcapiv2/model_autotask_mapping_request_contract.go b/jcapiv2/model_autotask_mapping_request_contract.go new file mode 100644 index 0000000..eccbfd3 --- /dev/null +++ b/jcapiv2/model_autotask_mapping_request_contract.go @@ -0,0 +1,13 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +type AutotaskMappingRequestContract struct { +} diff --git a/jcapiv2/model_autotask_mapping_request_data.go b/jcapiv2/model_autotask_mapping_request_data.go new file mode 100644 index 0000000..a19af7f --- /dev/null +++ b/jcapiv2/model_autotask_mapping_request_data.go @@ -0,0 +1,18 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +type AutotaskMappingRequestData struct { + Company *AutotaskMappingRequestCompany `json:"company"` + Contract *AutotaskMappingRequestContract `json:"contract"` + Delete bool `json:"delete,omitempty"` + Organization *AutotaskMappingRequestOrganization `json:"organization"` + Service *AutotaskMappingRequestService `json:"service"` +} diff --git a/jcapiv2/model_autotask_mapping_request_organization.go b/jcapiv2/model_autotask_mapping_request_organization.go new file mode 100644 index 0000000..5c5bade --- /dev/null +++ b/jcapiv2/model_autotask_mapping_request_organization.go @@ -0,0 +1,15 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +type AutotaskMappingRequestOrganization struct { + Id string `json:"id"` + Name string `json:"name"` +} diff --git a/jcapiv2/model_autotask_mapping_request_service.go b/jcapiv2/model_autotask_mapping_request_service.go new file mode 100644 index 0000000..ac30f26 --- /dev/null +++ b/jcapiv2/model_autotask_mapping_request_service.go @@ -0,0 +1,13 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +type AutotaskMappingRequestService struct { +} diff --git a/jcapiv2/model_autotask_mapping_response.go b/jcapiv2/model_autotask_mapping_response.go new file mode 100644 index 0000000..4746d41 --- /dev/null +++ b/jcapiv2/model_autotask_mapping_response.go @@ -0,0 +1,20 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +// Autotask mapping GET response +type AutotaskMappingResponse struct { + Company *AutotaskMappingResponseCompany `json:"company,omitempty"` + Contract *AutotaskMappingResponseContract `json:"contract,omitempty"` + LastSyncDateTime string `json:"lastSyncDateTime,omitempty"` + LastSyncStatus string `json:"lastSyncStatus,omitempty"` + Organization *AutotaskMappingResponseOrganization `json:"organization,omitempty"` + Service *AutotaskMappingResponseService `json:"service,omitempty"` +} diff --git a/jcapiv2/model_autotask_mapping_response_company.go b/jcapiv2/model_autotask_mapping_response_company.go new file mode 100644 index 0000000..5144afb --- /dev/null +++ b/jcapiv2/model_autotask_mapping_response_company.go @@ -0,0 +1,15 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +type AutotaskMappingResponseCompany struct { + Id string `json:"id,omitempty"` + Name string `json:"name,omitempty"` +} diff --git a/jcapiv2/model_autotask_mapping_response_contract.go b/jcapiv2/model_autotask_mapping_response_contract.go new file mode 100644 index 0000000..3c2b13b --- /dev/null +++ b/jcapiv2/model_autotask_mapping_response_contract.go @@ -0,0 +1,15 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +type AutotaskMappingResponseContract struct { + Id string `json:"id,omitempty"` + Name string `json:"name,omitempty"` +} diff --git a/jcapiv2/model_autotask_mapping_response_organization.go b/jcapiv2/model_autotask_mapping_response_organization.go new file mode 100644 index 0000000..cb1437e --- /dev/null +++ b/jcapiv2/model_autotask_mapping_response_organization.go @@ -0,0 +1,15 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +type AutotaskMappingResponseOrganization struct { + Id string `json:"id,omitempty"` + Name string `json:"name,omitempty"` +} diff --git a/jcapiv2/model_autotask_mapping_response_service.go b/jcapiv2/model_autotask_mapping_response_service.go new file mode 100644 index 0000000..785eedc --- /dev/null +++ b/jcapiv2/model_autotask_mapping_response_service.go @@ -0,0 +1,16 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +type AutotaskMappingResponseService struct { + Id string `json:"id,omitempty"` + Name string `json:"name,omitempty"` + NonBillableUsers int32 `json:"nonBillableUsers,omitempty"` +} diff --git a/jcapiv2/model_autotask_service.go b/jcapiv2/model_autotask_service.go new file mode 100644 index 0000000..89f168b --- /dev/null +++ b/jcapiv2/model_autotask_service.go @@ -0,0 +1,20 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +// Autotask contract service details +type AutotaskService struct { + // The autotask contract identifier linked to this contract service. + ContractId string `json:"contractId"` + // The contract service identifier. + Id string `json:"id"` + // The autotask service name linked to this contract service. + Name string `json:"name"` +} diff --git a/jcapiv2/model_autotask_settings.go b/jcapiv2/model_autotask_settings.go new file mode 100644 index 0000000..acadd7f --- /dev/null +++ b/jcapiv2/model_autotask_settings.go @@ -0,0 +1,18 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +// Autotask integration settings +type AutotaskSettings struct { + // Determine whether Autotask uses automatic ticketing + AutomaticTicketing bool `json:"automaticTicketing,omitempty"` + // The array of Autotask companyType IDs applicable to the Provider. + CompanyTypeIds []int32 `json:"companyTypeIds,omitempty"` +} diff --git a/jcapiv2/model_autotask_settings_patch_req.go b/jcapiv2/model_autotask_settings_patch_req.go new file mode 100644 index 0000000..51dbdfd --- /dev/null +++ b/jcapiv2/model_autotask_settings_patch_req.go @@ -0,0 +1,18 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +// Request for updating a Autotask integration's settings +type AutotaskSettingsPatchReq struct { + // Determine whether Autotask uses automatic ticketing + AutomaticTicketing bool `json:"automaticTicketing,omitempty"` + // The array of Autotask companyType IDs applicable to the Provider. + CompanyTypeIds []int32 `json:"companyTypeIds,omitempty"` +} diff --git a/jcapiv2/model_autotask_ticketing_alert_configuration.go b/jcapiv2/model_autotask_ticketing_alert_configuration.go new file mode 100644 index 0000000..3ab4705 --- /dev/null +++ b/jcapiv2/model_autotask_ticketing_alert_configuration.go @@ -0,0 +1,26 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +// An AutotaskTicketingAlertConfiguration object requires a queueId if the destination is queue. If the destination is resource, resource.id and resource.role.id are required. +type AutotaskTicketingAlertConfiguration struct { + Category string `json:"category,omitempty"` + Description string `json:"description,omitempty"` + Destination string `json:"destination,omitempty"` + DisplayName string `json:"displayName,omitempty"` + DueDays int32 `json:"dueDays,omitempty"` + Id int32 `json:"id,omitempty"` + Priority *AutotaskTicketingAlertConfigurationPriority `json:"priority,omitempty"` + Queue *AutotaskTicketingAlertConfigurationPriority `json:"queue,omitempty"` + Resource *AutotaskTicketingAlertConfigurationResource `json:"resource,omitempty"` + ShouldCreateTickets bool `json:"shouldCreateTickets,omitempty"` + Source *AutotaskTicketingAlertConfigurationPriority `json:"source,omitempty"` + Status *AutotaskTicketingAlertConfigurationPriority `json:"status,omitempty"` +} diff --git a/jcapiv2/model_autotask_ticketing_alert_configuration_list.go b/jcapiv2/model_autotask_ticketing_alert_configuration_list.go new file mode 100644 index 0000000..588f68b --- /dev/null +++ b/jcapiv2/model_autotask_ticketing_alert_configuration_list.go @@ -0,0 +1,14 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +type AutotaskTicketingAlertConfigurationList struct { + Records []AllOfAutotaskTicketingAlertConfigurationListRecordsItems `json:"records"` +} diff --git a/jcapiv2/model_autotask_ticketing_alert_configuration_option.go b/jcapiv2/model_autotask_ticketing_alert_configuration_option.go new file mode 100644 index 0000000..c1c1953 --- /dev/null +++ b/jcapiv2/model_autotask_ticketing_alert_configuration_option.go @@ -0,0 +1,15 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +type AutotaskTicketingAlertConfigurationOption struct { + Name string `json:"name,omitempty"` + Values []AutotaskTicketingAlertConfigurationOptionValues `json:"values,omitempty"` +} diff --git a/jcapiv2/model_autotask_ticketing_alert_configuration_option_values.go b/jcapiv2/model_autotask_ticketing_alert_configuration_option_values.go new file mode 100644 index 0000000..d2e9954 --- /dev/null +++ b/jcapiv2/model_autotask_ticketing_alert_configuration_option_values.go @@ -0,0 +1,15 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +type AutotaskTicketingAlertConfigurationOptionValues struct { + Label string `json:"label,omitempty"` + Value int32 `json:"value,omitempty"` +} diff --git a/jcapiv2/model_autotask_ticketing_alert_configuration_options.go b/jcapiv2/model_autotask_ticketing_alert_configuration_options.go new file mode 100644 index 0000000..ac9fac7 --- /dev/null +++ b/jcapiv2/model_autotask_ticketing_alert_configuration_options.go @@ -0,0 +1,15 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +type AutotaskTicketingAlertConfigurationOptions struct { + Options []AutotaskTicketingAlertConfigurationOption `json:"options,omitempty"` + Resources []AutotaskTicketingAlertConfigurationResource `json:"resources,omitempty"` +} diff --git a/jcapiv2/model_autotask_ticketing_alert_configuration_priority.go b/jcapiv2/model_autotask_ticketing_alert_configuration_priority.go new file mode 100644 index 0000000..8d807d4 --- /dev/null +++ b/jcapiv2/model_autotask_ticketing_alert_configuration_priority.go @@ -0,0 +1,15 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +type AutotaskTicketingAlertConfigurationPriority struct { + Id int32 `json:"id,omitempty"` + Name string `json:"name,omitempty"` +} diff --git a/jcapiv2/model_autotask_ticketing_alert_configuration_request.go b/jcapiv2/model_autotask_ticketing_alert_configuration_request.go new file mode 100644 index 0000000..a8cab36 --- /dev/null +++ b/jcapiv2/model_autotask_ticketing_alert_configuration_request.go @@ -0,0 +1,22 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +// An AutotaskTicketingAlertConfigurationRequest object requires a queueId if the destination is queue. If the destination is resource, resource.id and resource.role.id are required. +type AutotaskTicketingAlertConfigurationRequest struct { + Destination string `json:"destination"` + DueDays int32 `json:"dueDays"` + Priority *AutotaskTicketingAlertConfigurationPriority `json:"priority"` + Queue *AutotaskTicketingAlertConfigurationPriority `json:"queue,omitempty"` + Resource *AutotaskTicketingAlertConfigurationResource `json:"resource,omitempty"` + ShouldCreateTickets bool `json:"shouldCreateTickets"` + Source *AutotaskTicketingAlertConfigurationPriority `json:"source,omitempty"` + Status *AutotaskTicketingAlertConfigurationPriority `json:"status"` +} diff --git a/jcapiv2/model_autotask_ticketing_alert_configuration_resource.go b/jcapiv2/model_autotask_ticketing_alert_configuration_resource.go new file mode 100644 index 0000000..b4108b6 --- /dev/null +++ b/jcapiv2/model_autotask_ticketing_alert_configuration_resource.go @@ -0,0 +1,16 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +type AutotaskTicketingAlertConfigurationResource struct { + Id int32 `json:"id,omitempty"` + Name string `json:"name,omitempty"` + Role *AutotaskTicketingAlertConfigurationPriority `json:"role,omitempty"` +} diff --git a/jcapiv2/model_billing_integration_company_type.go b/jcapiv2/model_billing_integration_company_type.go new file mode 100644 index 0000000..db2f8a1 --- /dev/null +++ b/jcapiv2/model_billing_integration_company_type.go @@ -0,0 +1,18 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +// Billing Integration company type +type BillingIntegrationCompanyType struct { + // The company type identifier. + Id float64 `json:"id"` + // The company type name. + Name string `json:"name"` +} diff --git a/jcapiv2/model_bulk_scheduled_statechange_create.go b/jcapiv2/model_bulk_scheduled_statechange_create.go new file mode 100644 index 0000000..8e4dd23 --- /dev/null +++ b/jcapiv2/model_bulk_scheduled_statechange_create.go @@ -0,0 +1,27 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 +import ( + "time" +) + +// Model to support bulk scheduling of a state change for one or more users +type BulkScheduledStatechangeCreate struct { + // Send the activation or welcome email to the specified email address upon activation. Can only be used with a single user_id and scheduled activation. This field will be ignored if `send_activation_emails` is explicitly set to false. + ActivationEmailOverride string `json:"activation_email_override,omitempty"` + // Set to true to send activation or welcome email(s) to each user_id upon activation. Set to false to suppress emails. Can only be used with scheduled activation(s). + SendActivationEmails bool `json:"send_activation_emails,omitempty"` + // Date and time that scheduled action should occur + StartDate time.Time `json:"start_date"` + // The state to move the user(s) to + State string `json:"state"` + // Array of system user ids to schedule for a state change + UserIds []string `json:"user_ids"` +} diff --git a/jcapiv2/model_bulk_user_create.go b/jcapiv2/model_bulk_user_create.go new file mode 100644 index 0000000..5d0c91d --- /dev/null +++ b/jcapiv2/model_bulk_user_create.go @@ -0,0 +1,20 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +// See [V1 system user creation](https://docs.jumpcloud.com/api/1.0/index.html#operation/systemusers_post) for full list of attributes. +type BulkUserCreate struct { + // Map of additional attributes. + Attributes []interface{} `json:"attributes,omitempty"` + Email string `json:"email,omitempty"` + Firstname string `json:"firstname,omitempty"` + Lastname string `json:"lastname,omitempty"` + Username string `json:"username,omitempty"` +} diff --git a/jcapiv2/model_bulk_user_update.go b/jcapiv2/model_bulk_user_update.go new file mode 100644 index 0000000..1e04ee0 --- /dev/null +++ b/jcapiv2/model_bulk_user_update.go @@ -0,0 +1,22 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +// See [V1 system user update](https://docs.jumpcloud.com/api/1.0/index.html#operation/systemusers_put) for full list of attributes. +type BulkUserUpdate struct { + // Map of additional attributes. + Attributes []interface{} `json:"attributes,omitempty"` + Email string `json:"email,omitempty"` + Firstname string `json:"firstname,omitempty"` + // Object ID of the systemuser being updated + Id string `json:"id,omitempty"` + Lastname string `json:"lastname,omitempty"` + Username string `json:"username,omitempty"` +} diff --git a/jcapiv2/model_command_result_list.go b/jcapiv2/model_command_result_list.go new file mode 100644 index 0000000..8323b9f --- /dev/null +++ b/jcapiv2/model_command_result_list.go @@ -0,0 +1,17 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +// List of command results +type CommandResultList struct { + Results []CommandResultListResults `json:"results,omitempty"` + // The total number of command results + TotalCount int32 `json:"totalCount,omitempty"` +} diff --git a/jcapiv2/model_command_result_list_results.go b/jcapiv2/model_command_result_list_results.go new file mode 100644 index 0000000..d60d8ab --- /dev/null +++ b/jcapiv2/model_command_result_list_results.go @@ -0,0 +1,23 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +type CommandResultListResults struct { + // The ID of the command, from savedAgentCommands. + Command string `json:"command,omitempty"` + // The number of devices that we do have results from. + CompletedCount int32 `json:"completedCount,omitempty"` + // The workflowInstanceId. + Id string `json:"id,omitempty"` + // The number of devices that we haven't received results from. + PendingCount int32 `json:"pendingCount,omitempty"` + // The ID of the device the command is bound to. + System string `json:"system,omitempty"` +} diff --git a/jcapiv2/model_connect_wise_mapping_request.go b/jcapiv2/model_connect_wise_mapping_request.go new file mode 100644 index 0000000..9445e6d --- /dev/null +++ b/jcapiv2/model_connect_wise_mapping_request.go @@ -0,0 +1,15 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +// Request object for creating ConnectWise mappings +type ConnectWiseMappingRequest struct { + Data []ConnectWiseMappingRequestData `json:"data,omitempty"` +} diff --git a/jcapiv2/model_connect_wise_mapping_request_company.go b/jcapiv2/model_connect_wise_mapping_request_company.go new file mode 100644 index 0000000..39a0b5a --- /dev/null +++ b/jcapiv2/model_connect_wise_mapping_request_company.go @@ -0,0 +1,15 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +type ConnectWiseMappingRequestCompany struct { + Id string `json:"id"` + Name string `json:"name"` +} diff --git a/jcapiv2/model_connect_wise_mapping_request_data.go b/jcapiv2/model_connect_wise_mapping_request_data.go new file mode 100644 index 0000000..4d39447 --- /dev/null +++ b/jcapiv2/model_connect_wise_mapping_request_data.go @@ -0,0 +1,18 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +type ConnectWiseMappingRequestData struct { + Addition *interface{} `json:"addition"` + Agreement *interface{} `json:"agreement"` + Company *ConnectWiseMappingRequestCompany `json:"company"` + Delete bool `json:"delete,omitempty"` + Organization *ConnectWiseMappingRequestOrganization `json:"organization"` +} diff --git a/jcapiv2/model_connect_wise_mapping_request_organization.go b/jcapiv2/model_connect_wise_mapping_request_organization.go new file mode 100644 index 0000000..ffcdeaa --- /dev/null +++ b/jcapiv2/model_connect_wise_mapping_request_organization.go @@ -0,0 +1,15 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +type ConnectWiseMappingRequestOrganization struct { + Id string `json:"id"` + Name string `json:"name"` +} diff --git a/jcapiv2/model_connect_wise_mapping_response.go b/jcapiv2/model_connect_wise_mapping_response.go new file mode 100644 index 0000000..3fd6cca --- /dev/null +++ b/jcapiv2/model_connect_wise_mapping_response.go @@ -0,0 +1,20 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +// ConnectWise mapping GET response +type ConnectWiseMappingResponse struct { + Addition *ConnectWiseMappingResponseAddition `json:"addition,omitempty"` + Agreement *ConnectWiseMappingResponseAddition `json:"agreement,omitempty"` + Company *ConnectWiseMappingResponseAddition `json:"company,omitempty"` + LastSyncDateTime string `json:"lastSyncDateTime,omitempty"` + LastSyncStatus string `json:"lastSyncStatus,omitempty"` + Organization *ConnectWiseMappingResponseAddition `json:"organization,omitempty"` +} diff --git a/jcapiv2/model_connect_wise_mapping_response_addition.go b/jcapiv2/model_connect_wise_mapping_response_addition.go new file mode 100644 index 0000000..2685051 --- /dev/null +++ b/jcapiv2/model_connect_wise_mapping_response_addition.go @@ -0,0 +1,15 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +type ConnectWiseMappingResponseAddition struct { + Id string `json:"id,omitempty"` + Name string `json:"name,omitempty"` +} diff --git a/jcapiv2/model_connect_wise_settings.go b/jcapiv2/model_connect_wise_settings.go new file mode 100644 index 0000000..e6ed4f3 --- /dev/null +++ b/jcapiv2/model_connect_wise_settings.go @@ -0,0 +1,18 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +// ConnectWise integration settings +type ConnectWiseSettings struct { + // Determine whether ConnectWise uses automatic ticketing + AutomaticTicketing bool `json:"automaticTicketing,omitempty"` + // The array of ConnectWise companyType IDs applicable to the Provider. + CompanyTypeIds []int32 `json:"companyTypeIds,omitempty"` +} diff --git a/jcapiv2/model_connect_wise_settings_patch_req.go b/jcapiv2/model_connect_wise_settings_patch_req.go new file mode 100644 index 0000000..b000489 --- /dev/null +++ b/jcapiv2/model_connect_wise_settings_patch_req.go @@ -0,0 +1,18 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +// Request for updating a ConnectWise integration's settings +type ConnectWiseSettingsPatchReq struct { + // Determine whether ConnectWise uses automatic ticketing + AutomaticTicketing bool `json:"automaticTicketing,omitempty"` + // The array of ConnectWise companyType IDs applicable to the Provider. + CompanyTypeIds []int32 `json:"companyTypeIds,omitempty"` +} diff --git a/jcapiv2/model_connect_wise_ticketing_alert_configuration.go b/jcapiv2/model_connect_wise_ticketing_alert_configuration.go new file mode 100644 index 0000000..5db8164 --- /dev/null +++ b/jcapiv2/model_connect_wise_ticketing_alert_configuration.go @@ -0,0 +1,21 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +type ConnectWiseTicketingAlertConfiguration struct { + Category string `json:"category,omitempty"` + Description string `json:"description,omitempty"` + DisplayName string `json:"displayName,omitempty"` + DueDays int32 `json:"dueDays,omitempty"` + Id int32 `json:"id,omitempty"` + Priority *AutotaskTicketingAlertConfigurationPriority `json:"priority,omitempty"` + ShouldCreateTickets bool `json:"shouldCreateTickets"` + Source *AutotaskTicketingAlertConfigurationPriority `json:"source,omitempty"` +} diff --git a/jcapiv2/model_connect_wise_ticketing_alert_configuration_list.go b/jcapiv2/model_connect_wise_ticketing_alert_configuration_list.go new file mode 100644 index 0000000..e7d5dbe --- /dev/null +++ b/jcapiv2/model_connect_wise_ticketing_alert_configuration_list.go @@ -0,0 +1,14 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +type ConnectWiseTicketingAlertConfigurationList struct { + Records []AllOfConnectWiseTicketingAlertConfigurationListRecordsItems `json:"records"` +} diff --git a/jcapiv2/model_connect_wise_ticketing_alert_configuration_option.go b/jcapiv2/model_connect_wise_ticketing_alert_configuration_option.go new file mode 100644 index 0000000..e105305 --- /dev/null +++ b/jcapiv2/model_connect_wise_ticketing_alert_configuration_option.go @@ -0,0 +1,15 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +type ConnectWiseTicketingAlertConfigurationOption struct { + Name string `json:"name,omitempty"` + Values []AutotaskTicketingAlertConfigurationOptionValues `json:"values,omitempty"` +} diff --git a/jcapiv2/model_connect_wise_ticketing_alert_configuration_options.go b/jcapiv2/model_connect_wise_ticketing_alert_configuration_options.go new file mode 100644 index 0000000..040691b --- /dev/null +++ b/jcapiv2/model_connect_wise_ticketing_alert_configuration_options.go @@ -0,0 +1,14 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +type ConnectWiseTicketingAlertConfigurationOptions struct { + Records []ConnectWiseTicketingAlertConfigurationOption `json:"records"` +} diff --git a/jcapiv2/model_connect_wise_ticketing_alert_configuration_request.go b/jcapiv2/model_connect_wise_ticketing_alert_configuration_request.go new file mode 100644 index 0000000..cd24d84 --- /dev/null +++ b/jcapiv2/model_connect_wise_ticketing_alert_configuration_request.go @@ -0,0 +1,17 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +type ConnectWiseTicketingAlertConfigurationRequest struct { + DueDays int32 `json:"dueDays,omitempty"` + Priority *AutotaskTicketingAlertConfigurationPriority `json:"priority,omitempty"` + ShouldCreateTickets bool `json:"shouldCreateTickets"` + Source *AutotaskTicketingAlertConfigurationPriority `json:"source,omitempty"` +} diff --git a/jcapiv2/model_connectwise_addition.go b/jcapiv2/model_connectwise_addition.go new file mode 100644 index 0000000..18ea6b1 --- /dev/null +++ b/jcapiv2/model_connectwise_addition.go @@ -0,0 +1,18 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +// Connectwise addition details +type ConnectwiseAddition struct { + // The addition identifier. + Id string `json:"id"` + // The addition name. + Name string `json:"name"` +} diff --git a/jcapiv2/model_connectwise_agreement.go b/jcapiv2/model_connectwise_agreement.go new file mode 100644 index 0000000..bcbf2d4 --- /dev/null +++ b/jcapiv2/model_connectwise_agreement.go @@ -0,0 +1,20 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +// Connectwise agreement details +type ConnectwiseAgreement struct { + // The ConnectWise company identifier linked to agreement. + CompanyId string `json:"companyId"` + // The agreement identifier. + Id string `json:"id"` + // The agreement name. + Name string `json:"name"` +} diff --git a/jcapiv2/model_connectwise_company.go b/jcapiv2/model_connectwise_company.go new file mode 100644 index 0000000..4218ab8 --- /dev/null +++ b/jcapiv2/model_connectwise_company.go @@ -0,0 +1,18 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +// Connectwise company details +type ConnectwiseCompany struct { + // The company identifier. + Id string `json:"id"` + // The company name. + Name string `json:"name"` +} diff --git a/jcapiv2/model_connectwise_company_resp.go b/jcapiv2/model_connectwise_company_resp.go new file mode 100644 index 0000000..37b1f05 --- /dev/null +++ b/jcapiv2/model_connectwise_company_resp.go @@ -0,0 +1,16 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +// Response for retrieving ConnectWise companies +type ConnectwiseCompanyResp struct { + Records []ConnectwiseCompany `json:"records"` + TotalCount int32 `json:"totalCount"` +} diff --git a/jcapiv2/model_connectwise_company_type_resp.go b/jcapiv2/model_connectwise_company_type_resp.go new file mode 100644 index 0000000..7ed1c6f --- /dev/null +++ b/jcapiv2/model_connectwise_company_type_resp.go @@ -0,0 +1,16 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +// Response for retrieving ConnectWise company types +type ConnectwiseCompanyTypeResp struct { + Records []BillingIntegrationCompanyType `json:"records"` + TotalCount int32 `json:"totalCount"` +} diff --git a/jcapiv2/model_connectwise_integration.go b/jcapiv2/model_connectwise_integration.go new file mode 100644 index 0000000..c3e93fd --- /dev/null +++ b/jcapiv2/model_connectwise_integration.go @@ -0,0 +1,22 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +// ConnectWise integration configuration details +type ConnectwiseIntegration struct { + // The ConnectWise company identifier. + CompanyId string `json:"companyId"` + // The identifier for this ConnectWise integration. + Id string `json:"id"` + // Has the msp-api been configured with auth data yet + IsMspAuthConfigured bool `json:"isMspAuthConfigured,omitempty"` + // The base url for connecting to ConnectWise. + Url string `json:"url"` +} diff --git a/jcapiv2/model_connectwise_integration_patch_req.go b/jcapiv2/model_connectwise_integration_patch_req.go new file mode 100644 index 0000000..704832d --- /dev/null +++ b/jcapiv2/model_connectwise_integration_patch_req.go @@ -0,0 +1,22 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +// Request for updating a ConnectWise integration +type ConnectwiseIntegrationPatchReq struct { + // The ConnectWise company identifier. + CompanyId string `json:"companyId,omitempty"` + // The ConnectWise private key for authentication + PrivateKey string `json:"privateKey,omitempty"` + // The ConnectWise public key for authentication. + PublicKey string `json:"publicKey,omitempty"` + // The base url for connecting to ConnectWise. + Url string `json:"url,omitempty"` +} diff --git a/jcapiv2/model_connectwise_integration_req.go b/jcapiv2/model_connectwise_integration_req.go new file mode 100644 index 0000000..c365535 --- /dev/null +++ b/jcapiv2/model_connectwise_integration_req.go @@ -0,0 +1,22 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +// Request for creating a ConnectWise integration +type ConnectwiseIntegrationReq struct { + // The ConnectWise company identifier. + CompanyId string `json:"companyId"` + // The ConnectWise private key for authentication + PrivateKey string `json:"privateKey"` + // The ConnectWise public key for authentication. + PublicKey string `json:"publicKey"` + // The base url for connecting to ConnectWise. + Url string `json:"url"` +} diff --git a/jcapiv2/model_custom_email.go b/jcapiv2/model_custom_email.go new file mode 100644 index 0000000..5ff7dfc --- /dev/null +++ b/jcapiv2/model_custom_email.go @@ -0,0 +1,22 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +// Custom email content created by the admin user to personalize emails sent to their system users. +type CustomEmail struct { + Body string `json:"body,omitempty"` + Button string `json:"button,omitempty"` + Header string `json:"header,omitempty"` + Id string `json:"id,omitempty"` + NextStepContactInfo string `json:"nextStepContactInfo,omitempty"` + Subject string `json:"subject"` + Title string `json:"title,omitempty"` + Type_ *CustomEmailType `json:"type"` +} diff --git a/jcapiv2/model_custom_email_template.go b/jcapiv2/model_custom_email_template.go new file mode 100644 index 0000000..a258240 --- /dev/null +++ b/jcapiv2/model_custom_email_template.go @@ -0,0 +1,17 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +type CustomEmailTemplate struct { + Description string `json:"description,omitempty"` + DisplayName string `json:"displayName,omitempty"` + Fields []CustomEmailTemplateField `json:"fields,omitempty"` + Type_ *CustomEmailType `json:"type,omitempty"` +} diff --git a/jcapiv2/model_custom_email_template_field.go b/jcapiv2/model_custom_email_template_field.go new file mode 100644 index 0000000..04dff7c --- /dev/null +++ b/jcapiv2/model_custom_email_template_field.go @@ -0,0 +1,17 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +type CustomEmailTemplateField struct { + DefaultValue string `json:"defaultValue,omitempty"` + DisplayName string `json:"displayName,omitempty"` + Field string `json:"field,omitempty"` + Multiline bool `json:"multiline,omitempty"` +} diff --git a/jcapiv2/model_custom_email_type.go b/jcapiv2/model_custom_email_type.go new file mode 100644 index 0000000..7445b24 --- /dev/null +++ b/jcapiv2/model_custom_email_type.go @@ -0,0 +1,24 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +type CustomEmailType string + +// List of CustomEmailType +const ( + ACTIVATE_GAPPS_USER_CustomEmailType CustomEmailType = "activate_gapps_user" + ACTIVATE_O365_USER_CustomEmailType CustomEmailType = "activate_o365_user" + LOCKOUT_NOTICE_USER_CustomEmailType CustomEmailType = "lockout_notice_user" + PASSWORD_EXPIRATION_CustomEmailType CustomEmailType = "password_expiration" + PASSWORD_EXPIRATION_WARNING_CustomEmailType CustomEmailType = "password_expiration_warning" + PASSWORD_RESET_CONFIRMATION_CustomEmailType CustomEmailType = "password_reset_confirmation" + USER_CHANGE_PASSWORD_CustomEmailType CustomEmailType = "user_change_password" + ACTIVATE_USER_CUSTOM_CustomEmailType CustomEmailType = "activate_user_custom" +) diff --git a/jcapiv2/model_dep.go b/jcapiv2/model_dep.go new file mode 100644 index 0000000..37e5f2b --- /dev/null +++ b/jcapiv2/model_dep.go @@ -0,0 +1,17 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +type Dep struct { + // A toggle to determine if DEP registered devices should go through JumpCloud Zero Touch Enrollment. + EnableZeroTouchEnrollment bool `json:"enableZeroTouchEnrollment,omitempty"` + SetupAssistantOptions []DepSetupAssistantOption `json:"setupAssistantOptions,omitempty"` + WelcomeScreen *DepWelcomeScreen `json:"welcomeScreen,omitempty"` +} diff --git a/jcapiv2/model_dep_setup_assistant_option.go b/jcapiv2/model_dep_setup_assistant_option.go new file mode 100644 index 0000000..df2a64a --- /dev/null +++ b/jcapiv2/model_dep_setup_assistant_option.go @@ -0,0 +1,14 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +type DepSetupAssistantOption struct { + Option *SetupAssistantOption `json:"option,omitempty"` +} diff --git a/jcapiv2/model_dep_welcome_screen.go b/jcapiv2/model_dep_welcome_screen.go new file mode 100644 index 0000000..6efd6b0 --- /dev/null +++ b/jcapiv2/model_dep_welcome_screen.go @@ -0,0 +1,19 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +type DepWelcomeScreen struct { + // Text to display on the button on the DEP Welcome Screen. + Button string `json:"button,omitempty"` + // A message to display on the DEP Welcome Screen. + Paragraph string `json:"paragraph,omitempty"` + // The title to display on the DEP Welcome Screen. + Title string `json:"title,omitempty"` +} diff --git a/jcapiv2/model_device_id_erase_body.go b/jcapiv2/model_device_id_erase_body.go new file mode 100644 index 0000000..e1e62ad --- /dev/null +++ b/jcapiv2/model_device_id_erase_body.go @@ -0,0 +1,15 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +type DeviceIdEraseBody struct { + // 6-digit PIN, required for MacOS, to erase the device + Pin string `json:"pin,omitempty"` +} diff --git a/jcapiv2/model_device_id_lock_body.go b/jcapiv2/model_device_id_lock_body.go new file mode 100644 index 0000000..1aa5182 --- /dev/null +++ b/jcapiv2/model_device_id_lock_body.go @@ -0,0 +1,15 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +type DeviceIdLockBody struct { + // 6-digit PIN, required for MacOS, to lock the device + Pin string `json:"pin,omitempty"` +} diff --git a/jcapiv2/model_device_id_restart_body.go b/jcapiv2/model_device_id_restart_body.go new file mode 100644 index 0000000..3a35054 --- /dev/null +++ b/jcapiv2/model_device_id_restart_body.go @@ -0,0 +1,15 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +type DeviceIdRestartBody struct { + // The string to pass when doing a restart and performing a RebuildKernelCache. + KextPaths []string `json:"kextPaths,omitempty"` +} diff --git a/jcapiv2/model_directory.go b/jcapiv2/model_directory.go new file mode 100644 index 0000000..86b04c3 --- /dev/null +++ b/jcapiv2/model_directory.go @@ -0,0 +1,21 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +type Directory struct { + // The ObjectID of the directory. + Id string `json:"id"` + // The name of the directory. + Name string `json:"name"` + // the expiry and error status of the bearer token + OAuthStatus *interface{} `json:"oAuthStatus,omitempty"` + // The type of directory. + Type_ string `json:"type"` +} diff --git a/jcapiv2/model_duo_account.go b/jcapiv2/model_duo_account.go new file mode 100644 index 0000000..00ed825 --- /dev/null +++ b/jcapiv2/model_duo_account.go @@ -0,0 +1,17 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +type DuoAccount struct { + // object ID + Id string `json:"id"` + // Duo application name. + Name string `json:"name,omitempty"` +} diff --git a/jcapiv2/model_duo_application.go b/jcapiv2/model_duo_application.go new file mode 100644 index 0000000..538e7cb --- /dev/null +++ b/jcapiv2/model_duo_application.go @@ -0,0 +1,17 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +type DuoApplication struct { + ApiHost string `json:"apiHost"` + Id string `json:"id"` + IntegrationKey string `json:"integrationKey"` + Name string `json:"name"` +} diff --git a/jcapiv2/model_duo_application_req.go b/jcapiv2/model_duo_application_req.go new file mode 100644 index 0000000..5b6a921 --- /dev/null +++ b/jcapiv2/model_duo_application_req.go @@ -0,0 +1,17 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +type DuoApplicationReq struct { + ApiHost string `json:"apiHost"` + IntegrationKey string `json:"integrationKey"` + Name string `json:"name"` + SecretKey string `json:"secretKey"` +} diff --git a/jcapiv2/model_duo_application_update_req.go b/jcapiv2/model_duo_application_update_req.go new file mode 100644 index 0000000..8402ed5 --- /dev/null +++ b/jcapiv2/model_duo_application_update_req.go @@ -0,0 +1,17 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +type DuoApplicationUpdateReq struct { + ApiHost string `json:"apiHost"` + IntegrationKey string `json:"integrationKey"` + Name string `json:"name"` + SecretKey string `json:"secretKey,omitempty"` +} diff --git a/jcapiv2/model_error.go b/jcapiv2/model_error.go new file mode 100644 index 0000000..e402279 --- /dev/null +++ b/jcapiv2/model_error.go @@ -0,0 +1,19 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +type ModelError struct { + // HTTP status code + Code int32 `json:"code,omitempty"` + // Error message + Message string `json:"message,omitempty"` + // HTTP status description + Status string `json:"status,omitempty"` +} diff --git a/jcapiv2/model_error_details.go b/jcapiv2/model_error_details.go new file mode 100644 index 0000000..cdc3fef --- /dev/null +++ b/jcapiv2/model_error_details.go @@ -0,0 +1,21 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +type ErrorDetails struct { + // HTTP status code + Code int32 `json:"code,omitempty"` + // Error message + Message string `json:"message,omitempty"` + // HTTP status description + Status string `json:"status,omitempty"` + // Describes a list of objects with more detailed information of the given error. Each detail schema is according to one of the messages defined in Google's API: https://github.com/googleapis/googleapis/blob/master/google/rpc/error_details.proto + Details []interface{} `json:"details,omitempty"` +} diff --git a/jcapiv2/model_feature.go b/jcapiv2/model_feature.go new file mode 100644 index 0000000..d426212 --- /dev/null +++ b/jcapiv2/model_feature.go @@ -0,0 +1,16 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +// A feature represents JumpCloud functionality. +type Feature struct { + // The unique identifier for this feature. + Name string `json:"name,omitempty"` +} diff --git a/jcapiv2/model_filter.go b/jcapiv2/model_filter.go new file mode 100644 index 0000000..ad0e3c5 --- /dev/null +++ b/jcapiv2/model_filter.go @@ -0,0 +1,20 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +// Filter for a field. +type Filter struct { + // Name of field in filter target object. + Field string `json:"field"` + // Filter comparison operator. + Operator string `json:"operator"` + // Filter comparison value. + Value string `json:"value"` +} diff --git a/jcapiv2/model_filter_query.go b/jcapiv2/model_filter_query.go new file mode 100644 index 0000000..e782cab --- /dev/null +++ b/jcapiv2/model_filter_query.go @@ -0,0 +1,16 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +// Query using a sequence of field filters. +type FilterQuery struct { + QueryType string `json:"queryType"` + Filters []Filter `json:"filters,omitempty"` +} diff --git a/jcapiv2/model_g_suite_builtin_translation.go b/jcapiv2/model_g_suite_builtin_translation.go new file mode 100644 index 0000000..68f98a8 --- /dev/null +++ b/jcapiv2/model_g_suite_builtin_translation.go @@ -0,0 +1,32 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 +// GSuiteBuiltinTranslation : Built-in translations for G Suite export: * `user_home_addresses` - Translate all JumpCloud user addresses of type `home` to G Suite Directory user addresses of type `home` * `user_work_addresses` - Translate all JumpCloud user addresses of type `work` to G Suite Directory user addresses of type `work` * `user_other_addresses` - Translate all JumpCloud user addresses of type `other` to G Suite Directory user addresses of type `other` * `user_home_phone_numbers` - Translate all JumpCloud user phoneNumbers of type `home` to G Suite Directory user phones of type `home` * `user_mobile_phone_numbers` - Translate all JumpCloud user phoneNumbers of type `mobile` to G Suite Directory user phones of type `mobile` * `user_other_phone_numbers` - Translate all JumpCloud user phoneNumbers of type `other` to G Suite Directory user phones of type `other` * `user_work_phone_numbers` - Translate all JumpCloud user phoneNumbers of type `work` to G Suite Directory user phones of type `work` * `user_work_fax_phone_numbers` - Translate all JumpCloud user phoneNumbers of type `work_fax` to G Suite Directory user phones of type `work_fax` * `user_work_mobile_phone_numbers` - Translate all JumpCloud user phoneNumbers of type `work_mobile` to G Suite Directory user phones of type `work_mobile` * `user_manager` - Translate JumpCloud user `manager` to G Suite Directory user `relations-manager` * `user_primary_organization_cost_center` - Translate JumpCloud user `costCenter` to G Suite Directory user `costCenter` for `primary` organization * `user_primary_organization_department` - Translate JumpCloud user `department` to G Suite Directory user `department` for `primary` organization * `user_primary_organization_description` - Translate JumpCloud user `employeeType` to G Suite Directory user `description` for `primary` organization * `user_primary_organization_employee_id` - Translate JumpCloud user `employeeIdentifier` to G Suite Directory user `externalIds` element of type `organization` * `user_primary_organization_title` - Translate JumpCloud user `jobTitle` to G Suite Directory user `title` for `primary` organization * `user_alternate_email` - Translate JumpCloud user `alternateEmail` to G Suite Directory user `emails` +type GSuiteBuiltinTranslation string + +// List of GSuiteBuiltinTranslation +const ( + HOME_ADDRESSES_GSuiteBuiltinTranslation GSuiteBuiltinTranslation = "user_home_addresses" + WORK_ADDRESSES_GSuiteBuiltinTranslation GSuiteBuiltinTranslation = "user_work_addresses" + OTHER_ADDRESSES_GSuiteBuiltinTranslation GSuiteBuiltinTranslation = "user_other_addresses" + HOME_PHONE_NUMBERS_GSuiteBuiltinTranslation GSuiteBuiltinTranslation = "user_home_phone_numbers" + MOBILE_PHONE_NUMBERS_GSuiteBuiltinTranslation GSuiteBuiltinTranslation = "user_mobile_phone_numbers" + OTHER_PHONE_NUMBERS_GSuiteBuiltinTranslation GSuiteBuiltinTranslation = "user_other_phone_numbers" + WORK_PHONE_NUMBERS_GSuiteBuiltinTranslation GSuiteBuiltinTranslation = "user_work_phone_numbers" + WORK_FAX_PHONE_NUMBERS_GSuiteBuiltinTranslation GSuiteBuiltinTranslation = "user_work_fax_phone_numbers" + WORK_MOBILE_PHONE_NUMBERS_GSuiteBuiltinTranslation GSuiteBuiltinTranslation = "user_work_mobile_phone_numbers" + MANAGER_GSuiteBuiltinTranslation GSuiteBuiltinTranslation = "user_manager" + ALTERNATE_EMAIL_GSuiteBuiltinTranslation GSuiteBuiltinTranslation = "user_alternate_email" + PRIMARY_ORGANIZATION_COST_CENTER_GSuiteBuiltinTranslation GSuiteBuiltinTranslation = "user_primary_organization_cost_center" + PRIMARY_ORGANIZATION_DEPARTMENT_GSuiteBuiltinTranslation GSuiteBuiltinTranslation = "user_primary_organization_department" + PRIMARY_ORGANIZATION_DESCRIPTION_GSuiteBuiltinTranslation GSuiteBuiltinTranslation = "user_primary_organization_description" + PRIMARY_ORGANIZATION_EMPLOYEE_ID_GSuiteBuiltinTranslation GSuiteBuiltinTranslation = "user_primary_organization_employee_id" + PRIMARY_ORGANIZATION_TITLE_GSuiteBuiltinTranslation GSuiteBuiltinTranslation = "user_primary_organization_title" +) diff --git a/jcapiv2/model_g_suite_direction_translation.go b/jcapiv2/model_g_suite_direction_translation.go new file mode 100644 index 0000000..378b56f --- /dev/null +++ b/jcapiv2/model_g_suite_direction_translation.go @@ -0,0 +1,18 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 +// GSuiteDirectionTranslation : Direction identify if an attribute is going to be exported or imported from GSuite * `Import`- The data will be imported from GSuite into the user modal * `Export`- The data will be exported from the user modal to GSuite +type GSuiteDirectionTranslation string + +// List of GSuiteDirectionTranslation +const ( + EXPORT_GSuiteDirectionTranslation GSuiteDirectionTranslation = "export" + IMPORT__GSuiteDirectionTranslation GSuiteDirectionTranslation = "import" +) diff --git a/jcapiv2/model_g_suite_translation_rule.go b/jcapiv2/model_g_suite_translation_rule.go new file mode 100644 index 0000000..bcbfed9 --- /dev/null +++ b/jcapiv2/model_g_suite_translation_rule.go @@ -0,0 +1,17 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +type GSuiteTranslationRule struct { + BuiltIn *GSuiteBuiltinTranslation `json:"builtIn,omitempty"` + Direction *GSuiteDirectionTranslation `json:"direction,omitempty"` + // ObjectId uniquely identifying a Translation Rule. + Id string `json:"id,omitempty"` +} diff --git a/jcapiv2/model_g_suite_translation_rule_request.go b/jcapiv2/model_g_suite_translation_rule_request.go new file mode 100644 index 0000000..c241984 --- /dev/null +++ b/jcapiv2/model_g_suite_translation_rule_request.go @@ -0,0 +1,15 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +type GSuiteTranslationRuleRequest struct { + BuiltIn *GSuiteBuiltinTranslation `json:"builtIn,omitempty"` + Direction *GSuiteDirectionTranslation `json:"direction,omitempty"` +} diff --git a/jcapiv2/model_graph_attribute_ldap_groups.go b/jcapiv2/model_graph_attribute_ldap_groups.go new file mode 100644 index 0000000..14365f6 --- /dev/null +++ b/jcapiv2/model_graph_attribute_ldap_groups.go @@ -0,0 +1,15 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +// List of LDAP groups to provision when this JumpCloud group is bound to an LDAP instance. +type GraphAttributeLdapGroups struct { + LdapGroups []LdapGroup `json:"ldapGroups,omitempty"` +} diff --git a/jcapiv2/model_graph_attribute_posix_groups.go b/jcapiv2/model_graph_attribute_posix_groups.go new file mode 100644 index 0000000..2c204cc --- /dev/null +++ b/jcapiv2/model_graph_attribute_posix_groups.go @@ -0,0 +1,15 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +// List of POSIX groups to provision when this JumpCloud group is bound to a supported resource. +type GraphAttributePosixGroups struct { + PosixGroups []GraphAttributePosixGroupsPosixGroups `json:"posixGroups,omitempty"` +} diff --git a/jcapiv2/model_graph_attribute_posix_groups_posix_groups.go b/jcapiv2/model_graph_attribute_posix_groups_posix_groups.go new file mode 100644 index 0000000..f200d4c --- /dev/null +++ b/jcapiv2/model_graph_attribute_posix_groups_posix_groups.go @@ -0,0 +1,15 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +type GraphAttributePosixGroupsPosixGroups struct { + Id int32 `json:"id"` + Name string `json:"name"` +} diff --git a/jcapiv2/model_graph_attribute_radius.go b/jcapiv2/model_graph_attribute_radius.go new file mode 100644 index 0000000..902f0d6 --- /dev/null +++ b/jcapiv2/model_graph_attribute_radius.go @@ -0,0 +1,15 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +// RADIUS reply attributes are returned in the Access-Accept messages sent to endpoints that authenticate with JumpCloud RADIUS. +type GraphAttributeRadius struct { + Radius *GraphAttributeRadiusRadius `json:"radius,omitempty"` +} diff --git a/jcapiv2/model_graph_attribute_radius_radius.go b/jcapiv2/model_graph_attribute_radius_radius.go new file mode 100644 index 0000000..21c13a9 --- /dev/null +++ b/jcapiv2/model_graph_attribute_radius_radius.go @@ -0,0 +1,14 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +type GraphAttributeRadiusRadius struct { + Reply []GraphAttributeRadiusRadiusReply `json:"reply,omitempty"` +} diff --git a/jcapiv2/model_graph_attribute_radius_radius_reply.go b/jcapiv2/model_graph_attribute_radius_radius_reply.go new file mode 100644 index 0000000..aee6bdc --- /dev/null +++ b/jcapiv2/model_graph_attribute_radius_radius_reply.go @@ -0,0 +1,15 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +type GraphAttributeRadiusRadiusReply struct { + Name string `json:"name"` + Value string `json:"value"` +} diff --git a/jcapiv2/model_graph_attribute_samba_enabled.go b/jcapiv2/model_graph_attribute_samba_enabled.go new file mode 100644 index 0000000..dd1d09b --- /dev/null +++ b/jcapiv2/model_graph_attribute_samba_enabled.go @@ -0,0 +1,15 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +// Enabling Samba support allows for LDAP users to authenticate to endpoints that require Samba attributes within the LDAP directory +type GraphAttributeSambaEnabled struct { + SambaEnabled bool `json:"sambaEnabled,omitempty"` +} diff --git a/jcapiv2/model_graph_attribute_sudo.go b/jcapiv2/model_graph_attribute_sudo.go new file mode 100644 index 0000000..b1f444c --- /dev/null +++ b/jcapiv2/model_graph_attribute_sudo.go @@ -0,0 +1,15 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +// Setting user access controls in order to grant administrator permissions +type GraphAttributeSudo struct { + Sudo *GraphAttributeSudoSudo `json:"sudo,omitempty"` +} diff --git a/jcapiv2/model_graph_attribute_sudo_sudo.go b/jcapiv2/model_graph_attribute_sudo_sudo.go new file mode 100644 index 0000000..eda25e1 --- /dev/null +++ b/jcapiv2/model_graph_attribute_sudo_sudo.go @@ -0,0 +1,17 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +type GraphAttributeSudoSudo struct { + // Enables sudo + Enabled bool `json:"enabled"` + // Enable sudo without password (requires 'enabled' to be true) + WithoutPassword bool `json:"withoutPassword"` +} diff --git a/jcapiv2/model_graph_attributes.go b/jcapiv2/model_graph_attributes.go new file mode 100644 index 0000000..5f7ec5b --- /dev/null +++ b/jcapiv2/model_graph_attributes.go @@ -0,0 +1,14 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +// The graph attributes. +type GraphAttributes struct { +} diff --git a/jcapiv2/model_graph_connection.go b/jcapiv2/model_graph_connection.go new file mode 100644 index 0000000..9efcd4d --- /dev/null +++ b/jcapiv2/model_graph_connection.go @@ -0,0 +1,17 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +// Represents an edge between two graph objects. From can be omitted if it is clear from context. +type GraphConnection struct { + Attributes *GraphAttributes `json:"attributes,omitempty"` + From *GraphObject `json:"from,omitempty"` + To *GraphObject `json:"to"` +} diff --git a/jcapiv2/model_graph_object.go b/jcapiv2/model_graph_object.go new file mode 100644 index 0000000..dfe5adf --- /dev/null +++ b/jcapiv2/model_graph_object.go @@ -0,0 +1,18 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +type GraphObject struct { + Attributes *GraphAttributes `json:"attributes,omitempty"` + // The ObjectID of the graph object. + Id string `json:"id"` + // The type of graph object. + Type_ string `json:"type"` +} diff --git a/jcapiv2/model_graph_object_with_paths.go b/jcapiv2/model_graph_object_with_paths.go new file mode 100644 index 0000000..01384b8 --- /dev/null +++ b/jcapiv2/model_graph_object_with_paths.go @@ -0,0 +1,19 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +type GraphObjectWithPaths struct { + CompiledAttributes *GraphAttributes `json:"compiledAttributes,omitempty"` + // Object ID of this graph object. + Id string `json:"id"` + // A path through the graph between two graph objects. + Paths [][]GraphConnection `json:"paths"` + Type_ *GraphType `json:"type"` +} diff --git a/jcapiv2/model_graph_operation.go b/jcapiv2/model_graph_operation.go new file mode 100644 index 0000000..07ace42 --- /dev/null +++ b/jcapiv2/model_graph_operation.go @@ -0,0 +1,17 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +type GraphOperation struct { + // The ObjectID of graph object being added or removed as an association. + Id string `json:"id"` + // How to modify the graph connection. + Op string `json:"op"` +} diff --git a/jcapiv2/model_graph_operation_active_directory.go b/jcapiv2/model_graph_operation_active_directory.go new file mode 100644 index 0000000..299bdf3 --- /dev/null +++ b/jcapiv2/model_graph_operation_active_directory.go @@ -0,0 +1,20 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +type GraphOperationActiveDirectory struct { + // The ObjectID of graph object being added or removed as an association. + Id string `json:"id"` + // How to modify the graph connection. + Op string `json:"op"` + Attributes *GraphAttributes `json:"attributes,omitempty"` + // Targets which a \"active_directory\" can be associated to. + Type_ string `json:"type"` +} diff --git a/jcapiv2/model_graph_operation_application.go b/jcapiv2/model_graph_operation_application.go new file mode 100644 index 0000000..63c87d7 --- /dev/null +++ b/jcapiv2/model_graph_operation_application.go @@ -0,0 +1,20 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +type GraphOperationApplication struct { + // The ObjectID of graph object being added or removed as an association. + Id string `json:"id"` + // How to modify the graph connection. + Op string `json:"op"` + Attributes *GraphAttributes `json:"attributes,omitempty"` + // Targets which a \"application\" can be associated to. + Type_ string `json:"type"` +} diff --git a/jcapiv2/model_graph_operation_command.go b/jcapiv2/model_graph_operation_command.go new file mode 100644 index 0000000..8235a24 --- /dev/null +++ b/jcapiv2/model_graph_operation_command.go @@ -0,0 +1,20 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +type GraphOperationCommand struct { + // The ObjectID of graph object being added or removed as an association. + Id string `json:"id"` + // How to modify the graph connection. + Op string `json:"op"` + Attributes *GraphAttributes `json:"attributes,omitempty"` + // Targets which a \"command\" can be associated to. + Type_ string `json:"type"` +} diff --git a/jcapiv2/model_graph_operation_g_suite.go b/jcapiv2/model_graph_operation_g_suite.go new file mode 100644 index 0000000..5ce48a0 --- /dev/null +++ b/jcapiv2/model_graph_operation_g_suite.go @@ -0,0 +1,20 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +type GraphOperationGSuite struct { + // The ObjectID of graph object being added or removed as an association. + Id string `json:"id"` + // How to modify the graph connection. + Op string `json:"op"` + Attributes *GraphAttributes `json:"attributes,omitempty"` + // Targets which a \"g_suite\" can be associated to. + Type_ string `json:"type"` +} diff --git a/jcapiv2/model_graph_operation_ldap_server.go b/jcapiv2/model_graph_operation_ldap_server.go new file mode 100644 index 0000000..a546887 --- /dev/null +++ b/jcapiv2/model_graph_operation_ldap_server.go @@ -0,0 +1,20 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +type GraphOperationLdapServer struct { + // The ObjectID of graph object being added or removed as an association. + Id string `json:"id"` + // How to modify the graph connection. + Op string `json:"op"` + Attributes *GraphAttributes `json:"attributes,omitempty"` + // Targets which a \"ldap_server\" can be associated to. + Type_ string `json:"type"` +} diff --git a/jcapiv2/model_graph_operation_office365.go b/jcapiv2/model_graph_operation_office365.go new file mode 100644 index 0000000..5ea9d80 --- /dev/null +++ b/jcapiv2/model_graph_operation_office365.go @@ -0,0 +1,20 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +type GraphOperationOffice365 struct { + // The ObjectID of graph object being added or removed as an association. + Id string `json:"id"` + // How to modify the graph connection. + Op string `json:"op"` + Attributes *GraphAttributes `json:"attributes,omitempty"` + // Targets which a \"office_365\" can be associated to. + Type_ string `json:"type"` +} diff --git a/jcapiv2/model_graph_operation_policy.go b/jcapiv2/model_graph_operation_policy.go new file mode 100644 index 0000000..e228506 --- /dev/null +++ b/jcapiv2/model_graph_operation_policy.go @@ -0,0 +1,20 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +type GraphOperationPolicy struct { + // The ObjectID of graph object being added or removed as an association. + Id string `json:"id"` + // How to modify the graph connection. + Op string `json:"op"` + Attributes *GraphAttributes `json:"attributes,omitempty"` + // Targets which a \"policy\" can be associated to. + Type_ string `json:"type"` +} diff --git a/jcapiv2/model_graph_operation_policy_group.go b/jcapiv2/model_graph_operation_policy_group.go new file mode 100644 index 0000000..93b2cc8 --- /dev/null +++ b/jcapiv2/model_graph_operation_policy_group.go @@ -0,0 +1,20 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +type GraphOperationPolicyGroup struct { + // The ObjectID of graph object being added or removed as an association. + Id string `json:"id"` + // How to modify the graph connection. + Op string `json:"op"` + Attributes *GraphAttributes `json:"attributes,omitempty"` + // Targets which a \"policy_group\" can be associated to. + Type_ string `json:"type"` +} diff --git a/jcapiv2/model_graph_operation_policy_group_member.go b/jcapiv2/model_graph_operation_policy_group_member.go new file mode 100644 index 0000000..e159e10 --- /dev/null +++ b/jcapiv2/model_graph_operation_policy_group_member.go @@ -0,0 +1,20 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +type GraphOperationPolicyGroupMember struct { + // The ObjectID of graph object being added or removed as an association. + Id string `json:"id"` + // How to modify the graph connection. + Op string `json:"op"` + Attributes *GraphAttributes `json:"attributes,omitempty"` + // The member type. + Type_ string `json:"type"` +} diff --git a/jcapiv2/model_graph_operation_radius_server.go b/jcapiv2/model_graph_operation_radius_server.go new file mode 100644 index 0000000..42b29eb --- /dev/null +++ b/jcapiv2/model_graph_operation_radius_server.go @@ -0,0 +1,20 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +type GraphOperationRadiusServer struct { + // The ObjectID of graph object being added or removed as an association. + Id string `json:"id"` + // How to modify the graph connection. + Op string `json:"op"` + Attributes *GraphAttributes `json:"attributes,omitempty"` + // Targets which a \"radius_server\" can be associated to. + Type_ string `json:"type"` +} diff --git a/jcapiv2/model_graph_operation_software_app.go b/jcapiv2/model_graph_operation_software_app.go new file mode 100644 index 0000000..a570236 --- /dev/null +++ b/jcapiv2/model_graph_operation_software_app.go @@ -0,0 +1,20 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +type GraphOperationSoftwareApp struct { + // The ObjectID of graph object being added or removed as an association. + Id string `json:"id"` + // How to modify the graph connection. + Op string `json:"op"` + Attributes *GraphAttributes `json:"attributes,omitempty"` + // Targets which a \"software_app\" can be associated to. + Type_ string `json:"type"` +} diff --git a/jcapiv2/model_graph_operation_system.go b/jcapiv2/model_graph_operation_system.go new file mode 100644 index 0000000..0fc90a2 --- /dev/null +++ b/jcapiv2/model_graph_operation_system.go @@ -0,0 +1,20 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +type GraphOperationSystem struct { + // The ObjectID of graph object being added or removed as an association. + Id string `json:"id"` + // How to modify the graph connection. + Op string `json:"op"` + Attributes *interface{} `json:"attributes,omitempty"` + // Targets which a \"system\" can be associated to. + Type_ string `json:"type"` +} diff --git a/jcapiv2/model_graph_operation_system_group.go b/jcapiv2/model_graph_operation_system_group.go new file mode 100644 index 0000000..4a80d17 --- /dev/null +++ b/jcapiv2/model_graph_operation_system_group.go @@ -0,0 +1,20 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +type GraphOperationSystemGroup struct { + // The ObjectID of graph object being added or removed as an association. + Id string `json:"id"` + // How to modify the graph connection. + Op string `json:"op"` + Attributes *GraphAttributes `json:"attributes,omitempty"` + // Targets which a \"system_group\" can be associated to. + Type_ string `json:"type"` +} diff --git a/jcapiv2/model_graph_operation_system_group_member.go b/jcapiv2/model_graph_operation_system_group_member.go new file mode 100644 index 0000000..232aeec --- /dev/null +++ b/jcapiv2/model_graph_operation_system_group_member.go @@ -0,0 +1,20 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +type GraphOperationSystemGroupMember struct { + // The ObjectID of graph object being added or removed as an association. + Id string `json:"id"` + // How to modify the graph connection. + Op string `json:"op"` + Attributes *GraphAttributes `json:"attributes,omitempty"` + // The member type. + Type_ string `json:"type"` +} diff --git a/jcapiv2/model_graph_operation_user.go b/jcapiv2/model_graph_operation_user.go new file mode 100644 index 0000000..08e65c5 --- /dev/null +++ b/jcapiv2/model_graph_operation_user.go @@ -0,0 +1,20 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +type GraphOperationUser struct { + // The ObjectID of graph object being added or removed as an association. + Id string `json:"id"` + // How to modify the graph connection. + Op string `json:"op"` + Attributes *interface{} `json:"attributes,omitempty"` + // Targets which a \"user\" can be associated to. + Type_ string `json:"type"` +} diff --git a/jcapiv2/model_graph_operation_user_group.go b/jcapiv2/model_graph_operation_user_group.go new file mode 100644 index 0000000..d32286a --- /dev/null +++ b/jcapiv2/model_graph_operation_user_group.go @@ -0,0 +1,20 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +type GraphOperationUserGroup struct { + // The ObjectID of graph object being added or removed as an association. + Id string `json:"id"` + // How to modify the graph connection. + Op string `json:"op"` + Attributes *GraphAttributes `json:"attributes,omitempty"` + // Targets which a \"user_group\" can be associated to. + Type_ string `json:"type"` +} diff --git a/jcapiv2/model_graph_operation_user_group_member.go b/jcapiv2/model_graph_operation_user_group_member.go new file mode 100644 index 0000000..ee33122 --- /dev/null +++ b/jcapiv2/model_graph_operation_user_group_member.go @@ -0,0 +1,20 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +type GraphOperationUserGroupMember struct { + // The ObjectID of graph object being added or removed as an association. + Id string `json:"id"` + // How to modify the graph connection. + Op string `json:"op"` + Attributes *GraphAttributes `json:"attributes,omitempty"` + // The member type. + Type_ string `json:"type"` +} diff --git a/jcapiv2/model_graph_type.go b/jcapiv2/model_graph_type.go new file mode 100644 index 0000000..49e348f --- /dev/null +++ b/jcapiv2/model_graph_type.go @@ -0,0 +1,29 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 +// GraphType : A graph object type. +type GraphType string + +// List of GraphType +const ( + ACTIVE_DIRECTORY_GraphType GraphType = "active_directory" + APPLICATION_GraphType GraphType = "application" + COMMAND_GraphType GraphType = "command" + G_SUITE_GraphType GraphType = "g_suite" + LDAP_SERVER_GraphType GraphType = "ldap_server" + OFFICE_365_GraphType GraphType = "office_365" + POLICY_GraphType GraphType = "policy" + POLICY_GROUP_GraphType GraphType = "policy_group" + RADIUS_SERVER_GraphType GraphType = "radius_server" + SYSTEM_GraphType GraphType = "system" + SYSTEM_GROUP_GraphType GraphType = "system_group" + USER_GraphType GraphType = "user" + USER_GROUP_GraphType GraphType = "user_group" +) diff --git a/jcapiv2/model_group.go b/jcapiv2/model_group.go new file mode 100644 index 0000000..bebd354 --- /dev/null +++ b/jcapiv2/model_group.go @@ -0,0 +1,23 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +type Group struct { + Attributes *GraphAttributes `json:"attributes,omitempty"` + // Description of a Group + Description string `json:"description,omitempty"` + // E-mail address associated with a Group + Email string `json:"email,omitempty"` + // ObjectId uniquely identifying a Group. + Id string `json:"id,omitempty"` + // Display name of a Group. + Name string `json:"name,omitempty"` + Type_ *GroupType `json:"type,omitempty"` +} diff --git a/jcapiv2/model_group_attributes_user_group.go b/jcapiv2/model_group_attributes_user_group.go new file mode 100644 index 0000000..32c5a9a --- /dev/null +++ b/jcapiv2/model_group_attributes_user_group.go @@ -0,0 +1,19 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +// The graph attributes for a UserGroup. +type GroupAttributesUserGroup struct { + Sudo *GraphAttributeSudoSudo `json:"sudo,omitempty"` + LdapGroups []LdapGroup `json:"ldapGroups,omitempty"` + PosixGroups []GraphAttributePosixGroupsPosixGroups `json:"posixGroups,omitempty"` + Radius *GraphAttributeRadiusRadius `json:"radius,omitempty"` + SambaEnabled bool `json:"sambaEnabled,omitempty"` +} diff --git a/jcapiv2/model_group_id_suggestions_body.go b/jcapiv2/model_group_id_suggestions_body.go new file mode 100644 index 0000000..0715c29 --- /dev/null +++ b/jcapiv2/model_group_id_suggestions_body.go @@ -0,0 +1,14 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +type GroupIdSuggestionsBody struct { + UserIds []string `json:"user_ids,omitempty"` +} diff --git a/jcapiv2/model_group_type.go b/jcapiv2/model_group_type.go new file mode 100644 index 0000000..e9e57af --- /dev/null +++ b/jcapiv2/model_group_type.go @@ -0,0 +1,19 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 +// GroupType : The group type. +type GroupType string + +// List of GroupType +const ( + POLICY_GROUP_GroupType GroupType = "policy_group" + SYSTEM_GROUP_GroupType GroupType = "system_group" + USER_GROUP_GroupType GroupType = "user_group" +) diff --git a/jcapiv2/model_gsuite_output.go b/jcapiv2/model_gsuite_output.go new file mode 100644 index 0000000..af15467 --- /dev/null +++ b/jcapiv2/model_gsuite_output.go @@ -0,0 +1,18 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +type GsuiteOutput struct { + GroupsEnabled bool `json:"groupsEnabled,omitempty"` + Id string `json:"id,omitempty"` + Name string `json:"name,omitempty"` + UserLockoutAction string `json:"userLockoutAction,omitempty"` + UserPasswordExpirationAction string `json:"userPasswordExpirationAction,omitempty"` +} diff --git a/jcapiv2/model_gsuite_patch_input.go b/jcapiv2/model_gsuite_patch_input.go new file mode 100644 index 0000000..606f5db --- /dev/null +++ b/jcapiv2/model_gsuite_patch_input.go @@ -0,0 +1,17 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +type GsuitePatchInput struct { + GroupsEnabled bool `json:"groupsEnabled,omitempty"` + Name string `json:"name,omitempty"` + UserLockoutAction string `json:"userLockoutAction,omitempty"` + UserPasswordExpirationAction string `json:"userPasswordExpirationAction,omitempty"` +} diff --git a/jcapiv2/model_import_user.go b/jcapiv2/model_import_user.go new file mode 100644 index 0000000..ea0f889 --- /dev/null +++ b/jcapiv2/model_import_user.go @@ -0,0 +1,30 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +type ImportUser struct { + Addresses []ImportUserAddress `json:"addresses,omitempty"` + Company string `json:"company,omitempty"` + CostCenter string `json:"costCenter,omitempty"` + Department string `json:"department,omitempty"` + Displayname string `json:"displayname,omitempty"` + Email string `json:"email,omitempty"` + EmployeeIdentifier string `json:"employeeIdentifier,omitempty"` + EmployeeType string `json:"employeeType,omitempty"` + Firstname string `json:"firstname,omitempty"` + Id string `json:"id,omitempty"` + JobTitle string `json:"jobTitle,omitempty"` + Lastname string `json:"lastname,omitempty"` + Location string `json:"location,omitempty"` + Manager string `json:"manager,omitempty"` + Middlename string `json:"middlename,omitempty"` + PhoneNumbers []ImportUserPhoneNumber `json:"phoneNumbers,omitempty"` + Username string `json:"username,omitempty"` +} diff --git a/jcapiv2/model_import_user_address.go b/jcapiv2/model_import_user_address.go new file mode 100644 index 0000000..31b2e45 --- /dev/null +++ b/jcapiv2/model_import_user_address.go @@ -0,0 +1,19 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +type ImportUserAddress struct { + Country string `json:"country,omitempty"` + Locality string `json:"locality,omitempty"` + PostalCode string `json:"postalCode,omitempty"` + Region string `json:"region,omitempty"` + StreetAddress string `json:"streetAddress,omitempty"` + Type_ string `json:"type,omitempty"` +} diff --git a/jcapiv2/model_import_user_phone_number.go b/jcapiv2/model_import_user_phone_number.go new file mode 100644 index 0000000..b8f6799 --- /dev/null +++ b/jcapiv2/model_import_user_phone_number.go @@ -0,0 +1,15 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +type ImportUserPhoneNumber struct { + Type_ string `json:"type,omitempty"` + Value string `json:"value,omitempty"` +} diff --git a/jcapiv2/model_import_users_response.go b/jcapiv2/model_import_users_response.go new file mode 100644 index 0000000..6dd6988 --- /dev/null +++ b/jcapiv2/model_import_users_response.go @@ -0,0 +1,15 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +type ImportUsersResponse struct { + TotalCount float64 `json:"total_count,omitempty"` + Users []ImportUser `json:"users,omitempty"` +} diff --git a/jcapiv2/model_inline_response_200.go b/jcapiv2/model_inline_response_200.go new file mode 100644 index 0000000..4a83408 --- /dev/null +++ b/jcapiv2/model_inline_response_200.go @@ -0,0 +1,15 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +type InlineResponse200 struct { + EventsCount int32 `json:"events_count,omitempty"` + Results []ScheduledUserstateResult `json:"results,omitempty"` +} diff --git a/jcapiv2/model_inline_response_200_1.go b/jcapiv2/model_inline_response_200_1.go new file mode 100644 index 0000000..bbfc754 --- /dev/null +++ b/jcapiv2/model_inline_response_200_1.go @@ -0,0 +1,15 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +type InlineResponse2001 struct { + NextPageToken string `json:"nextPageToken,omitempty"` + Users []User `json:"users,omitempty"` +} diff --git a/jcapiv2/model_inline_response_200_10.go b/jcapiv2/model_inline_response_200_10.go new file mode 100644 index 0000000..113f11e --- /dev/null +++ b/jcapiv2/model_inline_response_200_10.go @@ -0,0 +1,17 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +type InlineResponse20010 struct { + Id string `json:"id,omitempty"` + Name string `json:"name,omitempty"` + UserLockoutAction *LdapServerAction `json:"userLockoutAction,omitempty"` + UserPasswordExpirationAction *LdapServerAction `json:"userPasswordExpirationAction,omitempty"` +} diff --git a/jcapiv2/model_inline_response_200_11.go b/jcapiv2/model_inline_response_200_11.go new file mode 100644 index 0000000..c6d3d9e --- /dev/null +++ b/jcapiv2/model_inline_response_200_11.go @@ -0,0 +1,16 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +type InlineResponse20011 struct { + SkipToken string `json:"skipToken,omitempty"` + Top int32 `json:"top,omitempty"` + Users []InlineResponse20011Users `json:"users,omitempty"` +} diff --git a/jcapiv2/model_inline_response_200_11_users.go b/jcapiv2/model_inline_response_200_11_users.go new file mode 100644 index 0000000..58ada75 --- /dev/null +++ b/jcapiv2/model_inline_response_200_11_users.go @@ -0,0 +1,17 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +type InlineResponse20011Users struct { + GivenName string `json:"givenName,omitempty"` + Id string `json:"id,omitempty"` + Surname string `json:"surname,omitempty"` + UserPrincipalName string `json:"userPrincipalName,omitempty"` +} diff --git a/jcapiv2/model_inline_response_200_12.go b/jcapiv2/model_inline_response_200_12.go new file mode 100644 index 0000000..9fd291e --- /dev/null +++ b/jcapiv2/model_inline_response_200_12.go @@ -0,0 +1,15 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +type InlineResponse20012 struct { + Results []Administrator `json:"results,omitempty"` + TotalCount int32 `json:"totalCount,omitempty"` +} diff --git a/jcapiv2/model_inline_response_200_13.go b/jcapiv2/model_inline_response_200_13.go new file mode 100644 index 0000000..2d301d5 --- /dev/null +++ b/jcapiv2/model_inline_response_200_13.go @@ -0,0 +1,15 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +type InlineResponse20013 struct { + Results []Organization `json:"results,omitempty"` + TotalCount int32 `json:"totalCount,omitempty"` +} diff --git a/jcapiv2/model_inline_response_200_2.go b/jcapiv2/model_inline_response_200_2.go new file mode 100644 index 0000000..20af2a7 --- /dev/null +++ b/jcapiv2/model_inline_response_200_2.go @@ -0,0 +1,15 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +type InlineResponse2002 struct { + NextPageToken string `json:"nextPageToken,omitempty"` + Users []InlineResponse2002Users `json:"users,omitempty"` +} diff --git a/jcapiv2/model_inline_response_200_2_users.go b/jcapiv2/model_inline_response_200_2_users.go new file mode 100644 index 0000000..2b211c1 --- /dev/null +++ b/jcapiv2/model_inline_response_200_2_users.go @@ -0,0 +1,18 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +type InlineResponse2002Users struct { + FamilyName string `json:"familyName,omitempty"` + GivenName string `json:"givenName,omitempty"` + Id string `json:"id,omitempty"` + PrimaryEmail string `json:"primaryEmail,omitempty"` + ThumbnailPhotoUrl string `json:"thumbnailPhotoUrl,omitempty"` +} diff --git a/jcapiv2/model_inline_response_200_3.go b/jcapiv2/model_inline_response_200_3.go new file mode 100644 index 0000000..70d07a2 --- /dev/null +++ b/jcapiv2/model_inline_response_200_3.go @@ -0,0 +1,15 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +type InlineResponse2003 struct { + Results []AutotaskContract `json:"results,omitempty"` + TotalCount int32 `json:"totalCount,omitempty"` +} diff --git a/jcapiv2/model_inline_response_200_4.go b/jcapiv2/model_inline_response_200_4.go new file mode 100644 index 0000000..4c8265d --- /dev/null +++ b/jcapiv2/model_inline_response_200_4.go @@ -0,0 +1,15 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +type InlineResponse2004 struct { + Results []AutotaskContractField `json:"results,omitempty"` + TotalCount int32 `json:"totalCount,omitempty"` +} diff --git a/jcapiv2/model_inline_response_200_5.go b/jcapiv2/model_inline_response_200_5.go new file mode 100644 index 0000000..3fc0a8c --- /dev/null +++ b/jcapiv2/model_inline_response_200_5.go @@ -0,0 +1,15 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +type InlineResponse2005 struct { + Results []AutotaskService `json:"results,omitempty"` + TotalCount int32 `json:"totalCount,omitempty"` +} diff --git a/jcapiv2/model_inline_response_200_6.go b/jcapiv2/model_inline_response_200_6.go new file mode 100644 index 0000000..f1d973a --- /dev/null +++ b/jcapiv2/model_inline_response_200_6.go @@ -0,0 +1,15 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +type InlineResponse2006 struct { + Records []AutotaskMappingResponse `json:"records,omitempty"` + TotalCount float64 `json:"totalCount,omitempty"` +} diff --git a/jcapiv2/model_inline_response_200_7.go b/jcapiv2/model_inline_response_200_7.go new file mode 100644 index 0000000..d53e70f --- /dev/null +++ b/jcapiv2/model_inline_response_200_7.go @@ -0,0 +1,15 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +type InlineResponse2007 struct { + Results []ConnectwiseAgreement `json:"results,omitempty"` + TotalCount int32 `json:"totalCount,omitempty"` +} diff --git a/jcapiv2/model_inline_response_200_8.go b/jcapiv2/model_inline_response_200_8.go new file mode 100644 index 0000000..fc3231b --- /dev/null +++ b/jcapiv2/model_inline_response_200_8.go @@ -0,0 +1,15 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +type InlineResponse2008 struct { + Results []ConnectwiseAddition `json:"results,omitempty"` + TotalCount int32 `json:"totalCount,omitempty"` +} diff --git a/jcapiv2/model_inline_response_200_9.go b/jcapiv2/model_inline_response_200_9.go new file mode 100644 index 0000000..18ce3c3 --- /dev/null +++ b/jcapiv2/model_inline_response_200_9.go @@ -0,0 +1,15 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +type InlineResponse2009 struct { + Records []ConnectWiseMappingResponse `json:"records,omitempty"` + TotalCount float64 `json:"totalCount,omitempty"` +} diff --git a/jcapiv2/model_inline_response_201.go b/jcapiv2/model_inline_response_201.go new file mode 100644 index 0000000..2f44eb4 --- /dev/null +++ b/jcapiv2/model_inline_response_201.go @@ -0,0 +1,15 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +type InlineResponse201 struct { + // The identifier of the created integration + IntegrationId string `json:"integrationId"` +} diff --git a/jcapiv2/model_inline_response_400.go b/jcapiv2/model_inline_response_400.go new file mode 100644 index 0000000..b475d73 --- /dev/null +++ b/jcapiv2/model_inline_response_400.go @@ -0,0 +1,14 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +type InlineResponse400 struct { + Message string `json:"message,omitempty"` +} diff --git a/jcapiv2/model_integration.go b/jcapiv2/model_integration.go new file mode 100644 index 0000000..30d6ef2 --- /dev/null +++ b/jcapiv2/model_integration.go @@ -0,0 +1,17 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +// An integration. +type Integration struct { + // Unique identifier for this integration + IntegrationId string `json:"integrationId,omitempty"` + Type_ *IntegrationType `json:"type,omitempty"` +} diff --git a/jcapiv2/model_integration_sync_error.go b/jcapiv2/model_integration_sync_error.go new file mode 100644 index 0000000..1306917 --- /dev/null +++ b/jcapiv2/model_integration_sync_error.go @@ -0,0 +1,18 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +// Integration sync error details +type IntegrationSyncError struct { + ErrorType string `json:"errorType"` + Message string `json:"message"` + OrgId string `json:"orgId"` + Timestamp string `json:"timestamp"` +} diff --git a/jcapiv2/model_integration_sync_error_resp.go b/jcapiv2/model_integration_sync_error_resp.go new file mode 100644 index 0000000..8679586 --- /dev/null +++ b/jcapiv2/model_integration_sync_error_resp.go @@ -0,0 +1,16 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +// Response for retrieving integrations sync errors +type IntegrationSyncErrorResp struct { + Records []IntegrationSyncError `json:"records"` + TotalCount int32 `json:"totalCount"` +} diff --git a/jcapiv2/model_integration_type.go b/jcapiv2/model_integration_type.go new file mode 100644 index 0000000..5f5f32b --- /dev/null +++ b/jcapiv2/model_integration_type.go @@ -0,0 +1,18 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 +// IntegrationType : The type of integration. +type IntegrationType string + +// List of IntegrationType +const ( + AUTOTASK_IntegrationType IntegrationType = "autotask" + CONNECTWISE_IntegrationType IntegrationType = "connectwise" +) diff --git a/jcapiv2/model_integrations_response.go b/jcapiv2/model_integrations_response.go new file mode 100644 index 0000000..89a0bfb --- /dev/null +++ b/jcapiv2/model_integrations_response.go @@ -0,0 +1,16 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +// Response for retrieving integrations. +type IntegrationsResponse struct { + Records []Integration `json:"records,omitempty"` + TotalCount int32 `json:"totalCount,omitempty"` +} diff --git a/jcapiv2/model_ip_list.go b/jcapiv2/model_ip_list.go new file mode 100644 index 0000000..1058d24 --- /dev/null +++ b/jcapiv2/model_ip_list.go @@ -0,0 +1,17 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +type IpList struct { + Description string `json:"description,omitempty"` + Id string `json:"id,omitempty"` + Ips []string `json:"ips,omitempty"` + Name string `json:"name,omitempty"` +} diff --git a/jcapiv2/model_ip_list_request.go b/jcapiv2/model_ip_list_request.go new file mode 100644 index 0000000..ac6860b --- /dev/null +++ b/jcapiv2/model_ip_list_request.go @@ -0,0 +1,16 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +type IpListRequest struct { + Description string `json:"description,omitempty"` + Ips []string `json:"ips,omitempty"` + Name string `json:"name,omitempty"` +} diff --git a/jcapiv2/model_job_id.go b/jcapiv2/model_job_id.go new file mode 100644 index 0000000..b0d3cd3 --- /dev/null +++ b/jcapiv2/model_job_id.go @@ -0,0 +1,14 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +type JobId struct { + JobId string `json:"jobId,omitempty"` +} diff --git a/jcapiv2/model_job_workresult.go b/jcapiv2/model_job_workresult.go new file mode 100644 index 0000000..cec5bdc --- /dev/null +++ b/jcapiv2/model_job_workresult.go @@ -0,0 +1,20 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +type JobWorkresult struct { + CreatedAt string `json:"createdAt,omitempty"` + Id string `json:"id,omitempty"` + Meta *interface{} `json:"meta,omitempty"` + PersistedFields *interface{} `json:"persistedFields,omitempty"` + Status string `json:"status,omitempty"` + StatusMsg string `json:"statusMsg,omitempty"` + UpdatedAt string `json:"updatedAt,omitempty"` +} diff --git a/jcapiv2/model_ldap_group.go b/jcapiv2/model_ldap_group.go new file mode 100644 index 0000000..b7ada43 --- /dev/null +++ b/jcapiv2/model_ldap_group.go @@ -0,0 +1,15 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +// An LDAP group object. +type LdapGroup struct { + Name string `json:"name,omitempty"` +} diff --git a/jcapiv2/model_ldap_server_action.go b/jcapiv2/model_ldap_server_action.go new file mode 100644 index 0000000..4556fe1 --- /dev/null +++ b/jcapiv2/model_ldap_server_action.go @@ -0,0 +1,18 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +type LdapServerAction string + +// List of LdapServerAction +const ( + DISABLE_LdapServerAction LdapServerAction = "disable" + REMOVE_LdapServerAction LdapServerAction = "remove" +) diff --git a/jcapiv2/model_ldap_server_input.go b/jcapiv2/model_ldap_server_input.go new file mode 100644 index 0000000..88a80c5 --- /dev/null +++ b/jcapiv2/model_ldap_server_input.go @@ -0,0 +1,19 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +type LdapServerInput struct { + // The name of this LDAP server + Name string `json:"name,omitempty"` + // action to take; one of 'remove' or 'disable' + UserLockoutAction string `json:"userLockoutAction,omitempty"` + // action to take; one of 'remove' or 'disable' + UserPasswordExpirationAction string `json:"userPasswordExpirationAction,omitempty"` +} diff --git a/jcapiv2/model_ldap_server_output.go b/jcapiv2/model_ldap_server_output.go new file mode 100644 index 0000000..b14d2be --- /dev/null +++ b/jcapiv2/model_ldap_server_output.go @@ -0,0 +1,19 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +type LdapServerOutput struct { + // The name of this LDAP server + Name string `json:"name,omitempty"` + // action to take; one of 'remove' or 'disable' + UserLockoutAction string `json:"userLockoutAction,omitempty"` + // action to take; one of 'remove' or 'disable' + UserPasswordExpirationAction string `json:"userPasswordExpirationAction,omitempty"` +} diff --git a/jcapiv2/model_ldapservers_id_body.go b/jcapiv2/model_ldapservers_id_body.go new file mode 100644 index 0000000..0d4debf --- /dev/null +++ b/jcapiv2/model_ldapservers_id_body.go @@ -0,0 +1,16 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +type LdapserversIdBody struct { + Id string `json:"id,omitempty"` + UserLockoutAction *LdapServerAction `json:"userLockoutAction,omitempty"` + UserPasswordExpirationAction *LdapServerAction `json:"userPasswordExpirationAction,omitempty"` +} diff --git a/jcapiv2/model_member_suggestion.go b/jcapiv2/model_member_suggestion.go new file mode 100644 index 0000000..6d7055e --- /dev/null +++ b/jcapiv2/model_member_suggestion.go @@ -0,0 +1,16 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +type MemberSuggestion struct { + Object *GraphObject `json:"object,omitempty"` + // How to modify group membership. + Op string `json:"op,omitempty"` +} diff --git a/jcapiv2/model_member_suggestions_post_result.go b/jcapiv2/model_member_suggestions_post_result.go new file mode 100644 index 0000000..7958344 --- /dev/null +++ b/jcapiv2/model_member_suggestions_post_result.go @@ -0,0 +1,15 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +type MemberSuggestionsPostResult struct { + SuggestionsFound []string `json:"suggestions_found,omitempty"` + SuggestionsNotFound []string `json:"suggestions_not_found,omitempty"` +} diff --git a/jcapiv2/model_office365_builtin_translation.go b/jcapiv2/model_office365_builtin_translation.go new file mode 100644 index 0000000..44083ed --- /dev/null +++ b/jcapiv2/model_office365_builtin_translation.go @@ -0,0 +1,29 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 +// Office365BuiltinTranslation : Built-in translations for Office 365 (Microsoft Graph) export: * `user_alternate_email` - Translate `alternateEmail` field of JumpCloud user to `otherMails` field of Microsoft Graph `user` * `user_business_phones` - Translate `number` field of first JumpCloud user `phoneNumber` of type `work` to `businessPhones` field of Microsoft Graph `user` * `user_city` - Translate `locality` field of JumpCloud user address of type `work` to `city` field of Microsoft Graph user * `user_country` - Translate `country` field of JumpCloud user address of type `work` to `country` field of Microsoft Graph `user` * `user_department` - Translate `department` field of JumpCloud user to `department` field of Microsoft Graph `user` * `user_job_title` - Translate `jobTitle` field of JumpCloud user to `jobTitle` field of Microsoft Graph `user` * `user_manager` - Translate `manager` field of JumpCloud user to `manager` field of Microsoft Graph `user` * `user_mobile_phone` - Translate `number` field of first JumpCloud user `phoneNumber` of type `mobile` to `mobilePhone` field of Microsoft Graph `user` * `user_office_location` - Translate `location` field of JumpCloud user to `officeLocation` field of Microsoft Graph `user` * `user_postal_code` - Translate `postalCode` field of JumpCloud user address of type `work` to `postalCode` field of Microsoft Graph `user` * `user_principal_name_from_alternate_email` - Translate user `alternateEmail` field of Jumpcloud user to `userPrincipalName` field of Microsoft Graph `user` * `user_state` - Translate `region` field of JumpCloud user address of type `work` to `state` field of Microsoft Graph `user` * `user_street_address` - Translate `streetAddress` field of JumpCloud user address of type `work` to `streetAddress` field of Microsoft Graph user +type Office365BuiltinTranslation string + +// List of Office365BuiltinTranslation +const ( + ALTERNATE_EMAIL_Office365BuiltinTranslation Office365BuiltinTranslation = "user_alternate_email" + BUSINESS_PHONES_Office365BuiltinTranslation Office365BuiltinTranslation = "user_business_phones" + CITY_Office365BuiltinTranslation Office365BuiltinTranslation = "user_city" + COUNTRY_Office365BuiltinTranslation Office365BuiltinTranslation = "user_country" + DEPARTMENT_Office365BuiltinTranslation Office365BuiltinTranslation = "user_department" + JOB_TITLE_Office365BuiltinTranslation Office365BuiltinTranslation = "user_job_title" + MANAGER_Office365BuiltinTranslation Office365BuiltinTranslation = "user_manager" + MOBILE_PHONE_Office365BuiltinTranslation Office365BuiltinTranslation = "user_mobile_phone" + OFFICE_LOCATION_Office365BuiltinTranslation Office365BuiltinTranslation = "user_office_location" + POSTAL_CODE_Office365BuiltinTranslation Office365BuiltinTranslation = "user_postal_code" + PRINCIPAL_NAME_FROM_ALTERNATE_EMAIL_Office365BuiltinTranslation Office365BuiltinTranslation = "user_principal_name_from_alternate_email" + STATE_Office365BuiltinTranslation Office365BuiltinTranslation = "user_state" + STREET_ADDRESS_Office365BuiltinTranslation Office365BuiltinTranslation = "user_street_address" +) diff --git a/jcapiv2/model_office365_direction_translation.go b/jcapiv2/model_office365_direction_translation.go new file mode 100644 index 0000000..ae4e4ec --- /dev/null +++ b/jcapiv2/model_office365_direction_translation.go @@ -0,0 +1,17 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 +// Office365DirectionTranslation : Direction identify if a attribute is going to be exported or imported from Office365 * `Export`- The data will exported from the user modal to Office365 +type Office365DirectionTranslation string + +// List of Office365DirectionTranslation +const ( + EXPORT_Office365DirectionTranslation Office365DirectionTranslation = "export" +) diff --git a/jcapiv2/model_office365_output.go b/jcapiv2/model_office365_output.go new file mode 100644 index 0000000..2311128 --- /dev/null +++ b/jcapiv2/model_office365_output.go @@ -0,0 +1,18 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +type Office365Output struct { + GroupsEnabled bool `json:"groupsEnabled,omitempty"` + Id string `json:"id"` + Name string `json:"name,omitempty"` + UserLockoutAction string `json:"userLockoutAction"` + UserPasswordExpirationAction string `json:"userPasswordExpirationAction"` +} diff --git a/jcapiv2/model_office365_patch_input.go b/jcapiv2/model_office365_patch_input.go new file mode 100644 index 0000000..69d015a --- /dev/null +++ b/jcapiv2/model_office365_patch_input.go @@ -0,0 +1,17 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +type Office365PatchInput struct { + GroupsEnabled bool `json:"groupsEnabled,omitempty"` + Name string `json:"name,omitempty"` + UserLockoutAction string `json:"userLockoutAction,omitempty"` + UserPasswordExpirationAction string `json:"userPasswordExpirationAction,omitempty"` +} diff --git a/jcapiv2/model_office365_translation_rule.go b/jcapiv2/model_office365_translation_rule.go new file mode 100644 index 0000000..41c9a62 --- /dev/null +++ b/jcapiv2/model_office365_translation_rule.go @@ -0,0 +1,17 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +type Office365TranslationRule struct { + BuiltIn *Office365BuiltinTranslation `json:"builtIn,omitempty"` + Direction *Office365DirectionTranslation `json:"direction,omitempty"` + // ObjectId uniquely identifying a Translation Rule. + Id string `json:"id,omitempty"` +} diff --git a/jcapiv2/model_office365_translation_rule_request.go b/jcapiv2/model_office365_translation_rule_request.go new file mode 100644 index 0000000..a5c88ba --- /dev/null +++ b/jcapiv2/model_office365_translation_rule_request.go @@ -0,0 +1,15 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +type Office365TranslationRuleRequest struct { + BuiltIn *Office365BuiltinTranslation `json:"builtIn,omitempty"` + Direction *Office365DirectionTranslation `json:"direction,omitempty"` +} diff --git a/jcapiv2/model_organization.go b/jcapiv2/model_organization.go new file mode 100644 index 0000000..e220c5a --- /dev/null +++ b/jcapiv2/model_organization.go @@ -0,0 +1,17 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +type Organization struct { + Id string `json:"id,omitempty"` + // The maximum number of users allowed in this organization. Requires organizations.billing scope to modify. + MaxSystemUsers int32 `json:"maxSystemUsers,omitempty"` + Name string `json:"name,omitempty"` +} diff --git a/jcapiv2/model_organization_case.go b/jcapiv2/model_organization_case.go new file mode 100644 index 0000000..ecb73b7 --- /dev/null +++ b/jcapiv2/model_organization_case.go @@ -0,0 +1,22 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +// Details of an organization's case (support/feature request) +type OrganizationCase struct { + CaseNumber string `json:"caseNumber,omitempty"` + Date string `json:"date,omitempty"` + Description string `json:"description,omitempty"` + Label string `json:"label,omitempty"` + Reporter string `json:"reporter,omitempty"` + ReporterEmail string `json:"reporterEmail,omitempty"` + Status string `json:"status,omitempty"` + Subject string `json:"subject,omitempty"` +} diff --git a/jcapiv2/model_organization_cases_response.go b/jcapiv2/model_organization_cases_response.go new file mode 100644 index 0000000..95cc832 --- /dev/null +++ b/jcapiv2/model_organization_cases_response.go @@ -0,0 +1,16 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +// Response for retrieving an organization's cases (support/feature requests) +type OrganizationCasesResponse struct { + Results []OrganizationCase `json:"results,omitempty"` + TotalCount int32 `json:"totalCount,omitempty"` +} diff --git a/jcapiv2/model_os_restriction.go b/jcapiv2/model_os_restriction.go new file mode 100644 index 0000000..9966ee1 --- /dev/null +++ b/jcapiv2/model_os_restriction.go @@ -0,0 +1,23 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +// Contains OS properties to restrict the application of policies to devices based on the device's OS +type OsRestriction struct { + AppleRestrictions *OsRestrictionAppleRestrictions `json:"appleRestrictions,omitempty"` + // The version of the OS in which the policy was deprecated + DeprecatedVersion string `json:"deprecatedVersion,omitempty"` + // The earliest version of the OS in which the policy can be applied + EarliestVersion string `json:"earliestVersion,omitempty"` + // The name of the OS in which this restriction applies + OsName string `json:"osName,omitempty"` + // This field is deprecated and will be ignored. Use appleRestrictions.supportedEnrollmentTypes instead + SupportedEnrollmentTypes []string `json:"supportedEnrollmentTypes,omitempty"` +} diff --git a/jcapiv2/model_os_restriction_apple_restrictions.go b/jcapiv2/model_os_restriction_apple_restrictions.go new file mode 100644 index 0000000..059ff03 --- /dev/null +++ b/jcapiv2/model_os_restriction_apple_restrictions.go @@ -0,0 +1,18 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +// The Apple specific restricitons for this policy, if there are any +type OsRestrictionAppleRestrictions struct { + // Boolean representing if the policy requires the Apple devices to be MDM supervised + RequiresSupervision bool `json:"requiresSupervision,omitempty"` + // The supported Apple enrollment types for this policy + SupportedEnrollmentTypes []string `json:"supportedEnrollmentTypes,omitempty"` +} diff --git a/jcapiv2/model_phone_number.go b/jcapiv2/model_phone_number.go new file mode 100644 index 0000000..ccf0e68 --- /dev/null +++ b/jcapiv2/model_phone_number.go @@ -0,0 +1,16 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +type PhoneNumber struct { + Id string `json:"id,omitempty"` + Number string `json:"number,omitempty"` + Type_ string `json:"type,omitempty"` +} diff --git a/jcapiv2/model_policy.go b/jcapiv2/model_policy.go new file mode 100644 index 0000000..01bc268 --- /dev/null +++ b/jcapiv2/model_policy.go @@ -0,0 +1,19 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +// An instance of a policy template. +type Policy struct { + // ObjectId uniquely identifying a Policy. + Id string `json:"id,omitempty"` + // The description for this specific Policy. + Name string `json:"name,omitempty"` + Template *PolicyTemplate `json:"template,omitempty"` +} diff --git a/jcapiv2/model_policy_group.go b/jcapiv2/model_policy_group.go new file mode 100644 index 0000000..6e0925e --- /dev/null +++ b/jcapiv2/model_policy_group.go @@ -0,0 +1,24 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +type PolicyGroup struct { + Attributes *GraphAttributes `json:"attributes,omitempty"` + // Description of a Policy Group + Description string `json:"description,omitempty"` + // E-mail address associated with a Policy Group + Email string `json:"email,omitempty"` + // ObjectId uniquely identifying a Policy Group. + Id string `json:"id,omitempty"` + // Display name of a Policy Group. + Name string `json:"name,omitempty"` + // The type of the group; always 'policy' for a Policy Group. + Type_ string `json:"type,omitempty"` +} diff --git a/jcapiv2/model_policy_group_data.go b/jcapiv2/model_policy_group_data.go new file mode 100644 index 0000000..42ff2fe --- /dev/null +++ b/jcapiv2/model_policy_group_data.go @@ -0,0 +1,15 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +type PolicyGroupData struct { + // Display name of a Policy Group. + Name string `json:"name"` +} diff --git a/jcapiv2/model_policy_request.go b/jcapiv2/model_policy_request.go new file mode 100644 index 0000000..b51c8e3 --- /dev/null +++ b/jcapiv2/model_policy_request.go @@ -0,0 +1,18 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +// An instance of a policy template. +type PolicyRequest struct { + // The description for this specific Policy. + Name string `json:"name"` + Template *PolicyRequestTemplate `json:"template,omitempty"` + Values []PolicyValue `json:"values,omitempty"` +} diff --git a/jcapiv2/model_policy_request_template.go b/jcapiv2/model_policy_request_template.go new file mode 100644 index 0000000..e1763b7 --- /dev/null +++ b/jcapiv2/model_policy_request_template.go @@ -0,0 +1,15 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +type PolicyRequestTemplate struct { + // ObjectId uniquely identifying a Policy instance; only allowed on POST requests. + Id string `json:"id,omitempty"` +} diff --git a/jcapiv2/model_policy_result.go b/jcapiv2/model_policy_result.go new file mode 100644 index 0000000..79ad388 --- /dev/null +++ b/jcapiv2/model_policy_result.go @@ -0,0 +1,38 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 +import ( + "time" +) + +type PolicyResult struct { + // Details pertaining to the policy result. + Detail string `json:"detail,omitempty"` + // The end of the policy application. + EndedAt time.Time `json:"endedAt,omitempty"` + // The 32-bit unsigned exit status from the applying the policy. + ExitStatus int32 `json:"exitStatus,omitempty"` + // ObjectId uniquely identifying a Policy Result. + Id string `json:"id,omitempty"` + // ObjectId uniquely identifying the parent Policy. + PolicyID string `json:"policyID,omitempty"` + // The start of the policy application. + StartedAt time.Time `json:"startedAt,omitempty"` + // Enumeration describing the state of the policy. Success, failed, or pending. + State string `json:"state,omitempty"` + // The STDERR output from applying the policy. + StdErr string `json:"stdErr,omitempty"` + // The STDOUT output from applying the policy. + StdOut string `json:"stdOut,omitempty"` + // True if the policy was successfully applied; false otherwise. + Success bool `json:"success,omitempty"` + // ObjectId uniquely identifying the parent System. + SystemID string `json:"systemID,omitempty"` +} diff --git a/jcapiv2/model_policy_template.go b/jcapiv2/model_policy_template.go new file mode 100644 index 0000000..fc71359 --- /dev/null +++ b/jcapiv2/model_policy_template.go @@ -0,0 +1,36 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +// The shallow information about a Policy Template. +type PolicyTemplate struct { + // Requirements before the policy can be activated. + Activation string `json:"activation,omitempty"` + // Text to describe any risk associated with this policy. + Alert string `json:"alert,omitempty"` + // Specifics about the behavior of the policy. + Behavior string `json:"behavior,omitempty"` + // The supported delivery mechanisms for this policy template. + DeliveryTypes []string `json:"deliveryTypes,omitempty"` + // The default description for the Policy. + Description string `json:"description,omitempty"` + // The default display name for the Policy. + DisplayName string `json:"displayName,omitempty"` + // ObjectId uniquely identifying a Policy Template. + Id string `json:"id,omitempty"` + // The unique name for the Policy Template. + Name string `json:"name,omitempty"` + OsMetaFamily string `json:"osMetaFamily,omitempty"` + OsRestrictions []OsRestriction `json:"osRestrictions,omitempty"` + // URL to visit for further information. + Reference string `json:"reference,omitempty"` + // String describing the release status of the policy template. + State string `json:"state,omitempty"` +} diff --git a/jcapiv2/model_policy_template_config_field.go b/jcapiv2/model_policy_template_config_field.go new file mode 100644 index 0000000..b034ebd --- /dev/null +++ b/jcapiv2/model_policy_template_config_field.go @@ -0,0 +1,34 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +type PolicyTemplateConfigField struct { + // The default value for this field. + DefaultValue string `json:"defaultValue,omitempty"` + // The options that correspond to the display_type. + DisplayOptions *interface{} `json:"displayOptions,omitempty"` + // The default rendering for this field. + DisplayType string `json:"displayType,omitempty"` + // ObjectId uniquely identifying a Policy Template Configuration Field + Id string `json:"id"` + // The default label for this field. + Label string `json:"label,omitempty"` + // A unique name identifying this config field. + Name string `json:"name"` + // The default position to render this field. + Position float64 `json:"position,omitempty"` + // If an admin is allowed to modify this field. + ReadOnly bool `json:"readOnly,omitempty"` + // If this field is required for this field. + Required bool `json:"required,omitempty"` + // Defines if the policy template config field is sensitive or not. + Sensitive bool `json:"sensitive,omitempty"` + Tooltip *PolicyTemplateConfigFieldTooltip `json:"tooltip,omitempty"` +} diff --git a/jcapiv2/model_policy_template_config_field_tooltip.go b/jcapiv2/model_policy_template_config_field_tooltip.go new file mode 100644 index 0000000..320d25d --- /dev/null +++ b/jcapiv2/model_policy_template_config_field_tooltip.go @@ -0,0 +1,15 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +type PolicyTemplateConfigFieldTooltip struct { + Template string `json:"template,omitempty"` + Variables *PolicyTemplateConfigFieldTooltipVariables `json:"variables,omitempty"` +} diff --git a/jcapiv2/model_policy_template_config_field_tooltip_variables.go b/jcapiv2/model_policy_template_config_field_tooltip_variables.go new file mode 100644 index 0000000..663b247 --- /dev/null +++ b/jcapiv2/model_policy_template_config_field_tooltip_variables.go @@ -0,0 +1,15 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +type PolicyTemplateConfigFieldTooltipVariables struct { + Icon string `json:"icon,omitempty"` + Message string `json:"message,omitempty"` +} diff --git a/jcapiv2/model_policy_template_with_details.go b/jcapiv2/model_policy_template_with_details.go new file mode 100644 index 0000000..e953413 --- /dev/null +++ b/jcapiv2/model_policy_template_with_details.go @@ -0,0 +1,30 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +// The shallow information about a Policy Template. +type PolicyTemplateWithDetails struct { + // Requirements before the policy can be activated. + Activation string `json:"activation,omitempty"` + // Specifics about the behavior of the policy. + Behavior string `json:"behavior,omitempty"` + // An unordered list of all the fields that can be configured for this Policy Template. + ConfigFields []PolicyTemplateConfigField `json:"configFields,omitempty"` + // The default description for the Policy. + Description string `json:"description,omitempty"` + // The default display name for the Policy. + DisplayName string `json:"displayName,omitempty"` + // ObjectId uniquely identifying a Policy Template. + Id string `json:"id,omitempty"` + // The unique name for the Policy Template. + Name string `json:"name,omitempty"` + OsMetaFamily string `json:"osMetaFamily,omitempty"` + OsRestrictions []OsRestriction `json:"osRestrictions,omitempty"` +} diff --git a/jcapiv2/model_policy_value.go b/jcapiv2/model_policy_value.go new file mode 100644 index 0000000..0d4be0f --- /dev/null +++ b/jcapiv2/model_policy_value.go @@ -0,0 +1,19 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +type PolicyValue struct { + // The ObjectId of the corresponding Policy Template configuration field. + ConfigFieldID string `json:"configFieldID,omitempty"` + // Defines if the value is sensitive or not. + Sensitive bool `json:"sensitive,omitempty"` + // The value for the configuration field for this Policy instance. + Value string `json:"value,omitempty"` +} diff --git a/jcapiv2/model_policy_with_details.go b/jcapiv2/model_policy_with_details.go new file mode 100644 index 0000000..fa1c5d5 --- /dev/null +++ b/jcapiv2/model_policy_with_details.go @@ -0,0 +1,21 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +// An instance of a policy template. +type PolicyWithDetails struct { + ConfigFields []PolicyTemplateConfigField `json:"configFields,omitempty"` + // ObjectId uniquely identifying a Policy. + Id string `json:"id,omitempty"` + // The description for this specific Policy. + Name string `json:"name,omitempty"` + Template *PolicyTemplate `json:"template,omitempty"` + Values []PolicyValue `json:"values,omitempty"` +} diff --git a/jcapiv2/model_provider.go b/jcapiv2/model_provider.go new file mode 100644 index 0000000..2ee4d3a --- /dev/null +++ b/jcapiv2/model_provider.go @@ -0,0 +1,15 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +type Provider struct { + DisallowOrgCreation bool `json:"disallowOrgCreation,omitempty"` + Id string `json:"id,omitempty"` +} diff --git a/jcapiv2/model_provider_admin_req.go b/jcapiv2/model_provider_admin_req.go new file mode 100644 index 0000000..9c29d2b --- /dev/null +++ b/jcapiv2/model_provider_admin_req.go @@ -0,0 +1,20 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +type ProviderAdminReq struct { + BindNoOrgs bool `json:"bindNoOrgs,omitempty"` + Email string `json:"email"` + EnableMultiFactor bool `json:"enableMultiFactor,omitempty"` + Firstname string `json:"firstname,omitempty"` + Lastname string `json:"lastname,omitempty"` + Role string `json:"role,omitempty"` + RoleName string `json:"roleName,omitempty"` +} diff --git a/jcapiv2/model_provider_invoice.go b/jcapiv2/model_provider_invoice.go new file mode 100644 index 0000000..fe7020b --- /dev/null +++ b/jcapiv2/model_provider_invoice.go @@ -0,0 +1,21 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +// Details of a an invoice +type ProviderInvoice struct { + AmountBilled string `json:"amountBilled,omitempty"` + AmountPaid string `json:"amountPaid,omitempty"` + AmountRemaining string `json:"amountRemaining,omitempty"` + Currency string `json:"currency,omitempty"` + DueDate string `json:"dueDate,omitempty"` + Id string `json:"id,omitempty"` + Status string `json:"status,omitempty"` +} diff --git a/jcapiv2/model_provider_invoice_response.go b/jcapiv2/model_provider_invoice_response.go new file mode 100644 index 0000000..cd20f49 --- /dev/null +++ b/jcapiv2/model_provider_invoice_response.go @@ -0,0 +1,16 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +// Response for retrieve provider invoices +type ProviderInvoiceResponse struct { + Records []ProviderInvoice `json:"records,omitempty"` + TotalCount int32 `json:"totalCount,omitempty"` +} diff --git a/jcapiv2/model_push_endpoint_response.go b/jcapiv2/model_push_endpoint_response.go new file mode 100644 index 0000000..6522995 --- /dev/null +++ b/jcapiv2/model_push_endpoint_response.go @@ -0,0 +1,23 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 +import ( + "time" +) + +// A push endpoint response from the auth service. +type PushEndpointResponse struct { + Device *PushEndpointResponseDevice `json:"device,omitempty"` + EnrollmentDate time.Time `json:"enrollmentDate,omitempty"` + Id string `json:"id,omitempty"` + LastUsedDate time.Time `json:"lastUsedDate,omitempty"` + Name string `json:"name,omitempty"` + State string `json:"state,omitempty"` +} diff --git a/jcapiv2/model_push_endpoint_response_device.go b/jcapiv2/model_push_endpoint_response_device.go new file mode 100644 index 0000000..c77538f --- /dev/null +++ b/jcapiv2/model_push_endpoint_response_device.go @@ -0,0 +1,19 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +type PushEndpointResponseDevice struct { + AppVersion string `json:"appVersion,omitempty"` + Make string `json:"make,omitempty"` + Model string `json:"model,omitempty"` + Os string `json:"os,omitempty"` + OsVersion string `json:"osVersion,omitempty"` + UvEnabled bool `json:"uvEnabled,omitempty"` +} diff --git a/jcapiv2/model_pushendpoints_push_endpoint_id_body.go b/jcapiv2/model_pushendpoints_push_endpoint_id_body.go new file mode 100644 index 0000000..d9665ae --- /dev/null +++ b/jcapiv2/model_pushendpoints_push_endpoint_id_body.go @@ -0,0 +1,15 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +type PushendpointsPushEndpointIdBody struct { + Name string `json:"name,omitempty"` + State string `json:"state,omitempty"` +} diff --git a/jcapiv2/model_pwm_all_users.go b/jcapiv2/model_pwm_all_users.go new file mode 100644 index 0000000..70a256a --- /dev/null +++ b/jcapiv2/model_pwm_all_users.go @@ -0,0 +1,15 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +type PwmAllUsers struct { + Results []PwmAllUsersResults `json:"results"` + TotalCount int32 `json:"totalCount"` +} diff --git a/jcapiv2/model_pwm_all_users_groups.go b/jcapiv2/model_pwm_all_users_groups.go new file mode 100644 index 0000000..87aa019 --- /dev/null +++ b/jcapiv2/model_pwm_all_users_groups.go @@ -0,0 +1,15 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +type PwmAllUsersGroups struct { + Id string `json:"id"` + Name string `json:"name"` +} diff --git a/jcapiv2/model_pwm_all_users_results.go b/jcapiv2/model_pwm_all_users_results.go new file mode 100644 index 0000000..ae842a8 --- /dev/null +++ b/jcapiv2/model_pwm_all_users_results.go @@ -0,0 +1,18 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +type PwmAllUsersResults struct { + Email string `json:"email"` + Groups []PwmAllUsersGroups `json:"groups,omitempty"` + Id string `json:"id"` + Name string `json:"name"` + Status string `json:"status"` +} diff --git a/jcapiv2/model_pwm_overview_app_versions.go b/jcapiv2/model_pwm_overview_app_versions.go new file mode 100644 index 0000000..d2567a5 --- /dev/null +++ b/jcapiv2/model_pwm_overview_app_versions.go @@ -0,0 +1,15 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +type PwmOverviewAppVersions struct { + Results []PwmOverviewAppVersionsResults `json:"results"` + TotalCount int32 `json:"totalCount"` +} diff --git a/jcapiv2/model_pwm_overview_app_versions_results.go b/jcapiv2/model_pwm_overview_app_versions_results.go new file mode 100644 index 0000000..e970260 --- /dev/null +++ b/jcapiv2/model_pwm_overview_app_versions_results.go @@ -0,0 +1,15 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +type PwmOverviewAppVersionsResults struct { + UsersCount int32 `json:"usersCount,omitempty"` + Version string `json:"version,omitempty"` +} diff --git a/jcapiv2/model_pwm_overview_main.go b/jcapiv2/model_pwm_overview_main.go new file mode 100644 index 0000000..26bf048 --- /dev/null +++ b/jcapiv2/model_pwm_overview_main.go @@ -0,0 +1,17 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +type PwmOverviewMain struct { + Devices []PwmOverviewMainDevices `json:"devices"` + PendingInvites int32 `json:"pendingInvites"` + SharedFolders int32 `json:"sharedFolders"` + TotalUsers int32 `json:"totalUsers"` +} diff --git a/jcapiv2/model_pwm_overview_main_devices.go b/jcapiv2/model_pwm_overview_main_devices.go new file mode 100644 index 0000000..49bd323 --- /dev/null +++ b/jcapiv2/model_pwm_overview_main_devices.go @@ -0,0 +1,16 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +type PwmOverviewMainDevices struct { + Count int32 `json:"count,omitempty"` + Id int32 `json:"id,omitempty"` + Name string `json:"name,omitempty"` +} diff --git a/jcapiv2/model_query.go b/jcapiv2/model_query.go new file mode 100644 index 0000000..4e31e3c --- /dev/null +++ b/jcapiv2/model_query.go @@ -0,0 +1,15 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +// Basic query. +type Query struct { + QueryType string `json:"queryType"` +} diff --git a/jcapiv2/model_queued_command_list.go b/jcapiv2/model_queued_command_list.go new file mode 100644 index 0000000..4706168 --- /dev/null +++ b/jcapiv2/model_queued_command_list.go @@ -0,0 +1,17 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +// List of queued commands +type QueuedCommandList struct { + Results []QueuedCommandListResults `json:"results,omitempty"` + // The total number of queued command results. + TotalCount int32 `json:"totalCount,omitempty"` +} diff --git a/jcapiv2/model_queued_command_list_results.go b/jcapiv2/model_queued_command_list_results.go new file mode 100644 index 0000000..de92513 --- /dev/null +++ b/jcapiv2/model_queued_command_list_results.go @@ -0,0 +1,21 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +type QueuedCommandListResults struct { + // The ID of the command, from savedAgentCommands. + Command string `json:"command,omitempty"` + // The workflowInstanceId. + Id string `json:"id,omitempty"` + // The number of devices that still haven't received the directive. + PendingCount int32 `json:"pendingCount,omitempty"` + // The ID of the device the command is bound to. + System string `json:"system,omitempty"` +} diff --git a/jcapiv2/model_samba_domain_input.go b/jcapiv2/model_samba_domain_input.go new file mode 100644 index 0000000..a632ec2 --- /dev/null +++ b/jcapiv2/model_samba_domain_input.go @@ -0,0 +1,17 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +type SambaDomainInput struct { + // Name of this domain's WorkGroup + Name string `json:"name"` + // Security identifier of this domain + Sid string `json:"sid"` +} diff --git a/jcapiv2/model_samba_domain_output.go b/jcapiv2/model_samba_domain_output.go new file mode 100644 index 0000000..6c621b6 --- /dev/null +++ b/jcapiv2/model_samba_domain_output.go @@ -0,0 +1,17 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +type SambaDomainOutput struct { + // Name of this domain's WorkGroup + Name string `json:"name"` + // Security identifier of this domain + Sid string `json:"sid"` +} diff --git a/jcapiv2/model_scheduled_userstate_result.go b/jcapiv2/model_scheduled_userstate_result.go new file mode 100644 index 0000000..23056c8 --- /dev/null +++ b/jcapiv2/model_scheduled_userstate_result.go @@ -0,0 +1,17 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +type ScheduledUserstateResult struct { + ScheduledDate string `json:"scheduledDate,omitempty"` + ScheduledJobId string `json:"scheduledJobId,omitempty"` + State string `json:"state,omitempty"` + SystemUserId string `json:"systemUserId,omitempty"` +} diff --git a/jcapiv2/model_setup_assistant_option.go b/jcapiv2/model_setup_assistant_option.go new file mode 100644 index 0000000..7cd9cdd --- /dev/null +++ b/jcapiv2/model_setup_assistant_option.go @@ -0,0 +1,47 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 +// SetupAssistantOption : Options to skip screens during MacOS and iOS setup: * `accessibility` - Skips the Accessibility pane, only if the Mac is connected to Ethernet and the cloud config is downloaded. * `appearance` - Skips the Choose Your Look screen. * `appleID` - Skips Apple ID setup. * `biometric` - Skips biometric setup. * `diagnostics` - Skips the App Analytics pane. * `displayTone` - Skips display tone setup. * `fileVault` - Skips FileVault setup assistant screen. * `icloudDiagnostics` - Skips iCloud analytics screen. * `icloudStorage` - Skips iCloud documents and desktop screen. * `location` - Skips location services setup. * `payment` - Skips Apple Pay setup. * `privacy` - Skips the Privacy setup. * `restore` - Skips restoring from backup. * `screenTime` - Skips screen time setup. * `siri` - Skips Siri setup. * `tos` - Skips terms and conditions. * `appStore` - Skips the App Store pane. * `deviceToDeviceMigration` - Skips Device to Device Migration pane. * `displayZoom` - Skips zoom setup. * `homeButton` - Skips the Meet the New Home Button screen on iPhone 7, iPhone 7 Plus, iPhone 8, iPhone 8 Plus and iPhone SE. * `imessageAndFacetime` - Skips the iMessage and FaceTime screen in iOS. * `messagingActivationUsingPhoneNumber` - Skips the iMessage pane. * `moveFromAndroid` - If the Restore pane is not skipped, removes the Move from Android option in the Restore pane on iOS.O * `passcode` - Hides and disables the passcode pane. * `restoreComplete` - Skips the Restore Completed pane. * `setupCellular` - Skips the add cellular plan pane. * `softwareUpdate` - Skips the mandatory software update screen in iOS. * `unlockWithWatch` - Skips Unlock Your Mac with your Apple Watch pane. * `updateComplete` - Skips the Software Update Complete pane. * `watchMigration` - Skips the screen for watch migration. * `welcome` - Skips the Get Started pane. +type SetupAssistantOption string + +// List of SetupAssistantOption +const ( + ACCESSIBILITY_SetupAssistantOption SetupAssistantOption = "accessibility" + APPEARANCE_SetupAssistantOption SetupAssistantOption = "appearance" + APPLE_ID_SetupAssistantOption SetupAssistantOption = "appleID" + BIOMETRIC_SetupAssistantOption SetupAssistantOption = "biometric" + DIAGNOSTICS_SetupAssistantOption SetupAssistantOption = "diagnostics" + DISPLAY_TONE_SetupAssistantOption SetupAssistantOption = "displayTone" + FILE_VAULT_SetupAssistantOption SetupAssistantOption = "fileVault" + ICLOUD_DIAGNOSTICS_SetupAssistantOption SetupAssistantOption = "icloudDiagnostics" + ICLOUD_STORAGE_SetupAssistantOption SetupAssistantOption = "icloudStorage" + LOCATION_SetupAssistantOption SetupAssistantOption = "location" + PAYMENT_SetupAssistantOption SetupAssistantOption = "payment" + PRIVACY_SetupAssistantOption SetupAssistantOption = "privacy" + RESTORE_SetupAssistantOption SetupAssistantOption = "restore" + SCREEN_TIME_SetupAssistantOption SetupAssistantOption = "screenTime" + SIRI_SetupAssistantOption SetupAssistantOption = "siri" + TOS_SetupAssistantOption SetupAssistantOption = "tos" + APP_STORE_SetupAssistantOption SetupAssistantOption = "appStore" + DISPLAY_ZOOM_SetupAssistantOption SetupAssistantOption = "displayZoom" + DEVICE_TO_DEVICE_MIGRATION_SetupAssistantOption SetupAssistantOption = "deviceToDeviceMigration" + HOME_BUTTON_SetupAssistantOption SetupAssistantOption = "homeButton" + IMESSAGE_AND_FACETIME_SetupAssistantOption SetupAssistantOption = "imessageAndFacetime" + MESSAGING_ACTIVATION_USING_PHONE_NUMBER_SetupAssistantOption SetupAssistantOption = "messagingActivationUsingPhoneNumber" + MOVE_FROM_ANDROID_SetupAssistantOption SetupAssistantOption = "moveFromAndroid" + PASSCODE_SetupAssistantOption SetupAssistantOption = "passcode" + RESTORE_COMPLETE_SetupAssistantOption SetupAssistantOption = "restoreComplete" + SETUP_CELLULAR_SetupAssistantOption SetupAssistantOption = "setupCellular" + SOFTWARE_UPDATE_SetupAssistantOption SetupAssistantOption = "softwareUpdate" + UNLOCK_WITH_WATCH_SetupAssistantOption SetupAssistantOption = "unlockWithWatch" + UPDATE_COMPLETE_SetupAssistantOption SetupAssistantOption = "updateComplete" + WATCH_MIGRATION_SetupAssistantOption SetupAssistantOption = "watchMigration" + WELCOME_SetupAssistantOption SetupAssistantOption = "welcome" +) diff --git a/jcapiv2/model_shared_folder_access_levels.go b/jcapiv2/model_shared_folder_access_levels.go new file mode 100644 index 0000000..773eb87 --- /dev/null +++ b/jcapiv2/model_shared_folder_access_levels.go @@ -0,0 +1,14 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +type SharedFolderAccessLevels struct { + Results []SharedFolderAccessLevelsResults `json:"results"` +} diff --git a/jcapiv2/model_shared_folder_access_levels_results.go b/jcapiv2/model_shared_folder_access_levels_results.go new file mode 100644 index 0000000..c658dc6 --- /dev/null +++ b/jcapiv2/model_shared_folder_access_levels_results.go @@ -0,0 +1,16 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +type SharedFolderAccessLevelsResults struct { + Description string `json:"description,omitempty"` + Id string `json:"id"` + Name string `json:"name"` +} diff --git a/jcapiv2/model_shared_folder_details.go b/jcapiv2/model_shared_folder_details.go new file mode 100644 index 0000000..8a5690b --- /dev/null +++ b/jcapiv2/model_shared_folder_details.go @@ -0,0 +1,18 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +type SharedFolderDetails struct { + CreatedAt string `json:"createdAt"` + ItemsInFolder int32 `json:"itemsInFolder"` + Name string `json:"name"` + UsersWithAccess int32 `json:"usersWithAccess"` + Uuid string `json:"uuid"` +} diff --git a/jcapiv2/model_shared_folder_users.go b/jcapiv2/model_shared_folder_users.go new file mode 100644 index 0000000..1e99a9b --- /dev/null +++ b/jcapiv2/model_shared_folder_users.go @@ -0,0 +1,15 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +type SharedFolderUsers struct { + Results []SharedFolderUsersResults `json:"results"` + TotalCount int32 `json:"totalCount"` +} diff --git a/jcapiv2/model_shared_folder_users_results.go b/jcapiv2/model_shared_folder_users_results.go new file mode 100644 index 0000000..866a066 --- /dev/null +++ b/jcapiv2/model_shared_folder_users_results.go @@ -0,0 +1,19 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +type SharedFolderUsersResults struct { + AccessLevelId string `json:"accessLevelId"` + AccessLevelName string `json:"accessLevelName"` + Email string `json:"email"` + Id string `json:"id"` + Name string `json:"name"` + Status string `json:"status"` +} diff --git a/jcapiv2/model_shared_folders_list.go b/jcapiv2/model_shared_folders_list.go new file mode 100644 index 0000000..97560ef --- /dev/null +++ b/jcapiv2/model_shared_folders_list.go @@ -0,0 +1,15 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +type SharedFoldersList struct { + Results []SharedFoldersListResults `json:"results"` + TotalCount int32 `json:"totalCount"` +} diff --git a/jcapiv2/model_shared_folders_list_results.go b/jcapiv2/model_shared_folders_list_results.go new file mode 100644 index 0000000..fb0a9f7 --- /dev/null +++ b/jcapiv2/model_shared_folders_list_results.go @@ -0,0 +1,18 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +type SharedFoldersListResults struct { + CreatedAt string `json:"createdAt"` + ItemsInFolder int32 `json:"itemsInFolder"` + Name string `json:"name"` + UsersWithAccess int32 `json:"usersWithAccess"` + Uuid string `json:"uuid"` +} diff --git a/jcapiv2/model_software_app.go b/jcapiv2/model_software_app.go new file mode 100644 index 0000000..5415893 --- /dev/null +++ b/jcapiv2/model_software_app.go @@ -0,0 +1,16 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +type SoftwareApp struct { + DisplayName string `json:"displayName,omitempty"` + Id string `json:"id,omitempty"` + Settings []SoftwareAppSettings `json:"settings,omitempty"` +} diff --git a/jcapiv2/model_software_app_apple_vpp.go b/jcapiv2/model_software_app_apple_vpp.go new file mode 100644 index 0000000..fc34a9b --- /dev/null +++ b/jcapiv2/model_software_app_apple_vpp.go @@ -0,0 +1,25 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +// appleVpp is an optional attribute, it will only be present on apps with a 'setting' 'package_manager' type of 'APPLE_VPP'. +type SoftwareAppAppleVpp struct { + // Text sent to configure the application, the text should be a valid plist. Returned only by 'GET /softwareapps/{id}'. + AppConfiguration string `json:"appConfiguration,omitempty"` + AssignedLicenses int32 `json:"assignedLicenses,omitempty"` + AvailableLicenses int32 `json:"availableLicenses,omitempty"` + // App details returned by iTunes API. See example. The properties in this field are out of our control and we cannot guarantee consistency, so it should be checked by the client and manage the details accordingly. + Details *interface{} `json:"details,omitempty"` + // Denotes if configuration has been enabled for the application. Returned only by ''GET /softwareapps/{id}''. + IsConfigEnabled bool `json:"isConfigEnabled,omitempty"` + // The supported device families for this VPP Application. + SupportedDeviceFamilies []string `json:"supportedDeviceFamilies,omitempty"` + TotalLicenses int32 `json:"totalLicenses,omitempty"` +} diff --git a/jcapiv2/model_software_app_reclaim_licenses.go b/jcapiv2/model_software_app_reclaim_licenses.go new file mode 100644 index 0000000..dec5875 --- /dev/null +++ b/jcapiv2/model_software_app_reclaim_licenses.go @@ -0,0 +1,17 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +type SoftwareAppReclaimLicenses struct { + AssignedLicenses int32 `json:"assignedLicenses,omitempty"` + AvailableLicenses int32 `json:"availableLicenses,omitempty"` + ReclaimedLicenses int32 `json:"reclaimedLicenses,omitempty"` + TotalLicenses int32 `json:"totalLicenses,omitempty"` +} diff --git a/jcapiv2/model_software_app_settings.go b/jcapiv2/model_software_app_settings.go new file mode 100644 index 0000000..42b7f2a --- /dev/null +++ b/jcapiv2/model_software_app_settings.go @@ -0,0 +1,39 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +type SoftwareAppSettings struct { + AllowUpdateDelay bool `json:"allowUpdateDelay,omitempty"` + AppleVpp *SoftwareAppAppleVpp `json:"appleVpp,omitempty"` + // The manifest asset kind (ex: software). + AssetKind string `json:"assetKind,omitempty"` + // The incremental size to use for summing the package as it is downloaded. + AssetSha256Size int32 `json:"assetSha256Size,omitempty"` + // The array of checksums, one each for the hash size up to the total size of the package. + AssetSha256Strings []string `json:"assetSha256Strings,omitempty"` + AutoUpdate bool `json:"autoUpdate,omitempty"` + // The software app description. + Description string `json:"description,omitempty"` + // State of Install or Uninstall + DesiredState string `json:"desiredState,omitempty"` + // Repository where the app is located within the package manager + Location string `json:"location,omitempty"` + // ID of the repository where the app is located within the package manager + LocationObjectId string `json:"locationObjectId,omitempty"` + PackageId string `json:"packageId,omitempty"` + // The package manifest kind (ex: software-package). + PackageKind string `json:"packageKind,omitempty"` + // App store serving the app: APPLE_VPP, CHOCOLATEY, etc. + PackageManager string `json:"packageManager,omitempty"` + // The package manifest subtitle. + PackageSubtitle string `json:"packageSubtitle,omitempty"` + // The package manifest version. + PackageVersion string `json:"packageVersion,omitempty"` +} diff --git a/jcapiv2/model_software_app_status.go b/jcapiv2/model_software_app_status.go new file mode 100644 index 0000000..413c520 --- /dev/null +++ b/jcapiv2/model_software_app_status.go @@ -0,0 +1,21 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +type SoftwareAppStatus struct { + Code int32 `json:"code,omitempty"` + Details string `json:"details,omitempty"` + Id string `json:"id,omitempty"` + SoftwareAppId string `json:"softwareAppId,omitempty"` + State string `json:"state,omitempty"` + SystemId string `json:"systemId,omitempty"` + Timestamp string `json:"timestamp,omitempty"` + Version string `json:"version,omitempty"` +} diff --git a/jcapiv2/model_software_app_with_status.go b/jcapiv2/model_software_app_with_status.go new file mode 100644 index 0000000..ee43c8d --- /dev/null +++ b/jcapiv2/model_software_app_with_status.go @@ -0,0 +1,15 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +type SoftwareAppWithStatus struct { + App *SoftwareApp `json:"app,omitempty"` + Status *SoftwareAppStatus `json:"status,omitempty"` +} diff --git a/jcapiv2/model_software_apps_retry_installation_request.go b/jcapiv2/model_software_apps_retry_installation_request.go new file mode 100644 index 0000000..0a64f9a --- /dev/null +++ b/jcapiv2/model_software_apps_retry_installation_request.go @@ -0,0 +1,15 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +type SoftwareAppsRetryInstallationRequest struct { + // An array of system IDs to retry the software application installation. + SystemIds []string `json:"system_ids,omitempty"` +} diff --git a/jcapiv2/model_subscription.go b/jcapiv2/model_subscription.go new file mode 100644 index 0000000..7b66bfa --- /dev/null +++ b/jcapiv2/model_subscription.go @@ -0,0 +1,23 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +type Subscription struct { + // The annual (discounted) price of this subscription. + AnnualPrice float64 `json:"annualPrice"` + // The display name of this subscription. + DisplayName string `json:"displayName"` + // Array of the features included in the subscription. + Features []Feature `json:"features"` + // The list price of this subscription. + ListPrice float64 `json:"listPrice"` + // Unique identifier corresponding to this subscription. + ProductCode string `json:"productCode"` +} diff --git a/jcapiv2/model_suggestion_counts.go b/jcapiv2/model_suggestion_counts.go new file mode 100644 index 0000000..5cca7d5 --- /dev/null +++ b/jcapiv2/model_suggestion_counts.go @@ -0,0 +1,16 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +type SuggestionCounts struct { + Add int32 `json:"add,omitempty"` + Remove int32 `json:"remove,omitempty"` + Total int32 `json:"total,omitempty"` +} diff --git a/jcapiv2/model_system_group.go b/jcapiv2/model_system_group.go new file mode 100644 index 0000000..3928375 --- /dev/null +++ b/jcapiv2/model_system_group.go @@ -0,0 +1,24 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +type SystemGroup struct { + Attributes *GraphAttributes `json:"attributes,omitempty"` + // Description of a System Group + Description string `json:"description,omitempty"` + // E-mail address associated with a System Group + Email string `json:"email,omitempty"` + // ObjectId uniquely identifying a System Group. + Id string `json:"id,omitempty"` + // Display name of a System Group. + Name string `json:"name,omitempty"` + // The type of the group; always 'system' for a System Group. + Type_ string `json:"type,omitempty"` +} diff --git a/jcapiv2/model_system_group_data.go b/jcapiv2/model_system_group_data.go new file mode 100644 index 0000000..8fe128d --- /dev/null +++ b/jcapiv2/model_system_group_data.go @@ -0,0 +1,15 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +type SystemGroupData struct { + // Display name of a System Group. + Name string `json:"name"` +} diff --git a/jcapiv2/model_system_insights_alf.go b/jcapiv2/model_system_insights_alf.go new file mode 100644 index 0000000..181cf81 --- /dev/null +++ b/jcapiv2/model_system_insights_alf.go @@ -0,0 +1,22 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +type SystemInsightsAlf struct { + AllowSignedEnabled int32 `json:"allow_signed_enabled,omitempty"` + CollectionTime string `json:"collection_time,omitempty"` + FirewallUnload int32 `json:"firewall_unload,omitempty"` + GlobalState int32 `json:"global_state,omitempty"` + LoggingEnabled int32 `json:"logging_enabled,omitempty"` + LoggingOption int32 `json:"logging_option,omitempty"` + StealthEnabled int32 `json:"stealth_enabled,omitempty"` + SystemId string `json:"system_id,omitempty"` + Version string `json:"version,omitempty"` +} diff --git a/jcapiv2/model_system_insights_alf_exceptions.go b/jcapiv2/model_system_insights_alf_exceptions.go new file mode 100644 index 0000000..25b1aa9 --- /dev/null +++ b/jcapiv2/model_system_insights_alf_exceptions.go @@ -0,0 +1,17 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +type SystemInsightsAlfExceptions struct { + CollectionTime string `json:"collection_time,omitempty"` + Path string `json:"path,omitempty"` + State float64 `json:"state,omitempty"` + SystemId string `json:"system_id,omitempty"` +} diff --git a/jcapiv2/model_system_insights_alf_explicit_auths.go b/jcapiv2/model_system_insights_alf_explicit_auths.go new file mode 100644 index 0000000..198700c --- /dev/null +++ b/jcapiv2/model_system_insights_alf_explicit_auths.go @@ -0,0 +1,16 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +type SystemInsightsAlfExplicitAuths struct { + CollectionTime string `json:"collection_time,omitempty"` + Process string `json:"process,omitempty"` + SystemId string `json:"system_id,omitempty"` +} diff --git a/jcapiv2/model_system_insights_appcompat_shims.go b/jcapiv2/model_system_insights_appcompat_shims.go new file mode 100644 index 0000000..a4929a3 --- /dev/null +++ b/jcapiv2/model_system_insights_appcompat_shims.go @@ -0,0 +1,21 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +type SystemInsightsAppcompatShims struct { + CollectionTime string `json:"collection_time,omitempty"` + Description string `json:"description,omitempty"` + Executable string `json:"executable,omitempty"` + InstallTime float64 `json:"install_time,omitempty"` + Path string `json:"path,omitempty"` + SdbId string `json:"sdb_id,omitempty"` + SystemId string `json:"system_id,omitempty"` + Type_ string `json:"type,omitempty"` +} diff --git a/jcapiv2/model_system_insights_apps.go b/jcapiv2/model_system_insights_apps.go new file mode 100644 index 0000000..e1e79df --- /dev/null +++ b/jcapiv2/model_system_insights_apps.go @@ -0,0 +1,34 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +type SystemInsightsApps struct { + ApplescriptEnabled string `json:"applescript_enabled,omitempty"` + BundleExecutable string `json:"bundle_executable,omitempty"` + BundleIdentifier string `json:"bundle_identifier,omitempty"` + BundleName string `json:"bundle_name,omitempty"` + BundlePackageType string `json:"bundle_package_type,omitempty"` + BundleShortVersion string `json:"bundle_short_version,omitempty"` + BundleVersion string `json:"bundle_version,omitempty"` + Category string `json:"category,omitempty"` + CollectionTime string `json:"collection_time,omitempty"` + Compiler string `json:"compiler,omitempty"` + Copyright string `json:"copyright,omitempty"` + DevelopmentRegion string `json:"development_region,omitempty"` + DisplayName string `json:"display_name,omitempty"` + Element string `json:"element,omitempty"` + Environment string `json:"environment,omitempty"` + InfoString string `json:"info_string,omitempty"` + LastOpenedTime float64 `json:"last_opened_time,omitempty"` + MinimumSystemVersion string `json:"minimum_system_version,omitempty"` + Name string `json:"name,omitempty"` + Path string `json:"path,omitempty"` + SystemId string `json:"system_id,omitempty"` +} diff --git a/jcapiv2/model_system_insights_authorized_keys.go b/jcapiv2/model_system_insights_authorized_keys.go new file mode 100644 index 0000000..7b014e7 --- /dev/null +++ b/jcapiv2/model_system_insights_authorized_keys.go @@ -0,0 +1,19 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +type SystemInsightsAuthorizedKeys struct { + Algorithm string `json:"algorithm,omitempty"` + CollectionTime string `json:"collection_time,omitempty"` + Key string `json:"key,omitempty"` + KeyFile string `json:"key_file,omitempty"` + SystemId string `json:"system_id,omitempty"` + Uid string `json:"uid,omitempty"` +} diff --git a/jcapiv2/model_system_insights_azure_instance_metadata.go b/jcapiv2/model_system_insights_azure_instance_metadata.go new file mode 100644 index 0000000..040451e --- /dev/null +++ b/jcapiv2/model_system_insights_azure_instance_metadata.go @@ -0,0 +1,31 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +type SystemInsightsAzureInstanceMetadata struct { + CollectionTime string `json:"collection_time,omitempty"` + Location string `json:"location,omitempty"` + Name string `json:"name,omitempty"` + Offer string `json:"offer,omitempty"` + OsType string `json:"os_type,omitempty"` + PlacementGroupId string `json:"placement_group_id,omitempty"` + PlatformFaultDomain string `json:"platform_fault_domain,omitempty"` + PlatformUpdateDomain string `json:"platform_update_domain,omitempty"` + Publisher string `json:"publisher,omitempty"` + ResourceGroupName string `json:"resource_group_name,omitempty"` + Sku string `json:"sku,omitempty"` + SubscriptionId string `json:"subscription_id,omitempty"` + SystemId string `json:"system_id,omitempty"` + Version string `json:"version,omitempty"` + VmId string `json:"vm_id,omitempty"` + VmScaleSetName string `json:"vm_scale_set_name,omitempty"` + VmSize string `json:"vm_size,omitempty"` + Zone string `json:"zone,omitempty"` +} diff --git a/jcapiv2/model_system_insights_azure_instance_tags.go b/jcapiv2/model_system_insights_azure_instance_tags.go new file mode 100644 index 0000000..0521b70 --- /dev/null +++ b/jcapiv2/model_system_insights_azure_instance_tags.go @@ -0,0 +1,18 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +type SystemInsightsAzureInstanceTags struct { + CollectionTime string `json:"collection_time,omitempty"` + Key string `json:"key,omitempty"` + SystemId string `json:"system_id,omitempty"` + Value string `json:"value,omitempty"` + VmId string `json:"vm_id,omitempty"` +} diff --git a/jcapiv2/model_system_insights_battery.go b/jcapiv2/model_system_insights_battery.go new file mode 100644 index 0000000..5a83450 --- /dev/null +++ b/jcapiv2/model_system_insights_battery.go @@ -0,0 +1,33 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +type SystemInsightsBattery struct { + Amperage int32 `json:"amperage,omitempty"` + Charged int32 `json:"charged,omitempty"` + Charging int32 `json:"charging,omitempty"` + CollectionTime string `json:"collection_time,omitempty"` + Condition string `json:"condition,omitempty"` + CurrentCapacity int32 `json:"current_capacity,omitempty"` + CycleCount int32 `json:"cycle_count,omitempty"` + DesignedCapacity int32 `json:"designed_capacity,omitempty"` + Health string `json:"health,omitempty"` + ManufactureDate int32 `json:"manufacture_date,omitempty"` + Manufacturer string `json:"manufacturer,omitempty"` + MaxCapacity int32 `json:"max_capacity,omitempty"` + MinutesToFullCharge int32 `json:"minutes_to_full_charge,omitempty"` + MinutesUntilEmpty int32 `json:"minutes_until_empty,omitempty"` + Model string `json:"model,omitempty"` + PercentRemaining int32 `json:"percent_remaining,omitempty"` + SerialNumber string `json:"serial_number,omitempty"` + State string `json:"state,omitempty"` + SystemId string `json:"system_id,omitempty"` + Voltage int32 `json:"voltage,omitempty"` +} diff --git a/jcapiv2/model_system_insights_bitlocker_info.go b/jcapiv2/model_system_insights_bitlocker_info.go new file mode 100644 index 0000000..9a559ab --- /dev/null +++ b/jcapiv2/model_system_insights_bitlocker_info.go @@ -0,0 +1,21 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +type SystemInsightsBitlockerInfo struct { + CollectionTime string `json:"collection_time,omitempty"` + ConversionStatus int32 `json:"conversion_status,omitempty"` + DeviceId string `json:"device_id,omitempty"` + DriveLetter string `json:"drive_letter,omitempty"` + EncryptionMethod string `json:"encryption_method,omitempty"` + PersistentVolumeId string `json:"persistent_volume_id,omitempty"` + ProtectionStatus int32 `json:"protection_status,omitempty"` + SystemId string `json:"system_id,omitempty"` +} diff --git a/jcapiv2/model_system_insights_browser_plugins.go b/jcapiv2/model_system_insights_browser_plugins.go new file mode 100644 index 0000000..7ad2323 --- /dev/null +++ b/jcapiv2/model_system_insights_browser_plugins.go @@ -0,0 +1,25 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +type SystemInsightsBrowserPlugins struct { + CollectionTime string `json:"collection_time,omitempty"` + Description string `json:"description,omitempty"` + DevelopmentRegion string `json:"development_region,omitempty"` + Disabled int32 `json:"disabled,omitempty"` + Identifier string `json:"identifier,omitempty"` + Name string `json:"name,omitempty"` + Native int32 `json:"native,omitempty"` + Path string `json:"path,omitempty"` + Sdk string `json:"sdk,omitempty"` + SystemId string `json:"system_id,omitempty"` + Uid string `json:"uid,omitempty"` + Version string `json:"version,omitempty"` +} diff --git a/jcapiv2/model_system_insights_certificates.go b/jcapiv2/model_system_insights_certificates.go new file mode 100644 index 0000000..af46105 --- /dev/null +++ b/jcapiv2/model_system_insights_certificates.go @@ -0,0 +1,35 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +type SystemInsightsCertificates struct { + AuthorityKeyId string `json:"authority_key_id,omitempty"` + Ca int32 `json:"ca,omitempty"` + CommonName string `json:"common_name,omitempty"` + Issuer string `json:"issuer,omitempty"` + KeyAlgorithm string `json:"key_algorithm,omitempty"` + KeyStrength string `json:"key_strength,omitempty"` + KeyUsage string `json:"key_usage,omitempty"` + NotValidAfter string `json:"not_valid_after,omitempty"` + NotValidBefore string `json:"not_valid_before,omitempty"` + Path string `json:"path,omitempty"` + SelfSigned int32 `json:"self_signed,omitempty"` + Serial string `json:"serial,omitempty"` + Sha1 string `json:"sha1,omitempty"` + Sid string `json:"sid,omitempty"` + SigningAlgorithm string `json:"signing_algorithm,omitempty"` + Store string `json:"store,omitempty"` + StoreId string `json:"store_id,omitempty"` + StoreLocation string `json:"store_location,omitempty"` + Subject string `json:"subject,omitempty"` + SubjectKeyId string `json:"subject_key_id,omitempty"` + SystemId string `json:"system_id,omitempty"` + Username string `json:"username,omitempty"` +} diff --git a/jcapiv2/model_system_insights_chassis_info.go b/jcapiv2/model_system_insights_chassis_info.go new file mode 100644 index 0000000..d190193 --- /dev/null +++ b/jcapiv2/model_system_insights_chassis_info.go @@ -0,0 +1,28 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +type SystemInsightsChassisInfo struct { + AudibleAlarm string `json:"audible_alarm,omitempty"` + BreachDescription string `json:"breach_description,omitempty"` + ChassisTypes string `json:"chassis_types,omitempty"` + CollectionTime string `json:"collection_time,omitempty"` + Description string `json:"description,omitempty"` + Lock string `json:"lock,omitempty"` + Manufacturer string `json:"manufacturer,omitempty"` + Model string `json:"model,omitempty"` + SecurityBreach string `json:"security_breach,omitempty"` + Serial string `json:"serial,omitempty"` + Sku string `json:"sku,omitempty"` + SmbiosTag string `json:"smbios_tag,omitempty"` + Status string `json:"status,omitempty"` + SystemId string `json:"system_id,omitempty"` + VisibleAlarm string `json:"visible_alarm,omitempty"` +} diff --git a/jcapiv2/model_system_insights_chrome_extensions.go b/jcapiv2/model_system_insights_chrome_extensions.go new file mode 100644 index 0000000..b216530 --- /dev/null +++ b/jcapiv2/model_system_insights_chrome_extensions.go @@ -0,0 +1,26 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +type SystemInsightsChromeExtensions struct { + Author string `json:"author,omitempty"` + CollectionTime string `json:"collection_time,omitempty"` + Description string `json:"description,omitempty"` + Identifier string `json:"identifier,omitempty"` + Locale string `json:"locale,omitempty"` + Name string `json:"name,omitempty"` + Path string `json:"path,omitempty"` + Permissions string `json:"permissions,omitempty"` + Persistent int32 `json:"persistent,omitempty"` + SystemId string `json:"system_id,omitempty"` + Uid string `json:"uid,omitempty"` + UpdateUrl string `json:"update_url,omitempty"` + Version string `json:"version,omitempty"` +} diff --git a/jcapiv2/model_system_insights_connectivity.go b/jcapiv2/model_system_insights_connectivity.go new file mode 100644 index 0000000..7a86443 --- /dev/null +++ b/jcapiv2/model_system_insights_connectivity.go @@ -0,0 +1,24 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +type SystemInsightsConnectivity struct { + CollectionTime string `json:"collection_time,omitempty"` + Disconnected int32 `json:"disconnected,omitempty"` + Ipv4Internet int32 `json:"ipv4_internet,omitempty"` + Ipv4LocalNetwork int32 `json:"ipv4_local_network,omitempty"` + Ipv4NoTraffic int32 `json:"ipv4_no_traffic,omitempty"` + Ipv4Subnet int32 `json:"ipv4_subnet,omitempty"` + Ipv6Internet int32 `json:"ipv6_internet,omitempty"` + Ipv6LocalNetwork int32 `json:"ipv6_local_network,omitempty"` + Ipv6NoTraffic int32 `json:"ipv6_no_traffic,omitempty"` + Ipv6Subnet int32 `json:"ipv6_subnet,omitempty"` + SystemId string `json:"system_id,omitempty"` +} diff --git a/jcapiv2/model_system_insights_crashes.go b/jcapiv2/model_system_insights_crashes.go new file mode 100644 index 0000000..45ab539 --- /dev/null +++ b/jcapiv2/model_system_insights_crashes.go @@ -0,0 +1,31 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +type SystemInsightsCrashes struct { + CollectionTime string `json:"collection_time,omitempty"` + CrashPath string `json:"crash_path,omitempty"` + CrashedThread string `json:"crashed_thread,omitempty"` + Datetime string `json:"datetime,omitempty"` + ExceptionCodes string `json:"exception_codes,omitempty"` + ExceptionNotes string `json:"exception_notes,omitempty"` + ExceptionType string `json:"exception_type,omitempty"` + Identifier string `json:"identifier,omitempty"` + Parent string `json:"parent,omitempty"` + Path string `json:"path,omitempty"` + Pid string `json:"pid,omitempty"` + Registers string `json:"registers,omitempty"` + Responsible string `json:"responsible,omitempty"` + StackTrace string `json:"stack_trace,omitempty"` + SystemId string `json:"system_id,omitempty"` + Type_ string `json:"type,omitempty"` + Uid int32 `json:"uid,omitempty"` + Version string `json:"version,omitempty"` +} diff --git a/jcapiv2/model_system_insights_cups_destinations.go b/jcapiv2/model_system_insights_cups_destinations.go new file mode 100644 index 0000000..f80ac11 --- /dev/null +++ b/jcapiv2/model_system_insights_cups_destinations.go @@ -0,0 +1,17 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +type SystemInsightsCupsDestinations struct { + Name string `json:"name,omitempty"` + OptionName string `json:"option_name,omitempty"` + OptionValue string `json:"option_value,omitempty"` + SystemId string `json:"system_id,omitempty"` +} diff --git a/jcapiv2/model_system_insights_disk_encryption.go b/jcapiv2/model_system_insights_disk_encryption.go new file mode 100644 index 0000000..0a8dd1f --- /dev/null +++ b/jcapiv2/model_system_insights_disk_encryption.go @@ -0,0 +1,22 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +type SystemInsightsDiskEncryption struct { + CollectionTime string `json:"collection_time,omitempty"` + Encrypted int32 `json:"encrypted,omitempty"` + EncryptionStatus string `json:"encryption_status,omitempty"` + Name string `json:"name,omitempty"` + SystemId string `json:"system_id,omitempty"` + Type_ string `json:"type,omitempty"` + Uid string `json:"uid,omitempty"` + UserUuid string `json:"user_uuid,omitempty"` + Uuid string `json:"uuid,omitempty"` +} diff --git a/jcapiv2/model_system_insights_disk_info.go b/jcapiv2/model_system_insights_disk_info.go new file mode 100644 index 0000000..269f3db --- /dev/null +++ b/jcapiv2/model_system_insights_disk_info.go @@ -0,0 +1,26 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +type SystemInsightsDiskInfo struct { + CollectionTime string `json:"collection_time,omitempty"` + Description string `json:"description,omitempty"` + DiskIndex int32 `json:"disk_index,omitempty"` + DiskSize string `json:"disk_size,omitempty"` + HardwareModel string `json:"hardware_model,omitempty"` + Id string `json:"id,omitempty"` + Manufacturer string `json:"manufacturer,omitempty"` + Name string `json:"name,omitempty"` + Partitions int32 `json:"partitions,omitempty"` + PnpDeviceId string `json:"pnp_device_id,omitempty"` + Serial string `json:"serial,omitempty"` + SystemId string `json:"system_id,omitempty"` + Type_ string `json:"type,omitempty"` +} diff --git a/jcapiv2/model_system_insights_dns_resolvers.go b/jcapiv2/model_system_insights_dns_resolvers.go new file mode 100644 index 0000000..0e68a50 --- /dev/null +++ b/jcapiv2/model_system_insights_dns_resolvers.go @@ -0,0 +1,20 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +type SystemInsightsDnsResolvers struct { + Address string `json:"address,omitempty"` + CollectionTime string `json:"collection_time,omitempty"` + Id float64 `json:"id,omitempty"` + Netmask string `json:"netmask,omitempty"` + Options string `json:"options,omitempty"` + SystemId string `json:"system_id,omitempty"` + Type_ string `json:"type,omitempty"` +} diff --git a/jcapiv2/model_system_insights_etc_hosts.go b/jcapiv2/model_system_insights_etc_hosts.go new file mode 100644 index 0000000..f17393a --- /dev/null +++ b/jcapiv2/model_system_insights_etc_hosts.go @@ -0,0 +1,17 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +type SystemInsightsEtcHosts struct { + Address string `json:"address,omitempty"` + CollectionTime string `json:"collection_time,omitempty"` + Hostnames string `json:"hostnames,omitempty"` + SystemId string `json:"system_id,omitempty"` +} diff --git a/jcapiv2/model_system_insights_firefox_addons.go b/jcapiv2/model_system_insights_firefox_addons.go new file mode 100644 index 0000000..1721c89 --- /dev/null +++ b/jcapiv2/model_system_insights_firefox_addons.go @@ -0,0 +1,29 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +type SystemInsightsFirefoxAddons struct { + Active int32 `json:"active,omitempty"` + Autoupdate int32 `json:"autoupdate,omitempty"` + CollectionTime string `json:"collection_time,omitempty"` + Creator string `json:"creator,omitempty"` + Description string `json:"description,omitempty"` + Disabled int32 `json:"disabled,omitempty"` + Identifier string `json:"identifier,omitempty"` + Location string `json:"location,omitempty"` + Name string `json:"name,omitempty"` + Path string `json:"path,omitempty"` + SourceUrl string `json:"source_url,omitempty"` + SystemId string `json:"system_id,omitempty"` + Type_ string `json:"type,omitempty"` + Uid string `json:"uid,omitempty"` + Version string `json:"version,omitempty"` + Visible int32 `json:"visible,omitempty"` +} diff --git a/jcapiv2/model_system_insights_groups.go b/jcapiv2/model_system_insights_groups.go new file mode 100644 index 0000000..3b7db25 --- /dev/null +++ b/jcapiv2/model_system_insights_groups.go @@ -0,0 +1,20 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +type SystemInsightsGroups struct { + CollectionTime string `json:"collection_time,omitempty"` + Comment string `json:"comment,omitempty"` + Gid string `json:"gid,omitempty"` + GidSigned string `json:"gid_signed,omitempty"` + GroupSid string `json:"group_sid,omitempty"` + Groupname string `json:"groupname,omitempty"` + SystemId string `json:"system_id,omitempty"` +} diff --git a/jcapiv2/model_system_insights_ie_extensions.go b/jcapiv2/model_system_insights_ie_extensions.go new file mode 100644 index 0000000..431436a --- /dev/null +++ b/jcapiv2/model_system_insights_ie_extensions.go @@ -0,0 +1,19 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +type SystemInsightsIeExtensions struct { + CollectionTime string `json:"collection_time,omitempty"` + Name string `json:"name,omitempty"` + Path string `json:"path,omitempty"` + RegistryPath string `json:"registry_path,omitempty"` + SystemId string `json:"system_id,omitempty"` + Version string `json:"version,omitempty"` +} diff --git a/jcapiv2/model_system_insights_interface_addresses.go b/jcapiv2/model_system_insights_interface_addresses.go new file mode 100644 index 0000000..ff51a33 --- /dev/null +++ b/jcapiv2/model_system_insights_interface_addresses.go @@ -0,0 +1,22 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +type SystemInsightsInterfaceAddresses struct { + Address string `json:"address,omitempty"` + Broadcast string `json:"broadcast,omitempty"` + CollectionTime string `json:"collection_time,omitempty"` + FriendlyName string `json:"friendly_name,omitempty"` + Interface_ string `json:"interface,omitempty"` + Mask string `json:"mask,omitempty"` + PointToPoint string `json:"point_to_point,omitempty"` + SystemId string `json:"system_id,omitempty"` + Type_ string `json:"type,omitempty"` +} diff --git a/jcapiv2/model_system_insights_interface_details.go b/jcapiv2/model_system_insights_interface_details.go new file mode 100644 index 0000000..3b470d4 --- /dev/null +++ b/jcapiv2/model_system_insights_interface_details.go @@ -0,0 +1,49 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +type SystemInsightsInterfaceDetails struct { + Collisions string `json:"collisions,omitempty"` + ConnectionId string `json:"connection_id,omitempty"` + ConnectionStatus string `json:"connection_status,omitempty"` + Description string `json:"description,omitempty"` + DhcpEnabled int32 `json:"dhcp_enabled,omitempty"` + DhcpLeaseExpires string `json:"dhcp_lease_expires,omitempty"` + DhcpLeaseObtained string `json:"dhcp_lease_obtained,omitempty"` + DhcpServer string `json:"dhcp_server,omitempty"` + DnsDomain string `json:"dns_domain,omitempty"` + DnsDomainSuffixSearchOrder string `json:"dns_domain_suffix_search_order,omitempty"` + DnsHostName string `json:"dns_host_name,omitempty"` + DnsServerSearchOrder string `json:"dns_server_search_order,omitempty"` + Enabled int32 `json:"enabled,omitempty"` + Flags int32 `json:"flags,omitempty"` + FriendlyName string `json:"friendly_name,omitempty"` + Ibytes string `json:"ibytes,omitempty"` + Idrops string `json:"idrops,omitempty"` + Ierrors string `json:"ierrors,omitempty"` + Interface_ string `json:"interface,omitempty"` + Ipackets string `json:"ipackets,omitempty"` + LastChange string `json:"last_change,omitempty"` + LinkSpeed string `json:"link_speed,omitempty"` + Mac string `json:"mac,omitempty"` + Manufacturer string `json:"manufacturer,omitempty"` + Metric int32 `json:"metric,omitempty"` + Mtu int32 `json:"mtu,omitempty"` + Obytes string `json:"obytes,omitempty"` + Odrops string `json:"odrops,omitempty"` + Oerrors string `json:"oerrors,omitempty"` + Opackets string `json:"opackets,omitempty"` + PciSlot string `json:"pci_slot,omitempty"` + PhysicalAdapter int32 `json:"physical_adapter,omitempty"` + Service string `json:"service,omitempty"` + Speed int32 `json:"speed,omitempty"` + SystemId string `json:"system_id,omitempty"` + Type_ int32 `json:"type,omitempty"` +} diff --git a/jcapiv2/model_system_insights_kernel_info.go b/jcapiv2/model_system_insights_kernel_info.go new file mode 100644 index 0000000..f9f061a --- /dev/null +++ b/jcapiv2/model_system_insights_kernel_info.go @@ -0,0 +1,19 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +type SystemInsightsKernelInfo struct { + Arguments string `json:"arguments,omitempty"` + CollectionTime string `json:"collection_time,omitempty"` + Device string `json:"device,omitempty"` + Path string `json:"path,omitempty"` + SystemId string `json:"system_id,omitempty"` + Version string `json:"version,omitempty"` +} diff --git a/jcapiv2/model_system_insights_launchd.go b/jcapiv2/model_system_insights_launchd.go new file mode 100644 index 0000000..057fba4 --- /dev/null +++ b/jcapiv2/model_system_insights_launchd.go @@ -0,0 +1,36 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +type SystemInsightsLaunchd struct { + CollectionTime string `json:"collection_time,omitempty"` + Disabled string `json:"disabled,omitempty"` + Groupname string `json:"groupname,omitempty"` + InetdCompatibility string `json:"inetd_compatibility,omitempty"` + KeepAlive string `json:"keep_alive,omitempty"` + Label string `json:"label,omitempty"` + Name string `json:"name,omitempty"` + OnDemand string `json:"on_demand,omitempty"` + Path string `json:"path,omitempty"` + ProcessType string `json:"process_type,omitempty"` + Program string `json:"program,omitempty"` + ProgramArguments string `json:"program_arguments,omitempty"` + QueueDirectories string `json:"queue_directories,omitempty"` + RootDirectory string `json:"root_directory,omitempty"` + RunAtLoad string `json:"run_at_load,omitempty"` + StartInterval string `json:"start_interval,omitempty"` + StartOnMount string `json:"start_on_mount,omitempty"` + StderrPath string `json:"stderr_path,omitempty"` + StdoutPath string `json:"stdout_path,omitempty"` + SystemId string `json:"system_id,omitempty"` + Username string `json:"username,omitempty"` + WatchPaths string `json:"watch_paths,omitempty"` + WorkingDirectory string `json:"working_directory,omitempty"` +} diff --git a/jcapiv2/model_system_insights_linux_packages.go b/jcapiv2/model_system_insights_linux_packages.go new file mode 100644 index 0000000..3332bfe --- /dev/null +++ b/jcapiv2/model_system_insights_linux_packages.go @@ -0,0 +1,25 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +type SystemInsightsLinuxPackages struct { + Arch string `json:"arch,omitempty"` + InstallTime int32 `json:"install_time,omitempty"` + MaintainerOrVendor string `json:"maintainer_or_vendor,omitempty"` + MountNamespaceId string `json:"mount_namespace_id,omitempty"` + Name string `json:"name,omitempty"` + PackageFormat string `json:"package_format,omitempty"` + PackageGroupOrSection string `json:"package_group_or_section,omitempty"` + PidWithNamespace int32 `json:"pid_with_namespace,omitempty"` + ReleaseOrRevision string `json:"release_or_revision,omitempty"` + Size string `json:"size,omitempty"` + SystemId string `json:"system_id,omitempty"` + Version string `json:"version,omitempty"` +} diff --git a/jcapiv2/model_system_insights_logged_in_users.go b/jcapiv2/model_system_insights_logged_in_users.go new file mode 100644 index 0000000..925d319 --- /dev/null +++ b/jcapiv2/model_system_insights_logged_in_users.go @@ -0,0 +1,21 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +type SystemInsightsLoggedInUsers struct { + CollectionTime string `json:"collection_time,omitempty"` + Host string `json:"host,omitempty"` + Pid int32 `json:"pid,omitempty"` + SystemId string `json:"system_id,omitempty"` + Time int32 `json:"time,omitempty"` + Tty string `json:"tty,omitempty"` + Type_ string `json:"type,omitempty"` + User string `json:"user,omitempty"` +} diff --git a/jcapiv2/model_system_insights_logical_drives.go b/jcapiv2/model_system_insights_logical_drives.go new file mode 100644 index 0000000..ce3dcbe --- /dev/null +++ b/jcapiv2/model_system_insights_logical_drives.go @@ -0,0 +1,21 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +type SystemInsightsLogicalDrives struct { + BootPartition int32 `json:"boot_partition,omitempty"` + CollectionTime string `json:"collection_time,omitempty"` + DeviceId string `json:"device_id,omitempty"` + FileSystem string `json:"file_system,omitempty"` + FreeSpace string `json:"free_space,omitempty"` + Size string `json:"size,omitempty"` + SystemId string `json:"system_id,omitempty"` + Type_ string `json:"type,omitempty"` +} diff --git a/jcapiv2/model_system_insights_managed_policies.go b/jcapiv2/model_system_insights_managed_policies.go new file mode 100644 index 0000000..36d45be --- /dev/null +++ b/jcapiv2/model_system_insights_managed_policies.go @@ -0,0 +1,21 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +type SystemInsightsManagedPolicies struct { + CollectionTime string `json:"collection_time,omitempty"` + Domain string `json:"domain,omitempty"` + Manual int32 `json:"manual,omitempty"` + Name string `json:"name,omitempty"` + SystemId string `json:"system_id,omitempty"` + Username string `json:"username,omitempty"` + Uuid string `json:"uuid,omitempty"` + Value string `json:"value,omitempty"` +} diff --git a/jcapiv2/model_system_insights_mounts.go b/jcapiv2/model_system_insights_mounts.go new file mode 100644 index 0000000..1c783a5 --- /dev/null +++ b/jcapiv2/model_system_insights_mounts.go @@ -0,0 +1,26 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +type SystemInsightsMounts struct { + Blocks string `json:"blocks,omitempty"` + BlocksAvailable string `json:"blocks_available,omitempty"` + BlocksFree string `json:"blocks_free,omitempty"` + BlocksSize string `json:"blocks_size,omitempty"` + CollectionTime string `json:"collection_time,omitempty"` + Device string `json:"device,omitempty"` + DeviceAlias string `json:"device_alias,omitempty"` + Flags string `json:"flags,omitempty"` + Inodes string `json:"inodes,omitempty"` + InodesFree string `json:"inodes_free,omitempty"` + Path string `json:"path,omitempty"` + SystemId string `json:"system_id,omitempty"` + Type_ string `json:"type,omitempty"` +} diff --git a/jcapiv2/model_system_insights_os_version.go b/jcapiv2/model_system_insights_os_version.go new file mode 100644 index 0000000..ed78129 --- /dev/null +++ b/jcapiv2/model_system_insights_os_version.go @@ -0,0 +1,25 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +type SystemInsightsOsVersion struct { + Build string `json:"build,omitempty"` + Codename string `json:"codename,omitempty"` + CollectionTime string `json:"collection_time,omitempty"` + InstallDate string `json:"install_date,omitempty"` + Major int32 `json:"major,omitempty"` + Minor int32 `json:"minor,omitempty"` + Name string `json:"name,omitempty"` + Patch int32 `json:"patch,omitempty"` + Platform string `json:"platform,omitempty"` + PlatformLike string `json:"platform_like,omitempty"` + SystemId string `json:"system_id,omitempty"` + Version string `json:"version,omitempty"` +} diff --git a/jcapiv2/model_system_insights_patches.go b/jcapiv2/model_system_insights_patches.go new file mode 100644 index 0000000..af60ba0 --- /dev/null +++ b/jcapiv2/model_system_insights_patches.go @@ -0,0 +1,23 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +type SystemInsightsPatches struct { + Caption string `json:"caption,omitempty"` + CollectionTime string `json:"collection_time,omitempty"` + Csname string `json:"csname,omitempty"` + Description string `json:"description,omitempty"` + FixComments string `json:"fix_comments,omitempty"` + HotfixId string `json:"hotfix_id,omitempty"` + InstallDate string `json:"install_date,omitempty"` + InstalledBy string `json:"installed_by,omitempty"` + InstalledOn string `json:"installed_on,omitempty"` + SystemId string `json:"system_id,omitempty"` +} diff --git a/jcapiv2/model_system_insights_programs.go b/jcapiv2/model_system_insights_programs.go new file mode 100644 index 0000000..b824fb1 --- /dev/null +++ b/jcapiv2/model_system_insights_programs.go @@ -0,0 +1,24 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +type SystemInsightsPrograms struct { + CollectionTime string `json:"collection_time,omitempty"` + IdentifyingNumber string `json:"identifying_number,omitempty"` + InstallDate string `json:"install_date,omitempty"` + InstallLocation string `json:"install_location,omitempty"` + InstallSource string `json:"install_source,omitempty"` + Language string `json:"language,omitempty"` + Name string `json:"name,omitempty"` + Publisher string `json:"publisher,omitempty"` + SystemId string `json:"system_id,omitempty"` + UninstallString string `json:"uninstall_string,omitempty"` + Version string `json:"version,omitempty"` +} diff --git a/jcapiv2/model_system_insights_python_packages.go b/jcapiv2/model_system_insights_python_packages.go new file mode 100644 index 0000000..a4b1057 --- /dev/null +++ b/jcapiv2/model_system_insights_python_packages.go @@ -0,0 +1,21 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +type SystemInsightsPythonPackages struct { + Auther string `json:"auther,omitempty"` + Directory string `json:"directory,omitempty"` + License string `json:"license,omitempty"` + Name string `json:"name,omitempty"` + Path string `json:"path,omitempty"` + Summary string `json:"summary,omitempty"` + SystemId string `json:"system_id,omitempty"` + Version string `json:"version,omitempty"` +} diff --git a/jcapiv2/model_system_insights_safari_extensions.go b/jcapiv2/model_system_insights_safari_extensions.go new file mode 100644 index 0000000..c4af2d0 --- /dev/null +++ b/jcapiv2/model_system_insights_safari_extensions.go @@ -0,0 +1,25 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +type SystemInsightsSafariExtensions struct { + Author string `json:"author,omitempty"` + CollectionTime string `json:"collection_time,omitempty"` + Description string `json:"description,omitempty"` + DeveloperId string `json:"developer_id,omitempty"` + Identifier string `json:"identifier,omitempty"` + Name string `json:"name,omitempty"` + Path string `json:"path,omitempty"` + Sdk string `json:"sdk,omitempty"` + SystemId string `json:"system_id,omitempty"` + Uid string `json:"uid,omitempty"` + UpdateUrl string `json:"update_url,omitempty"` + Version string `json:"version,omitempty"` +} diff --git a/jcapiv2/model_system_insights_scheduled_tasks.go b/jcapiv2/model_system_insights_scheduled_tasks.go new file mode 100644 index 0000000..7cbc7c9 --- /dev/null +++ b/jcapiv2/model_system_insights_scheduled_tasks.go @@ -0,0 +1,24 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +type SystemInsightsScheduledTasks struct { + Action string `json:"action,omitempty"` + Enabled int32 `json:"enabled,omitempty"` + Hidden int32 `json:"hidden,omitempty"` + LastRunCode string `json:"last_run_code,omitempty"` + LastRunMessage string `json:"last_run_message,omitempty"` + LastRunTime string `json:"last_run_time,omitempty"` + Name string `json:"name,omitempty"` + NextRunTime string `json:"next_run_time,omitempty"` + Path string `json:"path,omitempty"` + State string `json:"state,omitempty"` + SystemId string `json:"system_id,omitempty"` +} diff --git a/jcapiv2/model_system_insights_secureboot.go b/jcapiv2/model_system_insights_secureboot.go new file mode 100644 index 0000000..2f54479 --- /dev/null +++ b/jcapiv2/model_system_insights_secureboot.go @@ -0,0 +1,17 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +type SystemInsightsSecureboot struct { + CollectionTime string `json:"collection_time,omitempty"` + SecureBoot float64 `json:"secure_boot,omitempty"` + SetupMode float64 `json:"setup_mode,omitempty"` + SystemId string `json:"system_id,omitempty"` +} diff --git a/jcapiv2/model_system_insights_services.go b/jcapiv2/model_system_insights_services.go new file mode 100644 index 0000000..599e4f9 --- /dev/null +++ b/jcapiv2/model_system_insights_services.go @@ -0,0 +1,26 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +type SystemInsightsServices struct { + Description string `json:"description,omitempty"` + DisplayName string `json:"display_name,omitempty"` + ModulePath string `json:"module_path,omitempty"` + Name string `json:"name,omitempty"` + Path string `json:"path,omitempty"` + Pid int32 `json:"pid,omitempty"` + ServiceExitCode int32 `json:"service_exit_code,omitempty"` + ServiceType string `json:"service_type,omitempty"` + StartType string `json:"start_type,omitempty"` + Status string `json:"status,omitempty"` + SystemId string `json:"system_id,omitempty"` + UserAccount string `json:"user_account,omitempty"` + Win32ExitCode int32 `json:"win32_exit_code,omitempty"` +} diff --git a/jcapiv2/model_system_insights_shadow.go b/jcapiv2/model_system_insights_shadow.go new file mode 100644 index 0000000..9f6e2b5 --- /dev/null +++ b/jcapiv2/model_system_insights_shadow.go @@ -0,0 +1,25 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +type SystemInsightsShadow struct { + CollectionTime string `json:"collection_time,omitempty"` + Expire string `json:"expire,omitempty"` + Flag string `json:"flag,omitempty"` + HashAlg string `json:"hash_alg,omitempty"` + Inactive string `json:"inactive,omitempty"` + LastChange string `json:"last_change,omitempty"` + Max string `json:"max,omitempty"` + Min string `json:"min,omitempty"` + PasswordStatus string `json:"password_status,omitempty"` + SystemId string `json:"system_id,omitempty"` + Username string `json:"username,omitempty"` + Warning string `json:"warning,omitempty"` +} diff --git a/jcapiv2/model_system_insights_shared_folders.go b/jcapiv2/model_system_insights_shared_folders.go new file mode 100644 index 0000000..2bb9749 --- /dev/null +++ b/jcapiv2/model_system_insights_shared_folders.go @@ -0,0 +1,17 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +type SystemInsightsSharedFolders struct { + CollectionTime string `json:"collection_time,omitempty"` + Name string `json:"name,omitempty"` + Path string `json:"path,omitempty"` + SystemId string `json:"system_id,omitempty"` +} diff --git a/jcapiv2/model_system_insights_shared_resources.go b/jcapiv2/model_system_insights_shared_resources.go new file mode 100644 index 0000000..81be4a7 --- /dev/null +++ b/jcapiv2/model_system_insights_shared_resources.go @@ -0,0 +1,23 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +type SystemInsightsSharedResources struct { + AllowMaximum int32 `json:"allow_maximum,omitempty"` + CollectionTime string `json:"collection_time,omitempty"` + Description string `json:"description,omitempty"` + InstallDate string `json:"install_date,omitempty"` + MaximumAllowed int32 `json:"maximum_allowed,omitempty"` + Name string `json:"name,omitempty"` + Path string `json:"path,omitempty"` + Status string `json:"status,omitempty"` + SystemId string `json:"system_id,omitempty"` + Type_ int32 `json:"type,omitempty"` +} diff --git a/jcapiv2/model_system_insights_sharing_preferences.go b/jcapiv2/model_system_insights_sharing_preferences.go new file mode 100644 index 0000000..6c2aaad --- /dev/null +++ b/jcapiv2/model_system_insights_sharing_preferences.go @@ -0,0 +1,25 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +type SystemInsightsSharingPreferences struct { + BluetoothSharing int32 `json:"bluetooth_sharing,omitempty"` + CollectionTime string `json:"collection_time,omitempty"` + ContentCaching int32 `json:"content_caching,omitempty"` + DiscSharing int32 `json:"disc_sharing,omitempty"` + FileSharing int32 `json:"file_sharing,omitempty"` + InternetSharing int32 `json:"internet_sharing,omitempty"` + PrinterSharing int32 `json:"printer_sharing,omitempty"` + RemoteAppleEvents int32 `json:"remote_apple_events,omitempty"` + RemoteLogin int32 `json:"remote_login,omitempty"` + RemoteManagement int32 `json:"remote_management,omitempty"` + ScreenSharing int32 `json:"screen_sharing,omitempty"` + SystemId string `json:"system_id,omitempty"` +} diff --git a/jcapiv2/model_system_insights_sip_config.go b/jcapiv2/model_system_insights_sip_config.go new file mode 100644 index 0000000..e3813d7 --- /dev/null +++ b/jcapiv2/model_system_insights_sip_config.go @@ -0,0 +1,18 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +type SystemInsightsSipConfig struct { + CollectionTime string `json:"collection_time,omitempty"` + ConfigFlag string `json:"config_flag,omitempty"` + Enabled int32 `json:"enabled,omitempty"` + EnabledNvram int32 `json:"enabled_nvram,omitempty"` + SystemId string `json:"system_id,omitempty"` +} diff --git a/jcapiv2/model_system_insights_startup_items.go b/jcapiv2/model_system_insights_startup_items.go new file mode 100644 index 0000000..e0964c4 --- /dev/null +++ b/jcapiv2/model_system_insights_startup_items.go @@ -0,0 +1,21 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +type SystemInsightsStartupItems struct { + Args string `json:"args,omitempty"` + Name string `json:"name,omitempty"` + Path string `json:"path,omitempty"` + Source string `json:"source,omitempty"` + Status string `json:"status,omitempty"` + SystemId string `json:"system_id,omitempty"` + Type_ string `json:"type,omitempty"` + Username string `json:"username,omitempty"` +} diff --git a/jcapiv2/model_system_insights_system_controls.go b/jcapiv2/model_system_insights_system_controls.go new file mode 100644 index 0000000..ee5d2eb --- /dev/null +++ b/jcapiv2/model_system_insights_system_controls.go @@ -0,0 +1,22 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +type SystemInsightsSystemControls struct { + CollectionTime string `json:"collection_time,omitempty"` + ConfigValue string `json:"config_value,omitempty"` + CurrentValue string `json:"current_value,omitempty"` + FieldName string `json:"field_name,omitempty"` + Name string `json:"name,omitempty"` + Oid string `json:"oid,omitempty"` + Subsystem string `json:"subsystem,omitempty"` + SystemId string `json:"system_id,omitempty"` + Type_ string `json:"type,omitempty"` +} diff --git a/jcapiv2/model_system_insights_system_info.go b/jcapiv2/model_system_insights_system_info.go new file mode 100644 index 0000000..ba9111f --- /dev/null +++ b/jcapiv2/model_system_insights_system_info.go @@ -0,0 +1,30 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +type SystemInsightsSystemInfo struct { + CollectionTime string `json:"collection_time,omitempty"` + ComputerName string `json:"computer_name,omitempty"` + CpuBrand string `json:"cpu_brand,omitempty"` + CpuLogicalCores int32 `json:"cpu_logical_cores,omitempty"` + CpuMicrocode string `json:"cpu_microcode,omitempty"` + CpuPhysicalCores int32 `json:"cpu_physical_cores,omitempty"` + CpuSubtype string `json:"cpu_subtype,omitempty"` + CpuType string `json:"cpu_type,omitempty"` + HardwareModel string `json:"hardware_model,omitempty"` + HardwareSerial string `json:"hardware_serial,omitempty"` + HardwareVendor string `json:"hardware_vendor,omitempty"` + HardwareVersion string `json:"hardware_version,omitempty"` + Hostname string `json:"hostname,omitempty"` + LocalHostname string `json:"local_hostname,omitempty"` + PhysicalMemory string `json:"physical_memory,omitempty"` + SystemId string `json:"system_id,omitempty"` + Uuid string `json:"uuid,omitempty"` +} diff --git a/jcapiv2/model_system_insights_tpm_info.go b/jcapiv2/model_system_insights_tpm_info.go new file mode 100644 index 0000000..b0bccf2 --- /dev/null +++ b/jcapiv2/model_system_insights_tpm_info.go @@ -0,0 +1,24 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +type SystemInsightsTpmInfo struct { + Activated float64 `json:"activated,omitempty"` + CollectionTime string `json:"collection_time,omitempty"` + Enabled float64 `json:"enabled,omitempty"` + ManufacturerId float64 `json:"manufacturer_id,omitempty"` + ManufacturerName string `json:"manufacturer_name,omitempty"` + ManufacturerVersion string `json:"manufacturer_version,omitempty"` + Owned float64 `json:"owned,omitempty"` + PhysicalPresenceVersion string `json:"physical_presence_version,omitempty"` + ProductName string `json:"product_name,omitempty"` + SpecVersion string `json:"spec_version,omitempty"` + SystemId string `json:"system_id,omitempty"` +} diff --git a/jcapiv2/model_system_insights_uptime.go b/jcapiv2/model_system_insights_uptime.go new file mode 100644 index 0000000..4e34b20 --- /dev/null +++ b/jcapiv2/model_system_insights_uptime.go @@ -0,0 +1,20 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +type SystemInsightsUptime struct { + CollectionTime string `json:"collection_time,omitempty"` + Days int32 `json:"days,omitempty"` + Hours int32 `json:"hours,omitempty"` + Minutes int32 `json:"minutes,omitempty"` + Seconds int32 `json:"seconds,omitempty"` + SystemId string `json:"system_id,omitempty"` + TotalSeconds string `json:"total_seconds,omitempty"` +} diff --git a/jcapiv2/model_system_insights_usb_devices.go b/jcapiv2/model_system_insights_usb_devices.go new file mode 100644 index 0000000..eddadce --- /dev/null +++ b/jcapiv2/model_system_insights_usb_devices.go @@ -0,0 +1,27 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +type SystemInsightsUsbDevices struct { + Class string `json:"class,omitempty"` + CollectionTime string `json:"collection_time,omitempty"` + Model string `json:"model,omitempty"` + ModelId string `json:"model_id,omitempty"` + Protocol string `json:"protocol,omitempty"` + Removable int32 `json:"removable,omitempty"` + Serial string `json:"serial,omitempty"` + Subclass string `json:"subclass,omitempty"` + SystemId string `json:"system_id,omitempty"` + UsbAddress int32 `json:"usb_address,omitempty"` + UsbPort int32 `json:"usb_port,omitempty"` + Vendor string `json:"vendor,omitempty"` + VendorId string `json:"vendor_id,omitempty"` + Version string `json:"version,omitempty"` +} diff --git a/jcapiv2/model_system_insights_user_groups.go b/jcapiv2/model_system_insights_user_groups.go new file mode 100644 index 0000000..c3d5f49 --- /dev/null +++ b/jcapiv2/model_system_insights_user_groups.go @@ -0,0 +1,17 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +type SystemInsightsUserGroups struct { + CollectionTime string `json:"collection_time,omitempty"` + Gid string `json:"gid,omitempty"` + SystemId string `json:"system_id,omitempty"` + Uid string `json:"uid,omitempty"` +} diff --git a/jcapiv2/model_system_insights_user_ssh_keys.go b/jcapiv2/model_system_insights_user_ssh_keys.go new file mode 100644 index 0000000..67e4e84 --- /dev/null +++ b/jcapiv2/model_system_insights_user_ssh_keys.go @@ -0,0 +1,18 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +type SystemInsightsUserSshKeys struct { + CollectionTime string `json:"collection_time,omitempty"` + Encrypted int32 `json:"encrypted,omitempty"` + Path string `json:"path,omitempty"` + SystemId string `json:"system_id,omitempty"` + Uid string `json:"uid,omitempty"` +} diff --git a/jcapiv2/model_system_insights_userassist.go b/jcapiv2/model_system_insights_userassist.go new file mode 100644 index 0000000..3e7f85c --- /dev/null +++ b/jcapiv2/model_system_insights_userassist.go @@ -0,0 +1,19 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +type SystemInsightsUserassist struct { + CollectionTime string `json:"collection_time,omitempty"` + Count float64 `json:"count,omitempty"` + LastExecutionTime float64 `json:"last_execution_time,omitempty"` + Path string `json:"path,omitempty"` + Sid string `json:"sid,omitempty"` + SystemId string `json:"system_id,omitempty"` +} diff --git a/jcapiv2/model_system_insights_users.go b/jcapiv2/model_system_insights_users.go new file mode 100644 index 0000000..00474f5 --- /dev/null +++ b/jcapiv2/model_system_insights_users.go @@ -0,0 +1,37 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +type SystemInsightsUsers struct { + // Indicates this account belongs to a AD-managed user + AdManaged bool `json:"ad_managed,omitempty"` + // Indicates this account has local administrator privileges + Admin bool `json:"admin,omitempty"` + CollectionTime string `json:"collection_time,omitempty"` + Description string `json:"description,omitempty"` + Directory string `json:"directory,omitempty"` + Gid string `json:"gid,omitempty"` + GidSigned string `json:"gid_signed,omitempty"` + // A Unix timestamp showing the last time this user logged in + LastLogin string `json:"last_login,omitempty"` + // Indicates this account belongs to a JumpCloud-managed user + Managed bool `json:"managed,omitempty"` + // Indicates this account represents an interactive user account vs. a system or daemon account + RealUser bool `json:"real_user,omitempty"` + Shell string `json:"shell,omitempty"` + // Indicates this account is suspended or locked out + Suspended bool `json:"suspended,omitempty"` + SystemId string `json:"system_id,omitempty"` + Type_ string `json:"type,omitempty"` + Uid string `json:"uid,omitempty"` + UidSigned string `json:"uid_signed,omitempty"` + Username string `json:"username,omitempty"` + Uuid string `json:"uuid,omitempty"` +} diff --git a/jcapiv2/model_system_insights_wifi_networks.go b/jcapiv2/model_system_insights_wifi_networks.go new file mode 100644 index 0000000..aed1a29 --- /dev/null +++ b/jcapiv2/model_system_insights_wifi_networks.go @@ -0,0 +1,27 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +type SystemInsightsWifiNetworks struct { + AutoLogin float64 `json:"auto_login,omitempty"` + CaptivePortal float64 `json:"captive_portal,omitempty"` + CollectionTime string `json:"collection_time,omitempty"` + Disabled float64 `json:"disabled,omitempty"` + LastConnected float64 `json:"last_connected,omitempty"` + NetworkName string `json:"network_name,omitempty"` + Passpoint float64 `json:"passpoint,omitempty"` + PossiblyHidden float64 `json:"possibly_hidden,omitempty"` + Roaming float64 `json:"roaming,omitempty"` + RoamingProfile string `json:"roaming_profile,omitempty"` + SecurityType string `json:"security_type,omitempty"` + Ssid string `json:"ssid,omitempty"` + SystemId string `json:"system_id,omitempty"` + TemporarilyDisabled float64 `json:"temporarily_disabled,omitempty"` +} diff --git a/jcapiv2/model_system_insights_wifi_status.go b/jcapiv2/model_system_insights_wifi_status.go new file mode 100644 index 0000000..2167370 --- /dev/null +++ b/jcapiv2/model_system_insights_wifi_status.go @@ -0,0 +1,28 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +type SystemInsightsWifiStatus struct { + Bssid string `json:"bssid,omitempty"` + Channel float64 `json:"channel,omitempty"` + ChannelBand float64 `json:"channel_band,omitempty"` + ChannelWidth float64 `json:"channel_width,omitempty"` + CollectionTime string `json:"collection_time,omitempty"` + CountryCode string `json:"country_code,omitempty"` + Interface_ string `json:"interface,omitempty"` + Mode string `json:"mode,omitempty"` + NetworkName string `json:"network_name,omitempty"` + Noise float64 `json:"noise,omitempty"` + Rssi float64 `json:"rssi,omitempty"` + SecurityType string `json:"security_type,omitempty"` + Ssid string `json:"ssid,omitempty"` + SystemId string `json:"system_id,omitempty"` + TransmitRate string `json:"transmit_rate,omitempty"` +} diff --git a/jcapiv2/model_system_insights_windows_security_center.go b/jcapiv2/model_system_insights_windows_security_center.go new file mode 100644 index 0000000..c243ab5 --- /dev/null +++ b/jcapiv2/model_system_insights_windows_security_center.go @@ -0,0 +1,22 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +type SystemInsightsWindowsSecurityCenter struct { + Antispyware string `json:"antispyware,omitempty"` + Antivirus string `json:"antivirus,omitempty"` + Autoupdate string `json:"autoupdate,omitempty"` + CollectionTime string `json:"collection_time,omitempty"` + Firewall string `json:"firewall,omitempty"` + InternetSettings string `json:"internet_settings,omitempty"` + SystemId string `json:"system_id,omitempty"` + UserAccountControl string `json:"user_account_control,omitempty"` + WindowsSecurityCenterService string `json:"windows_security_center_service,omitempty"` +} diff --git a/jcapiv2/model_system_insights_windows_security_products.go b/jcapiv2/model_system_insights_windows_security_products.go new file mode 100644 index 0000000..2778152 --- /dev/null +++ b/jcapiv2/model_system_insights_windows_security_products.go @@ -0,0 +1,21 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +type SystemInsightsWindowsSecurityProducts struct { + CollectionTime string `json:"collection_time,omitempty"` + Name string `json:"name,omitempty"` + RemediationPath string `json:"remediation_path,omitempty"` + SignaturesUpToDate float64 `json:"signatures_up_to_date,omitempty"` + State string `json:"state,omitempty"` + StateTimestamp string `json:"state_timestamp,omitempty"` + SystemId string `json:"system_id,omitempty"` + Type_ string `json:"type,omitempty"` +} diff --git a/jcapiv2/model_systemfdekey.go b/jcapiv2/model_systemfdekey.go new file mode 100644 index 0000000..856b487 --- /dev/null +++ b/jcapiv2/model_systemfdekey.go @@ -0,0 +1,14 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +type Systemfdekey struct { + Key string `json:"key"` +} diff --git a/jcapiv2/model_ticketing_integration_alert.go b/jcapiv2/model_ticketing_integration_alert.go new file mode 100644 index 0000000..3d0b9f0 --- /dev/null +++ b/jcapiv2/model_ticketing_integration_alert.go @@ -0,0 +1,17 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +type TicketingIntegrationAlert struct { + Category string `json:"category,omitempty"` + Description string `json:"description,omitempty"` + Id int32 `json:"id,omitempty"` + Name string `json:"name,omitempty"` +} diff --git a/jcapiv2/model_ticketing_integration_alerts_resp.go b/jcapiv2/model_ticketing_integration_alerts_resp.go new file mode 100644 index 0000000..78b3d77 --- /dev/null +++ b/jcapiv2/model_ticketing_integration_alerts_resp.go @@ -0,0 +1,14 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +type TicketingIntegrationAlertsResp struct { + Records []TicketingIntegrationAlert `json:"records"` +} diff --git a/jcapiv2/model_user.go b/jcapiv2/model_user.go new file mode 100644 index 0000000..50668c6 --- /dev/null +++ b/jcapiv2/model_user.go @@ -0,0 +1,27 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +type User struct { + Addresses []Address `json:"addresses,omitempty"` + AlternateEmail string `json:"alternateEmail,omitempty"` + Company string `json:"company,omitempty"` + CostCenter string `json:"costCenter,omitempty"` + Department string `json:"department,omitempty"` + Email string `json:"email,omitempty"` + // Must be unique per user. + EmployeeIdentifier string `json:"employeeIdentifier,omitempty"` + EmployeeType string `json:"employeeType,omitempty"` + Firstname string `json:"firstname,omitempty"` + JobTitle string `json:"jobTitle,omitempty"` + Lastname string `json:"lastname,omitempty"` + Location string `json:"location,omitempty"` + PhoneNumbers []PhoneNumber `json:"phoneNumbers,omitempty"` +} diff --git a/jcapiv2/model_user_group.go b/jcapiv2/model_user_group.go new file mode 100644 index 0000000..4105230 --- /dev/null +++ b/jcapiv2/model_user_group.go @@ -0,0 +1,32 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +type UserGroup struct { + Attributes *GroupAttributesUserGroup `json:"attributes,omitempty"` + // Description of a User Group + Description string `json:"description,omitempty"` + // Email address of a User Group + Email string `json:"email,omitempty"` + // ObjectId uniquely identifying a User Group. + Id string `json:"id,omitempty"` + MemberQuery *FilterQuery `json:"memberQuery,omitempty"` + // Array of GraphObjects exempted from the query + MemberQueryExemptions []GraphObject `json:"memberQueryExemptions,omitempty"` + // True if notification emails are to be sent for membership suggestions. + MemberSuggestionsNotify bool `json:"memberSuggestionsNotify,omitempty"` + // True if membership of this group is automatically updated based on the Member Query and Member Query Exemptions, if configured + MembershipAutomated bool `json:"membershipAutomated,omitempty"` + // Display name of a User Group. + Name string `json:"name,omitempty"` + SuggestionCounts *SuggestionCounts `json:"suggestionCounts,omitempty"` + // The type of the group. + Type_ string `json:"type,omitempty"` +} diff --git a/jcapiv2/model_user_group_post.go b/jcapiv2/model_user_group_post.go new file mode 100644 index 0000000..5e66b3d --- /dev/null +++ b/jcapiv2/model_user_group_post.go @@ -0,0 +1,27 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +type UserGroupPost struct { + Attributes *GroupAttributesUserGroup `json:"attributes,omitempty"` + // Description of a User Group + Description string `json:"description,omitempty"` + // Email address of a User Group + Email string `json:"email,omitempty"` + MemberQuery *FilterQuery `json:"memberQuery,omitempty"` + // Array of GraphObjects exempted from the query + MemberQueryExemptions []GraphObject `json:"memberQueryExemptions,omitempty"` + // True if notification emails are to be sent for membership suggestions. + MemberSuggestionsNotify bool `json:"memberSuggestionsNotify,omitempty"` + // True if membership of this group is automatically updated based on the Member Query and Member Query Exemptions, if configured + MembershipAutomated bool `json:"membershipAutomated,omitempty"` + // Display name of a User Group. + Name string `json:"name"` +} diff --git a/jcapiv2/model_user_group_put.go b/jcapiv2/model_user_group_put.go new file mode 100644 index 0000000..fdfa317 --- /dev/null +++ b/jcapiv2/model_user_group_put.go @@ -0,0 +1,27 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +type UserGroupPut struct { + Attributes *GroupAttributesUserGroup `json:"attributes,omitempty"` + // Description of a User Group + Description string `json:"description,omitempty"` + // Email address of a User Group + Email string `json:"email,omitempty"` + MemberQuery *FilterQuery `json:"memberQuery,omitempty"` + // Array of GraphObjects exempted from the query + MemberQueryExemptions []GraphObject `json:"memberQueryExemptions,omitempty"` + // True if notification emails are to be sent for membership suggestions. + MemberSuggestionsNotify bool `json:"memberSuggestionsNotify,omitempty"` + // True if membership of this group is automatically updated based on the Member Query and Member Query Exemptions, if configured + MembershipAutomated bool `json:"membershipAutomated,omitempty"` + // Display name of a User Group. + Name string `json:"name"` +} diff --git a/jcapiv2/model_workday_fields.go b/jcapiv2/model_workday_fields.go new file mode 100644 index 0000000..8a56f8b --- /dev/null +++ b/jcapiv2/model_workday_fields.go @@ -0,0 +1,15 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +type WorkdayFields struct { + Name string `json:"name,omitempty"` + ReportUrl string `json:"reportUrl,omitempty"` +} diff --git a/jcapiv2/model_workday_input.go b/jcapiv2/model_workday_input.go new file mode 100644 index 0000000..49394ae --- /dev/null +++ b/jcapiv2/model_workday_input.go @@ -0,0 +1,16 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +type WorkdayInput struct { + Auth *AuthInput `json:"auth,omitempty"` + Name string `json:"name,omitempty"` + ReportUrl string `json:"reportUrl,omitempty"` +} diff --git a/jcapiv2/model_workday_output.go b/jcapiv2/model_workday_output.go new file mode 100644 index 0000000..e0c3a97 --- /dev/null +++ b/jcapiv2/model_workday_output.go @@ -0,0 +1,18 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +type WorkdayOutput struct { + Auth *WorkdayoutputAuth `json:"auth,omitempty"` + Id string `json:"id,omitempty"` + LastImport string `json:"lastImport,omitempty"` + Name string `json:"name,omitempty"` + ReportUrl string `json:"reportUrl,omitempty"` +} diff --git a/jcapiv2/model_workday_worker.go b/jcapiv2/model_workday_worker.go new file mode 100644 index 0000000..31c491f --- /dev/null +++ b/jcapiv2/model_workday_worker.go @@ -0,0 +1,18 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +type WorkdayWorker struct { + Attributes *interface{} `json:"attributes,omitempty"` + Email string `json:"email,omitempty"` + FirstName string `json:"firstName,omitempty"` + LastName string `json:"lastName,omitempty"` + Username string `json:"username,omitempty"` +} diff --git a/jcapiv2/model_workdayoutput_auth.go b/jcapiv2/model_workdayoutput_auth.go new file mode 100644 index 0000000..19a084b --- /dev/null +++ b/jcapiv2/model_workdayoutput_auth.go @@ -0,0 +1,15 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +type WorkdayoutputAuth struct { + Basic *AuthInfo `json:"basic,omitempty"` + Oauth *AuthInfo `json:"oauth,omitempty"` +} diff --git a/jcapiv2/response.go b/jcapiv2/response.go new file mode 100644 index 0000000..1cbcb8d --- /dev/null +++ b/jcapiv2/response.go @@ -0,0 +1,43 @@ +/* + * JumpCloud API + * + * # Overview JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. # Directory Objects This API offers the ability to interact with some of our core features; otherwise known as Directory Objects. The Directory Objects are: * Commands * Policies * Policy Groups * Applications * Systems * Users * User Groups * System Groups * Radius Servers * Directories: Office 365, LDAP,G-Suite, Active Directory * Duo accounts and applications. The Directory Object is an important concept to understand in order to successfully use JumpCloud API. ## JumpCloud Graph We've also introduced the concept of the JumpCloud Graph along with Directory Objects. The Graph is a powerful aspect of our platform which will enable you to associate objects with each other, or establish membership for certain objects to become members of other objects. Specific `GET` endpoints will allow you to traverse the JumpCloud Graph to return all indirect and directly bound objects in your organization. | ![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png \"JumpCloud Graph Model Example\") | |:--:| | **This diagram highlights our association and membership model as it relates to Directory Objects.** | # API Key ## Access Your API Key To locate your API Key: 1. Log into the [JumpCloud Admin Console](https://console.jumpcloud.com/). 2. Go to the username drop down located in the top-right of the Console. 3. Retrieve your API key from API Settings. ## API Key Considerations This API key is associated to the currently logged in administrator. Other admins will have different API keys. **WARNING** Please keep this API key secret, as it grants full access to any data accessible via your JumpCloud console account. You can also reset your API key in the same location in the JumpCloud Admin Console. ## Recycling or Resetting Your API Key In order to revoke access with the current API key, simply reset your API key. This will render all calls using the previous API key inaccessible. Your API key will be passed in as a header with the header name \"x-api-key\". ```bash curl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\" ``` # System Context * [Introduction](#introduction) * [Supported endpoints](#supported-endpoints) * [Response codes](#response-codes) * [Authentication](#authentication) * [Additional examples](#additional-examples) * [Third party](#third-party) ## Introduction JumpCloud System Context Authorization is an alternative way to authenticate with a subset of JumpCloud's REST APIs. Using this method, a system can manage its information and resource associations, allowing modern auto provisioning environments to scale as needed. **Notes:** * The following documentation applies to Linux Operating Systems only. * Systems that have been automatically enrolled using Apple's Device Enrollment Program (DEP) or systems enrolled using the User Portal install are not eligible to use the System Context API to prevent unauthorized access to system groups and resources. If a script that utilizes the System Context API is invoked on a system enrolled in this way, it will display an error. ## Supported Endpoints JumpCloud System Context Authorization can be used in conjunction with Systems endpoints found in the V1 API and certain System Group endpoints found in the v2 API. * A system may fetch, alter, and delete metadata about itself, including manipulating a system's Group and Systemuser associations, * `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_get) [`PUT`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_put) * A system may delete itself from your JumpCloud organization * `/api/systems/{system_id}` | [`DELETE`](https://docs.jumpcloud.com/api/1.0/index.html#operation/systems_delete) * A system may fetch its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembership) * `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsList) * `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemTraverseUser) * A system may alter its direct resource associations under v2 (Groups) * `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemAssociationsPost) * A system may alter its System Group associations * `/api/v2/systemgroups/{group_id}/members` | [`POST`](https://docs.jumpcloud.com/api/2.0/index.html#operation/graph_systemGroupMembersPost) * _NOTE_ If a system attempts to alter the system group membership of a different system the request will be rejected ## Response Codes If endpoints other than those described above are called using the System Context API, the server will return a `401` response. ## Authentication To allow for secure access to our APIs, you must authenticate each API request. JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00) to authenticate API requests. The HTTP Signatures sent with each request are similar to the signatures used by the Amazon Web Services REST API. To help with the request-signing process, we have provided an [example bash script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh). This example API request simply requests the entire system record. You must be root, or have permissions to access the contents of the `/opt/jc` directory to generate a signature. Here is a breakdown of the example script with explanations. First, the script extracts the systemKey from the JSON formatted `/opt/jc/jcagent.conf` file. ```bash #!/bin/bash conf=\"`cat /opt/jc/jcagent.conf`\" regex=\"systemKey\\\":\\\"(\\w+)\\\"\" if [[ $conf =~ $regex ]] ; then systemKey=\"${BASH_REMATCH[1]}\" fi ``` Then, the script retrieves the current date in the correct format. ```bash now=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`; ``` Next, we build a signing string to demonstrate the expected signature format. The signed string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35) and the date header, separated by a newline character. ```bash signstr=\"GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" ``` The next step is to calculate and apply the signature. This is a two-step process: 1. Create a signature from the signing string using the JumpCloud Agent private key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key`` 2. Then Base64-encode the signature string and trim off the newline characters: ``| openssl enc -e -a | tr -d '\\n'`` The combined steps above result in: ```bash signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; ``` Finally, we make sure the API call sending the signature has the same Authorization and Date header values, HTTP method, and URL that were used in the signing string. ```bash curl -iq \\ -H \"Accept: application/json\" \\ -H \"Content-Type: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Input Data All PUT and POST methods should use the HTTP Content-Type header with a value of 'application/json'. PUT methods are used for updating a record. POST methods are used to create a record. The following example demonstrates how to update the `displayName` of the system. ```bash signstr=\"PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\" signature=`printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ; curl -iq \\ -d \"{\\\"displayName\\\" : \\\"updated-system-name-1\\\"}\" \\ -X \"PUT\" \\ -H \"Content-Type: application/json\" \\ -H \"Accept: application/json\" \\ -H \"Date: ${now}\" \\ -H \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\ --url https://console.jumpcloud.com/api/systems/${systemKey} ``` ### Output Data All results will be formatted as JSON. Here is an abbreviated example of response output: ```json { \"_id\": \"525ee96f52e144993e000015\", \"agentServer\": \"lappy386\", \"agentVersion\": \"0.9.42\", \"arch\": \"x86_64\", \"connectionKey\": \"127.0.0.1_51812\", \"displayName\": \"ubuntu-1204\", \"firstContact\": \"2013-10-16T19:30:55.611Z\", \"hostname\": \"ubuntu-1204\" ... ``` ## Additional Examples ### Signing Authentication Example This example demonstrates how to make an authenticated request to fetch the JumpCloud record for this system. [SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh) ### Shutdown Hook This example demonstrates how to make an authenticated request on system shutdown. Using an init.d script registered at run level 0, you can call the System Context API as the system is shutting down. [Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) is an example of an init.d script that only runs at system shutdown. After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) script, you should install it on the system(s) running the JumpCloud agent. 1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd) to `/etc/init.d/instance-shutdown`. 2. On Ubuntu systems, run `update-rc.d instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add instance-shutdown`. ## Third Party ### Chef Cookbooks [https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud) [https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud) # Multi-Tenant Portal Headers Multi-Tenant Organization API Headers are available for JumpCloud Admins to use when making API requests from Organizations that have multiple managed organizations. The `x-org-id` is a required header for all multi-tenant admins when making API requests to JumpCloud. This header will define to which organization you would like to make the request. **NOTE** Single Tenant Admins do not need to provide this header when making an API request. ## Header Value `x-org-id` ## API Response Codes * `400` Malformed ID. * `400` x-org-id and Organization path ID do not match. * `401` ID not included for multi-tenant admin * `403` ID included on unsupported route. * `404` Organization ID Not Found. ```bash curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -H 'x-org-id: {ORG_ID}' ``` ## To Obtain an Individual Organization ID via the UI As a prerequisite, your Primary Organization will need to be setup for Multi-Tenancy. This provides access to the Multi-Tenant Organization Admin Portal. 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant Admin Portal. 2. From the Multi-Tenant Portal's primary navigation bar, select the Organization you'd like to access. 3. You will automatically be routed to that Organization's Admin Console. 4. Go to Settings in the sub-tenant's primary navigation. 5. You can obtain your Organization ID below your Organization's Contact Information on the Settings page. ## To Obtain All Organization IDs via the API * You can make an API request to this endpoint using the API key of your Primary Organization. `https://console.jumpcloud.com/api/organizations/` This will return all your managed organizations. ```bash curl -X GET \\ https://console.jumpcloud.com/api/organizations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` # SDKs You can find language specific SDKs that can help you kickstart your Integration with JumpCloud in the following GitHub repositories: * [Python](https://github.com/TheJumpCloud/jcapi-python) * [Go](https://github.com/TheJumpCloud/jcapi-go) * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby) * [Java](https://github.com/TheJumpCloud/jcapi-java) + * + * API version: 2.0 + * Contact: support@jumpcloud.com + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ +package jcapiv2 + +import ( + "net/http" +) + +type APIResponse struct { + *http.Response `json:"-"` + Message string `json:"message,omitempty"` + // Operation is the name of the swagger operation. + Operation string `json:"operation,omitempty"` + // RequestURL is the request URL. This value is always available, even if the + // embedded *http.Response is nil. + RequestURL string `json:"url,omitempty"` + // Method is the HTTP method used for the request. This value is always + // available, even if the embedded *http.Response is nil. + Method string `json:"method,omitempty"` + // Payload holds the contents of the response body (which may be nil or empty). + // This is provided here as the raw response.Body() reader will have already + // been drained. + Payload []byte `json:"-"` +} + +func NewAPIResponse(r *http.Response) *APIResponse { + + response := &APIResponse{Response: r} + return response +} + +func NewAPIResponseWithError(errorMessage string) *APIResponse { + + response := &APIResponse{Message: errorMessage} + return response +} diff --git a/tools/go-export-parser b/tools/go-export-parser old mode 100755 new mode 100644 diff --git a/v1/.swagger-codegen/VERSION b/v1/.swagger-codegen/VERSION deleted file mode 100644 index a625450..0000000 --- a/v1/.swagger-codegen/VERSION +++ /dev/null @@ -1 +0,0 @@ -2.3.1 \ No newline at end of file diff --git a/v1/README.md b/v1/README.md deleted file mode 100644 index 1b624f6..0000000 --- a/v1/README.md +++ /dev/null @@ -1,155 +0,0 @@ -# Go API client for v1 - - JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, & system users. - -## Overview -This API client was generated by the [swagger-codegen](https://github.com/swagger-api/swagger-codegen) project. By using the [swagger-spec](https://github.com/swagger-api/swagger-spec) from a remote server, you can easily generate an API client. - -- API version: 1.0 -- Package version: 3.0.0 -- Build package: io.swagger.codegen.languages.GoClientCodegen - -## Installation -Put the package under your project folder and add the following in import: -``` - "./v1" -``` - -## Documentation for API Endpoints - -All URIs are relative to *https://console.jumpcloud.com/api* - -Class | Method | HTTP request | Description ------------- | ------------- | ------------- | ------------- -*ApplicationTemplatesApi* | [**ApplicationTemplatesGet**](docs/ApplicationTemplatesApi.md#applicationtemplatesget) | **Get** /application-templates/{id} | Get an Application Template -*ApplicationTemplatesApi* | [**ApplicationTemplatesList**](docs/ApplicationTemplatesApi.md#applicationtemplateslist) | **Get** /application-templates | List Application Templates -*ApplicationsApi* | [**ApplicationsDelete**](docs/ApplicationsApi.md#applicationsdelete) | **Delete** /applications/{id} | Delete an Application -*ApplicationsApi* | [**ApplicationsGet**](docs/ApplicationsApi.md#applicationsget) | **Get** /applications/{id} | Get an Application -*ApplicationsApi* | [**ApplicationsList**](docs/ApplicationsApi.md#applicationslist) | **Get** /applications | Applications -*ApplicationsApi* | [**ApplicationsPost**](docs/ApplicationsApi.md#applicationspost) | **Post** /applications | Create an Application -*ApplicationsApi* | [**ApplicationsPut**](docs/ApplicationsApi.md#applicationsput) | **Put** /applications/{id} | Update an Application -*CommandResultsApi* | [**CommandResultsDelete**](docs/CommandResultsApi.md#commandresultsdelete) | **Delete** /commandresults/{id} | Delete a Command result -*CommandResultsApi* | [**CommandResultsGet**](docs/CommandResultsApi.md#commandresultsget) | **Get** /commandresults/{id} | List an individual Command result -*CommandResultsApi* | [**CommandResultsList**](docs/CommandResultsApi.md#commandresultslist) | **Get** /commandresults | List all Command Results -*CommandTriggersApi* | [**CommandTriggerWebhookPost**](docs/CommandTriggersApi.md#commandtriggerwebhookpost) | **Post** /command/trigger/{triggername} | Launch a command via a Trigger -*CommandsApi* | [**CommandFileGet**](docs/CommandsApi.md#commandfileget) | **Get** /files/command/{id} | Get a Command File -*CommandsApi* | [**CommandsDelete**](docs/CommandsApi.md#commandsdelete) | **Delete** /commands/{id} | Delete a Command -*CommandsApi* | [**CommandsGet**](docs/CommandsApi.md#commandsget) | **Get** /commands/{id} | List an individual Command -*CommandsApi* | [**CommandsList**](docs/CommandsApi.md#commandslist) | **Get** /commands | List All Commands -*CommandsApi* | [**CommandsPost**](docs/CommandsApi.md#commandspost) | **Post** /commands | Create A Command -*CommandsApi* | [**CommandsPut**](docs/CommandsApi.md#commandsput) | **Put** /commands/{id} | Update a Command -*OrganizationsApi* | [**OrganizationList**](docs/OrganizationsApi.md#organizationlist) | **Get** /organizations | Get Organization Details -*RadiusServersApi* | [**RadiusServersList**](docs/RadiusServersApi.md#radiusserverslist) | **Get** /radiusservers | List Radius Servers -*RadiusServersApi* | [**RadiusServersPost**](docs/RadiusServersApi.md#radiusserverspost) | **Post** /radiusservers | Create a Radius Server -*RadiusServersApi* | [**RadiusServersPut**](docs/RadiusServersApi.md#radiusserversput) | **Put** /radiusservers/{id} | Update Radius Servers -*SearchApi* | [**SearchOrganizationsPost**](docs/SearchApi.md#searchorganizationspost) | **Post** /search/organizations | Search Organizations -*SearchApi* | [**SearchSystemsPost**](docs/SearchApi.md#searchsystemspost) | **Post** /search/systems | Search Systems -*SearchApi* | [**SearchSystemusersPost**](docs/SearchApi.md#searchsystemuserspost) | **Post** /search/systemusers | Search System Users -*SystemsApi* | [**SystemsDelete**](docs/SystemsApi.md#systemsdelete) | **Delete** /systems/{id} | Delete a System -*SystemsApi* | [**SystemsGet**](docs/SystemsApi.md#systemsget) | **Get** /systems/{id} | List an individual system -*SystemsApi* | [**SystemsList**](docs/SystemsApi.md#systemslist) | **Get** /systems | List All Systems -*SystemsApi* | [**SystemsPut**](docs/SystemsApi.md#systemsput) | **Put** /systems/{id} | Update a system -*SystemsApi* | [**SystemsSystemusersBindingList**](docs/SystemsApi.md#systemssystemusersbindinglist) | **Get** /systems/{id}/systemusers | List system user bindings -*SystemsApi* | [**SystemsSystemusersBindingPut**](docs/SystemsApi.md#systemssystemusersbindingput) | **Put** /systems/{id}/systemusers | Update a system's or user's binding -*SystemusersApi* | [**SshkeyDelete**](docs/SystemusersApi.md#sshkeydelete) | **Delete** /systemusers/{systemuser_id}/sshkeys/{id} | Delete a system user's Public SSH Keys -*SystemusersApi* | [**SshkeyList**](docs/SystemusersApi.md#sshkeylist) | **Get** /systemusers/{id}/sshkeys | List a system user's public SSH keys -*SystemusersApi* | [**SshkeyPost**](docs/SystemusersApi.md#sshkeypost) | **Post** /systemusers/{id}/sshkeys | Create a system user's Public SSH Key -*SystemusersApi* | [**SystemusersDelete**](docs/SystemusersApi.md#systemusersdelete) | **Delete** /systemusers/{id} | Delete a system user -*SystemusersApi* | [**SystemusersGet**](docs/SystemusersApi.md#systemusersget) | **Get** /systemusers/{id} | List a system user -*SystemusersApi* | [**SystemusersList**](docs/SystemusersApi.md#systemuserslist) | **Get** /systemusers | List all system users -*SystemusersApi* | [**SystemusersPost**](docs/SystemusersApi.md#systemuserspost) | **Post** /systemusers | Create a system user -*SystemusersApi* | [**SystemusersPut**](docs/SystemusersApi.md#systemusersput) | **Put** /systemusers/{id} | Update a system user -*SystemusersApi* | [**SystemusersResetmfa**](docs/SystemusersApi.md#systemusersresetmfa) | **Post** /systemusers/{id}/resetmfa | Reset a system user's MFA token -*SystemusersApi* | [**SystemusersSystemsBindingList**](docs/SystemusersApi.md#systemuserssystemsbindinglist) | **Get** /systemusers/{id}/systems | List system user binding -*SystemusersApi* | [**SystemusersSystemsBindingPut**](docs/SystemusersApi.md#systemuserssystemsbindingput) | **Put** /systemusers/{id}/systems | Update a system user binding -*SystemusersApi* | [**SystemusersUnlock**](docs/SystemusersApi.md#systemusersunlock) | **Post** /systemusers/{id}/unlock | Unlock a system user -*TagsApi* | [**TagsDelete**](docs/TagsApi.md#tagsdelete) | **Delete** /tags/{name} | Delete a Tag -*TagsApi* | [**TagsGet**](docs/TagsApi.md#tagsget) | **Get** /Tags/{name} | List a Tag -*TagsApi* | [**TagsList**](docs/TagsApi.md#tagslist) | **Get** /tags | List All Tags -*TagsApi* | [**TagsPost**](docs/TagsApi.md#tagspost) | **Post** /tags | Create a Tag -*TagsApi* | [**TagsPut**](docs/TagsApi.md#tagsput) | **Put** /Tag/{name} | Update a Tag - - -## Documentation For Models - - - [Application](docs/Application.md) - - [ApplicationConfig](docs/ApplicationConfig.md) - - [ApplicationConfigAcsUrl](docs/ApplicationConfigAcsUrl.md) - - [ApplicationConfigAcsUrlTooltip](docs/ApplicationConfigAcsUrlTooltip.md) - - [ApplicationConfigAcsUrlTooltipVariables](docs/ApplicationConfigAcsUrlTooltipVariables.md) - - [ApplicationConfigConstantAttributes](docs/ApplicationConfigConstantAttributes.md) - - [ApplicationConfigConstantAttributesValue](docs/ApplicationConfigConstantAttributesValue.md) - - [ApplicationConfigDatabaseAttributes](docs/ApplicationConfigDatabaseAttributes.md) - - [Applicationslist](docs/Applicationslist.md) - - [Applicationtemplate](docs/Applicationtemplate.md) - - [ApplicationtemplateJit](docs/ApplicationtemplateJit.md) - - [Applicationtemplateslist](docs/Applicationtemplateslist.md) - - [Body](docs/Body.md) - - [Body1](docs/Body1.md) - - [Command](docs/Command.md) - - [Commandfilereturn](docs/Commandfilereturn.md) - - [CommandfilereturnResults](docs/CommandfilereturnResults.md) - - [Commandresult](docs/Commandresult.md) - - [CommandresultResponse](docs/CommandresultResponse.md) - - [CommandresultResponseData](docs/CommandresultResponseData.md) - - [Commandresultslist](docs/Commandresultslist.md) - - [Commandslist](docs/Commandslist.md) - - [CommandslistResults](docs/CommandslistResults.md) - - [Errorresponse](docs/Errorresponse.md) - - [Fde](docs/Fde.md) - - [Mfa](docs/Mfa.md) - - [Organizationslist](docs/Organizationslist.md) - - [OrganizationslistResults](docs/OrganizationslistResults.md) - - [Radiusserver](docs/Radiusserver.md) - - [Radiusserverpost](docs/Radiusserverpost.md) - - [Radiusserverput](docs/Radiusserverput.md) - - [Radiusserverslist](docs/Radiusserverslist.md) - - [Search](docs/Search.md) - - [Sshkeylist](docs/Sshkeylist.md) - - [Sshkeypost](docs/Sshkeypost.md) - - [System](docs/System.md) - - [SystemNetworkInterfaces](docs/SystemNetworkInterfaces.md) - - [SystemSshdParams](docs/SystemSshdParams.md) - - [SystemSystemInsights](docs/SystemSystemInsights.md) - - [Systemput](docs/Systemput.md) - - [SystemputAgentBoundMessages](docs/SystemputAgentBoundMessages.md) - - [Systemslist](docs/Systemslist.md) - - [Systemuser](docs/Systemuser.md) - - [Systemuserbinding](docs/Systemuserbinding.md) - - [Systemuserbindingsput](docs/Systemuserbindingsput.md) - - [Systemuserput](docs/Systemuserput.md) - - [SystemuserputAddresses](docs/SystemuserputAddresses.md) - - [SystemuserputPhoneNumbers](docs/SystemuserputPhoneNumbers.md) - - [Systemuserputpost](docs/Systemuserputpost.md) - - [SystemuserputpostAddresses](docs/SystemuserputpostAddresses.md) - - [SystemuserputpostPhoneNumbers](docs/SystemuserputpostPhoneNumbers.md) - - [Systemuserreturn](docs/Systemuserreturn.md) - - [SystemuserreturnAddresses](docs/SystemuserreturnAddresses.md) - - [SystemuserreturnPhoneNumbers](docs/SystemuserreturnPhoneNumbers.md) - - [Systemuserslist](docs/Systemuserslist.md) - - [Tag](docs/Tag.md) - - [Tagpost](docs/Tagpost.md) - - [Tagput](docs/Tagput.md) - - [Tagslist](docs/Tagslist.md) - - [Usersystembinding](docs/Usersystembinding.md) - - [Usersystembindingsput](docs/Usersystembindingsput.md) - - -## Documentation For Authorization - -## x-api-key -- **Type**: API key - -Example -``` - auth := context.WithValue(context.Background(), sw.ContextAPIKey, sw.APIKey{ - Key: "APIKEY", - Prefix: "Bearer", // Omit if not necessary. - }) - r, err := client.Service.Operation(auth, args) -``` - -## Author - - - diff --git a/v1/api/swagger.yaml b/v1/api/swagger.yaml deleted file mode 100644 index cfd3d86..0000000 --- a/v1/api/swagger.yaml +++ /dev/null @@ -1,6848 +0,0 @@ ---- -swagger: "2.0" -info: - description: " JumpCloud's V1 API. This set of endpoints allows JumpCloud customers\ - \ to manage commands, systems, & system users." - version: "1.0" - title: "JumpCloud APIs" -host: "console.jumpcloud.com" -basePath: "/api" -schemes: -- "https" -consumes: -- "application/json" -produces: -- "application/json" -paths: - /Tag/{name}: - put: - tags: - - "Tags" - summary: "Update a Tag" - description: "Hidden as Tags is deprecated\n\nUpdate a specific tag." - operationId: "tags_put" - parameters: - - name: "name" - in: "path" - required: true - type: "string" - x-exportParamName: "Name" - - in: "body" - name: "body" - required: false - schema: - $ref: "#/definitions/tagput" - x-exportParamName: "Body" - - name: "Content-Type" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "ContentType" - - name: "Accept" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "Accept" - responses: - 200: - description: "" - schema: - $ref: "#/definitions/tag" - security: - - x-api-key: [] - x-stoplight: - afterScript: null - beforeScript: null - id: "tags_put" - mock: - dynamic: false - enabled: false - statusCode: 200 - public: false - /Tags/{name}: - get: - tags: - - "Tags" - summary: "List a Tag" - description: "Hidden as Tags is deprecated\n\nReturns a specific tag." - operationId: "tags_get" - parameters: - - name: "name" - in: "path" - required: true - type: "string" - x-exportParamName: "Name" - - name: "fields" - in: "query" - description: "Use a space seperated string of field parameters to include\ - \ the data in the response. If omitted, the default list of fields will\ - \ be returned.\n" - required: false - type: "string" - x-exportParamName: "Fields" - - name: "limit" - in: "query" - description: "The number of records to return at once. Limited to 100." - required: false - type: "integer" - default: 10 - x-exportParamName: "Limit" - - name: "skip" - in: "query" - description: "The offset into the records to return." - required: false - type: "integer" - default: 0 - minimum: 0 - x-exportParamName: "Skip" - - name: "sort" - in: "query" - description: "Use space separated sort parameters to sort the collection.\n\ - Default sort is ascending. Prefix with `-` to sort descending.\n" - required: false - type: "string" - x-exportParamName: "Sort" - - name: "filter" - in: "query" - description: "A filter to apply to the query." - required: false - type: "string" - x-exportParamName: "Filter" - - name: "Content-Type" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "ContentType" - - name: "Accept" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "Accept" - responses: - 200: - description: "" - schema: - $ref: "#/definitions/tag" - security: - - x-api-key: [] - x-stoplight: - afterScript: null - beforeScript: null - id: "tags_get" - mock: - dynamic: false - enabled: false - statusCode: 200 - public: false - /application-templates: - get: - tags: - - "Application Templates" - summary: "List Application Templates" - description: "The endpoint returns all the SSO / SAML Application Templates.\n\ - \n#### Sample Request\n```\ncurl -X GET https://console.jumpcloud.com/api/application-templates\ - \ \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\ - \ \\\n -H 'x-api-key: {API_KEY}'\n\n```" - operationId: "application_templates_list" - parameters: - - name: "fields" - in: "query" - description: "The comma separated fields included in the returned records.\ - \ If omitted the default list of fields will be returned." - required: false - type: "string" - x-exportParamName: "Fields" - - name: "limit" - in: "query" - description: "The number of records to return at once." - required: false - type: "integer" - x-exportParamName: "Limit" - - name: "skip" - in: "query" - description: "The offset into the records to return." - required: false - type: "integer" - x-exportParamName: "Skip" - - name: "sort" - in: "query" - required: false - type: "string" - default: "The comma separated fields used to sort the collection. Default\ - \ sort is ascending, prefix with - to sort descending." - x-exportParamName: "Sort" - - name: "filter" - in: "query" - description: "A filter to apply to the query." - required: false - type: "string" - x-exportParamName: "Filter" - - name: "Content-Type" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "ContentType" - - name: "Accept" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "Accept" - - name: "x-org-id" - in: "header" - description: "" - required: false - type: "string" - x-exportParamName: "XOrgId" - responses: - 200: - description: "" - schema: - $ref: "#/definitions/applicationtemplateslist" - security: - - x-api-key: [] - x-stoplight: - afterScript: null - beforeScript: null - id: "application_templates_list" - mock: - dynamic: false - enabled: false - statusCode: 200 - public: true - /application-templates/{id}: - get: - tags: - - "Application Templates" - summary: "Get an Application Template" - description: "The endpoint returns a specific SSO / SAML Application Template.\n\ - \n#### Sample Request\n```\ncurl -X GET https://console.jumpcloud.com/api/application-templates/{id}\ - \ \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\ - \ \\\n -H 'x-api-key: {API_KEY}'\n\n```" - operationId: "application_templates_get" - parameters: - - name: "id" - in: "path" - required: true - type: "string" - x-exportParamName: "Id" - - name: "fields" - in: "query" - description: "The comma separated fields included in the returned records.\ - \ If omitted the default list of fields will be returned." - required: false - type: "string" - x-exportParamName: "Fields" - - name: "limit" - in: "query" - description: "The number of records to return at once." - required: false - type: "integer" - x-exportParamName: "Limit" - - name: "skip" - in: "query" - description: "The offset into the records to return." - required: false - type: "integer" - x-exportParamName: "Skip" - - name: "sort" - in: "query" - required: false - type: "string" - default: "The comma separated fields used to sort the collection. Default\ - \ sort is ascending, prefix with - to sort descending." - x-exportParamName: "Sort" - - name: "filter" - in: "query" - description: "A filter to apply to the query." - required: false - type: "string" - x-exportParamName: "Filter" - - name: "Content-Type" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "ContentType" - - name: "Accept" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "Accept" - - name: "x-org-id" - in: "header" - description: "" - required: false - type: "string" - x-exportParamName: "XOrgId" - responses: - 200: - description: "" - schema: - $ref: "#/definitions/applicationtemplate" - security: - - x-api-key: [] - x-stoplight: - afterScript: null - beforeScript: null - id: "application_templates_get" - mock: - dynamic: false - enabled: false - statusCode: 200 - public: true - /applications: - get: - tags: - - "Applications" - summary: "Applications" - description: "The endpoint returns all your SSO / SAML Applications.\n\n####\ - \ Sample Request\n```\ncurl -X GET https://console.jumpcloud.com/api/applications\ - \ \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\ - \ \\\n -H 'x-api-key: {API_KEY}'\n\n```" - operationId: "applications_list" - parameters: - - name: "fields" - in: "query" - description: "The comma separated fields included in the returned records.\ - \ If omitted the default list of fields will be returned." - required: false - type: "string" - x-exportParamName: "Fields" - - name: "limit" - in: "query" - description: "The number of records to return at once." - required: false - type: "integer" - x-exportParamName: "Limit" - - name: "skip" - in: "query" - description: "The offset into the records to return." - required: false - type: "integer" - x-exportParamName: "Skip" - - name: "sort" - in: "query" - required: false - type: "string" - default: "The comma separated fields used to sort the collection. Default\ - \ sort is ascending, prefix with - to sort descending." - x-exportParamName: "Sort" - - name: "filter" - in: "query" - description: "A filter to apply to the query." - required: false - type: "string" - x-exportParamName: "Filter" - - name: "Content-Type" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "ContentType" - - name: "Accept" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "Accept" - - name: "x-org-id" - in: "header" - description: "" - required: false - type: "string" - x-exportParamName: "XOrgId" - responses: - 200: - description: "" - schema: - $ref: "#/definitions/applicationslist" - security: - - x-api-key: [] - x-stoplight: - afterScript: null - beforeScript: null - id: "applications_list" - mock: - dynamic: false - enabled: false - statusCode: 200 - public: true - post: - tags: - - "Applications" - summary: "Create an Application" - description: "The endpoint adds a new SSO / SAML Applications." - operationId: "applications_post" - parameters: - - in: "body" - name: "body" - required: false - schema: - $ref: "#/definitions/application" - x-exportParamName: "Body" - - name: "Content-Type" - in: "header" - required: false - type: "string" - x-exportParamName: "ContentType" - - name: "Accept" - in: "header" - required: false - type: "string" - x-exportParamName: "Accept" - - name: "x-org-id" - in: "header" - required: false - type: "string" - x-exportParamName: "XOrgId" - responses: - 200: - description: "" - schema: - $ref: "#/definitions/application" - security: - - x-api-key: [] - x-stoplight: - afterScript: null - beforeScript: null - id: "applications_post" - mock: - dynamic: false - enabled: false - statusCode: 200 - public: true - /applications/{id}: - get: - tags: - - "Applications" - summary: "Get an Application" - description: "The endpoint retrieves an SSO / SAML Application." - operationId: "applications_get" - parameters: - - name: "id" - in: "path" - required: true - type: "string" - x-exportParamName: "Id" - - name: "Content-Type" - in: "header" - required: false - type: "string" - x-exportParamName: "ContentType" - - name: "Accept" - in: "header" - required: false - type: "string" - x-exportParamName: "Accept" - - name: "x-org-id" - in: "header" - required: false - type: "string" - x-exportParamName: "XOrgId" - responses: - 200: - description: "" - schema: - $ref: "#/definitions/application" - security: - - x-api-key: [] - x-stoplight: - afterScript: null - beforeScript: null - id: "applications_get" - mock: - dynamic: false - enabled: false - statusCode: 200 - public: true - put: - tags: - - "Applications" - summary: "Update an Application" - description: "The endpoint updates a SSO / SAML Application." - operationId: "applications_put" - parameters: - - name: "id" - in: "path" - required: true - type: "string" - x-exportParamName: "Id" - - in: "body" - name: "body" - required: false - schema: - $ref: "#/definitions/application" - x-exportParamName: "Body" - - name: "Content-Type" - in: "header" - required: false - type: "string" - x-exportParamName: "ContentType" - - name: "Accept" - in: "header" - required: false - type: "string" - x-exportParamName: "Accept" - - name: "x-org-id" - in: "header" - required: false - type: "string" - x-exportParamName: "XOrgId" - responses: - 200: - description: "" - schema: - $ref: "#/definitions/application" - security: - - x-api-key: [] - x-stoplight: - afterScript: null - beforeScript: null - id: "applications_put" - mock: - dynamic: false - enabled: false - statusCode: 200 - public: true - delete: - tags: - - "Applications" - summary: "Delete an Application" - description: "The endpoint deletes an SSO / SAML Application." - operationId: "applications_delete" - parameters: - - name: "id" - in: "path" - required: true - type: "string" - x-exportParamName: "Id" - - name: "Content-Type" - in: "header" - required: false - type: "string" - x-exportParamName: "ContentType" - - name: "Accept" - in: "header" - required: false - type: "string" - x-exportParamName: "Accept" - - name: "x-org-id" - in: "header" - required: false - type: "string" - x-exportParamName: "XOrgId" - responses: - 200: - description: "" - schema: - $ref: "#/definitions/application" - security: - - x-api-key: [] - x-stoplight: - afterScript: null - beforeScript: null - id: "applications_delete" - mock: - dynamic: false - enabled: false - statusCode: 200 - public: true - /command/trigger/{triggername}: - post: - tags: - - "Command Triggers" - summary: "Launch a command via a Trigger" - description: "This endpoint allows you to launch a command based on a defined\ - \ trigger.\n\n#### Sample Requests\n\n**Launch a Command via a Trigger**\n\ - \n```\ncurl --silent \\\n -X 'POST' \\\n -H \"x-api-key: {API_KEY}\"\ - \ \\\n \"https://console.jumpcloud.com/api/command/trigger/{TriggerName}\"\ - \n```\n**Launch a Command via a Trigger passing a JSON object to the command**\n\ - ```\ncurl --silent \\\n -X 'POST' \\\n -H \"x-api-key: {API_KEY}\"\ - \ \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\ - \ \\\n -d '{ \"srcip\":\"192.168.2.32\", \"attack\":\"Cross Site Scripting\ - \ Attempt\" }' \\\n \"https://console.jumpcloud.com/api/command/trigger/{TriggerName}\"\ - \n```" - operationId: "command_trigger_webhook_post" - parameters: - - name: "triggername" - in: "path" - required: true - type: "string" - x-exportParamName: "Triggername" - - name: "Content-Type" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "ContentType" - - name: "Accept" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "Accept" - - name: "x-org-id" - in: "header" - description: "" - required: false - type: "string" - x-exportParamName: "XOrgId" - responses: - 200: - description: "OK" - 401: - description: "" - security: - - x-api-key: [] - x-stoplight: - afterScript: null - beforeScript: null - id: "command_trigger_webhook_post" - mock: - dynamic: false - enabled: false - statusCode: 200 - public: true - /commandresults: - get: - tags: - - "Command Results" - summary: "List all Command Results" - description: "This endpoint returns all command results.\n\n#### Sample Request\n\ - ```\ncurl -X GET https://console.jumpcloud.com/api/commandresults \\\n -H\ - \ 'Accept: application/json' \\\n -H 'Content-Type: application/json' \\\n\ - \ -H 'x-api-key:{API_KEY}'\n ```" - operationId: "command_results_list" - parameters: - - name: "fields" - in: "query" - description: "Use a space seperated string of field parameters to include\ - \ the data in the response. If omitted, the default list of fields will\ - \ be returned.\n" - required: false - type: "string" - x-exportParamName: "Fields" - - name: "limit" - in: "query" - description: "The number of records to return at once. Limited to 100." - required: false - type: "integer" - default: 10 - x-exportParamName: "Limit" - - name: "skip" - in: "query" - description: "The offset into the records to return." - required: false - type: "integer" - default: 0 - minimum: 0 - x-exportParamName: "Skip" - - name: "sort" - in: "query" - description: "Use space separated sort parameters to sort the collection.\n\ - Default sort is ascending. Prefix with `-` to sort descending.\n" - required: false - type: "string" - x-exportParamName: "Sort" - - name: "filter" - in: "query" - description: "A filter to apply to the query." - required: false - type: "string" - x-exportParamName: "Filter" - - name: "Content-Type" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "ContentType" - - name: "Accept" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "Accept" - - name: "x-org-id" - in: "header" - description: "" - required: false - type: "string" - x-exportParamName: "XOrgId" - responses: - 200: - description: "OK" - schema: - $ref: "#/definitions/commandresultslist" - 401: - description: "Unauthorized" - security: - - x-api-key: [] - x-stoplight: - afterScript: null - beforeScript: null - id: "command_results_list" - mock: - dynamic: false - enabled: false - statusCode: 200 - public: true - /commandresults/{id}: - get: - tags: - - "Command Results" - summary: "List an individual Command result" - description: "This endpoint returns a specific command result.\n\n#### Sample\ - \ Request\n```\ncurl -X GET https://console.jumpcloud.com/api/commandresults/{CommandResultID}\ - \ \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\ - \ \\\n -H 'x-api-key: {API_KEY}'\n ```" - operationId: "command_results_get" - parameters: - - name: "id" - in: "path" - required: true - type: "string" - x-exportParamName: "Id" - - name: "fields" - in: "query" - description: "Use a space seperated string of field parameters to include\ - \ the data in the response. If omitted, the default list of fields will\ - \ be returned.\n" - required: false - type: "string" - x-exportParamName: "Fields" - - name: "filter" - in: "query" - description: "A filter to apply to the query." - required: false - type: "string" - x-exportParamName: "Filter" - - name: "Content-Type" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "ContentType" - - name: "Accept" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "Accept" - - name: "x-org-id" - in: "header" - description: "" - required: false - type: "string" - x-exportParamName: "XOrgId" - responses: - 200: - description: "OK" - schema: - $ref: "#/definitions/commandresult" - 401: - description: "Unauthorized" - security: - - x-api-key: [] - x-stoplight: - afterScript: null - beforeScript: null - id: "command_results_get" - mock: - dynamic: false - enabled: false - statusCode: 200 - public: true - delete: - tags: - - "Command Results" - summary: "Delete a Command result" - description: "This endpoint deletes a specific command result.\n\n#### Sample\ - \ Request\n```\ncurl -X GET https://console.jumpcloud.com/api/commandresults/{CommandID}\ - \ \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\ - \ \\\n -H 'x-api-key: {API_KEY}'\n ````" - operationId: "command_results_delete" - parameters: - - name: "id" - in: "path" - required: true - type: "string" - x-exportParamName: "Id" - - name: "Content-Type" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "ContentType" - - name: "Accept" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "Accept" - - name: "x-org-id" - in: "header" - description: "" - required: false - type: "string" - x-exportParamName: "XOrgId" - responses: - 200: - description: "OK" - schema: - $ref: "#/definitions/commandresult" - 401: - description: "Unauthorized" - security: - - x-api-key: [] - x-stoplight: - afterScript: null - beforeScript: null - id: "command_results_delete" - mock: - dynamic: false - enabled: false - statusCode: 200 - public: true - /commands: - get: - tags: - - "Commands" - summary: "List All Commands" - description: "This endpoint returns all commands.\n\n#### Sample Request\n```\n\ - curl -X GET https://console.jumpcloud.com/api/commands/ \\\n -H 'Accept:\ - \ application/json' \\\n -H 'Content-Type: application/json' \\\n -H 'x-api-key:\ - \ {API_KEY}'\n\n```" - operationId: "commands_list" - parameters: - - name: "skip" - in: "query" - description: "The offset into the records to return." - required: false - type: "integer" - default: 0 - minimum: 0 - x-exportParamName: "Skip" - - name: "fields" - in: "query" - description: "Use a space seperated string of field parameters to include\ - \ the data in the response. If omitted, the default list of fields will\ - \ be returned.\n" - required: false - type: "string" - x-exportParamName: "Fields" - - name: "limit" - in: "query" - description: "The number of records to return at once. Limited to 100." - required: false - type: "integer" - default: 10 - x-exportParamName: "Limit" - - name: "sort" - in: "query" - description: "Use space separated sort parameters to sort the collection.\n\ - Default sort is ascending. Prefix with `-` to sort descending.\n" - required: false - type: "string" - x-exportParamName: "Sort" - - name: "filter" - in: "query" - description: "A filter to apply to the query." - required: false - type: "string" - x-exportParamName: "Filter" - - name: "Content-Type" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "ContentType" - - name: "Accept" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "Accept" - - name: "x-org-id" - in: "header" - description: "" - required: false - type: "string" - x-exportParamName: "XOrgId" - responses: - 200: - description: "OK" - schema: - $ref: "#/definitions/commandslist" - 401: - description: "Unauthorized" - security: - - x-api-key: [] - x-stoplight: - afterScript: null - beforeScript: null - id: "commands_list" - mock: - dynamic: false - enabled: false - statusCode: 200 - public: true - post: - tags: - - "Commands" - summary: "Create A Command" - description: "This endpoint allows you to create a new command.\n\n#### Sample\ - \ Request\n\n```\ncurl -X POST https://console.jumpcloud.com/api/commands/\ - \ \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\ - \ \\\n -H 'x-api-key: {API_KEY}' \\\n -d '{\n\t\"name\":\"Test API Command\"\ - ,\n\t\"command\":\"String\",\n\t\"user\":\"{UserID}\",\n\t\"schedule\":\"\"\ - ,\n\t\"timeout\":\"100\"\n}'\n\n```" - operationId: "commands_post" - parameters: - - in: "body" - name: "body" - required: false - schema: - $ref: "#/definitions/command" - x-exportParamName: "Body" - - name: "Content-Type" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "ContentType" - - name: "Accept" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "Accept" - - name: "x-org-id" - in: "header" - description: "" - required: false - type: "string" - x-exportParamName: "XOrgId" - responses: - 200: - description: "OK" - schema: - $ref: "#/definitions/command" - 401: - description: "Unauthorized" - security: - - x-api-key: [] - x-stoplight: - afterScript: null - beforeScript: null - id: "commands_post" - mock: - dynamic: false - enabled: false - statusCode: 200 - public: true - /commands/{id}: - get: - tags: - - "Commands" - summary: "List an individual Command" - description: "This endpoint returns a specific command based on the command\ - \ ID.\n\n#### Sample Request\n```\ncurl -X GET https://console.jumpcloud.com/api/commands/{CommandID}\ - \ \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\ - \ \\\n -H 'x-api-key: {API_KEY}'\n```" - operationId: "commands_get" - parameters: - - name: "id" - in: "path" - required: true - type: "string" - x-exportParamName: "Id" - - name: "fields" - in: "query" - description: "Use a space seperated string of field parameters to include\ - \ the data in the response. If omitted, the default list of fields will\ - \ be returned.\n" - required: false - type: "string" - x-exportParamName: "Fields" - - name: "filter" - in: "query" - description: "A filter to apply to the query." - required: false - type: "string" - x-exportParamName: "Filter" - - name: "Content-Type" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "ContentType" - - name: "Accept" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "Accept" - - name: "x-org-id" - in: "header" - description: "" - required: false - type: "string" - x-exportParamName: "XOrgId" - responses: - 200: - description: "OK" - schema: - $ref: "#/definitions/command" - 401: - description: "Unauthorized" - security: - - x-api-key: [] - x-stoplight: - afterScript: null - beforeScript: null - id: "commands_get" - mock: - dynamic: false - enabled: false - statusCode: 200 - public: true - put: - tags: - - "Commands" - summary: "Update a Command" - description: "This endpoint Updates a command based on the command ID and returns\ - \ the modified command record.\n\n#### Sample Request\n```\ncurl -X PUT https://console.jumpcloud.com/api/commands/{CommandID}\ - \ \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\ - \ \\\n -H 'x-api-key: {API_KEY}' \\\n -d '{\n\t\"name\":\"Test API Command\"\ - ,\n\t\"command\":\"String\",\n\t\"user\":\"{UserID}\",\n\t\"schedule\":\"\"\ - ,\n\t\"timeout\":\"100\"\n}'\n\n```" - operationId: "commands_put" - parameters: - - name: "id" - in: "path" - required: true - type: "string" - x-exportParamName: "Id" - - in: "body" - name: "body" - required: false - schema: - $ref: "#/definitions/command" - x-exportParamName: "Body" - - name: "Content-Type" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "ContentType" - - name: "Accept" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "Accept" - - name: "x-org-id" - in: "header" - description: "" - required: false - type: "string" - x-exportParamName: "XOrgId" - responses: - 200: - description: "OK" - schema: - $ref: "#/definitions/command" - 401: - description: "Unauthorized" - security: - - x-api-key: [] - x-stoplight: - afterScript: null - beforeScript: null - id: "commands_put" - mock: - dynamic: false - enabled: false - statusCode: 200 - public: true - delete: - tags: - - "Commands" - summary: "Delete a Command" - description: "This endpoint deletes a specific command based on the Command\ - \ ID.\n\n#### Sample Request\n```\ncurl -X DELETE https://console.jumpcloud.com/api/commands/{CommandID}\ - \ \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\ - \ \\\n -H 'x-api-key: {API_KEY}'\n\n```" - operationId: "commands_delete" - parameters: - - name: "id" - in: "path" - required: true - type: "string" - x-exportParamName: "Id" - - name: "Content-Type" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "ContentType" - - name: "Accept" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "Accept" - - name: "x-org-id" - in: "header" - description: "" - required: false - type: "string" - x-exportParamName: "XOrgId" - responses: - 200: - description: "OK" - 401: - description: "Unauthorized" - security: - - x-api-key: [] - x-stoplight: - afterScript: null - beforeScript: null - id: "commands_delete" - mock: - dynamic: false - enabled: false - statusCode: 200 - public: true - /files/command/{id}: - get: - tags: - - "Commands" - summary: "Get a Command File" - description: "This endpoint returns the uploaded file(s) associated with a specific\ - \ command.\n\n#### Sample Request\n\n```\ncurl -X GET https://console.jumpcloud.com/api/files/command/{commandID}\ - \ \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\ - \ \\\n -H 'x-api-key: {API_KEY}'\n ```" - operationId: "command_file_get" - parameters: - - name: "id" - in: "path" - required: true - type: "string" - x-exportParamName: "Id" - - name: "fields" - in: "query" - description: "Use a space seperated string of field parameters to include\ - \ the data in the response. If omitted, the default list of fields will\ - \ be returned.\n" - required: false - type: "string" - x-exportParamName: "Fields" - - name: "limit" - in: "query" - description: "The number of records to return at once. Limited to 100." - required: false - type: "integer" - default: 10 - x-exportParamName: "Limit" - - name: "skip" - in: "query" - description: "The offset into the records to return." - required: false - type: "integer" - default: 0 - minimum: 0 - x-exportParamName: "Skip" - - name: "Content-Type" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "ContentType" - - name: "Accept" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "Accept" - - name: "x-org-id" - in: "header" - description: "" - required: false - type: "string" - x-exportParamName: "XOrgId" - responses: - 200: - description: "" - schema: - $ref: "#/definitions/commandfilereturn" - 400: - description: "" - schema: - type: "object" - properties: {} - security: - - x-api-key: [] - x-stoplight: - afterScript: null - beforeScript: null - id: "command_file_get" - mock: - dynamic: false - enabled: false - statusCode: 200 - public: true - /organizations: - get: - tags: - - "Organizations" - summary: "Get Organization Details" - description: "This endpoint returns Organization Details.\n\n#### Sample Request\n\ - \n```\ncurl -X GET \\\n https://console.jumpcloud.com/api/organizations \\\ - \n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\ - \ \\\n -H 'x-api-key: {API_KEY}'\n ```" - operationId: "organization_list" - parameters: - - name: "fields" - in: "query" - description: "Use a space seperated string of field parameters to include\ - \ the data in the response. If omitted, the default list of fields will\ - \ be returned.\n" - required: false - type: "string" - x-exportParamName: "Fields" - - name: "filter" - in: "query" - description: "A filter to apply to the query." - required: false - type: "string" - x-exportParamName: "Filter" - - name: "limit" - in: "query" - description: "The number of records to return at once. Limited to 100." - required: false - type: "integer" - default: 10 - x-exportParamName: "Limit" - - name: "Content-Type" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "ContentType" - - name: "Accept" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "Accept" - - name: "skip" - in: "query" - description: "The offset into the records to return." - required: false - type: "integer" - default: 0 - minimum: 0 - x-exportParamName: "Skip" - - name: "sort" - in: "query" - description: "Use space separated sort parameters to sort the collection.\n\ - Default sort is ascending. Prefix with `-` to sort descending.\n" - required: false - type: "string" - x-exportParamName: "Sort" - - name: "search" - in: "query" - description: "A nested object containing a string `searchTerm` and a list\ - \ of `fields` to search on." - required: false - type: "string" - x-exportParamName: "Search" - responses: - 200: - description: "" - schema: - $ref: "#/definitions/organizationslist" - security: - - x-api-key: [] - x-stoplight: - afterScript: null - beforeScript: null - id: "organization_list" - mock: - dynamic: false - enabled: false - statusCode: 200 - public: true - /radiusservers: - get: - tags: - - "Radius Servers" - summary: "List Radius Servers" - description: "This endpoint allows you to get a list of all RADIUS servers in\ - \ your organization.\n\n#### Sample Request\n```\ncurl -X GET https://console.jumpcloud.com/api/radiusservers/\ - \ \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\ - \ \\\n -H 'x-api-key: {API_KEY}' \\\n```" - operationId: "radius_servers_list" - parameters: - - name: "fields" - in: "query" - description: "Use a space seperated string of field parameters to include\ - \ the data in the response. If omitted, the default list of fields will\ - \ be returned.\n" - required: false - type: "string" - x-exportParamName: "Fields" - - name: "filter" - in: "query" - description: "A filter to apply to the query." - required: false - type: "string" - x-exportParamName: "Filter" - - name: "limit" - in: "query" - description: "The number of records to return at once. Limited to 100." - required: false - type: "integer" - default: 10 - x-exportParamName: "Limit" - - name: "Content-Type" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "ContentType" - - name: "Accept" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "Accept" - - name: "skip" - in: "query" - description: "The offset into the records to return." - required: false - type: "integer" - default: 0 - minimum: 0 - x-exportParamName: "Skip" - - name: "sort" - in: "query" - description: "Use space separated sort parameters to sort the collection.\n\ - Default sort is ascending. Prefix with `-` to sort descending.\n" - required: false - type: "string" - x-exportParamName: "Sort" - - name: "x-org-id" - in: "header" - description: "" - required: false - type: "string" - x-exportParamName: "XOrgId" - responses: - 200: - description: "" - schema: - $ref: "#/definitions/radiusserverslist" - security: - - x-api-key: [] - x-stoplight: - afterScript: null - beforeScript: null - id: "radius_servers_list" - mock: - dynamic: false - enabled: false - statusCode: 200 - public: true - post: - tags: - - "Radius Servers" - summary: "Create a Radius Server" - description: "This endpoint allows you to create RADIUS servers in your organization.\n\ - \n#### Sample Request\n```\ncurl -X POST https://console.jumpcloud.com/api/radiusservers/\ - \ \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\ - \ \\\n -H 'x-api-key: {API_KEY}' \\\n -d '{\n \"name\": \"{test_radius}\"\ - ,\n \"networkSourceIp\": \"{0.0.0.0}\",\n \"sharedSecret\":\"{secretpassword}\"\ - ,\n \"userLockoutAction\": \"REMOVE\",\n \"userPasswordExpirationAction\"\ - : \"MAINTAIN\"\n}'\n```" - operationId: "radius_servers_post" - parameters: - - in: "body" - name: "body" - required: false - schema: - $ref: "#/definitions/radiusserverpost" - x-exportParamName: "Body" - - name: "Content-Type" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "ContentType" - - name: "Accept" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "Accept" - - name: "x-org-id" - in: "header" - description: "" - required: false - type: "string" - x-exportParamName: "XOrgId" - responses: - 200: - description: "" - schema: - $ref: "#/definitions/radiusserver" - security: - - x-api-key: [] - x-stoplight: - afterScript: null - beforeScript: null - id: "radius_servers_post" - mock: - dynamic: false - enabled: false - statusCode: 200 - public: true - /radiusservers/{id}: - put: - tags: - - "Radius Servers" - summary: "Update Radius Servers" - description: "This endpoint allows you to update RADIUS servers in your organization.\n\ - \n####\n```\ncurl -X PUT https://console.jumpcloud.com/api/radiusservers/{ServerID}\ - \ \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\ - \ \\\n -H 'x-api-key: {API_KEY}' \\\n -d '{\n \"name\": \"{name_update}\"\ - ,\n \"networkSourceIp\": \"{0.0.0.0}\",\n \"userLockoutAction\": \"\ - REMOVE\",\n \"userPasswordExpirationAction\": \"MAINTAIN\"\n}'\n```" - operationId: "radius_servers_put" - parameters: - - name: "id" - in: "path" - required: true - type: "string" - x-exportParamName: "Id" - - in: "body" - name: "body" - required: false - schema: - $ref: "#/definitions/body" - x-exportParamName: "Body" - - name: "Content-Type" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "ContentType" - - name: "Accept" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "Accept" - - name: "x-org-id" - in: "header" - description: "" - required: false - type: "string" - x-exportParamName: "XOrgId" - responses: - 200: - description: "" - schema: - $ref: "#/definitions/radiusserverput" - security: - - x-api-key: [] - x-stoplight: - afterScript: null - beforeScript: null - id: "radius_servers_put" - mock: - dynamic: false - enabled: false - statusCode: 200 - public: true - /search/organizations: - post: - tags: - - "Search" - summary: "Search Organizations" - description: "This endpoint will return Organization data based on your search\ - \ parameters. This endpoint WILL NOT allow you to add a new Organization.\n\ - \nYou can use the supported parameters and pass those in the body of request.\n\ - \nThe parameters must be passed as Content-Type application/json.\n\n\n####\ - \ Sample Request\n```\ncurl -X POST https://console.jumpcloud.com/api/search/organizations\ - \ \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\ - \ \\\n -H 'x-api-key: {API_KEY}' \\\n -d '{\n \"search\":{\n \"fields\"\ - \ : [\"settings.name\"],\n \"searchTerm\": \"Second\"\n },\n \"fields\"\ - : [\"_id\", \"displayName\", \"logoUrl\"],\n \"limit\" : 0,\n \"skip\" :\ - \ 0\n}'\n```" - operationId: "search_organizations_post" - parameters: - - in: "body" - name: "body" - required: false - schema: - $ref: "#/definitions/search" - x-exportParamName: "Body" - - name: "fields" - in: "query" - description: "Use a space seperated string of field parameters to include\ - \ the data in the response. If omitted, the default list of fields will\ - \ be returned.\n" - required: false - type: "string" - x-exportParamName: "Fields" - - name: "filter" - in: "query" - description: "A filter to apply to the query." - required: false - type: "string" - x-exportParamName: "Filter" - - name: "limit" - in: "query" - description: "The number of records to return at once. Limited to 100." - required: false - type: "integer" - default: 10 - x-exportParamName: "Limit" - - name: "Content-Type" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "ContentType" - - name: "Accept" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "Accept" - - name: "skip" - in: "query" - description: "The offset into the records to return." - required: false - type: "integer" - default: 0 - minimum: 0 - x-exportParamName: "Skip" - responses: - 200: - description: "OK" - schema: - $ref: "#/definitions/organizationslist" - 401: - description: "Unauthorized" - security: - - x-api-key: [] - x-stoplight: - afterScript: null - beforeScript: null - id: "search_organizations_post" - mock: - dynamic: false - enabled: false - statusCode: 200 - public: true - /search/systems: - post: - tags: - - "Search" - summary: "Search Systems" - description: "Return Systems in multi-record format allowing for the passing\ - \ of the `filter` and `searchFilter` parameters. This WILL NOT allow you to\ - \ add a new system.\n\nTo support advanced filtering you can use the `filter`\ - \ and `searchFilter` parameters that can only be passed in the body of POST\ - \ /api/search/* routes. The `filter` and `searchFilter` parameters must be\ - \ passed as Content-Type application/json.\n\nThe `filter` parameter is an\ - \ object with a single property, either `and` or `or` with the value of the\ - \ property being an array of query expressions.\n\nThis allows you to filter\ - \ records using the logic of matching ALL or ANY records in the array of query\ - \ expressions. If the `and` or `or` are not included the default behavior\ - \ is to match ALL query expressions.\n\nThe `searchFilter` parameter allows\ - \ text searching on supported fields by specifying a `searchTerm` and a list\ - \ of `fields` to query on. If any `field` has a partial text match on the`searchTerm`\ - \ the record will be returned.\n\n\n#### Sample Request\n\nExact search for\ - \ a list of hostnames\n```\ncurl -X POST https://console.jumpcloud.com/api/search/systems\ - \ \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\ - \ \\\n -H 'x-api-key: {API_KEY}' \\\n -d '{\n \"filter\": {\n \"or\"\ - : [\n {\"hostname\" : \"my-hostname\"},\n {\"hostname\" : \"other-hostname\"\ - }\n ]\n },\n \"fields\" : \"os hostname displayName\"\n}'\n```\n\nText\ - \ search for a hostname or display name\n```\ncurl -X POST https://console.jumpcloud.com/api/search/systems\ - \ \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\ - \ \\\n -H 'x-api-key: {API_KEY}' \\\n -d '{\n \"searchFilter\": {\n \ - \ \"searchTerm\": \"my-host\",\n \"fields\": [\"hostname\", \"displayName\"\ - ]\n },\n \"fields\": \"os hostname displayName\"\n}'\n```\n\nCombining `filter`\ - \ and `searchFilter` to search for names that match a given OS\n```\ncurl\ - \ -X POST https://console.jumpcloud.com/api/search/systems \\\n -H 'Accept:\ - \ application/json' \\\n -H 'Content-Type: application/json' \\\n -H 'x-api-key:\ - \ {API_KEY}' \\\n -d '{\n \"searchFilter\": {\n \"searchTerm\": \"my-host\"\ - ,\n \"fields\": [\"hostname\", \"displayName\"]\n },\n \"filter\": {\n\ - \ \"or\": [\n {\"os\" : \"Ubuntu\"},\n {\"os\" : \"Mac OS X\"\ - }\n ]\n },\n \"fields\": \"os hostname displayName\"\n}'\n```" - operationId: "search_systems_post" - parameters: - - in: "body" - name: "body" - required: false - schema: - $ref: "#/definitions/search" - x-exportParamName: "Body" - - name: "fields" - in: "query" - description: "Use a space seperated string of field parameters to include\ - \ the data in the response. If omitted, the default list of fields will\ - \ be returned.\n" - required: false - type: "string" - x-exportParamName: "Fields" - - name: "limit" - in: "query" - description: "The number of records to return at once. Limited to 100." - required: false - type: "integer" - default: 10 - x-exportParamName: "Limit" - - name: "x-org-id" - in: "header" - description: "" - required: false - type: "string" - x-exportParamName: "XOrgId" - - name: "Content-Type" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "ContentType" - - name: "Accept" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "Accept" - - name: "skip" - in: "query" - description: "The offset into the records to return." - required: false - type: "integer" - default: 0 - minimum: 0 - x-exportParamName: "Skip" - - name: "filter" - in: "query" - description: "A filter to apply to the query." - required: false - type: "string" - x-exportParamName: "Filter" - responses: - 200: - description: "OK" - schema: - $ref: "#/definitions/systemslist" - 401: - description: "Unauthorized" - security: - - x-api-key: [] - x-stoplight: - afterScript: null - beforeScript: null - id: "search_systems_post" - mock: - dynamic: false - enabled: false - statusCode: 200 - public: true - /search/systemusers: - post: - tags: - - "Search" - summary: "Search System Users" - description: "Return System Users in multi-record format allowing for the passing\ - \ of the `filter` and `searchFilter` parameters. This WILL NOT allow you to\ - \ add a new system user.\n\nTo support advanced filtering you can use the\ - \ `filter` and `searchFilter` parameters that can only be passed in the body\ - \ of POST /api/search/* routes. The `filter` and `searchFilter` parameters\ - \ must be passed as Content-Type application/json.\n\nThe `filter` parameter\ - \ is an object with a single property, either `and` or `or` with the value\ - \ of the property being an array of query expressions.\n\nThis allows you\ - \ to filter records using the logic of matching ALL or ANY records in the\ - \ array of query expressions. If the `and` or `or` are not included the default\ - \ behavior is to match ALL query expressions.\n\nThe `searchFilter` parameter\ - \ allows text searching on supported fields by specifying a `searchTerm` and\ - \ a list of `fields` to query on. If any `field` has a partial text match\ - \ on the`searchTerm` the record will be returned.\n\n\n#### Sample Request\n\ - \nExact search for a list of system users in a department\n```\ncurl -X POST\ - \ https://console.jumpcloud.com/api/search/systemusers \\\n -H 'Accept: application/json'\ - \ \\\n -H 'Content-Type: application/json' \\\n -H 'x-api-key: {API_KEY}'\ - \ \\\n -d '{\n \"filter\" : [{\"department\" : \"IT\"}],\n \"fields\" :\ - \ \"email username sudo\"\n}'\n```\n\nText search for system users with and\ - \ email on a domain\n```\ncurl -X POST https://console.jumpcloud.com/api/search/systemusers\ - \ \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\ - \ \\\n -H 'x-api-key: {API_KEY}' \\\n -d '{\n \"searchFilter\" : {\n \ - \ \"searchTerm\": \"@jumpcloud.com\",\n \"fields\": [\"email\"]\n },\n\ - \ \"fields\" : \"email username sudo\"\n}'\n```\n\nCombining `filter` and\ - \ `searchFilter` to text search for system users with and email on a domain\ - \ who are in a list of departments\n```\ncurl -X POST https://console.jumpcloud.com/api/search/systemusers\ - \ \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\ - \ \\\n -H 'x-api-key: {API_KEY}' \\\n -d '{\n \"searchFilter\": {\n \ - \ \"searchTerm\": \"@jumpcloud.com\",\n \"fields\": [\"email\"]\n },\n\ - \ \"filter\": {\n \"or\": [\n {\"department\" : \"IT\"},\n {\"\ - department\" : \"Sales\"}\n ]\n },\n \"fields\" : \"email username sudo\"\ - \n}'\n```" - operationId: "search_systemusers_post" - parameters: - - in: "body" - name: "body" - required: false - schema: - $ref: "#/definitions/search" - x-exportParamName: "Body" - - name: "fields" - in: "query" - description: "Use a space seperated string of field parameters to include\ - \ the data in the response. If omitted, the default list of fields will\ - \ be returned.\n" - required: false - type: "string" - x-exportParamName: "Fields" - - name: "filter" - in: "query" - description: "A filter to apply to the query." - required: false - type: "string" - x-exportParamName: "Filter" - - name: "limit" - in: "query" - description: "The number of records to return at once. Limited to 100." - required: false - type: "integer" - default: 10 - x-exportParamName: "Limit" - - name: "Content-Type" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "ContentType" - - name: "Accept" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "Accept" - - name: "skip" - in: "query" - description: "The offset into the records to return." - required: false - type: "integer" - default: 0 - minimum: 0 - x-exportParamName: "Skip" - - name: "x-org-id" - in: "header" - description: "" - required: false - type: "string" - x-exportParamName: "XOrgId" - responses: - 200: - description: "OK" - schema: - $ref: "#/definitions/systemuserslist" - 401: - description: "Unauthorized" - security: - - x-api-key: [] - x-stoplight: - afterScript: null - beforeScript: null - id: "search_systemusers_post" - mock: - dynamic: false - enabled: false - statusCode: 200 - public: true - /systems: - get: - tags: - - "Systems" - summary: "List All Systems" - description: "This endpoint returns all Systems.\n\n#### Sample Requests\n```\n\ - curl -X GET https://console.jumpcloud.com/api/systems \\\n -H 'Accept: application/json'\ - \ \\\n -H 'Content-Type: application/json' \\\n -H 'x-api-key: {API_KEY}'\n\ - \n```" - operationId: "systems_list" - parameters: - - name: "fields" - in: "query" - description: "Use a space seperated string of field parameters to include\ - \ the data in the response. If omitted, the default list of fields will\ - \ be returned.\n" - required: false - type: "string" - x-exportParamName: "Fields" - - name: "limit" - in: "query" - description: "The number of records to return at once. Limited to 100." - required: false - type: "integer" - default: 10 - x-exportParamName: "Limit" - - name: "x-org-id" - in: "header" - description: "" - required: false - type: "string" - x-exportParamName: "XOrgId" - - name: "Content-Type" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "ContentType" - - name: "Accept" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "Accept" - - name: "search" - in: "query" - description: "A nested object containing a string `searchTerm` and a list\ - \ of `fields` to search on." - required: false - type: "string" - x-exportParamName: "Search" - - name: "skip" - in: "query" - description: "The offset into the records to return." - required: false - type: "integer" - default: 0 - minimum: 0 - x-exportParamName: "Skip" - - name: "sort" - in: "query" - description: "Use space separated sort parameters to sort the collection.\n\ - Default sort is ascending. Prefix with `-` to sort descending.\n" - required: false - type: "string" - x-exportParamName: "Sort" - - name: "filter" - in: "query" - description: "A filter to apply to the query." - required: false - type: "string" - x-exportParamName: "Filter" - responses: - 200: - description: "" - schema: - $ref: "#/definitions/systemslist" - security: - - x-api-key: [] - x-stoplight: - afterScript: null - beforeScript: null - id: "systems_list" - mock: - dynamic: false - enabled: false - statusCode: 200 - public: true - /systems/{id}: - get: - tags: - - "Systems" - summary: "List an individual system" - description: "This endpoint returns an individual system.\n\n#### Sample Request\n\ - ```\ncurl -X GET https://console.jumpcloud.com/api/systems/{SystemID} \\\n\ - \ -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\ - \ \\\n -H 'x-api-key: {API_KEY}'\n ```" - operationId: "systems_get" - parameters: - - name: "id" - in: "path" - required: true - type: "string" - x-exportParamName: "Id" - - name: "fields" - in: "query" - description: "Use a space seperated string of field parameters to include\ - \ the data in the response. If omitted, the default list of fields will\ - \ be returned.\n" - required: false - type: "string" - x-exportParamName: "Fields" - - name: "filter" - in: "query" - description: "A filter to apply to the query." - required: false - type: "string" - x-exportParamName: "Filter" - - name: "Content-Type" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "ContentType" - - name: "Accept" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "Accept" - - name: "Date" - in: "header" - description: "Current date header for the System Context API" - required: false - type: "string" - x-exportParamName: "Date" - - name: "Authorization" - in: "header" - description: "Authorization header for the System Context API" - required: false - type: "string" - x-exportParamName: "Authorization" - - name: "x-org-id" - in: "header" - description: "" - required: false - type: "string" - x-exportParamName: "XOrgId" - responses: - 200: - description: "" - schema: - $ref: "#/definitions/system" - security: - - x-api-key: [] - x-stoplight: - afterScript: null - beforeScript: null - id: "systems_get" - mock: - dynamic: false - enabled: false - statusCode: 200 - public: true - put: - tags: - - "Systems" - summary: "Update a system" - description: "This endpoint allows you to update a system.\n\n#### Sample Request\ - \ \n```\ncurl -X PUT https://console.jumpcloud.com/api/systems/{SystemID}\ - \ \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\ - \ \\\n -H 'x-api-key: {API_KEY}' \\\n -d '{\n\t\"displayName\":\"Name_Update\"\ - ,\n\t\"allowSshPasswordAuthentication\":\"true\",\n\t\"allowSshRootLogin\"\ - :\"true\",\n\t\"allowMultiFactorAuthentication\":\"true\",\n\t\"allowPublicKeyAuthentication\"\ - :\"false\"\n}'\n```" - operationId: "systems_put" - parameters: - - name: "id" - in: "path" - required: true - type: "string" - x-exportParamName: "Id" - - in: "body" - name: "body" - required: false - schema: - $ref: "#/definitions/systemput" - x-exportParamName: "Body" - - name: "Content-Type" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "ContentType" - - name: "Accept" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "Accept" - - name: "Date" - in: "header" - description: "Current date header for the System Context API" - required: false - type: "string" - x-exportParamName: "Date" - - name: "Authorization" - in: "header" - description: "Authorization header for the System Context API" - required: false - type: "string" - x-exportParamName: "Authorization" - - name: "x-org-id" - in: "header" - description: "" - required: false - type: "string" - x-exportParamName: "XOrgId" - responses: - 200: - description: "" - schema: - $ref: "#/definitions/system" - security: - - x-api-key: [] - x-stoplight: - afterScript: null - beforeScript: null - id: "systems_put" - mock: - dynamic: false - enabled: false - statusCode: 200 - public: true - delete: - tags: - - "Systems" - summary: "Delete a System" - description: "This endpoint allows you to delete a system. This command will\ - \ cause the system to uninstall the JumpCloud agent from its self which can\ - \ can take about a minute. If the system is not connected to JumpCloud the\ - \ system record will simply be removed.\n\n#### Sample Request\n```\ncurl\ - \ -X DELETE https://console.jumpcloud.com/api/systems/{SystemID} \\\n -H\ - \ 'Accept: application/json' \\\n -H 'Content-Type: application/json' \\\n\ - \ -H 'x-api-key: {API_KEY}'\n ```" - operationId: "systems_delete" - parameters: - - name: "id" - in: "path" - required: true - type: "string" - x-exportParamName: "Id" - - name: "Content-Type" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "ContentType" - - name: "Accept" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "Accept" - - name: "Date" - in: "header" - description: "Current date header for the System Context API" - required: false - type: "string" - x-exportParamName: "Date" - - name: "Authorization" - in: "header" - description: "Authorization header for the System Context API" - required: false - type: "string" - x-exportParamName: "Authorization" - - name: "x-org-id" - in: "header" - description: "" - required: false - type: "string" - x-exportParamName: "XOrgId" - responses: - 200: - description: "" - schema: - $ref: "#/definitions/system" - security: - - x-api-key: [] - x-stoplight: - afterScript: null - beforeScript: null - id: "systems_delete" - mock: - dynamic: false - enabled: false - statusCode: 200 - public: true - /systems/{id}/systemusers: - get: - tags: - - "Systems" - summary: "List system user bindings" - description: "Hidden as Tags is deprecated\n\nList system user bindings for\ - \ a specific system in a system and user binding format.\n\nThis endpoint\ - \ is only used for users still using JumpCloud Tags. If you are using JumpCloud\ - \ Groups please refer to the documentation found [here](https://docs.jumpcloud.com/2.0/systems/manage-associations-of-a-system).\n\ - \n#### Sample Request\n\n*List system user bindings for specific system*\n\ - \n```\ncurl -X https://console.jumpcloud.com/api/systems/{SystemID}/systemusers\\\ - \n -H 'Content-Type: application/json' \\\n -H 'x-api-key: {API_KEY}' \\\ - \n \"\n```" - operationId: "systems_systemusers_binding_list" - parameters: - - name: "id" - in: "path" - required: true - type: "string" - x-exportParamName: "Id" - - name: "fields" - in: "query" - description: "Use a space seperated string of field parameters to include\ - \ the data in the response. If omitted, the default list of fields will\ - \ be returned.\n" - required: false - type: "string" - x-exportParamName: "Fields" - - name: "limit" - in: "query" - description: "The number of records to return at once. Limited to 100." - required: false - type: "integer" - default: 10 - x-exportParamName: "Limit" - - name: "skip" - in: "query" - description: "The offset into the records to return." - required: false - type: "integer" - default: 0 - minimum: 0 - x-exportParamName: "Skip" - - name: "sort" - in: "query" - description: "Use space separated sort parameters to sort the collection.\n\ - Default sort is ascending. Prefix with `-` to sort descending.\n" - required: false - type: "string" - x-exportParamName: "Sort" - - name: "filter" - in: "query" - description: "A filter to apply to the query." - required: false - type: "string" - x-exportParamName: "Filter" - - name: "Content-Type" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "ContentType" - - name: "Accept" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "Accept" - - name: "x-org-id" - in: "header" - description: "" - required: false - type: "string" - x-exportParamName: "XOrgId" - responses: - 200: - description: "OK" - schema: - $ref: "#/definitions/systemuserbinding" - 401: - description: "Unauthorized" - security: - - x-api-key: [] - x-stoplight: - afterScript: null - beforeScript: null - id: "systems_systemusers_binding_list" - mock: - dynamic: false - enabled: false - statusCode: 200 - public: false - put: - tags: - - "Systems" - summary: "Update a system's or user's binding" - description: "Hidden as Tags is deprecated\n\nAdds or removes a user binding\ - \ for a system.\n\nThis endpoint is only used for users still using JumpCloud\ - \ Tags. If you are using JumpCloud Groups please refer to the documentation\ - \ found [here](https://docs.jumpcloud.com/2.0/systems/manage-associations-of-a-system).\n\ - \n#### Sample Request\n\n*Add (or remove) a system user to (from) a system*\n\ - \n```\ncurl \\\n -d '{ \"add\": [\"[SYSTEM_USER_ID_TO_ADD_HERE]\"], \"remove\"\ - : [\"[SYSTEM_USER_ID_TO_REMOVE_HERE]\"] }' \\\n -X PUT \\\n -H 'Content-Type:\ - \ application/json' \\\n -H 'Accept: application/json' \\\n -H \"x-api-key:\ - \ [YOUR_API_KEY_HERE]\" \\\n \"https://console.jumpcloud.com/api/systems/[SYSTEM_ID_HERE]/systemusers" - operationId: "systems_systemusers_binding_put" - parameters: - - name: "id" - in: "path" - required: true - type: "string" - x-exportParamName: "Id" - - in: "body" - name: "body" - required: false - schema: - $ref: "#/definitions/systemuserbindingsput" - x-exportParamName: "Body" - - name: "Content-Type" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "ContentType" - - name: "Accept" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "Accept" - - name: "x-org-id" - in: "header" - description: "" - required: false - type: "string" - x-exportParamName: "XOrgId" - responses: - 200: - description: "OK" - 400: - description: "" - schema: - type: "object" - properties: {} - security: - - x-api-key: [] - x-stoplight: - afterScript: null - beforeScript: null - id: "systems_systemusers_binding_put" - mock: - dynamic: false - enabled: false - statusCode: 200 - public: false - /systemusers: - get: - tags: - - "Systemusers" - summary: "List all system users" - description: "This endpoint returns all systemusers.\n\n#### Sample Request\n\ - \n```\ncurl -X GET https://console.jumpcloud.com/api/systemusers \\\n -H\ - \ 'Accept: application/json' \\\n -H 'Content-Type: application/json' \\\n\ - \ -H 'x-api-key: {API_KEY}'\n```" - operationId: "systemusers_list" - parameters: - - name: "limit" - in: "query" - description: "The number of records to return at once." - required: false - type: "integer" - default: 10 - x-exportParamName: "Limit" - - name: "skip" - in: "query" - description: "The offset into the records to return." - required: false - type: "integer" - default: 0 - x-exportParamName: "Skip" - - name: "sort" - in: "query" - description: "The comma separated fields used to sort the collection.\nDefault\ - \ sort is ascending, prefix with `-` to sort descending.\n" - required: false - type: "string" - x-exportParamName: "Sort" - - name: "fields" - in: "query" - description: "The comma separated fields included in the returned records.\n\ - If omitted the default list of fields will be returned.\n" - required: false - type: "string" - x-exportParamName: "Fields" - - name: "x-org-id" - in: "header" - description: "" - required: false - type: "string" - x-exportParamName: "XOrgId" - - name: "Content-Type" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "ContentType" - - name: "Accept" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "Accept" - - name: "search" - in: "query" - description: "A nested object containing a string `searchTerm` and a list\ - \ of `fields` to search on." - required: false - type: "string" - x-exportParamName: "Search" - - name: "filter" - in: "query" - description: "A filter to apply to the query." - required: false - type: "string" - x-exportParamName: "Filter" - responses: - 200: - description: "OK" - schema: - $ref: "#/definitions/systemuserslist" - 401: - description: "" - security: - - x-api-key: [] - x-stoplight: - afterScript: null - beforeScript: null - id: "systemusers_list" - mock: - dynamic: false - enabled: false - statusCode: 200 - public: true - post: - tags: - - "Systemusers" - summary: "Create a system user" - description: "This endpoint allows you to create a new system user.\n\n####\ - \ Sample Request\n\n```\ncurl -X POST https://console.jumpcloud.com/api/systemusers\ - \ \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\ - \ \\\n -H 'x-api-key: {API_KEY}' \\\n -d '{\n\t\"username\":\"{username}\"\ - ,\n\t\"email\":\"{email_address}\",\n\t\"firstname\":\"{Name}\",\n\t\"lastname\"\ - :\"{Name}\"\n}'\n```" - operationId: "systemusers_post" - parameters: - - in: "body" - name: "body" - required: false - schema: - $ref: "#/definitions/systemuserputpost" - x-exportParamName: "Body" - - name: "Content-Type" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "ContentType" - - name: "Accept" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "Accept" - - name: "x-org-id" - in: "header" - description: "" - required: false - type: "string" - x-exportParamName: "XOrgId" - responses: - 200: - description: "User added successfully" - schema: - $ref: "#/definitions/systemuserreturn" - 400: - description: "User already exists" - 401: - description: "Unauthorized" - security: - - x-api-key: [] - x-stoplight: - afterScript: null - beforeScript: null - id: "systemusers_post" - mock: - dynamic: false - enabled: false - statusCode: 200 - public: true - /systemusers/{id}: - get: - tags: - - "Systemusers" - summary: "List a system user" - description: "This endpoint returns a particular System User.\n\n#### Sample\ - \ Request\n\n```\ncurl -X GET https://console.jumpcloud.com/api/systemusers/{UserID}\ - \ \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\ - \ \\\n -H 'x-api-key: {API_KEY}'\n```" - operationId: "systemusers_get" - parameters: - - name: "id" - in: "path" - required: true - type: "string" - x-exportParamName: "Id" - - name: "fields" - in: "query" - description: "Use a space seperated string of field parameters to include\ - \ the data in the response. If omitted, the default list of fields will\ - \ be returned.\n" - required: false - type: "string" - x-exportParamName: "Fields" - - name: "filter" - in: "query" - description: "A filter to apply to the query." - required: false - type: "string" - x-exportParamName: "Filter" - - name: "Content-Type" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "ContentType" - - name: "Accept" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "Accept" - - name: "x-org-id" - in: "header" - description: "" - required: false - type: "string" - x-exportParamName: "XOrgId" - responses: - 200: - description: "OK" - schema: - $ref: "#/definitions/systemuserreturn" - 401: - description: "Unauthorized" - security: - - x-api-key: [] - x-stoplight: - afterScript: null - beforeScript: null - id: "systemusers_get" - mock: - dynamic: false - enabled: false - statusCode: 200 - public: true - put: - tags: - - "Systemusers" - summary: "Update a system user" - description: "This endpoint allows you to update a system user.\n\n#### Sample\ - \ Request\n\n```\ncurl -X PUT https://console.jumpcloud.com/api/systemusers/{UserID}\ - \ \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\ - \ \\\n -H 'x-api-key: {API_KEY}' \\\n -d '{\n\t\"email\":\"{email_address}\"\ - ,\n\t\"firstname\":\"{Name}\",\n\t\"lastname\":\"{Name}\"\n}'\n```" - operationId: "systemusers_put" - parameters: - - name: "id" - in: "path" - required: true - type: "string" - x-exportParamName: "Id" - - in: "body" - name: "body" - required: false - schema: - $ref: "#/definitions/systemuserput" - x-exportParamName: "Body" - - name: "Content-Type" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "ContentType" - - name: "Accept" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "Accept" - - name: "x-org-id" - in: "header" - description: "" - required: false - type: "string" - x-exportParamName: "XOrgId" - responses: - 200: - description: "OK" - schema: - $ref: "#/definitions/systemuserreturn" - 401: - description: "Unauthorized" - security: - - x-api-key: [] - x-stoplight: - afterScript: null - beforeScript: null - id: "systemusers_put" - mock: - dynamic: false - enabled: false - statusCode: 200 - public: true - delete: - tags: - - "Systemusers" - summary: "Delete a system user" - description: "This endpoint allows you to delete a particular system user.\n\ - \n#### Sample Request\n```\ncurl -X DELETE https://console.jumpcloud.com/api/systemusers/{UserID}\ - \ \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\ - \ \\\n -H 'x-api-key: {API_KEY}'\n```" - operationId: "systemusers_delete" - parameters: - - name: "id" - in: "path" - required: true - type: "string" - x-exportParamName: "Id" - - name: "Content-Type" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "ContentType" - - name: "Accept" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "Accept" - - name: "x-org-id" - in: "header" - description: "" - required: false - type: "string" - x-exportParamName: "XOrgId" - responses: - 200: - description: "OK" - schema: - $ref: "#/definitions/systemuserreturn" - 401: - description: "Unauthorized" - security: - - x-api-key: [] - x-stoplight: - afterScript: null - beforeScript: null - id: "systemusers_delete" - mock: - dynamic: false - enabled: false - statusCode: 200 - public: true - /systemusers/{id}/resetmfa: - post: - tags: - - "Systemusers" - summary: "Reset a system user's MFA token" - description: "This endpoint allows you to reset the TOTP key for a specified\ - \ system user and put them in an TOTP MFA enrollment period. This will result\ - \ in the user being prompted to setup TOTP MFA when logging into userportal.\ - \ Please be aware that if the user does not complete TOTP MFA setup before\ - \ the `exclusionUntil` date, they will be locked out of any resources that\ - \ require TOTP MFA.\n\nPlease refer to our [Knowledge Base Article](https://support.jumpcloud.com/customer/en/portal/articles/2959138-using-multifactor-authentication-with-jumpcloud)\ - \ on setting up MFA for more information.\n\n#### Sample Request\n```\ncurl\ - \ -X POST \\\n https://console.jumpcloud.com/api/systemusers/{UserID}/resetmfa\ - \ \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\ - \ \\\n -H 'x-api-key: {API_KEY}' \\\n -d '{\"exclusion\": true, \"exclusionUntil\"\ - : \"{date-time}\"}'\n\n\n```" - operationId: "systemusers_resetmfa" - parameters: - - name: "id" - in: "path" - required: true - type: "string" - x-exportParamName: "Id" - - in: "body" - name: "body" - required: false - schema: - $ref: "#/definitions/body_1" - x-exportParamName: "Body" - - name: "Content-Type" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "ContentType" - - name: "Accept" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "Accept" - - name: "x-org-id" - in: "header" - description: "" - required: false - type: "string" - x-exportParamName: "XOrgId" - responses: - 200: - description: "" - 400: - description: "" - schema: - $ref: "#/definitions/errorresponse" - 401: - description: "" - schema: - $ref: "#/definitions/errorresponse" - 403: - description: "" - schema: - $ref: "#/definitions/errorresponse" - 404: - description: "" - schema: - $ref: "#/definitions/errorresponse" - 409: - description: "" - schema: - $ref: "#/definitions/errorresponse" - 500: - description: "" - schema: - $ref: "#/definitions/errorresponse" - security: - - x-api-key: [] - x-stoplight: - afterScript: null - beforeScript: null - id: "systemusers_resetmfa" - mock: - dynamic: false - enabled: false - statusCode: 200 - public: true - /systemusers/{id}/sshkeys: - get: - tags: - - "Systemusers" - summary: "List a system user's public SSH keys" - description: "This endpoint will return a specific System User's public SSH\ - \ key." - operationId: "sshkey_list" - parameters: - - name: "id" - in: "path" - required: true - type: "string" - x-exportParamName: "Id" - - name: "Content-Type" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "ContentType" - - name: "Accept" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "Accept" - - name: "x-org-id" - in: "header" - description: "" - required: false - type: "string" - x-exportParamName: "XOrgId" - responses: - 200: - description: "" - schema: - type: "array" - items: - $ref: "#/definitions/sshkeylist" - 400: - description: "" - schema: - type: "object" - description: "Bad Request" - properties: {} - security: - - x-api-key: [] - x-stoplight: - afterScript: null - beforeScript: null - id: "sshkey_list" - mock: - dynamic: false - enabled: false - statusCode: 200 - public: true - post: - tags: - - "Systemusers" - summary: "Create a system user's Public SSH Key" - description: "This endpoint will create a specific System User's Public SSH\ - \ Key." - operationId: "sshkey_post" - parameters: - - name: "id" - in: "path" - required: true - type: "string" - x-exportParamName: "Id" - - in: "body" - name: "body" - required: false - schema: - $ref: "#/definitions/sshkeypost" - x-exportParamName: "Body" - - name: "Content-Type" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "ContentType" - - name: "Accept" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "Accept" - - name: "x-org-id" - in: "header" - description: "" - required: false - type: "string" - x-exportParamName: "XOrgId" - responses: - 200: - description: "" - schema: - $ref: "#/definitions/sshkeylist" - 400: - description: "" - schema: - type: "object" - description: "Bad Request" - properties: {} - security: - - x-api-key: [] - x-stoplight: - afterScript: null - beforeScript: null - id: "sshkey_post" - mock: - dynamic: false - enabled: false - statusCode: 200 - public: true - /systemusers/{id}/systems: - get: - tags: - - "Systemusers" - summary: "List system user binding" - description: "Hidden as Tags is deprecated\n\nAdds or removes a system binding\ - \ for a user.\n\nThis endpoint is only used for users still using JumpCloud\ - \ Tags. If you are using JumpCloud Groups please refer to the documentation\ - \ found [here](https://docs.jumpcloud.com/2.0/systems/manage-associations-of-a-system).\n\ - \n\nList system bindings for a specific system user in a system and user binding\ - \ format.\n\n### Examples\n\n#### List system bindings for specific system\ - \ user\n\n```\ncurl \\\n -H 'Content-Type: application/json' \\\n -H \"\ - x-api-key: [YOUR_API_KEY_HERE]\" \\\n \"https://console.jumpcloud.com/api/systemusers/[SYSTEM_USER_ID_HERE]/systems\"\ - \n```" - operationId: "systemusers_systems_binding_list" - parameters: - - name: "id" - in: "path" - required: true - type: "string" - x-exportParamName: "Id" - - name: "fields" - in: "query" - description: "Use a space seperated string of field parameters to include\ - \ the data in the response. If omitted, the default list of fields will\ - \ be returned.\n" - required: false - type: "string" - x-exportParamName: "Fields" - - name: "limit" - in: "query" - description: "The number of records to return at once. Limited to 100." - required: false - type: "integer" - default: 10 - x-exportParamName: "Limit" - - name: "skip" - in: "query" - description: "The offset into the records to return." - required: false - type: "integer" - default: 0 - minimum: 0 - x-exportParamName: "Skip" - - name: "sort" - in: "query" - description: "Use space separated sort parameters to sort the collection.\n\ - Default sort is ascending. Prefix with `-` to sort descending.\n" - required: false - type: "string" - x-exportParamName: "Sort" - - name: "filter" - in: "query" - description: "A filter to apply to the query." - required: false - type: "string" - x-exportParamName: "Filter" - - name: "Content-Type" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "ContentType" - - name: "Accept" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "Accept" - - name: "x-org-id" - in: "header" - description: "" - required: false - type: "string" - x-exportParamName: "XOrgId" - responses: - 200: - description: "OK" - schema: - type: "object" - properties: {} - 401: - description: "Unauthorized" - security: - - x-api-key: [] - x-stoplight: - afterScript: null - beforeScript: null - id: "systemusers_systems_binding_list" - mock: - dynamic: false - enabled: false - statusCode: 200 - public: false - put: - tags: - - "Systemusers" - summary: "Update a system user binding" - description: "Hidden as Tags is deprecated\n\nAdds or removes a system binding\ - \ for a user.\n\nThis endpoint is only used for users still using JumpCloud\ - \ Tags. If you are using JumpCloud Groups please refer to the documentation\ - \ found [here](https://docs.jumpcloud.com/2.0/systems/manage-associations-of-a-system).\n\ - \n### Example\n\n#### Add (or remove) system to system user\n\n```\ncurl \\\ - \n -d '{ \"add\": [\"[SYSTEM_ID_TO_ADD_HERE]\"], \"remove\": [\"[SYSTEM_ID_TO_REMOVE_HERE]\"\ - ] }' \\\n -X PUT \\\n -H 'Content-Type: application/json' \\\n -H 'Accept:\ - \ application/json' \\\n -H \"x-api-key: [YOUR_API_KEY_HERE]\" \\\n \"https://console.jumpcloud.com/api/systemusers/[SYSTEM_USER_ID_HERE]/systems\"\ - \n```" - operationId: "systemusers_systems_binding_put" - parameters: - - name: "id" - in: "path" - required: true - type: "string" - x-exportParamName: "Id" - - in: "body" - name: "body" - required: false - schema: - $ref: "#/definitions/usersystembindingsput" - x-exportParamName: "Body" - - name: "Content-Type" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "ContentType" - - name: "Accept" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "Accept" - - name: "x-org-id" - in: "header" - description: "" - required: false - type: "string" - x-exportParamName: "XOrgId" - responses: - 200: - description: "OK" - schema: - $ref: "#/definitions/usersystembinding" - 401: - description: "Unauthorized" - security: - - x-api-key: [] - x-stoplight: - afterScript: null - beforeScript: null - id: "systemusers_systems_binding_put" - mock: - dynamic: false - enabled: false - statusCode: 200 - public: false - /systemusers/{id}/unlock: - post: - tags: - - "Systemusers" - summary: "Unlock a system user" - description: "This endpoint allows you to unlock a user's account." - operationId: "systemusers_unlock" - parameters: - - name: "id" - in: "path" - required: true - type: "string" - x-exportParamName: "Id" - - name: "x-org-id" - in: "header" - description: "" - required: false - type: "string" - x-exportParamName: "XOrgId" - - name: "Content-Type" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "ContentType" - - name: "Accept" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "Accept" - responses: - 200: - description: "" - 400: - description: "" - schema: - $ref: "#/definitions/errorresponse" - 401: - description: "" - schema: - $ref: "#/definitions/errorresponse" - 403: - description: "" - schema: - $ref: "#/definitions/errorresponse" - 404: - description: "" - schema: - $ref: "#/definitions/errorresponse" - 409: - description: "" - schema: - $ref: "#/definitions/errorresponse" - 500: - description: "" - schema: - $ref: "#/definitions/errorresponse" - security: - - x-api-key: [] - x-stoplight: - afterScript: null - beforeScript: null - id: "systemusers_unlock" - mock: - dynamic: false - enabled: false - statusCode: 200 - public: true - /systemusers/{systemuser_id}/sshkeys/{id}: - delete: - tags: - - "Systemusers" - summary: "Delete a system user's Public SSH Keys" - description: "This endpoint will delete a specific System User's SSH Key." - operationId: "sshkey_delete" - parameters: - - name: "systemuser_id" - in: "path" - required: true - type: "string" - x-exportParamName: "SystemuserId" - - name: "id" - in: "path" - required: true - type: "string" - x-exportParamName: "Id" - - name: "Content-Type" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "ContentType" - - name: "Accept" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "Accept" - - name: "x-org-id" - in: "header" - description: "" - required: false - type: "string" - x-exportParamName: "XOrgId" - responses: - 200: - description: "" - 400: - description: "" - schema: - type: "object" - description: "Bad Request" - properties: {} - security: - - x-api-key: [] - x-stoplight: - afterScript: null - beforeScript: null - id: "sshkey_delete" - mock: - dynamic: false - enabled: false - statusCode: 200 - public: true - /tags: - get: - tags: - - "Tags" - summary: "List All Tags" - description: "Hidden as Tags is deprecated\n\nReturns all Tags." - operationId: "tags_list" - parameters: - - name: "fields" - in: "query" - description: "Use a space seperated string of field parameters to include\ - \ the data in the response. If omitted, the default list of fields will\ - \ be returned.\n" - required: false - type: "string" - x-exportParamName: "Fields" - - name: "limit" - in: "query" - description: "The number of records to return at once. Limited to 100." - required: false - type: "integer" - default: 10 - x-exportParamName: "Limit" - - name: "skip" - in: "query" - description: "The offset into the records to return." - required: false - type: "integer" - default: 0 - minimum: 0 - x-exportParamName: "Skip" - - name: "sort" - in: "query" - description: "Use space separated sort parameters to sort the collection.\n\ - Default sort is ascending. Prefix with `-` to sort descending.\n" - required: false - type: "string" - x-exportParamName: "Sort" - - name: "filter" - in: "query" - description: "A filter to apply to the query." - required: false - type: "string" - x-exportParamName: "Filter" - - name: "Content-Type" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "ContentType" - - name: "Accept" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "Accept" - responses: - 200: - description: "" - schema: - $ref: "#/definitions/tagslist" - security: - - x-api-key: [] - x-stoplight: - afterScript: null - beforeScript: null - id: "tags_list" - mock: - dynamic: false - enabled: false - statusCode: 200 - public: false - post: - tags: - - "Tags" - summary: "Create a Tag" - description: "Hidden as Tags is deprecated\n\nCreate a tag.\n\n### Examples\n\ - #### Create a new Tag\n\n```\ncurl \\\n -d '{\"name\" : \"Developers\"}'\ - \ \\\n -X 'POST' \\\n -H 'Content-Type: application/json' \\\n -H 'Accept:\ - \ application/json' \\\n -H \"x-api-key: [YOUR_API_KEY_HERE]\" \\\n \"https://console.jumpcloud.com/api/tags\"\ - \n```" - operationId: "tags_post" - parameters: - - in: "body" - name: "body" - required: false - schema: - $ref: "#/definitions/tagpost" - x-exportParamName: "Body" - - name: "Content-Type" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "ContentType" - - name: "Accept" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "Accept" - responses: - 200: - description: "" - schema: - $ref: "#/definitions/tag" - examples: - application/json: - _id: "58ea6b6610caf935133a3822" - externallyManaged: false - name: "test123" - regularExpressions: [] - sendToLDAP: false - systems: [] - systemusers: [] - security: - - x-api-key: [] - x-stoplight: - afterScript: null - beforeScript: null - id: "tags_post" - mock: - dynamic: false - enabled: false - statusCode: 200 - public: false - /tags/{name}: - delete: - tags: - - "Tags" - summary: "Delete a Tag" - description: "Hidden as Tags is deprecated\n\nDelete a Tag." - operationId: "tags_delete" - parameters: - - name: "name" - in: "path" - required: true - type: "string" - x-exportParamName: "Name" - - name: "Content-Type" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "ContentType" - - name: "Accept" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "Accept" - responses: - 200: - description: "" - schema: - $ref: "#/definitions/tag" - security: - - x-api-key: [] - x-stoplight: - afterScript: null - beforeScript: null - id: "tags_delete" - mock: - dynamic: false - enabled: false - statusCode: 200 - public: false -securityDefinitions: - x-api-key: - type: "apiKey" - name: "x-api-key" - in: "header" -definitions: - application: - type: "object" - properties: - _id: - type: "string" - beta: - type: "boolean" - config: - $ref: "#/definitions/application_config" - displayLabel: - type: "string" - displayName: - type: "string" - learnMore: - type: "string" - name: - type: "string" - organization: - type: "string" - ssoUrl: - type: "string" - title: "Application" - example: - displayLabel: "displayLabel" - learnMore: "learnMore" - ssoUrl: "ssoUrl" - displayName: "displayName" - organization: "organization" - name: "name" - _id: "_id" - config: - acsUrl: - visible: true - tooltip: - template: "template" - variables: - icon: "icon" - message: "message" - readOnly: true - label: "label" - position: 0 - type: "type" - value: "value" - required: true - constantAttributes: - visible: true - mutable: true - tooltip: - template: "template" - variables: - icon: "icon" - message: "message" - readOnly: true - label: "label" - position: 6 - type: "type" - value: - - visible: true - name: "name" - readOnly: true - value: "value" - required: true - - visible: true - name: "name" - readOnly: true - value: "value" - required: true - required: true - idpCertificate: - visible: true - tooltip: - template: "template" - variables: - icon: "icon" - message: "message" - readOnly: true - label: "label" - position: 0 - type: "type" - value: "value" - required: true - spEntityId: - visible: true - tooltip: - template: "template" - variables: - icon: "icon" - message: "message" - readOnly: true - label: "label" - position: 0 - type: "type" - value: "value" - required: true - databaseAttributes: - position: 1 - idpPrivateKey: - visible: true - tooltip: - template: "template" - variables: - icon: "icon" - message: "message" - readOnly: true - label: "label" - position: 0 - type: "type" - value: "value" - required: true - idpEntityId: - visible: true - tooltip: - template: "template" - variables: - icon: "icon" - message: "message" - readOnly: true - label: "label" - position: 0 - type: "type" - value: "value" - required: true - beta: true - x-stoplight: - id: "application" - name: "Application" - public: true - applicationslist: - type: "object" - properties: - results: - type: "array" - description: "The list of applications." - items: - $ref: "#/definitions/application" - totalCount: - type: "integer" - description: "The total number of applications." - title: "ApplicationsList" - example: - totalCount: 0 - results: - - displayLabel: "displayLabel" - learnMore: "learnMore" - ssoUrl: "ssoUrl" - displayName: "displayName" - organization: "organization" - name: "name" - _id: "_id" - config: - acsUrl: - visible: true - tooltip: - template: "template" - variables: - icon: "icon" - message: "message" - readOnly: true - label: "label" - position: 0 - type: "type" - value: "value" - required: true - constantAttributes: - visible: true - mutable: true - tooltip: - template: "template" - variables: - icon: "icon" - message: "message" - readOnly: true - label: "label" - position: 6 - type: "type" - value: - - visible: true - name: "name" - readOnly: true - value: "value" - required: true - - visible: true - name: "name" - readOnly: true - value: "value" - required: true - required: true - idpCertificate: - visible: true - tooltip: - template: "template" - variables: - icon: "icon" - message: "message" - readOnly: true - label: "label" - position: 0 - type: "type" - value: "value" - required: true - spEntityId: - visible: true - tooltip: - template: "template" - variables: - icon: "icon" - message: "message" - readOnly: true - label: "label" - position: 0 - type: "type" - value: "value" - required: true - databaseAttributes: - position: 1 - idpPrivateKey: - visible: true - tooltip: - template: "template" - variables: - icon: "icon" - message: "message" - readOnly: true - label: "label" - position: 0 - type: "type" - value: "value" - required: true - idpEntityId: - visible: true - tooltip: - template: "template" - variables: - icon: "icon" - message: "message" - readOnly: true - label: "label" - position: 0 - type: "type" - value: "value" - required: true - beta: true - - displayLabel: "displayLabel" - learnMore: "learnMore" - ssoUrl: "ssoUrl" - displayName: "displayName" - organization: "organization" - name: "name" - _id: "_id" - config: - acsUrl: - visible: true - tooltip: - template: "template" - variables: - icon: "icon" - message: "message" - readOnly: true - label: "label" - position: 0 - type: "type" - value: "value" - required: true - constantAttributes: - visible: true - mutable: true - tooltip: - template: "template" - variables: - icon: "icon" - message: "message" - readOnly: true - label: "label" - position: 6 - type: "type" - value: - - visible: true - name: "name" - readOnly: true - value: "value" - required: true - - visible: true - name: "name" - readOnly: true - value: "value" - required: true - required: true - idpCertificate: - visible: true - tooltip: - template: "template" - variables: - icon: "icon" - message: "message" - readOnly: true - label: "label" - position: 0 - type: "type" - value: "value" - required: true - spEntityId: - visible: true - tooltip: - template: "template" - variables: - icon: "icon" - message: "message" - readOnly: true - label: "label" - position: 0 - type: "type" - value: "value" - required: true - databaseAttributes: - position: 1 - idpPrivateKey: - visible: true - tooltip: - template: "template" - variables: - icon: "icon" - message: "message" - readOnly: true - label: "label" - position: 0 - type: "type" - value: "value" - required: true - idpEntityId: - visible: true - tooltip: - template: "template" - variables: - icon: "icon" - message: "message" - readOnly: true - label: "label" - position: 0 - type: "type" - value: "value" - required: true - beta: true - x-stoplight: - id: "applicationslist" - name: "ApplicationsList" - public: true - applicationtemplate: - type: "object" - properties: - _id: - type: "string" - beta: - type: "boolean" - color: - type: "string" - config: - $ref: "#/definitions/application_config" - displayLabel: - type: "string" - displayName: - type: "string" - isConfigured: - type: "boolean" - jit: - $ref: "#/definitions/applicationtemplate_jit" - learnMore: - type: "string" - name: - type: "string" - ssoUrl: - type: "string" - title: "ApplicationTemplate" - example: - displayLabel: "displayLabel" - isConfigured: true - color: "color" - jit: - createOnly: true - attributes: "{}" - learnMore: "learnMore" - ssoUrl: "ssoUrl" - displayName: "displayName" - name: "name" - _id: "_id" - config: - acsUrl: - visible: true - tooltip: - template: "template" - variables: - icon: "icon" - message: "message" - readOnly: true - label: "label" - position: 0 - type: "type" - value: "value" - required: true - constantAttributes: - visible: true - mutable: true - tooltip: - template: "template" - variables: - icon: "icon" - message: "message" - readOnly: true - label: "label" - position: 6 - type: "type" - value: - - visible: true - name: "name" - readOnly: true - value: "value" - required: true - - visible: true - name: "name" - readOnly: true - value: "value" - required: true - required: true - idpCertificate: - visible: true - tooltip: - template: "template" - variables: - icon: "icon" - message: "message" - readOnly: true - label: "label" - position: 0 - type: "type" - value: "value" - required: true - spEntityId: - visible: true - tooltip: - template: "template" - variables: - icon: "icon" - message: "message" - readOnly: true - label: "label" - position: 0 - type: "type" - value: "value" - required: true - databaseAttributes: - position: 1 - idpPrivateKey: - visible: true - tooltip: - template: "template" - variables: - icon: "icon" - message: "message" - readOnly: true - label: "label" - position: 0 - type: "type" - value: "value" - required: true - idpEntityId: - visible: true - tooltip: - template: "template" - variables: - icon: "icon" - message: "message" - readOnly: true - label: "label" - position: 0 - type: "type" - value: "value" - required: true - beta: true - x-stoplight: - id: "applicationtemplate" - name: "ApplicationTemplate" - public: true - applicationtemplateslist: - type: "object" - properties: - results: - type: "array" - description: "The list of applications." - items: - $ref: "#/definitions/applicationtemplate" - totalCount: - type: "integer" - description: "The total number of applications." - title: "ApplicationTemplatesList" - example: - totalCount: 5 - results: - - displayLabel: "displayLabel" - isConfigured: true - color: "color" - jit: - createOnly: true - attributes: "{}" - learnMore: "learnMore" - ssoUrl: "ssoUrl" - displayName: "displayName" - name: "name" - _id: "_id" - config: - acsUrl: - visible: true - tooltip: - template: "template" - variables: - icon: "icon" - message: "message" - readOnly: true - label: "label" - position: 0 - type: "type" - value: "value" - required: true - constantAttributes: - visible: true - mutable: true - tooltip: - template: "template" - variables: - icon: "icon" - message: "message" - readOnly: true - label: "label" - position: 6 - type: "type" - value: - - visible: true - name: "name" - readOnly: true - value: "value" - required: true - - visible: true - name: "name" - readOnly: true - value: "value" - required: true - required: true - idpCertificate: - visible: true - tooltip: - template: "template" - variables: - icon: "icon" - message: "message" - readOnly: true - label: "label" - position: 0 - type: "type" - value: "value" - required: true - spEntityId: - visible: true - tooltip: - template: "template" - variables: - icon: "icon" - message: "message" - readOnly: true - label: "label" - position: 0 - type: "type" - value: "value" - required: true - databaseAttributes: - position: 1 - idpPrivateKey: - visible: true - tooltip: - template: "template" - variables: - icon: "icon" - message: "message" - readOnly: true - label: "label" - position: 0 - type: "type" - value: "value" - required: true - idpEntityId: - visible: true - tooltip: - template: "template" - variables: - icon: "icon" - message: "message" - readOnly: true - label: "label" - position: 0 - type: "type" - value: "value" - required: true - beta: true - - displayLabel: "displayLabel" - isConfigured: true - color: "color" - jit: - createOnly: true - attributes: "{}" - learnMore: "learnMore" - ssoUrl: "ssoUrl" - displayName: "displayName" - name: "name" - _id: "_id" - config: - acsUrl: - visible: true - tooltip: - template: "template" - variables: - icon: "icon" - message: "message" - readOnly: true - label: "label" - position: 0 - type: "type" - value: "value" - required: true - constantAttributes: - visible: true - mutable: true - tooltip: - template: "template" - variables: - icon: "icon" - message: "message" - readOnly: true - label: "label" - position: 6 - type: "type" - value: - - visible: true - name: "name" - readOnly: true - value: "value" - required: true - - visible: true - name: "name" - readOnly: true - value: "value" - required: true - required: true - idpCertificate: - visible: true - tooltip: - template: "template" - variables: - icon: "icon" - message: "message" - readOnly: true - label: "label" - position: 0 - type: "type" - value: "value" - required: true - spEntityId: - visible: true - tooltip: - template: "template" - variables: - icon: "icon" - message: "message" - readOnly: true - label: "label" - position: 0 - type: "type" - value: "value" - required: true - databaseAttributes: - position: 1 - idpPrivateKey: - visible: true - tooltip: - template: "template" - variables: - icon: "icon" - message: "message" - readOnly: true - label: "label" - position: 0 - type: "type" - value: "value" - required: true - idpEntityId: - visible: true - tooltip: - template: "template" - variables: - icon: "icon" - message: "message" - readOnly: true - label: "label" - position: 0 - type: "type" - value: "value" - required: true - beta: true - x-stoplight: - id: "applicationtemplateslist" - name: "ApplicationTemplatesList" - public: true - command: - type: "object" - required: - - "command" - properties: - command: - type: "string" - description: "The command to execute on the server." - commandRunners: - type: "array" - description: "An array of IDs of the Command Runner Users that can execute\ - \ this command." - items: - type: "string" - commandType: - type: "string" - description: "The Command OS" - files: - type: "array" - description: "An array of file IDs to include with the command." - items: - type: "string" - launchType: - type: "string" - description: "How the command will execute." - listensTo: - type: "string" - description: "" - name: - type: "string" - organization: - type: "string" - description: "The ID of the organization." - schedule: - type: "string" - description: "A crontab that consists of: [ (seconds) (minutes) (hours) (days\ - \ of month) (months) (weekdays) ] or [ immediate ]. If you send this as\ - \ an empty string, it will run immediately.\n" - scheduleRepeatType: - type: "string" - description: "When the command will repeat." - sudo: - type: "boolean" - description: "" - systems: - type: "array" - description: "An array of system IDs to run the command on. Not available\ - \ if you are using Groups." - items: - type: "string" - timeout: - type: "string" - description: "The time in seconds to allow the command to run for." - trigger: - type: "string" - description: "The name of the command trigger." - user: - type: "string" - description: "The ID of the system user to run the command as. This field\ - \ is required when creating a command with a commandType of \"mac\" or \"\ - linux\"." - title: "Command" - example: - scheduleRepeatType: "scheduleRepeatType" - commandType: "commandType" - commandRunners: - - "commandRunners" - - "commandRunners" - trigger: "trigger" - command: "command" - timeout: "timeout" - schedule: "schedule" - systems: - - "systems" - - "systems" - organization: "organization" - name: "name" - files: - - "files" - - "files" - listensTo: "listensTo" - sudo: true - user: "user" - launchType: "launchType" - x-stoplight: - id: "command" - name: "Command" - public: true - commandfilereturn: - type: "object" - properties: - results: - $ref: "#/definitions/commandfilereturn_results" - totalCount: - type: "integer" - description: "The total number of commands files" - title: "CommandFileReturn" - example: - totalCount: 0 - results: - destination: "destination" - name: "name" - _id: "_id" - x-stoplight: - id: "commandfilereturn" - name: "CommandFileReturn" - public: true - commandresult: - type: "object" - properties: - _id: - type: "string" - description: "The ID of the command." - command: - type: "string" - description: "The command that was executed on the system." - files: - type: "array" - description: "An array of file ids that were included in the command" - items: - type: "string" - name: - type: "string" - description: "The name of the command." - organization: - type: "string" - description: "The ID of the organization." - requestTime: - type: "string" - description: "The time that the command was sent." - response: - $ref: "#/definitions/commandresult_response" - responseTime: - type: "string" - description: "The time that the command was completed." - sudo: - type: "boolean" - description: "If the user had sudo rights" - system: - type: "string" - description: "The name of the system the command was executed on." - systemId: - type: "string" - description: "The id of the system the command was executed on." - user: - type: "string" - description: "The user the command ran as." - workflowId: - type: "string" - workflowInstanceId: - type: "string" - title: "CommandResult" - example: - systemId: "systemId" - responseTime: "responseTime" - command: "command" - requestTime: "requestTime" - system: "system" - response: - data: - output: "output" - exitCode: 0 - id: "id" - error: "error" - organization: "organization" - name: "name" - files: - - "files" - - "files" - _id: "_id" - sudo: true - user: "user" - workflowInstanceId: "workflowInstanceId" - workflowId: "workflowId" - x-stoplight: - id: "commandresult" - name: "CommandResult" - public: true - commandresultslist: - type: "object" - properties: - results: - type: "array" - description: "The list of command results" - items: - $ref: "#/definitions/commandresult" - totalCount: - type: "integer" - description: "The total number of command results" - title: "CommandResultsList" - example: - totalCount: 6 - results: - - systemId: "systemId" - responseTime: "responseTime" - command: "command" - requestTime: "requestTime" - system: "system" - response: - data: - output: "output" - exitCode: 0 - id: "id" - error: "error" - organization: "organization" - name: "name" - files: - - "files" - - "files" - _id: "_id" - sudo: true - user: "user" - workflowInstanceId: "workflowInstanceId" - workflowId: "workflowId" - - systemId: "systemId" - responseTime: "responseTime" - command: "command" - requestTime: "requestTime" - system: "system" - response: - data: - output: "output" - exitCode: 0 - id: "id" - error: "error" - organization: "organization" - name: "name" - files: - - "files" - - "files" - _id: "_id" - sudo: true - user: "user" - workflowInstanceId: "workflowInstanceId" - workflowId: "workflowId" - x-stoplight: - id: "commandresultslist" - name: "CommandResultsList" - public: true - commandslist: - type: "object" - properties: - results: - type: "array" - items: - $ref: "#/definitions/commandslist_results" - totalCount: - type: "integer" - description: "The total number of commands" - title: "CommandsList" - example: - totalCount: 0 - results: - - schedule: "schedule" - scheduleRepeatType: "scheduleRepeatType" - commandType: "commandType" - organization: "organization" - name: "name" - _id: "_id" - listensTo: "listensTo" - trigger: "trigger" - command: "command" - launchType: "launchType" - - schedule: "schedule" - scheduleRepeatType: "scheduleRepeatType" - commandType: "commandType" - organization: "organization" - name: "name" - _id: "_id" - listensTo: "listensTo" - trigger: "trigger" - command: "command" - launchType: "launchType" - x-stoplight: - id: "commandslist" - name: "CommandsList" - public: true - errorresponse: - type: "object" - properties: - message: - type: "string" - title: "ErrorResponse" - x-stoplight: - id: "errorresponse" - name: "ErrorResponse" - public: true - fde: - type: "object" - properties: - active: - type: "boolean" - keyPresent: - type: "boolean" - title: "FDE" - example: - active: true - keyPresent: true - x-stoplight: - id: "fde" - name: "FDE" - public: true - mfa: - type: "object" - properties: - configured: - type: "boolean" - exclusion: - type: "boolean" - exclusionUntil: - type: "string" - format: "date-time" - title: "mfa" - example: - configured: true - exclusion: true - exclusionUntil: "2000-01-23T04:56:07.000+00:00" - x-stoplight: - id: "mfa" - name: "mfa" - public: true - organizationslist: - type: "object" - properties: - results: - type: "array" - description: "The list of organizations." - items: - $ref: "#/definitions/organizationslist_results" - totalCount: - type: "integer" - description: "The total number of organizations. " - title: "OrganizationList" - example: - totalCount: 0 - results: - - displayName: "displayName" - _id: "_id" - logoUrl: "logoUrl" - - displayName: "displayName" - _id: "_id" - logoUrl: "logoUrl" - x-stoplight: - id: "organizationslist" - name: "OrganizationList" - public: true - radiusserver: - type: "object" - properties: - _id: - type: "string" - mfa: - type: "string" - enum: - - "DISABLED" - - "ENABLED" - - "REQUIRED" - - "ALWAYS" - name: - type: "string" - networkSourceIp: - type: "string" - organization: - type: "string" - sharedSecret: - type: "string" - tagNames: - type: "array" - items: - type: "string" - tags: - type: "array" - items: - type: "string" - userLockoutAction: - type: "string" - userPasswordExpirationAction: - type: "string" - title: "RadiusServer" - example: - networkSourceIp: "networkSourceIp" - userLockoutAction: "userLockoutAction" - organization: "organization" - name: "name" - mfa: "DISABLED" - userPasswordExpirationAction: "userPasswordExpirationAction" - _id: "_id" - sharedSecret: "sharedSecret" - tagNames: - - "tagNames" - - "tagNames" - tags: - - "tags" - - "tags" - x-stoplight: - id: "radiusserver" - name: "RadiusServer" - public: true - radiusserverpost: - type: "object" - required: - - "name" - - "networkSourceIp" - - "sharedSecret" - properties: - mfa: - type: "string" - enum: - - "DISABLED" - - "ENABLED" - - "REQUIRED" - - "ALWAYS" - name: - type: "string" - networkSourceIp: - type: "string" - sharedSecret: - type: "string" - description: "RADIUS shared secret between the server and client." - tagNames: - type: "array" - items: - type: "string" - userLockoutAction: - type: "string" - userPasswordExpirationAction: - type: "string" - title: "RadiusServerPost" - x-stoplight: - id: "radiusserverpost" - name: "RadiusServerPost" - public: true - radiusserverput: - type: "object" - properties: - _id: - type: "string" - mfa: - type: "string" - enum: - - "DISABLED" - - "ENABLED" - - "REQUIRED" - - "ALWAYS" - name: - type: "string" - networkSourceIp: - type: "string" - tagNames: - type: "array" - items: - type: "string" - userLockoutAction: - type: "string" - userPasswordExpirationAction: - type: "string" - title: "RadiusServerPut" - example: - networkSourceIp: "networkSourceIp" - userLockoutAction: "userLockoutAction" - name: "name" - mfa: "DISABLED" - userPasswordExpirationAction: "userPasswordExpirationAction" - _id: "_id" - tagNames: - - "tagNames" - - "tagNames" - x-stoplight: - id: "radiusserverput" - name: "RadiusServerPut" - public: true - radiusserverslist: - type: "object" - properties: - results: - type: "array" - items: - $ref: "#/definitions/radiusserver" - totalCount: - type: "integer" - title: "RadiusServersList" - example: - totalCount: 0 - results: - - networkSourceIp: "networkSourceIp" - userLockoutAction: "userLockoutAction" - organization: "organization" - name: "name" - mfa: "DISABLED" - userPasswordExpirationAction: "userPasswordExpirationAction" - _id: "_id" - sharedSecret: "sharedSecret" - tagNames: - - "tagNames" - - "tagNames" - tags: - - "tags" - - "tags" - - networkSourceIp: "networkSourceIp" - userLockoutAction: "userLockoutAction" - organization: "organization" - name: "name" - mfa: "DISABLED" - userPasswordExpirationAction: "userPasswordExpirationAction" - _id: "_id" - sharedSecret: "sharedSecret" - tagNames: - - "tagNames" - - "tagNames" - tags: - - "tags" - - "tags" - x-stoplight: - id: "radiusserverslist" - name: "RadiusServersList" - public: true - search: - type: "object" - properties: - fields: - type: "string" - filter: - type: "object" - properties: {} - searchFilter: - type: "object" - properties: {} - title: "Search" - x-stoplight: - id: "search" - name: "Search" - public: true - sshkeylist: - type: "object" - properties: - _id: - type: "string" - description: "The ID of the SSH key." - create_date: - type: "string" - description: "The date the SSH key was created." - name: - type: "string" - description: "The name of the SSH key." - public_key: - type: "string" - description: "The Public SSH key." - title: "SSHKeyList" - example: - public_key: "public_key" - name: "name" - _id: "_id" - create_date: "create_date" - x-stoplight: - id: "sshkeylist" - name: "SSHKeyList" - public: true - sshkeypost: - type: "object" - required: - - "name" - - "public_key" - properties: - name: - type: "string" - description: "The name of the SSH key." - public_key: - type: "string" - description: "The Public SSH key." - title: "SSHKeyPost" - x-stoplight: - id: "sshkeypost" - name: "SSHKeyPost" - public: true - system: - type: "object" - properties: - _id: - type: "string" - active: - type: "boolean" - agentVersion: - type: "string" - allowMultiFactorAuthentication: - type: "boolean" - allowPublicKeyAuthentication: - type: "boolean" - allowSshPasswordAuthentication: - type: "boolean" - allowSshRootLogin: - type: "boolean" - amazonInstanceID: - type: "string" - arch: - type: "string" - connectionHistory: - type: "array" - items: - type: "object" - properties: {} - created: - type: "string" - displayName: - type: "string" - fde: - $ref: "#/definitions/fde" - hostname: - type: "string" - lastContact: - type: "string" - modifySSHDConfig: - type: "boolean" - networkInterfaces: - type: "array" - items: - $ref: "#/definitions/system_networkInterfaces" - organization: - type: "string" - os: - type: "string" - remoteIP: - type: "string" - sshRootEnabled: - type: "boolean" - sshdParams: - type: "array" - items: - $ref: "#/definitions/system_sshdParams" - systemInsights: - $ref: "#/definitions/system_systemInsights" - systemTimezone: - type: "integer" - tags: - type: "array" - items: - type: "string" - templateName: - type: "string" - version: - type: "string" - title: "System" - example: - allowSshRootLogin: true - remoteIP: "remoteIP" - displayName: "displayName" - hostname: "hostname" - amazonInstanceID: "amazonInstanceID" - allowSshPasswordAuthentication: true - connectionHistory: - - "{}" - - "{}" - systemInsights: - state: "enabled" - os: "os" - allowMultiFactorAuthentication: true - created: "created" - fde: - active: true - keyPresent: true - modifySSHDConfig: true - active: true - sshRootEnabled: true - version: "version" - lastContact: "lastContact" - tags: - - "tags" - - "tags" - allowPublicKeyAuthentication: true - networkInterfaces: - - internal: true - address: "address" - name: "name" - family: "family" - - internal: true - address: "address" - name: "name" - family: "family" - templateName: "templateName" - sshdParams: - - name: "name" - value: "value" - - name: "name" - value: "value" - organization: "organization" - agentVersion: "agentVersion" - _id: "_id" - arch: "arch" - systemTimezone: 0 - x-stoplight: - id: "system" - name: "System" - public: true - systemput: - type: "object" - properties: - agentBoundMessages: - type: "array" - items: - $ref: "#/definitions/systemput_agentBoundMessages" - allowMultiFactorAuthentication: - type: "boolean" - allowPublicKeyAuthentication: - type: "boolean" - allowSshPasswordAuthentication: - type: "boolean" - allowSshRootLogin: - type: "boolean" - displayName: - type: "string" - tags: - type: "array" - items: - type: "string" - title: "SystemPut" - x-stoplight: - id: "systemput" - name: "SystemPut" - public: true - systemslist: - type: "object" - properties: - results: - type: "array" - description: "The list of systems." - items: - $ref: "#/definitions/system" - totalCount: - type: "integer" - description: "The total number of systems." - title: "SystemsList" - example: - totalCount: 6 - results: - - allowSshRootLogin: true - remoteIP: "remoteIP" - displayName: "displayName" - hostname: "hostname" - amazonInstanceID: "amazonInstanceID" - allowSshPasswordAuthentication: true - connectionHistory: - - "{}" - - "{}" - systemInsights: - state: "enabled" - os: "os" - allowMultiFactorAuthentication: true - created: "created" - fde: - active: true - keyPresent: true - modifySSHDConfig: true - active: true - sshRootEnabled: true - version: "version" - lastContact: "lastContact" - tags: - - "tags" - - "tags" - allowPublicKeyAuthentication: true - networkInterfaces: - - internal: true - address: "address" - name: "name" - family: "family" - - internal: true - address: "address" - name: "name" - family: "family" - templateName: "templateName" - sshdParams: - - name: "name" - value: "value" - - name: "name" - value: "value" - organization: "organization" - agentVersion: "agentVersion" - _id: "_id" - arch: "arch" - systemTimezone: 0 - - allowSshRootLogin: true - remoteIP: "remoteIP" - displayName: "displayName" - hostname: "hostname" - amazonInstanceID: "amazonInstanceID" - allowSshPasswordAuthentication: true - connectionHistory: - - "{}" - - "{}" - systemInsights: - state: "enabled" - os: "os" - allowMultiFactorAuthentication: true - created: "created" - fde: - active: true - keyPresent: true - modifySSHDConfig: true - active: true - sshRootEnabled: true - version: "version" - lastContact: "lastContact" - tags: - - "tags" - - "tags" - allowPublicKeyAuthentication: true - networkInterfaces: - - internal: true - address: "address" - name: "name" - family: "family" - - internal: true - address: "address" - name: "name" - family: "family" - templateName: "templateName" - sshdParams: - - name: "name" - value: "value" - - name: "name" - value: "value" - organization: "organization" - agentVersion: "agentVersion" - _id: "_id" - arch: "arch" - systemTimezone: 0 - x-stoplight: - id: "systemslist" - name: "SystemsList" - public: true - systemuser: - type: "object" - properties: - _id: - type: "string" - account_locked: - type: "boolean" - activated: - type: "boolean" - allow_public_key: - type: "boolean" - associatedTagCount: - type: "integer" - minimum: 0 - attributes: - type: "array" - items: - type: "object" - properties: {} - company: - type: "string" - maxLength: 1024 - costCenter: - type: "string" - maxLength: 1024 - created: - type: "string" - department: - type: "string" - maxLength: 1024 - description: - type: "string" - maxLength: 1024 - displayname: - type: "string" - maxLength: 1024 - email: - type: "string" - maxLength: 1024 - employeeIdentifier: - type: "string" - description: "Must be unique per user. " - maxLength: 256 - employeeType: - type: "string" - maxLength: 1024 - enable_managed_uid: - type: "boolean" - enable_user_portal_multifactor: - type: "boolean" - external_dn: - type: "string" - external_source_type: - type: "string" - externally_managed: - type: "boolean" - firstname: - type: "string" - maxLength: 1024 - jobTitle: - type: "string" - maxLength: 1024 - lastname: - type: "string" - maxLength: 1024 - ldap_binding_user: - type: "boolean" - location: - type: "string" - maxLength: 1024 - mfa: - $ref: "#/definitions/mfa" - middlename: - type: "string" - maxLength: 1024 - password_expiration_date: - type: "string" - password_expired: - type: "boolean" - password_never_expires: - type: "boolean" - passwordless_sudo: - type: "boolean" - public_key: - type: "string" - samba_service_user: - type: "boolean" - ssh_keys: - type: "array" - items: - $ref: "#/definitions/sshkeylist" - sudo: - type: "boolean" - suspended: - type: "boolean" - tags: - type: "array" - items: - type: "string" - totp_enabled: - type: "boolean" - unix_guid: - type: "integer" - minimum: 1 - unix_uid: - type: "integer" - minimum: 1 - username: - type: "string" - maxLength: 1024 - title: "SystemUser" - x-stoplight: - id: "systemuser" - name: "SystemUser" - public: true - systemuserbinding: - type: "object" - title: "SystemUserBinding" - x-stoplight: - id: "systemuserbinding" - name: "SystemUserBinding" - public: true - systemuserbindingsput: - type: "object" - required: - - "add" - - "remove" - properties: - add: - type: "array" - description: "The list of systemuser ids to be added to this system." - items: - type: "string" - remove: - type: "array" - description: "The list of systemuser ids to be removed from this system." - items: - type: "string" - title: "SystemUserBindingsPut" - x-stoplight: - id: "systemuserbindingsput" - name: "SystemUserBindingsPut" - public: true - systemuserput: - type: "object" - properties: - account_locked: - type: "boolean" - addresses: - type: "array" - description: "type, poBox, extendedAddress, streetAddress, locality, region,\ - \ postalCode, country" - items: - $ref: "#/definitions/systemuserput_addresses" - allow_public_key: - type: "boolean" - attributes: - type: "array" - items: - type: "object" - properties: {} - company: - type: "string" - maxLength: 1024 - costCenter: - type: "string" - maxLength: 1024 - department: - type: "string" - maxLength: 1024 - description: - type: "string" - maxLength: 1024 - displayname: - type: "string" - maxLength: 1024 - email: - type: "string" - maxLength: 1024 - employeeIdentifier: - type: "string" - description: "Must be unique per user. " - maxLength: 256 - employeeType: - type: "string" - maxLength: 1024 - enable_managed_uid: - type: "boolean" - enable_user_portal_multifactor: - type: "boolean" - external_dn: - type: "string" - external_source_type: - type: "string" - externally_managed: - type: "boolean" - firstname: - type: "string" - maxLength: 1024 - jobTitle: - type: "string" - maxLength: 1024 - lastname: - type: "string" - maxLength: 1024 - ldap_binding_user: - type: "boolean" - location: - type: "string" - maxLength: 1024 - mfa: - $ref: "#/definitions/mfa" - middlename: - type: "string" - maxLength: 1024 - password: - type: "string" - password_never_expires: - type: "boolean" - phoneNumbers: - type: "array" - items: - $ref: "#/definitions/systemuserput_phoneNumbers" - public_key: - type: "string" - relationships: - type: "array" - items: - type: "object" - properties: {} - samba_service_user: - type: "boolean" - ssh_keys: - type: "array" - items: - $ref: "#/definitions/sshkeypost" - sudo: - type: "boolean" - suspended: - type: "boolean" - tags: - type: "array" - items: - type: "string" - unix_guid: - type: "integer" - minimum: 1 - unix_uid: - type: "integer" - minimum: 1 - username: - type: "string" - maxLength: 1024 - title: "SystemUserPut" - x-stoplight: - id: "systemuserput" - name: "SystemUserPut" - public: true - systemuserputpost: - type: "object" - required: - - "email" - - "username" - properties: - account_locked: - type: "boolean" - activated: - type: "boolean" - addresses: - type: "array" - items: - $ref: "#/definitions/systemuserputpost_addresses" - allow_public_key: - type: "boolean" - attributes: - type: "array" - items: - type: "object" - properties: {} - company: - type: "string" - costCenter: - type: "string" - department: - type: "string" - description: - type: "string" - maxLength: 1024 - displayname: - type: "string" - email: - type: "string" - maxLength: 1024 - employeeIdentifier: - type: "string" - description: "Must be unique per user. " - maxLength: 256 - employeeType: - type: "string" - enable_managed_uid: - type: "boolean" - enable_user_portal_multifactor: - type: "boolean" - external_dn: - type: "string" - external_source_type: - type: "string" - externally_managed: - type: "boolean" - firstname: - type: "string" - jobTitle: - type: "string" - lastname: - type: "string" - ldap_binding_user: - type: "boolean" - location: - type: "string" - mfa: - $ref: "#/definitions/mfa" - middlename: - type: "string" - password: - type: "string" - password_never_expires: - type: "boolean" - passwordless_sudo: - type: "boolean" - phoneNumbers: - type: "array" - items: - $ref: "#/definitions/systemuserputpost_phoneNumbers" - public_key: - type: "string" - relationships: - type: "array" - items: - type: "object" - properties: {} - samba_service_user: - type: "boolean" - sudo: - type: "boolean" - suspended: - type: "boolean" - tags: - type: "array" - items: - type: "string" - unix_guid: - type: "integer" - minimum: 1 - unix_uid: - type: "integer" - minimum: 1 - username: - type: "string" - title: "SystemUserPost" - x-stoplight: - id: "systemuserputpost" - name: "SystemUserPost" - public: true - systemuserreturn: - type: "object" - properties: - _id: - type: "string" - account_locked: - type: "boolean" - activated: - type: "boolean" - addresses: - type: "array" - items: - $ref: "#/definitions/systemuserreturn_addresses" - allow_public_key: - type: "boolean" - attributes: - type: "array" - items: - type: "object" - properties: {} - badLoginAttempts: - type: "integer" - minimum: 0 - company: - type: "string" - maxLength: 1024 - costCenter: - type: "string" - maxLength: 1024 - created: - type: "string" - department: - type: "string" - maxLength: 1024 - description: - type: "string" - maxLength: 1024 - displayname: - type: "string" - maxLength: 1024 - email: - type: "string" - maxLength: 1024 - employeeIdentifier: - type: "string" - description: "Must be unique per user. " - maxLength: 256 - employeeType: - type: "string" - maxLength: 1024 - enable_managed_uid: - type: "boolean" - enable_user_portal_multifactor: - type: "boolean" - external_dn: - type: "string" - external_source_type: - type: "string" - externally_managed: - type: "boolean" - firstname: - type: "string" - maxLength: 1024 - jobTitle: - type: "string" - maxLength: 1024 - lastname: - type: "string" - maxLength: 1024 - ldap_binding_user: - type: "boolean" - location: - type: "string" - maxLength: 1024 - mfa: - $ref: "#/definitions/mfa" - middlename: - type: "string" - maxLength: 1024 - organization: - type: "string" - password_expiration_date: - type: "string" - password_expired: - type: "boolean" - password_never_expires: - type: "boolean" - passwordless_sudo: - type: "boolean" - phoneNumbers: - type: "array" - items: - $ref: "#/definitions/systemuserreturn_phoneNumbers" - public_key: - type: "string" - relationships: - type: "array" - items: - type: "object" - properties: {} - samba_service_user: - type: "boolean" - ssh_keys: - type: "array" - items: - $ref: "#/definitions/sshkeylist" - sudo: - type: "boolean" - suspended: - type: "boolean" - tags: - type: "array" - items: - type: "string" - totp_enabled: - type: "boolean" - unix_guid: - type: "integer" - minimum: 1 - unix_uid: - type: "integer" - minimum: 1 - username: - type: "string" - maxLength: 1024 - title: "SystemUserReturn" - example: - public_key: "public_key" - addresses: - - country: "country" - poBox: "poBox" - streetAddress: "streetAddress" - postalCode: "postalCode" - locality: "locality" - id: "id" - extendedAddress: "extendedAddress" - region: "region" - type: "type" - - country: "country" - poBox: "poBox" - streetAddress: "streetAddress" - postalCode: "postalCode" - locality: "locality" - id: "id" - extendedAddress: "extendedAddress" - region: "region" - type: "type" - badLoginAttempts: 0 - firstname: "firstname" - account_locked: true - totp_enabled: true - jobTitle: "jobTitle" - unix_guid: 1 - description: "description" - samba_service_user: true - allow_public_key: true - phoneNumbers: - - number: "number" - id: "id" - type: "type" - - number: "number" - id: "id" - type: "type" - relationships: - - "{}" - - "{}" - unix_uid: 1 - passwordless_sudo: true - externally_managed: true - ldap_binding_user: true - password_expiration_date: "password_expiration_date" - company: "company" - sudo: true - department: "department" - email: "email" - enable_managed_uid: true - password_expired: true - costCenter: "costCenter" - created: "created" - mfa: - configured: true - exclusion: true - exclusionUntil: "2000-01-23T04:56:07.000+00:00" - middlename: "middlename" - external_source_type: "external_source_type" - suspended: true - lastname: "lastname" - tags: - - "tags" - - "tags" - employeeIdentifier: "employeeIdentifier" - employeeType: "employeeType" - ssh_keys: - - public_key: "public_key" - name: "name" - _id: "_id" - create_date: "create_date" - - public_key: "public_key" - name: "name" - _id: "_id" - create_date: "create_date" - displayname: "displayname" - organization: "organization" - password_never_expires: true - enable_user_portal_multifactor: true - attributes: - - "{}" - - "{}" - location: "location" - _id: "_id" - external_dn: "external_dn" - activated: true - username: "username" - x-stoplight: - id: "systemuserreturn" - name: "SystemUserReturn" - public: true - systemuserslist: - type: "object" - properties: - results: - type: "array" - description: "The list of system users." - items: - $ref: "#/definitions/systemuserreturn" - totalCount: - type: "integer" - description: "The total number of system users." - title: "SystemUsersList" - example: - totalCount: 5 - results: - - public_key: "public_key" - addresses: - - country: "country" - poBox: "poBox" - streetAddress: "streetAddress" - postalCode: "postalCode" - locality: "locality" - id: "id" - extendedAddress: "extendedAddress" - region: "region" - type: "type" - - country: "country" - poBox: "poBox" - streetAddress: "streetAddress" - postalCode: "postalCode" - locality: "locality" - id: "id" - extendedAddress: "extendedAddress" - region: "region" - type: "type" - badLoginAttempts: 0 - firstname: "firstname" - account_locked: true - totp_enabled: true - jobTitle: "jobTitle" - unix_guid: 1 - description: "description" - samba_service_user: true - allow_public_key: true - phoneNumbers: - - number: "number" - id: "id" - type: "type" - - number: "number" - id: "id" - type: "type" - relationships: - - "{}" - - "{}" - unix_uid: 1 - passwordless_sudo: true - externally_managed: true - ldap_binding_user: true - password_expiration_date: "password_expiration_date" - company: "company" - sudo: true - department: "department" - email: "email" - enable_managed_uid: true - password_expired: true - costCenter: "costCenter" - created: "created" - mfa: - configured: true - exclusion: true - exclusionUntil: "2000-01-23T04:56:07.000+00:00" - middlename: "middlename" - external_source_type: "external_source_type" - suspended: true - lastname: "lastname" - tags: - - "tags" - - "tags" - employeeIdentifier: "employeeIdentifier" - employeeType: "employeeType" - ssh_keys: - - public_key: "public_key" - name: "name" - _id: "_id" - create_date: "create_date" - - public_key: "public_key" - name: "name" - _id: "_id" - create_date: "create_date" - displayname: "displayname" - organization: "organization" - password_never_expires: true - enable_user_portal_multifactor: true - attributes: - - "{}" - - "{}" - location: "location" - _id: "_id" - external_dn: "external_dn" - activated: true - username: "username" - - public_key: "public_key" - addresses: - - country: "country" - poBox: "poBox" - streetAddress: "streetAddress" - postalCode: "postalCode" - locality: "locality" - id: "id" - extendedAddress: "extendedAddress" - region: "region" - type: "type" - - country: "country" - poBox: "poBox" - streetAddress: "streetAddress" - postalCode: "postalCode" - locality: "locality" - id: "id" - extendedAddress: "extendedAddress" - region: "region" - type: "type" - badLoginAttempts: 0 - firstname: "firstname" - account_locked: true - totp_enabled: true - jobTitle: "jobTitle" - unix_guid: 1 - description: "description" - samba_service_user: true - allow_public_key: true - phoneNumbers: - - number: "number" - id: "id" - type: "type" - - number: "number" - id: "id" - type: "type" - relationships: - - "{}" - - "{}" - unix_uid: 1 - passwordless_sudo: true - externally_managed: true - ldap_binding_user: true - password_expiration_date: "password_expiration_date" - company: "company" - sudo: true - department: "department" - email: "email" - enable_managed_uid: true - password_expired: true - costCenter: "costCenter" - created: "created" - mfa: - configured: true - exclusion: true - exclusionUntil: "2000-01-23T04:56:07.000+00:00" - middlename: "middlename" - external_source_type: "external_source_type" - suspended: true - lastname: "lastname" - tags: - - "tags" - - "tags" - employeeIdentifier: "employeeIdentifier" - employeeType: "employeeType" - ssh_keys: - - public_key: "public_key" - name: "name" - _id: "_id" - create_date: "create_date" - - public_key: "public_key" - name: "name" - _id: "_id" - create_date: "create_date" - displayname: "displayname" - organization: "organization" - password_never_expires: true - enable_user_portal_multifactor: true - attributes: - - "{}" - - "{}" - location: "location" - _id: "_id" - external_dn: "external_dn" - activated: true - username: "username" - x-stoplight: - id: "systemuserslist" - name: "SystemUsersList" - public: true - tag: - type: "object" - properties: - _id: - type: "string" - expired: - type: "boolean" - externalDN: - type: "string" - externalSourceType: - type: "string" - externallyManaged: - type: "boolean" - groupGid: - type: "string" - groupName: - type: "string" - name: - type: "string" - description: "A unique name for the Tag." - regularExpressions: - type: "array" - items: - type: "string" - sendToLDAP: - type: "boolean" - systems: - type: "array" - description: "An array of system ids that are associated to the Tag." - items: - type: "string" - systemusers: - type: "array" - description: "An array of system user ids that are associated to the Tag." - items: - type: "string" - title: "Tag" - example: - groupName: "groupName" - expired: true - systems: - - "systems" - - "systems" - externalSourceType: "externalSourceType" - externallyManaged: true - name: "name" - externalDN: "externalDN" - regularExpressions: - - "regularExpressions" - - "regularExpressions" - _id: "_id" - systemusers: - - "systemusers" - - "systemusers" - groupGid: "groupGid" - sendToLDAP: true - x-stoplight: - id: "tag" - name: "Tag" - public: true - tagpost: - type: "object" - required: - - "name" - properties: - externalDN: - type: "string" - externalSourceType: - type: "string" - externallyManaged: - type: "boolean" - groupGid: - type: "string" - groupName: - type: "string" - name: - type: "string" - description: "A unique name for the Tag." - regularExpressions: - type: "array" - items: - type: "string" - sendToLDAP: - type: "boolean" - systems: - type: "array" - description: "An array of system ids that are associated to the Tag." - items: - type: "string" - systemusers: - type: "array" - description: "An array of system user ids that are associated to the Tag." - items: - type: "string" - title: "TagPost" - x-stoplight: - id: "tagpost" - name: "TagPost" - public: true - tagput: - type: "object" - properties: - externalDN: - type: "string" - externalSourceType: - type: "string" - externallyManaged: - type: "boolean" - groupGid: - type: "string" - groupName: - type: "string" - name: - type: "string" - description: "A unique name for the Tag." - regularExpressions: - type: "array" - items: - type: "string" - sendToLDAP: - type: "boolean" - systems: - type: "array" - description: "An array of system ids that are associated to the Tag." - items: - type: "string" - systemusers: - type: "array" - description: "An array of system user ids that are associated to the Tag." - items: - type: "string" - title: "TagPut" - x-stoplight: - id: "tagput" - name: "TagPut" - public: true - tagslist: - type: "object" - properties: - results: - type: "array" - description: "The list of tags." - items: - $ref: "#/definitions/tag" - totalCount: - type: "integer" - description: "The total number of tags." - title: "TagsList" - example: - totalCount: 0 - results: - - groupName: "groupName" - expired: true - systems: - - "systems" - - "systems" - externalSourceType: "externalSourceType" - externallyManaged: true - name: "name" - externalDN: "externalDN" - regularExpressions: - - "regularExpressions" - - "regularExpressions" - _id: "_id" - systemusers: - - "systemusers" - - "systemusers" - groupGid: "groupGid" - sendToLDAP: true - - groupName: "groupName" - expired: true - systems: - - "systems" - - "systems" - externalSourceType: "externalSourceType" - externallyManaged: true - name: "name" - externalDN: "externalDN" - regularExpressions: - - "regularExpressions" - - "regularExpressions" - _id: "_id" - systemusers: - - "systemusers" - - "systemusers" - groupGid: "groupGid" - sendToLDAP: true - x-stoplight: - id: "tagslist" - name: "TagsList" - public: true - usersystembinding: - type: "object" - title: "UserSystemBinding" - x-stoplight: - id: "usersystembinding" - name: "UserSystemBinding" - public: true - usersystembindingsput: - type: "object" - required: - - "add" - - "remove" - properties: - add: - type: "array" - description: "The list of system ids to be added to this user." - items: - type: "string" - remove: - type: "array" - description: "The list of system ids to be removed from this user." - items: - type: "string" - title: "UserSystemBindingsPut" - x-stoplight: - id: "usersystembindingsput" - name: "UserSystemBindingsPut" - public: true - body: - type: "object" - required: - - "name" - - "networkSourceIp" - properties: - mfa: - type: "string" - enum: - - "DISABLED" - - "ENABLED" - - "REQUIRED" - - "ALWAYS" - name: - type: "string" - networkSourceIp: - type: "string" - tags: - type: "array" - items: - type: "string" - userLockoutAction: - type: "string" - userPasswordExpirationAction: - type: "string" - example: - name: "test radius" - networkSourceIp: "0.0.0.0" - tagsNames: - - "tag1" - body_1: - type: "object" - properties: - exclusion: - type: "boolean" - exclusionUntil: - type: "string" - format: "date-time" - application_config_acsUrl_tooltip_variables: - properties: - icon: - type: "string" - message: - type: "string" - example: - icon: "icon" - message: "message" - application_config_acsUrl_tooltip: - properties: - template: - type: "string" - variables: - $ref: "#/definitions/application_config_acsUrl_tooltip_variables" - example: - template: "template" - variables: - icon: "icon" - message: "message" - application_config_acsUrl: - properties: - label: - type: "string" - position: - type: "integer" - readOnly: - type: "boolean" - required: - type: "boolean" - tooltip: - $ref: "#/definitions/application_config_acsUrl_tooltip" - type: - type: "string" - value: - type: "string" - visible: - type: "boolean" - example: - visible: true - tooltip: - template: "template" - variables: - icon: "icon" - message: "message" - readOnly: true - label: "label" - position: 0 - type: "type" - value: "value" - required: true - application_config_constantAttributes_value: - properties: - name: - type: "string" - readOnly: - type: "boolean" - required: - type: "boolean" - value: - type: "string" - visible: - type: "boolean" - example: - visible: true - name: "name" - readOnly: true - value: "value" - required: true - application_config_constantAttributes: - properties: - label: - type: "string" - mutable: - type: "boolean" - position: - type: "integer" - readOnly: - type: "boolean" - required: - type: "boolean" - tooltip: - $ref: "#/definitions/application_config_acsUrl_tooltip" - type: - type: "string" - value: - type: "array" - items: - $ref: "#/definitions/application_config_constantAttributes_value" - visible: - type: "boolean" - example: - visible: true - mutable: true - tooltip: - template: "template" - variables: - icon: "icon" - message: "message" - readOnly: true - label: "label" - position: 6 - type: "type" - value: - - visible: true - name: "name" - readOnly: true - value: "value" - required: true - - visible: true - name: "name" - readOnly: true - value: "value" - required: true - required: true - application_config_databaseAttributes: - properties: - position: - type: "integer" - example: - position: 1 - application_config: - properties: - acsUrl: - $ref: "#/definitions/application_config_acsUrl" - constantAttributes: - $ref: "#/definitions/application_config_constantAttributes" - databaseAttributes: - $ref: "#/definitions/application_config_databaseAttributes" - idpCertificate: - $ref: "#/definitions/application_config_acsUrl" - idpEntityId: - $ref: "#/definitions/application_config_acsUrl" - idpPrivateKey: - $ref: "#/definitions/application_config_acsUrl" - spEntityId: - $ref: "#/definitions/application_config_acsUrl" - example: - acsUrl: - visible: true - tooltip: - template: "template" - variables: - icon: "icon" - message: "message" - readOnly: true - label: "label" - position: 0 - type: "type" - value: "value" - required: true - constantAttributes: - visible: true - mutable: true - tooltip: - template: "template" - variables: - icon: "icon" - message: "message" - readOnly: true - label: "label" - position: 6 - type: "type" - value: - - visible: true - name: "name" - readOnly: true - value: "value" - required: true - - visible: true - name: "name" - readOnly: true - value: "value" - required: true - required: true - idpCertificate: - visible: true - tooltip: - template: "template" - variables: - icon: "icon" - message: "message" - readOnly: true - label: "label" - position: 0 - type: "type" - value: "value" - required: true - spEntityId: - visible: true - tooltip: - template: "template" - variables: - icon: "icon" - message: "message" - readOnly: true - label: "label" - position: 0 - type: "type" - value: "value" - required: true - databaseAttributes: - position: 1 - idpPrivateKey: - visible: true - tooltip: - template: "template" - variables: - icon: "icon" - message: "message" - readOnly: true - label: "label" - position: 0 - type: "type" - value: "value" - required: true - idpEntityId: - visible: true - tooltip: - template: "template" - variables: - icon: "icon" - message: "message" - readOnly: true - label: "label" - position: 0 - type: "type" - value: "value" - required: true - applicationtemplate_jit: - properties: - attributes: - type: "object" - properties: {} - createOnly: - type: "boolean" - example: - createOnly: true - attributes: "{}" - commandfilereturn_results: - properties: - _id: - type: "string" - description: "The ID of the file." - destination: - type: "string" - description: "The location where the file will be stored." - name: - type: "string" - description: "The file name." - example: - destination: "destination" - name: "name" - _id: "_id" - commandresult_response_data: - properties: - exitCode: - type: "integer" - description: "The stderr output from the command that ran." - output: - type: "string" - description: "The output of the command that was executed." - example: - output: "output" - exitCode: 0 - commandresult_response: - properties: - data: - $ref: "#/definitions/commandresult_response_data" - error: - type: "string" - description: "The stderr output from the command that ran." - id: - type: "string" - description: "ID of the response." - example: - data: - output: "output" - exitCode: 0 - id: "id" - error: "error" - commandslist_results: - properties: - _id: - type: "string" - description: "The ID of the command." - command: - type: "string" - description: "The Command to execute." - commandType: - type: "string" - description: "The Command OS." - launchType: - type: "string" - description: "How the Command is executed." - listensTo: - type: "string" - name: - type: "string" - description: "The name of the Command." - organization: - type: "string" - description: "The ID of the Organization." - schedule: - type: "string" - description: "A crontab that consists of: [ (seconds) (minutes) (hours) (days\ - \ of month) (months) (weekdays) ] or [ immediate ]. If you send this as\ - \ an empty string, it will run immediately." - scheduleRepeatType: - type: "string" - description: "When the command will repeat." - trigger: - type: "string" - description: "Trigger to execute command." - example: - schedule: "schedule" - scheduleRepeatType: "scheduleRepeatType" - commandType: "commandType" - organization: "organization" - name: "name" - _id: "_id" - listensTo: "listensTo" - trigger: "trigger" - command: "command" - launchType: "launchType" - organizationslist_results: - properties: - _id: - type: "string" - description: "The ID of the organization." - displayName: - type: "string" - description: "The name of the organization." - logoUrl: - type: "string" - description: "The organization logo image URL. " - example: - displayName: "displayName" - _id: "_id" - logoUrl: "logoUrl" - system_networkInterfaces: - properties: - address: - type: "string" - family: - type: "string" - internal: - type: "boolean" - name: - type: "string" - example: - internal: true - address: "address" - name: "name" - family: "family" - system_sshdParams: - properties: - name: - type: "string" - value: - type: "string" - example: - name: "name" - value: "value" - system_systemInsights: - properties: - state: - type: "string" - enum: - - "enabled" - - "disabled" - - "deferred" - example: - state: "enabled" - systemput_agentBoundMessages: - properties: - cmd: - type: "string" - systemuserput_addresses: - properties: - country: - type: "string" - maxLength: 1024 - extendedAddress: - type: "string" - maxLength: 1024 - locality: - type: "string" - maxLength: 1024 - poBox: - type: "string" - maxLength: 1024 - postalCode: - type: "string" - maxLength: 1024 - region: - type: "string" - maxLength: 1024 - streetAddress: - type: "string" - maxLength: 1024 - type: - type: "string" - maxLength: 1024 - systemuserput_phoneNumbers: - properties: - number: - type: "string" - maxLength: 1024 - type: - type: "string" - maxLength: 1024 - systemuserputpost_addresses: - properties: - country: - type: "string" - extendedAddress: - type: "string" - locality: - type: "string" - poBox: - type: "string" - postalCode: - type: "string" - region: - type: "string" - streetAddress: - type: "string" - type: - type: "string" - systemuserputpost_phoneNumbers: - properties: - number: - type: "string" - type: - type: "string" - systemuserreturn_addresses: - properties: - country: - type: "string" - maxLength: 1024 - extendedAddress: - type: "string" - maxLength: 1024 - id: - type: "string" - locality: - type: "string" - maxLength: 1024 - poBox: - type: "string" - maxLength: 1024 - postalCode: - type: "string" - maxLength: 1024 - region: - type: "string" - maxLength: 1024 - streetAddress: - type: "string" - maxLength: 1024 - type: - type: "string" - maxLength: 1024 - example: - country: "country" - poBox: "poBox" - streetAddress: "streetAddress" - postalCode: "postalCode" - locality: "locality" - id: "id" - extendedAddress: "extendedAddress" - region: "region" - type: "type" - systemuserreturn_phoneNumbers: - properties: - id: - type: "string" - number: - type: "string" - maxLength: 1024 - type: - type: "string" - maxLength: 1024 - example: - number: "number" - id: "id" - type: "type" -parameters: - trait:fields:fields: - name: "fields" - in: "query" - description: "Use a space seperated string of field parameters to include the\ - \ data in the response. If omitted, the default list of fields will be returned.\n" - required: false - type: "string" - x-exportParamName: "Fields" - trait:filter:filter: - name: "filter" - in: "query" - description: "A filter to apply to the query." - required: false - type: "string" - x-exportParamName: "Filter" - trait:limit:limit: - name: "limit" - in: "query" - description: "The number of records to return at once. Limited to 100." - required: false - type: "integer" - default: 10 - x-exportParamName: "Limit" - trait:multiTenantRequestHeaders:x-org-id: - name: "x-org-id" - in: "header" - description: "" - required: false - type: "string" - x-exportParamName: "XOrgId" - trait:requestHeaders:Accept: - name: "Accept" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "Accept" - trait:requestHeaders:Content-Type: - name: "Content-Type" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "ContentType" - trait:search:search: - name: "search" - in: "query" - description: "A nested object containing a string `searchTerm` and a list of `fields`\ - \ to search on." - required: false - type: "string" - x-exportParamName: "Search" - trait:skip:skip: - name: "skip" - in: "query" - description: "The offset into the records to return." - required: false - type: "integer" - default: 0 - minimum: 0 - x-exportParamName: "Skip" - trait:sort:sort: - name: "sort" - in: "query" - description: "Use space separated sort parameters to sort the collection.\nDefault\ - \ sort is ascending. Prefix with `-` to sort descending.\n" - required: false - type: "string" - x-exportParamName: "Sort" - trait:systemContextAuth:Authorization: - name: "Authorization" - in: "header" - description: "Authorization header for the System Context API" - required: false - type: "string" - x-exportParamName: "Authorization" - trait:systemContextAuth:Date: - name: "Date" - in: "header" - description: "Current date header for the System Context API" - required: false - type: "string" - x-exportParamName: "Date" -responses: - trait:standardErrors:400: - description: "" - schema: - $ref: "#/definitions/errorresponse" - trait:standardErrors:401: - description: "" - schema: - $ref: "#/definitions/errorresponse" - trait:standardErrors:403: - description: "" - schema: - $ref: "#/definitions/errorresponse" - trait:standardErrors:404: - description: "" - schema: - $ref: "#/definitions/errorresponse" - trait:standardErrors:409: - description: "" - schema: - $ref: "#/definitions/errorresponse" - trait:standardErrors:500: - description: "" - schema: - $ref: "#/definitions/errorresponse" -x-stoplight: - afterScript: "" - beforeScript: "" - functions: {} - mock: - dynamic: false - enabled: false - textSections: - api-change-log: - content: "### 08-01-2018\n\n`minor release`\n- [New Get Organization endpoint](https://docs.jumpcloud.com/1.0/organizations/get-organization-details)\n\ - - [Multi-Tenant x-org-id](https://docs.jumpcloud.com/2.0/authentication-and-authorization/multi-tenant-organization-api-headers)\ - \ documentation and functionality.\n- Corrections to Command Endpoint Documentation.\n\ - - Remove ssh_keys from systemuserpost model.\n\n### 09-12-2018\n\n`minor release`\n\ - \n- X-Org-Id Request Header\n- SSH Key Models for GET / POST\n- system user\ - \ models properly reference the new ssh key models.\n- Correction to additional\ - \ ID field on Systems\n- New System User Attribute Fields and Model Updates\ - \ for System User PUT / POST / GET\n- Addition of SSH Key endpoints GET, DEL,\ - \ POST\n- New Search Organizations POST endpoint\n- Misc Text Section updates\n\ - - V1 YAML phone + address object updates" - id: "api-change-log" - name: "API Changelog" - public: true - authentication-and-authorization-overview: - content: "#### Access Your API Key\n\nTo locate your API Key:\n1. Log into the\ - \ [JumpCloud Admin Console](https://console.jumpcloud.com/)\n2. Go to the\ - \ username drop down located in the top-right of the Console.\n3. Retrieve\ - \ your API key from API Settings.\n\n#### API Key Considerations\n\nThis API\ - \ key is associated to the currently logged in administrator. Other admins\ - \ will have different API keys.\n\nPlease keep this API key secret, as it\ - \ grants full access to any data accessible via your JumpCloud console account.\n\ - \nYou can also reset your API key in the same location in the JumpCloud Admin\ - \ Console.\n\n##### Recycling or Resetting Your API Key\n\nIn order to revoke\ - \ access with the current API key, simply reset your API key. This will render\ - \ all calls using the previous API key inaccessible.\n\nFor API V1 the API\ - \ key will be passed in as a header with the header name \"x-api-key\".\n\n\ - **Example**\n```\ncurl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/systemusers\"\ - \n```" - id: "authentication-and-authorization-overview" - name: "API Key" - public: true - multi-tenant-organization-api-headers: - content: "Multi-Tenant Organization API Headers are available for JumpCloud\ - \ Admins to use when making API requests from Organizations that have multiple\ - \ managed organizations.\n\nThe `x-org-id` is a required header for all multi-tenant\ - \ admins when making API requests to Jumpcloud as this header will define\ - \ what organization you would like to make the request for.\n\nPlease note\ - \ that Single Tenant Admins do not need to provide this header when making\ - \ an API request.\n\n#### Header Value\n\n`x-org-id`\n\n#### API Response\ - \ Codes\n\n- `400` Malformed ID.\n- `400` x-org-id and Organization path ID\ - \ do not match.\n- `401` ID not included for multi-tenant admin\n- `403` ID\ - \ included on unsupported route.\n- `404` Organization ID Not Found.\n\n####\ - \ Sample Request\n```\ncurl -X GET https://console.jumpcloud.com/api/v2/directories\ - \ \\\n -H 'accept: application/json' \\\n -H 'content-type: application/json'\ - \ \\\n -H 'x-api-key: {API_KEY}' \\\n -H 'x-org-id: {ORG_ID}'\n\n```\n\n\ - #### To Obtain an Individual Organization ID via the UI\n\nAs a prerequisite\ - \ your Primary Organization will need to be setup for Multi-Tenancy which\ - \ will give you access to the Multi-Tenant Organization Admin Portal.\n\n\ - 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you\ - \ are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant\ - \ Admin Portal.\n2. From the Multi-Tenant Portal's primary navigation bar,\ - \ select the Organization you'd like to access.\n3. You will automatically\ - \ be routed to that Organization's Admin Console.\n4. Go to Settings in the\ - \ sub-tenant's primary navigation.\n5. You can obtain your Organization ID\ - \ below your Organization's Contact Information on the Settings page.\n\n\ - #### To Obtain All Organization IDs via the API\n\n1. You can make an API\ - \ request to this endpoint using the API key of your Primary Organization.\ - \ `https://console.jumpcloud.com/api/organizations/` This will return all\ - \ your managed organizations.\n\n#### Sample Request\n```\ncurl -X GET \\\n\ - \ https://console.jumpcloud.com/api/organizations/ \\\n -H 'Accept: application/json'\ - \ \\\n -H 'Content-Type: application/json' \\\n -H 'x-api-key: {API_KEY}'\n\ - \n```" - id: "multi-tenant-organization-api-headers" - name: "Multi Tenant Organization API Headers" - public: true - system-context: - content: "* [Introduction](#introduction)\n* [Supported endpoints](#supported-endpoints)\n\ - * [Response codes](#response-codes)\n* [Authentication](#authentication)\n\ - * [Additional examples](#additional-examples)\n* [Third party](#third-party)\n\ - \n### Introduction\n\nJumpCloud System Context Authorization is an alternative\ - \ way to authenticate with a subset of JumpCloud's REST APIs. Using this method\ - \ a system can manage its information and resource associations, allowing\ - \ modern auto provisioning environments to scale as needed.\n\n**Note: The\ - \ following documentation applies to Linux Operating Systems only.**\n\n###\ - \ Supported Endpoints\n\nJumpCloud System Context Authorization can be used\ - \ in conjunction with Systems endpoints found in the V1 API and certain System\ - \ Group endpoints found in the v2 API.\n\n- A system may fetch, alter, and\ - \ delete metadata about itself, including manipulating a system's Group and\ - \ Systemuser associations,\n - `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/1.0/systems/list-an-individual-system)\ - \ [`PUT`](https://docs.jumpcloud.com/1.0/systems/update-a-system)\n- A system\ - \ may delete itself from your JumpCloud organization\n - `/api/systems/{system_id}`\ - \ | [`DELETE`](https://docs.jumpcloud.com/1.0/systems/delete-a-system)\n-\ - \ A system may fetch its direct resource associations under v2 (Groups)\n\ - \ - `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/2.0/systems/list-a-systems-group-membership)\n\ - \ - `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/2.0/systems/list-associations-of-a-system)\n\ - \ - `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/2.0/systems/list-the-users-associated-with-a-system)\n\ - - A system may alter its direct resource associations under v2 (Groups)\n\ - \ - `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/2.0/systems/manage-associations-of-a-system)\n\ - - A system may alter its System Group associations\n - `/api/v2/systemgroups/{systemgroup_id}/members`\ - \ | [`POST`](https://docs.jumpcloud.com/2.0/system-groups/update-a-system-group)\n\ - \ - _NOTE_ If a system attempts to alter the system group membership of\ - \ a different system the request will be rejected\n\n\n### Response Codes\n\ - \nIf endpoints other than those described above are called using the System\ - \ Context API the server will return a `401` response.\n\n### Authentication\n\ - \nTo allow for secure access to our APIs, you must authenticate each API request.\n\ - JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00)\ - \ to authenticate API requests.\nThe HTTP Signatures sent with each request\ - \ are similar to the signatures used by the Amazon Web Services REST API.\n\ - To help with the request-signing process, we have provided an [example bash\ - \ script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh).\ - \ This example API request simply requests the entire system record. You must\ - \ be root, or have permissions to access the contents of the `/opt/jc` directory\ - \ to generate a signature.\n\n\nHere is a breakdown of the example script,\ - \ with explanations.\n\nThe first thing the script does is extract the systemKey\ - \ from the JSON formatted `/opt/jc/jcagent.conf` file.\n\n```\n#!/bin/bash\n\ - \nconf=\"`cat /opt/jc/jcagent.conf`\"\nregex=\"systemKey\\\":\\\"(\\w+)\\\"\ - \"\n\nif [[ $conf =~ $regex ]] ; then\n systemKey=\"${BASH_REMATCH[1]}\"\n\ - fi\n```\n\nThen the script retrieves the current date in the correct format.\n\ - \n```\nnow=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`;\n```\n\nNext we build\ - \ a signing string to demonstrate the expected signature format. The signed\ - \ string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35)\ - \ and the date header, separated by a newline character.\n\n```\nsignstr=\"\ - GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\"\n```\n\nThe next step\ - \ is to calculate and apply the signature. This is a two-step process:\n\n\ - 1. Create a signature from the signing string using the JumpCloud Agent private\ - \ key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key``\n\ - 1. Then Base64-encode the signature string and trim off the newline characters:\ - \ ``| openssl enc -e -a | tr -d '\\n'``\n\nThe combined steps above result\ - \ in:\n\n```\nsignature=`printf \"$signstr\" | openssl dgst -sha256 -sign\ - \ /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ;\n```\n\nFinally,\ - \ we make sure the API call sending the signature has the same Authorization\ - \ and Date header values, HTTP method, and URL that were used in the signing\ - \ string.\n\n```\ncurl -iq \\\n -H \"Accept: application/json\" \\\n -H\ - \ \"Content-Type: application/json\" \\\n -H \"Date: ${now}\" \\\n -H \"\ - Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line\ - \ date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\\ - \n --url https://console.jumpcloud.com/api/systems/${systemKey}\n```\n\n\ - #### Input Data\n\nAll PUT and POST methods should use the HTTP Content-Type\ - \ header with a value of 'application/json'. PUT methods are used for updating\ - \ a record. POST methods are used to create a record.\n\nThe following example\ - \ demonstrates how to update the `displayName` of the system.\n\n```\nsignstr=\"\ - PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\"\nsignature=`printf\ - \ \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc\ - \ -e -a | tr -d '\\n'` ;\n\ncurl -iq \\\n -d \"{\\\"displayName\\\" : \\\"\ - updated-system-name-1\\\"}\" \\\n -X \"PUT\" \\\n -H \"Content-Type: application/json\"\ - \ \\\n -H \"Accept: application/json\" \\\n -H \"Date: ${now}\" \\\n -H\ - \ \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"\ - request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\ - \"\" \\\n --url https://console.jumpcloud.com/api/systems/${systemKey}\n\ - ```\n\n\n#### Output Data\n\nAll results will be formatted as JSON.\n\nHere\ - \ is an abbreviated example of response output:\n\n```\n{\n \"__v\": 0,\n\ - \ \"_id\": \"525ee96f52e144993e000015\",\n \"agentServer\": \"lappy386\"\ - ,\n \"agentVersion\": \"0.9.42\",\n \"arch\": \"x86_64\",\n \"connectionKey\"\ - : \"127.0.0.1_51812\",\n \"displayName\": \"ubuntu-1204\",\n \"firstContact\"\ - : \"2013-10-16T19:30:55.611Z\",\n \"hostname\": \"ubuntu-1204\"\n ...\n\ - ```\n\n\n### Additional Examples\n\n#### Signing Authentication Example\n\n\ - This example demonstrates how to make an authenticated request to fetch the\ - \ JumpCloud record for this system.\n\n[SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh)\n\ - \n\n#### Shutdown Hook\n\nThis example demonstrates how to make authenticated\ - \ request on system shutdown.\nUsing an init.d script registered at run level\ - \ 0, you can call the System Context API as the system is shutting down.\n\ - \n[Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd)\ - \ is an example of an init.d script that only runs at system shutdown.\n\n\ - After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd)\ - \ script, you should install it on the system(s) running the JumpCloud agent...\n\ - \n1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd)\ - \ to `/etc/init.d/instance-shutdown`\n2. On Ubuntu systems, run `update-rc.d\ - \ instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add\ - \ instance-shutdown`\n\n\n### Third Party\n\n#### Chef Cookbooks\n\n[https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud)\n\ - \n[https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud)" - id: "system-context" - name: "System Context" - public: true - v1-api: - content: "Our existing API offers the ability to interact with some of our core\ - \ features such as: Commands, Systems, and Users. We are currently in the\ - \ process of migrating our API V1 features to [API V2](https://docs.jumpcloud.com/2.0)\ - \ Depending on your type of integration you may be required to use both V1\ - \ and V2 APIs.\n\nPlease refer to our [API V2](https://docs.jumpcloud.com/2.0)\ - \ docs to understand the functionality available in that API set.\n\n### API\ - \ SDKs\n\nYou can find language specific SDKs that can help you kickstart\ - \ your Integration with JumpCloud in the following GitHub repositories:\n\n\ - * [Python](https://github.com/TheJumpCloud/jcapi-python)\n* [Go](https://github.com/TheJumpCloud/jcapi-go)\n\ - * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby)\n* [Java](https://github.com/TheJumpCloud/jcapi-java)" - id: "v1-api" - name: "V1 API" - public: true - version: - groups: - docs: - - divider: false - items: - - _id: "v1-api" - type: "docTextSections" - - _id: "api-change-log" - type: "docTextSections" - name: "API Overview" - - description: "" - divider: false - items: - - _id: "authentication-and-authorization-overview" - type: "docTextSections" - - _id: "system-context" - type: "docTextSections" - - _id: "multi-tenant-organization-api-headers" - type: "docTextSections" - name: "Authentication & Authorization" - - divider: false - items: - - _id: "application_templates_list" - type: "endpoints" - - _id: "application_templates_get" - type: "endpoints" - name: "Application Templates" - - description: "The Applications endpoint is use to create and modify your SSO\ - \ Applications in JumpCloud. It's recommended to use the Console UI to setup\ - \ your SSO Applications." - divider: false - items: - - _id: "applications_list" - type: "endpoints" - - _id: "applications_get" - type: "endpoints" - - _id: "applications_post" - type: "endpoints" - - _id: "applications_put" - type: "endpoints" - - _id: "applications_delete" - type: "endpoints" - name: "Applications" - - description: "The Triggers section of the JumpCloud API allows you to use\ - \ a webhook to launch a command or a workflow. When JumpCloud receives a\ - \ webhook containing the trigger name, JumpCloud will automatically execute\ - \ any command(s) with that trigger name, in parallel, across all the servers\ - \ defined in the saved commands.\n\nTriggers can be executed solely with\ - \ a trigger name (the name you provide in the \"Trigger Name:\" field when\ - \ you set a Command to \"Run on Trigger (webhook)\", or you can post a JSON\ - \ object in the POST body, and all top level string or numeric objects in\ - \ the JSON object will be sent to the command as environment variables.\n\ - \nFor example, posting:\n```\n{\n \"srcip\": \"192.168.1.32\",\n \"\ - attack\": \"Attempted Cross-Site Request Forgery\"\n}\n```\nwill generate\ - \ the following environment variables for the started command:\n```\nsrcip=\"\ - 192.168.1.32\"\nattack=\"Attempted Cross-Site Request Forgery\"\nBecause\ - \ sub-objects and arrays are not stringified before being passed to the\ - \ command, the command will see the environment variables set to \"[object\ - \ Object]\" in these cases.\n```" - divider: false - items: - - _id: "command_trigger_webhook_post" - type: "endpoints" - name: "Command Triggers" - - description: "The Command Scheduler can be used to run commands across your\ - \ systems/tags either immediately, at a specific time in the future, or\ - \ repeatedly. Please note that systems OR tags is a required field. Setting\ - \ both is unsupported. You can retrieve the results by using the Command\ - \ Results API." - divider: false - items: - - _id: "commands_list" - type: "endpoints" - - _id: "commands_get" - type: "endpoints" - - _id: "commands_post" - type: "endpoints" - - _id: "commands_delete" - type: "endpoints" - - _id: "command_file_get" - type: "endpoints" - - _id: "commands_put" - type: "endpoints" - name: "Commands" - - description: "The Command Results section of the JumpCloud API allows you\ - \ to retrieve and delete the results of commands that you ran on your system\ - \ through JumpCloud. None of the properties are modifiable, but you can\ - \ delete records." - divider: false - items: - - _id: "command_results_list" - type: "endpoints" - - _id: "command_results_get" - type: "endpoints" - - _id: "command_results_delete" - type: "endpoints" - name: "Command Results" - - description: "You can obtain information about your JumpCloud Organization(s)." - divider: false - items: - - _id: "organization_list" - type: "endpoints" - name: "Organizations" - - divider: false - items: - - _id: "radius_servers_list" - type: "endpoints" - - _id: "radius_servers_post" - type: "endpoints" - - _id: "radius_servers_put" - type: "endpoints" - name: "Radius Servers" - - items: - - _id: "search_organizations_post" - type: "endpoints" - - _id: "search_systems_post" - type: "endpoints" - - _id: "search_systemusers_post" - type: "endpoints" - name: "Search" - - description: "The System Users section of the JumpCloud API allows you to\ - \ add, retrieve, delete, and modify System Users. To add a System User to\ - \ JumpCloud, you must provide an email address and username. The System\ - \ Users email will be used to contact the new System User, allowing them\ - \ to be activated. During activation, the user will prompted to set their\ - \ password, an SSH public key, and to set up Google Authenticator for Multi-factor\ - \ authentication.\n\nAdding a new System User will not grant them access\ - \ to servers until they're associated to a Tag, and a System User can be\ - \ assigned to a Tag as soon as they're created. However, they will not gain\ - \ access to any servers until they have activated." - divider: false - items: - - _id: "systems_list" - type: "endpoints" - - _id: "systems_get" - type: "endpoints" - - _id: "systems_put" - type: "endpoints" - - _id: "systems_delete" - type: "endpoints" - - _id: "systems_systemusers_binding_list" - type: "endpoints" - - _id: "systems_systemusers_binding_put" - type: "endpoints" - name: "Systems" - - description: "The System Users section of the JumpCloud API allows you to\ - \ add, retrieve, delete, and modify System Users. To add a System User to\ - \ JumpCloud, you must provide an email address and username. The System\ - \ Users email will be used to contact the new System User, allowing them\ - \ to be activated. During activation, the user will prompted to set their\ - \ password, an SSH public key, and to set up Google Authenticator for Multi-factor\ - \ authentication.\n\nAdding a new System User will not grant them access\ - \ to servers until they're associated to a Tag, and a System User can be\ - \ assigned to a Tag as soon as they're created. However, they will not gain\ - \ access to any servers until they have activated." - divider: false - items: - - _id: "systemusers_list" - type: "endpoints" - - _id: "systemusers_get" - type: "endpoints" - - _id: "systemusers_systems_binding_list" - type: "endpoints" - - _id: "systemusers_systems_binding_put" - type: "endpoints" - - _id: "systemusers_post" - type: "endpoints" - - _id: "systemusers_put" - type: "endpoints" - - _id: "systemusers_delete" - type: "endpoints" - - _id: "systemusers_resetmfa" - type: "endpoints" - - _id: "sshkey_list" - type: "endpoints" - - _id: "sshkey_post" - type: "endpoints" - - _id: "sshkey_delete" - type: "endpoints" - - _id: "systemusers_unlock" - type: "endpoints" - name: "Systemusers" - - description: "The Tags section of the JumpCloud API allows you to add, retrieve,\ - \ delete, and modify Tags. Tags are used to associate system users to systems,\ - \ and to create groups of systems for easy management in the Commands tab.\ - \ For example, if you have user \"jsmith\" and a system both associated\ - \ to the same Tag, then the system user \"jsmith\" will be able to login\ - \ to that system. If either the system or \"jsmith\" are removed from the\ - \ Tag, \"jsmith\" will no longer have access to that system.\n\nFor more\ - \ information about tags see: [How to Use Tags](https://support.jumpcloud.com/customer/portal/articles/2449137-getting-started-tags)" - divider: false - items: - - _id: "tags_list" - type: "endpoints" - - _id: "tags_get" - type: "endpoints" - - _id: "tags_post" - type: "endpoints" - - _id: "tags_put" - type: "endpoints" - - _id: "tags_delete" - type: "endpoints" - name: "Tags" - - description: "Models make up the core input and output structures in this\ - \ API. They are used in endpoint request and response bodies." - divider: false - items: - - _id: "application" - type: "schemas" - - _id: "applicationslist" - type: "schemas" - - _id: "applicationtemplate" - type: "schemas" - - _id: "applicationtemplateslist" - type: "schemas" - - _id: "command" - type: "schemas" - - _id: "commandfilereturn" - type: "schemas" - - _id: "commandresult" - type: "schemas" - - _id: "commandresultslist" - type: "schemas" - - _id: "commandslist" - type: "schemas" - - _id: "fde" - type: "schemas" - - _id: "organizationslist" - type: "schemas" - - _id: "radiusserver" - type: "schemas" - - _id: "radiusserverpost" - type: "schemas" - - _id: "radiusserverput" - type: "schemas" - - _id: "radiusserverslist" - type: "schemas" - - _id: "search" - type: "schemas" - - _id: "sshkeypost" - type: "schemas" - - _id: "system" - type: "schemas" - - _id: "systemput" - type: "schemas" - - _id: "systemslist" - type: "schemas" - - _id: "systemuserbinding" - type: "schemas" - - _id: "systemuserbindingsput" - type: "schemas" - - _id: "systemuserput" - type: "schemas" - - _id: "systemuserreturn" - type: "schemas" - - _id: "systemuserslist" - type: "schemas" - - _id: "ddrZmggZ983Ray45n" - type: "schemas" - - _id: "tag" - type: "schemas" - - _id: "tagpost" - type: "schemas" - - _id: "tagput" - type: "schemas" - - _id: "tagslist" - type: "schemas" - - _id: "usersystembinding" - type: "schemas" - - _id: "usersystembindingsput" - type: "schemas" - name: "Models" - - description: "Traits describe common behaviors or structures in this API." - items: - - _id: "fields" - type: "traits" - - _id: "filter" - type: "traits" - - _id: "limit" - type: "traits" - - _id: "multiTenantRequestHeaders" - type: "traits" - - _id: "requestHeaders" - type: "traits" - - _id: "search" - type: "traits" - - _id: "skip" - type: "traits" - - _id: "sort" - type: "traits" - - _id: "systemContextAuth" - type: "traits" - name: "Traits" - savedEntries: [] - tests: [] - traits: [] - utilFuncs: [] -x-tests: {} diff --git a/v1/api_client.go b/v1/api_client.go deleted file mode 100644 index 0150809..0000000 --- a/v1/api_client.go +++ /dev/null @@ -1,448 +0,0 @@ -/* - * JumpCloud APIs - * - * JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, & system users. - * - * API version: 1.0 - * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) - */ - -package v1 - -import ( - "bytes" - "encoding/json" - "encoding/xml" - "fmt" - "errors" - "io" - "mime/multipart" - "golang.org/x/oauth2" - "golang.org/x/net/context" - "net/http" - "net/url" - "time" - "os" - "path/filepath" - "reflect" - "regexp" - "strings" - "unicode/utf8" - "strconv" -) - -var ( - jsonCheck = regexp.MustCompile("(?i:[application|text]/json)") - xmlCheck = regexp.MustCompile("(?i:[application|text]/xml)") -) - -// APIClient manages communication with the JumpCloud APIs API v1.0 -// In most cases there should be only one, shared, APIClient. -type APIClient struct { - cfg *Configuration - common service // Reuse a single struct instead of allocating one for each service on the heap. - - // API Services - ApplicationTemplatesApi *ApplicationTemplatesApiService - ApplicationsApi *ApplicationsApiService - CommandResultsApi *CommandResultsApiService - CommandTriggersApi *CommandTriggersApiService - CommandsApi *CommandsApiService - OrganizationsApi *OrganizationsApiService - RadiusServersApi *RadiusServersApiService - SearchApi *SearchApiService - SystemsApi *SystemsApiService - SystemusersApi *SystemusersApiService - TagsApi *TagsApiService -} - -type service struct { - client *APIClient -} - -// NewAPIClient creates a new API client. Requires a userAgent string describing your application. -// optionally a custom http.Client to allow for advanced features such as caching. -func NewAPIClient(cfg *Configuration) *APIClient { - if cfg.HTTPClient == nil { - cfg.HTTPClient = http.DefaultClient - } - - c := &APIClient{} - c.cfg = cfg - c.common.client = c - - // API Services - c.ApplicationTemplatesApi = (*ApplicationTemplatesApiService)(&c.common) - c.ApplicationsApi = (*ApplicationsApiService)(&c.common) - c.CommandResultsApi = (*CommandResultsApiService)(&c.common) - c.CommandTriggersApi = (*CommandTriggersApiService)(&c.common) - c.CommandsApi = (*CommandsApiService)(&c.common) - c.OrganizationsApi = (*OrganizationsApiService)(&c.common) - c.RadiusServersApi = (*RadiusServersApiService)(&c.common) - c.SearchApi = (*SearchApiService)(&c.common) - c.SystemsApi = (*SystemsApiService)(&c.common) - c.SystemusersApi = (*SystemusersApiService)(&c.common) - c.TagsApi = (*TagsApiService)(&c.common) - - return c -} - -func atoi(in string) (int, error) { - return strconv.Atoi(in) -} - - -// selectHeaderContentType select a content type from the available list. -func selectHeaderContentType(contentTypes []string) string { - if len(contentTypes) == 0 { - return "" - } - if contains(contentTypes, "application/json") { - return "application/json" - } - return contentTypes[0] // use the first content type specified in 'consumes' -} - -// selectHeaderAccept join all accept types and return -func selectHeaderAccept(accepts []string) string { - if len(accepts) == 0 { - return "" - } - - if contains(accepts, "application/json") { - return "application/json" - } - - return strings.Join(accepts, ",") -} - -// contains is a case insenstive match, finding needle in a haystack -func contains(haystack []string, needle string) bool { - for _, a := range haystack { - if strings.ToLower(a) == strings.ToLower(needle) { - return true - } - } - return false -} - -// Verify optional parameters are of the correct type. -func typeCheckParameter(obj interface{}, expected string, name string) error { - // Make sure there is an object. - if obj == nil { - return nil - } - - // Check the type is as expected. - if reflect.TypeOf(obj).String() != expected { - return fmt.Errorf("Expected %s to be of type %s but received %s.", name, expected, reflect.TypeOf(obj).String()) - } - return nil -} - -// parameterToString convert interface{} parameters to string, using a delimiter if format is provided. -func parameterToString(obj interface{}, collectionFormat string) string { - var delimiter string - - switch collectionFormat { - case "pipes": - delimiter = "|" - case "ssv": - delimiter = " " - case "tsv": - delimiter = "\t" - case "csv": - delimiter = "," - } - - if reflect.TypeOf(obj).Kind() == reflect.Slice { - return strings.Trim(strings.Replace(fmt.Sprint(obj), " ", delimiter, -1), "[]") - } - - return fmt.Sprintf("%v", obj) -} - -// callAPI do the request. -func (c *APIClient) callAPI(request *http.Request) (*http.Response, error) { - return c.cfg.HTTPClient.Do(request) -} - -// Change base path to allow switching to mocks -func (c *APIClient) ChangeBasePath (path string) { - c.cfg.BasePath = path -} - -// prepareRequest build the request -func (c *APIClient) prepareRequest ( - ctx context.Context, - path string, method string, - postBody interface{}, - headerParams map[string]string, - queryParams url.Values, - formParams url.Values, - fileName string, - fileBytes []byte) (localVarRequest *http.Request, err error) { - - var body *bytes.Buffer - - // Detect postBody type and post. - if postBody != nil { - contentType := headerParams["Content-Type"] - if contentType == "" { - contentType = detectContentType(postBody) - headerParams["Content-Type"] = contentType - } - - body, err = setBody(postBody, contentType) - if err != nil { - return nil, err - } - } - - // add form parameters and file if available. - if len(formParams) > 0 || (len(fileBytes) > 0 && fileName != "") { - if body != nil { - return nil, errors.New("Cannot specify postBody and multipart form at the same time.") - } - body = &bytes.Buffer{} - w := multipart.NewWriter(body) - - for k, v := range formParams { - for _, iv := range v { - if strings.HasPrefix(k, "@") { // file - err = addFile(w, k[1:], iv) - if err != nil { - return nil, err - } - } else { // form value - w.WriteField(k, iv) - } - } - } - if len(fileBytes) > 0 && fileName != "" { - w.Boundary() - //_, fileNm := filepath.Split(fileName) - part, err := w.CreateFormFile("file", filepath.Base(fileName)) - if err != nil { - return nil, err - } - _, err = part.Write(fileBytes) - if err != nil { - return nil, err - } - // Set the Boundary in the Content-Type - headerParams["Content-Type"] = w.FormDataContentType() - } - - // Set Content-Length - headerParams["Content-Length"] = fmt.Sprintf("%d", body.Len()) - w.Close() - } - - // Setup path and query parameters - url, err := url.Parse(path) - if err != nil { - return nil, err - } - - // Adding Query Param - query := url.Query() - for k, v := range queryParams { - for _, iv := range v { - query.Add(k, iv) - } - } - - // Encode the parameters. - url.RawQuery = query.Encode() - - // Generate a new request - if body != nil { - localVarRequest, err = http.NewRequest(method, url.String(), body) - } else { - localVarRequest, err = http.NewRequest(method, url.String(), nil) - } - if err != nil { - return nil, err - } - - // add header parameters, if any - if len(headerParams) > 0 { - headers := http.Header{} - for h, v := range headerParams { - headers.Set(h, v) - } - localVarRequest.Header = headers - } - - // Override request host, if applicable - if c.cfg.Host != "" { - localVarRequest.Host = c.cfg.Host - } - - // Add the user agent to the request. - localVarRequest.Header.Add("User-Agent", c.cfg.UserAgent) - - - if ctx != nil { - // add context to the request - localVarRequest = localVarRequest.WithContext(ctx) - - // Walk through any authentication. - - // OAuth2 authentication - if tok, ok := ctx.Value(ContextOAuth2).(oauth2.TokenSource); ok { - // We were able to grab an oauth2 token from the context - var latestToken *oauth2.Token - if latestToken, err = tok.Token(); err != nil { - return nil, err - } - - latestToken.SetAuthHeader(localVarRequest) - } - - // Basic HTTP Authentication - if auth, ok := ctx.Value(ContextBasicAuth).(BasicAuth); ok { - localVarRequest.SetBasicAuth(auth.UserName, auth.Password) - } - - // AccessToken Authentication - if auth, ok := ctx.Value(ContextAccessToken).(string); ok { - localVarRequest.Header.Add("Authorization", "Bearer " + auth) - } - } - - for header, value := range c.cfg.DefaultHeader { - localVarRequest.Header.Add(header, value) - } - - return localVarRequest, nil -} - - -// Add a file to the multipart request -func addFile(w *multipart.Writer, fieldName, path string) error { - file, err := os.Open(path) - if err != nil { - return err - } - defer file.Close() - - part, err := w.CreateFormFile(fieldName, filepath.Base(path)) - if err != nil { - return err - } - _, err = io.Copy(part, file) - - return err -} - -// Prevent trying to import "fmt" -func reportError(format string, a ...interface{}) (error) { - return fmt.Errorf(format, a...) -} - -// Set request body from an interface{} -func setBody(body interface{}, contentType string) (bodyBuf *bytes.Buffer, err error) { - if bodyBuf == nil { - bodyBuf = &bytes.Buffer{} - } - - if reader, ok := body.(io.Reader); ok { - _, err = bodyBuf.ReadFrom(reader) - } else if b, ok := body.([]byte); ok { - _, err = bodyBuf.Write(b) - } else if s, ok := body.(string); ok { - _, err = bodyBuf.WriteString(s) - } else if jsonCheck.MatchString(contentType) { - err = json.NewEncoder(bodyBuf).Encode(body) - } else if xmlCheck.MatchString(contentType) { - xml.NewEncoder(bodyBuf).Encode(body) - } - - if err != nil { - return nil, err - } - - if bodyBuf.Len() == 0 { - err = fmt.Errorf("Invalid body type %s\n", contentType) - return nil, err - } - return bodyBuf, nil -} - -// detectContentType method is used to figure out `Request.Body` content type for request header -func detectContentType(body interface{}) string { - contentType := "text/plain; charset=utf-8" - kind := reflect.TypeOf(body).Kind() - - switch kind { - case reflect.Struct, reflect.Map, reflect.Ptr: - contentType = "application/json; charset=utf-8" - case reflect.String: - contentType = "text/plain; charset=utf-8" - default: - if b, ok := body.([]byte); ok { - contentType = http.DetectContentType(b) - } else if kind == reflect.Slice { - contentType = "application/json; charset=utf-8" - } - } - - return contentType -} - - -// Ripped from https://github.com/gregjones/httpcache/blob/master/httpcache.go -type cacheControl map[string]string - -func parseCacheControl(headers http.Header) cacheControl { - cc := cacheControl{} - ccHeader := headers.Get("Cache-Control") - for _, part := range strings.Split(ccHeader, ",") { - part = strings.Trim(part, " ") - if part == "" { - continue - } - if strings.ContainsRune(part, '=') { - keyval := strings.Split(part, "=") - cc[strings.Trim(keyval[0], " ")] = strings.Trim(keyval[1], ",") - } else { - cc[part] = "" - } - } - return cc -} - -// CacheExpires helper function to determine remaining time before repeating a request. -func CacheExpires(r *http.Response) (time.Time) { - // Figure out when the cache expires. - var expires time.Time - now, err := time.Parse(time.RFC1123, r.Header.Get("date")) - if err != nil { - return time.Now() - } - respCacheControl := parseCacheControl(r.Header) - - if maxAge, ok := respCacheControl["max-age"]; ok { - lifetime, err := time.ParseDuration(maxAge + "s") - if err != nil { - expires = now - } - expires = now.Add(lifetime) - } else { - expiresHeader := r.Header.Get("Expires") - if expiresHeader != "" { - expires, err = time.Parse(time.RFC1123, expiresHeader) - if err != nil { - expires = now - } - } - } - return expires -} - -func strlen(s string) (int) { - return utf8.RuneCountInString(s) -} - diff --git a/v1/api_response.go b/v1/api_response.go deleted file mode 100644 index cb69e30..0000000 --- a/v1/api_response.go +++ /dev/null @@ -1,43 +0,0 @@ -/* - * JumpCloud APIs - * - * JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, & system users. - * - * API version: 1.0 - * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) - */ - -package v1 - -import ( - "net/http" -) - -type APIResponse struct { - *http.Response `json:"-"` - Message string `json:"message,omitempty"` - // Operation is the name of the swagger operation. - Operation string `json:"operation,omitempty"` - // RequestURL is the request URL. This value is always available, even if the - // embedded *http.Response is nil. - RequestURL string `json:"url,omitempty"` - // Method is the HTTP method used for the request. This value is always - // available, even if the embedded *http.Response is nil. - Method string `json:"method,omitempty"` - // Payload holds the contents of the response body (which may be nil or empty). - // This is provided here as the raw response.Body() reader will have already - // been drained. - Payload []byte `json:"-"` -} - -func NewAPIResponse(r *http.Response) *APIResponse { - - response := &APIResponse{Response: r} - return response -} - -func NewAPIResponseWithError(errorMessage string) *APIResponse { - - response := &APIResponse{Message: errorMessage} - return response -} diff --git a/v1/application.go b/v1/application.go deleted file mode 100644 index 3ee74f0..0000000 --- a/v1/application.go +++ /dev/null @@ -1,31 +0,0 @@ -/* - * JumpCloud APIs - * - * JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, & system users. - * - * API version: 1.0 - * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) - */ - -package v1 - -type Application struct { - - Id string `json:"_id,omitempty"` - - Beta bool `json:"beta,omitempty"` - - Config *ApplicationConfig `json:"config,omitempty"` - - DisplayLabel string `json:"displayLabel,omitempty"` - - DisplayName string `json:"displayName,omitempty"` - - LearnMore string `json:"learnMore,omitempty"` - - Name string `json:"name,omitempty"` - - Organization string `json:"organization,omitempty"` - - SsoUrl string `json:"ssoUrl,omitempty"` -} diff --git a/v1/application_config.go b/v1/application_config.go deleted file mode 100644 index da33cab..0000000 --- a/v1/application_config.go +++ /dev/null @@ -1,27 +0,0 @@ -/* - * JumpCloud APIs - * - * JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, & system users. - * - * API version: 1.0 - * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) - */ - -package v1 - -type ApplicationConfig struct { - - AcsUrl *ApplicationConfigAcsUrl `json:"acsUrl,omitempty"` - - ConstantAttributes *ApplicationConfigConstantAttributes `json:"constantAttributes,omitempty"` - - DatabaseAttributes *ApplicationConfigDatabaseAttributes `json:"databaseAttributes,omitempty"` - - IdpCertificate *ApplicationConfigAcsUrl `json:"idpCertificate,omitempty"` - - IdpEntityId *ApplicationConfigAcsUrl `json:"idpEntityId,omitempty"` - - IdpPrivateKey *ApplicationConfigAcsUrl `json:"idpPrivateKey,omitempty"` - - SpEntityId *ApplicationConfigAcsUrl `json:"spEntityId,omitempty"` -} diff --git a/v1/application_config_acs_url.go b/v1/application_config_acs_url.go deleted file mode 100644 index 7dca2f7..0000000 --- a/v1/application_config_acs_url.go +++ /dev/null @@ -1,29 +0,0 @@ -/* - * JumpCloud APIs - * - * JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, & system users. - * - * API version: 1.0 - * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) - */ - -package v1 - -type ApplicationConfigAcsUrl struct { - - Label string `json:"label,omitempty"` - - Position int32 `json:"position,omitempty"` - - ReadOnly bool `json:"readOnly,omitempty"` - - Required bool `json:"required,omitempty"` - - Tooltip *ApplicationConfigAcsUrlTooltip `json:"tooltip,omitempty"` - - Type_ string `json:"type,omitempty"` - - Value string `json:"value,omitempty"` - - Visible bool `json:"visible,omitempty"` -} diff --git a/v1/application_config_acs_url_tooltip.go b/v1/application_config_acs_url_tooltip.go deleted file mode 100644 index 4cf5f33..0000000 --- a/v1/application_config_acs_url_tooltip.go +++ /dev/null @@ -1,17 +0,0 @@ -/* - * JumpCloud APIs - * - * JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, & system users. - * - * API version: 1.0 - * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) - */ - -package v1 - -type ApplicationConfigAcsUrlTooltip struct { - - Template string `json:"template,omitempty"` - - Variables *ApplicationConfigAcsUrlTooltipVariables `json:"variables,omitempty"` -} diff --git a/v1/application_config_acs_url_tooltip_variables.go b/v1/application_config_acs_url_tooltip_variables.go deleted file mode 100644 index 778b088..0000000 --- a/v1/application_config_acs_url_tooltip_variables.go +++ /dev/null @@ -1,17 +0,0 @@ -/* - * JumpCloud APIs - * - * JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, & system users. - * - * API version: 1.0 - * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) - */ - -package v1 - -type ApplicationConfigAcsUrlTooltipVariables struct { - - Icon string `json:"icon,omitempty"` - - Message string `json:"message,omitempty"` -} diff --git a/v1/application_config_constant_attributes.go b/v1/application_config_constant_attributes.go deleted file mode 100644 index 99ef580..0000000 --- a/v1/application_config_constant_attributes.go +++ /dev/null @@ -1,31 +0,0 @@ -/* - * JumpCloud APIs - * - * JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, & system users. - * - * API version: 1.0 - * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) - */ - -package v1 - -type ApplicationConfigConstantAttributes struct { - - Label string `json:"label,omitempty"` - - Mutable bool `json:"mutable,omitempty"` - - Position int32 `json:"position,omitempty"` - - ReadOnly bool `json:"readOnly,omitempty"` - - Required bool `json:"required,omitempty"` - - Tooltip *ApplicationConfigAcsUrlTooltip `json:"tooltip,omitempty"` - - Type_ string `json:"type,omitempty"` - - Value []ApplicationConfigConstantAttributesValue `json:"value,omitempty"` - - Visible bool `json:"visible,omitempty"` -} diff --git a/v1/application_config_constant_attributes_value.go b/v1/application_config_constant_attributes_value.go deleted file mode 100644 index a2124a7..0000000 --- a/v1/application_config_constant_attributes_value.go +++ /dev/null @@ -1,23 +0,0 @@ -/* - * JumpCloud APIs - * - * JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, & system users. - * - * API version: 1.0 - * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) - */ - -package v1 - -type ApplicationConfigConstantAttributesValue struct { - - Name string `json:"name,omitempty"` - - ReadOnly bool `json:"readOnly,omitempty"` - - Required bool `json:"required,omitempty"` - - Value string `json:"value,omitempty"` - - Visible bool `json:"visible,omitempty"` -} diff --git a/v1/application_config_database_attributes.go b/v1/application_config_database_attributes.go deleted file mode 100644 index 9371ed2..0000000 --- a/v1/application_config_database_attributes.go +++ /dev/null @@ -1,15 +0,0 @@ -/* - * JumpCloud APIs - * - * JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, & system users. - * - * API version: 1.0 - * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) - */ - -package v1 - -type ApplicationConfigDatabaseAttributes struct { - - Position int32 `json:"position,omitempty"` -} diff --git a/v1/application_templates_api.go b/v1/application_templates_api.go deleted file mode 100644 index 58313ae..0000000 --- a/v1/application_templates_api.go +++ /dev/null @@ -1,275 +0,0 @@ -/* - * JumpCloud APIs - * - * JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, & system users. - * - * API version: 1.0 - * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) - */ - -package v1 - -import ( - "io/ioutil" - "net/url" - "net/http" - "strings" - "golang.org/x/net/context" - "encoding/json" - "fmt" -) - -// Linger please -var ( - _ context.Context -) - -type ApplicationTemplatesApiService service - - -/* ApplicationTemplatesApiService Get an Application Template - The endpoint returns a specific SSO / SAML Application Template. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/application-templates/{id} \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - * @param ctx context.Context for authentication, logging, tracing, etc. - @param id - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "fields" (string) The comma separated fields included in the returned records. If omitted the default list of fields will be returned. - @param "limit" (int32) The number of records to return at once. - @param "skip" (int32) The offset into the records to return. - @param "sort" (string) - @param "filter" (string) A filter to apply to the query. - @param "xOrgId" (string) - @return Applicationtemplate*/ -func (a *ApplicationTemplatesApiService) ApplicationTemplatesGet(ctx context.Context, id string, contentType string, accept string, localVarOptionals map[string]interface{}) (Applicationtemplate, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload Applicationtemplate - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/application-templates/{id}" - localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["fields"], "string", "fields"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["limit"], "int32", "limit"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["skip"], "int32", "skip"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["sort"], "string", "sort"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["filter"], "string", "filter"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return successPayload, nil, err - } - - if localVarTempParam, localVarOk := localVarOptionals["fields"].(string); localVarOk { - localVarQueryParams.Add("fields", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["limit"].(int32); localVarOk { - localVarQueryParams.Add("limit", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["skip"].(int32); localVarOk { - localVarQueryParams.Add("skip", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["sort"].(string); localVarOk { - localVarQueryParams.Add("sort", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["filter"].(string); localVarOk { - localVarQueryParams.Add("filter", parameterToString(localVarTempParam, "")) - } - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* ApplicationTemplatesApiService List Application Templates - The endpoint returns all the SSO / SAML Application Templates. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/application-templates \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - * @param ctx context.Context for authentication, logging, tracing, etc. - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "fields" (string) The comma separated fields included in the returned records. If omitted the default list of fields will be returned. - @param "limit" (int32) The number of records to return at once. - @param "skip" (int32) The offset into the records to return. - @param "sort" (string) - @param "filter" (string) A filter to apply to the query. - @param "xOrgId" (string) - @return Applicationtemplateslist*/ -func (a *ApplicationTemplatesApiService) ApplicationTemplatesList(ctx context.Context, contentType string, accept string, localVarOptionals map[string]interface{}) (Applicationtemplateslist, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload Applicationtemplateslist - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/application-templates" - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["fields"], "string", "fields"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["limit"], "int32", "limit"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["skip"], "int32", "skip"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["sort"], "string", "sort"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["filter"], "string", "filter"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return successPayload, nil, err - } - - if localVarTempParam, localVarOk := localVarOptionals["fields"].(string); localVarOk { - localVarQueryParams.Add("fields", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["limit"].(int32); localVarOk { - localVarQueryParams.Add("limit", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["skip"].(int32); localVarOk { - localVarQueryParams.Add("skip", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["sort"].(string); localVarOk { - localVarQueryParams.Add("sort", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["filter"].(string); localVarOk { - localVarQueryParams.Add("filter", parameterToString(localVarTempParam, "")) - } - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - diff --git a/v1/applications_api.go b/v1/applications_api.go deleted file mode 100644 index f73d35b..0000000 --- a/v1/applications_api.go +++ /dev/null @@ -1,555 +0,0 @@ -/* - * JumpCloud APIs - * - * JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, & system users. - * - * API version: 1.0 - * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) - */ - -package v1 - -import ( - "io/ioutil" - "net/url" - "net/http" - "strings" - "golang.org/x/net/context" - "encoding/json" - "fmt" -) - -// Linger please -var ( - _ context.Context -) - -type ApplicationsApiService service - - -/* ApplicationsApiService Delete an Application - The endpoint deletes an SSO / SAML Application. - * @param ctx context.Context for authentication, logging, tracing, etc. - @param id - @param optional (nil or map[string]interface{}) with one or more of: - @param "contentType" (string) - @param "accept" (string) - @param "xOrgId" (string) - @return Application*/ -func (a *ApplicationsApiService) ApplicationsDelete(ctx context.Context, id string, localVarOptionals map[string]interface{}) (Application, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Delete") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload Application - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/applications/{id}" - localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["contentType"], "string", "contentType"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["accept"], "string", "accept"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return successPayload, nil, err - } - - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - if localVarTempParam, localVarOk := localVarOptionals["contentType"].(string); localVarOk { - localVarHeaderParams["Content-Type"] = parameterToString(localVarTempParam, "") - } - if localVarTempParam, localVarOk := localVarOptionals["accept"].(string); localVarOk { - localVarHeaderParams["Accept"] = parameterToString(localVarTempParam, "") - } - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* ApplicationsApiService Get an Application - The endpoint retrieves an SSO / SAML Application. - * @param ctx context.Context for authentication, logging, tracing, etc. - @param id - @param optional (nil or map[string]interface{}) with one or more of: - @param "contentType" (string) - @param "accept" (string) - @param "xOrgId" (string) - @return Application*/ -func (a *ApplicationsApiService) ApplicationsGet(ctx context.Context, id string, localVarOptionals map[string]interface{}) (Application, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload Application - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/applications/{id}" - localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["contentType"], "string", "contentType"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["accept"], "string", "accept"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return successPayload, nil, err - } - - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - if localVarTempParam, localVarOk := localVarOptionals["contentType"].(string); localVarOk { - localVarHeaderParams["Content-Type"] = parameterToString(localVarTempParam, "") - } - if localVarTempParam, localVarOk := localVarOptionals["accept"].(string); localVarOk { - localVarHeaderParams["Accept"] = parameterToString(localVarTempParam, "") - } - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* ApplicationsApiService Applications - The endpoint returns all your SSO / SAML Applications. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/applications \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - * @param ctx context.Context for authentication, logging, tracing, etc. - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "fields" (string) The comma separated fields included in the returned records. If omitted the default list of fields will be returned. - @param "limit" (int32) The number of records to return at once. - @param "skip" (int32) The offset into the records to return. - @param "sort" (string) - @param "filter" (string) A filter to apply to the query. - @param "xOrgId" (string) - @return Applicationslist*/ -func (a *ApplicationsApiService) ApplicationsList(ctx context.Context, contentType string, accept string, localVarOptionals map[string]interface{}) (Applicationslist, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload Applicationslist - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/applications" - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["fields"], "string", "fields"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["limit"], "int32", "limit"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["skip"], "int32", "skip"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["sort"], "string", "sort"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["filter"], "string", "filter"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return successPayload, nil, err - } - - if localVarTempParam, localVarOk := localVarOptionals["fields"].(string); localVarOk { - localVarQueryParams.Add("fields", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["limit"].(int32); localVarOk { - localVarQueryParams.Add("limit", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["skip"].(int32); localVarOk { - localVarQueryParams.Add("skip", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["sort"].(string); localVarOk { - localVarQueryParams.Add("sort", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["filter"].(string); localVarOk { - localVarQueryParams.Add("filter", parameterToString(localVarTempParam, "")) - } - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* ApplicationsApiService Create an Application - The endpoint adds a new SSO / SAML Applications. - * @param ctx context.Context for authentication, logging, tracing, etc. - @param optional (nil or map[string]interface{}) with one or more of: - @param "body" (Application) - @param "contentType" (string) - @param "accept" (string) - @param "xOrgId" (string) - @return Application*/ -func (a *ApplicationsApiService) ApplicationsPost(ctx context.Context, localVarOptionals map[string]interface{}) (Application, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Post") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload Application - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/applications" - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["contentType"], "string", "contentType"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["accept"], "string", "accept"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return successPayload, nil, err - } - - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - if localVarTempParam, localVarOk := localVarOptionals["contentType"].(string); localVarOk { - localVarHeaderParams["Content-Type"] = parameterToString(localVarTempParam, "") - } - if localVarTempParam, localVarOk := localVarOptionals["accept"].(string); localVarOk { - localVarHeaderParams["Accept"] = parameterToString(localVarTempParam, "") - } - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - // body params - if localVarTempParam, localVarOk := localVarOptionals["body"].(Application); localVarOk { - localVarPostBody = &localVarTempParam - } - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* ApplicationsApiService Update an Application - The endpoint updates a SSO / SAML Application. - * @param ctx context.Context for authentication, logging, tracing, etc. - @param id - @param optional (nil or map[string]interface{}) with one or more of: - @param "body" (Application) - @param "contentType" (string) - @param "accept" (string) - @param "xOrgId" (string) - @return Application*/ -func (a *ApplicationsApiService) ApplicationsPut(ctx context.Context, id string, localVarOptionals map[string]interface{}) (Application, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Put") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload Application - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/applications/{id}" - localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["contentType"], "string", "contentType"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["accept"], "string", "accept"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return successPayload, nil, err - } - - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - if localVarTempParam, localVarOk := localVarOptionals["contentType"].(string); localVarOk { - localVarHeaderParams["Content-Type"] = parameterToString(localVarTempParam, "") - } - if localVarTempParam, localVarOk := localVarOptionals["accept"].(string); localVarOk { - localVarHeaderParams["Accept"] = parameterToString(localVarTempParam, "") - } - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - // body params - if localVarTempParam, localVarOk := localVarOptionals["body"].(Application); localVarOk { - localVarPostBody = &localVarTempParam - } - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - diff --git a/v1/applicationslist.go b/v1/applicationslist.go deleted file mode 100644 index 5462278..0000000 --- a/v1/applicationslist.go +++ /dev/null @@ -1,19 +0,0 @@ -/* - * JumpCloud APIs - * - * JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, & system users. - * - * API version: 1.0 - * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) - */ - -package v1 - -type Applicationslist struct { - - // The list of applications. - Results []Application `json:"results,omitempty"` - - // The total number of applications. - TotalCount int32 `json:"totalCount,omitempty"` -} diff --git a/v1/applicationtemplate.go b/v1/applicationtemplate.go deleted file mode 100644 index 8505b12..0000000 --- a/v1/applicationtemplate.go +++ /dev/null @@ -1,35 +0,0 @@ -/* - * JumpCloud APIs - * - * JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, & system users. - * - * API version: 1.0 - * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) - */ - -package v1 - -type Applicationtemplate struct { - - Id string `json:"_id,omitempty"` - - Beta bool `json:"beta,omitempty"` - - Color string `json:"color,omitempty"` - - Config *ApplicationConfig `json:"config,omitempty"` - - DisplayLabel string `json:"displayLabel,omitempty"` - - DisplayName string `json:"displayName,omitempty"` - - IsConfigured bool `json:"isConfigured,omitempty"` - - Jit *ApplicationtemplateJit `json:"jit,omitempty"` - - LearnMore string `json:"learnMore,omitempty"` - - Name string `json:"name,omitempty"` - - SsoUrl string `json:"ssoUrl,omitempty"` -} diff --git a/v1/applicationtemplate_jit.go b/v1/applicationtemplate_jit.go deleted file mode 100644 index 5ef667c..0000000 --- a/v1/applicationtemplate_jit.go +++ /dev/null @@ -1,17 +0,0 @@ -/* - * JumpCloud APIs - * - * JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, & system users. - * - * API version: 1.0 - * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) - */ - -package v1 - -type ApplicationtemplateJit struct { - - Attributes *interface{} `json:"attributes,omitempty"` - - CreateOnly bool `json:"createOnly,omitempty"` -} diff --git a/v1/applicationtemplateslist.go b/v1/applicationtemplateslist.go deleted file mode 100644 index 944f98d..0000000 --- a/v1/applicationtemplateslist.go +++ /dev/null @@ -1,19 +0,0 @@ -/* - * JumpCloud APIs - * - * JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, & system users. - * - * API version: 1.0 - * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) - */ - -package v1 - -type Applicationtemplateslist struct { - - // The list of applications. - Results []Applicationtemplate `json:"results,omitempty"` - - // The total number of applications. - TotalCount int32 `json:"totalCount,omitempty"` -} diff --git a/v1/body.go b/v1/body.go deleted file mode 100644 index 924630f..0000000 --- a/v1/body.go +++ /dev/null @@ -1,25 +0,0 @@ -/* - * JumpCloud APIs - * - * JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, & system users. - * - * API version: 1.0 - * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) - */ - -package v1 - -type Body struct { - - Mfa string `json:"mfa,omitempty"` - - Name string `json:"name"` - - NetworkSourceIp string `json:"networkSourceIp"` - - Tags []string `json:"tags,omitempty"` - - UserLockoutAction string `json:"userLockoutAction,omitempty"` - - UserPasswordExpirationAction string `json:"userPasswordExpirationAction,omitempty"` -} diff --git a/v1/body_1.go b/v1/body_1.go deleted file mode 100644 index 1b6d393..0000000 --- a/v1/body_1.go +++ /dev/null @@ -1,21 +0,0 @@ -/* - * JumpCloud APIs - * - * JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, & system users. - * - * API version: 1.0 - * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) - */ - -package v1 - -import ( - "time" -) - -type Body1 struct { - - Exclusion bool `json:"exclusion,omitempty"` - - ExclusionUntil time.Time `json:"exclusionUntil,omitempty"` -} diff --git a/v1/command.go b/v1/command.go deleted file mode 100644 index 6a5fbdf..0000000 --- a/v1/command.go +++ /dev/null @@ -1,57 +0,0 @@ -/* - * JumpCloud APIs - * - * JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, & system users. - * - * API version: 1.0 - * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) - */ - -package v1 - -type Command struct { - - // The command to execute on the server. - Command string `json:"command"` - - // An array of IDs of the Command Runner Users that can execute this command. - CommandRunners []string `json:"commandRunners,omitempty"` - - // The Command OS - CommandType string `json:"commandType,omitempty"` - - // An array of file IDs to include with the command. - Files []string `json:"files,omitempty"` - - // How the command will execute. - LaunchType string `json:"launchType,omitempty"` - - // - ListensTo string `json:"listensTo,omitempty"` - - Name string `json:"name,omitempty"` - - // The ID of the organization. - Organization string `json:"organization,omitempty"` - - // A crontab that consists of: [ (seconds) (minutes) (hours) (days of month) (months) (weekdays) ] or [ immediate ]. If you send this as an empty string, it will run immediately. - Schedule string `json:"schedule,omitempty"` - - // When the command will repeat. - ScheduleRepeatType string `json:"scheduleRepeatType,omitempty"` - - // - Sudo bool `json:"sudo,omitempty"` - - // An array of system IDs to run the command on. Not available if you are using Groups. - Systems []string `json:"systems,omitempty"` - - // The time in seconds to allow the command to run for. - Timeout string `json:"timeout,omitempty"` - - // The name of the command trigger. - Trigger string `json:"trigger,omitempty"` - - // The ID of the system user to run the command as. This field is required when creating a command with a commandType of \"mac\" or \"linux\". - User string `json:"user,omitempty"` -} diff --git a/v1/command_results_api.go b/v1/command_results_api.go deleted file mode 100644 index 977747a..0000000 --- a/v1/command_results_api.go +++ /dev/null @@ -1,343 +0,0 @@ -/* - * JumpCloud APIs - * - * JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, & system users. - * - * API version: 1.0 - * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) - */ - -package v1 - -import ( - "io/ioutil" - "net/url" - "net/http" - "strings" - "golang.org/x/net/context" - "encoding/json" - "fmt" -) - -// Linger please -var ( - _ context.Context -) - -type CommandResultsApiService service - - -/* CommandResultsApiService Delete a Command result - This endpoint deletes a specific command result. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/commandresults/{CommandID} \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ```` - * @param ctx context.Context for authentication, logging, tracing, etc. - @param id - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "xOrgId" (string) - @return Commandresult*/ -func (a *CommandResultsApiService) CommandResultsDelete(ctx context.Context, id string, contentType string, accept string, localVarOptionals map[string]interface{}) (Commandresult, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Delete") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload Commandresult - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/commandresults/{id}" - localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return successPayload, nil, err - } - - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* CommandResultsApiService List an individual Command result - This endpoint returns a specific command result. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/commandresults/{CommandResultID} \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - * @param ctx context.Context for authentication, logging, tracing, etc. - @param id - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "fields" (string) Use a space seperated string of field parameters to include the data in the response. If omitted, the default list of fields will be returned. - @param "filter" (string) A filter to apply to the query. - @param "xOrgId" (string) - @return Commandresult*/ -func (a *CommandResultsApiService) CommandResultsGet(ctx context.Context, id string, contentType string, accept string, localVarOptionals map[string]interface{}) (Commandresult, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload Commandresult - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/commandresults/{id}" - localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["fields"], "string", "fields"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["filter"], "string", "filter"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return successPayload, nil, err - } - - if localVarTempParam, localVarOk := localVarOptionals["fields"].(string); localVarOk { - localVarQueryParams.Add("fields", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["filter"].(string); localVarOk { - localVarQueryParams.Add("filter", parameterToString(localVarTempParam, "")) - } - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* CommandResultsApiService List all Command Results - This endpoint returns all command results. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/commandresults \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key:{API_KEY}' ``` - * @param ctx context.Context for authentication, logging, tracing, etc. - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "fields" (string) Use a space seperated string of field parameters to include the data in the response. If omitted, the default list of fields will be returned. - @param "limit" (int32) The number of records to return at once. Limited to 100. - @param "skip" (int32) The offset into the records to return. - @param "sort" (string) Use space separated sort parameters to sort the collection. Default sort is ascending. Prefix with `-` to sort descending. - @param "filter" (string) A filter to apply to the query. - @param "xOrgId" (string) - @return Commandresultslist*/ -func (a *CommandResultsApiService) CommandResultsList(ctx context.Context, contentType string, accept string, localVarOptionals map[string]interface{}) (Commandresultslist, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload Commandresultslist - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/commandresults" - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["fields"], "string", "fields"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["limit"], "int32", "limit"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["skip"], "int32", "skip"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["sort"], "string", "sort"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["filter"], "string", "filter"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return successPayload, nil, err - } - - if localVarTempParam, localVarOk := localVarOptionals["fields"].(string); localVarOk { - localVarQueryParams.Add("fields", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["limit"].(int32); localVarOk { - localVarQueryParams.Add("limit", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["skip"].(int32); localVarOk { - localVarQueryParams.Add("skip", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["sort"].(string); localVarOk { - localVarQueryParams.Add("sort", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["filter"].(string); localVarOk { - localVarQueryParams.Add("filter", parameterToString(localVarTempParam, "")) - } - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - diff --git a/v1/command_triggers_api.go b/v1/command_triggers_api.go deleted file mode 100644 index 33f385c..0000000 --- a/v1/command_triggers_api.go +++ /dev/null @@ -1,111 +0,0 @@ -/* - * JumpCloud APIs - * - * JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, & system users. - * - * API version: 1.0 - * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) - */ - -package v1 - -import ( - "io/ioutil" - "net/url" - "net/http" - "strings" - "golang.org/x/net/context" - "fmt" -) - -// Linger please -var ( - _ context.Context -) - -type CommandTriggersApiService service - - -/* CommandTriggersApiService Launch a command via a Trigger - This endpoint allows you to launch a command based on a defined trigger. #### Sample Requests **Launch a Command via a Trigger** ``` curl --silent \\ -X 'POST' \\ -H \"x-api-key: {API_KEY}\" \\ \"https://console.jumpcloud.com/api/command/trigger/{TriggerName}\" ``` **Launch a Command via a Trigger passing a JSON object to the command** ``` curl --silent \\ -X 'POST' \\ -H \"x-api-key: {API_KEY}\" \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -d '{ \"srcip\":\"192.168.2.32\", \"attack\":\"Cross Site Scripting Attempt\" }' \\ \"https://console.jumpcloud.com/api/command/trigger/{TriggerName}\" ``` - * @param ctx context.Context for authentication, logging, tracing, etc. - @param triggername - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "xOrgId" (string) - @return */ -func (a *CommandTriggersApiService) CommandTriggerWebhookPost(ctx context.Context, triggername string, contentType string, accept string, localVarOptionals map[string]interface{}) ( *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Post") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/command/trigger/{triggername}" - localVarPath = strings.Replace(localVarPath, "{"+"triggername"+"}", fmt.Sprintf("%v", triggername), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return nil, err - } - - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - return localVarHttpResponse, err -} - diff --git a/v1/commandfilereturn.go b/v1/commandfilereturn.go deleted file mode 100644 index 518436a..0000000 --- a/v1/commandfilereturn.go +++ /dev/null @@ -1,18 +0,0 @@ -/* - * JumpCloud APIs - * - * JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, & system users. - * - * API version: 1.0 - * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) - */ - -package v1 - -type Commandfilereturn struct { - - Results *CommandfilereturnResults `json:"results,omitempty"` - - // The total number of commands files - TotalCount int32 `json:"totalCount,omitempty"` -} diff --git a/v1/commandfilereturn_results.go b/v1/commandfilereturn_results.go deleted file mode 100644 index 07d09df..0000000 --- a/v1/commandfilereturn_results.go +++ /dev/null @@ -1,22 +0,0 @@ -/* - * JumpCloud APIs - * - * JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, & system users. - * - * API version: 1.0 - * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) - */ - -package v1 - -type CommandfilereturnResults struct { - - // The ID of the file. - Id string `json:"_id,omitempty"` - - // The location where the file will be stored. - Destination string `json:"destination,omitempty"` - - // The file name. - Name string `json:"name,omitempty"` -} diff --git a/v1/commandresult.go b/v1/commandresult.go deleted file mode 100644 index fdcf39c..0000000 --- a/v1/commandresult.go +++ /dev/null @@ -1,52 +0,0 @@ -/* - * JumpCloud APIs - * - * JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, & system users. - * - * API version: 1.0 - * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) - */ - -package v1 - -type Commandresult struct { - - // The ID of the command. - Id string `json:"_id,omitempty"` - - // The command that was executed on the system. - Command string `json:"command,omitempty"` - - // An array of file ids that were included in the command - Files []string `json:"files,omitempty"` - - // The name of the command. - Name string `json:"name,omitempty"` - - // The ID of the organization. - Organization string `json:"organization,omitempty"` - - // The time that the command was sent. - RequestTime string `json:"requestTime,omitempty"` - - Response *CommandresultResponse `json:"response,omitempty"` - - // The time that the command was completed. - ResponseTime string `json:"responseTime,omitempty"` - - // If the user had sudo rights - Sudo bool `json:"sudo,omitempty"` - - // The name of the system the command was executed on. - System string `json:"system,omitempty"` - - // The id of the system the command was executed on. - SystemId string `json:"systemId,omitempty"` - - // The user the command ran as. - User string `json:"user,omitempty"` - - WorkflowId string `json:"workflowId,omitempty"` - - WorkflowInstanceId string `json:"workflowInstanceId,omitempty"` -} diff --git a/v1/commandresult_response.go b/v1/commandresult_response.go deleted file mode 100644 index 15214fa..0000000 --- a/v1/commandresult_response.go +++ /dev/null @@ -1,21 +0,0 @@ -/* - * JumpCloud APIs - * - * JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, & system users. - * - * API version: 1.0 - * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) - */ - -package v1 - -type CommandresultResponse struct { - - Data *CommandresultResponseData `json:"data,omitempty"` - - // The stderr output from the command that ran. - Error_ string `json:"error,omitempty"` - - // ID of the response. - Id string `json:"id,omitempty"` -} diff --git a/v1/commandresult_response_data.go b/v1/commandresult_response_data.go deleted file mode 100644 index fdb7e6a..0000000 --- a/v1/commandresult_response_data.go +++ /dev/null @@ -1,19 +0,0 @@ -/* - * JumpCloud APIs - * - * JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, & system users. - * - * API version: 1.0 - * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) - */ - -package v1 - -type CommandresultResponseData struct { - - // The stderr output from the command that ran. - ExitCode int32 `json:"exitCode,omitempty"` - - // The output of the command that was executed. - Output string `json:"output,omitempty"` -} diff --git a/v1/commandresultslist.go b/v1/commandresultslist.go deleted file mode 100644 index e1aeef9..0000000 --- a/v1/commandresultslist.go +++ /dev/null @@ -1,19 +0,0 @@ -/* - * JumpCloud APIs - * - * JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, & system users. - * - * API version: 1.0 - * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) - */ - -package v1 - -type Commandresultslist struct { - - // The list of command results - Results []Commandresult `json:"results,omitempty"` - - // The total number of command results - TotalCount int32 `json:"totalCount,omitempty"` -} diff --git a/v1/commands_api.go b/v1/commands_api.go deleted file mode 100644 index 0a21a05..0000000 --- a/v1/commands_api.go +++ /dev/null @@ -1,633 +0,0 @@ -/* - * JumpCloud APIs - * - * JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, & system users. - * - * API version: 1.0 - * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) - */ - -package v1 - -import ( - "io/ioutil" - "net/url" - "net/http" - "strings" - "golang.org/x/net/context" - "encoding/json" - "fmt" -) - -// Linger please -var ( - _ context.Context -) - -type CommandsApiService service - - -/* CommandsApiService Get a Command File - This endpoint returns the uploaded file(s) associated with a specific command. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/files/command/{commandID} \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - * @param ctx context.Context for authentication, logging, tracing, etc. - @param id - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "fields" (string) Use a space seperated string of field parameters to include the data in the response. If omitted, the default list of fields will be returned. - @param "limit" (int32) The number of records to return at once. Limited to 100. - @param "skip" (int32) The offset into the records to return. - @param "xOrgId" (string) - @return Commandfilereturn*/ -func (a *CommandsApiService) CommandFileGet(ctx context.Context, id string, contentType string, accept string, localVarOptionals map[string]interface{}) (Commandfilereturn, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload Commandfilereturn - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/files/command/{id}" - localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["fields"], "string", "fields"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["limit"], "int32", "limit"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["skip"], "int32", "skip"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return successPayload, nil, err - } - - if localVarTempParam, localVarOk := localVarOptionals["fields"].(string); localVarOk { - localVarQueryParams.Add("fields", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["limit"].(int32); localVarOk { - localVarQueryParams.Add("limit", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["skip"].(int32); localVarOk { - localVarQueryParams.Add("skip", parameterToString(localVarTempParam, "")) - } - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* CommandsApiService Delete a Command - This endpoint deletes a specific command based on the Command ID. #### Sample Request ``` curl -X DELETE https://console.jumpcloud.com/api/commands/{CommandID} \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - * @param ctx context.Context for authentication, logging, tracing, etc. - @param id - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "xOrgId" (string) - @return */ -func (a *CommandsApiService) CommandsDelete(ctx context.Context, id string, contentType string, accept string, localVarOptionals map[string]interface{}) ( *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Delete") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/commands/{id}" - localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return nil, err - } - - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - return localVarHttpResponse, err -} - -/* CommandsApiService List an individual Command - This endpoint returns a specific command based on the command ID. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/commands/{CommandID} \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - * @param ctx context.Context for authentication, logging, tracing, etc. - @param id - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "fields" (string) Use a space seperated string of field parameters to include the data in the response. If omitted, the default list of fields will be returned. - @param "filter" (string) A filter to apply to the query. - @param "xOrgId" (string) - @return Command*/ -func (a *CommandsApiService) CommandsGet(ctx context.Context, id string, contentType string, accept string, localVarOptionals map[string]interface{}) (Command, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload Command - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/commands/{id}" - localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["fields"], "string", "fields"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["filter"], "string", "filter"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return successPayload, nil, err - } - - if localVarTempParam, localVarOk := localVarOptionals["fields"].(string); localVarOk { - localVarQueryParams.Add("fields", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["filter"].(string); localVarOk { - localVarQueryParams.Add("filter", parameterToString(localVarTempParam, "")) - } - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* CommandsApiService List All Commands - This endpoint returns all commands. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/commands/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - * @param ctx context.Context for authentication, logging, tracing, etc. - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "skip" (int32) The offset into the records to return. - @param "fields" (string) Use a space seperated string of field parameters to include the data in the response. If omitted, the default list of fields will be returned. - @param "limit" (int32) The number of records to return at once. Limited to 100. - @param "sort" (string) Use space separated sort parameters to sort the collection. Default sort is ascending. Prefix with `-` to sort descending. - @param "filter" (string) A filter to apply to the query. - @param "xOrgId" (string) - @return Commandslist*/ -func (a *CommandsApiService) CommandsList(ctx context.Context, contentType string, accept string, localVarOptionals map[string]interface{}) (Commandslist, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload Commandslist - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/commands" - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["skip"], "int32", "skip"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["fields"], "string", "fields"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["limit"], "int32", "limit"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["sort"], "string", "sort"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["filter"], "string", "filter"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return successPayload, nil, err - } - - if localVarTempParam, localVarOk := localVarOptionals["skip"].(int32); localVarOk { - localVarQueryParams.Add("skip", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["fields"].(string); localVarOk { - localVarQueryParams.Add("fields", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["limit"].(int32); localVarOk { - localVarQueryParams.Add("limit", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["sort"].(string); localVarOk { - localVarQueryParams.Add("sort", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["filter"].(string); localVarOk { - localVarQueryParams.Add("filter", parameterToString(localVarTempParam, "")) - } - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* CommandsApiService Create A Command - This endpoint allows you to create a new command. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/commands/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"name\":\"Test API Command\", \"command\":\"String\", \"user\":\"{UserID}\", \"schedule\":\"\", \"timeout\":\"100\" }' ``` - * @param ctx context.Context for authentication, logging, tracing, etc. - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "body" (Command) - @param "xOrgId" (string) - @return Command*/ -func (a *CommandsApiService) CommandsPost(ctx context.Context, contentType string, accept string, localVarOptionals map[string]interface{}) (Command, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Post") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload Command - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/commands" - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return successPayload, nil, err - } - - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - // body params - if localVarTempParam, localVarOk := localVarOptionals["body"].(Command); localVarOk { - localVarPostBody = &localVarTempParam - } - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* CommandsApiService Update a Command - This endpoint Updates a command based on the command ID and returns the modified command record. #### Sample Request ``` curl -X PUT https://console.jumpcloud.com/api/commands/{CommandID} \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"name\":\"Test API Command\", \"command\":\"String\", \"user\":\"{UserID}\", \"schedule\":\"\", \"timeout\":\"100\" }' ``` - * @param ctx context.Context for authentication, logging, tracing, etc. - @param id - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "body" (Command) - @param "xOrgId" (string) - @return Command*/ -func (a *CommandsApiService) CommandsPut(ctx context.Context, id string, contentType string, accept string, localVarOptionals map[string]interface{}) (Command, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Put") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload Command - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/commands/{id}" - localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return successPayload, nil, err - } - - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - // body params - if localVarTempParam, localVarOk := localVarOptionals["body"].(Command); localVarOk { - localVarPostBody = &localVarTempParam - } - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - diff --git a/v1/commandslist.go b/v1/commandslist.go deleted file mode 100644 index 803277a..0000000 --- a/v1/commandslist.go +++ /dev/null @@ -1,18 +0,0 @@ -/* - * JumpCloud APIs - * - * JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, & system users. - * - * API version: 1.0 - * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) - */ - -package v1 - -type Commandslist struct { - - Results []CommandslistResults `json:"results,omitempty"` - - // The total number of commands - TotalCount int32 `json:"totalCount,omitempty"` -} diff --git a/v1/commandslist_results.go b/v1/commandslist_results.go deleted file mode 100644 index d6b14db..0000000 --- a/v1/commandslist_results.go +++ /dev/null @@ -1,42 +0,0 @@ -/* - * JumpCloud APIs - * - * JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, & system users. - * - * API version: 1.0 - * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) - */ - -package v1 - -type CommandslistResults struct { - - // The ID of the command. - Id string `json:"_id,omitempty"` - - // The Command to execute. - Command string `json:"command,omitempty"` - - // The Command OS. - CommandType string `json:"commandType,omitempty"` - - // How the Command is executed. - LaunchType string `json:"launchType,omitempty"` - - ListensTo string `json:"listensTo,omitempty"` - - // The name of the Command. - Name string `json:"name,omitempty"` - - // The ID of the Organization. - Organization string `json:"organization,omitempty"` - - // A crontab that consists of: [ (seconds) (minutes) (hours) (days of month) (months) (weekdays) ] or [ immediate ]. If you send this as an empty string, it will run immediately. - Schedule string `json:"schedule,omitempty"` - - // When the command will repeat. - ScheduleRepeatType string `json:"scheduleRepeatType,omitempty"` - - // Trigger to execute command. - Trigger string `json:"trigger,omitempty"` -} diff --git a/v1/configuration.go b/v1/configuration.go deleted file mode 100644 index ae51265..0000000 --- a/v1/configuration.go +++ /dev/null @@ -1,72 +0,0 @@ -/* - * JumpCloud APIs - * - * JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, & system users. - * - * API version: 1.0 - * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) - */ - -package v1 - -import ( - "net/http" -) - -// contextKeys are used to identify the type of value in the context. -// Since these are string, it is possible to get a short description of the -// context key for logging and debugging using key.String(). - -type contextKey string - -func (c contextKey) String() string { - return "auth " + string(c) -} - -var ( - // ContextOAuth2 takes a oauth2.TokenSource as authentication for the request. - ContextOAuth2 = contextKey("token") - - // ContextBasicAuth takes BasicAuth as authentication for the request. - ContextBasicAuth = contextKey("basic") - - // ContextAccessToken takes a string oauth2 access token as authentication for the request. - ContextAccessToken = contextKey("accesstoken") - - // ContextAPIKey takes an APIKey as authentication for the request - ContextAPIKey = contextKey("apikey") -) - -// BasicAuth provides basic http authentication to a request passed via context using ContextBasicAuth -type BasicAuth struct { - UserName string `json:"userName,omitempty"` - Password string `json:"password,omitempty"` -} - -// APIKey provides API key based authentication to a request passed via context using ContextAPIKey -type APIKey struct { - Key string - Prefix string -} - -type Configuration struct { - BasePath string `json:"basePath,omitempty"` - Host string `json:"host,omitempty"` - Scheme string `json:"scheme,omitempty"` - DefaultHeader map[string]string `json:"defaultHeader,omitempty"` - UserAgent string `json:"userAgent,omitempty"` - HTTPClient *http.Client -} - -func NewConfiguration() *Configuration { - cfg := &Configuration{ - BasePath: "https://console.jumpcloud.com/api", - DefaultHeader: make(map[string]string), - UserAgent: "Swagger-Codegen/3.0.0/go", - } - return cfg -} - -func (c *Configuration) AddDefaultHeader(key string, value string) { - c.DefaultHeader[key] = value -} \ No newline at end of file diff --git a/v1/docs/Application.md b/v1/docs/Application.md deleted file mode 100644 index af5c016..0000000 --- a/v1/docs/Application.md +++ /dev/null @@ -1,18 +0,0 @@ -# Application - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Id** | **string** | | [optional] [default to null] -**Beta** | **bool** | | [optional] [default to null] -**Config** | [***ApplicationConfig**](application_config.md) | | [optional] [default to null] -**DisplayLabel** | **string** | | [optional] [default to null] -**DisplayName** | **string** | | [optional] [default to null] -**LearnMore** | **string** | | [optional] [default to null] -**Name** | **string** | | [optional] [default to null] -**Organization** | **string** | | [optional] [default to null] -**SsoUrl** | **string** | | [optional] [default to null] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/v1/docs/ApplicationTemplatesApi.md b/v1/docs/ApplicationTemplatesApi.md deleted file mode 100644 index 71ebfc0..0000000 --- a/v1/docs/ApplicationTemplatesApi.md +++ /dev/null @@ -1,100 +0,0 @@ -# \ApplicationTemplatesApi - -All URIs are relative to *https://console.jumpcloud.com/api* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**ApplicationTemplatesGet**](ApplicationTemplatesApi.md#ApplicationTemplatesGet) | **Get** /application-templates/{id} | Get an Application Template -[**ApplicationTemplatesList**](ApplicationTemplatesApi.md#ApplicationTemplatesList) | **Get** /application-templates | List Application Templates - - -# **ApplicationTemplatesGet** -> Applicationtemplate ApplicationTemplatesGet(ctx, id, contentType, accept, optional) -Get an Application Template - -The endpoint returns a specific SSO / SAML Application Template. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/application-templates/{id} \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **id** | **string**| | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **id** | **string**| | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **fields** | **string**| The comma separated fields included in the returned records. If omitted the default list of fields will be returned. | - **limit** | **int32**| The number of records to return at once. | - **skip** | **int32**| The offset into the records to return. | - **sort** | **string**| | [default to The comma separated fields used to sort the collection. Default sort is ascending, prefix with - to sort descending.] - **filter** | **string**| A filter to apply to the query. | - **xOrgId** | **string**| | [default to ] - -### Return type - -[**Applicationtemplate**](applicationtemplate.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **ApplicationTemplatesList** -> Applicationtemplateslist ApplicationTemplatesList(ctx, contentType, accept, optional) -List Application Templates - -The endpoint returns all the SSO / SAML Application Templates. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/application-templates \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **fields** | **string**| The comma separated fields included in the returned records. If omitted the default list of fields will be returned. | - **limit** | **int32**| The number of records to return at once. | - **skip** | **int32**| The offset into the records to return. | - **sort** | **string**| | [default to The comma separated fields used to sort the collection. Default sort is ascending, prefix with - to sort descending.] - **filter** | **string**| A filter to apply to the query. | - **xOrgId** | **string**| | [default to ] - -### Return type - -[**Applicationtemplateslist**](applicationtemplateslist.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - diff --git a/v1/docs/ApplicationsApi.md b/v1/docs/ApplicationsApi.md deleted file mode 100644 index 71cbcb4..0000000 --- a/v1/docs/ApplicationsApi.md +++ /dev/null @@ -1,213 +0,0 @@ -# \ApplicationsApi - -All URIs are relative to *https://console.jumpcloud.com/api* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**ApplicationsDelete**](ApplicationsApi.md#ApplicationsDelete) | **Delete** /applications/{id} | Delete an Application -[**ApplicationsGet**](ApplicationsApi.md#ApplicationsGet) | **Get** /applications/{id} | Get an Application -[**ApplicationsList**](ApplicationsApi.md#ApplicationsList) | **Get** /applications | Applications -[**ApplicationsPost**](ApplicationsApi.md#ApplicationsPost) | **Post** /applications | Create an Application -[**ApplicationsPut**](ApplicationsApi.md#ApplicationsPut) | **Put** /applications/{id} | Update an Application - - -# **ApplicationsDelete** -> Application ApplicationsDelete(ctx, id, optional) -Delete an Application - -The endpoint deletes an SSO / SAML Application. - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **id** | **string**| | - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **id** | **string**| | - **contentType** | **string**| | - **accept** | **string**| | - **xOrgId** | **string**| | - -### Return type - -[**Application**](application.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **ApplicationsGet** -> Application ApplicationsGet(ctx, id, optional) -Get an Application - -The endpoint retrieves an SSO / SAML Application. - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **id** | **string**| | - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **id** | **string**| | - **contentType** | **string**| | - **accept** | **string**| | - **xOrgId** | **string**| | - -### Return type - -[**Application**](application.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **ApplicationsList** -> Applicationslist ApplicationsList(ctx, contentType, accept, optional) -Applications - -The endpoint returns all your SSO / SAML Applications. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/applications \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **fields** | **string**| The comma separated fields included in the returned records. If omitted the default list of fields will be returned. | - **limit** | **int32**| The number of records to return at once. | - **skip** | **int32**| The offset into the records to return. | - **sort** | **string**| | [default to The comma separated fields used to sort the collection. Default sort is ascending, prefix with - to sort descending.] - **filter** | **string**| A filter to apply to the query. | - **xOrgId** | **string**| | [default to ] - -### Return type - -[**Applicationslist**](applicationslist.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **ApplicationsPost** -> Application ApplicationsPost(ctx, optional) -Create an Application - -The endpoint adds a new SSO / SAML Applications. - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**Application**](Application.md)| | - **contentType** | **string**| | - **accept** | **string**| | - **xOrgId** | **string**| | - -### Return type - -[**Application**](application.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **ApplicationsPut** -> Application ApplicationsPut(ctx, id, optional) -Update an Application - -The endpoint updates a SSO / SAML Application. - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **id** | **string**| | - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **id** | **string**| | - **body** | [**Application**](Application.md)| | - **contentType** | **string**| | - **accept** | **string**| | - **xOrgId** | **string**| | - -### Return type - -[**Application**](application.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - diff --git a/v1/docs/Applicationtemplate.md b/v1/docs/Applicationtemplate.md deleted file mode 100644 index 3687313..0000000 --- a/v1/docs/Applicationtemplate.md +++ /dev/null @@ -1,20 +0,0 @@ -# Applicationtemplate - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Id** | **string** | | [optional] [default to null] -**Beta** | **bool** | | [optional] [default to null] -**Color** | **string** | | [optional] [default to null] -**Config** | [***ApplicationConfig**](application_config.md) | | [optional] [default to null] -**DisplayLabel** | **string** | | [optional] [default to null] -**DisplayName** | **string** | | [optional] [default to null] -**IsConfigured** | **bool** | | [optional] [default to null] -**Jit** | [***ApplicationtemplateJit**](applicationtemplate_jit.md) | | [optional] [default to null] -**LearnMore** | **string** | | [optional] [default to null] -**Name** | **string** | | [optional] [default to null] -**SsoUrl** | **string** | | [optional] [default to null] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/v1/docs/Body.md b/v1/docs/Body.md deleted file mode 100644 index de74fa6..0000000 --- a/v1/docs/Body.md +++ /dev/null @@ -1,15 +0,0 @@ -# Body - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Mfa** | **string** | | [optional] [default to null] -**Name** | **string** | | [default to null] -**NetworkSourceIp** | **string** | | [default to null] -**Tags** | **[]string** | | [optional] [default to null] -**UserLockoutAction** | **string** | | [optional] [default to null] -**UserPasswordExpirationAction** | **string** | | [optional] [default to null] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/v1/docs/Body1.md b/v1/docs/Body1.md deleted file mode 100644 index 999f7f7..0000000 --- a/v1/docs/Body1.md +++ /dev/null @@ -1,11 +0,0 @@ -# Body1 - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Exclusion** | **bool** | | [optional] [default to null] -**ExclusionUntil** | [**time.Time**](time.Time.md) | | [optional] [default to null] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/v1/docs/CommandResultsApi.md b/v1/docs/CommandResultsApi.md deleted file mode 100644 index 9fa4522..0000000 --- a/v1/docs/CommandResultsApi.md +++ /dev/null @@ -1,139 +0,0 @@ -# \CommandResultsApi - -All URIs are relative to *https://console.jumpcloud.com/api* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**CommandResultsDelete**](CommandResultsApi.md#CommandResultsDelete) | **Delete** /commandresults/{id} | Delete a Command result -[**CommandResultsGet**](CommandResultsApi.md#CommandResultsGet) | **Get** /commandresults/{id} | List an individual Command result -[**CommandResultsList**](CommandResultsApi.md#CommandResultsList) | **Get** /commandresults | List all Command Results - - -# **CommandResultsDelete** -> Commandresult CommandResultsDelete(ctx, id, contentType, accept, optional) -Delete a Command result - -This endpoint deletes a specific command result. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/commandresults/{CommandID} \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ```` - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **id** | **string**| | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **id** | **string**| | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **xOrgId** | **string**| | [default to ] - -### Return type - -[**Commandresult**](commandresult.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **CommandResultsGet** -> Commandresult CommandResultsGet(ctx, id, contentType, accept, optional) -List an individual Command result - -This endpoint returns a specific command result. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/commandresults/{CommandResultID} \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **id** | **string**| | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **id** | **string**| | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **fields** | **string**| Use a space seperated string of field parameters to include the data in the response. If omitted, the default list of fields will be returned. | [default to ] - **filter** | **string**| A filter to apply to the query. | - **xOrgId** | **string**| | [default to ] - -### Return type - -[**Commandresult**](commandresult.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **CommandResultsList** -> Commandresultslist CommandResultsList(ctx, contentType, accept, optional) -List all Command Results - -This endpoint returns all command results. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/commandresults \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key:{API_KEY}' ``` - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **fields** | **string**| Use a space seperated string of field parameters to include the data in the response. If omitted, the default list of fields will be returned. | [default to ] - **limit** | **int32**| The number of records to return at once. Limited to 100. | [default to 10] - **skip** | **int32**| The offset into the records to return. | [default to 0] - **sort** | **string**| Use space separated sort parameters to sort the collection. Default sort is ascending. Prefix with `-` to sort descending. | [default to ] - **filter** | **string**| A filter to apply to the query. | - **xOrgId** | **string**| | [default to ] - -### Return type - -[**Commandresultslist**](commandresultslist.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - diff --git a/v1/docs/CommandTriggersApi.md b/v1/docs/CommandTriggersApi.md deleted file mode 100644 index d6c066d..0000000 --- a/v1/docs/CommandTriggersApi.md +++ /dev/null @@ -1,50 +0,0 @@ -# \CommandTriggersApi - -All URIs are relative to *https://console.jumpcloud.com/api* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**CommandTriggerWebhookPost**](CommandTriggersApi.md#CommandTriggerWebhookPost) | **Post** /command/trigger/{triggername} | Launch a command via a Trigger - - -# **CommandTriggerWebhookPost** -> CommandTriggerWebhookPost(ctx, triggername, contentType, accept, optional) -Launch a command via a Trigger - -This endpoint allows you to launch a command based on a defined trigger. #### Sample Requests **Launch a Command via a Trigger** ``` curl --silent \\ -X 'POST' \\ -H \"x-api-key: {API_KEY}\" \\ \"https://console.jumpcloud.com/api/command/trigger/{TriggerName}\" ``` **Launch a Command via a Trigger passing a JSON object to the command** ``` curl --silent \\ -X 'POST' \\ -H \"x-api-key: {API_KEY}\" \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -d '{ \"srcip\":\"192.168.2.32\", \"attack\":\"Cross Site Scripting Attempt\" }' \\ \"https://console.jumpcloud.com/api/command/trigger/{TriggerName}\" ``` - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **triggername** | **string**| | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **triggername** | **string**| | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **xOrgId** | **string**| | [default to ] - -### Return type - - (empty response body) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - diff --git a/v1/docs/Commandresultslist.md b/v1/docs/Commandresultslist.md deleted file mode 100644 index 2bce513..0000000 --- a/v1/docs/Commandresultslist.md +++ /dev/null @@ -1,11 +0,0 @@ -# Commandresultslist - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Results** | [**[]Commandresult**](commandresult.md) | The list of command results | [optional] [default to null] -**TotalCount** | **int32** | The total number of command results | [optional] [default to null] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/v1/docs/CommandsApi.md b/v1/docs/CommandsApi.md deleted file mode 100644 index 3c7a812..0000000 --- a/v1/docs/CommandsApi.md +++ /dev/null @@ -1,268 +0,0 @@ -# \CommandsApi - -All URIs are relative to *https://console.jumpcloud.com/api* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**CommandFileGet**](CommandsApi.md#CommandFileGet) | **Get** /files/command/{id} | Get a Command File -[**CommandsDelete**](CommandsApi.md#CommandsDelete) | **Delete** /commands/{id} | Delete a Command -[**CommandsGet**](CommandsApi.md#CommandsGet) | **Get** /commands/{id} | List an individual Command -[**CommandsList**](CommandsApi.md#CommandsList) | **Get** /commands | List All Commands -[**CommandsPost**](CommandsApi.md#CommandsPost) | **Post** /commands | Create A Command -[**CommandsPut**](CommandsApi.md#CommandsPut) | **Put** /commands/{id} | Update a Command - - -# **CommandFileGet** -> Commandfilereturn CommandFileGet(ctx, id, contentType, accept, optional) -Get a Command File - -This endpoint returns the uploaded file(s) associated with a specific command. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/files/command/{commandID} \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **id** | **string**| | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **id** | **string**| | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **fields** | **string**| Use a space seperated string of field parameters to include the data in the response. If omitted, the default list of fields will be returned. | [default to ] - **limit** | **int32**| The number of records to return at once. Limited to 100. | [default to 10] - **skip** | **int32**| The offset into the records to return. | [default to 0] - **xOrgId** | **string**| | [default to ] - -### Return type - -[**Commandfilereturn**](commandfilereturn.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **CommandsDelete** -> CommandsDelete(ctx, id, contentType, accept, optional) -Delete a Command - -This endpoint deletes a specific command based on the Command ID. #### Sample Request ``` curl -X DELETE https://console.jumpcloud.com/api/commands/{CommandID} \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **id** | **string**| | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **id** | **string**| | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **xOrgId** | **string**| | [default to ] - -### Return type - - (empty response body) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **CommandsGet** -> Command CommandsGet(ctx, id, contentType, accept, optional) -List an individual Command - -This endpoint returns a specific command based on the command ID. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/commands/{CommandID} \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **id** | **string**| | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **id** | **string**| | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **fields** | **string**| Use a space seperated string of field parameters to include the data in the response. If omitted, the default list of fields will be returned. | [default to ] - **filter** | **string**| A filter to apply to the query. | - **xOrgId** | **string**| | [default to ] - -### Return type - -[**Command**](command.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **CommandsList** -> Commandslist CommandsList(ctx, contentType, accept, optional) -List All Commands - -This endpoint returns all commands. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/commands/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **skip** | **int32**| The offset into the records to return. | [default to 0] - **fields** | **string**| Use a space seperated string of field parameters to include the data in the response. If omitted, the default list of fields will be returned. | [default to ] - **limit** | **int32**| The number of records to return at once. Limited to 100. | [default to 10] - **sort** | **string**| Use space separated sort parameters to sort the collection. Default sort is ascending. Prefix with `-` to sort descending. | [default to ] - **filter** | **string**| A filter to apply to the query. | - **xOrgId** | **string**| | [default to ] - -### Return type - -[**Commandslist**](commandslist.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **CommandsPost** -> Command CommandsPost(ctx, contentType, accept, optional) -Create A Command - -This endpoint allows you to create a new command. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/commands/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"name\":\"Test API Command\", \"command\":\"String\", \"user\":\"{UserID}\", \"schedule\":\"\", \"timeout\":\"100\" }' ``` - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **body** | [**Command**](Command.md)| | - **xOrgId** | **string**| | [default to ] - -### Return type - -[**Command**](command.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **CommandsPut** -> Command CommandsPut(ctx, id, contentType, accept, optional) -Update a Command - -This endpoint Updates a command based on the command ID and returns the modified command record. #### Sample Request ``` curl -X PUT https://console.jumpcloud.com/api/commands/{CommandID} \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"name\":\"Test API Command\", \"command\":\"String\", \"user\":\"{UserID}\", \"schedule\":\"\", \"timeout\":\"100\" }' ``` - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **id** | **string**| | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **id** | **string**| | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **body** | [**Command**](Command.md)| | - **xOrgId** | **string**| | [default to ] - -### Return type - -[**Command**](command.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - diff --git a/v1/docs/Errorresponse.md b/v1/docs/Errorresponse.md deleted file mode 100644 index 0227c32..0000000 --- a/v1/docs/Errorresponse.md +++ /dev/null @@ -1,10 +0,0 @@ -# Errorresponse - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Message** | **string** | | [optional] [default to null] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/v1/docs/Mfa.md b/v1/docs/Mfa.md deleted file mode 100644 index 3639ccc..0000000 --- a/v1/docs/Mfa.md +++ /dev/null @@ -1,12 +0,0 @@ -# Mfa - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Configured** | **bool** | | [optional] [default to null] -**Exclusion** | **bool** | | [optional] [default to null] -**ExclusionUntil** | [**time.Time**](time.Time.md) | | [optional] [default to null] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/v1/docs/OrganizationsApi.md b/v1/docs/OrganizationsApi.md deleted file mode 100644 index 5487219..0000000 --- a/v1/docs/OrganizationsApi.md +++ /dev/null @@ -1,53 +0,0 @@ -# \OrganizationsApi - -All URIs are relative to *https://console.jumpcloud.com/api* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**OrganizationList**](OrganizationsApi.md#OrganizationList) | **Get** /organizations | Get Organization Details - - -# **OrganizationList** -> Organizationslist OrganizationList(ctx, contentType, accept, optional) -Get Organization Details - -This endpoint returns Organization Details. #### Sample Request ``` curl -X GET \\ https://console.jumpcloud.com/api/organizations \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **fields** | **string**| Use a space seperated string of field parameters to include the data in the response. If omitted, the default list of fields will be returned. | [default to ] - **filter** | **string**| A filter to apply to the query. | - **limit** | **int32**| The number of records to return at once. Limited to 100. | [default to 10] - **skip** | **int32**| The offset into the records to return. | [default to 0] - **sort** | **string**| Use space separated sort parameters to sort the collection. Default sort is ascending. Prefix with `-` to sort descending. | [default to ] - **search** | **string**| A nested object containing a string `searchTerm` and a list of `fields` to search on. | - -### Return type - -[**Organizationslist**](organizationslist.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - diff --git a/v1/docs/RadiusServersApi.md b/v1/docs/RadiusServersApi.md deleted file mode 100644 index c62b693..0000000 --- a/v1/docs/RadiusServersApi.md +++ /dev/null @@ -1,137 +0,0 @@ -# \RadiusServersApi - -All URIs are relative to *https://console.jumpcloud.com/api* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**RadiusServersList**](RadiusServersApi.md#RadiusServersList) | **Get** /radiusservers | List Radius Servers -[**RadiusServersPost**](RadiusServersApi.md#RadiusServersPost) | **Post** /radiusservers | Create a Radius Server -[**RadiusServersPut**](RadiusServersApi.md#RadiusServersPut) | **Put** /radiusservers/{id} | Update Radius Servers - - -# **RadiusServersList** -> Radiusserverslist RadiusServersList(ctx, contentType, accept, optional) -List Radius Servers - -This endpoint allows you to get a list of all RADIUS servers in your organization. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/radiusservers/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ ``` - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **fields** | **string**| Use a space seperated string of field parameters to include the data in the response. If omitted, the default list of fields will be returned. | [default to ] - **filter** | **string**| A filter to apply to the query. | - **limit** | **int32**| The number of records to return at once. Limited to 100. | [default to 10] - **skip** | **int32**| The offset into the records to return. | [default to 0] - **sort** | **string**| Use space separated sort parameters to sort the collection. Default sort is ascending. Prefix with `-` to sort descending. | [default to ] - **xOrgId** | **string**| | [default to ] - -### Return type - -[**Radiusserverslist**](radiusserverslist.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **RadiusServersPost** -> Radiusserver RadiusServersPost(ctx, contentType, accept, optional) -Create a Radius Server - -This endpoint allows you to create RADIUS servers in your organization. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/radiusservers/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"name\": \"{test_radius}\", \"networkSourceIp\": \"{0.0.0.0}\", \"sharedSecret\":\"{secretpassword}\", \"userLockoutAction\": \"REMOVE\", \"userPasswordExpirationAction\": \"MAINTAIN\" }' ``` - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **body** | [**Radiusserverpost**](Radiusserverpost.md)| | - **xOrgId** | **string**| | [default to ] - -### Return type - -[**Radiusserver**](radiusserver.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **RadiusServersPut** -> Radiusserverput RadiusServersPut(ctx, id, contentType, accept, optional) -Update Radius Servers - -This endpoint allows you to update RADIUS servers in your organization. #### ``` curl -X PUT https://console.jumpcloud.com/api/radiusservers/{ServerID} \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"name\": \"{name_update}\", \"networkSourceIp\": \"{0.0.0.0}\", \"userLockoutAction\": \"REMOVE\", \"userPasswordExpirationAction\": \"MAINTAIN\" }' ``` - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **id** | **string**| | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **id** | **string**| | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **body** | [**Body**](Body.md)| | - **xOrgId** | **string**| | [default to ] - -### Return type - -[**Radiusserverput**](radiusserverput.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - diff --git a/v1/docs/Radiusserverpost.md b/v1/docs/Radiusserverpost.md deleted file mode 100644 index a2d0961..0000000 --- a/v1/docs/Radiusserverpost.md +++ /dev/null @@ -1,16 +0,0 @@ -# Radiusserverpost - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Mfa** | **string** | | [optional] [default to null] -**Name** | **string** | | [default to null] -**NetworkSourceIp** | **string** | | [default to null] -**SharedSecret** | **string** | RADIUS shared secret between the server and client. | [default to null] -**TagNames** | **[]string** | | [optional] [default to null] -**UserLockoutAction** | **string** | | [optional] [default to null] -**UserPasswordExpirationAction** | **string** | | [optional] [default to null] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/v1/docs/Radiusserverput.md b/v1/docs/Radiusserverput.md deleted file mode 100644 index 5f34e6c..0000000 --- a/v1/docs/Radiusserverput.md +++ /dev/null @@ -1,16 +0,0 @@ -# Radiusserverput - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Id** | **string** | | [optional] [default to null] -**Mfa** | **string** | | [optional] [default to null] -**Name** | **string** | | [optional] [default to null] -**NetworkSourceIp** | **string** | | [optional] [default to null] -**TagNames** | **[]string** | | [optional] [default to null] -**UserLockoutAction** | **string** | | [optional] [default to null] -**UserPasswordExpirationAction** | **string** | | [optional] [default to null] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/v1/docs/SearchApi.md b/v1/docs/SearchApi.md deleted file mode 100644 index 622382d..0000000 --- a/v1/docs/SearchApi.md +++ /dev/null @@ -1,142 +0,0 @@ -# \SearchApi - -All URIs are relative to *https://console.jumpcloud.com/api* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**SearchOrganizationsPost**](SearchApi.md#SearchOrganizationsPost) | **Post** /search/organizations | Search Organizations -[**SearchSystemsPost**](SearchApi.md#SearchSystemsPost) | **Post** /search/systems | Search Systems -[**SearchSystemusersPost**](SearchApi.md#SearchSystemusersPost) | **Post** /search/systemusers | Search System Users - - -# **SearchOrganizationsPost** -> Organizationslist SearchOrganizationsPost(ctx, contentType, accept, optional) -Search Organizations - -This endpoint will return Organization data based on your search parameters. This endpoint WILL NOT allow you to add a new Organization. You can use the supported parameters and pass those in the body of request. The parameters must be passed as Content-Type application/json. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/search/organizations \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"search\":{ \"fields\" : [\"settings.name\"], \"searchTerm\": \"Second\" }, \"fields\": [\"_id\", \"displayName\", \"logoUrl\"], \"limit\" : 0, \"skip\" : 0 }' ``` - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **body** | [**Search**](Search.md)| | - **fields** | **string**| Use a space seperated string of field parameters to include the data in the response. If omitted, the default list of fields will be returned. | [default to ] - **filter** | **string**| A filter to apply to the query. | - **limit** | **int32**| The number of records to return at once. Limited to 100. | [default to 10] - **skip** | **int32**| The offset into the records to return. | [default to 0] - -### Return type - -[**Organizationslist**](organizationslist.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **SearchSystemsPost** -> Systemslist SearchSystemsPost(ctx, contentType, accept, optional) -Search Systems - -Return Systems in multi-record format allowing for the passing of the `filter` and `searchFilter` parameters. This WILL NOT allow you to add a new system. To support advanced filtering you can use the `filter` and `searchFilter` parameters that can only be passed in the body of POST /api/search/_* routes. The `filter` and `searchFilter` parameters must be passed as Content-Type application/json. The `filter` parameter is an object with a single property, either `and` or `or` with the value of the property being an array of query expressions. This allows you to filter records using the logic of matching ALL or ANY records in the array of query expressions. If the `and` or `or` are not included the default behavior is to match ALL query expressions. The `searchFilter` parameter allows text searching on supported fields by specifying a `searchTerm` and a list of `fields` to query on. If any `field` has a partial text match on the`searchTerm` the record will be returned. #### Sample Request Exact search for a list of hostnames ``` curl -X POST https://console.jumpcloud.com/api/search/systems \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"filter\": { \"or\": [ {\"hostname\" : \"my-hostname\"}, {\"hostname\" : \"other-hostname\"} ] }, \"fields\" : \"os hostname displayName\" }' ``` Text search for a hostname or display name ``` curl -X POST https://console.jumpcloud.com/api/search/systems \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"searchFilter\": { \"searchTerm\": \"my-host\", \"fields\": [\"hostname\", \"displayName\"] }, \"fields\": \"os hostname displayName\" }' ``` Combining `filter` and `searchFilter` to search for names that match a given OS ``` curl -X POST https://console.jumpcloud.com/api/search/systems \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"searchFilter\": { \"searchTerm\": \"my-host\", \"fields\": [\"hostname\", \"displayName\"] }, \"filter\": { \"or\": [ {\"os\" : \"Ubuntu\"}, {\"os\" : \"Mac OS X\"} ] }, \"fields\": \"os hostname displayName\" }' ``` - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **body** | [**Search**](Search.md)| | - **fields** | **string**| Use a space seperated string of field parameters to include the data in the response. If omitted, the default list of fields will be returned. | [default to ] - **limit** | **int32**| The number of records to return at once. Limited to 100. | [default to 10] - **xOrgId** | **string**| | [default to ] - **skip** | **int32**| The offset into the records to return. | [default to 0] - **filter** | **string**| A filter to apply to the query. | - -### Return type - -[**Systemslist**](systemslist.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **SearchSystemusersPost** -> Systemuserslist SearchSystemusersPost(ctx, contentType, accept, optional) -Search System Users - -Return System Users in multi-record format allowing for the passing of the `filter` and `searchFilter` parameters. This WILL NOT allow you to add a new system user. To support advanced filtering you can use the `filter` and `searchFilter` parameters that can only be passed in the body of POST /api/search/_* routes. The `filter` and `searchFilter` parameters must be passed as Content-Type application/json. The `filter` parameter is an object with a single property, either `and` or `or` with the value of the property being an array of query expressions. This allows you to filter records using the logic of matching ALL or ANY records in the array of query expressions. If the `and` or `or` are not included the default behavior is to match ALL query expressions. The `searchFilter` parameter allows text searching on supported fields by specifying a `searchTerm` and a list of `fields` to query on. If any `field` has a partial text match on the`searchTerm` the record will be returned. #### Sample Request Exact search for a list of system users in a department ``` curl -X POST https://console.jumpcloud.com/api/search/systemusers \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"filter\" : [{\"department\" : \"IT\"}], \"fields\" : \"email username sudo\" }' ``` Text search for system users with and email on a domain ``` curl -X POST https://console.jumpcloud.com/api/search/systemusers \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"searchFilter\" : { \"searchTerm\": \"@jumpcloud.com\", \"fields\": [\"email\"] }, \"fields\" : \"email username sudo\" }' ``` Combining `filter` and `searchFilter` to text search for system users with and email on a domain who are in a list of departments ``` curl -X POST https://console.jumpcloud.com/api/search/systemusers \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"searchFilter\": { \"searchTerm\": \"@jumpcloud.com\", \"fields\": [\"email\"] }, \"filter\": { \"or\": [ {\"department\" : \"IT\"}, {\"department\" : \"Sales\"} ] }, \"fields\" : \"email username sudo\" }' ``` - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **body** | [**Search**](Search.md)| | - **fields** | **string**| Use a space seperated string of field parameters to include the data in the response. If omitted, the default list of fields will be returned. | [default to ] - **filter** | **string**| A filter to apply to the query. | - **limit** | **int32**| The number of records to return at once. Limited to 100. | [default to 10] - **skip** | **int32**| The offset into the records to return. | [default to 0] - **xOrgId** | **string**| | [default to ] - -### Return type - -[**Systemuserslist**](systemuserslist.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - diff --git a/v1/docs/Sshkeylist.md b/v1/docs/Sshkeylist.md deleted file mode 100644 index 34fc467..0000000 --- a/v1/docs/Sshkeylist.md +++ /dev/null @@ -1,13 +0,0 @@ -# Sshkeylist - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Id** | **string** | The ID of the SSH key. | [optional] [default to null] -**CreateDate** | **string** | The date the SSH key was created. | [optional] [default to null] -**Name** | **string** | The name of the SSH key. | [optional] [default to null] -**PublicKey** | **string** | The Public SSH key. | [optional] [default to null] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/v1/docs/System.md b/v1/docs/System.md deleted file mode 100644 index 34de7f1..0000000 --- a/v1/docs/System.md +++ /dev/null @@ -1,36 +0,0 @@ -# System - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Id** | **string** | | [optional] [default to null] -**Active** | **bool** | | [optional] [default to null] -**AgentVersion** | **string** | | [optional] [default to null] -**AllowMultiFactorAuthentication** | **bool** | | [optional] [default to null] -**AllowPublicKeyAuthentication** | **bool** | | [optional] [default to null] -**AllowSshPasswordAuthentication** | **bool** | | [optional] [default to null] -**AllowSshRootLogin** | **bool** | | [optional] [default to null] -**AmazonInstanceID** | **string** | | [optional] [default to null] -**Arch** | **string** | | [optional] [default to null] -**ConnectionHistory** | [**[]interface{}**](interface{}.md) | | [optional] [default to null] -**Created** | **string** | | [optional] [default to null] -**DisplayName** | **string** | | [optional] [default to null] -**Fde** | [***Fde**](fde.md) | | [optional] [default to null] -**Hostname** | **string** | | [optional] [default to null] -**LastContact** | **string** | | [optional] [default to null] -**ModifySSHDConfig** | **bool** | | [optional] [default to null] -**NetworkInterfaces** | [**[]SystemNetworkInterfaces**](system_networkInterfaces.md) | | [optional] [default to null] -**Organization** | **string** | | [optional] [default to null] -**Os** | **string** | | [optional] [default to null] -**RemoteIP** | **string** | | [optional] [default to null] -**SshRootEnabled** | **bool** | | [optional] [default to null] -**SshdParams** | [**[]SystemSshdParams**](system_sshdParams.md) | | [optional] [default to null] -**SystemInsights** | [***SystemSystemInsights**](system_systemInsights.md) | | [optional] [default to null] -**SystemTimezone** | **int32** | | [optional] [default to null] -**Tags** | **[]string** | | [optional] [default to null] -**TemplateName** | **string** | | [optional] [default to null] -**Version** | **string** | | [optional] [default to null] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/v1/docs/SystemsApi.md b/v1/docs/SystemsApi.md deleted file mode 100644 index 30aab44..0000000 --- a/v1/docs/SystemsApi.md +++ /dev/null @@ -1,279 +0,0 @@ -# \SystemsApi - -All URIs are relative to *https://console.jumpcloud.com/api* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**SystemsDelete**](SystemsApi.md#SystemsDelete) | **Delete** /systems/{id} | Delete a System -[**SystemsGet**](SystemsApi.md#SystemsGet) | **Get** /systems/{id} | List an individual system -[**SystemsList**](SystemsApi.md#SystemsList) | **Get** /systems | List All Systems -[**SystemsPut**](SystemsApi.md#SystemsPut) | **Put** /systems/{id} | Update a system -[**SystemsSystemusersBindingList**](SystemsApi.md#SystemsSystemusersBindingList) | **Get** /systems/{id}/systemusers | List system user bindings -[**SystemsSystemusersBindingPut**](SystemsApi.md#SystemsSystemusersBindingPut) | **Put** /systems/{id}/systemusers | Update a system's or user's binding - - -# **SystemsDelete** -> System SystemsDelete(ctx, id, contentType, accept, optional) -Delete a System - -This endpoint allows you to delete a system. This command will cause the system to uninstall the JumpCloud agent from its self which can can take about a minute. If the system is not connected to JumpCloud the system record will simply be removed. #### Sample Request ``` curl -X DELETE https://console.jumpcloud.com/api/systems/{SystemID} \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **id** | **string**| | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **id** | **string**| | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **date** | **string**| Current date header for the System Context API | - **authorization** | **string**| Authorization header for the System Context API | - **xOrgId** | **string**| | [default to ] - -### Return type - -[**System**](system.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **SystemsGet** -> System SystemsGet(ctx, id, contentType, accept, optional) -List an individual system - -This endpoint returns an individual system. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/systems/{SystemID} \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **id** | **string**| | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **id** | **string**| | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **fields** | **string**| Use a space seperated string of field parameters to include the data in the response. If omitted, the default list of fields will be returned. | [default to ] - **filter** | **string**| A filter to apply to the query. | - **date** | **string**| Current date header for the System Context API | - **authorization** | **string**| Authorization header for the System Context API | - **xOrgId** | **string**| | [default to ] - -### Return type - -[**System**](system.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **SystemsList** -> Systemslist SystemsList(ctx, contentType, accept, optional) -List All Systems - -This endpoint returns all Systems. #### Sample Requests ``` curl -X GET https://console.jumpcloud.com/api/systems \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **fields** | **string**| Use a space seperated string of field parameters to include the data in the response. If omitted, the default list of fields will be returned. | [default to ] - **limit** | **int32**| The number of records to return at once. Limited to 100. | [default to 10] - **xOrgId** | **string**| | [default to ] - **search** | **string**| A nested object containing a string `searchTerm` and a list of `fields` to search on. | - **skip** | **int32**| The offset into the records to return. | [default to 0] - **sort** | **string**| Use space separated sort parameters to sort the collection. Default sort is ascending. Prefix with `-` to sort descending. | [default to ] - **filter** | **string**| A filter to apply to the query. | - -### Return type - -[**Systemslist**](systemslist.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **SystemsPut** -> System SystemsPut(ctx, id, contentType, accept, optional) -Update a system - -This endpoint allows you to update a system. #### Sample Request ``` curl -X PUT https://console.jumpcloud.com/api/systems/{SystemID} \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"displayName\":\"Name_Update\", \"allowSshPasswordAuthentication\":\"true\", \"allowSshRootLogin\":\"true\", \"allowMultiFactorAuthentication\":\"true\", \"allowPublicKeyAuthentication\":\"false\" }' ``` - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **id** | **string**| | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **id** | **string**| | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **body** | [**Systemput**](Systemput.md)| | - **date** | **string**| Current date header for the System Context API | - **authorization** | **string**| Authorization header for the System Context API | - **xOrgId** | **string**| | [default to ] - -### Return type - -[**System**](system.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **SystemsSystemusersBindingList** -> Systemuserbinding SystemsSystemusersBindingList(ctx, id, contentType, accept, optional) -List system user bindings - -Hidden as Tags is deprecated List system user bindings for a specific system in a system and user binding format. This endpoint is only used for users still using JumpCloud Tags. If you are using JumpCloud Groups please refer to the documentation found [here](https://docs.jumpcloud.com/2.0/systems/manage-associations-of-a-system). #### Sample Request *List system user bindings for specific system* ``` curl -X https://console.jumpcloud.com/api/systems/{SystemID}/systemusers\\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ \" ``` - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **id** | **string**| | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **id** | **string**| | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **fields** | **string**| Use a space seperated string of field parameters to include the data in the response. If omitted, the default list of fields will be returned. | [default to ] - **limit** | **int32**| The number of records to return at once. Limited to 100. | [default to 10] - **skip** | **int32**| The offset into the records to return. | [default to 0] - **sort** | **string**| Use space separated sort parameters to sort the collection. Default sort is ascending. Prefix with `-` to sort descending. | [default to ] - **filter** | **string**| A filter to apply to the query. | - **xOrgId** | **string**| | [default to ] - -### Return type - -[**Systemuserbinding**](systemuserbinding.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **SystemsSystemusersBindingPut** -> SystemsSystemusersBindingPut(ctx, id, contentType, accept, optional) -Update a system's or user's binding - -Hidden as Tags is deprecated Adds or removes a user binding for a system. This endpoint is only used for users still using JumpCloud Tags. If you are using JumpCloud Groups please refer to the documentation found [here](https://docs.jumpcloud.com/2.0/systems/manage-associations-of-a-system). #### Sample Request *Add (or remove) a system user to (from) a system* ``` curl \\ -d '{ \"add\": [\"[SYSTEM_USER_ID_TO_ADD_HERE]\"], \"remove\": [\"[SYSTEM_USER_ID_TO_REMOVE_HERE]\"] }' \\ -X PUT \\ -H 'Content-Type: application/json' \\ -H 'Accept: application/json' \\ -H \"x-api-key: [YOUR_API_KEY_HERE]\" \\ \"https://console.jumpcloud.com/api/systems/[SYSTEM_ID_HERE]/systemusers - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **id** | **string**| | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **id** | **string**| | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **body** | [**Systemuserbindingsput**](Systemuserbindingsput.md)| | - **xOrgId** | **string**| | [default to ] - -### Return type - - (empty response body) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - diff --git a/v1/docs/Systemuser.md b/v1/docs/Systemuser.md deleted file mode 100644 index 4918767..0000000 --- a/v1/docs/Systemuser.md +++ /dev/null @@ -1,50 +0,0 @@ -# Systemuser - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Id** | **string** | | [optional] [default to null] -**AccountLocked** | **bool** | | [optional] [default to null] -**Activated** | **bool** | | [optional] [default to null] -**AllowPublicKey** | **bool** | | [optional] [default to null] -**AssociatedTagCount** | **int32** | | [optional] [default to null] -**Attributes** | [**[]interface{}**](interface{}.md) | | [optional] [default to null] -**Company** | **string** | | [optional] [default to null] -**CostCenter** | **string** | | [optional] [default to null] -**Created** | **string** | | [optional] [default to null] -**Department** | **string** | | [optional] [default to null] -**Description** | **string** | | [optional] [default to null] -**Displayname** | **string** | | [optional] [default to null] -**Email** | **string** | | [optional] [default to null] -**EmployeeIdentifier** | **string** | Must be unique per user. | [optional] [default to null] -**EmployeeType** | **string** | | [optional] [default to null] -**EnableManagedUid** | **bool** | | [optional] [default to null] -**EnableUserPortalMultifactor** | **bool** | | [optional] [default to null] -**ExternalDn** | **string** | | [optional] [default to null] -**ExternalSourceType** | **string** | | [optional] [default to null] -**ExternallyManaged** | **bool** | | [optional] [default to null] -**Firstname** | **string** | | [optional] [default to null] -**JobTitle** | **string** | | [optional] [default to null] -**Lastname** | **string** | | [optional] [default to null] -**LdapBindingUser** | **bool** | | [optional] [default to null] -**Location** | **string** | | [optional] [default to null] -**Mfa** | [***Mfa**](mfa.md) | | [optional] [default to null] -**Middlename** | **string** | | [optional] [default to null] -**PasswordExpirationDate** | **string** | | [optional] [default to null] -**PasswordExpired** | **bool** | | [optional] [default to null] -**PasswordNeverExpires** | **bool** | | [optional] [default to null] -**PasswordlessSudo** | **bool** | | [optional] [default to null] -**PublicKey** | **string** | | [optional] [default to null] -**SambaServiceUser** | **bool** | | [optional] [default to null] -**SshKeys** | [**[]Sshkeylist**](sshkeylist.md) | | [optional] [default to null] -**Sudo** | **bool** | | [optional] [default to null] -**Suspended** | **bool** | | [optional] [default to null] -**Tags** | **[]string** | | [optional] [default to null] -**TotpEnabled** | **bool** | | [optional] [default to null] -**UnixGuid** | **int32** | | [optional] [default to null] -**UnixUid** | **int32** | | [optional] [default to null] -**Username** | **string** | | [optional] [default to null] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/v1/docs/Systemuserbinding.md b/v1/docs/Systemuserbinding.md deleted file mode 100644 index 5f56054..0000000 --- a/v1/docs/Systemuserbinding.md +++ /dev/null @@ -1,9 +0,0 @@ -# Systemuserbinding - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/v1/docs/Systemuserbindingsput.md b/v1/docs/Systemuserbindingsput.md deleted file mode 100644 index dfaaced..0000000 --- a/v1/docs/Systemuserbindingsput.md +++ /dev/null @@ -1,11 +0,0 @@ -# Systemuserbindingsput - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Add** | **[]string** | The list of systemuser ids to be added to this system. | [default to null] -**Remove** | **[]string** | The list of systemuser ids to be removed from this system. | [default to null] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/v1/docs/Systemuserputpost.md b/v1/docs/Systemuserputpost.md deleted file mode 100644 index 7a63c52..0000000 --- a/v1/docs/Systemuserputpost.md +++ /dev/null @@ -1,47 +0,0 @@ -# Systemuserputpost - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**AccountLocked** | **bool** | | [optional] [default to null] -**Activated** | **bool** | | [optional] [default to null] -**Addresses** | [**[]SystemuserputpostAddresses**](systemuserputpost_addresses.md) | | [optional] [default to null] -**AllowPublicKey** | **bool** | | [optional] [default to null] -**Attributes** | [**[]interface{}**](interface{}.md) | | [optional] [default to null] -**Company** | **string** | | [optional] [default to null] -**CostCenter** | **string** | | [optional] [default to null] -**Department** | **string** | | [optional] [default to null] -**Description** | **string** | | [optional] [default to null] -**Displayname** | **string** | | [optional] [default to null] -**Email** | **string** | | [default to null] -**EmployeeIdentifier** | **string** | Must be unique per user. | [optional] [default to null] -**EmployeeType** | **string** | | [optional] [default to null] -**EnableManagedUid** | **bool** | | [optional] [default to null] -**EnableUserPortalMultifactor** | **bool** | | [optional] [default to null] -**ExternalDn** | **string** | | [optional] [default to null] -**ExternalSourceType** | **string** | | [optional] [default to null] -**ExternallyManaged** | **bool** | | [optional] [default to null] -**Firstname** | **string** | | [optional] [default to null] -**JobTitle** | **string** | | [optional] [default to null] -**Lastname** | **string** | | [optional] [default to null] -**LdapBindingUser** | **bool** | | [optional] [default to null] -**Location** | **string** | | [optional] [default to null] -**Mfa** | [***Mfa**](mfa.md) | | [optional] [default to null] -**Middlename** | **string** | | [optional] [default to null] -**Password** | **string** | | [optional] [default to null] -**PasswordNeverExpires** | **bool** | | [optional] [default to null] -**PasswordlessSudo** | **bool** | | [optional] [default to null] -**PhoneNumbers** | [**[]SystemuserputpostPhoneNumbers**](systemuserputpost_phoneNumbers.md) | | [optional] [default to null] -**PublicKey** | **string** | | [optional] [default to null] -**Relationships** | [**[]interface{}**](interface{}.md) | | [optional] [default to null] -**SambaServiceUser** | **bool** | | [optional] [default to null] -**Sudo** | **bool** | | [optional] [default to null] -**Suspended** | **bool** | | [optional] [default to null] -**Tags** | **[]string** | | [optional] [default to null] -**UnixGuid** | **int32** | | [optional] [default to null] -**UnixUid** | **int32** | | [optional] [default to null] -**Username** | **string** | | [default to null] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/v1/docs/SystemuserputpostAddresses.md b/v1/docs/SystemuserputpostAddresses.md deleted file mode 100644 index b788ebc..0000000 --- a/v1/docs/SystemuserputpostAddresses.md +++ /dev/null @@ -1,17 +0,0 @@ -# SystemuserputpostAddresses - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Country** | **string** | | [optional] [default to null] -**ExtendedAddress** | **string** | | [optional] [default to null] -**Locality** | **string** | | [optional] [default to null] -**PoBox** | **string** | | [optional] [default to null] -**PostalCode** | **string** | | [optional] [default to null] -**Region** | **string** | | [optional] [default to null] -**StreetAddress** | **string** | | [optional] [default to null] -**Type_** | **string** | | [optional] [default to null] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/v1/docs/SystemuserputpostPhoneNumbers.md b/v1/docs/SystemuserputpostPhoneNumbers.md deleted file mode 100644 index 0d0f196..0000000 --- a/v1/docs/SystemuserputpostPhoneNumbers.md +++ /dev/null @@ -1,11 +0,0 @@ -# SystemuserputpostPhoneNumbers - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Number** | **string** | | [optional] [default to null] -**Type_** | **string** | | [optional] [default to null] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/v1/docs/Systemuserreturn.md b/v1/docs/Systemuserreturn.md deleted file mode 100644 index 3f9ca6a..0000000 --- a/v1/docs/Systemuserreturn.md +++ /dev/null @@ -1,54 +0,0 @@ -# Systemuserreturn - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Id** | **string** | | [optional] [default to null] -**AccountLocked** | **bool** | | [optional] [default to null] -**Activated** | **bool** | | [optional] [default to null] -**Addresses** | [**[]SystemuserreturnAddresses**](systemuserreturn_addresses.md) | | [optional] [default to null] -**AllowPublicKey** | **bool** | | [optional] [default to null] -**Attributes** | [**[]interface{}**](interface{}.md) | | [optional] [default to null] -**BadLoginAttempts** | **int32** | | [optional] [default to null] -**Company** | **string** | | [optional] [default to null] -**CostCenter** | **string** | | [optional] [default to null] -**Created** | **string** | | [optional] [default to null] -**Department** | **string** | | [optional] [default to null] -**Description** | **string** | | [optional] [default to null] -**Displayname** | **string** | | [optional] [default to null] -**Email** | **string** | | [optional] [default to null] -**EmployeeIdentifier** | **string** | Must be unique per user. | [optional] [default to null] -**EmployeeType** | **string** | | [optional] [default to null] -**EnableManagedUid** | **bool** | | [optional] [default to null] -**EnableUserPortalMultifactor** | **bool** | | [optional] [default to null] -**ExternalDn** | **string** | | [optional] [default to null] -**ExternalSourceType** | **string** | | [optional] [default to null] -**ExternallyManaged** | **bool** | | [optional] [default to null] -**Firstname** | **string** | | [optional] [default to null] -**JobTitle** | **string** | | [optional] [default to null] -**Lastname** | **string** | | [optional] [default to null] -**LdapBindingUser** | **bool** | | [optional] [default to null] -**Location** | **string** | | [optional] [default to null] -**Mfa** | [***Mfa**](mfa.md) | | [optional] [default to null] -**Middlename** | **string** | | [optional] [default to null] -**Organization** | **string** | | [optional] [default to null] -**PasswordExpirationDate** | **string** | | [optional] [default to null] -**PasswordExpired** | **bool** | | [optional] [default to null] -**PasswordNeverExpires** | **bool** | | [optional] [default to null] -**PasswordlessSudo** | **bool** | | [optional] [default to null] -**PhoneNumbers** | [**[]SystemuserreturnPhoneNumbers**](systemuserreturn_phoneNumbers.md) | | [optional] [default to null] -**PublicKey** | **string** | | [optional] [default to null] -**Relationships** | [**[]interface{}**](interface{}.md) | | [optional] [default to null] -**SambaServiceUser** | **bool** | | [optional] [default to null] -**SshKeys** | [**[]Sshkeylist**](sshkeylist.md) | | [optional] [default to null] -**Sudo** | **bool** | | [optional] [default to null] -**Suspended** | **bool** | | [optional] [default to null] -**Tags** | **[]string** | | [optional] [default to null] -**TotpEnabled** | **bool** | | [optional] [default to null] -**UnixGuid** | **int32** | | [optional] [default to null] -**UnixUid** | **int32** | | [optional] [default to null] -**Username** | **string** | | [optional] [default to null] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/v1/docs/SystemusersApi.md b/v1/docs/SystemusersApi.md deleted file mode 100644 index 658ef5a..0000000 --- a/v1/docs/SystemusersApi.md +++ /dev/null @@ -1,528 +0,0 @@ -# \SystemusersApi - -All URIs are relative to *https://console.jumpcloud.com/api* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**SshkeyDelete**](SystemusersApi.md#SshkeyDelete) | **Delete** /systemusers/{systemuser_id}/sshkeys/{id} | Delete a system user's Public SSH Keys -[**SshkeyList**](SystemusersApi.md#SshkeyList) | **Get** /systemusers/{id}/sshkeys | List a system user's public SSH keys -[**SshkeyPost**](SystemusersApi.md#SshkeyPost) | **Post** /systemusers/{id}/sshkeys | Create a system user's Public SSH Key -[**SystemusersDelete**](SystemusersApi.md#SystemusersDelete) | **Delete** /systemusers/{id} | Delete a system user -[**SystemusersGet**](SystemusersApi.md#SystemusersGet) | **Get** /systemusers/{id} | List a system user -[**SystemusersList**](SystemusersApi.md#SystemusersList) | **Get** /systemusers | List all system users -[**SystemusersPost**](SystemusersApi.md#SystemusersPost) | **Post** /systemusers | Create a system user -[**SystemusersPut**](SystemusersApi.md#SystemusersPut) | **Put** /systemusers/{id} | Update a system user -[**SystemusersResetmfa**](SystemusersApi.md#SystemusersResetmfa) | **Post** /systemusers/{id}/resetmfa | Reset a system user's MFA token -[**SystemusersSystemsBindingList**](SystemusersApi.md#SystemusersSystemsBindingList) | **Get** /systemusers/{id}/systems | List system user binding -[**SystemusersSystemsBindingPut**](SystemusersApi.md#SystemusersSystemsBindingPut) | **Put** /systemusers/{id}/systems | Update a system user binding -[**SystemusersUnlock**](SystemusersApi.md#SystemusersUnlock) | **Post** /systemusers/{id}/unlock | Unlock a system user - - -# **SshkeyDelete** -> SshkeyDelete(ctx, systemuserId, id, contentType, accept, optional) -Delete a system user's Public SSH Keys - -This endpoint will delete a specific System User's SSH Key. - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **systemuserId** | **string**| | - **id** | **string**| | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **systemuserId** | **string**| | - **id** | **string**| | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **xOrgId** | **string**| | [default to ] - -### Return type - - (empty response body) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **SshkeyList** -> []Sshkeylist SshkeyList(ctx, id, contentType, accept, optional) -List a system user's public SSH keys - -This endpoint will return a specific System User's public SSH key. - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **id** | **string**| | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **id** | **string**| | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **xOrgId** | **string**| | [default to ] - -### Return type - -[**[]Sshkeylist**](sshkeylist.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **SshkeyPost** -> Sshkeylist SshkeyPost(ctx, id, contentType, accept, optional) -Create a system user's Public SSH Key - -This endpoint will create a specific System User's Public SSH Key. - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **id** | **string**| | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **id** | **string**| | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **body** | [**Sshkeypost**](Sshkeypost.md)| | - **xOrgId** | **string**| | [default to ] - -### Return type - -[**Sshkeylist**](sshkeylist.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **SystemusersDelete** -> Systemuserreturn SystemusersDelete(ctx, id, contentType, accept, optional) -Delete a system user - -This endpoint allows you to delete a particular system user. #### Sample Request ``` curl -X DELETE https://console.jumpcloud.com/api/systemusers/{UserID} \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **id** | **string**| | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **id** | **string**| | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **xOrgId** | **string**| | [default to ] - -### Return type - -[**Systemuserreturn**](systemuserreturn.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **SystemusersGet** -> Systemuserreturn SystemusersGet(ctx, id, contentType, accept, optional) -List a system user - -This endpoint returns a particular System User. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/systemusers/{UserID} \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **id** | **string**| | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **id** | **string**| | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **fields** | **string**| Use a space seperated string of field parameters to include the data in the response. If omitted, the default list of fields will be returned. | [default to ] - **filter** | **string**| A filter to apply to the query. | - **xOrgId** | **string**| | [default to ] - -### Return type - -[**Systemuserreturn**](systemuserreturn.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **SystemusersList** -> Systemuserslist SystemusersList(ctx, contentType, accept, optional) -List all system users - -This endpoint returns all systemusers. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/systemusers \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **limit** | **int32**| The number of records to return at once. | [default to 10] - **skip** | **int32**| The offset into the records to return. | [default to 0] - **sort** | **string**| The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. | [default to ] - **fields** | **string**| The comma separated fields included in the returned records. If omitted the default list of fields will be returned. | [default to ] - **xOrgId** | **string**| | [default to ] - **search** | **string**| A nested object containing a string `searchTerm` and a list of `fields` to search on. | - **filter** | **string**| A filter to apply to the query. | - -### Return type - -[**Systemuserslist**](systemuserslist.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **SystemusersPost** -> Systemuserreturn SystemusersPost(ctx, contentType, accept, optional) -Create a system user - -This endpoint allows you to create a new system user. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/systemusers \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"username\":\"{username}\", \"email\":\"{email_address}\", \"firstname\":\"{Name}\", \"lastname\":\"{Name}\" }' ``` - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **body** | [**Systemuserputpost**](Systemuserputpost.md)| | - **xOrgId** | **string**| | [default to ] - -### Return type - -[**Systemuserreturn**](systemuserreturn.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **SystemusersPut** -> Systemuserreturn SystemusersPut(ctx, id, contentType, accept, optional) -Update a system user - -This endpoint allows you to update a system user. #### Sample Request ``` curl -X PUT https://console.jumpcloud.com/api/systemusers/{UserID} \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"email\":\"{email_address}\", \"firstname\":\"{Name}\", \"lastname\":\"{Name}\" }' ``` - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **id** | **string**| | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **id** | **string**| | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **body** | [**Systemuserput**](Systemuserput.md)| | - **xOrgId** | **string**| | [default to ] - -### Return type - -[**Systemuserreturn**](systemuserreturn.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **SystemusersResetmfa** -> SystemusersResetmfa(ctx, id, contentType, accept, optional) -Reset a system user's MFA token - -This endpoint allows you to reset the TOTP key for a specified system user and put them in an TOTP MFA enrollment period. This will result in the user being prompted to setup TOTP MFA when logging into userportal. Please be aware that if the user does not complete TOTP MFA setup before the `exclusionUntil` date, they will be locked out of any resources that require TOTP MFA. Please refer to our [Knowledge Base Article](https://support.jumpcloud.com/customer/en/portal/articles/2959138-using-multifactor-authentication-with-jumpcloud) on setting up MFA for more information. #### Sample Request ``` curl -X POST \\ https://console.jumpcloud.com/api/systemusers/{UserID}/resetmfa \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{\"exclusion\": true, \"exclusionUntil\": \"{date-time}\"}' ``` - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **id** | **string**| | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **id** | **string**| | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **body** | [**Body1**](Body1.md)| | - **xOrgId** | **string**| | [default to ] - -### Return type - - (empty response body) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **SystemusersSystemsBindingList** -> interface{} SystemusersSystemsBindingList(ctx, id, contentType, accept, optional) -List system user binding - -Hidden as Tags is deprecated Adds or removes a system binding for a user. This endpoint is only used for users still using JumpCloud Tags. If you are using JumpCloud Groups please refer to the documentation found [here](https://docs.jumpcloud.com/2.0/systems/manage-associations-of-a-system). List system bindings for a specific system user in a system and user binding format. ### Examples #### List system bindings for specific system user ``` curl \\ -H 'Content-Type: application/json' \\ -H \"x-api-key: [YOUR_API_KEY_HERE]\" \\ \"https://console.jumpcloud.com/api/systemusers/[SYSTEM_USER_ID_HERE]/systems\" ``` - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **id** | **string**| | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **id** | **string**| | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **fields** | **string**| Use a space seperated string of field parameters to include the data in the response. If omitted, the default list of fields will be returned. | [default to ] - **limit** | **int32**| The number of records to return at once. Limited to 100. | [default to 10] - **skip** | **int32**| The offset into the records to return. | [default to 0] - **sort** | **string**| Use space separated sort parameters to sort the collection. Default sort is ascending. Prefix with `-` to sort descending. | [default to ] - **filter** | **string**| A filter to apply to the query. | - **xOrgId** | **string**| | [default to ] - -### Return type - -[**interface{}**](interface{}.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **SystemusersSystemsBindingPut** -> Usersystembinding SystemusersSystemsBindingPut(ctx, id, contentType, accept, optional) -Update a system user binding - -Hidden as Tags is deprecated Adds or removes a system binding for a user. This endpoint is only used for users still using JumpCloud Tags. If you are using JumpCloud Groups please refer to the documentation found [here](https://docs.jumpcloud.com/2.0/systems/manage-associations-of-a-system). ### Example #### Add (or remove) system to system user ``` curl \\ -d '{ \"add\": [\"[SYSTEM_ID_TO_ADD_HERE]\"], \"remove\": [\"[SYSTEM_ID_TO_REMOVE_HERE]\"] }' \\ -X PUT \\ -H 'Content-Type: application/json' \\ -H 'Accept: application/json' \\ -H \"x-api-key: [YOUR_API_KEY_HERE]\" \\ \"https://console.jumpcloud.com/api/systemusers/[SYSTEM_USER_ID_HERE]/systems\" ``` - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **id** | **string**| | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **id** | **string**| | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **body** | [**Usersystembindingsput**](Usersystembindingsput.md)| | - **xOrgId** | **string**| | [default to ] - -### Return type - -[**Usersystembinding**](usersystembinding.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **SystemusersUnlock** -> SystemusersUnlock(ctx, id, contentType, accept, optional) -Unlock a system user - -This endpoint allows you to unlock a user's account. - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **id** | **string**| | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **id** | **string**| | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **xOrgId** | **string**| | [default to ] - -### Return type - - (empty response body) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - diff --git a/v1/docs/Tag.md b/v1/docs/Tag.md deleted file mode 100644 index 94a70d8..0000000 --- a/v1/docs/Tag.md +++ /dev/null @@ -1,21 +0,0 @@ -# Tag - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Id** | **string** | | [optional] [default to null] -**Expired** | **bool** | | [optional] [default to null] -**ExternalDN** | **string** | | [optional] [default to null] -**ExternalSourceType** | **string** | | [optional] [default to null] -**ExternallyManaged** | **bool** | | [optional] [default to null] -**GroupGid** | **string** | | [optional] [default to null] -**GroupName** | **string** | | [optional] [default to null] -**Name** | **string** | A unique name for the Tag. | [optional] [default to null] -**RegularExpressions** | **[]string** | | [optional] [default to null] -**SendToLDAP** | **bool** | | [optional] [default to null] -**Systems** | **[]string** | An array of system ids that are associated to the Tag. | [optional] [default to null] -**Systemusers** | **[]string** | An array of system user ids that are associated to the Tag. | [optional] [default to null] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/v1/docs/Tagpost.md b/v1/docs/Tagpost.md deleted file mode 100644 index b56eb9f..0000000 --- a/v1/docs/Tagpost.md +++ /dev/null @@ -1,19 +0,0 @@ -# Tagpost - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**ExternalDN** | **string** | | [optional] [default to null] -**ExternalSourceType** | **string** | | [optional] [default to null] -**ExternallyManaged** | **bool** | | [optional] [default to null] -**GroupGid** | **string** | | [optional] [default to null] -**GroupName** | **string** | | [optional] [default to null] -**Name** | **string** | A unique name for the Tag. | [default to null] -**RegularExpressions** | **[]string** | | [optional] [default to null] -**SendToLDAP** | **bool** | | [optional] [default to null] -**Systems** | **[]string** | An array of system ids that are associated to the Tag. | [optional] [default to null] -**Systemusers** | **[]string** | An array of system user ids that are associated to the Tag. | [optional] [default to null] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/v1/docs/Tagput.md b/v1/docs/Tagput.md deleted file mode 100644 index 25db557..0000000 --- a/v1/docs/Tagput.md +++ /dev/null @@ -1,19 +0,0 @@ -# Tagput - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**ExternalDN** | **string** | | [optional] [default to null] -**ExternalSourceType** | **string** | | [optional] [default to null] -**ExternallyManaged** | **bool** | | [optional] [default to null] -**GroupGid** | **string** | | [optional] [default to null] -**GroupName** | **string** | | [optional] [default to null] -**Name** | **string** | A unique name for the Tag. | [optional] [default to null] -**RegularExpressions** | **[]string** | | [optional] [default to null] -**SendToLDAP** | **bool** | | [optional] [default to null] -**Systems** | **[]string** | An array of system ids that are associated to the Tag. | [optional] [default to null] -**Systemusers** | **[]string** | An array of system user ids that are associated to the Tag. | [optional] [default to null] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/v1/docs/TagsApi.md b/v1/docs/TagsApi.md deleted file mode 100644 index ec8fcbf..0000000 --- a/v1/docs/TagsApi.md +++ /dev/null @@ -1,211 +0,0 @@ -# \TagsApi - -All URIs are relative to *https://console.jumpcloud.com/api* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**TagsDelete**](TagsApi.md#TagsDelete) | **Delete** /tags/{name} | Delete a Tag -[**TagsGet**](TagsApi.md#TagsGet) | **Get** /Tags/{name} | List a Tag -[**TagsList**](TagsApi.md#TagsList) | **Get** /tags | List All Tags -[**TagsPost**](TagsApi.md#TagsPost) | **Post** /tags | Create a Tag -[**TagsPut**](TagsApi.md#TagsPut) | **Put** /Tag/{name} | Update a Tag - - -# **TagsDelete** -> Tag TagsDelete(ctx, name, contentType, accept) -Delete a Tag - -Hidden as Tags is deprecated Delete a Tag. - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **name** | **string**| | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - -### Return type - -[**Tag**](tag.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **TagsGet** -> Tag TagsGet(ctx, name, contentType, accept, optional) -List a Tag - -Hidden as Tags is deprecated Returns a specific tag. - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **name** | **string**| | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **name** | **string**| | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **fields** | **string**| Use a space seperated string of field parameters to include the data in the response. If omitted, the default list of fields will be returned. | [default to ] - **limit** | **int32**| The number of records to return at once. Limited to 100. | [default to 10] - **skip** | **int32**| The offset into the records to return. | [default to 0] - **sort** | **string**| Use space separated sort parameters to sort the collection. Default sort is ascending. Prefix with `-` to sort descending. | [default to ] - **filter** | **string**| A filter to apply to the query. | - -### Return type - -[**Tag**](tag.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **TagsList** -> Tagslist TagsList(ctx, contentType, accept, optional) -List All Tags - -Hidden as Tags is deprecated Returns all Tags. - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **fields** | **string**| Use a space seperated string of field parameters to include the data in the response. If omitted, the default list of fields will be returned. | [default to ] - **limit** | **int32**| The number of records to return at once. Limited to 100. | [default to 10] - **skip** | **int32**| The offset into the records to return. | [default to 0] - **sort** | **string**| Use space separated sort parameters to sort the collection. Default sort is ascending. Prefix with `-` to sort descending. | [default to ] - **filter** | **string**| A filter to apply to the query. | - -### Return type - -[**Tagslist**](tagslist.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **TagsPost** -> Tag TagsPost(ctx, contentType, accept, optional) -Create a Tag - -Hidden as Tags is deprecated Create a tag. ### Examples #### Create a new Tag ``` curl \\ -d '{\"name\" : \"Developers\"}' \\ -X 'POST' \\ -H 'Content-Type: application/json' \\ -H 'Accept: application/json' \\ -H \"x-api-key: [YOUR_API_KEY_HERE]\" \\ \"https://console.jumpcloud.com/api/tags\" ``` - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **body** | [**Tagpost**](Tagpost.md)| | - -### Return type - -[**Tag**](tag.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **TagsPut** -> Tag TagsPut(ctx, name, contentType, accept, optional) -Update a Tag - -Hidden as Tags is deprecated Update a specific tag. - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **name** | **string**| | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **name** | **string**| | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **body** | [**Tagput**](Tagput.md)| | - -### Return type - -[**Tag**](tag.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - diff --git a/v1/docs/Tagslist.md b/v1/docs/Tagslist.md deleted file mode 100644 index ef058ba..0000000 --- a/v1/docs/Tagslist.md +++ /dev/null @@ -1,11 +0,0 @@ -# Tagslist - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Results** | [**[]Tag**](tag.md) | The list of tags. | [optional] [default to null] -**TotalCount** | **int32** | The total number of tags. | [optional] [default to null] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/v1/docs/Usersystembinding.md b/v1/docs/Usersystembinding.md deleted file mode 100644 index 31de0df..0000000 --- a/v1/docs/Usersystembinding.md +++ /dev/null @@ -1,9 +0,0 @@ -# Usersystembinding - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/v1/docs/Usersystembindingsput.md b/v1/docs/Usersystembindingsput.md deleted file mode 100644 index a2ee295..0000000 --- a/v1/docs/Usersystembindingsput.md +++ /dev/null @@ -1,11 +0,0 @@ -# Usersystembindingsput - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Add** | **[]string** | The list of system ids to be added to this user. | [default to null] -**Remove** | **[]string** | The list of system ids to be removed from this user. | [default to null] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/v1/errorresponse.go b/v1/errorresponse.go deleted file mode 100644 index 7cb47c2..0000000 --- a/v1/errorresponse.go +++ /dev/null @@ -1,15 +0,0 @@ -/* - * JumpCloud APIs - * - * JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, & system users. - * - * API version: 1.0 - * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) - */ - -package v1 - -type Errorresponse struct { - - Message string `json:"message,omitempty"` -} diff --git a/v1/fde.go b/v1/fde.go deleted file mode 100644 index c9e6356..0000000 --- a/v1/fde.go +++ /dev/null @@ -1,17 +0,0 @@ -/* - * JumpCloud APIs - * - * JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, & system users. - * - * API version: 1.0 - * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) - */ - -package v1 - -type Fde struct { - - Active bool `json:"active,omitempty"` - - KeyPresent bool `json:"keyPresent,omitempty"` -} diff --git a/v1/mfa.go b/v1/mfa.go deleted file mode 100644 index c06c983..0000000 --- a/v1/mfa.go +++ /dev/null @@ -1,23 +0,0 @@ -/* - * JumpCloud APIs - * - * JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, & system users. - * - * API version: 1.0 - * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) - */ - -package v1 - -import ( - "time" -) - -type Mfa struct { - - Configured bool `json:"configured,omitempty"` - - Exclusion bool `json:"exclusion,omitempty"` - - ExclusionUntil time.Time `json:"exclusionUntil,omitempty"` -} diff --git a/v1/organizations_api.go b/v1/organizations_api.go deleted file mode 100644 index ccc46e0..0000000 --- a/v1/organizations_api.go +++ /dev/null @@ -1,150 +0,0 @@ -/* - * JumpCloud APIs - * - * JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, & system users. - * - * API version: 1.0 - * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) - */ - -package v1 - -import ( - "io/ioutil" - "net/url" - "net/http" - "strings" - "golang.org/x/net/context" - "encoding/json" -) - -// Linger please -var ( - _ context.Context -) - -type OrganizationsApiService service - - -/* OrganizationsApiService Get Organization Details - This endpoint returns Organization Details. #### Sample Request ``` curl -X GET \\ https://console.jumpcloud.com/api/organizations \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - * @param ctx context.Context for authentication, logging, tracing, etc. - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "fields" (string) Use a space seperated string of field parameters to include the data in the response. If omitted, the default list of fields will be returned. - @param "filter" (string) A filter to apply to the query. - @param "limit" (int32) The number of records to return at once. Limited to 100. - @param "skip" (int32) The offset into the records to return. - @param "sort" (string) Use space separated sort parameters to sort the collection. Default sort is ascending. Prefix with `-` to sort descending. - @param "search" (string) A nested object containing a string `searchTerm` and a list of `fields` to search on. - @return Organizationslist*/ -func (a *OrganizationsApiService) OrganizationList(ctx context.Context, contentType string, accept string, localVarOptionals map[string]interface{}) (Organizationslist, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload Organizationslist - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/organizations" - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["fields"], "string", "fields"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["filter"], "string", "filter"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["limit"], "int32", "limit"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["skip"], "int32", "skip"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["sort"], "string", "sort"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["search"], "string", "search"); err != nil { - return successPayload, nil, err - } - - if localVarTempParam, localVarOk := localVarOptionals["fields"].(string); localVarOk { - localVarQueryParams.Add("fields", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["filter"].(string); localVarOk { - localVarQueryParams.Add("filter", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["limit"].(int32); localVarOk { - localVarQueryParams.Add("limit", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["skip"].(int32); localVarOk { - localVarQueryParams.Add("skip", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["sort"].(string); localVarOk { - localVarQueryParams.Add("sort", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["search"].(string); localVarOk { - localVarQueryParams.Add("search", parameterToString(localVarTempParam, "")) - } - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - diff --git a/v1/organizationslist.go b/v1/organizationslist.go deleted file mode 100644 index 8ff45e5..0000000 --- a/v1/organizationslist.go +++ /dev/null @@ -1,19 +0,0 @@ -/* - * JumpCloud APIs - * - * JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, & system users. - * - * API version: 1.0 - * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) - */ - -package v1 - -type Organizationslist struct { - - // The list of organizations. - Results []OrganizationslistResults `json:"results,omitempty"` - - // The total number of organizations. - TotalCount int32 `json:"totalCount,omitempty"` -} diff --git a/v1/organizationslist_results.go b/v1/organizationslist_results.go deleted file mode 100644 index 3b3fabf..0000000 --- a/v1/organizationslist_results.go +++ /dev/null @@ -1,22 +0,0 @@ -/* - * JumpCloud APIs - * - * JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, & system users. - * - * API version: 1.0 - * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) - */ - -package v1 - -type OrganizationslistResults struct { - - // The ID of the organization. - Id string `json:"_id,omitempty"` - - // The name of the organization. - DisplayName string `json:"displayName,omitempty"` - - // The organization logo image URL. - LogoUrl string `json:"logoUrl,omitempty"` -} diff --git a/v1/radius_servers_api.go b/v1/radius_servers_api.go deleted file mode 100644 index d4cb171..0000000 --- a/v1/radius_servers_api.go +++ /dev/null @@ -1,337 +0,0 @@ -/* - * JumpCloud APIs - * - * JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, & system users. - * - * API version: 1.0 - * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) - */ - -package v1 - -import ( - "io/ioutil" - "net/url" - "net/http" - "strings" - "golang.org/x/net/context" - "encoding/json" - "fmt" -) - -// Linger please -var ( - _ context.Context -) - -type RadiusServersApiService service - - -/* RadiusServersApiService List Radius Servers - This endpoint allows you to get a list of all RADIUS servers in your organization. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/radiusservers/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ ``` - * @param ctx context.Context for authentication, logging, tracing, etc. - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "fields" (string) Use a space seperated string of field parameters to include the data in the response. If omitted, the default list of fields will be returned. - @param "filter" (string) A filter to apply to the query. - @param "limit" (int32) The number of records to return at once. Limited to 100. - @param "skip" (int32) The offset into the records to return. - @param "sort" (string) Use space separated sort parameters to sort the collection. Default sort is ascending. Prefix with `-` to sort descending. - @param "xOrgId" (string) - @return Radiusserverslist*/ -func (a *RadiusServersApiService) RadiusServersList(ctx context.Context, contentType string, accept string, localVarOptionals map[string]interface{}) (Radiusserverslist, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload Radiusserverslist - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/radiusservers" - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["fields"], "string", "fields"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["filter"], "string", "filter"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["limit"], "int32", "limit"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["skip"], "int32", "skip"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["sort"], "string", "sort"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return successPayload, nil, err - } - - if localVarTempParam, localVarOk := localVarOptionals["fields"].(string); localVarOk { - localVarQueryParams.Add("fields", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["filter"].(string); localVarOk { - localVarQueryParams.Add("filter", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["limit"].(int32); localVarOk { - localVarQueryParams.Add("limit", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["skip"].(int32); localVarOk { - localVarQueryParams.Add("skip", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["sort"].(string); localVarOk { - localVarQueryParams.Add("sort", parameterToString(localVarTempParam, "")) - } - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* RadiusServersApiService Create a Radius Server - This endpoint allows you to create RADIUS servers in your organization. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/radiusservers/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"name\": \"{test_radius}\", \"networkSourceIp\": \"{0.0.0.0}\", \"sharedSecret\":\"{secretpassword}\", \"userLockoutAction\": \"REMOVE\", \"userPasswordExpirationAction\": \"MAINTAIN\" }' ``` - * @param ctx context.Context for authentication, logging, tracing, etc. - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "body" (Radiusserverpost) - @param "xOrgId" (string) - @return Radiusserver*/ -func (a *RadiusServersApiService) RadiusServersPost(ctx context.Context, contentType string, accept string, localVarOptionals map[string]interface{}) (Radiusserver, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Post") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload Radiusserver - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/radiusservers" - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return successPayload, nil, err - } - - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - // body params - if localVarTempParam, localVarOk := localVarOptionals["body"].(Radiusserverpost); localVarOk { - localVarPostBody = &localVarTempParam - } - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* RadiusServersApiService Update Radius Servers - This endpoint allows you to update RADIUS servers in your organization. #### ``` curl -X PUT https://console.jumpcloud.com/api/radiusservers/{ServerID} \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"name\": \"{name_update}\", \"networkSourceIp\": \"{0.0.0.0}\", \"userLockoutAction\": \"REMOVE\", \"userPasswordExpirationAction\": \"MAINTAIN\" }' ``` - * @param ctx context.Context for authentication, logging, tracing, etc. - @param id - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "body" (Body) - @param "xOrgId" (string) - @return Radiusserverput*/ -func (a *RadiusServersApiService) RadiusServersPut(ctx context.Context, id string, contentType string, accept string, localVarOptionals map[string]interface{}) (Radiusserverput, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Put") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload Radiusserverput - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/radiusservers/{id}" - localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return successPayload, nil, err - } - - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - // body params - if localVarTempParam, localVarOk := localVarOptionals["body"].(Body); localVarOk { - localVarPostBody = &localVarTempParam - } - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - diff --git a/v1/radiusserver.go b/v1/radiusserver.go deleted file mode 100644 index 15ddfcf..0000000 --- a/v1/radiusserver.go +++ /dev/null @@ -1,33 +0,0 @@ -/* - * JumpCloud APIs - * - * JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, & system users. - * - * API version: 1.0 - * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) - */ - -package v1 - -type Radiusserver struct { - - Id string `json:"_id,omitempty"` - - Mfa string `json:"mfa,omitempty"` - - Name string `json:"name,omitempty"` - - NetworkSourceIp string `json:"networkSourceIp,omitempty"` - - Organization string `json:"organization,omitempty"` - - SharedSecret string `json:"sharedSecret,omitempty"` - - TagNames []string `json:"tagNames,omitempty"` - - Tags []string `json:"tags,omitempty"` - - UserLockoutAction string `json:"userLockoutAction,omitempty"` - - UserPasswordExpirationAction string `json:"userPasswordExpirationAction,omitempty"` -} diff --git a/v1/radiusserverpost.go b/v1/radiusserverpost.go deleted file mode 100644 index 39fc22a..0000000 --- a/v1/radiusserverpost.go +++ /dev/null @@ -1,28 +0,0 @@ -/* - * JumpCloud APIs - * - * JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, & system users. - * - * API version: 1.0 - * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) - */ - -package v1 - -type Radiusserverpost struct { - - Mfa string `json:"mfa,omitempty"` - - Name string `json:"name"` - - NetworkSourceIp string `json:"networkSourceIp"` - - // RADIUS shared secret between the server and client. - SharedSecret string `json:"sharedSecret"` - - TagNames []string `json:"tagNames,omitempty"` - - UserLockoutAction string `json:"userLockoutAction,omitempty"` - - UserPasswordExpirationAction string `json:"userPasswordExpirationAction,omitempty"` -} diff --git a/v1/radiusserverput.go b/v1/radiusserverput.go deleted file mode 100644 index f23e49a..0000000 --- a/v1/radiusserverput.go +++ /dev/null @@ -1,27 +0,0 @@ -/* - * JumpCloud APIs - * - * JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, & system users. - * - * API version: 1.0 - * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) - */ - -package v1 - -type Radiusserverput struct { - - Id string `json:"_id,omitempty"` - - Mfa string `json:"mfa,omitempty"` - - Name string `json:"name,omitempty"` - - NetworkSourceIp string `json:"networkSourceIp,omitempty"` - - TagNames []string `json:"tagNames,omitempty"` - - UserLockoutAction string `json:"userLockoutAction,omitempty"` - - UserPasswordExpirationAction string `json:"userPasswordExpirationAction,omitempty"` -} diff --git a/v1/radiusserverslist.go b/v1/radiusserverslist.go deleted file mode 100644 index 8a43801..0000000 --- a/v1/radiusserverslist.go +++ /dev/null @@ -1,17 +0,0 @@ -/* - * JumpCloud APIs - * - * JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, & system users. - * - * API version: 1.0 - * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) - */ - -package v1 - -type Radiusserverslist struct { - - Results []Radiusserver `json:"results,omitempty"` - - TotalCount int32 `json:"totalCount,omitempty"` -} diff --git a/v1/search.go b/v1/search.go deleted file mode 100644 index bb43de4..0000000 --- a/v1/search.go +++ /dev/null @@ -1,19 +0,0 @@ -/* - * JumpCloud APIs - * - * JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, & system users. - * - * API version: 1.0 - * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) - */ - -package v1 - -type Search struct { - - Fields string `json:"fields,omitempty"` - - Filter *interface{} `json:"filter,omitempty"` - - SearchFilter *interface{} `json:"searchFilter,omitempty"` -} diff --git a/v1/search_api.go b/v1/search_api.go deleted file mode 100644 index 21d462f..0000000 --- a/v1/search_api.go +++ /dev/null @@ -1,381 +0,0 @@ -/* - * JumpCloud APIs - * - * JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, & system users. - * - * API version: 1.0 - * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) - */ - -package v1 - -import ( - "io/ioutil" - "net/url" - "net/http" - "strings" - "golang.org/x/net/context" - "encoding/json" -) - -// Linger please -var ( - _ context.Context -) - -type SearchApiService service - - -/* SearchApiService Search Organizations - This endpoint will return Organization data based on your search parameters. This endpoint WILL NOT allow you to add a new Organization. You can use the supported parameters and pass those in the body of request. The parameters must be passed as Content-Type application/json. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/search/organizations \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"search\":{ \"fields\" : [\"settings.name\"], \"searchTerm\": \"Second\" }, \"fields\": [\"_id\", \"displayName\", \"logoUrl\"], \"limit\" : 0, \"skip\" : 0 }' ``` - * @param ctx context.Context for authentication, logging, tracing, etc. - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "body" (Search) - @param "fields" (string) Use a space seperated string of field parameters to include the data in the response. If omitted, the default list of fields will be returned. - @param "filter" (string) A filter to apply to the query. - @param "limit" (int32) The number of records to return at once. Limited to 100. - @param "skip" (int32) The offset into the records to return. - @return Organizationslist*/ -func (a *SearchApiService) SearchOrganizationsPost(ctx context.Context, contentType string, accept string, localVarOptionals map[string]interface{}) (Organizationslist, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Post") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload Organizationslist - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/search/organizations" - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["fields"], "string", "fields"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["filter"], "string", "filter"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["limit"], "int32", "limit"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["skip"], "int32", "skip"); err != nil { - return successPayload, nil, err - } - - if localVarTempParam, localVarOk := localVarOptionals["fields"].(string); localVarOk { - localVarQueryParams.Add("fields", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["filter"].(string); localVarOk { - localVarQueryParams.Add("filter", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["limit"].(int32); localVarOk { - localVarQueryParams.Add("limit", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["skip"].(int32); localVarOk { - localVarQueryParams.Add("skip", parameterToString(localVarTempParam, "")) - } - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - // body params - if localVarTempParam, localVarOk := localVarOptionals["body"].(Search); localVarOk { - localVarPostBody = &localVarTempParam - } - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* SearchApiService Search Systems - Return Systems in multi-record format allowing for the passing of the `filter` and `searchFilter` parameters. This WILL NOT allow you to add a new system. To support advanced filtering you can use the `filter` and `searchFilter` parameters that can only be passed in the body of POST /api/search/_* routes. The `filter` and `searchFilter` parameters must be passed as Content-Type application/json. The `filter` parameter is an object with a single property, either `and` or `or` with the value of the property being an array of query expressions. This allows you to filter records using the logic of matching ALL or ANY records in the array of query expressions. If the `and` or `or` are not included the default behavior is to match ALL query expressions. The `searchFilter` parameter allows text searching on supported fields by specifying a `searchTerm` and a list of `fields` to query on. If any `field` has a partial text match on the`searchTerm` the record will be returned. #### Sample Request Exact search for a list of hostnames ``` curl -X POST https://console.jumpcloud.com/api/search/systems \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"filter\": { \"or\": [ {\"hostname\" : \"my-hostname\"}, {\"hostname\" : \"other-hostname\"} ] }, \"fields\" : \"os hostname displayName\" }' ``` Text search for a hostname or display name ``` curl -X POST https://console.jumpcloud.com/api/search/systems \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"searchFilter\": { \"searchTerm\": \"my-host\", \"fields\": [\"hostname\", \"displayName\"] }, \"fields\": \"os hostname displayName\" }' ``` Combining `filter` and `searchFilter` to search for names that match a given OS ``` curl -X POST https://console.jumpcloud.com/api/search/systems \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"searchFilter\": { \"searchTerm\": \"my-host\", \"fields\": [\"hostname\", \"displayName\"] }, \"filter\": { \"or\": [ {\"os\" : \"Ubuntu\"}, {\"os\" : \"Mac OS X\"} ] }, \"fields\": \"os hostname displayName\" }' ``` - * @param ctx context.Context for authentication, logging, tracing, etc. - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "body" (Search) - @param "fields" (string) Use a space seperated string of field parameters to include the data in the response. If omitted, the default list of fields will be returned. - @param "limit" (int32) The number of records to return at once. Limited to 100. - @param "xOrgId" (string) - @param "skip" (int32) The offset into the records to return. - @param "filter" (string) A filter to apply to the query. - @return Systemslist*/ -func (a *SearchApiService) SearchSystemsPost(ctx context.Context, contentType string, accept string, localVarOptionals map[string]interface{}) (Systemslist, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Post") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload Systemslist - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/search/systems" - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["fields"], "string", "fields"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["limit"], "int32", "limit"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["skip"], "int32", "skip"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["filter"], "string", "filter"); err != nil { - return successPayload, nil, err - } - - if localVarTempParam, localVarOk := localVarOptionals["fields"].(string); localVarOk { - localVarQueryParams.Add("fields", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["limit"].(int32); localVarOk { - localVarQueryParams.Add("limit", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["skip"].(int32); localVarOk { - localVarQueryParams.Add("skip", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["filter"].(string); localVarOk { - localVarQueryParams.Add("filter", parameterToString(localVarTempParam, "")) - } - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - // body params - if localVarTempParam, localVarOk := localVarOptionals["body"].(Search); localVarOk { - localVarPostBody = &localVarTempParam - } - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* SearchApiService Search System Users - Return System Users in multi-record format allowing for the passing of the `filter` and `searchFilter` parameters. This WILL NOT allow you to add a new system user. To support advanced filtering you can use the `filter` and `searchFilter` parameters that can only be passed in the body of POST /api/search/_* routes. The `filter` and `searchFilter` parameters must be passed as Content-Type application/json. The `filter` parameter is an object with a single property, either `and` or `or` with the value of the property being an array of query expressions. This allows you to filter records using the logic of matching ALL or ANY records in the array of query expressions. If the `and` or `or` are not included the default behavior is to match ALL query expressions. The `searchFilter` parameter allows text searching on supported fields by specifying a `searchTerm` and a list of `fields` to query on. If any `field` has a partial text match on the`searchTerm` the record will be returned. #### Sample Request Exact search for a list of system users in a department ``` curl -X POST https://console.jumpcloud.com/api/search/systemusers \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"filter\" : [{\"department\" : \"IT\"}], \"fields\" : \"email username sudo\" }' ``` Text search for system users with and email on a domain ``` curl -X POST https://console.jumpcloud.com/api/search/systemusers \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"searchFilter\" : { \"searchTerm\": \"@jumpcloud.com\", \"fields\": [\"email\"] }, \"fields\" : \"email username sudo\" }' ``` Combining `filter` and `searchFilter` to text search for system users with and email on a domain who are in a list of departments ``` curl -X POST https://console.jumpcloud.com/api/search/systemusers \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"searchFilter\": { \"searchTerm\": \"@jumpcloud.com\", \"fields\": [\"email\"] }, \"filter\": { \"or\": [ {\"department\" : \"IT\"}, {\"department\" : \"Sales\"} ] }, \"fields\" : \"email username sudo\" }' ``` - * @param ctx context.Context for authentication, logging, tracing, etc. - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "body" (Search) - @param "fields" (string) Use a space seperated string of field parameters to include the data in the response. If omitted, the default list of fields will be returned. - @param "filter" (string) A filter to apply to the query. - @param "limit" (int32) The number of records to return at once. Limited to 100. - @param "skip" (int32) The offset into the records to return. - @param "xOrgId" (string) - @return Systemuserslist*/ -func (a *SearchApiService) SearchSystemusersPost(ctx context.Context, contentType string, accept string, localVarOptionals map[string]interface{}) (Systemuserslist, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Post") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload Systemuserslist - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/search/systemusers" - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["fields"], "string", "fields"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["filter"], "string", "filter"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["limit"], "int32", "limit"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["skip"], "int32", "skip"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return successPayload, nil, err - } - - if localVarTempParam, localVarOk := localVarOptionals["fields"].(string); localVarOk { - localVarQueryParams.Add("fields", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["filter"].(string); localVarOk { - localVarQueryParams.Add("filter", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["limit"].(int32); localVarOk { - localVarQueryParams.Add("limit", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["skip"].(int32); localVarOk { - localVarQueryParams.Add("skip", parameterToString(localVarTempParam, "")) - } - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - // body params - if localVarTempParam, localVarOk := localVarOptionals["body"].(Search); localVarOk { - localVarPostBody = &localVarTempParam - } - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - diff --git a/v1/sshkeylist.go b/v1/sshkeylist.go deleted file mode 100644 index 90e8fcc..0000000 --- a/v1/sshkeylist.go +++ /dev/null @@ -1,25 +0,0 @@ -/* - * JumpCloud APIs - * - * JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, & system users. - * - * API version: 1.0 - * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) - */ - -package v1 - -type Sshkeylist struct { - - // The ID of the SSH key. - Id string `json:"_id,omitempty"` - - // The date the SSH key was created. - CreateDate string `json:"create_date,omitempty"` - - // The name of the SSH key. - Name string `json:"name,omitempty"` - - // The Public SSH key. - PublicKey string `json:"public_key,omitempty"` -} diff --git a/v1/sshkeypost.go b/v1/sshkeypost.go deleted file mode 100644 index fd07efb..0000000 --- a/v1/sshkeypost.go +++ /dev/null @@ -1,19 +0,0 @@ -/* - * JumpCloud APIs - * - * JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, & system users. - * - * API version: 1.0 - * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) - */ - -package v1 - -type Sshkeypost struct { - - // The name of the SSH key. - Name string `json:"name"` - - // The Public SSH key. - PublicKey string `json:"public_key"` -} diff --git a/v1/system.go b/v1/system.go deleted file mode 100644 index d2a44f7..0000000 --- a/v1/system.go +++ /dev/null @@ -1,67 +0,0 @@ -/* - * JumpCloud APIs - * - * JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, & system users. - * - * API version: 1.0 - * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) - */ - -package v1 - -type System struct { - - Id string `json:"_id,omitempty"` - - Active bool `json:"active,omitempty"` - - AgentVersion string `json:"agentVersion,omitempty"` - - AllowMultiFactorAuthentication bool `json:"allowMultiFactorAuthentication,omitempty"` - - AllowPublicKeyAuthentication bool `json:"allowPublicKeyAuthentication,omitempty"` - - AllowSshPasswordAuthentication bool `json:"allowSshPasswordAuthentication,omitempty"` - - AllowSshRootLogin bool `json:"allowSshRootLogin,omitempty"` - - AmazonInstanceID string `json:"amazonInstanceID,omitempty"` - - Arch string `json:"arch,omitempty"` - - ConnectionHistory []interface{} `json:"connectionHistory,omitempty"` - - Created string `json:"created,omitempty"` - - DisplayName string `json:"displayName,omitempty"` - - Fde *Fde `json:"fde,omitempty"` - - Hostname string `json:"hostname,omitempty"` - - LastContact string `json:"lastContact,omitempty"` - - ModifySSHDConfig bool `json:"modifySSHDConfig,omitempty"` - - NetworkInterfaces []SystemNetworkInterfaces `json:"networkInterfaces,omitempty"` - - Organization string `json:"organization,omitempty"` - - Os string `json:"os,omitempty"` - - RemoteIP string `json:"remoteIP,omitempty"` - - SshRootEnabled bool `json:"sshRootEnabled,omitempty"` - - SshdParams []SystemSshdParams `json:"sshdParams,omitempty"` - - SystemInsights *SystemSystemInsights `json:"systemInsights,omitempty"` - - SystemTimezone int32 `json:"systemTimezone,omitempty"` - - Tags []string `json:"tags,omitempty"` - - TemplateName string `json:"templateName,omitempty"` - - Version string `json:"version,omitempty"` -} diff --git a/v1/system_network_interfaces.go b/v1/system_network_interfaces.go deleted file mode 100644 index a1a4ac1..0000000 --- a/v1/system_network_interfaces.go +++ /dev/null @@ -1,21 +0,0 @@ -/* - * JumpCloud APIs - * - * JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, & system users. - * - * API version: 1.0 - * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) - */ - -package v1 - -type SystemNetworkInterfaces struct { - - Address string `json:"address,omitempty"` - - Family string `json:"family,omitempty"` - - Internal bool `json:"internal,omitempty"` - - Name string `json:"name,omitempty"` -} diff --git a/v1/system_sshd_params.go b/v1/system_sshd_params.go deleted file mode 100644 index 49dcb10..0000000 --- a/v1/system_sshd_params.go +++ /dev/null @@ -1,17 +0,0 @@ -/* - * JumpCloud APIs - * - * JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, & system users. - * - * API version: 1.0 - * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) - */ - -package v1 - -type SystemSshdParams struct { - - Name string `json:"name,omitempty"` - - Value string `json:"value,omitempty"` -} diff --git a/v1/system_system_insights.go b/v1/system_system_insights.go deleted file mode 100644 index a3bedd0..0000000 --- a/v1/system_system_insights.go +++ /dev/null @@ -1,15 +0,0 @@ -/* - * JumpCloud APIs - * - * JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, & system users. - * - * API version: 1.0 - * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) - */ - -package v1 - -type SystemSystemInsights struct { - - State string `json:"state,omitempty"` -} diff --git a/v1/systemput.go b/v1/systemput.go deleted file mode 100644 index 93dd44f..0000000 --- a/v1/systemput.go +++ /dev/null @@ -1,27 +0,0 @@ -/* - * JumpCloud APIs - * - * JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, & system users. - * - * API version: 1.0 - * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) - */ - -package v1 - -type Systemput struct { - - AgentBoundMessages []SystemputAgentBoundMessages `json:"agentBoundMessages,omitempty"` - - AllowMultiFactorAuthentication bool `json:"allowMultiFactorAuthentication,omitempty"` - - AllowPublicKeyAuthentication bool `json:"allowPublicKeyAuthentication,omitempty"` - - AllowSshPasswordAuthentication bool `json:"allowSshPasswordAuthentication,omitempty"` - - AllowSshRootLogin bool `json:"allowSshRootLogin,omitempty"` - - DisplayName string `json:"displayName,omitempty"` - - Tags []string `json:"tags,omitempty"` -} diff --git a/v1/systemput_agent_bound_messages.go b/v1/systemput_agent_bound_messages.go deleted file mode 100644 index 7d7677f..0000000 --- a/v1/systemput_agent_bound_messages.go +++ /dev/null @@ -1,15 +0,0 @@ -/* - * JumpCloud APIs - * - * JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, & system users. - * - * API version: 1.0 - * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) - */ - -package v1 - -type SystemputAgentBoundMessages struct { - - Cmd string `json:"cmd,omitempty"` -} diff --git a/v1/systems_api.go b/v1/systems_api.go deleted file mode 100644 index ee72498..0000000 --- a/v1/systems_api.go +++ /dev/null @@ -1,698 +0,0 @@ -/* - * JumpCloud APIs - * - * JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, & system users. - * - * API version: 1.0 - * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) - */ - -package v1 - -import ( - "io/ioutil" - "net/url" - "net/http" - "strings" - "golang.org/x/net/context" - "encoding/json" - "fmt" -) - -// Linger please -var ( - _ context.Context -) - -type SystemsApiService service - - -/* SystemsApiService Delete a System - This endpoint allows you to delete a system. This command will cause the system to uninstall the JumpCloud agent from its self which can can take about a minute. If the system is not connected to JumpCloud the system record will simply be removed. #### Sample Request ``` curl -X DELETE https://console.jumpcloud.com/api/systems/{SystemID} \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - * @param ctx context.Context for authentication, logging, tracing, etc. - @param id - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "date" (string) Current date header for the System Context API - @param "authorization" (string) Authorization header for the System Context API - @param "xOrgId" (string) - @return System*/ -func (a *SystemsApiService) SystemsDelete(ctx context.Context, id string, contentType string, accept string, localVarOptionals map[string]interface{}) (System, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Delete") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload System - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/systems/{id}" - localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["date"], "string", "date"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["authorization"], "string", "authorization"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return successPayload, nil, err - } - - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if localVarTempParam, localVarOk := localVarOptionals["date"].(string); localVarOk { - localVarHeaderParams["Date"] = parameterToString(localVarTempParam, "") - } - if localVarTempParam, localVarOk := localVarOptionals["authorization"].(string); localVarOk { - localVarHeaderParams["Authorization"] = parameterToString(localVarTempParam, "") - } - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* SystemsApiService List an individual system - This endpoint returns an individual system. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/systems/{SystemID} \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - * @param ctx context.Context for authentication, logging, tracing, etc. - @param id - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "fields" (string) Use a space seperated string of field parameters to include the data in the response. If omitted, the default list of fields will be returned. - @param "filter" (string) A filter to apply to the query. - @param "date" (string) Current date header for the System Context API - @param "authorization" (string) Authorization header for the System Context API - @param "xOrgId" (string) - @return System*/ -func (a *SystemsApiService) SystemsGet(ctx context.Context, id string, contentType string, accept string, localVarOptionals map[string]interface{}) (System, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload System - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/systems/{id}" - localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["fields"], "string", "fields"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["filter"], "string", "filter"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["date"], "string", "date"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["authorization"], "string", "authorization"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return successPayload, nil, err - } - - if localVarTempParam, localVarOk := localVarOptionals["fields"].(string); localVarOk { - localVarQueryParams.Add("fields", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["filter"].(string); localVarOk { - localVarQueryParams.Add("filter", parameterToString(localVarTempParam, "")) - } - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if localVarTempParam, localVarOk := localVarOptionals["date"].(string); localVarOk { - localVarHeaderParams["Date"] = parameterToString(localVarTempParam, "") - } - if localVarTempParam, localVarOk := localVarOptionals["authorization"].(string); localVarOk { - localVarHeaderParams["Authorization"] = parameterToString(localVarTempParam, "") - } - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* SystemsApiService List All Systems - This endpoint returns all Systems. #### Sample Requests ``` curl -X GET https://console.jumpcloud.com/api/systems \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - * @param ctx context.Context for authentication, logging, tracing, etc. - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "fields" (string) Use a space seperated string of field parameters to include the data in the response. If omitted, the default list of fields will be returned. - @param "limit" (int32) The number of records to return at once. Limited to 100. - @param "xOrgId" (string) - @param "search" (string) A nested object containing a string `searchTerm` and a list of `fields` to search on. - @param "skip" (int32) The offset into the records to return. - @param "sort" (string) Use space separated sort parameters to sort the collection. Default sort is ascending. Prefix with `-` to sort descending. - @param "filter" (string) A filter to apply to the query. - @return Systemslist*/ -func (a *SystemsApiService) SystemsList(ctx context.Context, contentType string, accept string, localVarOptionals map[string]interface{}) (Systemslist, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload Systemslist - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/systems" - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["fields"], "string", "fields"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["limit"], "int32", "limit"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["search"], "string", "search"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["skip"], "int32", "skip"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["sort"], "string", "sort"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["filter"], "string", "filter"); err != nil { - return successPayload, nil, err - } - - if localVarTempParam, localVarOk := localVarOptionals["fields"].(string); localVarOk { - localVarQueryParams.Add("fields", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["limit"].(int32); localVarOk { - localVarQueryParams.Add("limit", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["search"].(string); localVarOk { - localVarQueryParams.Add("search", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["skip"].(int32); localVarOk { - localVarQueryParams.Add("skip", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["sort"].(string); localVarOk { - localVarQueryParams.Add("sort", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["filter"].(string); localVarOk { - localVarQueryParams.Add("filter", parameterToString(localVarTempParam, "")) - } - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* SystemsApiService Update a system - This endpoint allows you to update a system. #### Sample Request ``` curl -X PUT https://console.jumpcloud.com/api/systems/{SystemID} \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"displayName\":\"Name_Update\", \"allowSshPasswordAuthentication\":\"true\", \"allowSshRootLogin\":\"true\", \"allowMultiFactorAuthentication\":\"true\", \"allowPublicKeyAuthentication\":\"false\" }' ``` - * @param ctx context.Context for authentication, logging, tracing, etc. - @param id - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "body" (Systemput) - @param "date" (string) Current date header for the System Context API - @param "authorization" (string) Authorization header for the System Context API - @param "xOrgId" (string) - @return System*/ -func (a *SystemsApiService) SystemsPut(ctx context.Context, id string, contentType string, accept string, localVarOptionals map[string]interface{}) (System, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Put") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload System - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/systems/{id}" - localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["date"], "string", "date"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["authorization"], "string", "authorization"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return successPayload, nil, err - } - - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if localVarTempParam, localVarOk := localVarOptionals["date"].(string); localVarOk { - localVarHeaderParams["Date"] = parameterToString(localVarTempParam, "") - } - if localVarTempParam, localVarOk := localVarOptionals["authorization"].(string); localVarOk { - localVarHeaderParams["Authorization"] = parameterToString(localVarTempParam, "") - } - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - // body params - if localVarTempParam, localVarOk := localVarOptionals["body"].(Systemput); localVarOk { - localVarPostBody = &localVarTempParam - } - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* SystemsApiService List system user bindings - Hidden as Tags is deprecated List system user bindings for a specific system in a system and user binding format. This endpoint is only used for users still using JumpCloud Tags. If you are using JumpCloud Groups please refer to the documentation found [here](https://docs.jumpcloud.com/2.0/systems/manage-associations-of-a-system). #### Sample Request *List system user bindings for specific system* ``` curl -X https://console.jumpcloud.com/api/systems/{SystemID}/systemusers\\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ \" ``` - * @param ctx context.Context for authentication, logging, tracing, etc. - @param id - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "fields" (string) Use a space seperated string of field parameters to include the data in the response. If omitted, the default list of fields will be returned. - @param "limit" (int32) The number of records to return at once. Limited to 100. - @param "skip" (int32) The offset into the records to return. - @param "sort" (string) Use space separated sort parameters to sort the collection. Default sort is ascending. Prefix with `-` to sort descending. - @param "filter" (string) A filter to apply to the query. - @param "xOrgId" (string) - @return Systemuserbinding*/ -func (a *SystemsApiService) SystemsSystemusersBindingList(ctx context.Context, id string, contentType string, accept string, localVarOptionals map[string]interface{}) (Systemuserbinding, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload Systemuserbinding - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/systems/{id}/systemusers" - localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["fields"], "string", "fields"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["limit"], "int32", "limit"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["skip"], "int32", "skip"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["sort"], "string", "sort"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["filter"], "string", "filter"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return successPayload, nil, err - } - - if localVarTempParam, localVarOk := localVarOptionals["fields"].(string); localVarOk { - localVarQueryParams.Add("fields", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["limit"].(int32); localVarOk { - localVarQueryParams.Add("limit", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["skip"].(int32); localVarOk { - localVarQueryParams.Add("skip", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["sort"].(string); localVarOk { - localVarQueryParams.Add("sort", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["filter"].(string); localVarOk { - localVarQueryParams.Add("filter", parameterToString(localVarTempParam, "")) - } - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* SystemsApiService Update a system's or user's binding - Hidden as Tags is deprecated Adds or removes a user binding for a system. This endpoint is only used for users still using JumpCloud Tags. If you are using JumpCloud Groups please refer to the documentation found [here](https://docs.jumpcloud.com/2.0/systems/manage-associations-of-a-system). #### Sample Request *Add (or remove) a system user to (from) a system* ``` curl \\ -d '{ \"add\": [\"[SYSTEM_USER_ID_TO_ADD_HERE]\"], \"remove\": [\"[SYSTEM_USER_ID_TO_REMOVE_HERE]\"] }' \\ -X PUT \\ -H 'Content-Type: application/json' \\ -H 'Accept: application/json' \\ -H \"x-api-key: [YOUR_API_KEY_HERE]\" \\ \"https://console.jumpcloud.com/api/systems/[SYSTEM_ID_HERE]/systemusers - * @param ctx context.Context for authentication, logging, tracing, etc. - @param id - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "body" (Systemuserbindingsput) - @param "xOrgId" (string) - @return */ -func (a *SystemsApiService) SystemsSystemusersBindingPut(ctx context.Context, id string, contentType string, accept string, localVarOptionals map[string]interface{}) ( *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Put") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/systems/{id}/systemusers" - localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return nil, err - } - - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - // body params - if localVarTempParam, localVarOk := localVarOptionals["body"].(Systemuserbindingsput); localVarOk { - localVarPostBody = &localVarTempParam - } - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - return localVarHttpResponse, err -} - diff --git a/v1/systemslist.go b/v1/systemslist.go deleted file mode 100644 index bcf2282..0000000 --- a/v1/systemslist.go +++ /dev/null @@ -1,19 +0,0 @@ -/* - * JumpCloud APIs - * - * JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, & system users. - * - * API version: 1.0 - * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) - */ - -package v1 - -type Systemslist struct { - - // The list of systems. - Results []System `json:"results,omitempty"` - - // The total number of systems. - TotalCount int32 `json:"totalCount,omitempty"` -} diff --git a/v1/systemuser.go b/v1/systemuser.go deleted file mode 100644 index 024a945..0000000 --- a/v1/systemuser.go +++ /dev/null @@ -1,96 +0,0 @@ -/* - * JumpCloud APIs - * - * JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, & system users. - * - * API version: 1.0 - * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) - */ - -package v1 - -type Systemuser struct { - - Id string `json:"_id,omitempty"` - - AccountLocked bool `json:"account_locked,omitempty"` - - Activated bool `json:"activated,omitempty"` - - AllowPublicKey bool `json:"allow_public_key,omitempty"` - - AssociatedTagCount int32 `json:"associatedTagCount,omitempty"` - - Attributes []interface{} `json:"attributes,omitempty"` - - Company string `json:"company,omitempty"` - - CostCenter string `json:"costCenter,omitempty"` - - Created string `json:"created,omitempty"` - - Department string `json:"department,omitempty"` - - Description string `json:"description,omitempty"` - - Displayname string `json:"displayname,omitempty"` - - Email string `json:"email,omitempty"` - - // Must be unique per user. - EmployeeIdentifier string `json:"employeeIdentifier,omitempty"` - - EmployeeType string `json:"employeeType,omitempty"` - - EnableManagedUid bool `json:"enable_managed_uid,omitempty"` - - EnableUserPortalMultifactor bool `json:"enable_user_portal_multifactor,omitempty"` - - ExternalDn string `json:"external_dn,omitempty"` - - ExternalSourceType string `json:"external_source_type,omitempty"` - - ExternallyManaged bool `json:"externally_managed,omitempty"` - - Firstname string `json:"firstname,omitempty"` - - JobTitle string `json:"jobTitle,omitempty"` - - Lastname string `json:"lastname,omitempty"` - - LdapBindingUser bool `json:"ldap_binding_user,omitempty"` - - Location string `json:"location,omitempty"` - - Mfa *Mfa `json:"mfa,omitempty"` - - Middlename string `json:"middlename,omitempty"` - - PasswordExpirationDate string `json:"password_expiration_date,omitempty"` - - PasswordExpired bool `json:"password_expired,omitempty"` - - PasswordNeverExpires bool `json:"password_never_expires,omitempty"` - - PasswordlessSudo bool `json:"passwordless_sudo,omitempty"` - - PublicKey string `json:"public_key,omitempty"` - - SambaServiceUser bool `json:"samba_service_user,omitempty"` - - SshKeys []Sshkeylist `json:"ssh_keys,omitempty"` - - Sudo bool `json:"sudo,omitempty"` - - Suspended bool `json:"suspended,omitempty"` - - Tags []string `json:"tags,omitempty"` - - TotpEnabled bool `json:"totp_enabled,omitempty"` - - UnixGuid int32 `json:"unix_guid,omitempty"` - - UnixUid int32 `json:"unix_uid,omitempty"` - - Username string `json:"username,omitempty"` -} diff --git a/v1/systemuserbinding.go b/v1/systemuserbinding.go deleted file mode 100644 index bf4d8cb..0000000 --- a/v1/systemuserbinding.go +++ /dev/null @@ -1,13 +0,0 @@ -/* - * JumpCloud APIs - * - * JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, & system users. - * - * API version: 1.0 - * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) - */ - -package v1 - -type Systemuserbinding struct { -} diff --git a/v1/systemuserbindingsput.go b/v1/systemuserbindingsput.go deleted file mode 100644 index ae42213..0000000 --- a/v1/systemuserbindingsput.go +++ /dev/null @@ -1,19 +0,0 @@ -/* - * JumpCloud APIs - * - * JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, & system users. - * - * API version: 1.0 - * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) - */ - -package v1 - -type Systemuserbindingsput struct { - - // The list of systemuser ids to be added to this system. - Add []string `json:"add"` - - // The list of systemuser ids to be removed from this system. - Remove []string `json:"remove"` -} diff --git a/v1/systemuserput.go b/v1/systemuserput.go deleted file mode 100644 index 7c42e87..0000000 --- a/v1/systemuserput.go +++ /dev/null @@ -1,89 +0,0 @@ -/* - * JumpCloud APIs - * - * JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, & system users. - * - * API version: 1.0 - * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) - */ - -package v1 - -type Systemuserput struct { - - AccountLocked bool `json:"account_locked,omitempty"` - - // type, poBox, extendedAddress, streetAddress, locality, region, postalCode, country - Addresses []SystemuserputAddresses `json:"addresses,omitempty"` - - AllowPublicKey bool `json:"allow_public_key,omitempty"` - - Attributes []interface{} `json:"attributes,omitempty"` - - Company string `json:"company,omitempty"` - - CostCenter string `json:"costCenter,omitempty"` - - Department string `json:"department,omitempty"` - - Description string `json:"description,omitempty"` - - Displayname string `json:"displayname,omitempty"` - - Email string `json:"email,omitempty"` - - // Must be unique per user. - EmployeeIdentifier string `json:"employeeIdentifier,omitempty"` - - EmployeeType string `json:"employeeType,omitempty"` - - EnableManagedUid bool `json:"enable_managed_uid,omitempty"` - - EnableUserPortalMultifactor bool `json:"enable_user_portal_multifactor,omitempty"` - - ExternalDn string `json:"external_dn,omitempty"` - - ExternalSourceType string `json:"external_source_type,omitempty"` - - ExternallyManaged bool `json:"externally_managed,omitempty"` - - Firstname string `json:"firstname,omitempty"` - - JobTitle string `json:"jobTitle,omitempty"` - - Lastname string `json:"lastname,omitempty"` - - LdapBindingUser bool `json:"ldap_binding_user,omitempty"` - - Location string `json:"location,omitempty"` - - Mfa *Mfa `json:"mfa,omitempty"` - - Middlename string `json:"middlename,omitempty"` - - Password string `json:"password,omitempty"` - - PasswordNeverExpires bool `json:"password_never_expires,omitempty"` - - PhoneNumbers []SystemuserputPhoneNumbers `json:"phoneNumbers,omitempty"` - - PublicKey string `json:"public_key,omitempty"` - - Relationships []interface{} `json:"relationships,omitempty"` - - SambaServiceUser bool `json:"samba_service_user,omitempty"` - - SshKeys []Sshkeypost `json:"ssh_keys,omitempty"` - - Sudo bool `json:"sudo,omitempty"` - - Suspended bool `json:"suspended,omitempty"` - - Tags []string `json:"tags,omitempty"` - - UnixGuid int32 `json:"unix_guid,omitempty"` - - UnixUid int32 `json:"unix_uid,omitempty"` - - Username string `json:"username,omitempty"` -} diff --git a/v1/systemuserput_addresses.go b/v1/systemuserput_addresses.go deleted file mode 100644 index 733b32b..0000000 --- a/v1/systemuserput_addresses.go +++ /dev/null @@ -1,29 +0,0 @@ -/* - * JumpCloud APIs - * - * JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, & system users. - * - * API version: 1.0 - * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) - */ - -package v1 - -type SystemuserputAddresses struct { - - Country string `json:"country,omitempty"` - - ExtendedAddress string `json:"extendedAddress,omitempty"` - - Locality string `json:"locality,omitempty"` - - PoBox string `json:"poBox,omitempty"` - - PostalCode string `json:"postalCode,omitempty"` - - Region string `json:"region,omitempty"` - - StreetAddress string `json:"streetAddress,omitempty"` - - Type_ string `json:"type,omitempty"` -} diff --git a/v1/systemuserput_phone_numbers.go b/v1/systemuserput_phone_numbers.go deleted file mode 100644 index fcaf4b8..0000000 --- a/v1/systemuserput_phone_numbers.go +++ /dev/null @@ -1,17 +0,0 @@ -/* - * JumpCloud APIs - * - * JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, & system users. - * - * API version: 1.0 - * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) - */ - -package v1 - -type SystemuserputPhoneNumbers struct { - - Number string `json:"number,omitempty"` - - Type_ string `json:"type,omitempty"` -} diff --git a/v1/systemuserputpost.go b/v1/systemuserputpost.go deleted file mode 100644 index bab131d..0000000 --- a/v1/systemuserputpost.go +++ /dev/null @@ -1,90 +0,0 @@ -/* - * JumpCloud APIs - * - * JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, & system users. - * - * API version: 1.0 - * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) - */ - -package v1 - -type Systemuserputpost struct { - - AccountLocked bool `json:"account_locked,omitempty"` - - Activated bool `json:"activated,omitempty"` - - Addresses []SystemuserputpostAddresses `json:"addresses,omitempty"` - - AllowPublicKey bool `json:"allow_public_key,omitempty"` - - Attributes []interface{} `json:"attributes,omitempty"` - - Company string `json:"company,omitempty"` - - CostCenter string `json:"costCenter,omitempty"` - - Department string `json:"department,omitempty"` - - Description string `json:"description,omitempty"` - - Displayname string `json:"displayname,omitempty"` - - Email string `json:"email"` - - // Must be unique per user. - EmployeeIdentifier string `json:"employeeIdentifier,omitempty"` - - EmployeeType string `json:"employeeType,omitempty"` - - EnableManagedUid bool `json:"enable_managed_uid,omitempty"` - - EnableUserPortalMultifactor bool `json:"enable_user_portal_multifactor,omitempty"` - - ExternalDn string `json:"external_dn,omitempty"` - - ExternalSourceType string `json:"external_source_type,omitempty"` - - ExternallyManaged bool `json:"externally_managed,omitempty"` - - Firstname string `json:"firstname,omitempty"` - - JobTitle string `json:"jobTitle,omitempty"` - - Lastname string `json:"lastname,omitempty"` - - LdapBindingUser bool `json:"ldap_binding_user,omitempty"` - - Location string `json:"location,omitempty"` - - Mfa *Mfa `json:"mfa,omitempty"` - - Middlename string `json:"middlename,omitempty"` - - Password string `json:"password,omitempty"` - - PasswordNeverExpires bool `json:"password_never_expires,omitempty"` - - PasswordlessSudo bool `json:"passwordless_sudo,omitempty"` - - PhoneNumbers []SystemuserputpostPhoneNumbers `json:"phoneNumbers,omitempty"` - - PublicKey string `json:"public_key,omitempty"` - - Relationships []interface{} `json:"relationships,omitempty"` - - SambaServiceUser bool `json:"samba_service_user,omitempty"` - - Sudo bool `json:"sudo,omitempty"` - - Suspended bool `json:"suspended,omitempty"` - - Tags []string `json:"tags,omitempty"` - - UnixGuid int32 `json:"unix_guid,omitempty"` - - UnixUid int32 `json:"unix_uid,omitempty"` - - Username string `json:"username"` -} diff --git a/v1/systemuserputpost_addresses.go b/v1/systemuserputpost_addresses.go deleted file mode 100644 index dc21822..0000000 --- a/v1/systemuserputpost_addresses.go +++ /dev/null @@ -1,29 +0,0 @@ -/* - * JumpCloud APIs - * - * JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, & system users. - * - * API version: 1.0 - * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) - */ - -package v1 - -type SystemuserputpostAddresses struct { - - Country string `json:"country,omitempty"` - - ExtendedAddress string `json:"extendedAddress,omitempty"` - - Locality string `json:"locality,omitempty"` - - PoBox string `json:"poBox,omitempty"` - - PostalCode string `json:"postalCode,omitempty"` - - Region string `json:"region,omitempty"` - - StreetAddress string `json:"streetAddress,omitempty"` - - Type_ string `json:"type,omitempty"` -} diff --git a/v1/systemuserputpost_phone_numbers.go b/v1/systemuserputpost_phone_numbers.go deleted file mode 100644 index f8b59cf..0000000 --- a/v1/systemuserputpost_phone_numbers.go +++ /dev/null @@ -1,17 +0,0 @@ -/* - * JumpCloud APIs - * - * JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, & system users. - * - * API version: 1.0 - * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) - */ - -package v1 - -type SystemuserputpostPhoneNumbers struct { - - Number string `json:"number,omitempty"` - - Type_ string `json:"type,omitempty"` -} diff --git a/v1/systemuserreturn.go b/v1/systemuserreturn.go deleted file mode 100644 index f8815d4..0000000 --- a/v1/systemuserreturn.go +++ /dev/null @@ -1,104 +0,0 @@ -/* - * JumpCloud APIs - * - * JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, & system users. - * - * API version: 1.0 - * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) - */ - -package v1 - -type Systemuserreturn struct { - - Id string `json:"_id,omitempty"` - - AccountLocked bool `json:"account_locked,omitempty"` - - Activated bool `json:"activated,omitempty"` - - Addresses []SystemuserreturnAddresses `json:"addresses,omitempty"` - - AllowPublicKey bool `json:"allow_public_key,omitempty"` - - Attributes []interface{} `json:"attributes,omitempty"` - - BadLoginAttempts int32 `json:"badLoginAttempts,omitempty"` - - Company string `json:"company,omitempty"` - - CostCenter string `json:"costCenter,omitempty"` - - Created string `json:"created,omitempty"` - - Department string `json:"department,omitempty"` - - Description string `json:"description,omitempty"` - - Displayname string `json:"displayname,omitempty"` - - Email string `json:"email,omitempty"` - - // Must be unique per user. - EmployeeIdentifier string `json:"employeeIdentifier,omitempty"` - - EmployeeType string `json:"employeeType,omitempty"` - - EnableManagedUid bool `json:"enable_managed_uid,omitempty"` - - EnableUserPortalMultifactor bool `json:"enable_user_portal_multifactor,omitempty"` - - ExternalDn string `json:"external_dn,omitempty"` - - ExternalSourceType string `json:"external_source_type,omitempty"` - - ExternallyManaged bool `json:"externally_managed,omitempty"` - - Firstname string `json:"firstname,omitempty"` - - JobTitle string `json:"jobTitle,omitempty"` - - Lastname string `json:"lastname,omitempty"` - - LdapBindingUser bool `json:"ldap_binding_user,omitempty"` - - Location string `json:"location,omitempty"` - - Mfa *Mfa `json:"mfa,omitempty"` - - Middlename string `json:"middlename,omitempty"` - - Organization string `json:"organization,omitempty"` - - PasswordExpirationDate string `json:"password_expiration_date,omitempty"` - - PasswordExpired bool `json:"password_expired,omitempty"` - - PasswordNeverExpires bool `json:"password_never_expires,omitempty"` - - PasswordlessSudo bool `json:"passwordless_sudo,omitempty"` - - PhoneNumbers []SystemuserreturnPhoneNumbers `json:"phoneNumbers,omitempty"` - - PublicKey string `json:"public_key,omitempty"` - - Relationships []interface{} `json:"relationships,omitempty"` - - SambaServiceUser bool `json:"samba_service_user,omitempty"` - - SshKeys []Sshkeylist `json:"ssh_keys,omitempty"` - - Sudo bool `json:"sudo,omitempty"` - - Suspended bool `json:"suspended,omitempty"` - - Tags []string `json:"tags,omitempty"` - - TotpEnabled bool `json:"totp_enabled,omitempty"` - - UnixGuid int32 `json:"unix_guid,omitempty"` - - UnixUid int32 `json:"unix_uid,omitempty"` - - Username string `json:"username,omitempty"` -} diff --git a/v1/systemuserreturn_addresses.go b/v1/systemuserreturn_addresses.go deleted file mode 100644 index bdd80e5..0000000 --- a/v1/systemuserreturn_addresses.go +++ /dev/null @@ -1,31 +0,0 @@ -/* - * JumpCloud APIs - * - * JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, & system users. - * - * API version: 1.0 - * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) - */ - -package v1 - -type SystemuserreturnAddresses struct { - - Country string `json:"country,omitempty"` - - ExtendedAddress string `json:"extendedAddress,omitempty"` - - Id string `json:"id,omitempty"` - - Locality string `json:"locality,omitempty"` - - PoBox string `json:"poBox,omitempty"` - - PostalCode string `json:"postalCode,omitempty"` - - Region string `json:"region,omitempty"` - - StreetAddress string `json:"streetAddress,omitempty"` - - Type_ string `json:"type,omitempty"` -} diff --git a/v1/systemuserreturn_phone_numbers.go b/v1/systemuserreturn_phone_numbers.go deleted file mode 100644 index 01896a0..0000000 --- a/v1/systemuserreturn_phone_numbers.go +++ /dev/null @@ -1,19 +0,0 @@ -/* - * JumpCloud APIs - * - * JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, & system users. - * - * API version: 1.0 - * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) - */ - -package v1 - -type SystemuserreturnPhoneNumbers struct { - - Id string `json:"id,omitempty"` - - Number string `json:"number,omitempty"` - - Type_ string `json:"type,omitempty"` -} diff --git a/v1/systemusers_api.go b/v1/systemusers_api.go deleted file mode 100644 index fd60f42..0000000 --- a/v1/systemusers_api.go +++ /dev/null @@ -1,1193 +0,0 @@ -/* - * JumpCloud APIs - * - * JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, & system users. - * - * API version: 1.0 - * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) - */ - -package v1 - -import ( - "io/ioutil" - "net/url" - "net/http" - "strings" - "golang.org/x/net/context" - "encoding/json" - "fmt" -) - -// Linger please -var ( - _ context.Context -) - -type SystemusersApiService service - - -/* SystemusersApiService Delete a system user's Public SSH Keys - This endpoint will delete a specific System User's SSH Key. - * @param ctx context.Context for authentication, logging, tracing, etc. - @param systemuserId - @param id - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "xOrgId" (string) - @return */ -func (a *SystemusersApiService) SshkeyDelete(ctx context.Context, systemuserId string, id string, contentType string, accept string, localVarOptionals map[string]interface{}) ( *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Delete") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/systemusers/{systemuser_id}/sshkeys/{id}" - localVarPath = strings.Replace(localVarPath, "{"+"systemuser_id"+"}", fmt.Sprintf("%v", systemuserId), -1) - localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return nil, err - } - - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - return localVarHttpResponse, err -} - -/* SystemusersApiService List a system user's public SSH keys - This endpoint will return a specific System User's public SSH key. - * @param ctx context.Context for authentication, logging, tracing, etc. - @param id - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "xOrgId" (string) - @return []Sshkeylist*/ -func (a *SystemusersApiService) SshkeyList(ctx context.Context, id string, contentType string, accept string, localVarOptionals map[string]interface{}) ([]Sshkeylist, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload []Sshkeylist - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/systemusers/{id}/sshkeys" - localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return successPayload, nil, err - } - - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* SystemusersApiService Create a system user's Public SSH Key - This endpoint will create a specific System User's Public SSH Key. - * @param ctx context.Context for authentication, logging, tracing, etc. - @param id - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "body" (Sshkeypost) - @param "xOrgId" (string) - @return Sshkeylist*/ -func (a *SystemusersApiService) SshkeyPost(ctx context.Context, id string, contentType string, accept string, localVarOptionals map[string]interface{}) (Sshkeylist, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Post") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload Sshkeylist - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/systemusers/{id}/sshkeys" - localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return successPayload, nil, err - } - - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - // body params - if localVarTempParam, localVarOk := localVarOptionals["body"].(Sshkeypost); localVarOk { - localVarPostBody = &localVarTempParam - } - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* SystemusersApiService Delete a system user - This endpoint allows you to delete a particular system user. #### Sample Request ``` curl -X DELETE https://console.jumpcloud.com/api/systemusers/{UserID} \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - * @param ctx context.Context for authentication, logging, tracing, etc. - @param id - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "xOrgId" (string) - @return Systemuserreturn*/ -func (a *SystemusersApiService) SystemusersDelete(ctx context.Context, id string, contentType string, accept string, localVarOptionals map[string]interface{}) (Systemuserreturn, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Delete") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload Systemuserreturn - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/systemusers/{id}" - localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return successPayload, nil, err - } - - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* SystemusersApiService List a system user - This endpoint returns a particular System User. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/systemusers/{UserID} \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - * @param ctx context.Context for authentication, logging, tracing, etc. - @param id - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "fields" (string) Use a space seperated string of field parameters to include the data in the response. If omitted, the default list of fields will be returned. - @param "filter" (string) A filter to apply to the query. - @param "xOrgId" (string) - @return Systemuserreturn*/ -func (a *SystemusersApiService) SystemusersGet(ctx context.Context, id string, contentType string, accept string, localVarOptionals map[string]interface{}) (Systemuserreturn, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload Systemuserreturn - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/systemusers/{id}" - localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["fields"], "string", "fields"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["filter"], "string", "filter"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return successPayload, nil, err - } - - if localVarTempParam, localVarOk := localVarOptionals["fields"].(string); localVarOk { - localVarQueryParams.Add("fields", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["filter"].(string); localVarOk { - localVarQueryParams.Add("filter", parameterToString(localVarTempParam, "")) - } - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* SystemusersApiService List all system users - This endpoint returns all systemusers. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/systemusers \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - * @param ctx context.Context for authentication, logging, tracing, etc. - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "limit" (int32) The number of records to return at once. - @param "skip" (int32) The offset into the records to return. - @param "sort" (string) The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. - @param "fields" (string) The comma separated fields included in the returned records. If omitted the default list of fields will be returned. - @param "xOrgId" (string) - @param "search" (string) A nested object containing a string `searchTerm` and a list of `fields` to search on. - @param "filter" (string) A filter to apply to the query. - @return Systemuserslist*/ -func (a *SystemusersApiService) SystemusersList(ctx context.Context, contentType string, accept string, localVarOptionals map[string]interface{}) (Systemuserslist, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload Systemuserslist - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/systemusers" - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["limit"], "int32", "limit"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["skip"], "int32", "skip"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["sort"], "string", "sort"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["fields"], "string", "fields"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["search"], "string", "search"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["filter"], "string", "filter"); err != nil { - return successPayload, nil, err - } - - if localVarTempParam, localVarOk := localVarOptionals["limit"].(int32); localVarOk { - localVarQueryParams.Add("limit", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["skip"].(int32); localVarOk { - localVarQueryParams.Add("skip", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["sort"].(string); localVarOk { - localVarQueryParams.Add("sort", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["fields"].(string); localVarOk { - localVarQueryParams.Add("fields", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["search"].(string); localVarOk { - localVarQueryParams.Add("search", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["filter"].(string); localVarOk { - localVarQueryParams.Add("filter", parameterToString(localVarTempParam, "")) - } - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* SystemusersApiService Create a system user - This endpoint allows you to create a new system user. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/systemusers \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"username\":\"{username}\", \"email\":\"{email_address}\", \"firstname\":\"{Name}\", \"lastname\":\"{Name}\" }' ``` - * @param ctx context.Context for authentication, logging, tracing, etc. - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "body" (Systemuserputpost) - @param "xOrgId" (string) - @return Systemuserreturn*/ -func (a *SystemusersApiService) SystemusersPost(ctx context.Context, contentType string, accept string, localVarOptionals map[string]interface{}) (Systemuserreturn, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Post") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload Systemuserreturn - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/systemusers" - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return successPayload, nil, err - } - - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - // body params - if localVarTempParam, localVarOk := localVarOptionals["body"].(Systemuserputpost); localVarOk { - localVarPostBody = &localVarTempParam - } - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* SystemusersApiService Update a system user - This endpoint allows you to update a system user. #### Sample Request ``` curl -X PUT https://console.jumpcloud.com/api/systemusers/{UserID} \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"email\":\"{email_address}\", \"firstname\":\"{Name}\", \"lastname\":\"{Name}\" }' ``` - * @param ctx context.Context for authentication, logging, tracing, etc. - @param id - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "body" (Systemuserput) - @param "xOrgId" (string) - @return Systemuserreturn*/ -func (a *SystemusersApiService) SystemusersPut(ctx context.Context, id string, contentType string, accept string, localVarOptionals map[string]interface{}) (Systemuserreturn, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Put") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload Systemuserreturn - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/systemusers/{id}" - localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return successPayload, nil, err - } - - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - // body params - if localVarTempParam, localVarOk := localVarOptionals["body"].(Systemuserput); localVarOk { - localVarPostBody = &localVarTempParam - } - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* SystemusersApiService Reset a system user's MFA token - This endpoint allows you to reset the TOTP key for a specified system user and put them in an TOTP MFA enrollment period. This will result in the user being prompted to setup TOTP MFA when logging into userportal. Please be aware that if the user does not complete TOTP MFA setup before the `exclusionUntil` date, they will be locked out of any resources that require TOTP MFA. Please refer to our [Knowledge Base Article](https://support.jumpcloud.com/customer/en/portal/articles/2959138-using-multifactor-authentication-with-jumpcloud) on setting up MFA for more information. #### Sample Request ``` curl -X POST \\ https://console.jumpcloud.com/api/systemusers/{UserID}/resetmfa \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{\"exclusion\": true, \"exclusionUntil\": \"{date-time}\"}' ``` - * @param ctx context.Context for authentication, logging, tracing, etc. - @param id - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "body" (Body1) - @param "xOrgId" (string) - @return */ -func (a *SystemusersApiService) SystemusersResetmfa(ctx context.Context, id string, contentType string, accept string, localVarOptionals map[string]interface{}) ( *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Post") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/systemusers/{id}/resetmfa" - localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return nil, err - } - - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - // body params - if localVarTempParam, localVarOk := localVarOptionals["body"].(Body1); localVarOk { - localVarPostBody = &localVarTempParam - } - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - return localVarHttpResponse, err -} - -/* SystemusersApiService List system user binding - Hidden as Tags is deprecated Adds or removes a system binding for a user. This endpoint is only used for users still using JumpCloud Tags. If you are using JumpCloud Groups please refer to the documentation found [here](https://docs.jumpcloud.com/2.0/systems/manage-associations-of-a-system). List system bindings for a specific system user in a system and user binding format. ### Examples #### List system bindings for specific system user ``` curl \\ -H 'Content-Type: application/json' \\ -H \"x-api-key: [YOUR_API_KEY_HERE]\" \\ \"https://console.jumpcloud.com/api/systemusers/[SYSTEM_USER_ID_HERE]/systems\" ``` - * @param ctx context.Context for authentication, logging, tracing, etc. - @param id - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "fields" (string) Use a space seperated string of field parameters to include the data in the response. If omitted, the default list of fields will be returned. - @param "limit" (int32) The number of records to return at once. Limited to 100. - @param "skip" (int32) The offset into the records to return. - @param "sort" (string) Use space separated sort parameters to sort the collection. Default sort is ascending. Prefix with `-` to sort descending. - @param "filter" (string) A filter to apply to the query. - @param "xOrgId" (string) - @return interface{}*/ -func (a *SystemusersApiService) SystemusersSystemsBindingList(ctx context.Context, id string, contentType string, accept string, localVarOptionals map[string]interface{}) (interface{}, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload interface{} - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/systemusers/{id}/systems" - localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["fields"], "string", "fields"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["limit"], "int32", "limit"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["skip"], "int32", "skip"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["sort"], "string", "sort"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["filter"], "string", "filter"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return successPayload, nil, err - } - - if localVarTempParam, localVarOk := localVarOptionals["fields"].(string); localVarOk { - localVarQueryParams.Add("fields", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["limit"].(int32); localVarOk { - localVarQueryParams.Add("limit", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["skip"].(int32); localVarOk { - localVarQueryParams.Add("skip", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["sort"].(string); localVarOk { - localVarQueryParams.Add("sort", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["filter"].(string); localVarOk { - localVarQueryParams.Add("filter", parameterToString(localVarTempParam, "")) - } - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* SystemusersApiService Update a system user binding - Hidden as Tags is deprecated Adds or removes a system binding for a user. This endpoint is only used for users still using JumpCloud Tags. If you are using JumpCloud Groups please refer to the documentation found [here](https://docs.jumpcloud.com/2.0/systems/manage-associations-of-a-system). ### Example #### Add (or remove) system to system user ``` curl \\ -d '{ \"add\": [\"[SYSTEM_ID_TO_ADD_HERE]\"], \"remove\": [\"[SYSTEM_ID_TO_REMOVE_HERE]\"] }' \\ -X PUT \\ -H 'Content-Type: application/json' \\ -H 'Accept: application/json' \\ -H \"x-api-key: [YOUR_API_KEY_HERE]\" \\ \"https://console.jumpcloud.com/api/systemusers/[SYSTEM_USER_ID_HERE]/systems\" ``` - * @param ctx context.Context for authentication, logging, tracing, etc. - @param id - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "body" (Usersystembindingsput) - @param "xOrgId" (string) - @return Usersystembinding*/ -func (a *SystemusersApiService) SystemusersSystemsBindingPut(ctx context.Context, id string, contentType string, accept string, localVarOptionals map[string]interface{}) (Usersystembinding, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Put") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload Usersystembinding - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/systemusers/{id}/systems" - localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return successPayload, nil, err - } - - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - // body params - if localVarTempParam, localVarOk := localVarOptionals["body"].(Usersystembindingsput); localVarOk { - localVarPostBody = &localVarTempParam - } - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* SystemusersApiService Unlock a system user - This endpoint allows you to unlock a user's account. - * @param ctx context.Context for authentication, logging, tracing, etc. - @param id - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "xOrgId" (string) - @return */ -func (a *SystemusersApiService) SystemusersUnlock(ctx context.Context, id string, contentType string, accept string, localVarOptionals map[string]interface{}) ( *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Post") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/systemusers/{id}/unlock" - localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return nil, err - } - - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - return localVarHttpResponse, err -} - diff --git a/v1/systemuserslist.go b/v1/systemuserslist.go deleted file mode 100644 index 4501f77..0000000 --- a/v1/systemuserslist.go +++ /dev/null @@ -1,19 +0,0 @@ -/* - * JumpCloud APIs - * - * JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, & system users. - * - * API version: 1.0 - * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) - */ - -package v1 - -type Systemuserslist struct { - - // The list of system users. - Results []Systemuserreturn `json:"results,omitempty"` - - // The total number of system users. - TotalCount int32 `json:"totalCount,omitempty"` -} diff --git a/v1/tag.go b/v1/tag.go deleted file mode 100644 index 7c25863..0000000 --- a/v1/tag.go +++ /dev/null @@ -1,40 +0,0 @@ -/* - * JumpCloud APIs - * - * JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, & system users. - * - * API version: 1.0 - * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) - */ - -package v1 - -type Tag struct { - - Id string `json:"_id,omitempty"` - - Expired bool `json:"expired,omitempty"` - - ExternalDN string `json:"externalDN,omitempty"` - - ExternalSourceType string `json:"externalSourceType,omitempty"` - - ExternallyManaged bool `json:"externallyManaged,omitempty"` - - GroupGid string `json:"groupGid,omitempty"` - - GroupName string `json:"groupName,omitempty"` - - // A unique name for the Tag. - Name string `json:"name,omitempty"` - - RegularExpressions []string `json:"regularExpressions,omitempty"` - - SendToLDAP bool `json:"sendToLDAP,omitempty"` - - // An array of system ids that are associated to the Tag. - Systems []string `json:"systems,omitempty"` - - // An array of system user ids that are associated to the Tag. - Systemusers []string `json:"systemusers,omitempty"` -} diff --git a/v1/tagpost.go b/v1/tagpost.go deleted file mode 100644 index 897e45b..0000000 --- a/v1/tagpost.go +++ /dev/null @@ -1,36 +0,0 @@ -/* - * JumpCloud APIs - * - * JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, & system users. - * - * API version: 1.0 - * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) - */ - -package v1 - -type Tagpost struct { - - ExternalDN string `json:"externalDN,omitempty"` - - ExternalSourceType string `json:"externalSourceType,omitempty"` - - ExternallyManaged bool `json:"externallyManaged,omitempty"` - - GroupGid string `json:"groupGid,omitempty"` - - GroupName string `json:"groupName,omitempty"` - - // A unique name for the Tag. - Name string `json:"name"` - - RegularExpressions []string `json:"regularExpressions,omitempty"` - - SendToLDAP bool `json:"sendToLDAP,omitempty"` - - // An array of system ids that are associated to the Tag. - Systems []string `json:"systems,omitempty"` - - // An array of system user ids that are associated to the Tag. - Systemusers []string `json:"systemusers,omitempty"` -} diff --git a/v1/tagput.go b/v1/tagput.go deleted file mode 100644 index 96fd48e..0000000 --- a/v1/tagput.go +++ /dev/null @@ -1,36 +0,0 @@ -/* - * JumpCloud APIs - * - * JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, & system users. - * - * API version: 1.0 - * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) - */ - -package v1 - -type Tagput struct { - - ExternalDN string `json:"externalDN,omitempty"` - - ExternalSourceType string `json:"externalSourceType,omitempty"` - - ExternallyManaged bool `json:"externallyManaged,omitempty"` - - GroupGid string `json:"groupGid,omitempty"` - - GroupName string `json:"groupName,omitempty"` - - // A unique name for the Tag. - Name string `json:"name,omitempty"` - - RegularExpressions []string `json:"regularExpressions,omitempty"` - - SendToLDAP bool `json:"sendToLDAP,omitempty"` - - // An array of system ids that are associated to the Tag. - Systems []string `json:"systems,omitempty"` - - // An array of system user ids that are associated to the Tag. - Systemusers []string `json:"systemusers,omitempty"` -} diff --git a/v1/tags_api.go b/v1/tags_api.go deleted file mode 100644 index 9188e3f..0000000 --- a/v1/tags_api.go +++ /dev/null @@ -1,514 +0,0 @@ -/* - * JumpCloud APIs - * - * JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, & system users. - * - * API version: 1.0 - * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) - */ - -package v1 - -import ( - "io/ioutil" - "net/url" - "net/http" - "strings" - "golang.org/x/net/context" - "encoding/json" - "fmt" -) - -// Linger please -var ( - _ context.Context -) - -type TagsApiService service - - -/* TagsApiService Delete a Tag - Hidden as Tags is deprecated Delete a Tag. - * @param ctx context.Context for authentication, logging, tracing, etc. - @param name - @param contentType - @param accept - @return Tag*/ -func (a *TagsApiService) TagsDelete(ctx context.Context, name string, contentType string, accept string) (Tag, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Delete") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload Tag - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/tags/{name}" - localVarPath = strings.Replace(localVarPath, "{"+"name"+"}", fmt.Sprintf("%v", name), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* TagsApiService List a Tag - Hidden as Tags is deprecated Returns a specific tag. - * @param ctx context.Context for authentication, logging, tracing, etc. - @param name - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "fields" (string) Use a space seperated string of field parameters to include the data in the response. If omitted, the default list of fields will be returned. - @param "limit" (int32) The number of records to return at once. Limited to 100. - @param "skip" (int32) The offset into the records to return. - @param "sort" (string) Use space separated sort parameters to sort the collection. Default sort is ascending. Prefix with `-` to sort descending. - @param "filter" (string) A filter to apply to the query. - @return Tag*/ -func (a *TagsApiService) TagsGet(ctx context.Context, name string, contentType string, accept string, localVarOptionals map[string]interface{}) (Tag, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload Tag - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/Tags/{name}" - localVarPath = strings.Replace(localVarPath, "{"+"name"+"}", fmt.Sprintf("%v", name), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["fields"], "string", "fields"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["limit"], "int32", "limit"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["skip"], "int32", "skip"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["sort"], "string", "sort"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["filter"], "string", "filter"); err != nil { - return successPayload, nil, err - } - - if localVarTempParam, localVarOk := localVarOptionals["fields"].(string); localVarOk { - localVarQueryParams.Add("fields", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["limit"].(int32); localVarOk { - localVarQueryParams.Add("limit", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["skip"].(int32); localVarOk { - localVarQueryParams.Add("skip", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["sort"].(string); localVarOk { - localVarQueryParams.Add("sort", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["filter"].(string); localVarOk { - localVarQueryParams.Add("filter", parameterToString(localVarTempParam, "")) - } - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* TagsApiService List All Tags - Hidden as Tags is deprecated Returns all Tags. - * @param ctx context.Context for authentication, logging, tracing, etc. - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "fields" (string) Use a space seperated string of field parameters to include the data in the response. If omitted, the default list of fields will be returned. - @param "limit" (int32) The number of records to return at once. Limited to 100. - @param "skip" (int32) The offset into the records to return. - @param "sort" (string) Use space separated sort parameters to sort the collection. Default sort is ascending. Prefix with `-` to sort descending. - @param "filter" (string) A filter to apply to the query. - @return Tagslist*/ -func (a *TagsApiService) TagsList(ctx context.Context, contentType string, accept string, localVarOptionals map[string]interface{}) (Tagslist, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload Tagslist - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/tags" - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["fields"], "string", "fields"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["limit"], "int32", "limit"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["skip"], "int32", "skip"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["sort"], "string", "sort"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["filter"], "string", "filter"); err != nil { - return successPayload, nil, err - } - - if localVarTempParam, localVarOk := localVarOptionals["fields"].(string); localVarOk { - localVarQueryParams.Add("fields", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["limit"].(int32); localVarOk { - localVarQueryParams.Add("limit", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["skip"].(int32); localVarOk { - localVarQueryParams.Add("skip", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["sort"].(string); localVarOk { - localVarQueryParams.Add("sort", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["filter"].(string); localVarOk { - localVarQueryParams.Add("filter", parameterToString(localVarTempParam, "")) - } - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* TagsApiService Create a Tag - Hidden as Tags is deprecated Create a tag. ### Examples #### Create a new Tag ``` curl \\ -d '{\"name\" : \"Developers\"}' \\ -X 'POST' \\ -H 'Content-Type: application/json' \\ -H 'Accept: application/json' \\ -H \"x-api-key: [YOUR_API_KEY_HERE]\" \\ \"https://console.jumpcloud.com/api/tags\" ``` - * @param ctx context.Context for authentication, logging, tracing, etc. - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "body" (Tagpost) - @return Tag*/ -func (a *TagsApiService) TagsPost(ctx context.Context, contentType string, accept string, localVarOptionals map[string]interface{}) (Tag, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Post") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload Tag - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/tags" - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - // body params - if localVarTempParam, localVarOk := localVarOptionals["body"].(Tagpost); localVarOk { - localVarPostBody = &localVarTempParam - } - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* TagsApiService Update a Tag - Hidden as Tags is deprecated Update a specific tag. - * @param ctx context.Context for authentication, logging, tracing, etc. - @param name - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "body" (Tagput) - @return Tag*/ -func (a *TagsApiService) TagsPut(ctx context.Context, name string, contentType string, accept string, localVarOptionals map[string]interface{}) (Tag, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Put") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload Tag - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/Tag/{name}" - localVarPath = strings.Replace(localVarPath, "{"+"name"+"}", fmt.Sprintf("%v", name), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - // body params - if localVarTempParam, localVarOk := localVarOptionals["body"].(Tagput); localVarOk { - localVarPostBody = &localVarTempParam - } - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - diff --git a/v1/tagslist.go b/v1/tagslist.go deleted file mode 100644 index 94c9c72..0000000 --- a/v1/tagslist.go +++ /dev/null @@ -1,19 +0,0 @@ -/* - * JumpCloud APIs - * - * JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, & system users. - * - * API version: 1.0 - * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) - */ - -package v1 - -type Tagslist struct { - - // The list of tags. - Results []Tag `json:"results,omitempty"` - - // The total number of tags. - TotalCount int32 `json:"totalCount,omitempty"` -} diff --git a/v1/usersystembinding.go b/v1/usersystembinding.go deleted file mode 100644 index 6ce2ee2..0000000 --- a/v1/usersystembinding.go +++ /dev/null @@ -1,13 +0,0 @@ -/* - * JumpCloud APIs - * - * JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, & system users. - * - * API version: 1.0 - * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) - */ - -package v1 - -type Usersystembinding struct { -} diff --git a/v1/usersystembindingsput.go b/v1/usersystembindingsput.go deleted file mode 100644 index 48ab742..0000000 --- a/v1/usersystembindingsput.go +++ /dev/null @@ -1,19 +0,0 @@ -/* - * JumpCloud APIs - * - * JumpCloud's V1 API. This set of endpoints allows JumpCloud customers to manage commands, systems, & system users. - * - * API version: 1.0 - * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) - */ - -package v1 - -type Usersystembindingsput struct { - - // The list of system ids to be added to this user. - Add []string `json:"add"` - - // The list of system ids to be removed from this user. - Remove []string `json:"remove"` -} diff --git a/v2/.swagger-codegen/VERSION b/v2/.swagger-codegen/VERSION deleted file mode 100644 index a625450..0000000 --- a/v2/.swagger-codegen/VERSION +++ /dev/null @@ -1 +0,0 @@ -2.3.1 \ No newline at end of file diff --git a/v2/README.md b/v2/README.md deleted file mode 100644 index 9f2b797..0000000 --- a/v2/README.md +++ /dev/null @@ -1,505 +0,0 @@ -# Go API client for v2 - - JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. - -## Overview -This API client was generated by the [swagger-codegen](https://github.com/swagger-api/swagger-codegen) project. By using the [swagger-spec](https://github.com/swagger-api/swagger-spec) from a remote server, you can easily generate an API client. - -- API version: 2.0 -- Package version: 3.0.0 -- Build package: io.swagger.codegen.languages.GoClientCodegen - -## Installation -Put the package under your project folder and add the following in import: -``` - "./v2" -``` - -## Documentation for API Endpoints - -All URIs are relative to *https://console.jumpcloud.com/api/v2* - -Class | Method | HTTP request | Description ------------- | ------------- | ------------- | ------------- -*ActiveDirectoryApi* | [**ActivedirectoriesAgentsDelete**](docs/ActiveDirectoryApi.md#activedirectoriesagentsdelete) | **Delete** /activedirectories/{activedirectory_id}/agents/{agent_id} | Delete Active Directory Agent -*ActiveDirectoryApi* | [**ActivedirectoriesAgentsGet**](docs/ActiveDirectoryApi.md#activedirectoriesagentsget) | **Get** /activedirectories/{activedirectory_id}/agents/{agent_id} | Get Active Directory Agent -*ActiveDirectoryApi* | [**ActivedirectoriesAgentsList**](docs/ActiveDirectoryApi.md#activedirectoriesagentslist) | **Get** /activedirectories/{activedirectory_id}/agents | List Active Directory Agents -*ActiveDirectoryApi* | [**ActivedirectoriesAgentsPost**](docs/ActiveDirectoryApi.md#activedirectoriesagentspost) | **Post** /activedirectories/{activedirectory_id}/agents | Create a new Active Directory Agent -*ActiveDirectoryApi* | [**ActivedirectoriesDelete**](docs/ActiveDirectoryApi.md#activedirectoriesdelete) | **Delete** /activedirectories/{id} | Delete an Active Directory -*ActiveDirectoryApi* | [**ActivedirectoriesGet**](docs/ActiveDirectoryApi.md#activedirectoriesget) | **Get** /activedirectories/{id} | Get an Active Directory -*ActiveDirectoryApi* | [**ActivedirectoriesList**](docs/ActiveDirectoryApi.md#activedirectorieslist) | **Get** /activedirectories | List Active Directories -*ActiveDirectoryApi* | [**ActivedirectoriesPost**](docs/ActiveDirectoryApi.md#activedirectoriespost) | **Post** /activedirectories | Create a new Active Directory -*ActiveDirectoryApi* | [**GraphActiveDirectoryAssociationsList**](docs/ActiveDirectoryApi.md#graphactivedirectoryassociationslist) | **Get** /activedirectories/{activedirectory_id}/associations | List the associations of an Active Directory instance -*ActiveDirectoryApi* | [**GraphActiveDirectoryAssociationsPost**](docs/ActiveDirectoryApi.md#graphactivedirectoryassociationspost) | **Post** /activedirectories/{activedirectory_id}/associations | Manage the associations of an Active Directory instance -*ActiveDirectoryApi* | [**GraphActiveDirectoryTraverseUserGroup**](docs/ActiveDirectoryApi.md#graphactivedirectorytraverseusergroup) | **Get** /activedirectories/{activedirectory_id}/usergroups | List the User Groups bound to an Active Directory instance -*AppleMDMApi* | [**ApplemdmsDelete**](docs/AppleMDMApi.md#applemdmsdelete) | **Delete** /applemdms/{apple_mdm_id} | Delete an Apple MDM -*AppleMDMApi* | [**ApplemdmsList**](docs/AppleMDMApi.md#applemdmslist) | **Get** /applemdms | List Apple MDMs -*AppleMDMApi* | [**ApplemdmsPost**](docs/AppleMDMApi.md#applemdmspost) | **Post** /applemdms | Create Apple MDM -*AppleMDMApi* | [**ApplemdmsPut**](docs/AppleMDMApi.md#applemdmsput) | **Put** /applemdms/{apple_mdm_id} | Update an Apple MDM -*AppleMDMApi* | [**EnrollmentprofilesGet**](docs/AppleMDMApi.md#enrollmentprofilesget) | **Get** /applemdms/{apple_mdm_id}/enrollmentprofiles/{enrollment_profile_id} | Get an Apple MDM Enrollment Profile -*AppleMDMApi* | [**EnrollmentprofilesList**](docs/AppleMDMApi.md#enrollmentprofileslist) | **Get** /applemdms/{apple_mdm_id}/enrollmentprofiles | List Apple MDM Enrollment Profiles -*ApplicationsApi* | [**GraphApplicationAssociationsList**](docs/ApplicationsApi.md#graphapplicationassociationslist) | **Get** /applications/{application_id}/associations | List the associations of an Application -*ApplicationsApi* | [**GraphApplicationAssociationsPost**](docs/ApplicationsApi.md#graphapplicationassociationspost) | **Post** /applications/{application_id}/associations | Manage the associations of an Application -*ApplicationsApi* | [**GraphApplicationTraverseUser**](docs/ApplicationsApi.md#graphapplicationtraverseuser) | **Get** /applications/{application_id}/users | List the Users bound to an Application -*ApplicationsApi* | [**GraphApplicationTraverseUserGroup**](docs/ApplicationsApi.md#graphapplicationtraverseusergroup) | **Get** /applications/{application_id}/usergroups | List the User Groups bound to an Application -*BulkJobRequestsApi* | [**BulkUsersCreate**](docs/BulkJobRequestsApi.md#bulkuserscreate) | **Post** /bulk/users | Bulk Users Create -*BulkJobRequestsApi* | [**BulkUsersCreateResults**](docs/BulkJobRequestsApi.md#bulkuserscreateresults) | **Get** /bulk/users/{job_id}/results | List Bulk Users Results -*BulkJobRequestsApi* | [**BulkUsersUpdate**](docs/BulkJobRequestsApi.md#bulkusersupdate) | **Patch** /bulk/users | Bulk Users Update -*BulkJobRequestsApi* | [**JobsGet**](docs/BulkJobRequestsApi.md#jobsget) | **Get** /jobs/{id} | Get Job (incomplete) -*BulkJobRequestsApi* | [**JobsResults**](docs/BulkJobRequestsApi.md#jobsresults) | **Get** /jobs/{id}/results | List Job Results -*CommandsApi* | [**GraphCommandAssociationsList**](docs/CommandsApi.md#graphcommandassociationslist) | **Get** /commands/{command_id}/associations | List the associations of a Command -*CommandsApi* | [**GraphCommandAssociationsPost**](docs/CommandsApi.md#graphcommandassociationspost) | **Post** /commands/{command_id}/associations | Manage the associations of a Command -*CommandsApi* | [**GraphCommandTraverseSystem**](docs/CommandsApi.md#graphcommandtraversesystem) | **Get** /commands/{command_id}/systems | List the Systems bound to a Command -*CommandsApi* | [**GraphCommandTraverseSystemGroup**](docs/CommandsApi.md#graphcommandtraversesystemgroup) | **Get** /commands/{command_id}/systemgroups | List the System Groups bound to a Command -*DefaultApi* | [**JcEnrollmentProfilesDelete**](docs/DefaultApi.md#jcenrollmentprofilesdelete) | **Delete** /enrollmentprofiles/{enrollment_profile_id} | Delete Enrollment Profile -*DefaultApi* | [**JcEnrollmentProfilesGet**](docs/DefaultApi.md#jcenrollmentprofilesget) | **Get** /enrollmentprofiles/{enrollment_profile_id} | Get Enrollment Profile -*DefaultApi* | [**JcEnrollmentProfilesList**](docs/DefaultApi.md#jcenrollmentprofileslist) | **Get** /enrollmentprofiles | List Enrollment Profiles -*DefaultApi* | [**JcEnrollmentProfilesPost**](docs/DefaultApi.md#jcenrollmentprofilespost) | **Post** /enrollmentprofiles | Create new Enrollment Profile -*DefaultApi* | [**JcEnrollmentProfilesPut**](docs/DefaultApi.md#jcenrollmentprofilesput) | **Put** /enrollmentprofiles/{enrollment_profile_id} | Update Enrollment Profile -*DirectoriesApi* | [**DirectoriesList**](docs/DirectoriesApi.md#directorieslist) | **Get** /directories | List All Directories -*DuoApi* | [**DuoAccountDelete**](docs/DuoApi.md#duoaccountdelete) | **Delete** /duo/accounts/{id} | Delete a Duo Account -*DuoApi* | [**DuoAccountGet**](docs/DuoApi.md#duoaccountget) | **Get** /duo/accounts/{id} | Get a Duo Acount -*DuoApi* | [**DuoAccountList**](docs/DuoApi.md#duoaccountlist) | **Get** /duo/accounts | List Duo Acounts -*DuoApi* | [**DuoAccountPost**](docs/DuoApi.md#duoaccountpost) | **Post** /duo/accounts | Create Duo Account -*DuoApi* | [**DuoApplicationDelete**](docs/DuoApi.md#duoapplicationdelete) | **Delete** /duo/accounts/{account_id}/applications/{application_id} | Delete a Duo Application -*DuoApi* | [**DuoApplicationGet**](docs/DuoApi.md#duoapplicationget) | **Get** /duo/accounts/{account_id}/applications/{application_id} | Get a Duo application -*DuoApi* | [**DuoApplicationList**](docs/DuoApi.md#duoapplicationlist) | **Get** /duo/accounts/{account_id}/applications | List Duo Applications -*DuoApi* | [**DuoApplicationPost**](docs/DuoApi.md#duoapplicationpost) | **Post** /duo/accounts/{account_id}/applications | Create Duo Application -*DuoApi* | [**DuoApplicationUpdate**](docs/DuoApi.md#duoapplicationupdate) | **Put** /duo/accounts/{account_id}/applications/{application_id} | Update Duo Application -*FdeApi* | [**SystemsGetFDEKey**](docs/FdeApi.md#systemsgetfdekey) | **Get** /systems/{system_id}/fdekey | Get System FDE Key -*GSuiteApi* | [**GraphGSuiteAssociationsList**](docs/GSuiteApi.md#graphgsuiteassociationslist) | **Get** /gsuites/{gsuite_id}/associations | List the associations of a G Suite instance -*GSuiteApi* | [**GraphGSuiteAssociationsPost**](docs/GSuiteApi.md#graphgsuiteassociationspost) | **Post** /gsuites/{gsuite_id}/associations | Manage the associations of a G Suite instance -*GSuiteApi* | [**GraphGSuiteTraverseUser**](docs/GSuiteApi.md#graphgsuitetraverseuser) | **Get** /gsuites/{gsuite_id}/users | List the Users bound to a G Suite instance -*GSuiteApi* | [**GraphGSuiteTraverseUserGroup**](docs/GSuiteApi.md#graphgsuitetraverseusergroup) | **Get** /gsuites/{gsuite_id}/usergroups | List the User Groups bound to a G Suite instance -*GSuiteApi* | [**GsuitesGet**](docs/GSuiteApi.md#gsuitesget) | **Get** /gsuites/{id} | Get G Suite -*GSuiteApi* | [**GsuitesPatch**](docs/GSuiteApi.md#gsuitespatch) | **Patch** /gsuites/{id} | Update existing G Suite -*GSuiteApi* | [**TranslationRulesGSuiteDelete**](docs/GSuiteApi.md#translationrulesgsuitedelete) | **Delete** /gsuites/{gsuite_id}/translationrules/{id} | Deletes a G Suite translation rule -*GSuiteApi* | [**TranslationRulesGSuiteGet**](docs/GSuiteApi.md#translationrulesgsuiteget) | **Get** /gsuites/{gsuite_id}/translationrules/{id} | Gets a specific G Suite translation rule -*GSuiteApi* | [**TranslationRulesGSuiteList**](docs/GSuiteApi.md#translationrulesgsuitelist) | **Get** /gsuites/{gsuite_id}/translationrules | List all the G Suite Translation Rules -*GSuiteApi* | [**TranslationRulesGSuitePost**](docs/GSuiteApi.md#translationrulesgsuitepost) | **Post** /gsuites/{gsuite_id}/translationrules | Create a new G Suite Translation Rule -*GraphApi* | [**GraphActiveDirectoryAssociationsList**](docs/GraphApi.md#graphactivedirectoryassociationslist) | **Get** /activedirectories/{activedirectory_id}/associations | List the associations of an Active Directory instance -*GraphApi* | [**GraphActiveDirectoryAssociationsPost**](docs/GraphApi.md#graphactivedirectoryassociationspost) | **Post** /activedirectories/{activedirectory_id}/associations | Manage the associations of an Active Directory instance -*GraphApi* | [**GraphActiveDirectoryTraverseUser**](docs/GraphApi.md#graphactivedirectorytraverseuser) | **Get** /activedirectories/{activedirectory_id}/users | List the Users bound to an Active Directory instance -*GraphApi* | [**GraphActiveDirectoryTraverseUserGroup**](docs/GraphApi.md#graphactivedirectorytraverseusergroup) | **Get** /activedirectories/{activedirectory_id}/usergroups | List the User Groups bound to an Active Directory instance -*GraphApi* | [**GraphApplicationAssociationsList**](docs/GraphApi.md#graphapplicationassociationslist) | **Get** /applications/{application_id}/associations | List the associations of an Application -*GraphApi* | [**GraphApplicationAssociationsPost**](docs/GraphApi.md#graphapplicationassociationspost) | **Post** /applications/{application_id}/associations | Manage the associations of an Application -*GraphApi* | [**GraphApplicationTraverseUser**](docs/GraphApi.md#graphapplicationtraverseuser) | **Get** /applications/{application_id}/users | List the Users bound to an Application -*GraphApi* | [**GraphApplicationTraverseUserGroup**](docs/GraphApi.md#graphapplicationtraverseusergroup) | **Get** /applications/{application_id}/usergroups | List the User Groups bound to an Application -*GraphApi* | [**GraphCommandAssociationsList**](docs/GraphApi.md#graphcommandassociationslist) | **Get** /commands/{command_id}/associations | List the associations of a Command -*GraphApi* | [**GraphCommandAssociationsPost**](docs/GraphApi.md#graphcommandassociationspost) | **Post** /commands/{command_id}/associations | Manage the associations of a Command -*GraphApi* | [**GraphCommandTraverseSystem**](docs/GraphApi.md#graphcommandtraversesystem) | **Get** /commands/{command_id}/systems | List the Systems bound to a Command -*GraphApi* | [**GraphCommandTraverseSystemGroup**](docs/GraphApi.md#graphcommandtraversesystemgroup) | **Get** /commands/{command_id}/systemgroups | List the System Groups bound to a Command -*GraphApi* | [**GraphGSuiteAssociationsList**](docs/GraphApi.md#graphgsuiteassociationslist) | **Get** /gsuites/{gsuite_id}/associations | List the associations of a G Suite instance -*GraphApi* | [**GraphGSuiteAssociationsPost**](docs/GraphApi.md#graphgsuiteassociationspost) | **Post** /gsuites/{gsuite_id}/associations | Manage the associations of a G Suite instance -*GraphApi* | [**GraphGSuiteTraverseUser**](docs/GraphApi.md#graphgsuitetraverseuser) | **Get** /gsuites/{gsuite_id}/users | List the Users bound to a G Suite instance -*GraphApi* | [**GraphGSuiteTraverseUserGroup**](docs/GraphApi.md#graphgsuitetraverseusergroup) | **Get** /gsuites/{gsuite_id}/usergroups | List the User Groups bound to a G Suite instance -*GraphApi* | [**GraphLdapServerAssociationsList**](docs/GraphApi.md#graphldapserverassociationslist) | **Get** /ldapservers/{ldapserver_id}/associations | List the associations of a LDAP Server -*GraphApi* | [**GraphLdapServerAssociationsPost**](docs/GraphApi.md#graphldapserverassociationspost) | **Post** /ldapservers/{ldapserver_id}/associations | Manage the associations of a LDAP Server -*GraphApi* | [**GraphLdapServerTraverseUser**](docs/GraphApi.md#graphldapservertraverseuser) | **Get** /ldapservers/{ldapserver_id}/users | List the Users bound to a LDAP Server -*GraphApi* | [**GraphLdapServerTraverseUserGroup**](docs/GraphApi.md#graphldapservertraverseusergroup) | **Get** /ldapservers/{ldapserver_id}/usergroups | List the User Groups bound to a LDAP Server -*GraphApi* | [**GraphOffice365AssociationsList**](docs/GraphApi.md#graphoffice365associationslist) | **Get** /office365s/{office365_id}/associations | List the associations of an Office 365 instance -*GraphApi* | [**GraphOffice365AssociationsPost**](docs/GraphApi.md#graphoffice365associationspost) | **Post** /office365s/{office365_id}/associations | Manage the associations of an Office 365 instance -*GraphApi* | [**GraphOffice365TraverseUser**](docs/GraphApi.md#graphoffice365traverseuser) | **Get** /office365s/{office365_id}/users | List the Users bound to an Office 365 instance -*GraphApi* | [**GraphOffice365TraverseUserGroup**](docs/GraphApi.md#graphoffice365traverseusergroup) | **Get** /office365s/{office365_id}/usergroups | List the User Groups bound to an Office 365 instance -*GraphApi* | [**GraphPolicyAssociationsList**](docs/GraphApi.md#graphpolicyassociationslist) | **Get** /policies/{policy_id}/associations | List the associations of a Policy -*GraphApi* | [**GraphPolicyAssociationsPost**](docs/GraphApi.md#graphpolicyassociationspost) | **Post** /policies/{policy_id}/associations | Manage the associations of a Policy -*GraphApi* | [**GraphPolicyTraverseSystem**](docs/GraphApi.md#graphpolicytraversesystem) | **Get** /policies/{policy_id}/systems | List the Systems bound to a Policy -*GraphApi* | [**GraphPolicyTraverseSystemGroup**](docs/GraphApi.md#graphpolicytraversesystemgroup) | **Get** /policies/{policy_id}/systemgroups | List the System Groups bound to a Policy -*GraphApi* | [**GraphRadiusServerAssociationsList**](docs/GraphApi.md#graphradiusserverassociationslist) | **Get** /radiusservers/{radiusserver_id}/associations | List the associations of a RADIUS Server -*GraphApi* | [**GraphRadiusServerAssociationsPost**](docs/GraphApi.md#graphradiusserverassociationspost) | **Post** /radiusservers/{radiusserver_id}/associations | Manage the associations of a RADIUS Server -*GraphApi* | [**GraphRadiusServerTraverseUser**](docs/GraphApi.md#graphradiusservertraverseuser) | **Get** /radiusservers/{radiusserver_id}/users | List the Users bound to a RADIUS Server -*GraphApi* | [**GraphRadiusServerTraverseUserGroup**](docs/GraphApi.md#graphradiusservertraverseusergroup) | **Get** /radiusservers/{radiusserver_id}/usergroups | List the User Groups bound to a RADIUS Server -*GraphApi* | [**GraphSystemAssociationsList**](docs/GraphApi.md#graphsystemassociationslist) | **Get** /systems/{system_id}/associations | List the associations of a System -*GraphApi* | [**GraphSystemAssociationsPost**](docs/GraphApi.md#graphsystemassociationspost) | **Post** /systems/{system_id}/associations | Manage associations of a System -*GraphApi* | [**GraphSystemGroupAssociationsList**](docs/GraphApi.md#graphsystemgroupassociationslist) | **Get** /systemgroups/{group_id}/associations | List the associations of a System Group -*GraphApi* | [**GraphSystemGroupAssociationsPost**](docs/GraphApi.md#graphsystemgroupassociationspost) | **Post** /systemgroups/{group_id}/associations | Manage the associations of a System Group -*GraphApi* | [**GraphSystemGroupMemberOf**](docs/GraphApi.md#graphsystemgroupmemberof) | **Get** /systemgroups/{group_id}/memberof | List the System Group's parents -*GraphApi* | [**GraphSystemGroupMembersList**](docs/GraphApi.md#graphsystemgroupmemberslist) | **Get** /systemgroups/{group_id}/members | List the members of a System Group -*GraphApi* | [**GraphSystemGroupMembersPost**](docs/GraphApi.md#graphsystemgroupmemberspost) | **Post** /systemgroups/{group_id}/members | Manage the members of a System Group -*GraphApi* | [**GraphSystemGroupMembership**](docs/GraphApi.md#graphsystemgroupmembership) | **Get** /systemgroups/{group_id}/membership | List the System Group's membership -*GraphApi* | [**GraphSystemGroupTraverseCommand**](docs/GraphApi.md#graphsystemgrouptraversecommand) | **Get** /systemgroups/{group_id}/commands | List the Commands bound to a System Group -*GraphApi* | [**GraphSystemGroupTraversePolicy**](docs/GraphApi.md#graphsystemgrouptraversepolicy) | **Get** /systemgroups/{group_id}/policies | List the Policies bound to a System Group -*GraphApi* | [**GraphSystemGroupTraverseUser**](docs/GraphApi.md#graphsystemgrouptraverseuser) | **Get** /systemgroups/{group_id}/users | List the Users bound to a System Group -*GraphApi* | [**GraphSystemGroupTraverseUserGroup**](docs/GraphApi.md#graphsystemgrouptraverseusergroup) | **Get** /systemgroups/{group_id}/usergroups | List the User Groups bound to a System Group -*GraphApi* | [**GraphSystemMemberOf**](docs/GraphApi.md#graphsystemmemberof) | **Get** /systems/{system_id}/memberof | List the parent Groups of a System -*GraphApi* | [**GraphSystemTraverseCommand**](docs/GraphApi.md#graphsystemtraversecommand) | **Get** /systems/{system_id}/commands | List the Commands bound to a System -*GraphApi* | [**GraphSystemTraversePolicy**](docs/GraphApi.md#graphsystemtraversepolicy) | **Get** /systems/{system_id}/policies | List the Policies bound to a System -*GraphApi* | [**GraphSystemTraverseUser**](docs/GraphApi.md#graphsystemtraverseuser) | **Get** /systems/{system_id}/users | List the Users bound to a System -*GraphApi* | [**GraphSystemTraverseUserGroup**](docs/GraphApi.md#graphsystemtraverseusergroup) | **Get** /systems/{system_id}/usergroups | List the User Groups bound to a System -*GraphApi* | [**GraphUserAssociationsList**](docs/GraphApi.md#graphuserassociationslist) | **Get** /users/{user_id}/associations | List the associations of a User -*GraphApi* | [**GraphUserAssociationsPost**](docs/GraphApi.md#graphuserassociationspost) | **Post** /users/{user_id}/associations | Manage the associations of a User -*GraphApi* | [**GraphUserGroupAssociationsList**](docs/GraphApi.md#graphusergroupassociationslist) | **Get** /usergroups/{group_id}/associations | List the associations of a User Group. -*GraphApi* | [**GraphUserGroupAssociationsPost**](docs/GraphApi.md#graphusergroupassociationspost) | **Post** /usergroups/{group_id}/associations | Manage the associations of a User Group -*GraphApi* | [**GraphUserGroupMemberOf**](docs/GraphApi.md#graphusergroupmemberof) | **Get** /usergroups/{group_id}/memberof | List the User Group's parents -*GraphApi* | [**GraphUserGroupMembersList**](docs/GraphApi.md#graphusergroupmemberslist) | **Get** /usergroups/{group_id}/members | List the members of a User Group -*GraphApi* | [**GraphUserGroupMembersPost**](docs/GraphApi.md#graphusergroupmemberspost) | **Post** /usergroups/{group_id}/members | Manage the members of a User Group -*GraphApi* | [**GraphUserGroupMembership**](docs/GraphApi.md#graphusergroupmembership) | **Get** /usergroups/{group_id}/membership | List the User Group's membership -*GraphApi* | [**GraphUserGroupTraverseActiveDirectory**](docs/GraphApi.md#graphusergrouptraverseactivedirectory) | **Get** /usergroups/{group_id}/activedirectories | List the Active Directories bound to a User Group -*GraphApi* | [**GraphUserGroupTraverseApplication**](docs/GraphApi.md#graphusergrouptraverseapplication) | **Get** /usergroups/{group_id}/applications | List the Applications bound to a User Group -*GraphApi* | [**GraphUserGroupTraverseDirectory**](docs/GraphApi.md#graphusergrouptraversedirectory) | **Get** /usergroups/{group_id}/directories | List the Directories bound to a User Group -*GraphApi* | [**GraphUserGroupTraverseGSuite**](docs/GraphApi.md#graphusergrouptraversegsuite) | **Get** /usergroups/{group_id}/gsuites | List the G Suite instances bound to a User Group -*GraphApi* | [**GraphUserGroupTraverseLdapServer**](docs/GraphApi.md#graphusergrouptraverseldapserver) | **Get** /usergroups/{group_id}/ldapservers | List the LDAP Servers bound to a User Group -*GraphApi* | [**GraphUserGroupTraverseOffice365**](docs/GraphApi.md#graphusergrouptraverseoffice365) | **Get** /usergroups/{group_id}/office365s | List the Office 365 instances bound to a User Group -*GraphApi* | [**GraphUserGroupTraverseRadiusServer**](docs/GraphApi.md#graphusergrouptraverseradiusserver) | **Get** /usergroups/{group_id}/radiusservers | List the RADIUS Servers bound to a User Group -*GraphApi* | [**GraphUserGroupTraverseSystem**](docs/GraphApi.md#graphusergrouptraversesystem) | **Get** /usergroups/{group_id}/systems | List the Systems bound to a User Group -*GraphApi* | [**GraphUserGroupTraverseSystemGroup**](docs/GraphApi.md#graphusergrouptraversesystemgroup) | **Get** /usergroups/{group_id}/systemgroups | List the System Groups bound to User Groups -*GraphApi* | [**GraphUserMemberOf**](docs/GraphApi.md#graphusermemberof) | **Get** /users/{user_id}/memberof | List the parent Groups of a User -*GraphApi* | [**GraphUserTraverseActiveDirectory**](docs/GraphApi.md#graphusertraverseactivedirectory) | **Get** /users/{user_id}/activedirectories | List the Active Directory instances bound to a User -*GraphApi* | [**GraphUserTraverseApplication**](docs/GraphApi.md#graphusertraverseapplication) | **Get** /users/{user_id}/applications | List the Applications bound to a User -*GraphApi* | [**GraphUserTraverseDirectory**](docs/GraphApi.md#graphusertraversedirectory) | **Get** /users/{user_id}/directories | List the Directories bound to a User -*GraphApi* | [**GraphUserTraverseGSuite**](docs/GraphApi.md#graphusertraversegsuite) | **Get** /users/{user_id}/gsuites | List the G Suite instances bound to a User -*GraphApi* | [**GraphUserTraverseLdapServer**](docs/GraphApi.md#graphusertraverseldapserver) | **Get** /users/{user_id}/ldapservers | List the LDAP servers bound to a User -*GraphApi* | [**GraphUserTraverseOffice365**](docs/GraphApi.md#graphusertraverseoffice365) | **Get** /users/{user_id}/office365s | List the Office 365 instances bound to a User -*GraphApi* | [**GraphUserTraverseRadiusServer**](docs/GraphApi.md#graphusertraverseradiusserver) | **Get** /users/{user_id}/radiusservers | List the RADIUS Servers bound to a User -*GraphApi* | [**GraphUserTraverseSystem**](docs/GraphApi.md#graphusertraversesystem) | **Get** /users/{user_id}/systems | List the Systems bound to a User -*GraphApi* | [**GraphUserTraverseSystemGroup**](docs/GraphApi.md#graphusertraversesystemgroup) | **Get** /users/{user_id}/systemgroups | List the System Groups bound to a User -*GraphApi* | [**PolicystatusesList**](docs/GraphApi.md#policystatuseslist) | **Get** /systems/{system_id}/policystatuses | List the policy statuses for a system -*GroupsApi* | [**GroupsList**](docs/GroupsApi.md#groupslist) | **Get** /groups | List All Groups -*KnowledgeApi* | [**KnowledgeSalesforceList**](docs/KnowledgeApi.md#knowledgesalesforcelist) | **Get** /knowledge/salesforce | List Knowledge Articles -*LDAPServersApi* | [**GraphLdapServerAssociationsList**](docs/LDAPServersApi.md#graphldapserverassociationslist) | **Get** /ldapservers/{ldapserver_id}/associations | List the associations of a LDAP Server -*LDAPServersApi* | [**GraphLdapServerAssociationsPost**](docs/LDAPServersApi.md#graphldapserverassociationspost) | **Post** /ldapservers/{ldapserver_id}/associations | Manage the associations of a LDAP Server -*LDAPServersApi* | [**GraphLdapServerTraverseUser**](docs/LDAPServersApi.md#graphldapservertraverseuser) | **Get** /ldapservers/{ldapserver_id}/users | List the Users bound to a LDAP Server -*LDAPServersApi* | [**GraphLdapServerTraverseUserGroup**](docs/LDAPServersApi.md#graphldapservertraverseusergroup) | **Get** /ldapservers/{ldapserver_id}/usergroups | List the User Groups bound to a LDAP Server -*LDAPServersApi* | [**LdapserversGet**](docs/LDAPServersApi.md#ldapserversget) | **Get** /ldapservers/{id} | Get LDAP Server -*LDAPServersApi* | [**LdapserversList**](docs/LDAPServersApi.md#ldapserverslist) | **Get** /ldapservers | List LDAP Servers -*LDAPServersApi* | [**LdapserversPatch**](docs/LDAPServersApi.md#ldapserverspatch) | **Patch** /ldapservers/{id} | Update existing LDAP server -*Office365Api* | [**GraphOffice365AssociationsList**](docs/Office365Api.md#graphoffice365associationslist) | **Get** /office365s/{office365_id}/associations | List the associations of an Office 365 instance -*Office365Api* | [**GraphOffice365AssociationsPost**](docs/Office365Api.md#graphoffice365associationspost) | **Post** /office365s/{office365_id}/associations | Manage the associations of an Office 365 instance -*Office365Api* | [**GraphOffice365TraverseUser**](docs/Office365Api.md#graphoffice365traverseuser) | **Get** /office365s/{office365_id}/users | List the Users bound to an Office 365 instance -*Office365Api* | [**GraphOffice365TraverseUserGroup**](docs/Office365Api.md#graphoffice365traverseusergroup) | **Get** /office365s/{office365_id}/usergroups | List the User Groups bound to an Office 365 instance -*Office365Api* | [**TranslationRulesOffice365Delete**](docs/Office365Api.md#translationrulesoffice365delete) | **Delete** /office365s/{office365_id}/translationrules/{id} | Deletes a Office 365 translation rule -*Office365Api* | [**TranslationRulesOffice365Get**](docs/Office365Api.md#translationrulesoffice365get) | **Get** /office365s/{office365_id}/translationrules/{id} | Gets a specific Office 365 translation rule -*Office365Api* | [**TranslationRulesOffice365List**](docs/Office365Api.md#translationrulesoffice365list) | **Get** /office365s/{office365_id}/translationrules | List all the Office 365 Translation Rules -*Office365Api* | [**TranslationRulesOffice365Post**](docs/Office365Api.md#translationrulesoffice365post) | **Post** /office365s/{office365_id}/translationrules | Create a new Office 365 Translation Rule -*OrganizationsApi* | [**OrgCryptoGet**](docs/OrganizationsApi.md#orgcryptoget) | **Get** /organizations/{id}/crypto | Get Crypto Settings -*OrganizationsApi* | [**OrgCryptoPut**](docs/OrganizationsApi.md#orgcryptoput) | **Put** /organizations/{id}/crypto | Edit Crypto Settings -*PoliciesApi* | [**GraphPolicyAssociationsList**](docs/PoliciesApi.md#graphpolicyassociationslist) | **Get** /policies/{policy_id}/associations | List the associations of a Policy -*PoliciesApi* | [**GraphPolicyAssociationsPost**](docs/PoliciesApi.md#graphpolicyassociationspost) | **Post** /policies/{policy_id}/associations | Manage the associations of a Policy -*PoliciesApi* | [**GraphPolicyTraverseSystem**](docs/PoliciesApi.md#graphpolicytraversesystem) | **Get** /policies/{policy_id}/systems | List the Systems bound to a Policy -*PoliciesApi* | [**GraphPolicyTraverseSystemGroup**](docs/PoliciesApi.md#graphpolicytraversesystemgroup) | **Get** /policies/{policy_id}/systemgroups | List the System Groups bound to a Policy -*PoliciesApi* | [**PoliciesDelete**](docs/PoliciesApi.md#policiesdelete) | **Delete** /policies/{id} | Deletes a Policy -*PoliciesApi* | [**PoliciesGet**](docs/PoliciesApi.md#policiesget) | **Get** /policies/{id} | Gets a specific Policy. -*PoliciesApi* | [**PoliciesList**](docs/PoliciesApi.md#policieslist) | **Get** /policies | Lists all the Policies -*PoliciesApi* | [**PoliciesPost**](docs/PoliciesApi.md#policiespost) | **Post** /policies | Create a new Policy -*PoliciesApi* | [**PoliciesPut**](docs/PoliciesApi.md#policiesput) | **Put** /policies/{id} | Update an existing Policy -*PoliciesApi* | [**PolicyresultsGet**](docs/PoliciesApi.md#policyresultsget) | **Get** /policyresults/{id} | Get a specific Policy Result. -*PoliciesApi* | [**PolicyresultsList**](docs/PoliciesApi.md#policyresultslist) | **Get** /policies/{policy_id}/policyresults | Lists all the policy results of a policy. -*PoliciesApi* | [**PolicyresultsOrgList**](docs/PoliciesApi.md#policyresultsorglist) | **Get** /policyresults | Lists all the policy results for an organization. -*PoliciesApi* | [**PolicystatusesList**](docs/PoliciesApi.md#policystatuseslist) | **Get** /policies/{policy_id}/policystatuses | Lists the latest policy results of a policy. -*PoliciesApi* | [**PolicystatusesList_0**](docs/PoliciesApi.md#policystatuseslist_0) | **Get** /systems/{system_id}/policystatuses | List the policy statuses for a system -*PoliciesApi* | [**PolicytemplatesGet**](docs/PoliciesApi.md#policytemplatesget) | **Get** /policytemplates/{id} | Get a specific Policy Template -*PoliciesApi* | [**PolicytemplatesList**](docs/PoliciesApi.md#policytemplateslist) | **Get** /policytemplates | Lists all of the Policy Templates -*PolicytemplatesApi* | [**PolicytemplatesGet**](docs/PolicytemplatesApi.md#policytemplatesget) | **Get** /policytemplates/{id} | Get a specific Policy Template -*PolicytemplatesApi* | [**PolicytemplatesList**](docs/PolicytemplatesApi.md#policytemplateslist) | **Get** /policytemplates | Lists all of the Policy Templates -*ProvidersApi* | [**ProvidersListAdministrators**](docs/ProvidersApi.md#providerslistadministrators) | **Get** /providers/{provider_id}/administrators | List Provider Administrators -*ProvidersApi* | [**ProvidersPostAdmins**](docs/ProvidersApi.md#providerspostadmins) | **Post** /providers/{provider_id}/administrators | Create a new Provider Administrator -*RADIUSServersApi* | [**GraphRadiusServerAssociationsList**](docs/RADIUSServersApi.md#graphradiusserverassociationslist) | **Get** /radiusservers/{radiusserver_id}/associations | List the associations of a RADIUS Server -*RADIUSServersApi* | [**GraphRadiusServerAssociationsPost**](docs/RADIUSServersApi.md#graphradiusserverassociationspost) | **Post** /radiusservers/{radiusserver_id}/associations | Manage the associations of a RADIUS Server -*RADIUSServersApi* | [**GraphRadiusServerTraverseUser**](docs/RADIUSServersApi.md#graphradiusservertraverseuser) | **Get** /radiusservers/{radiusserver_id}/users | List the Users bound to a RADIUS Server -*RADIUSServersApi* | [**GraphRadiusServerTraverseUserGroup**](docs/RADIUSServersApi.md#graphradiusservertraverseusergroup) | **Get** /radiusservers/{radiusserver_id}/usergroups | List the User Groups bound to a RADIUS Server -*SambaDomainsApi* | [**LdapserversSambaDomainsDelete**](docs/SambaDomainsApi.md#ldapserverssambadomainsdelete) | **Delete** /ldapservers/{ldapserver_id}/sambadomains/{id} | Delete Samba Domain -*SambaDomainsApi* | [**LdapserversSambaDomainsGet**](docs/SambaDomainsApi.md#ldapserverssambadomainsget) | **Get** /ldapservers/{ldapserver_id}/sambadomains/{id} | Get Samba Domain -*SambaDomainsApi* | [**LdapserversSambaDomainsList**](docs/SambaDomainsApi.md#ldapserverssambadomainslist) | **Get** /ldapservers/{ldapserver_id}/sambadomains | List Samba Domains -*SambaDomainsApi* | [**LdapserversSambaDomainsPost**](docs/SambaDomainsApi.md#ldapserverssambadomainspost) | **Post** /ldapservers/{ldapserver_id}/sambadomains | Create Samba Domain -*SambaDomainsApi* | [**LdapserversSambaDomainsPut**](docs/SambaDomainsApi.md#ldapserverssambadomainsput) | **Put** /ldapservers/{ldapserver_id}/sambadomains/{id} | Update Samba Domain -*SystemGroupAssociationsApi* | [**GraphSystemGroupAssociationsList**](docs/SystemGroupAssociationsApi.md#graphsystemgroupassociationslist) | **Get** /systemgroups/{group_id}/associations | List the associations of a System Group -*SystemGroupAssociationsApi* | [**GraphSystemGroupAssociationsPost**](docs/SystemGroupAssociationsApi.md#graphsystemgroupassociationspost) | **Post** /systemgroups/{group_id}/associations | Manage the associations of a System Group -*SystemGroupAssociationsApi* | [**GraphSystemGroupTraverseCommand**](docs/SystemGroupAssociationsApi.md#graphsystemgrouptraversecommand) | **Get** /systemgroups/{group_id}/commands | List the Commands bound to a System Group -*SystemGroupAssociationsApi* | [**GraphSystemGroupTraversePolicy**](docs/SystemGroupAssociationsApi.md#graphsystemgrouptraversepolicy) | **Get** /systemgroups/{group_id}/policies | List the Policies bound to a System Group -*SystemGroupAssociationsApi* | [**GraphSystemGroupTraverseUser**](docs/SystemGroupAssociationsApi.md#graphsystemgrouptraverseuser) | **Get** /systemgroups/{group_id}/users | List the Users bound to a System Group -*SystemGroupAssociationsApi* | [**GraphSystemGroupTraverseUserGroup**](docs/SystemGroupAssociationsApi.md#graphsystemgrouptraverseusergroup) | **Get** /systemgroups/{group_id}/usergroups | List the User Groups bound to a System Group -*SystemGroupMembersMembershipApi* | [**GraphSystemGroupMemberOf**](docs/SystemGroupMembersMembershipApi.md#graphsystemgroupmemberof) | **Get** /systemgroups/{group_id}/memberof | List the System Group's parents -*SystemGroupMembersMembershipApi* | [**GraphSystemGroupMembersList**](docs/SystemGroupMembersMembershipApi.md#graphsystemgroupmemberslist) | **Get** /systemgroups/{group_id}/members | List the members of a System Group -*SystemGroupMembersMembershipApi* | [**GraphSystemGroupMembersPost**](docs/SystemGroupMembersMembershipApi.md#graphsystemgroupmemberspost) | **Post** /systemgroups/{group_id}/members | Manage the members of a System Group -*SystemGroupMembersMembershipApi* | [**GraphSystemGroupMembership**](docs/SystemGroupMembersMembershipApi.md#graphsystemgroupmembership) | **Get** /systemgroups/{group_id}/membership | List the System Group's membership -*SystemGroupsApi* | [**GraphSystemGroupAssociationsList**](docs/SystemGroupsApi.md#graphsystemgroupassociationslist) | **Get** /systemgroups/{group_id}/associations | List the associations of a System Group -*SystemGroupsApi* | [**GraphSystemGroupAssociationsPost**](docs/SystemGroupsApi.md#graphsystemgroupassociationspost) | **Post** /systemgroups/{group_id}/associations | Manage the associations of a System Group -*SystemGroupsApi* | [**GraphSystemGroupMemberOf**](docs/SystemGroupsApi.md#graphsystemgroupmemberof) | **Get** /systemgroups/{group_id}/memberof | List the System Group's parents -*SystemGroupsApi* | [**GraphSystemGroupMembersList**](docs/SystemGroupsApi.md#graphsystemgroupmemberslist) | **Get** /systemgroups/{group_id}/members | List the members of a System Group -*SystemGroupsApi* | [**GraphSystemGroupMembersPost**](docs/SystemGroupsApi.md#graphsystemgroupmemberspost) | **Post** /systemgroups/{group_id}/members | Manage the members of a System Group -*SystemGroupsApi* | [**GraphSystemGroupMembership**](docs/SystemGroupsApi.md#graphsystemgroupmembership) | **Get** /systemgroups/{group_id}/membership | List the System Group's membership -*SystemGroupsApi* | [**GraphSystemGroupTraversePolicy**](docs/SystemGroupsApi.md#graphsystemgrouptraversepolicy) | **Get** /systemgroups/{group_id}/policies | List the Policies bound to a System Group -*SystemGroupsApi* | [**GraphSystemGroupTraverseUser**](docs/SystemGroupsApi.md#graphsystemgrouptraverseuser) | **Get** /systemgroups/{group_id}/users | List the Users bound to a System Group -*SystemGroupsApi* | [**GraphSystemGroupTraverseUserGroup**](docs/SystemGroupsApi.md#graphsystemgrouptraverseusergroup) | **Get** /systemgroups/{group_id}/usergroups | List the User Groups bound to a System Group -*SystemGroupsApi* | [**GroupsSystemDelete**](docs/SystemGroupsApi.md#groupssystemdelete) | **Delete** /systemgroups/{id} | Delete a System Group -*SystemGroupsApi* | [**GroupsSystemGet**](docs/SystemGroupsApi.md#groupssystemget) | **Get** /systemgroups/{id} | View an individual System Group details -*SystemGroupsApi* | [**GroupsSystemList**](docs/SystemGroupsApi.md#groupssystemlist) | **Get** /systemgroups | List all System Groups -*SystemGroupsApi* | [**GroupsSystemPatch**](docs/SystemGroupsApi.md#groupssystempatch) | **Patch** /systemgroups/{id} | Partial update a System Group -*SystemGroupsApi* | [**GroupsSystemPost**](docs/SystemGroupsApi.md#groupssystempost) | **Post** /systemgroups | Create a new System Group -*SystemGroupsApi* | [**GroupsSystemPut**](docs/SystemGroupsApi.md#groupssystemput) | **Put** /systemgroups/{id} | Update a System Group -*SystemInsightsApi* | [**SysteminsightsListApps**](docs/SystemInsightsApi.md#systeminsightslistapps) | **Get** /systeminsights/apps | List System Insights Apps -*SystemInsightsApi* | [**SysteminsightsListBattery**](docs/SystemInsightsApi.md#systeminsightslistbattery) | **Get** /systeminsights/battery | List System Insights Battery -*SystemInsightsApi* | [**SysteminsightsListBitlockerInfo**](docs/SystemInsightsApi.md#systeminsightslistbitlockerinfo) | **Get** /systeminsights/bitlocker_info | List System Insights Bitlocker Info -*SystemInsightsApi* | [**SysteminsightsListBrowserPlugins**](docs/SystemInsightsApi.md#systeminsightslistbrowserplugins) | **Get** /systeminsights/browser_plugins | List System Insights Browser Plugins -*SystemInsightsApi* | [**SysteminsightsListChromeExtensions**](docs/SystemInsightsApi.md#systeminsightslistchromeextensions) | **Get** /systeminsights/chrome_extensions | List System Insights Chrome Extensions -*SystemInsightsApi* | [**SysteminsightsListCrashes**](docs/SystemInsightsApi.md#systeminsightslistcrashes) | **Get** /systeminsights/crashes | List System Insights Crashes -*SystemInsightsApi* | [**SysteminsightsListDiskEncryption**](docs/SystemInsightsApi.md#systeminsightslistdiskencryption) | **Get** /systeminsights/disk_encryption | List System Insights Disk Encryption -*SystemInsightsApi* | [**SysteminsightsListDiskInfo**](docs/SystemInsightsApi.md#systeminsightslistdiskinfo) | **Get** /systeminsights/disk_info | List System Insights Disk Info -*SystemInsightsApi* | [**SysteminsightsListEtcHosts**](docs/SystemInsightsApi.md#systeminsightslistetchosts) | **Get** /systeminsights/etc_hosts | List System Insights Etc Hosts -*SystemInsightsApi* | [**SysteminsightsListFirefoxAddons**](docs/SystemInsightsApi.md#systeminsightslistfirefoxaddons) | **Get** /systeminsights/firefox_addons | List System Insights Firefox Addons -*SystemInsightsApi* | [**SysteminsightsListGroups**](docs/SystemInsightsApi.md#systeminsightslistgroups) | **Get** /systeminsights/groups | List System Insights Groups -*SystemInsightsApi* | [**SysteminsightsListIeExtensions**](docs/SystemInsightsApi.md#systeminsightslistieextensions) | **Get** /systeminsights/ie_extensions | List System Insights IE Extensions -*SystemInsightsApi* | [**SysteminsightsListInterfaceAddresses**](docs/SystemInsightsApi.md#systeminsightslistinterfaceaddresses) | **Get** /systeminsights/interface_addresses | List System Insights Interface Addresses -*SystemInsightsApi* | [**SysteminsightsListKernelInfo**](docs/SystemInsightsApi.md#systeminsightslistkernelinfo) | **Get** /systeminsights/kernel_info | List System Insights Kernel Info -*SystemInsightsApi* | [**SysteminsightsListLaunchd**](docs/SystemInsightsApi.md#systeminsightslistlaunchd) | **Get** /systeminsights/launchd | List System Insights Launchd -*SystemInsightsApi* | [**SysteminsightsListLoggedInUsers**](docs/SystemInsightsApi.md#systeminsightslistloggedinusers) | **Get** /systeminsights/logged_in_users | List System Insights Logged-In Users -*SystemInsightsApi* | [**SysteminsightsListLogicalDrives**](docs/SystemInsightsApi.md#systeminsightslistlogicaldrives) | **Get** /systeminsights/logical_drives | List System Insights Logical Drives -*SystemInsightsApi* | [**SysteminsightsListMounts**](docs/SystemInsightsApi.md#systeminsightslistmounts) | **Get** /systeminsights/mounts | List System Insights Mounts -*SystemInsightsApi* | [**SysteminsightsListOsVersion**](docs/SystemInsightsApi.md#systeminsightslistosversion) | **Get** /systeminsights/os_version | List System Insights OS Version -*SystemInsightsApi* | [**SysteminsightsListPatches**](docs/SystemInsightsApi.md#systeminsightslistpatches) | **Get** /systeminsights/patches | List System Insights Patches -*SystemInsightsApi* | [**SysteminsightsListPrograms**](docs/SystemInsightsApi.md#systeminsightslistprograms) | **Get** /systeminsights/programs | List System Insights Programs -*SystemInsightsApi* | [**SysteminsightsListSafariExtensions**](docs/SystemInsightsApi.md#systeminsightslistsafariextensions) | **Get** /systeminsights/safari_extensions | List System Insights Safari Extensions -*SystemInsightsApi* | [**SysteminsightsListSystemApps**](docs/SystemInsightsApi.md#systeminsightslistsystemapps) | **Get** /systeminsights/{system_id}/apps | List System Insights System Apps -*SystemInsightsApi* | [**SysteminsightsListSystemBitlockerInfo**](docs/SystemInsightsApi.md#systeminsightslistsystembitlockerinfo) | **Get** /systeminsights/{system_id}/bitlocker_info | List System Insights System Bitlocker Info -*SystemInsightsApi* | [**SysteminsightsListSystemBrowserPlugins**](docs/SystemInsightsApi.md#systeminsightslistsystembrowserplugins) | **Get** /systeminsights/{system_id}/browser_plugins | List System Insights System Browser Plugins -*SystemInsightsApi* | [**SysteminsightsListSystemChromeExtensions**](docs/SystemInsightsApi.md#systeminsightslistsystemchromeextensions) | **Get** /systeminsights/{system_id}/chrome_extensions | List System Insights System Chrome Extensions -*SystemInsightsApi* | [**SysteminsightsListSystemControls**](docs/SystemInsightsApi.md#systeminsightslistsystemcontrols) | **Get** /systeminsights/system_controls | List System Insights System Control -*SystemInsightsApi* | [**SysteminsightsListSystemDiskEncryption**](docs/SystemInsightsApi.md#systeminsightslistsystemdiskencryption) | **Get** /systeminsights/{system_id}/disk_encryption | List System Insights System Disk Encryption -*SystemInsightsApi* | [**SysteminsightsListSystemDiskInfo**](docs/SystemInsightsApi.md#systeminsightslistsystemdiskinfo) | **Get** /systeminsights/{system_id}/disk_info | List System Insights System Disk Info -*SystemInsightsApi* | [**SysteminsightsListSystemEtcHosts**](docs/SystemInsightsApi.md#systeminsightslistsystemetchosts) | **Get** /systeminsights/{system_id}/etc_hosts | List System Insights System Etc Hosts -*SystemInsightsApi* | [**SysteminsightsListSystemFirefoxAddons**](docs/SystemInsightsApi.md#systeminsightslistsystemfirefoxaddons) | **Get** /systeminsights/{system_id}/firefox_addons | List System Insights System Firefox Addons -*SystemInsightsApi* | [**SysteminsightsListSystemGroups**](docs/SystemInsightsApi.md#systeminsightslistsystemgroups) | **Get** /systeminsights/{system_id}/groups | List System Insights System Groups -*SystemInsightsApi* | [**SysteminsightsListSystemInfo**](docs/SystemInsightsApi.md#systeminsightslistsysteminfo) | **Get** /systeminsights/system_info | List System Insights System Info -*SystemInsightsApi* | [**SysteminsightsListSystemInterfaceAddresses**](docs/SystemInsightsApi.md#systeminsightslistsysteminterfaceaddresses) | **Get** /systeminsights/{system_id}/interface_addresses | List System Insights System Interface Addresses -*SystemInsightsApi* | [**SysteminsightsListSystemKernelInfo**](docs/SystemInsightsApi.md#systeminsightslistsystemkernelinfo) | **Get** /systeminsights/{system_id}/kernel_info | List System Insights System Kernel Info -*SystemInsightsApi* | [**SysteminsightsListSystemLogicalDrives**](docs/SystemInsightsApi.md#systeminsightslistsystemlogicaldrives) | **Get** /systeminsights/{system_id}/logical_drives | List System Insights System Logical Drives -*SystemInsightsApi* | [**SysteminsightsListSystemMounts**](docs/SystemInsightsApi.md#systeminsightslistsystemmounts) | **Get** /systeminsights/{system_id}/mounts | List System Insights System Mounts -*SystemInsightsApi* | [**SysteminsightsListSystemOsVersion**](docs/SystemInsightsApi.md#systeminsightslistsystemosversion) | **Get** /systeminsights/{system_id}/os_version | List System Insights System OS Version -*SystemInsightsApi* | [**SysteminsightsListSystemPatches**](docs/SystemInsightsApi.md#systeminsightslistsystempatches) | **Get** /systeminsights/{system_id}/patches | List System Insights System Patches -*SystemInsightsApi* | [**SysteminsightsListSystemPrograms**](docs/SystemInsightsApi.md#systeminsightslistsystemprograms) | **Get** /systeminsights/{system_id}/programs | List System Insights System Programs -*SystemInsightsApi* | [**SysteminsightsListSystemSafariExtensions**](docs/SystemInsightsApi.md#systeminsightslistsystemsafariextensions) | **Get** /systeminsights/{system_id}/safari_extensions | List System Insights System Safari Extensions -*SystemInsightsApi* | [**SysteminsightsListSystemSystemControls**](docs/SystemInsightsApi.md#systeminsightslistsystemsystemcontrols) | **Get** /systeminsights/{system_id}/system_controls | List System Insights System System Controls -*SystemInsightsApi* | [**SysteminsightsListSystemSystemInfo**](docs/SystemInsightsApi.md#systeminsightslistsystemsysteminfo) | **Get** /systeminsights/{system_id}/system_info | List System Insights System System Info -*SystemInsightsApi* | [**SysteminsightsListSystemUptime**](docs/SystemInsightsApi.md#systeminsightslistsystemuptime) | **Get** /systeminsights/{system_id}/uptime | List System Insights System Uptime -*SystemInsightsApi* | [**SysteminsightsListSystemUsers**](docs/SystemInsightsApi.md#systeminsightslistsystemusers) | **Get** /systeminsights/{system_id}/users | List System Insights System Users -*SystemInsightsApi* | [**SysteminsightsListUptime**](docs/SystemInsightsApi.md#systeminsightslistuptime) | **Get** /systeminsights/uptime | List System Insights Uptime -*SystemInsightsApi* | [**SysteminsightsListUsbDevices**](docs/SystemInsightsApi.md#systeminsightslistusbdevices) | **Get** /systeminsights/usb_devices | List System Insights USB Devices -*SystemInsightsApi* | [**SysteminsightsListUserGroups**](docs/SystemInsightsApi.md#systeminsightslistusergroups) | **Get** /systeminsights/user_groups | List System Insights User Groups -*SystemInsightsApi* | [**SysteminsightsListUsers**](docs/SystemInsightsApi.md#systeminsightslistusers) | **Get** /systeminsights/users | List System Insights Users -*SystemInsightsApi* | [**SysteminsightsListWindowsCrashes**](docs/SystemInsightsApi.md#systeminsightslistwindowscrashes) | **Get** /systeminsights/windows_crashes | List System Insights Windows Crashes -*SystemsApi* | [**GraphSystemAssociationsList**](docs/SystemsApi.md#graphsystemassociationslist) | **Get** /systems/{system_id}/associations | List the associations of a System -*SystemsApi* | [**GraphSystemAssociationsPost**](docs/SystemsApi.md#graphsystemassociationspost) | **Post** /systems/{system_id}/associations | Manage associations of a System -*SystemsApi* | [**GraphSystemMemberOf**](docs/SystemsApi.md#graphsystemmemberof) | **Get** /systems/{system_id}/memberof | List the parent Groups of a System -*SystemsApi* | [**GraphSystemTraverseCommand**](docs/SystemsApi.md#graphsystemtraversecommand) | **Get** /systems/{system_id}/commands | List the Commands bound to a System -*SystemsApi* | [**GraphSystemTraversePolicy**](docs/SystemsApi.md#graphsystemtraversepolicy) | **Get** /systems/{system_id}/policies | List the Policies bound to a System -*SystemsApi* | [**GraphSystemTraverseUser**](docs/SystemsApi.md#graphsystemtraverseuser) | **Get** /systems/{system_id}/users | List the Users bound to a System -*SystemsApi* | [**GraphSystemTraverseUserGroup**](docs/SystemsApi.md#graphsystemtraverseusergroup) | **Get** /systems/{system_id}/usergroups | List the User Groups bound to a System -*SystemsApi* | [**SystemsGetFDEKey**](docs/SystemsApi.md#systemsgetfdekey) | **Get** /systems/{system_id}/fdekey | Get System FDE Key -*UserGroupAssociationsApi* | [**GraphUserGroupAssociationsList**](docs/UserGroupAssociationsApi.md#graphusergroupassociationslist) | **Get** /usergroups/{group_id}/associations | List the associations of a User Group. -*UserGroupAssociationsApi* | [**GraphUserGroupAssociationsPost**](docs/UserGroupAssociationsApi.md#graphusergroupassociationspost) | **Post** /usergroups/{group_id}/associations | Manage the associations of a User Group -*UserGroupAssociationsApi* | [**GraphUserGroupTraverseActiveDirectory**](docs/UserGroupAssociationsApi.md#graphusergrouptraverseactivedirectory) | **Get** /usergroups/{group_id}/activedirectories | List the Active Directories bound to a User Group -*UserGroupAssociationsApi* | [**GraphUserGroupTraverseApplication**](docs/UserGroupAssociationsApi.md#graphusergrouptraverseapplication) | **Get** /usergroups/{group_id}/applications | List the Applications bound to a User Group -*UserGroupAssociationsApi* | [**GraphUserGroupTraverseDirectory**](docs/UserGroupAssociationsApi.md#graphusergrouptraversedirectory) | **Get** /usergroups/{group_id}/directories | List the Directories bound to a User Group -*UserGroupAssociationsApi* | [**GraphUserGroupTraverseGSuite**](docs/UserGroupAssociationsApi.md#graphusergrouptraversegsuite) | **Get** /usergroups/{group_id}/gsuites | List the G Suite instances bound to a User Group -*UserGroupAssociationsApi* | [**GraphUserGroupTraverseLdapServer**](docs/UserGroupAssociationsApi.md#graphusergrouptraverseldapserver) | **Get** /usergroups/{group_id}/ldapservers | List the LDAP Servers bound to a User Group -*UserGroupAssociationsApi* | [**GraphUserGroupTraverseOffice365**](docs/UserGroupAssociationsApi.md#graphusergrouptraverseoffice365) | **Get** /usergroups/{group_id}/office365s | List the Office 365 instances bound to a User Group -*UserGroupAssociationsApi* | [**GraphUserGroupTraverseRadiusServer**](docs/UserGroupAssociationsApi.md#graphusergrouptraverseradiusserver) | **Get** /usergroups/{group_id}/radiusservers | List the RADIUS Servers bound to a User Group -*UserGroupAssociationsApi* | [**GraphUserGroupTraverseSystem**](docs/UserGroupAssociationsApi.md#graphusergrouptraversesystem) | **Get** /usergroups/{group_id}/systems | List the Systems bound to a User Group -*UserGroupAssociationsApi* | [**GraphUserGroupTraverseSystemGroup**](docs/UserGroupAssociationsApi.md#graphusergrouptraversesystemgroup) | **Get** /usergroups/{group_id}/systemgroups | List the System Groups bound to User Groups -*UserGroupMembersMembershipApi* | [**GraphUserGroupMemberOf**](docs/UserGroupMembersMembershipApi.md#graphusergroupmemberof) | **Get** /usergroups/{group_id}/memberof | List the User Group's parents -*UserGroupMembersMembershipApi* | [**GraphUserGroupMembersList**](docs/UserGroupMembersMembershipApi.md#graphusergroupmemberslist) | **Get** /usergroups/{group_id}/members | List the members of a User Group -*UserGroupMembersMembershipApi* | [**GraphUserGroupMembersPost**](docs/UserGroupMembersMembershipApi.md#graphusergroupmemberspost) | **Post** /usergroups/{group_id}/members | Manage the members of a User Group -*UserGroupMembersMembershipApi* | [**GraphUserGroupMembership**](docs/UserGroupMembersMembershipApi.md#graphusergroupmembership) | **Get** /usergroups/{group_id}/membership | List the User Group's membership -*UserGroupsApi* | [**GraphUserGroupAssociationsList**](docs/UserGroupsApi.md#graphusergroupassociationslist) | **Get** /usergroups/{group_id}/associations | List the associations of a User Group. -*UserGroupsApi* | [**GraphUserGroupAssociationsPost**](docs/UserGroupsApi.md#graphusergroupassociationspost) | **Post** /usergroups/{group_id}/associations | Manage the associations of a User Group -*UserGroupsApi* | [**GraphUserGroupMemberOf**](docs/UserGroupsApi.md#graphusergroupmemberof) | **Get** /usergroups/{group_id}/memberof | List the User Group's parents -*UserGroupsApi* | [**GraphUserGroupMembersList**](docs/UserGroupsApi.md#graphusergroupmemberslist) | **Get** /usergroups/{group_id}/members | List the members of a User Group -*UserGroupsApi* | [**GraphUserGroupMembersPost**](docs/UserGroupsApi.md#graphusergroupmemberspost) | **Post** /usergroups/{group_id}/members | Manage the members of a User Group -*UserGroupsApi* | [**GraphUserGroupMembership**](docs/UserGroupsApi.md#graphusergroupmembership) | **Get** /usergroups/{group_id}/membership | List the User Group's membership -*UserGroupsApi* | [**GraphUserGroupTraverseActiveDirectory**](docs/UserGroupsApi.md#graphusergrouptraverseactivedirectory) | **Get** /usergroups/{group_id}/activedirectories | List the Active Directories bound to a User Group -*UserGroupsApi* | [**GraphUserGroupTraverseApplication**](docs/UserGroupsApi.md#graphusergrouptraverseapplication) | **Get** /usergroups/{group_id}/applications | List the Applications bound to a User Group -*UserGroupsApi* | [**GraphUserGroupTraverseDirectory**](docs/UserGroupsApi.md#graphusergrouptraversedirectory) | **Get** /usergroups/{group_id}/directories | List the Directories bound to a User Group -*UserGroupsApi* | [**GraphUserGroupTraverseGSuite**](docs/UserGroupsApi.md#graphusergrouptraversegsuite) | **Get** /usergroups/{group_id}/gsuites | List the G Suite instances bound to a User Group -*UserGroupsApi* | [**GraphUserGroupTraverseLdapServer**](docs/UserGroupsApi.md#graphusergrouptraverseldapserver) | **Get** /usergroups/{group_id}/ldapservers | List the LDAP Servers bound to a User Group -*UserGroupsApi* | [**GraphUserGroupTraverseOffice365**](docs/UserGroupsApi.md#graphusergrouptraverseoffice365) | **Get** /usergroups/{group_id}/office365s | List the Office 365 instances bound to a User Group -*UserGroupsApi* | [**GraphUserGroupTraverseRadiusServer**](docs/UserGroupsApi.md#graphusergrouptraverseradiusserver) | **Get** /usergroups/{group_id}/radiusservers | List the RADIUS Servers bound to a User Group -*UserGroupsApi* | [**GraphUserGroupTraverseSystem**](docs/UserGroupsApi.md#graphusergrouptraversesystem) | **Get** /usergroups/{group_id}/systems | List the Systems bound to a User Group -*UserGroupsApi* | [**GraphUserGroupTraverseSystemGroup**](docs/UserGroupsApi.md#graphusergrouptraversesystemgroup) | **Get** /usergroups/{group_id}/systemgroups | List the System Groups bound to User Groups -*UserGroupsApi* | [**GroupsUserDelete**](docs/UserGroupsApi.md#groupsuserdelete) | **Delete** /usergroups/{id} | Delete a User Group -*UserGroupsApi* | [**GroupsUserGet**](docs/UserGroupsApi.md#groupsuserget) | **Get** /usergroups/{id} | View an individual User Group details -*UserGroupsApi* | [**GroupsUserList**](docs/UserGroupsApi.md#groupsuserlist) | **Get** /usergroups | List all User Groups -*UserGroupsApi* | [**GroupsUserPatch**](docs/UserGroupsApi.md#groupsuserpatch) | **Patch** /usergroups/{id} | Partial update a User Group -*UserGroupsApi* | [**GroupsUserPost**](docs/UserGroupsApi.md#groupsuserpost) | **Post** /usergroups | Create a new User Group -*UserGroupsApi* | [**GroupsUserPut**](docs/UserGroupsApi.md#groupsuserput) | **Put** /usergroups/{id} | Update a User Group -*UsersApi* | [**GraphUserAssociationsList**](docs/UsersApi.md#graphuserassociationslist) | **Get** /users/{user_id}/associations | List the associations of a User -*UsersApi* | [**GraphUserAssociationsPost**](docs/UsersApi.md#graphuserassociationspost) | **Post** /users/{user_id}/associations | Manage the associations of a User -*UsersApi* | [**GraphUserMemberOf**](docs/UsersApi.md#graphusermemberof) | **Get** /users/{user_id}/memberof | List the parent Groups of a User -*UsersApi* | [**GraphUserTraverseApplication**](docs/UsersApi.md#graphusertraverseapplication) | **Get** /users/{user_id}/applications | List the Applications bound to a User -*UsersApi* | [**GraphUserTraverseDirectory**](docs/UsersApi.md#graphusertraversedirectory) | **Get** /users/{user_id}/directories | List the Directories bound to a User -*UsersApi* | [**GraphUserTraverseGSuite**](docs/UsersApi.md#graphusertraversegsuite) | **Get** /users/{user_id}/gsuites | List the G Suite instances bound to a User -*UsersApi* | [**GraphUserTraverseLdapServer**](docs/UsersApi.md#graphusertraverseldapserver) | **Get** /users/{user_id}/ldapservers | List the LDAP servers bound to a User -*UsersApi* | [**GraphUserTraverseOffice365**](docs/UsersApi.md#graphusertraverseoffice365) | **Get** /users/{user_id}/office365s | List the Office 365 instances bound to a User -*UsersApi* | [**GraphUserTraverseRadiusServer**](docs/UsersApi.md#graphusertraverseradiusserver) | **Get** /users/{user_id}/radiusservers | List the RADIUS Servers bound to a User -*UsersApi* | [**GraphUserTraverseSystem**](docs/UsersApi.md#graphusertraversesystem) | **Get** /users/{user_id}/systems | List the Systems bound to a User -*UsersApi* | [**GraphUserTraverseSystemGroup**](docs/UsersApi.md#graphusertraversesystemgroup) | **Get** /users/{user_id}/systemgroups | List the System Groups bound to a User -*UsersApi* | [**UsersSendEmails**](docs/UsersApi.md#userssendemails) | **Post** /users/{user_id}/emails | Send User Emails -*WorkdayImportApi* | [**WorkdaysAuthorize**](docs/WorkdayImportApi.md#workdaysauthorize) | **Post** /workdays/{workday_id}/auth | Authorize Workday -*WorkdayImportApi* | [**WorkdaysDeauthorize**](docs/WorkdayImportApi.md#workdaysdeauthorize) | **Delete** /workdays/{workday_id}/auth | Deauthorize Workday -*WorkdayImportApi* | [**WorkdaysDelete**](docs/WorkdayImportApi.md#workdaysdelete) | **Delete** /workdays/{id} | Delete Workday -*WorkdayImportApi* | [**WorkdaysGet**](docs/WorkdayImportApi.md#workdaysget) | **Get** /workdays/{id} | Get Workday -*WorkdayImportApi* | [**WorkdaysImport**](docs/WorkdayImportApi.md#workdaysimport) | **Post** /workdays/{workday_id}/import | Workday Import -*WorkdayImportApi* | [**WorkdaysImportresults**](docs/WorkdayImportApi.md#workdaysimportresults) | **Get** /workdays/{id}/import/{job_id}/results | List Import Results -*WorkdayImportApi* | [**WorkdaysList**](docs/WorkdayImportApi.md#workdayslist) | **Get** /workdays | List Workdays -*WorkdayImportApi* | [**WorkdaysPost**](docs/WorkdayImportApi.md#workdayspost) | **Post** /workdays | Create new Workday -*WorkdayImportApi* | [**WorkdaysPut**](docs/WorkdayImportApi.md#workdaysput) | **Put** /workdays/{id} | Update Workday -*WorkdayImportApi* | [**WorkdaysSettings**](docs/WorkdayImportApi.md#workdayssettings) | **Get** /workdays/settings | Get Workday Settings (incomplete) -*WorkdayImportApi* | [**WorkdaysWorkers**](docs/WorkdayImportApi.md#workdaysworkers) | **Get** /workdays/{workday_id}/workers | List Workday Workers - - -## Documentation For Models - - - [ActiveDirectoryAgentGetOutput](docs/ActiveDirectoryAgentGetOutput.md) - - [ActiveDirectoryAgentInput](docs/ActiveDirectoryAgentInput.md) - - [ActiveDirectoryAgentListOutput](docs/ActiveDirectoryAgentListOutput.md) - - [ActiveDirectoryInput](docs/ActiveDirectoryInput.md) - - [Administrator](docs/Administrator.md) - - [AppleMdm](docs/AppleMdm.md) - - [AppleMdmPatchInput](docs/AppleMdmPatchInput.md) - - [AuthInfo](docs/AuthInfo.md) - - [AuthInput](docs/AuthInput.md) - - [AuthInputObject](docs/AuthInputObject.md) - - [AuthinputBasic](docs/AuthinputBasic.md) - - [AuthinputOauth](docs/AuthinputOauth.md) - - [Body](docs/Body.md) - - [Body1](docs/Body1.md) - - [Body2](docs/Body2.md) - - [Body3](docs/Body3.md) - - [BulkUserCreate](docs/BulkUserCreate.md) - - [BulkUserUpdate](docs/BulkUserUpdate.md) - - [Directory](docs/Directory.md) - - [DuoAccount](docs/DuoAccount.md) - - [DuoApplication](docs/DuoApplication.md) - - [DuoApplicationReq](docs/DuoApplicationReq.md) - - [DuoApplicationUpdateReq](docs/DuoApplicationUpdateReq.md) - - [DuoRegistrationApplication](docs/DuoRegistrationApplication.md) - - [DuoRegistrationApplicationReq](docs/DuoRegistrationApplicationReq.md) - - [Emailrequest](docs/Emailrequest.md) - - [EnrollmentProfile](docs/EnrollmentProfile.md) - - [Errorresponse](docs/Errorresponse.md) - - [GSuiteBuiltinTranslation](docs/GSuiteBuiltinTranslation.md) - - [GSuiteTranslationRule](docs/GSuiteTranslationRule.md) - - [GSuiteTranslationRuleRequest](docs/GSuiteTranslationRuleRequest.md) - - [GraphConnection](docs/GraphConnection.md) - - [GraphManagementReq](docs/GraphManagementReq.md) - - [GraphObject](docs/GraphObject.md) - - [GraphObjectWithPaths](docs/GraphObjectWithPaths.md) - - [GraphType](docs/GraphType.md) - - [Group](docs/Group.md) - - [GroupType](docs/GroupType.md) - - [GsuiteOutput](docs/GsuiteOutput.md) - - [GsuitePatchInput](docs/GsuitePatchInput.md) - - [InlineResponse200](docs/InlineResponse200.md) - - [InlineResponse2001](docs/InlineResponse2001.md) - - [InlineResponse201](docs/InlineResponse201.md) - - [InlineResponse400](docs/InlineResponse400.md) - - [JcEnrollmentProfile](docs/JcEnrollmentProfile.md) - - [JobDetails](docs/JobDetails.md) - - [JobId](docs/JobId.md) - - [JobWorkresult](docs/JobWorkresult.md) - - [LdapServerAction](docs/LdapServerAction.md) - - [LdapServerInput](docs/LdapServerInput.md) - - [Mfa](docs/Mfa.md) - - [Mobileconfig](docs/Mobileconfig.md) - - [ModelError](docs/ModelError.md) - - [OauthCodeInput](docs/OauthCodeInput.md) - - [Office365BuiltinTranslation](docs/Office365BuiltinTranslation.md) - - [Office365TranslationRule](docs/Office365TranslationRule.md) - - [Office365TranslationRuleRequest](docs/Office365TranslationRuleRequest.md) - - [OrgCryptoSettings](docs/OrgCryptoSettings.md) - - [OrgcryptosettingsSshKeys](docs/OrgcryptosettingsSshKeys.md) - - [Policy](docs/Policy.md) - - [PolicyRequest](docs/PolicyRequest.md) - - [PolicyRequestTemplate](docs/PolicyRequestTemplate.md) - - [PolicyResult](docs/PolicyResult.md) - - [PolicyTemplate](docs/PolicyTemplate.md) - - [PolicyTemplateConfigField](docs/PolicyTemplateConfigField.md) - - [PolicyTemplateConfigFieldTooltip](docs/PolicyTemplateConfigFieldTooltip.md) - - [PolicyTemplateConfigFieldTooltipVariables](docs/PolicyTemplateConfigFieldTooltipVariables.md) - - [PolicyTemplateWithDetails](docs/PolicyTemplateWithDetails.md) - - [PolicyValue](docs/PolicyValue.md) - - [PolicyWithDetails](docs/PolicyWithDetails.md) - - [Provider](docs/Provider.md) - - [ProviderAdminReq](docs/ProviderAdminReq.md) - - [ProviderContact](docs/ProviderContact.md) - - [SalesforceKnowledgeListOutput](docs/SalesforceKnowledgeListOutput.md) - - [SalesforceknowledgelistoutputInner](docs/SalesforceknowledgelistoutputInner.md) - - [SambaDomainInput](docs/SambaDomainInput.md) - - [Sshkeylist](docs/Sshkeylist.md) - - [SystemGraphManagementReq](docs/SystemGraphManagementReq.md) - - [SystemGraphManagementReqAttributes](docs/SystemGraphManagementReqAttributes.md) - - [SystemGraphManagementReqAttributesSudo](docs/SystemGraphManagementReqAttributesSudo.md) - - [SystemGroup](docs/SystemGroup.md) - - [SystemGroupData](docs/SystemGroupData.md) - - [SystemGroupGraphManagementReq](docs/SystemGroupGraphManagementReq.md) - - [SystemGroupMembersReq](docs/SystemGroupMembersReq.md) - - [SystemInsightsApps](docs/SystemInsightsApps.md) - - [SystemInsightsBattery](docs/SystemInsightsBattery.md) - - [SystemInsightsBitlockerInfo](docs/SystemInsightsBitlockerInfo.md) - - [SystemInsightsBrowserPlugins](docs/SystemInsightsBrowserPlugins.md) - - [SystemInsightsChromeExtensions](docs/SystemInsightsChromeExtensions.md) - - [SystemInsightsCrashes](docs/SystemInsightsCrashes.md) - - [SystemInsightsDiskEncryption](docs/SystemInsightsDiskEncryption.md) - - [SystemInsightsDiskInfo](docs/SystemInsightsDiskInfo.md) - - [SystemInsightsEtcHosts](docs/SystemInsightsEtcHosts.md) - - [SystemInsightsFirefoxAddons](docs/SystemInsightsFirefoxAddons.md) - - [SystemInsightsGroups](docs/SystemInsightsGroups.md) - - [SystemInsightsIeExtensions](docs/SystemInsightsIeExtensions.md) - - [SystemInsightsInterfaceAddresses](docs/SystemInsightsInterfaceAddresses.md) - - [SystemInsightsKernelInfo](docs/SystemInsightsKernelInfo.md) - - [SystemInsightsLaunchd](docs/SystemInsightsLaunchd.md) - - [SystemInsightsLoggedInUsers](docs/SystemInsightsLoggedInUsers.md) - - [SystemInsightsLogicalDrvies](docs/SystemInsightsLogicalDrvies.md) - - [SystemInsightsMounts](docs/SystemInsightsMounts.md) - - [SystemInsightsOsVersion](docs/SystemInsightsOsVersion.md) - - [SystemInsightsPatches](docs/SystemInsightsPatches.md) - - [SystemInsightsPrograms](docs/SystemInsightsPrograms.md) - - [SystemInsightsSafariExtensions](docs/SystemInsightsSafariExtensions.md) - - [SystemInsightsSystemControls](docs/SystemInsightsSystemControls.md) - - [SystemInsightsSystemInfo](docs/SystemInsightsSystemInfo.md) - - [SystemInsightsUptime](docs/SystemInsightsUptime.md) - - [SystemInsightsUsbDevices](docs/SystemInsightsUsbDevices.md) - - [SystemInsightsUserGroups](docs/SystemInsightsUserGroups.md) - - [SystemInsightsUsers](docs/SystemInsightsUsers.md) - - [SystemInsightsWindowsCrashes](docs/SystemInsightsWindowsCrashes.md) - - [Systemfdekey](docs/Systemfdekey.md) - - [Systemuser](docs/Systemuser.md) - - [Systemuserputpost](docs/Systemuserputpost.md) - - [SystemuserputpostAddresses](docs/SystemuserputpostAddresses.md) - - [SystemuserputpostPhoneNumbers](docs/SystemuserputpostPhoneNumbers.md) - - [UserGraphManagementReq](docs/UserGraphManagementReq.md) - - [UserGroup](docs/UserGroup.md) - - [UserGroupAttributes](docs/UserGroupAttributes.md) - - [UserGroupAttributesPosixGroups](docs/UserGroupAttributesPosixGroups.md) - - [UserGroupGraphManagementReq](docs/UserGroupGraphManagementReq.md) - - [UserGroupMembersReq](docs/UserGroupMembersReq.md) - - [UserGroupPost](docs/UserGroupPost.md) - - [UserGroupPut](docs/UserGroupPut.md) - - [WorkdayFields](docs/WorkdayFields.md) - - [WorkdayInput](docs/WorkdayInput.md) - - [WorkdayOutput](docs/WorkdayOutput.md) - - [WorkdayRequest](docs/WorkdayRequest.md) - - [WorkdayWorker](docs/WorkdayWorker.md) - - [WorkdayoutputAuth](docs/WorkdayoutputAuth.md) - - [ActiveDirectoryOutput](docs/ActiveDirectoryOutput.md) - - [LdapServerOutput](docs/LdapServerOutput.md) - - [SambaDomainOutput](docs/SambaDomainOutput.md) - - -## Documentation For Authorization - -## x-api-key -- **Type**: API key - -Example -``` - auth := context.WithValue(context.Background(), sw.ContextAPIKey, sw.APIKey{ - Key: "APIKEY", - Prefix: "Bearer", // Omit if not necessary. - }) - r, err := client.Service.Operation(auth, args) -``` - -## Author - - - diff --git a/v2/active_directory_agent_get_output.go b/v2/active_directory_agent_get_output.go deleted file mode 100644 index 3778596..0000000 --- a/v2/active_directory_agent_get_output.go +++ /dev/null @@ -1,19 +0,0 @@ -/* - * JumpCloud APIs - * - * JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. - * - * API version: 2.0 - * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) - */ - -package v2 - -type ActiveDirectoryAgentGetOutput struct { - - // The connect key to use when installing the Agent on a Domain Controller. - ConnectKey string `json:"connectKey,omitempty"` - - // ObjectID of this Active Directory Agent. - Id string `json:"id"` -} diff --git a/v2/active_directory_agent_input.go b/v2/active_directory_agent_input.go deleted file mode 100644 index f72f44f..0000000 --- a/v2/active_directory_agent_input.go +++ /dev/null @@ -1,13 +0,0 @@ -/* - * JumpCloud APIs - * - * JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. - * - * API version: 2.0 - * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) - */ - -package v2 - -type ActiveDirectoryAgentInput struct { -} diff --git a/v2/active_directory_agent_list_output.go b/v2/active_directory_agent_list_output.go deleted file mode 100644 index 004ebd3..0000000 --- a/v2/active_directory_agent_list_output.go +++ /dev/null @@ -1,18 +0,0 @@ -/* - * JumpCloud APIs - * - * JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. - * - * API version: 2.0 - * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) - */ - -package v2 - -type ActiveDirectoryAgentListOutput struct { - - // ObjectID of this Active Directory Agent. - Id string `json:"id,omitempty"` - - State string `json:"state,omitempty"` -} diff --git a/v2/active_directory_api.go b/v2/active_directory_api.go deleted file mode 100644 index 083ec72..0000000 --- a/v2/active_directory_api.go +++ /dev/null @@ -1,1058 +0,0 @@ -/* - * JumpCloud APIs - * - * JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. - * - * API version: 2.0 - * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) - */ - -package v2 - -import ( - "io/ioutil" - "net/url" - "net/http" - "strings" - "golang.org/x/net/context" - "encoding/json" - "fmt" -) - -// Linger please -var ( - _ context.Context -) - -type ActiveDirectoryApiService service - - -/* ActiveDirectoryApiService Delete Active Directory Agent - * @param ctx context.Context for authentication, logging, tracing, etc. - @param activedirectoryId - @param agentId - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "xOrgId" (string) - @return */ -func (a *ActiveDirectoryApiService) ActivedirectoriesAgentsDelete(ctx context.Context, activedirectoryId string, agentId string, contentType string, accept string, localVarOptionals map[string]interface{}) ( *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Delete") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/activedirectories/{activedirectory_id}/agents/{agent_id}" - localVarPath = strings.Replace(localVarPath, "{"+"activedirectory_id"+"}", fmt.Sprintf("%v", activedirectoryId), -1) - localVarPath = strings.Replace(localVarPath, "{"+"agent_id"+"}", fmt.Sprintf("%v", agentId), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return nil, err - } - - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - return localVarHttpResponse, err -} - -/* ActiveDirectoryApiService Get Active Directory Agent - This endpoint returns a specific active directory agent. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/activedirectories/{activedirectory_id}/agents/{agent_id} \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - * @param ctx context.Context for authentication, logging, tracing, etc. - @param activedirectoryId - @param agentId - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "xOrgId" (string) - @return ActiveDirectoryAgentListOutput*/ -func (a *ActiveDirectoryApiService) ActivedirectoriesAgentsGet(ctx context.Context, activedirectoryId string, agentId string, contentType string, accept string, localVarOptionals map[string]interface{}) (ActiveDirectoryAgentListOutput, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload ActiveDirectoryAgentListOutput - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/activedirectories/{activedirectory_id}/agents/{agent_id}" - localVarPath = strings.Replace(localVarPath, "{"+"activedirectory_id"+"}", fmt.Sprintf("%v", activedirectoryId), -1) - localVarPath = strings.Replace(localVarPath, "{"+"agent_id"+"}", fmt.Sprintf("%v", agentId), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return successPayload, nil, err - } - - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* ActiveDirectoryApiService List Active Directory Agents - This endpoint allows you to list all your Active Directory Agents for a given Instance. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/activedirectories/{activedirectory_id}/agents \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - * @param ctx context.Context for authentication, logging, tracing, etc. - @param activedirectoryId - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "limit" (int32) The number of records to return at once. Limited to 100. - @param "skip" (int32) The offset into the records to return. - @param "sort" ([]string) The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. - @param "xOrgId" (string) - @return []ActiveDirectoryAgentListOutput*/ -func (a *ActiveDirectoryApiService) ActivedirectoriesAgentsList(ctx context.Context, activedirectoryId string, contentType string, accept string, localVarOptionals map[string]interface{}) ([]ActiveDirectoryAgentListOutput, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload []ActiveDirectoryAgentListOutput - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/activedirectories/{activedirectory_id}/agents" - localVarPath = strings.Replace(localVarPath, "{"+"activedirectory_id"+"}", fmt.Sprintf("%v", activedirectoryId), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["limit"], "int32", "limit"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["skip"], "int32", "skip"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return successPayload, nil, err - } - - if localVarTempParam, localVarOk := localVarOptionals["limit"].(int32); localVarOk { - localVarQueryParams.Add("limit", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["skip"].(int32); localVarOk { - localVarQueryParams.Add("skip", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["sort"].([]string); localVarOk { - localVarQueryParams.Add("sort", parameterToString(localVarTempParam, "csv")) - } - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* ActiveDirectoryApiService Create a new Active Directory Agent - This endpoint allows you to create a new Active Directory Agent. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/activedirectories/{activedirectory_id}/agents \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{}' ``` - * @param ctx context.Context for authentication, logging, tracing, etc. - @param activedirectoryId - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "body" (ActiveDirectoryAgentInput) - @param "xOrgId" (string) - @return ActiveDirectoryAgentGetOutput*/ -func (a *ActiveDirectoryApiService) ActivedirectoriesAgentsPost(ctx context.Context, activedirectoryId string, contentType string, accept string, localVarOptionals map[string]interface{}) (ActiveDirectoryAgentGetOutput, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Post") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload ActiveDirectoryAgentGetOutput - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/activedirectories/{activedirectory_id}/agents" - localVarPath = strings.Replace(localVarPath, "{"+"activedirectory_id"+"}", fmt.Sprintf("%v", activedirectoryId), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return successPayload, nil, err - } - - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - // body params - if localVarTempParam, localVarOk := localVarOptionals["body"].(ActiveDirectoryAgentInput); localVarOk { - localVarPostBody = &localVarTempParam - } - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* ActiveDirectoryApiService Delete an Active Directory - This endpoint allows you to delete an Active Directory Instance. #### Sample Request ``` curl -X DELETE https://console.jumpcloud.com/api/v2/activedirectories/{ActiveDirectory_ID} \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY' ``` - * @param ctx context.Context for authentication, logging, tracing, etc. - @param id ObjectID of this Active Directory instance. - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "xOrgId" (string) - @return */ -func (a *ActiveDirectoryApiService) ActivedirectoriesDelete(ctx context.Context, id string, contentType string, accept string, localVarOptionals map[string]interface{}) ( *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Delete") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/activedirectories/{id}" - localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return nil, err - } - - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - return localVarHttpResponse, err -} - -/* ActiveDirectoryApiService Get an Active Directory - This endpoint returns a specific Active Directory. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/activedirectories/{ActiveDirectory_ID} \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - * @param ctx context.Context for authentication, logging, tracing, etc. - @param id ObjectID of this Active Directory instance. - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "xOrgId" (string) - @return ActiveDirectoryOutput*/ -func (a *ActiveDirectoryApiService) ActivedirectoriesGet(ctx context.Context, id string, contentType string, accept string, localVarOptionals map[string]interface{}) (ActiveDirectoryOutput, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload ActiveDirectoryOutput - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/activedirectories/{id}" - localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return successPayload, nil, err - } - - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* ActiveDirectoryApiService List Active Directories - This endpoint allows you to list all your Active Directory Instances. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/activedirectories/ \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - * @param ctx context.Context for authentication, logging, tracing, etc. - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "fields" ([]string) The comma separated fields included in the returned records. If omitted, the default list of fields will be returned. - @param "filter" ([]string) Supported operators are: eq, ne, gt, ge, lt, le, between, search, in - @param "limit" (int32) The number of records to return at once. Limited to 100. - @param "skip" (int32) The offset into the records to return. - @param "sort" ([]string) The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. - @param "xOrgId" (string) - @return []ActiveDirectoryOutput*/ -func (a *ActiveDirectoryApiService) ActivedirectoriesList(ctx context.Context, contentType string, accept string, localVarOptionals map[string]interface{}) ([]ActiveDirectoryOutput, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload []ActiveDirectoryOutput - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/activedirectories" - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["limit"], "int32", "limit"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["skip"], "int32", "skip"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return successPayload, nil, err - } - - if localVarTempParam, localVarOk := localVarOptionals["fields"].([]string); localVarOk { - localVarQueryParams.Add("fields", parameterToString(localVarTempParam, "csv")) - } - if localVarTempParam, localVarOk := localVarOptionals["filter"].([]string); localVarOk { - localVarQueryParams.Add("filter", parameterToString(localVarTempParam, "csv")) - } - if localVarTempParam, localVarOk := localVarOptionals["limit"].(int32); localVarOk { - localVarQueryParams.Add("limit", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["skip"].(int32); localVarOk { - localVarQueryParams.Add("skip", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["sort"].([]string); localVarOk { - localVarQueryParams.Add("sort", parameterToString(localVarTempParam, "csv")) - } - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* ActiveDirectoryApiService Create a new Active Directory - This endpoint allows you to create a new Active Directory. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/activedirectories/ \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"domain\": \"{DC=AD_domain_name;DC=com}\" } ' ``` - * @param ctx context.Context for authentication, logging, tracing, etc. - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "body" (ActiveDirectoryInput) - @param "xOrgId" (string) - @return ActiveDirectoryOutput*/ -func (a *ActiveDirectoryApiService) ActivedirectoriesPost(ctx context.Context, contentType string, accept string, localVarOptionals map[string]interface{}) (ActiveDirectoryOutput, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Post") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload ActiveDirectoryOutput - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/activedirectories" - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return successPayload, nil, err - } - - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - // body params - if localVarTempParam, localVarOk := localVarOptionals["body"].(ActiveDirectoryInput); localVarOk { - localVarPostBody = &localVarTempParam - } - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* ActiveDirectoryApiService List the associations of an Active Directory instance - This endpoint returns the direct associations of this Active Directory instance. A direct association can be a non-homogeneous relationship between 2 different objects, for example Active Directory and Users. #### Sample Request ``` curl -X GET 'https://console.jumpcloud.com/api/v2/activedirectories/{ActiveDirectory_ID}/associations?targets=user \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - * @param ctx context.Context for authentication, logging, tracing, etc. - @param activedirectoryId - @param targets - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "limit" (int32) The number of records to return at once. Limited to 100. - @param "skip" (int32) The offset into the records to return. - @param "xOrgId" (string) - @return []GraphConnection*/ -func (a *ActiveDirectoryApiService) GraphActiveDirectoryAssociationsList(ctx context.Context, activedirectoryId string, targets []string, contentType string, accept string, localVarOptionals map[string]interface{}) ([]GraphConnection, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload []GraphConnection - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/activedirectories/{activedirectory_id}/associations" - localVarPath = strings.Replace(localVarPath, "{"+"activedirectory_id"+"}", fmt.Sprintf("%v", activedirectoryId), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["limit"], "int32", "limit"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["skip"], "int32", "skip"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return successPayload, nil, err - } - - localVarQueryParams.Add("targets", parameterToString(targets, "csv")) - if localVarTempParam, localVarOk := localVarOptionals["limit"].(int32); localVarOk { - localVarQueryParams.Add("limit", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["skip"].(int32); localVarOk { - localVarQueryParams.Add("skip", parameterToString(localVarTempParam, "")) - } - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* ActiveDirectoryApiService Manage the associations of an Active Directory instance - This endpoint allows you to manage the _direct_ associations of an Active Directory instance. A direct association can be a non-homogeneous relationship between 2 different objects, for example Active Directory and Users. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/activedirectories/{AD_Instance_ID}/associations \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"op\": \"add\", \"type\": \"user\", \"id\": \"{User_ID}\" } ' ``` - * @param ctx context.Context for authentication, logging, tracing, etc. - @param activedirectoryId - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "body" (GraphManagementReq) - @param "xOrgId" (string) - @return */ -func (a *ActiveDirectoryApiService) GraphActiveDirectoryAssociationsPost(ctx context.Context, activedirectoryId string, contentType string, accept string, localVarOptionals map[string]interface{}) ( *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Post") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/activedirectories/{activedirectory_id}/associations" - localVarPath = strings.Replace(localVarPath, "{"+"activedirectory_id"+"}", fmt.Sprintf("%v", activedirectoryId), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return nil, err - } - - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - // body params - if localVarTempParam, localVarOk := localVarOptionals["body"].(GraphManagementReq); localVarOk { - localVarPostBody = &localVarTempParam - } - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - return localVarHttpResponse, err -} - -/* ActiveDirectoryApiService List the User Groups bound to an Active Directory instance - This endpoint will return all Users Groups bound to an Active Directory instance, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the group's type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this Active Directory instance to the corresponding User Group; this array represents all grouping and/or associations that would have to be removed to deprovision the User Group from this Active Directory instance. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/activedirectories/{ActiveDirectory_ID}/usergroups \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - * @param ctx context.Context for authentication, logging, tracing, etc. - @param activedirectoryId ObjectID of the Active Directory instance. - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "limit" (int32) The number of records to return at once. Limited to 100. - @param "xOrgId" (string) - @param "skip" (int32) The offset into the records to return. - @param "filter" ([]string) Supported operators are: eq, ne, gt, ge, lt, le, between, search, in - @return []GraphObjectWithPaths*/ -func (a *ActiveDirectoryApiService) GraphActiveDirectoryTraverseUserGroup(ctx context.Context, activedirectoryId string, contentType string, accept string, localVarOptionals map[string]interface{}) ([]GraphObjectWithPaths, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload []GraphObjectWithPaths - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/activedirectories/{activedirectory_id}/usergroups" - localVarPath = strings.Replace(localVarPath, "{"+"activedirectory_id"+"}", fmt.Sprintf("%v", activedirectoryId), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["limit"], "int32", "limit"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["skip"], "int32", "skip"); err != nil { - return successPayload, nil, err - } - - if localVarTempParam, localVarOk := localVarOptionals["limit"].(int32); localVarOk { - localVarQueryParams.Add("limit", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["skip"].(int32); localVarOk { - localVarQueryParams.Add("skip", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["filter"].([]string); localVarOk { - localVarQueryParams.Add("filter", parameterToString(localVarTempParam, "csv")) - } - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - diff --git a/v2/active_directory_input.go b/v2/active_directory_input.go deleted file mode 100644 index 8f79a86..0000000 --- a/v2/active_directory_input.go +++ /dev/null @@ -1,16 +0,0 @@ -/* - * JumpCloud APIs - * - * JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. - * - * API version: 2.0 - * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) - */ - -package v2 - -type ActiveDirectoryInput struct { - - // Domain name for this Active Directory instance. - Domain string `json:"domain,omitempty"` -} diff --git a/v2/active_directory_output.go b/v2/active_directory_output.go deleted file mode 100644 index 5aed5de..0000000 --- a/v2/active_directory_output.go +++ /dev/null @@ -1,19 +0,0 @@ -/* - * JumpCloud APIs - * - * JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. - * - * API version: 2.0 - * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) - */ - -package v2 - -type ActiveDirectoryOutput struct { - - // Domain name for this Active Directory instance. - Domain string `json:"domain,omitempty"` - - // ObjectID of this Active Directory instance. - Id string `json:"id"` -} diff --git a/v2/administrator.go b/v2/administrator.go deleted file mode 100644 index 97b0486..0000000 --- a/v2/administrator.go +++ /dev/null @@ -1,25 +0,0 @@ -/* - * JumpCloud APIs - * - * JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. - * - * API version: 2.0 - * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) - */ - -package v2 - -type Administrator struct { - - Email string `json:"email,omitempty"` - - EnableMultiFactor bool `json:"enableMultiFactor,omitempty"` - - Firstname string `json:"firstname,omitempty"` - - Id string `json:"id,omitempty"` - - Lastname string `json:"lastname,omitempty"` - - Registered bool `json:"registered,omitempty"` -} diff --git a/v2/api/swagger.yaml b/v2/api/swagger.yaml deleted file mode 100644 index 53d8d0e..0000000 --- a/v2/api/swagger.yaml +++ /dev/null @@ -1,20965 +0,0 @@ ---- -swagger: "2.0" -info: - description: " JumpCloud's V2 API. This set of endpoints allows JumpCloud customers\ - \ to manage objects, groupings and mappings and interact with the JumpCloud Graph." - version: "2.0" - title: "JumpCloud APIs" -host: "console.jumpcloud.com" -basePath: "/api/v2" -schemes: -- "https" -consumes: -- "application/json" -produces: -- "application/json" -paths: - /activedirectories: - get: - tags: - - "Active Directory" - summary: "List Active Directories" - description: "This endpoint allows you to list all your Active Directory Instances.\n\ - \n#### Sample Request\n```\ncurl -X GET https://console.jumpcloud.com/api/v2/activedirectories/\ - \ \\\n -H 'accept: application/json' \\\n -H 'content-type: application/json'\ - \ \\\n -H 'x-api-key: {API_KEY}'\n ```" - operationId: "activedirectories_list" - parameters: - - name: "fields" - in: "query" - description: "The comma separated fields included in the returned records.\n\ - If omitted, the default list of fields will be returned.\n" - required: false - type: "array" - items: - type: "string" - x-exportParamName: "Fields" - - name: "filter" - in: "query" - description: "Supported operators are: eq, ne, gt, ge, lt, le, between, search,\ - \ in" - required: false - type: "array" - items: - type: "string" - x-exportParamName: "Filter" - - name: "limit" - in: "query" - description: "The number of records to return at once. Limited to 100." - required: false - type: "integer" - default: 10 - x-exportParamName: "Limit" - - name: "Content-Type" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "ContentType" - - name: "Accept" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "Accept" - - name: "skip" - in: "query" - description: "The offset into the records to return." - required: false - type: "integer" - default: 0 - minimum: 0 - x-exportParamName: "Skip" - - name: "sort" - in: "query" - description: "The comma separated fields used to sort the collection.\nDefault\ - \ sort is ascending, prefix with `-` to sort descending.\n" - required: false - type: "array" - items: - type: "string" - x-exportParamName: "Sort" - - name: "x-org-id" - in: "header" - description: "" - required: false - type: "string" - x-exportParamName: "XOrgId" - responses: - 200: - description: "" - schema: - type: "array" - items: - $ref: "#/definitions/active-directory-output" - security: - - x-api-key: [] - x-stoplight: - afterScript: null - beforeScript: null - id: "activedirectories_list" - mock: - dynamic: false - enabled: false - statusCode: 200 - public: true - post: - tags: - - "Active Directory" - summary: "Create a new Active Directory" - description: "This endpoint allows you to create a new Active Directory.\n\n\ - \n#### Sample Request\n```\ncurl -X POST https://console.jumpcloud.com/api/v2/activedirectories/\ - \ \\\n -H 'accept: application/json' \\\n -H 'content-type: application/json'\ - \ \\\n -H 'x-api-key: {API_KEY}' \\\n -d '{\n \"domain\": \"{DC=AD_domain_name;DC=com}\"\ - \n}\n'\n```" - operationId: "activedirectories_post" - parameters: - - in: "body" - name: "body" - required: false - schema: - $ref: "#/definitions/active-directory-input" - x-exportParamName: "Body" - - name: "Content-Type" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "ContentType" - - name: "Accept" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "Accept" - - name: "x-org-id" - in: "header" - description: "" - required: false - type: "string" - x-exportParamName: "XOrgId" - responses: - 201: - description: "" - schema: - $ref: "#/definitions/active-directory-output" - security: - - x-api-key: [] - x-stoplight: - afterScript: null - beforeScript: null - id: "activedirectories_post" - mock: - dynamic: false - enabled: false - statusCode: 200 - public: false - /activedirectories/{activedirectory_id}/agents: - get: - tags: - - "Active Directory" - summary: "List Active Directory Agents" - description: "This endpoint allows you to list all your Active Directory Agents\ - \ for a given Instance.\n\n#### Sample Request\n```\ncurl -X GET https://console.jumpcloud.com/api/v2/activedirectories/{activedirectory_id}/agents\ - \ \\\n -H 'accept: application/json' \\\n -H 'content-type: application/json'\ - \ \\\n -H 'x-api-key: {API_KEY}'\n ```" - operationId: "activedirectories_agentsList" - parameters: - - name: "activedirectory_id" - in: "path" - required: true - type: "string" - x-exportParamName: "ActivedirectoryId" - - name: "limit" - in: "query" - description: "The number of records to return at once. Limited to 100." - required: false - type: "integer" - default: 10 - x-exportParamName: "Limit" - - name: "Content-Type" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "ContentType" - - name: "Accept" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "Accept" - - name: "skip" - in: "query" - description: "The offset into the records to return." - required: false - type: "integer" - default: 0 - minimum: 0 - x-exportParamName: "Skip" - - name: "sort" - in: "query" - description: "The comma separated fields used to sort the collection.\nDefault\ - \ sort is ascending, prefix with `-` to sort descending.\n" - required: false - type: "array" - items: - type: "string" - x-exportParamName: "Sort" - - name: "x-org-id" - in: "header" - description: "" - required: false - type: "string" - x-exportParamName: "XOrgId" - responses: - 200: - description: "" - schema: - type: "array" - items: - $ref: "#/definitions/active-directory-agent-list-output" - security: - - x-api-key: [] - x-stoplight: - afterScript: null - beforeScript: null - id: "activedirectories_agentsList" - mock: - dynamic: false - enabled: false - statusCode: 200 - public: false - post: - tags: - - "Active Directory" - summary: "Create a new Active Directory Agent" - description: "This endpoint allows you to create a new Active Directory Agent.\n\ - \n\n#### Sample Request\n```\ncurl -X POST https://console.jumpcloud.com/api/v2/activedirectories/{activedirectory_id}/agents\ - \ \\\n -H 'accept: application/json' \\\n -H 'content-type: application/json'\ - \ \\\n -H 'x-api-key: {API_KEY}' \\\n -d '{}'\n```" - operationId: "activedirectories_agentsPost" - parameters: - - name: "activedirectory_id" - in: "path" - required: true - type: "string" - x-exportParamName: "ActivedirectoryId" - - in: "body" - name: "body" - required: false - schema: - $ref: "#/definitions/active-directory-agent-input" - x-exportParamName: "Body" - - name: "x-org-id" - in: "header" - description: "" - required: false - type: "string" - x-exportParamName: "XOrgId" - - name: "Content-Type" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "ContentType" - - name: "Accept" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "Accept" - responses: - 201: - description: "" - schema: - $ref: "#/definitions/active-directory-agent-get-output" - security: - - x-api-key: [] - x-stoplight: - afterScript: null - beforeScript: null - id: "activedirectories_agentsPost" - mock: - dynamic: false - enabled: false - statusCode: 200 - public: false - /activedirectories/{activedirectory_id}/agents/{agent_id}: - get: - tags: - - "Active Directory" - summary: "Get Active Directory Agent" - description: "This endpoint returns a specific active directory agent.\n\n####\ - \ Sample Request\n```\ncurl -X GET https://console.jumpcloud.com/api/v2/activedirectories/{activedirectory_id}/agents/{agent_id}\ - \ \\\n -H 'accept: application/json' \\\n -H 'content-type: application/json'\ - \ \\\n -H 'x-api-key: {API_KEY}'\n ```" - operationId: "activedirectories_agentsGet" - parameters: - - name: "activedirectory_id" - in: "path" - required: true - type: "string" - x-exportParamName: "ActivedirectoryId" - - name: "agent_id" - in: "path" - required: true - type: "string" - x-exportParamName: "AgentId" - - name: "x-org-id" - in: "header" - description: "" - required: false - type: "string" - x-exportParamName: "XOrgId" - - name: "Content-Type" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "ContentType" - - name: "Accept" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "Accept" - responses: - 200: - description: "" - schema: - $ref: "#/definitions/active-directory-agent-list-output" - x-stoplight: - afterScript: null - beforeScript: null - id: "activedirectories_agentsGet" - mock: - dynamic: false - enabled: false - statusCode: 200 - public: false - delete: - tags: - - "Active Directory" - summary: "Delete Active Directory Agent" - operationId: "activedirectories_agentsDelete" - parameters: - - name: "activedirectory_id" - in: "path" - required: true - type: "string" - x-exportParamName: "ActivedirectoryId" - - name: "agent_id" - in: "path" - required: true - type: "string" - x-exportParamName: "AgentId" - - name: "x-org-id" - in: "header" - description: "" - required: false - type: "string" - x-exportParamName: "XOrgId" - - name: "Content-Type" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "ContentType" - - name: "Accept" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "Accept" - responses: - 204: - description: "" - x-stoplight: - afterScript: null - beforeScript: null - id: "activedirectories_agentsDelete" - mock: - dynamic: false - enabled: false - statusCode: 200 - public: false - /activedirectories/{activedirectory_id}/associations: - get: - tags: - - "Graph" - - "Active Directory" - summary: "List the associations of an Active Directory instance" - description: "This endpoint returns the direct associations of this Active Directory\ - \ instance.\n\nA direct association can be a non-homogeneous relationship\ - \ between 2 different objects, for example Active Directory and Users.\n\n\ - \n#### Sample Request\n```\ncurl -X GET 'https://console.jumpcloud.com/api/v2/activedirectories/{ActiveDirectory_ID}/associations?targets=user\ - \ \\\n -H 'accept: application/json' \\\n -H 'content-type: application/json'\ - \ \\\n -H 'x-api-key: {API_KEY}'\n```" - operationId: "graph_activeDirectoryAssociationsList" - parameters: - - name: "activedirectory_id" - in: "path" - required: true - type: "string" - x-exportParamName: "ActivedirectoryId" - - name: "targets" - in: "query" - description: "" - required: true - type: "array" - items: - type: "string" - enum: - - "active_directory" - - "application" - - "command" - - "g_suite" - - "ldap_server" - - "office_365" - - "policy" - - "radius_server" - - "system" - - "system_group" - - "user" - - "user_group" - x-exportParamName: "Targets" - - name: "limit" - in: "query" - description: "The number of records to return at once. Limited to 100." - required: false - type: "integer" - default: 10 - x-exportParamName: "Limit" - - name: "Content-Type" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "ContentType" - - name: "Accept" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "Accept" - - name: "skip" - in: "query" - description: "The offset into the records to return." - required: false - type: "integer" - default: 0 - minimum: 0 - x-exportParamName: "Skip" - - name: "x-org-id" - in: "header" - description: "" - required: false - type: "string" - x-exportParamName: "XOrgId" - responses: - 200: - description: "" - schema: - type: "array" - items: - $ref: "#/definitions/GraphConnection" - security: - - x-api-key: [] - x-stoplight: - afterScript: null - beforeScript: null - id: "graph_activeDirectoryAssociationsList" - mock: - dynamic: false - enabled: false - statusCode: 200 - public: true - post: - tags: - - "Graph" - - "Active Directory" - summary: "Manage the associations of an Active Directory instance" - description: "This endpoint allows you to manage the _direct_ associations of\ - \ an Active Directory instance.\n\nA direct association can be a non-homogeneous\ - \ relationship between 2 different objects, for example Active Directory and\ - \ Users.\n\n#### Sample Request\n```\ncurl -X POST https://console.jumpcloud.com/api/v2/activedirectories/{AD_Instance_ID}/associations\ - \ \\\n -H 'accept: application/json' \\\n -H 'content-type: application/json'\ - \ \\\n -H 'x-api-key: {API_KEY}' \\\n -d '{\n \"op\": \"add\",\n\ - \ \"type\": \"user\",\n \"id\": \"{User_ID}\"\n}\n'\n```" - operationId: "graph_activeDirectoryAssociationsPost" - parameters: - - name: "activedirectory_id" - in: "path" - required: true - type: "string" - x-exportParamName: "ActivedirectoryId" - - in: "body" - name: "body" - required: false - schema: - $ref: "#/definitions/GraphManagementReq" - x-exportParamName: "Body" - - name: "Content-Type" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "ContentType" - - name: "Accept" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "Accept" - - name: "x-org-id" - in: "header" - description: "" - required: false - type: "string" - x-exportParamName: "XOrgId" - responses: - 204: - description: "" - security: - - x-api-key: [] - x-stoplight: - afterScript: null - beforeScript: null - id: "graph_activeDirectoryAssociationsPost" - mock: - dynamic: false - enabled: false - statusCode: 200 - public: false - /activedirectories/{activedirectory_id}/usergroups: - get: - tags: - - "Graph" - - "Active Directory" - summary: "List the User Groups bound to an Active Directory instance" - description: "This endpoint will return all Users Groups bound to an Active\ - \ Directory instance, either directly or indirectly, essentially traversing\ - \ the JumpCloud Graph for your Organization.\n\nEach element will contain\ - \ the group's type, id, attributes and paths.\n\nThe `attributes` object is\ - \ a key/value hash of compiled graph attributes for all paths followed.\n\n\ - The `paths` array enumerates each path from this Active Directory instance\ - \ to the corresponding User Group; this array represents all grouping and/or\ - \ associations that would have to be removed to deprovision the User Group\ - \ from this Active Directory instance.\n\nSee `/members` and `/associations`\ - \ endpoints to manage those collections.\n\n#### Sample Request\n```\ncurl\ - \ -X GET https://console.jumpcloud.com/api/v2/activedirectories/{ActiveDirectory_ID}/usergroups\ - \ \\\n -H 'accept: application/json' \\\n -H 'content-type: application/json'\ - \ \\\n -H 'x-api-key: {API_KEY}'\n```" - operationId: "graph_activeDirectoryTraverseUserGroup" - parameters: - - name: "activedirectory_id" - in: "path" - description: "ObjectID of the Active Directory instance." - required: true - type: "string" - x-exportParamName: "ActivedirectoryId" - - name: "limit" - in: "query" - description: "The number of records to return at once. Limited to 100." - required: false - type: "integer" - default: 10 - x-exportParamName: "Limit" - - name: "x-org-id" - in: "header" - description: "" - required: false - type: "string" - x-exportParamName: "XOrgId" - - name: "Content-Type" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "ContentType" - - name: "Accept" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "Accept" - - name: "skip" - in: "query" - description: "The offset into the records to return." - required: false - type: "integer" - default: 0 - minimum: 0 - x-exportParamName: "Skip" - - name: "filter" - in: "query" - description: "Supported operators are: eq, ne, gt, ge, lt, le, between, search,\ - \ in" - required: false - type: "array" - items: - type: "string" - x-exportParamName: "Filter" - responses: - 200: - description: "" - schema: - type: "array" - items: - $ref: "#/definitions/GraphObjectWithPaths" - security: - - x-api-key: [] - x-stoplight: - afterScript: null - beforeScript: null - id: "graph_activeDirectoryTraverseUserGroup" - mock: - dynamic: false - enabled: false - statusCode: 200 - public: true - /activedirectories/{activedirectory_id}/users: - get: - tags: - - "Graph" - summary: "List the Users bound to an Active Directory instance" - description: "This endpoint will return all Users bound to an Active Directory\ - \ instance, either directly or indirectly, essentially traversing the JumpCloud\ - \ Graph for your Organization.\n\nEach element will contain the type, id,\ - \ attributes and paths.\n\nThe `attributes` object is a key/value hash of\ - \ compiled graph attributes for all paths followed.\n\nThe `paths` array enumerates\ - \ each path from this Active Directory instance to the corresponding User;\ - \ this array represents all grouping and/or associations that would have to\ - \ be removed to deprovision the User from this Active Directory instance.\n\ - \nSee `/members` and `/associations` endpoints to manage those collections.\n\ - \n#### Sample Request\n```\ncurl -X GET https://console.jumpcloud.com/api/v2/activedirectories/{ActiveDirectory_ID}/users\ - \ \\\n -H 'accept: application/json' \\\n -H 'content-type: application/json'\ - \ \\\n -H 'x-api-key: {API_KEY}'\n```" - operationId: "graph_activeDirectoryTraverseUser" - parameters: - - name: "activedirectory_id" - in: "path" - description: "ObjectID of the Active Directory instance." - required: true - type: "string" - x-exportParamName: "ActivedirectoryId" - - name: "filter" - in: "query" - description: "Supported operators are: eq, ne, gt, ge, lt, le, between, search,\ - \ in" - required: false - type: "array" - items: - type: "string" - x-exportParamName: "Filter" - - name: "limit" - in: "query" - description: "The number of records to return at once. Limited to 100." - required: false - type: "integer" - default: 10 - x-exportParamName: "Limit" - - name: "x-org-id" - in: "header" - description: "" - required: false - type: "string" - x-exportParamName: "XOrgId" - - name: "Content-Type" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "ContentType" - - name: "Accept" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "Accept" - - name: "skip" - in: "query" - description: "The offset into the records to return." - required: false - type: "integer" - default: 0 - minimum: 0 - x-exportParamName: "Skip" - responses: - 200: - description: "" - schema: - type: "array" - items: - $ref: "#/definitions/GraphObjectWithPaths" - security: - - x-api-key: [] - x-stoplight: - afterScript: null - beforeScript: null - id: "graph_activeDirectoryTraverseUser" - mock: - dynamic: false - enabled: false - statusCode: 200 - public: false - /activedirectories/{id}: - get: - tags: - - "Active Directory" - summary: "Get an Active Directory" - description: "This endpoint returns a specific Active Directory.\n\n#### Sample\ - \ Request\n\n```\ncurl -X GET https://console.jumpcloud.com/api/v2/activedirectories/{ActiveDirectory_ID}\ - \ \\\n -H 'accept: application/json' \\\n -H 'content-type: application/json'\ - \ \\\n -H 'x-api-key: {API_KEY}'\n ```" - operationId: "activedirectories_get" - parameters: - - name: "id" - in: "path" - description: "ObjectID of this Active Directory instance." - required: true - type: "string" - x-exportParamName: "Id" - - name: "Content-Type" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "ContentType" - - name: "Accept" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "Accept" - - name: "x-org-id" - in: "header" - description: "" - required: false - type: "string" - x-exportParamName: "XOrgId" - responses: - 200: - description: "" - schema: - $ref: "#/definitions/active-directory-output" - security: - - x-api-key: [] - x-stoplight: - afterScript: null - beforeScript: null - id: "activedirectories_get" - mock: - dynamic: false - enabled: false - statusCode: 200 - public: true - delete: - tags: - - "Active Directory" - summary: "Delete an Active Directory" - description: "This endpoint allows you to delete an Active Directory Instance.\n\ - \n#### Sample Request\n```\ncurl -X DELETE https://console.jumpcloud.com/api/v2/activedirectories/{ActiveDirectory_ID}\ - \ \\\n -H 'accept: application/json' \\\n -H 'content-type: application/json'\ - \ \\\n -H 'x-api-key: {API_KEY'\n ```" - operationId: "activedirectories_delete" - parameters: - - name: "id" - in: "path" - description: "ObjectID of this Active Directory instance." - required: true - type: "string" - x-exportParamName: "Id" - - name: "Content-Type" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "ContentType" - - name: "Accept" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "Accept" - - name: "x-org-id" - in: "header" - description: "" - required: false - type: "string" - x-exportParamName: "XOrgId" - responses: - 204: - description: "" - security: - - x-api-key: [] - x-stoplight: - afterScript: null - beforeScript: null - id: "activedirectories_delete" - mock: - dynamic: false - enabled: false - statusCode: 200 - public: false - /applemdms: - get: - tags: - - "Apple MDM" - summary: "List Apple MDMs" - description: "Get a list of all Apple MDM configurations. An empty topic indicates\ - \ that a signed certificate from Apple has not been provided to the PUT endpoint\ - \ yet.\n\nNote: currently only one MDM configuration per organization is supported.\n\ - \n#### Sample Request\n```\ncurl https://console.jumpcloud.com/api/v2/applemdms\ - \ \\\n -H 'accept: application/json' \\\n -H 'content-type: application/json'\ - \ \\\n -H 'x-api-key: {API_KEY}'\n```" - operationId: "applemdms_list" - parameters: - - name: "x-org-id" - in: "header" - description: "" - required: false - type: "string" - x-exportParamName: "XOrgId" - - name: "Content-Type" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "ContentType" - - name: "Accept" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "Accept" - responses: - 200: - description: "" - schema: - type: "array" - items: - $ref: "#/definitions/AppleMDM" - security: - - x-api-key: [] - x-stoplight: - afterScript: null - beforeScript: null - id: "applemdms_list" - mock: - dynamic: false - enabled: false - statusCode: 200 - public: false - post: - tags: - - "Apple MDM" - summary: "Create Apple MDM" - description: "Creates an Apple MDM Enrollment for an organization. Only one\ - \ enrollment per organization will be allowed. Note that this is the first\ - \ step in completly setting up an MDM Enrollment. The user must supply the\ - \ returned plist to Apple for signing, and then provide the certificate provided\ - \ by Apple back into the PUT API.\n\n#### Sample Request\n```\n curl -X POST\ - \ https://console.jumpcloud.com/api/v2/organizations/{Organization_ID}/mdm\ - \ \\\n -H 'accept: application/json' \\\n -H 'content-type: application/json'\ - \ \\\n -H 'x-api-key: {API_KEY}' \\\n -d '{}'\n```" - operationId: "applemdms_post" - parameters: - - in: "body" - name: "body" - required: false - schema: - $ref: "#/definitions/body" - x-exportParamName: "Body" - - name: "Content-Type" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "ContentType" - - name: "Accept" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "Accept" - - name: "x-org-id" - in: "header" - description: "" - required: false - type: "string" - x-exportParamName: "XOrgId" - responses: - 201: - description: "" - schema: - $ref: "#/definitions/inline_response_201" - 400: - description: "" - schema: - $ref: "#/definitions/errorresponse" - 401: - description: "" - schema: - $ref: "#/definitions/errorresponse" - 403: - description: "" - schema: - $ref: "#/definitions/errorresponse" - 404: - description: "" - schema: - $ref: "#/definitions/errorresponse" - 409: - description: "" - schema: - $ref: "#/definitions/errorresponse" - 500: - description: "" - schema: - $ref: "#/definitions/errorresponse" - security: - - x-api-key: [] - x-stoplight: - afterScript: null - beforeScript: null - id: "applemdms_post" - mock: - dynamic: false - enabled: false - statusCode: 200 - public: false - /applemdms/{apple_mdm_id}: - put: - tags: - - "Apple MDM" - summary: "Update an Apple MDM" - description: "Updates an Apple MDM configuration. This endpoint is used to\ - \ supply JumpCloud with a signed certificate from Apple in order to finalize\ - \ the setup and allow JumpCloud to manage your devices.\n\n#### Sample Request\n\ - ```\n curl -X PUT https://console.jumpcloud.com/api/v2/applemdms/{ID} \\\n\ - \ -H 'accept: application/json' \\\n -H 'content-type: application/json'\ - \ \\\n -H 'x-api-key: {API_KEY}' \\\n -d '{\n \"name\": \"MDM name\"\ - ,\n \"appleSignedCert\": \"{CERTIFICATE}\"\n }'\n```" - operationId: "applemdms_put" - parameters: - - name: "apple_mdm_id" - in: "path" - required: true - type: "string" - x-exportParamName: "AppleMdmId" - - in: "body" - name: "body" - required: false - schema: - $ref: "#/definitions/apple-mdm-patch-input" - x-exportParamName: "Body" - - name: "x-org-id" - in: "header" - description: "" - required: false - type: "string" - x-exportParamName: "XOrgId" - - name: "Content-Type" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "ContentType" - - name: "Accept" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "Accept" - responses: - 200: - description: "" - schema: - $ref: "#/definitions/AppleMDM" - 400: - description: "" - schema: - $ref: "#/definitions/errorresponse" - 401: - description: "" - schema: - $ref: "#/definitions/errorresponse" - 403: - description: "" - schema: - $ref: "#/definitions/errorresponse" - 404: - description: "" - schema: - $ref: "#/definitions/errorresponse" - 409: - description: "" - schema: - $ref: "#/definitions/errorresponse" - 500: - description: "" - schema: - $ref: "#/definitions/errorresponse" - security: - - x-api-key: [] - x-stoplight: - afterScript: null - beforeScript: null - id: "applemdms_put" - mock: - dynamic: false - enabled: false - statusCode: 200 - public: false - delete: - tags: - - "Apple MDM" - summary: "Delete an Apple MDM" - description: "Removes an Apple MDM configuration.\n\nWarning: This is a destructive\ - \ operation and will remove your Apple Push Certificates. We will no longer\ - \ be able to manage your devices and the only recovery option is to re-register\ - \ all devices into MDM.\n\n#### Sample Request\n```\ncurl -X DELETE https://console.jumpcloud.com/api/v2/applemdms/{id}\ - \ \\\n -H 'accept: application/json' \\\n -H 'content-type: application/json'\ - \ \\\n -H 'x-api-key: {API_KEY}'\n```" - operationId: "applemdms_delete" - parameters: - - name: "apple_mdm_id" - in: "path" - required: true - type: "string" - x-exportParamName: "AppleMdmId" - - name: "x-org-id" - in: "header" - description: "" - required: false - type: "string" - x-exportParamName: "XOrgId" - - name: "Content-Type" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "ContentType" - - name: "Accept" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "Accept" - responses: - 200: - description: "" - schema: - $ref: "#/definitions/AppleMDM" - 400: - description: "" - schema: - $ref: "#/definitions/errorresponse" - 401: - description: "" - schema: - $ref: "#/definitions/errorresponse" - 403: - description: "" - schema: - $ref: "#/definitions/errorresponse" - 404: - description: "" - schema: - $ref: "#/definitions/errorresponse" - 409: - description: "" - schema: - $ref: "#/definitions/errorresponse" - 500: - description: "" - schema: - $ref: "#/definitions/errorresponse" - security: - - x-api-key: [] - x-stoplight: - afterScript: null - beforeScript: null - id: "applemdms_delete" - mock: - dynamic: false - enabled: false - statusCode: 200 - public: false - /applemdms/{apple_mdm_id}/enrollmentprofiles: - get: - tags: - - "Apple MDM" - summary: "List Apple MDM Enrollment Profiles" - description: "Get a list of enrollment profiles for an apple mdm.\n\nNote: currently\ - \ only one enrollment profile is supported.\n\n#### Sample Request\n```\n\ - curl https://console.jumpcloud.com/api/v2/applemdms/{APPLE_MDM_ID}/enrollmentprofiles\ - \ \\\n -H 'accept: application/json' \\\n -H 'content-type: application/json'\ - \ \\\n -H 'x-api-key: {API_KEY}'\n```" - operationId: "enrollmentprofiles_list" - parameters: - - name: "apple_mdm_id" - in: "path" - required: true - type: "string" - x-exportParamName: "AppleMdmId" - - name: "x-org-id" - in: "header" - description: "" - required: false - type: "string" - x-exportParamName: "XOrgId" - - name: "Content-Type" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "ContentType" - - name: "Accept" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "Accept" - responses: - 200: - description: "" - schema: - type: "array" - items: - $ref: "#/definitions/AppleMDM" - security: - - x-api-key: [] - x-stoplight: - afterScript: null - beforeScript: null - id: "enrollmentprofiles_list" - mock: - dynamic: false - enabled: false - statusCode: 200 - public: false - /applemdms/{apple_mdm_id}/enrollmentprofiles/{enrollment_profile_id}: - get: - tags: - - "Apple MDM" - summary: "Get an Apple MDM Enrollment Profile" - description: "Get an enrollment profile\n\nCurrently only requesting the mobileconfig\ - \ is supported.\n\n#### Sample Request\n\n```\ncurl https://console.jumpcloud.com/api/v2/applemdms/{APPLE_MDM_ID}/enrollmentprofiles/{ENROLLMENT_PROFILE_ID}\ - \ \\\n -H 'accept: application/x-apple-aspen-config' \\\n -H 'content-type:\ - \ application/json' \\\n -H 'x-api-key: {API_KEY}'\n```" - operationId: "enrollmentprofiles_get" - produces: - - "application/x-apple-aspen-config" - parameters: - - name: "apple_mdm_id" - in: "path" - required: true - type: "string" - x-exportParamName: "AppleMdmId" - - name: "enrollment_profile_id" - in: "path" - required: true - type: "string" - x-exportParamName: "EnrollmentProfileId" - - name: "x-org-id" - in: "header" - description: "" - required: false - type: "string" - x-exportParamName: "XOrgId" - - name: "Content-Type" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "ContentType" - - name: "Accept" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "Accept" - responses: - 200: - description: "" - schema: - $ref: "#/definitions/mobileconfig" - security: - - x-api-key: [] - x-stoplight: - afterScript: null - beforeScript: null - id: "enrollmentprofiles_get" - mock: - dynamic: false - enabled: false - statusCode: 200 - public: false - /applications/{application_id}/associations: - get: - tags: - - "Graph" - - "Applications" - summary: "List the associations of an Application" - description: "This endpoint will return the _direct_ associations of an Application.\ - \ A direct association can be a non-homogeneous relationship between 2 different\ - \ objects, for example Applications and User Groups.\n\n\n#### Sample Request\n\ - ```\ncurl -X GET 'https://console.jumpcloud.com/api/v2/applications/{Application_ID}/associations?targets=user_group\ - \ \\\n -H 'accept: application/json' \\\n -H 'content-type: application/json'\ - \ \\\n -H 'x-api-key: {API_KEY}'\n```" - operationId: "graph_applicationAssociationsList" - parameters: - - name: "application_id" - in: "path" - description: "ObjectID of the Application." - required: true - type: "string" - x-exportParamName: "ApplicationId" - - name: "targets" - in: "query" - description: "" - required: true - type: "array" - items: - type: "string" - enum: - - "active_directory" - - "application" - - "command" - - "g_suite" - - "ldap_server" - - "office_365" - - "policy" - - "radius_server" - - "system" - - "system_group" - - "user" - - "user_group" - x-exportParamName: "Targets" - - name: "limit" - in: "query" - description: "The number of records to return at once. Limited to 100." - required: false - type: "integer" - default: 10 - x-exportParamName: "Limit" - - name: "Content-Type" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "ContentType" - - name: "Accept" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "Accept" - - name: "skip" - in: "query" - description: "The offset into the records to return." - required: false - type: "integer" - default: 0 - minimum: 0 - x-exportParamName: "Skip" - - name: "x-org-id" - in: "header" - description: "" - required: false - type: "string" - x-exportParamName: "XOrgId" - responses: - 200: - description: "OK" - schema: - type: "array" - items: - $ref: "#/definitions/GraphConnection" - security: - - x-api-key: [] - x-stoplight: - afterScript: null - beforeScript: null - id: "graph_applicationAssociationsList" - mock: - dynamic: false - enabled: false - statusCode: 200 - public: true - post: - tags: - - "Graph" - - "Applications" - summary: "Manage the associations of an Application" - description: "This endpoint allows you to manage the _direct_ associations of\ - \ an Application. A direct association can be a non-homogeneous relationship\ - \ between 2 different objects, for example Application and User Groups.\n\n\ - #### Sample Request\n```\ncurl -X POST 'https://console.jumpcloud.com/api/v2/applications/{Application_ID}/associations'\ - \ \\\n -H 'accept: application/json' \\\n -H 'content-type: application/json'\ - \ \\\n -H 'x-api-key: {API_KEY}' \\\n -d '{\n \"op\": \"add\",\n \"\ - type\": \"user_group\",\n \"id\": \"{Group_ID}\"\n}'\n```" - operationId: "graph_applicationAssociationsPost" - parameters: - - name: "application_id" - in: "path" - description: "ObjectID of the Application." - required: true - type: "string" - x-exportParamName: "ApplicationId" - - in: "body" - name: "body" - required: false - schema: - $ref: "#/definitions/GraphManagementReq" - x-exportParamName: "Body" - - name: "Content-Type" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "ContentType" - - name: "Accept" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "Accept" - - name: "x-org-id" - in: "header" - description: "" - required: false - type: "string" - x-exportParamName: "XOrgId" - responses: - 204: - description: "OK" - security: - - x-api-key: [] - x-stoplight: - afterScript: "null" - beforeScript: "function (ctx, request) {\n // Your javascript code here.\n\ - }" - id: "graph_applicationAssociationsPost" - mock: - dynamic: false - enabled: false - statusCode: 200 - public: true - x-swagger-jumpcloud-auto-insert: true - /applications/{application_id}/usergroups: - get: - tags: - - "Graph" - - "Applications" - summary: "List the User Groups bound to an Application" - description: "This endpoint will return all Users Groups bound to an Application,\ - \ either directly or indirectly, essentially traversing the JumpCloud Graph\ - \ for your Organization.\n\nEach element will contain the group's type, id,\ - \ attributes and paths.\n\nThe `attributes` object is a key/value hash of\ - \ compiled graph attributes for all paths followed.\n\nThe `paths` array enumerates\ - \ each path from this Application to the corresponding User Group; this array\ - \ represents all grouping and/or associations that would have to be removed\ - \ to deprovision the User Group from this Application.\n\nSee `/members` and\ - \ `/associations` endpoints to manage those collections.\n\n#### Sample Request\n\ - ```\ncurl -X GET https://console.jumpcloud.com/api/v2/applications/{Application_ID}/usergroups\ - \ \\\n -H 'accept: application/json' \\\n -H 'content-type: application/json'\ - \ \\\n -H 'x-api-key: {API_KEY}'\n```" - operationId: "graph_applicationTraverseUserGroup" - parameters: - - name: "application_id" - in: "path" - description: "ObjectID of the Application." - required: true - type: "string" - x-exportParamName: "ApplicationId" - - name: "limit" - in: "query" - description: "The number of records to return at once. Limited to 100." - required: false - type: "integer" - default: 10 - x-exportParamName: "Limit" - - name: "x-org-id" - in: "header" - description: "" - required: false - type: "string" - x-exportParamName: "XOrgId" - - name: "Content-Type" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "ContentType" - - name: "Accept" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "Accept" - - name: "skip" - in: "query" - description: "The offset into the records to return." - required: false - type: "integer" - default: 0 - minimum: 0 - x-exportParamName: "Skip" - - name: "filter" - in: "query" - description: "Supported operators are: eq, ne, gt, ge, lt, le, between, search,\ - \ in" - required: false - type: "array" - items: - type: "string" - x-exportParamName: "Filter" - responses: - 200: - description: "OK" - schema: - type: "array" - items: - $ref: "#/definitions/GraphObjectWithPaths" - security: - - x-api-key: [] - x-stoplight: - afterScript: null - beforeScript: null - id: "graph_applicationTraverseUserGroup" - mock: - dynamic: false - enabled: false - statusCode: 200 - public: true - /applications/{application_id}/users: - get: - tags: - - "Graph" - - "Applications" - summary: "List the Users bound to an Application" - description: "This endpoint will return all Users bound to an Application, either\ - \ directly or indirectly, essentially traversing the JumpCloud Graph for your\ - \ Organization.\n\nEach element will contain the type, id, attributes and\ - \ paths.\n\nThe `attributes` object is a key/value hash of compiled graph\ - \ attributes for all paths followed.\n\nThe `paths` array enumerates each\ - \ path from this Application to the corresponding User; this array represents\ - \ all grouping and/or associations that would have to be removed to deprovision\ - \ the User from this Application.\n\nSee `/members` and `/associations` endpoints\ - \ to manage those collections.\n\n#### Sample Request\n```\ncurl -X GET https://console.jumpcloud.com/api/v2/applications/{Application_ID}/users\ - \ \\\n -H 'accept: application/json' \\\n -H 'content-type: application/json'\ - \ \\\n -H 'x-api-key: {API_KEY}'\n```" - operationId: "graph_applicationTraverseUser" - parameters: - - name: "application_id" - in: "path" - description: "ObjectID of the Application." - required: true - type: "string" - x-exportParamName: "ApplicationId" - - name: "limit" - in: "query" - description: "The number of records to return at once. Limited to 100." - required: false - type: "integer" - default: 10 - x-exportParamName: "Limit" - - name: "x-org-id" - in: "header" - description: "" - required: false - type: "string" - x-exportParamName: "XOrgId" - - name: "Content-Type" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "ContentType" - - name: "Accept" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "Accept" - - name: "skip" - in: "query" - description: "The offset into the records to return." - required: false - type: "integer" - default: 0 - minimum: 0 - x-exportParamName: "Skip" - - name: "filter" - in: "query" - description: "Supported operators are: eq, ne, gt, ge, lt, le, between, search,\ - \ in" - required: false - type: "array" - items: - type: "string" - x-exportParamName: "Filter" - responses: - 200: - description: "OK" - schema: - type: "array" - items: - $ref: "#/definitions/GraphObjectWithPaths" - security: - - x-api-key: [] - x-stoplight: - afterScript: null - beforeScript: null - id: "graph_applicationTraverseUser" - mock: - dynamic: false - enabled: false - statusCode: 200 - public: true - /bulk/users: - post: - tags: - - "Bulk Job Requests" - summary: "Bulk Users Create" - description: "The endpoint allows you to create a bulk job to asynchronously\ - \ create users. See [Create a System User](https://docs.jumpcloud.com/1.0/systemusers/create-a-system-user)\ - \ for full list of attributes.\n\n#### Sample Request \n```\ncurl -X POST\ - \ https://console.jumpcloud.com/api/v2/bulk/users \\\n -H 'Accept: application/json'\ - \ \\\n -H 'Content-Type: application/json' \\\n -H 'x-api-key: {API_KEY}'\ - \ \\\n -d '[\n\t{\n\t\t\"email\":\"{email}\",\n\t\t\"firstname\":\"{firstname}\"\ - ,\n\t\t\"lastname\":\"{firstname}\",\n\t\t\"username\":\"{username}\",\n\t\ - \t\"attributes\":[\n\t\t\t{\"name\":\"EmployeeID\",\"value\":\"0000\"},\n\t\ - \t\t{\"name\":\"Custom\",\"value\":\"attribute\"}\n\t\t]\n\t}\n]\n```" - operationId: "bulk_usersCreate" - parameters: - - in: "body" - name: "body" - required: false - schema: - type: "array" - items: - $ref: "#/definitions/bulk-user-create" - x-exportParamName: "Body" - - name: "Content-Type" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "ContentType" - - name: "Accept" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "Accept" - - name: "x-org-id" - in: "header" - description: "" - required: false - type: "string" - x-exportParamName: "XOrgId" - responses: - 201: - description: "" - schema: - $ref: "#/definitions/job-id" - security: - - x-api-key: [] - x-stoplight: - afterScript: null - beforeScript: null - id: "bulk_usersCreate" - mock: - dynamic: false - enabled: false - statusCode: 200 - public: true - patch: - tags: - - "Bulk Job Requests" - summary: "Bulk Users Update" - description: "The endpoint allows you to create a bulk job to asynchronously\ - \ update users. See [Update a System User](https://docs.jumpcloud.com/1.0/systemusers/update-a-system-user)\ - \ for full list of attributes.\n\n#### Sample Request \n```\ncurl -X PATCH\ - \ https://console.jumpcloud.com/api/v2/bulk/users \\\n -H 'Accept: application/json'\ - \ \\\n -H 'Content-Type: application/json' \\\n -H 'x-api-key: {API_KEY}'\ - \ \\\n -d '[\n\t{\n\t \"id\":\"5be9fb4ddb01290001e85109\",\n\t\t\"firstname\"\ - :\"{UPDATED_FIRSTNAME}\",\n\t\t\"department\":\"{UPDATED_DEPARTMENT}\",\n\t\ - \t\"attributes\":[\n\t\t\t{\"name\":\"Custom\",\"value\":\"{ATTRIBUTE_VALUE}\"\ - }\n\t\t]\n\t},\n\t{\n\t \"id\":\"5be9fb4ddb01290001e85109\",\n\t\t\"firstname\"\ - :\"{UPDATED_FIRSTNAME}\",\n\t\t\"costCenter\":\"{UPDATED_COST_CENTER}\",\n\ - \t\t\"phoneNumbers\":[\n\t\t\t{\"type\":\"home\",\"number\":\"{HOME_PHONE_NUMBER}\"\ - },\n\t\t\t{\"type\":\"work\",\"number\":\"{WORK_PHONE_NUMBER}\"}\n\t\t]\n\t\ - }\n]\n```" - operationId: "bulk_usersUpdate" - parameters: - - in: "body" - name: "body" - required: false - schema: - type: "array" - items: - $ref: "#/definitions/bulk-user-update" - x-exportParamName: "Body" - - name: "x-org-id" - in: "header" - description: "" - required: false - type: "string" - x-exportParamName: "XOrgId" - - name: "Content-Type" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "ContentType" - - name: "Accept" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "Accept" - responses: - 201: - description: "" - schema: - $ref: "#/definitions/job-id" - security: - - x-api-key: [] - x-stoplight: - afterScript: null - beforeScript: null - id: "bulk_usersUpdate" - mock: - dynamic: false - enabled: false - statusCode: 200 - public: true - /bulk/users/{job_id}/results: - get: - tags: - - "Bulk Job Requests" - summary: "List Bulk Users Results" - description: "This endpoint will return the results of particular user import\ - \ or update job request.\n\n#### Sample Request\n```\ncurl -X GET \\\n https://console.jumpcloud.com/api/v2/bulk/users/{ImportJobID}/results\ - \ \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\ - \ \\\n -H 'x-api-key: {API_KEY}'\n ```" - operationId: "bulk_usersCreateResults" - parameters: - - name: "job_id" - in: "path" - required: true - type: "string" - x-exportParamName: "JobId" - - name: "limit" - in: "query" - description: "The number of records to return at once. Limited to 100." - required: false - type: "integer" - default: 10 - x-exportParamName: "Limit" - - name: "skip" - in: "query" - description: "The offset into the records to return." - required: false - type: "integer" - default: 0 - minimum: 0 - x-exportParamName: "Skip" - - name: "Content-Type" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "ContentType" - - name: "Accept" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "Accept" - - name: "x-org-id" - in: "header" - description: "" - required: false - type: "string" - x-exportParamName: "XOrgId" - responses: - 200: - description: "" - schema: - type: "array" - items: - $ref: "#/definitions/job-workresult" - security: - - x-api-key: [] - x-stoplight: - afterScript: null - beforeScript: null - id: "bulk_usersCreateResults" - mock: - dynamic: false - enabled: false - statusCode: 200 - public: true - /commands/{command_id}/associations: - get: - tags: - - "Graph" - - "Commands" - summary: "List the associations of a Command" - description: "This endpoint will return the _direct_ associations of this Command.\n\ - \nA direct association can be a non-homogeneous relationship between 2 different\ - \ objects, for example Commands and User Groups.\n\n\n#### Sample Request\n\ - ```\ncurl -X GET https://console.jumpcloud.com/api/v2/commands/{Command_ID}/associations?targets=system_group\ - \ \\\n -H 'accept: application/json' \\\n -H 'content-type: application/json'\ - \ \\\n -H 'x-api-key: {API_KEY}'\n```" - operationId: "graph_commandAssociationsList" - parameters: - - name: "command_id" - in: "path" - description: "ObjectID of the Command." - required: true - type: "string" - x-exportParamName: "CommandId" - - name: "targets" - in: "query" - description: "" - required: true - type: "array" - items: - type: "string" - enum: - - "active_directory" - - "application" - - "command" - - "g_suite" - - "ldap_server" - - "office_365" - - "policy" - - "radius_server" - - "system" - - "system_group" - - "user" - - "user_group" - x-exportParamName: "Targets" - - name: "limit" - in: "query" - description: "The number of records to return at once. Limited to 100." - required: false - type: "integer" - default: 10 - x-exportParamName: "Limit" - - name: "Content-Type" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "ContentType" - - name: "Accept" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "Accept" - - name: "skip" - in: "query" - description: "The offset into the records to return." - required: false - type: "integer" - default: 0 - minimum: 0 - x-exportParamName: "Skip" - - name: "x-org-id" - in: "header" - description: "" - required: false - type: "string" - x-exportParamName: "XOrgId" - responses: - 200: - description: "OK" - schema: - type: "array" - items: - $ref: "#/definitions/GraphConnection" - security: - - x-api-key: [] - x-stoplight: - afterScript: null - beforeScript: null - id: "graph_commandAssociationsList" - mock: - dynamic: false - enabled: false - statusCode: 200 - public: true - post: - tags: - - "Graph" - - "Commands" - summary: "Manage the associations of a Command" - description: "This endpoint will allow you to manage the _direct_ associations\ - \ of this Command.\n\nA direct association can be a non-homogeneous relationship\ - \ between 2 different objects, for example Commands and User Groups.\n\n\n\ - #### Sample Request\n```\n curl -X POST https://console.jumpcloud.com/api/v2/commands/{Command_ID}/associations\ - \ \\\n -H 'accept: application/json' \\\n -H 'content-type: application/json'\ - \ \\\n -H 'x-api-key: {API_KEY}' \\\n -d '{\n \"op\": \"add\",\n \"\ - type\": \"system_group\",\n \"id\": \"Group_ID\"\n}'\n```" - operationId: "graph_commandAssociationsPost" - parameters: - - name: "command_id" - in: "path" - description: "ObjectID of the Command." - required: true - type: "string" - x-exportParamName: "CommandId" - - in: "body" - name: "body" - required: false - schema: - $ref: "#/definitions/GraphManagementReq" - x-exportParamName: "Body" - - name: "Content-Type" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "ContentType" - - name: "Accept" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "Accept" - - name: "x-org-id" - in: "header" - description: "" - required: false - type: "string" - x-exportParamName: "XOrgId" - responses: - 204: - description: "OK" - security: - - x-api-key: [] - x-stoplight: - afterScript: null - beforeScript: null - id: "graph_commandAssociationsPost" - mock: - dynamic: false - enabled: false - statusCode: 200 - public: true - x-swagger-jumpcloud-auto-insert: true - /commands/{command_id}/systemgroups: - get: - tags: - - "Graph" - - "Commands" - summary: "List the System Groups bound to a Command" - description: "This endpoint will return all System Groups bound to a Command,\ - \ either directly or indirectly, essentially traversing the JumpCloud Graph\ - \ for your Organization.\n\nEach element will contain the group's type, id,\ - \ attributes and paths.\n\nThe `attributes` object is a key/value hash of\ - \ compiled graph attributes for all paths followed.\n\nThe `paths` array enumerates\ - \ each path from this Command to the corresponding System Group; this array\ - \ represents all grouping and/or associations that would have to be removed\ - \ to deprovision the System Group from this Command.\n\nSee `/members` and\ - \ `/associations` endpoints to manage those collections.\n\n#### Sample Request\n\ - ```\ncurl -X GET https://console.jumpcloud.com/api/v2/commands/{Command_ID}/systemgroups\ - \ \\\n -H 'accept: application/json' \\\n -H 'content-type: application/json'\ - \ \\\n -H 'x-api-key: {API_KEY}'\n```" - operationId: "graph_commandTraverseSystemGroup" - parameters: - - name: "command_id" - in: "path" - description: "ObjectID of the Command." - required: true - type: "string" - x-exportParamName: "CommandId" - - name: "limit" - in: "query" - description: "The number of records to return at once. Limited to 100." - required: false - type: "integer" - default: 10 - x-exportParamName: "Limit" - - name: "x-org-id" - in: "header" - description: "" - required: false - type: "string" - x-exportParamName: "XOrgId" - - name: "Content-Type" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "ContentType" - - name: "Accept" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "Accept" - - name: "skip" - in: "query" - description: "The offset into the records to return." - required: false - type: "integer" - default: 0 - minimum: 0 - x-exportParamName: "Skip" - - name: "filter" - in: "query" - description: "Supported operators are: eq, ne, gt, ge, lt, le, between, search,\ - \ in" - required: false - type: "array" - items: - type: "string" - x-exportParamName: "Filter" - responses: - 200: - description: "OK" - schema: - type: "array" - items: - $ref: "#/definitions/GraphObjectWithPaths" - security: - - x-api-key: [] - x-stoplight: - afterScript: null - beforeScript: null - id: "graph_commandTraverseSystemGroup" - mock: - dynamic: false - enabled: false - statusCode: 200 - public: true - /commands/{command_id}/systems: - get: - tags: - - "Graph" - - "Commands" - summary: "List the Systems bound to a Command" - description: "This endpoint will return all Systems bound to a Command, either\ - \ directly or indirectly, essentially traversing the JumpCloud Graph for your\ - \ Organization.\n\nEach element will contain the type, id, attributes and\ - \ paths.\n\nThe `attributes` object is a key/value hash of compiled graph\ - \ attributes for all paths followed.\n\nThe `paths` array enumerates each\ - \ path from this Command to the corresponding System; this array represents\ - \ all grouping and/or associations that would have to be removed to deprovision\ - \ the System from this Command.\n\nSee `/members` and `/associations` endpoints\ - \ to manage those collections.\n\n#### Sample Request\n```\ncurl -X GET https://console.jumpcloud.com/api/v2/commands/{Command_ID}/systems\ - \ \\\n -H 'accept: application/json' \\\n -H 'content-type: application/json'\ - \ \\\n -H 'x-api-key: {API_KEY}'\n```" - operationId: "graph_commandTraverseSystem" - parameters: - - name: "command_id" - in: "path" - description: "ObjectID of the Command." - required: true - type: "string" - x-exportParamName: "CommandId" - - name: "limit" - in: "query" - description: "The number of records to return at once. Limited to 100." - required: false - type: "integer" - default: 10 - x-exportParamName: "Limit" - - name: "x-org-id" - in: "header" - description: "" - required: false - type: "string" - x-exportParamName: "XOrgId" - - name: "Content-Type" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "ContentType" - - name: "Accept" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "Accept" - - name: "skip" - in: "query" - description: "The offset into the records to return." - required: false - type: "integer" - default: 0 - minimum: 0 - x-exportParamName: "Skip" - - name: "filter" - in: "query" - description: "Supported operators are: eq, ne, gt, ge, lt, le, between, search,\ - \ in" - required: false - type: "array" - items: - type: "string" - x-exportParamName: "Filter" - responses: - 200: - description: "OK" - schema: - type: "array" - items: - $ref: "#/definitions/GraphObjectWithPaths" - security: - - x-api-key: [] - x-stoplight: - afterScript: null - beforeScript: null - id: "graph_commandTraverseSystem" - mock: - dynamic: false - enabled: false - statusCode: 200 - public: true - /directories: - get: - tags: - - "Directories" - summary: "List All Directories" - description: "This endpoint returns all active directories (LDAP, O365 Suite,\ - \ G-Suite).\n\n#### Sample Request\n```\n curl -X GET https://console.jumpcloud.com/api/v2/directories\ - \ \\\n -H 'accept: application/json' \\\n -H 'content-type: application/json'\ - \ \\\n -H 'x-api-key: {API_KEY}'\n```" - operationId: "directories_list" - parameters: - - name: "fields" - in: "query" - description: "The comma separated fields included in the returned records.\n\ - If omitted, the default list of fields will be returned.\n" - required: false - type: "array" - items: - type: "string" - x-exportParamName: "Fields" - - name: "limit" - in: "query" - description: "The number of records to return at once. Limited to 100." - required: false - type: "integer" - default: 10 - x-exportParamName: "Limit" - - name: "Content-Type" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "ContentType" - - name: "Accept" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "Accept" - - name: "sort" - in: "query" - description: "The comma separated fields used to sort the collection.\nDefault\ - \ sort is ascending, prefix with `-` to sort descending.\n" - required: false - type: "array" - items: - type: "string" - x-exportParamName: "Sort" - - name: "skip" - in: "query" - description: "The offset into the records to return." - required: false - type: "integer" - default: 0 - minimum: 0 - x-exportParamName: "Skip" - - name: "x-org-id" - in: "header" - description: "" - required: false - type: "string" - x-exportParamName: "XOrgId" - responses: - 200: - description: "OK" - schema: - type: "array" - items: - $ref: "#/definitions/Directory" - default: - description: "Unexpected error" - schema: - $ref: "#/definitions/Error" - security: - - x-api-key: [] - x-stoplight: - afterScript: null - beforeScript: null - id: "directories_list" - mock: - dynamic: false - enabled: false - statusCode: 200 - public: true - /duo/accounts: - get: - tags: - - "Duo" - summary: "List Duo Acounts" - description: "This endpoint returns all the Duo accounts for your organization.\ - \ Note: There can currently only be one Duo account for your organization.\n\ - \n#### Sample Request\n```\ncurl https://console.jumpcloud.com/api/v2/duo/accounts\ - \ \\\n -H 'accept: application/json' \\\n -H 'content-type: application/json'\ - \ \\\n -H 'x-api-key: {API_KEY}'\n```" - operationId: "duo_accountList" - parameters: - - name: "x-org-id" - in: "header" - description: "" - required: false - type: "string" - x-exportParamName: "XOrgId" - - name: "Content-Type" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "ContentType" - - name: "Accept" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "Accept" - responses: - 200: - description: "" - schema: - type: "array" - items: - $ref: "#/definitions/DuoAccount" - security: - - x-api-key: [] - x-stoplight: - afterScript: null - beforeScript: null - id: "duo_accountList" - mock: - dynamic: false - enabled: false - statusCode: 200 - public: false - post: - tags: - - "Duo" - summary: "Create Duo Account" - description: "Registers a Duo account for an organization. Only one Duo account\ - \ will be allowed,\nin case an organization has a Duo account already a 409\ - \ (Conflict) code will be returned.\n\n#### Sample Request\n```\n curl -X\ - \ POST https://console.jumpcloud.com/api/v2/duo/accounts \\\n -H 'accept:\ - \ application/json' \\\n -H 'content-type: application/json' \\\n -H 'x-api-key:\ - \ {API_KEY}' \\\n -d '{}'\n```" - operationId: "duo_accountPost" - parameters: - - name: "Content-Type" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "ContentType" - - name: "Accept" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "Accept" - - name: "x-org-id" - in: "header" - description: "" - required: false - type: "string" - x-exportParamName: "XOrgId" - responses: - 201: - description: "" - schema: - $ref: "#/definitions/DuoAccount" - 400: - description: "" - schema: - $ref: "#/definitions/errorresponse" - 401: - description: "" - schema: - $ref: "#/definitions/errorresponse" - 403: - description: "" - schema: - $ref: "#/definitions/errorresponse" - 404: - description: "" - schema: - $ref: "#/definitions/errorresponse" - 409: - description: "" - schema: - $ref: "#/definitions/errorresponse" - 500: - description: "" - schema: - $ref: "#/definitions/errorresponse" - security: - - x-api-key: [] - x-stoplight: - afterScript: null - beforeScript: null - id: "duo_accountPost" - mock: - dynamic: false - enabled: false - statusCode: 200 - public: false - /duo/accounts/{account_id}/applications: - get: - tags: - - "Duo" - summary: "List Duo Applications" - description: "This endpoint returns all the Duo applications for the specified\ - \ Duo account. Note: There can currently only be one Duo application for your\ - \ organization.\n\n#### Sample Request\n```\n curl https://console.jumpcloud.com/api/v2/duo/accounts/{ACCOUNT_ID}/applications\ - \ \\\n -H 'accept: application/json' \\\n -H 'content-type: application/json'\ - \ \\\n -H 'x-api-key: {API_KEY}'\n```" - operationId: "duo_applicationList" - parameters: - - name: "account_id" - in: "path" - required: true - type: "string" - x-exportParamName: "AccountId" - - name: "x-org-id" - in: "header" - description: "" - required: false - type: "string" - x-exportParamName: "XOrgId" - - name: "Content-Type" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "ContentType" - - name: "Accept" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "Accept" - responses: - 200: - description: "" - schema: - type: "array" - items: - $ref: "#/definitions/DuoApplication" - 400: - description: "" - schema: - $ref: "#/definitions/errorresponse" - 401: - description: "" - schema: - $ref: "#/definitions/errorresponse" - 403: - description: "" - schema: - $ref: "#/definitions/errorresponse" - 404: - description: "" - schema: - $ref: "#/definitions/errorresponse" - 409: - description: "" - schema: - $ref: "#/definitions/errorresponse" - 500: - description: "" - schema: - $ref: "#/definitions/errorresponse" - security: - - x-api-key: [] - x-stoplight: - afterScript: null - beforeScript: null - id: "duo_applicationList" - mock: - dynamic: false - enabled: false - statusCode: 200 - public: false - post: - tags: - - "Duo" - summary: "Create Duo Application" - description: "Creates a Duo application for your organization and the specified\ - \ account.\n\n#### Sample Request\n```\n curl -X POST https://console.jumpcloud.com/api/v2/duo/accounts/{ACCOUNT_ID}/applications\ - \ \\\n -H 'accept: application/json' \\\n -H 'content-type: application/json'\ - \ \\\n -H 'x-api-key: {API_KEY}' \\\n -d '{\n \"name\": \"Application\ - \ Name\",\n \"apiHost\": \"api-1234.duosecurity.com\",\n \"integrationKey\"\ - : \"1234\",\n \"secretKey\": \"5678\"\n }'\n```" - operationId: "duo_applicationPost" - parameters: - - name: "account_id" - in: "path" - required: true - type: "string" - x-exportParamName: "AccountId" - - in: "body" - name: "body" - required: false - schema: - $ref: "#/definitions/DuoApplicationReq" - x-exportParamName: "Body" - - name: "x-org-id" - in: "header" - description: "" - required: false - type: "string" - x-exportParamName: "XOrgId" - - name: "Content-Type" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "ContentType" - - name: "Accept" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "Accept" - responses: - 201: - description: "" - schema: - $ref: "#/definitions/DuoApplication" - 400: - description: "" - schema: - $ref: "#/definitions/errorresponse" - 401: - description: "" - schema: - $ref: "#/definitions/errorresponse" - 403: - description: "" - schema: - $ref: "#/definitions/errorresponse" - 404: - description: "" - schema: - $ref: "#/definitions/errorresponse" - 409: - description: "" - schema: - $ref: "#/definitions/errorresponse" - 500: - description: "" - schema: - $ref: "#/definitions/errorresponse" - security: - - x-api-key: [] - x-stoplight: - afterScript: null - beforeScript: null - id: "duo_applicationPost" - mock: - dynamic: false - enabled: false - statusCode: 200 - public: false - /duo/accounts/{account_id}/applications/{application_id}: - get: - tags: - - "Duo" - summary: "Get a Duo application" - description: "This endpoint returns a specific Duo application that is associated\ - \ with the specified Duo account.\n\n#### Sample Request\n```\n curl https://console.jumpcloud.com/api/v2/duo/accounts/{ACCOUNT_ID}/applications/{APPLICATION_ID}\ - \ \\\n -H 'accept: application/json' \\\n -H 'content-type: application/json'\ - \ \\\n -H 'x-api-key: {API_KEY}'\n```" - operationId: "duo_applicationGet" - parameters: - - name: "account_id" - in: "path" - required: true - type: "string" - x-exportParamName: "AccountId" - - name: "application_id" - in: "path" - required: true - type: "string" - x-exportParamName: "ApplicationId" - - name: "x-org-id" - in: "header" - description: "" - required: false - type: "string" - x-exportParamName: "XOrgId" - - name: "Content-Type" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "ContentType" - - name: "Accept" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "Accept" - responses: - 200: - description: "" - schema: - $ref: "#/definitions/DuoApplication" - 400: - description: "" - schema: - $ref: "#/definitions/errorresponse" - 401: - description: "" - schema: - $ref: "#/definitions/errorresponse" - 403: - description: "" - schema: - $ref: "#/definitions/errorresponse" - 404: - description: "" - schema: - $ref: "#/definitions/errorresponse" - 409: - description: "" - schema: - $ref: "#/definitions/errorresponse" - 500: - description: "" - schema: - $ref: "#/definitions/errorresponse" - security: - - x-api-key: [] - x-stoplight: - afterScript: null - beforeScript: null - id: "duo_applicationGet" - mock: - dynamic: false - enabled: false - statusCode: 200 - public: false - put: - tags: - - "Duo" - summary: "Update Duo Application" - description: "Updates the specified Duo application.\n\n#### Sample Request\n\ - ```\n curl -X PUT https://console.jumpcloud.com/api/v2/duo/accounts/{ACCOUNT_ID}/applications/{APPLICATION_ID}\ - \ \\\n -H 'accept: application/json' \\\n -H 'content-type: application/json'\ - \ \\\n -H 'x-api-key: {API_KEY}' \\\n -d '{\n \"name\": \"Application\ - \ Name\",\n \"apiHost\": \"api-1234.duosecurity.com\",\n \"integrationKey\"\ - : \"1234\",\n \"secretKey\": \"5678\"\n }'\n```" - operationId: "duo_applicationUpdate" - parameters: - - name: "account_id" - in: "path" - required: true - type: "string" - x-exportParamName: "AccountId" - - name: "application_id" - in: "path" - required: true - type: "string" - x-exportParamName: "ApplicationId" - - in: "body" - name: "body" - required: false - schema: - $ref: "#/definitions/DuoApplicationUpdateReq" - x-exportParamName: "Body" - - name: "x-org-id" - in: "header" - description: "" - required: false - type: "string" - x-exportParamName: "XOrgId" - - name: "Content-Type" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "ContentType" - - name: "Accept" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "Accept" - responses: - 200: - description: "" - schema: - $ref: "#/definitions/DuoApplication" - 400: - description: "" - schema: - $ref: "#/definitions/errorresponse" - 401: - description: "" - schema: - $ref: "#/definitions/errorresponse" - 403: - description: "" - schema: - $ref: "#/definitions/errorresponse" - 404: - description: "" - schema: - $ref: "#/definitions/errorresponse" - 409: - description: "" - schema: - $ref: "#/definitions/errorresponse" - 500: - description: "" - schema: - $ref: "#/definitions/errorresponse" - security: - - x-api-key: [] - x-stoplight: - afterScript: null - beforeScript: null - id: "duo_applicationUpdate" - mock: - dynamic: false - enabled: false - statusCode: 200 - public: false - delete: - tags: - - "Duo" - summary: "Delete a Duo Application" - description: "Deletes the specified Duo application, an error will be returned\ - \ if the application is used in a protected resource.\n\n#### Sample Request\n\ - ```\n curl -X DELETE https://console.jumpcloud.com/api/v2/duo/accounts/{ACCOUNT_ID}/applications/{APPLICATION_ID}\ - \ \\\n -H 'accept: application/json' \\\n -H 'content-type: application/json'\ - \ \\\n -H 'x-api-key: {API_KEY}''\n```" - operationId: "duo_applicationDelete" - parameters: - - name: "account_id" - in: "path" - required: true - type: "string" - x-exportParamName: "AccountId" - - name: "application_id" - in: "path" - required: true - type: "string" - x-exportParamName: "ApplicationId" - - name: "x-org-id" - in: "header" - description: "" - required: false - type: "string" - x-exportParamName: "XOrgId" - - name: "Content-Type" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "ContentType" - - name: "Accept" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "Accept" - responses: - 200: - description: "" - schema: - $ref: "#/definitions/DuoApplication" - 400: - description: "" - schema: - $ref: "#/definitions/errorresponse" - 401: - description: "" - schema: - $ref: "#/definitions/errorresponse" - 403: - description: "" - schema: - $ref: "#/definitions/errorresponse" - 404: - description: "" - schema: - $ref: "#/definitions/errorresponse" - 409: - description: "" - schema: - $ref: "#/definitions/errorresponse" - 500: - description: "" - schema: - $ref: "#/definitions/errorresponse" - security: - - x-api-key: [] - x-stoplight: - afterScript: null - beforeScript: null - id: "duo_applicationDelete" - mock: - dynamic: false - enabled: false - statusCode: 200 - public: false - /duo/accounts/{id}: - get: - tags: - - "Duo" - summary: "Get a Duo Acount" - description: "This endpoint returns a specific Duo account.\n\n#### Sample Request\n\ - ```\ncurl https://console.jumpcloud.com/api/v2/duo/accounts/{id} \\\n -H\ - \ 'accept: application/json' \\\n -H 'content-type: application/json' \\\n\ - \ -H 'x-api-key: {API_KEY}'\n```" - operationId: "duo_accountGet" - parameters: - - name: "id" - in: "path" - description: "ObjectID of the Duo Account" - required: true - type: "string" - x-exportParamName: "Id" - - name: "x-org-id" - in: "header" - description: "" - required: false - type: "string" - x-exportParamName: "XOrgId" - - name: "Content-Type" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "ContentType" - - name: "Accept" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "Accept" - responses: - 200: - description: "" - schema: - $ref: "#/definitions/DuoAccount" - security: - - x-api-key: [] - x-stoplight: - afterScript: null - beforeScript: null - id: "duo_accountGet" - mock: - dynamic: false - enabled: false - statusCode: 200 - public: false - delete: - tags: - - "Duo" - summary: "Delete a Duo Account" - description: "Removes the specified Duo account, an error will be returned if\ - \ the account has some Duo application used in a protected resource.\n\n####\ - \ Sample Request\n```\ncurl -X DELETE https://console.jumpcloud.com/api/v2/duo/accounts/{id}\ - \ \\\n -H 'accept: application/json' \\\n -H 'content-type: application/json'\ - \ \\\n -H 'x-api-key: {API_KEY}'\n```" - operationId: "duo_accountDelete" - parameters: - - name: "id" - in: "path" - description: "ObjectID of the Duo Account" - required: true - type: "string" - x-exportParamName: "Id" - - name: "x-org-id" - in: "header" - description: "" - required: false - type: "string" - x-exportParamName: "XOrgId" - - name: "Content-Type" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "ContentType" - - name: "Accept" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "Accept" - responses: - 200: - description: "" - schema: - $ref: "#/definitions/DuoAccount" - 400: - description: "" - schema: - $ref: "#/definitions/errorresponse" - 401: - description: "" - schema: - $ref: "#/definitions/errorresponse" - 403: - description: "" - schema: - $ref: "#/definitions/errorresponse" - 404: - description: "" - schema: - $ref: "#/definitions/errorresponse" - 409: - description: "" - schema: - $ref: "#/definitions/errorresponse" - 500: - description: "" - schema: - $ref: "#/definitions/errorresponse" - security: - - x-api-key: [] - x-stoplight: - afterScript: null - beforeScript: null - id: "duo_accountDelete" - mock: - dynamic: false - enabled: false - statusCode: 200 - public: false - /enrollmentprofiles: - get: - summary: "List Enrollment Profiles" - operationId: "jcEnrollmentProfiles_list" - parameters: - - name: "limit" - in: "query" - required: false - type: "integer" - default: 10 - maximum: 100 - minimum: 0 - x-exportParamName: "Limit" - - name: "skip" - in: "query" - description: "The offset into the records to return." - required: false - type: "integer" - default: 0 - minimum: 0 - x-exportParamName: "Skip" - responses: - 200: - description: "" - schema: - type: "array" - items: - $ref: "#/definitions/jc-enrollment-profile" - security: - - x-api-key: [] - x-stoplight: - afterScript: null - beforeScript: null - id: "jcEnrollmentProfiles_list" - mock: - dynamic: false - enabled: false - statusCode: 200 - public: false - post: - summary: "Create new Enrollment Profile" - operationId: "jcEnrollmentProfiles_post" - parameters: - - in: "body" - name: "body" - required: false - schema: - $ref: "#/definitions/body_1" - x-exportParamName: "Body" - responses: - 200: - description: "" - schema: - $ref: "#/definitions/jc-enrollment-profile" - security: - - x-api-key: [] - x-stoplight: - afterScript: null - beforeScript: null - id: "jcEnrollmentProfiles_post" - mock: - dynamic: false - enabled: false - statusCode: 200 - public: false - /enrollmentprofiles/{enrollment_profile_id}: - get: - summary: "Get Enrollment Profile" - operationId: "jcEnrollmentProfiles_get" - parameters: - - name: "enrollment_profile_id" - in: "path" - required: true - type: "string" - x-exportParamName: "EnrollmentProfileId" - - in: "body" - name: "body" - required: false - schema: - $ref: "#/definitions/jc-enrollment-profile" - x-exportParamName: "Body" - responses: - default: - description: "" - security: - - x-api-key: [] - x-stoplight: - afterScript: null - beforeScript: null - id: "jcEnrollmentProfiles_get" - mock: - dynamic: false - enabled: false - statusCode: 200 - public: false - put: - summary: "Update Enrollment Profile" - operationId: "jcEnrollmentProfiles_put" - parameters: - - name: "enrollment_profile_id" - in: "path" - required: true - type: "string" - x-exportParamName: "EnrollmentProfileId" - - in: "body" - name: "body" - required: false - schema: - $ref: "#/definitions/body_2" - x-exportParamName: "Body" - responses: - 200: - description: "" - schema: - $ref: "#/definitions/jc-enrollment-profile" - security: - - x-api-key: [] - x-stoplight: - afterScript: null - beforeScript: null - id: "jcEnrollmentProfiles_put" - mock: - dynamic: false - enabled: false - statusCode: 200 - public: false - delete: - summary: "Delete Enrollment Profile" - operationId: "jcEnrollmentProfiles_delete" - parameters: - - name: "enrollment_profile_id" - in: "path" - required: true - type: "string" - x-exportParamName: "EnrollmentProfileId" - responses: - 200: - description: "" - schema: - $ref: "#/definitions/jc-enrollment-profile" - security: - - x-api-key: [] - x-stoplight: - afterScript: null - beforeScript: null - id: "jcEnrollmentProfiles_delete" - mock: - dynamic: false - enabled: false - statusCode: 200 - public: false - /groups: - get: - tags: - - "Groups" - summary: "List All Groups" - description: "This endpoint returns all Groups that exist in your organization.\n\ - \n#### Available filter fields:\n - `name`\n - `disabled`\n - `type`\n\n\ - #### Sample Request\n\n```\n curl -X GET \\\n https://console.jumpcloud.com/api/v2/groups\ - \ \\\n -H 'accept: application/json' \\\n -H 'content-type: application/json'\ - \ \\\n -H 'x-api-key: {API_KEY}'\n```" - operationId: "groups_list" - parameters: - - name: "fields" - in: "query" - description: "The comma separated fields included in the returned records.\n\ - If omitted, the default list of fields will be returned.\n" - required: false - type: "array" - items: - type: "string" - x-exportParamName: "Fields" - - name: "filter" - in: "query" - description: "Supported operators are: eq, ne, gt, ge, lt, le, between, search,\ - \ in" - required: false - type: "array" - items: - type: "string" - x-exportParamName: "Filter" - - name: "limit" - in: "query" - description: "The number of records to return at once. Limited to 100." - required: false - type: "integer" - default: 10 - x-exportParamName: "Limit" - - name: "skip" - in: "query" - description: "The offset into the records to return." - required: false - type: "integer" - default: 0 - minimum: 0 - x-exportParamName: "Skip" - - name: "sort" - in: "query" - description: "The comma separated fields used to sort the collection.\nDefault\ - \ sort is ascending, prefix with `-` to sort descending.\n" - required: false - type: "array" - items: - type: "string" - x-exportParamName: "Sort" - - name: "Content-Type" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "ContentType" - - name: "Accept" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "Accept" - - name: "x-org-id" - in: "header" - description: "" - required: false - type: "string" - x-exportParamName: "XOrgId" - responses: - 200: - description: "OK" - schema: - type: "array" - items: - $ref: "#/definitions/Group" - default: - description: "Unexpected error" - schema: - $ref: "#/definitions/Error" - security: - - x-api-key: [] - x-stoplight: - afterScript: null - beforeScript: null - id: "groups_list" - mock: - dynamic: false - enabled: false - statusCode: 200 - public: true - /gsuites/{gsuite_id}/associations: - get: - tags: - - "Graph" - - "G Suite" - summary: "List the associations of a G Suite instance" - description: "This endpoint returns the _direct_ associations of this G Suite\ - \ instance.\n\nA direct association can be a non-homogeneous relationship\ - \ between 2 different objects, for example G Suite and Users.\n\n\n#### Sample\ - \ Request\n```\ncurl -X GET 'https://console.jumpcloud.com/api/v2/gsuites/{Gsuite_ID}/associations?targets=user_group\ - \ \\\n -H 'accept: application/json' \\\n -H 'content-type: application/json'\ - \ \\\n -H 'x-api-key: {API_KEY}'\n```" - operationId: "graph_gSuiteAssociationsList" - parameters: - - name: "gsuite_id" - in: "path" - description: "ObjectID of the G Suite instance." - required: true - type: "string" - x-exportParamName: "GsuiteId" - - name: "targets" - in: "query" - description: "" - required: true - type: "array" - items: - type: "string" - enum: - - "active_directory" - - "application" - - "command" - - "g_suite" - - "ldap_server" - - "office_365" - - "policy" - - "radius_server" - - "system" - - "system_group" - - "user" - - "user_group" - x-exportParamName: "Targets" - - name: "limit" - in: "query" - description: "The number of records to return at once. Limited to 100." - required: false - type: "integer" - default: 10 - x-exportParamName: "Limit" - - name: "Content-Type" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "ContentType" - - name: "Accept" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "Accept" - - name: "skip" - in: "query" - description: "The offset into the records to return." - required: false - type: "integer" - default: 0 - minimum: 0 - x-exportParamName: "Skip" - - name: "x-org-id" - in: "header" - description: "" - required: false - type: "string" - x-exportParamName: "XOrgId" - responses: - 200: - description: "OK" - schema: - type: "array" - items: - $ref: "#/definitions/GraphConnection" - security: - - x-api-key: [] - x-stoplight: - afterScript: null - beforeScript: null - id: "graph_gSuiteAssociationsList" - mock: - dynamic: false - enabled: false - statusCode: 200 - public: true - post: - tags: - - "Graph" - - "G Suite" - summary: "Manage the associations of a G Suite instance" - description: "This endpoint returns the _direct_ associations of this G Suite\ - \ instance.\n\nA direct association can be a non-homogeneous relationship\ - \ between 2 different objects, for example G Suite and Users.\n\n\n#### Sample\ - \ Request\n```\ncurl -X POST https://console.jumpcloud.com/api/v2/gsuites/{Gsuite_ID}/associations\ - \ \\\n -H 'accept: application/json' \\\n -H 'content-type: application/json'\ - \ \\\n -H 'x-api-key: {API_KEY}' \\\n -d '{\n \"op\": \"add\",\n \"\ - type\": \"user_group\",\n \"id\": \"{Group_ID}\"\n}'\n```" - operationId: "graph_gSuiteAssociationsPost" - parameters: - - name: "gsuite_id" - in: "path" - description: "ObjectID of the G Suite instance." - required: true - type: "string" - x-exportParamName: "GsuiteId" - - in: "body" - name: "body" - required: false - schema: - $ref: "#/definitions/GraphManagementReq" - x-exportParamName: "Body" - - name: "x-org-id" - in: "header" - description: "" - required: false - type: "string" - x-exportParamName: "XOrgId" - responses: - 204: - description: "OK" - security: - - x-api-key: [] - x-stoplight: - afterScript: null - beforeScript: null - id: "graph_gSuiteAssociationsPost" - mock: - dynamic: false - enabled: false - statusCode: 200 - public: true - x-swagger-jumpcloud-auto-insert: true - /gsuites/{gsuite_id}/translationrules: - get: - tags: - - "G Suite" - summary: "List all the G Suite Translation Rules" - description: "This endpoint returns all graph translation rules for a specific\ - \ G Suite instance. These rules specify how JumpCloud attributes translate\ - \ to [G Suite Admin SDK](https://developers.google.com/admin-sdk/directory/)\ - \ attributes.\n\n##### Sample Request\n\n```\n curl -X GET https://console.jumpcloud.com/api/v2/gsuites/{gsuite_id}/translationrules\ - \ \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\ - \ \\\n -H 'x-api-key: {API_KEY}'\n ```" - operationId: "translationRules_gSuiteList" - parameters: - - name: "gsuite_id" - in: "path" - required: true - type: "string" - x-exportParamName: "GsuiteId" - - name: "fields" - in: "query" - description: "The comma separated fields included in the returned records.\n\ - If omitted, the default list of fields will be returned.\n" - required: false - type: "array" - items: - type: "string" - x-exportParamName: "Fields" - - name: "filter" - in: "query" - description: "Supported operators are: eq, ne, gt, ge, lt, le, between, search,\ - \ in" - required: false - type: "array" - items: - type: "string" - x-exportParamName: "Filter" - - name: "limit" - in: "query" - description: "The number of records to return at once. Limited to 100." - required: false - type: "integer" - default: 10 - x-exportParamName: "Limit" - - name: "Content-Type" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "ContentType" - - name: "Accept" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "Accept" - - name: "skip" - in: "query" - description: "The offset into the records to return." - required: false - type: "integer" - default: 0 - minimum: 0 - x-exportParamName: "Skip" - - name: "sort" - in: "query" - description: "The comma separated fields used to sort the collection.\nDefault\ - \ sort is ascending, prefix with `-` to sort descending.\n" - required: false - type: "array" - items: - type: "string" - x-exportParamName: "Sort" - responses: - 200: - description: "" - schema: - type: "array" - items: - $ref: "#/definitions/GSuiteTranslationRule" - examples: - application/json: - - field: "g_suite_work_addresses" - id: "object_id_1" - source_type: "user" - security: - - x-api-key: [] - x-stoplight: - afterScript: null - beforeScript: null - id: "translationRules_gSuiteList" - mock: - dynamic: false - enabled: false - statusCode: 200 - public: true - post: - tags: - - "G Suite" - summary: "Create a new G Suite Translation Rule" - description: "This endpoint allows you to create a translation rule for a specific\ - \ G Suite instance. These rules specify how JumpCloud attributes translate\ - \ to [G Suite Admin SDK](https://developers.google.com/admin-sdk/directory/)\ - \ attributes.\n\n##### Sample Request\n```\ncurl -X POST https://console.jumpcloud.com/api/v2/gsuites/{gsuite_id}/translationrules\ - \ \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\ - \ \\\n -H 'x-api-key: {API_KEY}' \\\n -d '{\n {Translation Rule Parameters}\n\ - }'\n\n```" - operationId: "translationRules_gSuitePost" - parameters: - - name: "gsuite_id" - in: "path" - required: true - type: "string" - x-exportParamName: "GsuiteId" - - in: "body" - name: "body" - required: false - schema: - $ref: "#/definitions/GSuiteTranslationRuleRequest" - x-exportParamName: "Body" - - name: "Content-Type" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "ContentType" - - name: "Accept" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "Accept" - responses: - 201: - description: "" - schema: - $ref: "#/definitions/GSuiteTranslationRule" - security: - - x-api-key: [] - x-stoplight: - afterScript: null - beforeScript: null - id: "translationRules_gSuitePost" - mock: - dynamic: false - enabled: false - statusCode: 200 - public: true - /gsuites/{gsuite_id}/translationrules/{id}: - get: - tags: - - "G Suite" - summary: "Gets a specific G Suite translation rule" - description: "This endpoint returns a specific translation rule for a specific\ - \ G Suite instance. These rules specify how JumpCloud attributes translate\ - \ to [G Suite Admin SDK](https://developers.google.com/admin-sdk/directory/)\ - \ attributes.\n\n###### Sample Request\n\n```\n curl -X GET https://console.jumpcloud.com/api/v2/gsuites/{gsuite_id}/translationrules/{id}\ - \ \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\ - \ \\\n -H 'x-api-key: {API_KEY}'\n ```" - operationId: "translationRules_gSuiteGet" - parameters: - - name: "gsuite_id" - in: "path" - required: true - type: "string" - x-exportParamName: "GsuiteId" - - name: "id" - in: "path" - required: true - type: "string" - x-exportParamName: "Id" - - name: "Content-Type" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "ContentType" - - name: "Accept" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "Accept" - responses: - 200: - description: "" - schema: - $ref: "#/definitions/GSuiteTranslationRule" - security: - - x-api-key: [] - x-stoplight: - afterScript: null - beforeScript: null - id: "translationRules_gSuiteGet" - mock: - dynamic: false - enabled: false - statusCode: 200 - public: true - delete: - tags: - - "G Suite" - summary: "Deletes a G Suite translation rule" - description: "This endpoint allows you to delete a translation rule for a specific\ - \ G Suite instance. These rules specify how JumpCloud attributes translate\ - \ to [G Suite Admin SDK](https://developers.google.com/admin-sdk/directory/)\ - \ attributes.\n\n#### Sample Request\n\n```\ncurl -X DELETE https://console.jumpcloud.com/api/v2/gsuites/{gsuite_id}/translationrules/{id}\ - \ \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\ - \ \\\n -H 'x-api-key: {API_KEY}'\n ```" - operationId: "translationRules_gSuiteDelete" - parameters: - - name: "gsuite_id" - in: "path" - required: true - type: "string" - x-exportParamName: "GsuiteId" - - name: "id" - in: "path" - required: true - type: "string" - x-exportParamName: "Id" - - name: "Content-Type" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "ContentType" - - name: "Accept" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "Accept" - responses: - 204: - description: "" - security: - - x-api-key: [] - x-stoplight: - afterScript: null - beforeScript: null - id: "translationRules_gSuiteDelete" - mock: - dynamic: false - enabled: false - statusCode: 200 - public: true - /gsuites/{gsuite_id}/usergroups: - get: - tags: - - "Graph" - - "G Suite" - summary: "List the User Groups bound to a G Suite instance" - description: "This endpoint will return all User Groups bound to an G Suite\ - \ instance, either directly or indirectly, essentially traversing the JumpCloud\ - \ Graph for your Organization.\n\nEach element will contain the group's type,\ - \ id, attributes and paths.\n\nThe `attributes` object is a key/value hash\ - \ of compiled graph attributes for all paths followed.\n\nThe `paths` array\ - \ enumerates each path from this G Suite instance to the corresponding User\ - \ Group; this array represents all grouping and/or associations that would\ - \ have to be removed to deprovision the User Group from this G Suite instance.\n\ - \nSee `/members` and `/associations` endpoints to manage those collections.\n\ - \n#### Sample Request\n```\n curl -X GET https://console.jumpcloud.com/api/v2/gsuites/{GSuite_ID}/usergroups\ - \ \\\n -H 'accept: application/json' \\\n -H 'content-type: application/json'\ - \ \\\n -H 'x-api-key: {API_KEY}'\n```" - operationId: "graph_gSuiteTraverseUserGroup" - parameters: - - name: "gsuite_id" - in: "path" - description: "ObjectID of the G Suite instance." - required: true - type: "string" - x-exportParamName: "GsuiteId" - - name: "limit" - in: "query" - description: "The number of records to return at once. Limited to 100." - required: false - type: "integer" - default: 10 - x-exportParamName: "Limit" - - name: "x-org-id" - in: "header" - description: "" - required: false - type: "string" - x-exportParamName: "XOrgId" - - name: "Content-Type" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "ContentType" - - name: "Accept" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "Accept" - - name: "skip" - in: "query" - description: "The offset into the records to return." - required: false - type: "integer" - default: 0 - minimum: 0 - x-exportParamName: "Skip" - - name: "filter" - in: "query" - description: "Supported operators are: eq, ne, gt, ge, lt, le, between, search,\ - \ in" - required: false - type: "array" - items: - type: "string" - x-exportParamName: "Filter" - responses: - 200: - description: "OK" - schema: - type: "array" - items: - $ref: "#/definitions/GraphObjectWithPaths" - security: - - x-api-key: [] - x-stoplight: - afterScript: null - beforeScript: null - id: "graph_gSuiteTraverseUserGroup" - mock: - dynamic: false - enabled: false - statusCode: 200 - public: true - /gsuites/{gsuite_id}/users: - get: - tags: - - "Graph" - - "G Suite" - summary: "List the Users bound to a G Suite instance" - description: "This endpoint will return all Users bound to a G Suite instance,\ - \ either directly or indirectly, essentially traversing the JumpCloud Graph\ - \ for your Organization.\n\nEach element will contain the type, id, attributes\ - \ and paths.\n\nThe `attributes` object is a key/value hash of compiled graph\ - \ attributes for all paths followed.\n\nThe `paths` array enumerates each\ - \ path from this G Suite instance to the corresponding User; this array represents\ - \ all grouping and/or associations that would have to be removed to deprovision\ - \ the User from this G Suite instance.\n\nSee `/members` and `/associations`\ - \ endpoints to manage those collections.\n\n#### Sample Request\n```\n curl\ - \ -X GET https://console.jumpcloud.com/api/v2/gsuites/{Gsuite_ID}/users \\\ - \n -H 'accept: application/json' \\\n -H 'content-type: application/json'\ - \ \\\n -H 'x-api-key: {API_KEY}'\n```" - operationId: "graph_gSuiteTraverseUser" - parameters: - - name: "gsuite_id" - in: "path" - description: "ObjectID of the G Suite instance." - required: true - type: "string" - x-exportParamName: "GsuiteId" - - name: "limit" - in: "query" - description: "The number of records to return at once. Limited to 100." - required: false - type: "integer" - default: 10 - x-exportParamName: "Limit" - - name: "x-org-id" - in: "header" - description: "" - required: false - type: "string" - x-exportParamName: "XOrgId" - - name: "Content-Type" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "ContentType" - - name: "Accept" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "Accept" - - name: "skip" - in: "query" - description: "The offset into the records to return." - required: false - type: "integer" - default: 0 - minimum: 0 - x-exportParamName: "Skip" - - name: "filter" - in: "query" - description: "Supported operators are: eq, ne, gt, ge, lt, le, between, search,\ - \ in" - required: false - type: "array" - items: - type: "string" - x-exportParamName: "Filter" - responses: - 200: - description: "OK" - schema: - type: "array" - items: - $ref: "#/definitions/GraphObjectWithPaths" - security: - - x-api-key: [] - x-stoplight: - afterScript: null - beforeScript: null - id: "graph_gSuiteTraverseUser" - mock: - dynamic: false - enabled: false - statusCode: 200 - public: true - /gsuites/{id}: - get: - tags: - - "G Suite" - summary: "Get G Suite" - description: "This endpoint returns a specific G Suite.\n\n##### Sample Request\n\ - \n```\n curl -X GET https://console.jumpcloud.com/api/v2/gsuites/{GSUITE_ID}\ - \ \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\ - \ \\\n -H 'x-api-key: {API_KEY}'\n```" - operationId: "gsuites_get" - parameters: - - name: "id" - in: "path" - description: "Unique identifier of the GSuite." - required: true - type: "string" - x-exportParamName: "Id" - - name: "x-org-id" - in: "header" - description: "" - required: false - type: "string" - x-exportParamName: "XOrgId" - - name: "Content-Type" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "ContentType" - - name: "Accept" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "Accept" - responses: - 200: - description: "" - schema: - $ref: "#/definitions/gsuite-output" - x-stoplight: - afterScript: null - beforeScript: null - id: "gsuites_get" - mock: - dynamic: false - enabled: false - statusCode: 200 - public: true - patch: - tags: - - "G Suite" - summary: "Update existing G Suite" - description: "This endpoint allows updating some attributes of a G Suite.\n\n\ - ##### Sample Request\n\n```\ncurl -X PATCH https://console.jumpcloud.com/api/v2/gsuites/{GSUITE_ID}\ - \ \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\ - \ \\\n -H 'x-api-key: {API_KEY}' \\\n -d '{\n \"userLockoutAction\":\ - \ \"remove\",\n \"userPasswordExpirationAction\": \"disable\"\n }'\n```" - operationId: "gsuites_patch" - parameters: - - name: "id" - in: "path" - description: "Unique identifier of the GSuite." - required: true - type: "string" - x-exportParamName: "Id" - - in: "body" - name: "body" - required: false - schema: - $ref: "#/definitions/gsuite-patch-input" - x-exportParamName: "Body" - - name: "x-org-id" - in: "header" - description: "" - required: false - type: "string" - x-exportParamName: "XOrgId" - - name: "Content-Type" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "ContentType" - - name: "Accept" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "Accept" - responses: - 200: - description: "" - schema: - $ref: "#/definitions/gsuite-output" - x-stoplight: - afterScript: null - beforeScript: null - id: "gsuites_patch" - mock: - dynamic: false - enabled: false - statusCode: 200 - public: true - /jobs/{id}: - get: - tags: - - "Bulk Job Requests" - summary: "Get Job (incomplete)" - description: "**This endpoint is not complete and should remain hidden as it's\ - \ not functional yet.**" - operationId: "jobs_get" - parameters: - - name: "id" - in: "path" - required: true - type: "string" - x-exportParamName: "Id" - - name: "Content-Type" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "ContentType" - - name: "Accept" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "Accept" - - name: "x-org-id" - in: "header" - description: "" - required: false - type: "string" - x-exportParamName: "XOrgId" - responses: - 200: - description: "" - schema: - $ref: "#/definitions/job-details" - security: - - x-api-key: [] - x-stoplight: - afterScript: null - beforeScript: null - id: "jobs_get" - mock: - dynamic: false - enabled: false - statusCode: 200 - public: false - /jobs/{id}/results: - get: - tags: - - "Bulk Job Requests" - summary: "List Job Results" - description: "This endpoint will return the results of particular import job\ - \ request.\n\n#### Sample Request\n```\ncurl -X GET \\\n https://console.jumpcloud.com/api/v2/jobs/{ImportJobID}/results\ - \ \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\ - \ \\\n -H 'x-api-key: {API_KEY}'\n ```" - operationId: "jobs_results" - parameters: - - name: "id" - in: "path" - required: true - type: "string" - x-exportParamName: "Id" - - name: "limit" - in: "query" - description: "The number of records to return at once. Limited to 100." - required: false - type: "integer" - default: 10 - x-exportParamName: "Limit" - - name: "skip" - in: "query" - description: "The offset into the records to return." - required: false - type: "integer" - default: 0 - minimum: 0 - x-exportParamName: "Skip" - - name: "Content-Type" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "ContentType" - - name: "Accept" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "Accept" - - name: "x-org-id" - in: "header" - description: "" - required: false - type: "string" - x-exportParamName: "XOrgId" - responses: - 200: - description: "" - schema: - type: "array" - items: - $ref: "#/definitions/job-workresult" - security: - - x-api-key: [] - x-stoplight: - afterScript: null - beforeScript: null - id: "jobs_results" - mock: - dynamic: false - enabled: false - statusCode: 200 - public: false - /knowledge/salesforce: - get: - tags: - - "Knowledge" - summary: "List Knowledge Articles" - description: "This endpoint returns a list of knowledge articles hosted in salesforce.\n\ - \n```\nSample Request\ncurl -X GET https://console.jumpcloud.com/api/v2/knowledge/salesforce\ - \ \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\ - \ \\\n -H 'x-api-key: {API_KEY}'\n```" - operationId: "knowledge_salesforceList" - parameters: - - name: "fields" - in: "query" - required: false - type: "array" - items: - type: "string" - x-exportParamName: "Fields" - - name: "filter" - in: "query" - description: "Supported operators are: eq, ne, gt, ge, lt, le, between, search,\ - \ in" - required: false - type: "array" - items: - type: "string" - x-exportParamName: "Filter" - - name: "limit" - in: "query" - description: "The number of records to return at once. Limited to 100." - required: false - type: "integer" - default: 10 - x-exportParamName: "Limit" - - name: "skip" - in: "query" - description: "The offset into the records to return." - required: false - type: "integer" - default: 0 - minimum: 0 - x-exportParamName: "Skip" - - name: "sort" - in: "query" - description: "The comma separated fields used to sort the collection.\nDefault\ - \ sort is ascending, prefix with `-` to sort descending.\n" - required: false - type: "array" - items: - type: "string" - x-exportParamName: "Sort" - responses: - 200: - description: "" - schema: - $ref: "#/definitions/salesforce-knowledge-list-output" - security: - - x-api-key: [] - x-stoplight: - afterScript: null - beforeScript: "function (ctx, request) {\n // Your javascript code here.\n\ - }" - id: "knowledge_salesforceList" - mock: - dynamic: false - enabled: false - statusCode: 200 - public: false - x-swagger-authorization: - - "user" - - "noOrgHeaderSelection" - x-swagger-grouping-strategies: [] - x-swagger-user-roles: [] - /ldapservers: - get: - tags: - - "LDAP Servers" - summary: "List LDAP Servers" - description: "This endpoint returns the object IDs of your LDAP servers.\n\n\ - \n##### Sample Request\n\n```\n curl -X GET https://console.jumpcloud.com/api/v2/ldapservers/\ - \ \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\ - \ \\\n -H 'x-api-key: {API_KEY}'" - operationId: "ldapservers_list" - parameters: - - name: "fields" - in: "query" - description: "The comma separated fields included in the returned records.\n\ - If omitted, the default list of fields will be returned.\n" - required: false - type: "array" - items: - type: "string" - x-exportParamName: "Fields" - - name: "filter" - in: "query" - description: "Supported operators are: eq, ne, gt, ge, lt, le, between, search,\ - \ in" - required: false - type: "array" - items: - type: "string" - x-exportParamName: "Filter" - - name: "limit" - in: "query" - description: "The number of records to return at once. Limited to 100." - required: false - type: "integer" - default: 10 - x-exportParamName: "Limit" - - name: "Content-Type" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "ContentType" - - name: "Accept" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "Accept" - - name: "skip" - in: "query" - description: "The offset into the records to return." - required: false - type: "integer" - default: 0 - minimum: 0 - x-exportParamName: "Skip" - - name: "sort" - in: "query" - description: "The comma separated fields used to sort the collection.\nDefault\ - \ sort is ascending, prefix with `-` to sort descending.\n" - required: false - type: "array" - items: - type: "string" - x-exportParamName: "Sort" - - name: "x-org-id" - in: "header" - description: "" - required: false - type: "string" - x-exportParamName: "XOrgId" - responses: - 200: - description: "" - schema: - type: "array" - items: - $ref: "#/definitions/ldap-server-output" - security: - - x-api-key: [] - x-stoplight: - afterScript: null - beforeScript: null - id: "ldapservers_list" - mock: - dynamic: false - enabled: false - statusCode: 200 - public: true - /ldapservers/{id}: - get: - tags: - - "LDAP Servers" - summary: "Get LDAP Server" - description: "This endpoint returns a specific LDAP server.\n\n##### Sample\ - \ Request\n\n```\n curl -X GET https://console.jumpcloud.com/api/v2/ldapservers/{LDAP_ID}\ - \ \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\ - \ \\\n -H 'x-api-key: {API_KEY}'\n```" - operationId: "ldapservers_get" - parameters: - - name: "id" - in: "path" - description: "Unique identifier of the LDAP server." - required: true - type: "string" - x-exportParamName: "Id" - - name: "Content-Type" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "ContentType" - - name: "Accept" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "Accept" - - name: "x-org-id" - in: "header" - description: "" - required: false - type: "string" - x-exportParamName: "XOrgId" - responses: - 200: - description: "" - schema: - $ref: "#/definitions/ldap-server-output" - security: - - x-api-key: [] - x-stoplight: - afterScript: null - beforeScript: null - id: "ldapservers_get" - mock: - dynamic: false - enabled: false - statusCode: 200 - public: true - patch: - tags: - - "LDAP Servers" - summary: "Update existing LDAP server" - description: "This endpoint allows updating some attributes of an LDAP server.\n\ - \nSample Request\n\n```\ncurl -X PATCH https://console.jumpcloud.com/api/v2/ldapservers/{LDAP_ID}\ - \ \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\ - \ \\\n -H 'x-api-key: {API_KEY}' \\\n -d '{\n \"userLockoutAction\":\ - \ \"remove\",\n \"userPasswordExpirationAction\": \"disable\"\n }'\n```" - operationId: "ldapservers_patch" - parameters: - - name: "id" - in: "path" - description: "Unique identifier of the LDAP server." - required: true - type: "string" - x-exportParamName: "Id" - - in: "body" - name: "body" - required: false - schema: - $ref: "#/definitions/body_3" - x-exportParamName: "Body" - - name: "x-api-key" - in: "header" - required: false - type: "string" - x-exportParamName: "XApiKey" - - name: "x-org-id" - in: "header" - required: false - type: "string" - x-exportParamName: "XOrgId" - - name: "Content-Type" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "ContentType" - - name: "Accept" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "Accept" - responses: - 200: - description: "" - schema: - $ref: "#/definitions/inline_response_200" - 400: - description: "" - schema: - $ref: "#/definitions/inline_response_400" - security: - - x-api-key: [] - x-stoplight: - afterScript: null - beforeScript: null - id: "ldapservers_patch" - mock: - dynamic: false - enabled: false - statusCode: 200 - public: true - /ldapservers/{ldapserver_id}/associations: - get: - tags: - - "Graph" - - "LDAP Servers" - summary: "List the associations of a LDAP Server" - description: "This endpoint returns the _direct_ associations of this LDAP Server.\n\ - \nA direct association can be a non-homogeneous relationship between 2 different\ - \ objects, for example LDAP and Users.\n\n#### Sample Request\n\n```\n curl\ - \ -X GET 'https://console.jumpcloud.com/api/v2/ldapservers/{LDAP_ID}/associations?targets=user_group\ - \ \\\n -H 'accept: application/json' \\\n -H 'content-type: application/json'\ - \ \\\n -H 'x-api-key: {API_KEY}'\n```" - operationId: "graph_ldapServerAssociationsList" - parameters: - - name: "ldapserver_id" - in: "path" - description: "ObjectID of the LDAP Server." - required: true - type: "string" - x-exportParamName: "LdapserverId" - - name: "targets" - in: "query" - description: "" - required: true - type: "array" - items: - type: "string" - enum: - - "active_directory" - - "application" - - "command" - - "g_suite" - - "ldap_server" - - "office_365" - - "policy" - - "radius_server" - - "system" - - "system_group" - - "user" - - "user_group" - x-exportParamName: "Targets" - - name: "limit" - in: "query" - description: "The number of records to return at once. Limited to 100." - required: false - type: "integer" - default: 10 - x-exportParamName: "Limit" - - name: "Content-Type" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "ContentType" - - name: "Accept" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "Accept" - - name: "skip" - in: "query" - description: "The offset into the records to return." - required: false - type: "integer" - default: 0 - minimum: 0 - x-exportParamName: "Skip" - - name: "x-org-id" - in: "header" - description: "" - required: false - type: "string" - x-exportParamName: "XOrgId" - responses: - 200: - description: "OK" - schema: - type: "array" - items: - $ref: "#/definitions/GraphConnection" - security: - - x-api-key: [] - x-stoplight: - afterScript: null - beforeScript: null - id: "graph_ldapServerAssociationsList" - mock: - dynamic: false - enabled: false - statusCode: 200 - public: true - post: - tags: - - "Graph" - - "LDAP Servers" - summary: "Manage the associations of a LDAP Server" - description: "This endpoint allows you to manage the _direct_ associations of\ - \ a LDAP Server.\n\nA direct association can be a non-homogeneous relationship\ - \ between 2 different objects, for example LDAP and Users.\n\n#### Sample\ - \ Request\n```\ncurl -X POST https://console.jumpcloud.com/api/v2/ldapservers/{LDAP_ID}/associations\ - \ \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\ - \ \\\n -H 'x-api-key: {API_KEY}' \\\n -d '{\n \"op\": \"add\",\n \"\ - type\": \"user\",\n \"id\": \"{User_ID}\"\n}'\n```" - operationId: "graph_ldapServerAssociationsPost" - parameters: - - name: "ldapserver_id" - in: "path" - description: "ObjectID of the LDAP Server." - required: true - type: "string" - x-exportParamName: "LdapserverId" - - in: "body" - name: "body" - required: false - schema: - $ref: "#/definitions/GraphManagementReq" - x-exportParamName: "Body" - - name: "Content-Type" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "ContentType" - - name: "Accept" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "Accept" - - name: "x-org-id" - in: "header" - description: "" - required: false - type: "string" - x-exportParamName: "XOrgId" - responses: - 204: - description: "OK" - security: - - x-api-key: [] - x-stoplight: - afterScript: null - beforeScript: null - id: "graph_ldapServerAssociationsPost" - mock: - dynamic: false - enabled: false - statusCode: 200 - public: true - x-swagger-jumpcloud-auto-insert: true - /ldapservers/{ldapserver_id}/sambadomains: - get: - tags: - - "Samba Domains" - summary: "List Samba Domains" - description: "This endpoint returns all samba domains for an LDAP server.\n\n\ - ##### Sample Request\n```\ncurl -X GET https://console.jumpcloud.com/api/v2/ldapservers/{LDAP_ID}/sambadomains\ - \ \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\ - \ \\\n -H 'x-api-key: {API_KEY}'\n ```" - operationId: "ldapservers_sambaDomainsList" - parameters: - - name: "ldapserver_id" - in: "path" - description: "Unique identifier of the LDAP server." - required: true - type: "string" - x-exportParamName: "LdapserverId" - - name: "Content-Type" - in: "header" - required: false - type: "string" - default: "application/json" - x-exportParamName: "ContentType" - - name: "Accept" - in: "header" - required: false - type: "string" - default: "application/json" - x-exportParamName: "Accept" - - name: "fields" - in: "query" - description: "The comma separated fields included in the returned records.\n\ - If omitted, the default list of fields will be returned.\n" - required: false - type: "array" - items: - type: "string" - x-exportParamName: "Fields" - - name: "filter" - in: "query" - description: "Supported operators are: eq, ne, gt, ge, lt, le, between, search,\ - \ in" - required: false - type: "array" - items: - type: "string" - x-exportParamName: "Filter" - - name: "limit" - in: "query" - description: "The number of records to return at once. Limited to 100." - required: false - type: "integer" - default: 10 - x-exportParamName: "Limit" - - name: "skip" - in: "query" - description: "The offset into the records to return." - required: false - type: "integer" - default: 0 - minimum: 0 - x-exportParamName: "Skip" - - name: "sort" - in: "query" - description: "The comma separated fields used to sort the collection.\nDefault\ - \ sort is ascending, prefix with `-` to sort descending.\n" - required: false - type: "array" - items: - type: "string" - x-exportParamName: "Sort" - - name: "x-org-id" - in: "header" - description: "" - required: false - type: "string" - x-exportParamName: "XOrgId" - responses: - 200: - description: "" - schema: - type: "array" - items: - $ref: "#/definitions/samba-domain-output" - default: - description: "" - schema: - $ref: "#/definitions/Error" - security: - - x-api-key: [] - x-stoplight: - afterScript: null - beforeScript: null - id: "ldapservers_sambaDomainsList" - mock: - dynamic: false - enabled: false - statusCode: 200 - public: true - post: - tags: - - "Samba Domains" - summary: "Create Samba Domain" - description: "This endpoint allows you to create a samba domain for an LDAP\ - \ server.\n\n##### Sample Request\n```\ncurl -X POST https://console.jumpcloud.com/api/v2/ldapservers/{LDAP_ID}/sambadomains\ - \ \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\ - \ \\\n -H 'x-api-key: {API_KEY}' \\\n -d '{\n\"sid\":\"{SID_ID}\",\n\"name\"\ - :\"{WORKGROUP_NAME}\"\n}'\n```" - operationId: "ldapservers_sambaDomainsPost" - parameters: - - name: "ldapserver_id" - in: "path" - description: "Unique identifier of the LDAP server." - required: true - type: "string" - x-exportParamName: "LdapserverId" - - in: "body" - name: "body" - required: false - schema: - $ref: "#/definitions/samba-domain-input" - x-exportParamName: "Body" - - name: "Content-Type" - in: "header" - required: false - type: "string" - default: "application/json" - x-exportParamName: "ContentType" - - name: "Accept" - in: "header" - required: false - type: "string" - default: "application/json" - x-exportParamName: "Accept" - - name: "x-org-id" - in: "header" - description: "" - required: false - type: "string" - x-exportParamName: "XOrgId" - responses: - 201: - description: "" - schema: - $ref: "#/definitions/samba-domain-output" - security: - - x-api-key: [] - x-stoplight: - afterScript: null - beforeScript: null - id: "ldapservers_sambaDomainsPost" - mock: - dynamic: false - enabled: false - statusCode: 200 - public: true - /ldapservers/{ldapserver_id}/sambadomains/{id}: - get: - tags: - - "Samba Domains" - summary: "Get Samba Domain" - description: "This endpoint returns a specific samba domain for an LDAP server.\n\ - \n##### Sample Request\n```\ncurl -X GET \\\n https://console.jumpcloud.com/api/v2/ldapservers/ldapservers/{LDAP_ID}/sambadomains/{SAMBA_ID}\ - \ \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\ - \ \\\n -H 'x-api-key: {API_KEY}'\n ```" - operationId: "ldapservers_sambaDomainsGet" - parameters: - - name: "ldapserver_id" - in: "path" - description: "Unique identifier of the LDAP server." - required: true - type: "string" - x-exportParamName: "LdapserverId" - - name: "id" - in: "path" - description: "Unique identifier of the samba domain." - required: true - type: "string" - x-exportParamName: "Id" - - name: "Content-Type" - in: "header" - required: false - type: "string" - default: "application/json" - x-exportParamName: "ContentType" - - name: "Accept" - in: "header" - required: false - type: "string" - default: "application/json" - x-exportParamName: "Accept" - - name: "x-org-id" - in: "header" - description: "" - required: false - type: "string" - x-exportParamName: "XOrgId" - responses: - 200: - description: "" - schema: - $ref: "#/definitions/samba-domain-output" - security: - - x-api-key: [] - x-stoplight: - afterScript: null - beforeScript: null - id: "ldapservers_sambaDomainsGet" - mock: - dynamic: false - enabled: false - statusCode: 200 - public: true - put: - tags: - - "Samba Domains" - summary: "Update Samba Domain" - description: "This endpoint allows you to update the samba domain information\ - \ for an LDAP server.\n\n##### Sample Request\n```\ncurl -X PUT https://console.jumpcloud.com/api/v2/ldapservers/{LDAP_ID}/sambadomains/{SAMBA_ID}\ - \ \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\ - \ \\\n -H 'x-api-key: {API_KEY}' \\\n -d '{\n\"sid\":\"{SID_ID}\",\n\"name\"\ - :\"{WORKGROUP_NAME}\"\n}'\n\n```" - operationId: "ldapservers_sambaDomainsPut" - parameters: - - name: "ldapserver_id" - in: "path" - description: "Unique identifier of the LDAP server." - required: true - type: "string" - x-exportParamName: "LdapserverId" - - name: "id" - in: "path" - description: "Unique identifier of the samba domain." - required: true - type: "string" - x-exportParamName: "Id" - - in: "body" - name: "body" - required: false - schema: - $ref: "#/definitions/samba-domain-input" - x-exportParamName: "Body" - - name: "Content-Type" - in: "header" - required: false - type: "string" - default: "application/json" - x-exportParamName: "ContentType" - - name: "Accept" - in: "header" - required: false - type: "string" - default: "application/json" - x-exportParamName: "Accept" - - name: "x-org-id" - in: "header" - description: "" - required: false - type: "string" - x-exportParamName: "XOrgId" - responses: - 200: - description: "" - schema: - $ref: "#/definitions/samba-domain-output" - security: - - x-api-key: [] - x-stoplight: - afterScript: null - beforeScript: null - id: "ldapservers_sambaDomainsPut" - mock: - dynamic: false - enabled: false - statusCode: 200 - public: true - delete: - tags: - - "Samba Domains" - summary: "Delete Samba Domain" - description: "This endpoint allows you to delete a samba domain from an LDAP\ - \ server.\n\n##### Sample Request\n```\ncurl -X DELETE https://console.jumpcloud.com/api/v2/ldapservers/{LDAP_ID}/sambadomains/{SAMBA_ID}\ - \ \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\ - \ \\\n -H 'x-api-key: {API_KEY}'\n```" - operationId: "ldapservers_sambaDomainsDelete" - parameters: - - name: "ldapserver_id" - in: "path" - description: "Unique identifier of the LDAP server." - required: true - type: "string" - x-exportParamName: "LdapserverId" - - name: "id" - in: "path" - description: "Unique identifier of the samba domain." - required: true - type: "string" - x-exportParamName: "Id" - - name: "Content-Type" - in: "header" - required: false - type: "string" - default: "application/json" - x-exportParamName: "ContentType" - - name: "Accept" - in: "header" - required: false - type: "string" - default: "application/json" - x-exportParamName: "Accept" - - name: "x-org-id" - in: "header" - description: "" - required: false - type: "string" - x-exportParamName: "XOrgId" - responses: - 200: - description: "" - schema: - type: "string" - 204: - description: "" - security: - - x-api-key: [] - x-stoplight: - afterScript: null - beforeScript: null - id: "ldapservers_sambaDomainsDelete" - mock: - dynamic: false - enabled: false - statusCode: 200 - public: true - /ldapservers/{ldapserver_id}/usergroups: - get: - tags: - - "Graph" - - "LDAP Servers" - summary: "List the User Groups bound to a LDAP Server" - description: "This endpoint will return all Users Groups bound to a LDAP Server,\ - \ either directly or indirectly, essentially traversing the JumpCloud Graph\ - \ for your Organization.\n\nEach element will contain the group's type, id,\ - \ attributes and paths.\n\nThe `attributes` object is a key/value hash of\ - \ compiled graph attributes for all paths followed.\n\nThe `paths` array enumerates\ - \ each path from this LDAP server instance to the corresponding User Group;\ - \ this array represents all grouping and/or associations that would have to\ - \ be removed to deprovision the User Group from this LDAP server instance.\n\ - \nSee `/members` and `/associations` endpoints to manage those collections.\n\ - \n#### Sample Request\n```\ncurl -X GET https://console.jumpcloud.com/api/v2/ldapservers/{LDAP_ID}/usergroups\ - \ \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\ - \ \\\n -H 'x-api-key: {API_KEY}'\n```" - operationId: "graph_ldapServerTraverseUserGroup" - parameters: - - name: "ldapserver_id" - in: "path" - description: "ObjectID of the LDAP Server." - required: true - type: "string" - x-exportParamName: "LdapserverId" - - name: "limit" - in: "query" - description: "The number of records to return at once. Limited to 100." - required: false - type: "integer" - default: 10 - x-exportParamName: "Limit" - - name: "x-org-id" - in: "header" - description: "" - required: false - type: "string" - x-exportParamName: "XOrgId" - - name: "Content-Type" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "ContentType" - - name: "Accept" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "Accept" - - name: "skip" - in: "query" - description: "The offset into the records to return." - required: false - type: "integer" - default: 0 - minimum: 0 - x-exportParamName: "Skip" - - name: "filter" - in: "query" - description: "Supported operators are: eq, ne, gt, ge, lt, le, between, search,\ - \ in" - required: false - type: "array" - items: - type: "string" - x-exportParamName: "Filter" - responses: - 200: - description: "OK" - schema: - type: "array" - items: - $ref: "#/definitions/GraphObjectWithPaths" - security: - - x-api-key: [] - x-stoplight: - afterScript: null - beforeScript: null - id: "graph_ldapServerTraverseUserGroup" - mock: - dynamic: false - enabled: false - statusCode: 200 - public: true - /ldapservers/{ldapserver_id}/users: - get: - tags: - - "Graph" - - "LDAP Servers" - summary: "List the Users bound to a LDAP Server" - description: "This endpoint will return all Users bound to an LDAP Server, either\ - \ directly or indirectly, essentially traversing the JumpCloud Graph for your\ - \ Organization.\n\nEach element will contain the type, id, attributes and\ - \ paths.\n\nThe `attributes` object is a key/value hash of compiled graph\ - \ attributes for all paths followed.\n\nThe `paths` array enumerates each\ - \ path from this LDAP server instance to the corresponding User; this array\ - \ represents all grouping and/or associations that would have to be removed\ - \ to deprovision the User from this LDAP server instance.\n\nSee `/members`\ - \ and `/associations` endpoints to manage those collections.\n\n#### Sample\ - \ Request\n```\ncurl -X GET https://console.jumpcloud.com/api/v2/ldapservers/{LDAP_ID}/users\ - \ \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\ - \ \\\n -H 'x-api-key: {API_KEY}'\n```" - operationId: "graph_ldapServerTraverseUser" - parameters: - - name: "ldapserver_id" - in: "path" - description: "ObjectID of the LDAP Server." - required: true - type: "string" - x-exportParamName: "LdapserverId" - - name: "limit" - in: "query" - description: "The number of records to return at once. Limited to 100." - required: false - type: "integer" - default: 10 - x-exportParamName: "Limit" - - name: "x-org-id" - in: "header" - description: "" - required: false - type: "string" - x-exportParamName: "XOrgId" - - name: "Content-Type" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "ContentType" - - name: "Accept" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "Accept" - - name: "skip" - in: "query" - description: "The offset into the records to return." - required: false - type: "integer" - default: 0 - minimum: 0 - x-exportParamName: "Skip" - - name: "filter" - in: "query" - description: "Supported operators are: eq, ne, gt, ge, lt, le, between, search,\ - \ in" - required: false - type: "array" - items: - type: "string" - x-exportParamName: "Filter" - responses: - 200: - description: "OK" - schema: - type: "array" - items: - $ref: "#/definitions/GraphObjectWithPaths" - security: - - x-api-key: [] - x-stoplight: - afterScript: null - beforeScript: null - id: "graph_ldapServerTraverseUser" - mock: - dynamic: false - enabled: false - statusCode: 200 - public: true - /office365s/{office365_id}/associations: - get: - tags: - - "Graph" - - "Office 365" - summary: "List the associations of an Office 365 instance" - description: "This endpoint returns _direct_ associations of an Office 365 instance.\n\ - \n\nA direct association can be a non-homogeneous relationship between 2 different\ - \ objects, for example Office 365 and Users.\n\n#### Sample Request\n```\n\ - curl -X GET 'https://console.jumpcloud.com/api/v2/office365s/{O365_ID}/associations?targets=user_group\ - \ \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\ - \ \\\n -H 'x-api-key: {API_KEY}'\n\n```" - operationId: "graph_office365AssociationsList" - parameters: - - name: "office365_id" - in: "path" - description: "ObjectID of the Office 365 instance." - required: true - type: "string" - x-exportParamName: "Office365Id" - - name: "targets" - in: "query" - description: "" - required: true - type: "array" - items: - type: "string" - enum: - - "active_directory" - - "application" - - "command" - - "g_suite" - - "ldap_server" - - "office_365" - - "policy" - - "radius_server" - - "system" - - "system_group" - - "user" - - "user_group" - x-exportParamName: "Targets" - - name: "limit" - in: "query" - description: "The number of records to return at once. Limited to 100." - required: false - type: "integer" - default: 10 - x-exportParamName: "Limit" - - name: "Content-Type" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "ContentType" - - name: "Accept" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "Accept" - - name: "skip" - in: "query" - description: "The offset into the records to return." - required: false - type: "integer" - default: 0 - minimum: 0 - x-exportParamName: "Skip" - - name: "x-org-id" - in: "header" - description: "" - required: false - type: "string" - x-exportParamName: "XOrgId" - responses: - 200: - description: "OK" - schema: - type: "array" - items: - $ref: "#/definitions/GraphConnection" - security: - - x-api-key: [] - x-stoplight: - afterScript: null - beforeScript: null - id: "graph_office365AssociationsList" - mock: - dynamic: false - enabled: false - statusCode: 200 - public: true - post: - tags: - - "Graph" - - "Office 365" - summary: "Manage the associations of an Office 365 instance" - description: "This endpoint allows you to manage the _direct_ associations of\ - \ a Office 365 instance.\n\nA direct association can be a non-homogeneous\ - \ relationship between 2 different objects, for example Office 365 and Users.\n\ - \n#### Sample Request\n```\ncurl -X POST https://console.jumpcloud.com/api/v2/office365s/{O365_ID}/associations\ - \ \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\ - \ \\\n -H 'x-api-key: {API_KEY}' \\\n -d '{\n \"op\": \"add\",\n \"\ - type\": \"user_group\",\n \"id\": \"{Group_ID}\"\n}'\n```" - operationId: "graph_office365AssociationsPost" - parameters: - - name: "office365_id" - in: "path" - description: "ObjectID of the Office 365 instance." - required: true - type: "string" - x-exportParamName: "Office365Id" - - in: "body" - name: "body" - required: false - schema: - $ref: "#/definitions/GraphManagementReq" - x-exportParamName: "Body" - - name: "Content-Type" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "ContentType" - - name: "Accept" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "Accept" - - name: "x-org-id" - in: "header" - description: "" - required: false - type: "string" - x-exportParamName: "XOrgId" - responses: - 204: - description: "OK" - security: - - x-api-key: [] - x-stoplight: - afterScript: null - beforeScript: null - id: "graph_office365AssociationsPost" - mock: - dynamic: false - enabled: false - statusCode: 200 - public: true - x-swagger-jumpcloud-auto-insert: true - /office365s/{office365_id}/translationrules: - get: - tags: - - "Office 365" - summary: "List all the Office 365 Translation Rules" - description: "This endpoint returns all translation rules for a specific Office\ - \ 365 instance. These rules specify how JumpCloud attributes translate to\ - \ [Microsoft Graph](https://developer.microsoft.com/en-us/graph) attributes.\n\ - \n##### Sample Request\n\n```\n curl -X GET https://console.jumpcloud.com/api/v2/office365s/{office365_id}/translationrules\ - \ \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\ - \ \\\n -H 'x-api-key: {API_KEY}'\n ```" - operationId: "translationRules_office365List" - parameters: - - name: "office365_id" - in: "path" - required: true - type: "string" - x-exportParamName: "Office365Id" - - name: "fields" - in: "query" - description: "The comma separated fields included in the returned records.\n\ - If omitted, the default list of fields will be returned.\n" - required: false - type: "array" - items: - type: "string" - x-exportParamName: "Fields" - - name: "filter" - in: "query" - description: "Supported operators are: eq, ne, gt, ge, lt, le, between, search,\ - \ in" - required: false - type: "array" - items: - type: "string" - x-exportParamName: "Filter" - - name: "limit" - in: "query" - description: "The number of records to return at once. Limited to 100." - required: false - type: "integer" - default: 10 - x-exportParamName: "Limit" - - name: "Content-Type" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "ContentType" - - name: "Accept" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "Accept" - - name: "skip" - in: "query" - description: "The offset into the records to return." - required: false - type: "integer" - default: 0 - minimum: 0 - x-exportParamName: "Skip" - - name: "sort" - in: "query" - description: "The comma separated fields used to sort the collection.\nDefault\ - \ sort is ascending, prefix with `-` to sort descending.\n" - required: false - type: "array" - items: - type: "string" - x-exportParamName: "Sort" - responses: - 200: - description: "" - schema: - type: "array" - items: - $ref: "#/definitions/Office365TranslationRule" - examples: - application/json: - - field: "office_365_state" - id: "object_id_1" - source_type: "user" - security: - - x-api-key: [] - x-stoplight: - afterScript: null - beforeScript: null - id: "translationRules_office365List" - mock: - dynamic: false - enabled: false - statusCode: 200 - public: true - post: - tags: - - "Office 365" - summary: "Create a new Office 365 Translation Rule" - description: "This endpoint allows you to create a translation rule for a specific\ - \ Office 365 instance. These rules specify how JumpCloud attributes translate\ - \ to [Microsoft Graph](https://developer.microsoft.com/en-us/graph) attributes.\n\ - \n##### Sample Request\n```\ncurl -X POST https://console.jumpcloud.com/api/v2/office365s/{office365_id}/translationrules\ - \ \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\ - \ \\\n -H 'x-api-key: {API_KEY}' \\\n -d '{\n {Translation Rule Parameters}\n\ - }'\n\n```" - operationId: "translationRules_office365Post" - parameters: - - name: "office365_id" - in: "path" - required: true - type: "string" - x-exportParamName: "Office365Id" - - in: "body" - name: "body" - required: false - schema: - $ref: "#/definitions/Office365TranslationRuleRequest" - x-exportParamName: "Body" - - name: "Content-Type" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "ContentType" - - name: "Accept" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "Accept" - responses: - 201: - description: "" - schema: - $ref: "#/definitions/Office365TranslationRule" - security: - - x-api-key: [] - x-stoplight: - afterScript: null - beforeScript: null - id: "translationRules_office365Post" - mock: - dynamic: false - enabled: false - statusCode: 200 - public: true - /office365s/{office365_id}/translationrules/{id}: - get: - tags: - - "Office 365" - summary: "Gets a specific Office 365 translation rule" - description: "This endpoint returns a specific translation rule for a specific\ - \ Office 365 instance. These rules specify how JumpCloud attributes translate\ - \ to [Microsoft Graph](https://developer.microsoft.com/en-us/graph) attributes.\n\ - \n###### Sample Request\n\n```\n curl -X GET https://console.jumpcloud.com/api/v2/office365s/{office365_id}/translationrules/{id}\ - \ \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\ - \ \\\n -H 'x-api-key: {API_KEY}'\n ```" - operationId: "translationRules_office365Get" - parameters: - - name: "office365_id" - in: "path" - required: true - type: "string" - x-exportParamName: "Office365Id" - - name: "id" - in: "path" - required: true - type: "string" - x-exportParamName: "Id" - - name: "Content-Type" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "ContentType" - - name: "Accept" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "Accept" - responses: - 200: - description: "" - schema: - $ref: "#/definitions/Office365TranslationRule" - security: - - x-api-key: [] - x-stoplight: - afterScript: null - beforeScript: null - id: "translationRules_office365Get" - mock: - dynamic: false - enabled: false - statusCode: 200 - public: true - delete: - tags: - - "Office 365" - summary: "Deletes a Office 365 translation rule" - description: "This endpoint allows you to delete a translation rule for a specific\ - \ Office 365 instance. These rules specify how JumpCloud attributes translate\ - \ to [Microsoft Graph](https://developer.microsoft.com/en-us/graph) attributes.\n\ - \n#### Sample Request\n\n```\ncurl -X DELETE https://console.jumpcloud.com/api/v2/office365s/{office365_id}/translationrules/{id}\ - \ \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\ - \ \\\n -H 'x-api-key: {API_KEY}'\n ```" - operationId: "translationRules_office365Delete" - parameters: - - name: "office365_id" - in: "path" - required: true - type: "string" - x-exportParamName: "Office365Id" - - name: "id" - in: "path" - required: true - type: "string" - x-exportParamName: "Id" - - name: "Content-Type" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "ContentType" - - name: "Accept" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "Accept" - responses: - 204: - description: "" - security: - - x-api-key: [] - x-stoplight: - afterScript: null - beforeScript: null - id: "translationRules_office365Delete" - mock: - dynamic: false - enabled: false - statusCode: 200 - public: true - /office365s/{office365_id}/usergroups: - get: - tags: - - "Graph" - - "Office 365" - summary: "List the User Groups bound to an Office 365 instance" - description: "This endpoint will return all Users Groups bound to an Office\ - \ 365 instance, either directly or indirectly, essentially traversing the\ - \ JumpCloud Graph for your Organization.\n\nEach element will contain the\ - \ group's type, id, attributes and paths.\n\nThe `attributes` object is a\ - \ key/value hash of compiled graph attributes for all paths followed.\n\n\ - The `paths` array enumerates each path from this Office 365 instance to the\ - \ corresponding User Group; this array represents all grouping and/or associations\ - \ that would have to be removed to deprovision the User Group from this Office\ - \ 365 instance.\n\nSee `/members` and `/associations` endpoints to manage\ - \ those collections.\n\n#### Sample Request\n```\n curl -X GET https://console.jumpcloud.com/api/v2/office365s/{O365_ID/usergroups\ - \ \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\ - \ \\\n -H 'x-api-key: {API_KEY}'\n```" - operationId: "graph_office365TraverseUserGroup" - parameters: - - name: "office365_id" - in: "path" - description: "ObjectID of the Office 365 suite." - required: true - type: "string" - x-exportParamName: "Office365Id" - - name: "limit" - in: "query" - description: "The number of records to return at once. Limited to 100." - required: false - type: "integer" - default: 10 - x-exportParamName: "Limit" - - name: "x-org-id" - in: "header" - description: "" - required: false - type: "string" - x-exportParamName: "XOrgId" - - name: "Content-Type" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "ContentType" - - name: "Accept" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "Accept" - - name: "skip" - in: "query" - description: "The offset into the records to return." - required: false - type: "integer" - default: 0 - minimum: 0 - x-exportParamName: "Skip" - - name: "filter" - in: "query" - description: "Supported operators are: eq, ne, gt, ge, lt, le, between, search,\ - \ in" - required: false - type: "array" - items: - type: "string" - x-exportParamName: "Filter" - responses: - 200: - description: "OK" - schema: - type: "array" - items: - $ref: "#/definitions/GraphObjectWithPaths" - security: - - x-api-key: [] - x-stoplight: - afterScript: null - beforeScript: null - id: "graph_office365TraverseUserGroup" - mock: - dynamic: false - enabled: false - statusCode: 200 - public: true - /office365s/{office365_id}/users: - get: - tags: - - "Graph" - - "Office 365" - summary: "List the Users bound to an Office 365 instance" - description: "This endpoint will return all Users bound to an Office 365 instance,\ - \ either directly or indirectly, essentially traversing the JumpCloud Graph\ - \ for your Organization.\n\nEach element will contain the type, id, attributes\ - \ and paths.\n\nThe `attributes` object is a key/value hash of compiled graph\ - \ attributes for all paths followed.\n\nThe `paths` array enumerates each\ - \ path from this Office 365 instance to the corresponding User; this array\ - \ represents all grouping and/or associations that would have to be removed\ - \ to deprovision the User from this Office 365 instance.\n\nSee `/members`\ - \ and `/associations` endpoints to manage those collections.\n\n#### Sample\ - \ Request\n```\ncurl -X GET https://console.jumpcloud.com/api/v2/office365s/{O365_ID}/users\ - \ \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\ - \ \\\n -H 'x-api-key: {API_KEY}'\n```" - operationId: "graph_office365TraverseUser" - parameters: - - name: "office365_id" - in: "path" - description: "ObjectID of the Office 365 suite." - required: true - type: "string" - x-exportParamName: "Office365Id" - - name: "limit" - in: "query" - description: "The number of records to return at once. Limited to 100." - required: false - type: "integer" - default: 10 - x-exportParamName: "Limit" - - name: "x-org-id" - in: "header" - description: "" - required: false - type: "string" - x-exportParamName: "XOrgId" - - name: "Content-Type" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "ContentType" - - name: "Accept" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "Accept" - - name: "skip" - in: "query" - description: "The offset into the records to return." - required: false - type: "integer" - default: 0 - minimum: 0 - x-exportParamName: "Skip" - - name: "filter" - in: "query" - description: "Supported operators are: eq, ne, gt, ge, lt, le, between, search,\ - \ in" - required: false - type: "array" - items: - type: "string" - x-exportParamName: "Filter" - responses: - 200: - description: "OK" - schema: - type: "array" - items: - $ref: "#/definitions/GraphObjectWithPaths" - security: - - x-api-key: [] - x-stoplight: - afterScript: null - beforeScript: null - id: "graph_office365TraverseUser" - mock: - dynamic: false - enabled: false - statusCode: 200 - public: true - /organizations/{id}/crypto: - get: - tags: - - "Organizations" - summary: "Get Crypto Settings" - operationId: "org_crypto_get" - parameters: - - name: "id" - in: "path" - required: true - type: "string" - x-exportParamName: "Id" - - name: "fields" - in: "query" - description: "The comma separated fields included in the returned records.\n\ - If omitted, the default list of fields will be returned.\n" - required: false - type: "array" - items: - type: "string" - x-exportParamName: "Fields" - - name: "filter" - in: "query" - description: "Supported operators are: eq, ne, gt, ge, lt, le, between, search,\ - \ in" - required: false - type: "array" - items: - type: "string" - x-exportParamName: "Filter" - - name: "x-org-id" - in: "header" - description: "" - required: false - type: "string" - x-exportParamName: "XOrgId" - - name: "Content-Type" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "ContentType" - - name: "Accept" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "Accept" - - name: "skip" - in: "query" - description: "The offset into the records to return." - required: false - type: "integer" - default: 0 - minimum: 0 - x-exportParamName: "Skip" - - name: "sort" - in: "query" - description: "The comma separated fields used to sort the collection.\nDefault\ - \ sort is ascending, prefix with `-` to sort descending.\n" - required: false - type: "array" - items: - type: "string" - x-exportParamName: "Sort" - - name: "limit" - in: "query" - description: "The number of records to return at once. Limited to 100." - required: false - type: "integer" - default: 10 - x-exportParamName: "Limit" - responses: - 200: - description: "" - schema: - $ref: "#/definitions/org-crypto-settings" - security: - - x-api-key: [] - x-stoplight: - afterScript: null - beforeScript: null - id: "org_crypto_get" - mock: - dynamic: false - enabled: false - statusCode: 200 - public: false - put: - tags: - - "Organizations" - summary: "Edit Crypto Settings" - operationId: "org_crypto_put" - parameters: - - name: "id" - in: "path" - required: true - type: "string" - x-exportParamName: "Id" - - in: "body" - name: "body" - required: false - schema: - $ref: "#/definitions/org-crypto-settings" - x-exportParamName: "Body" - - name: "fields" - in: "query" - description: "The comma separated fields included in the returned records.\n\ - If omitted, the default list of fields will be returned.\n" - required: false - type: "array" - items: - type: "string" - x-exportParamName: "Fields" - - name: "filter" - in: "query" - description: "Supported operators are: eq, ne, gt, ge, lt, le, between, search,\ - \ in" - required: false - type: "array" - items: - type: "string" - x-exportParamName: "Filter" - - name: "x-org-id" - in: "header" - description: "" - required: false - type: "string" - x-exportParamName: "XOrgId" - - name: "Content-Type" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "ContentType" - - name: "Accept" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "Accept" - - name: "skip" - in: "query" - description: "The offset into the records to return." - required: false - type: "integer" - default: 0 - minimum: 0 - x-exportParamName: "Skip" - - name: "sort" - in: "query" - description: "The comma separated fields used to sort the collection.\nDefault\ - \ sort is ascending, prefix with `-` to sort descending.\n" - required: false - type: "array" - items: - type: "string" - x-exportParamName: "Sort" - - name: "limit" - in: "query" - description: "The number of records to return at once. Limited to 100." - required: false - type: "integer" - default: 10 - x-exportParamName: "Limit" - responses: - 204: - description: "" - schema: - type: "object" - properties: {} - security: - - x-api-key: [] - x-stoplight: - afterScript: null - beforeScript: null - id: "org_crypto_put" - mock: - dynamic: false - enabled: false - statusCode: 200 - public: false - /policies: - get: - tags: - - "Policies" - summary: "Lists all the Policies" - description: "This endpoint returns all policies.\n\n##### Sample Request\n\n\ - ```\n curl -X GET https://console.jumpcloud.com/api/v2/policies \\\n -H\ - \ 'Accept: application/json' \\\n -H 'Content-Type: application/json' \\\n\ - \ -H 'x-api-key: {API_KEY}'\n ```" - operationId: "policies_list" - parameters: - - name: "fields" - in: "query" - description: "The comma separated fields included in the returned records.\n\ - If omitted, the default list of fields will be returned.\n" - required: false - type: "array" - items: - type: "string" - x-exportParamName: "Fields" - - name: "filter" - in: "query" - description: "Supported operators are: eq, ne, gt, ge, lt, le, between, search,\ - \ in" - required: false - type: "array" - items: - type: "string" - x-exportParamName: "Filter" - - name: "limit" - in: "query" - description: "The number of records to return at once. Limited to 100." - required: false - type: "integer" - default: 10 - x-exportParamName: "Limit" - - name: "skip" - in: "query" - description: "The offset into the records to return." - required: false - type: "integer" - default: 0 - minimum: 0 - x-exportParamName: "Skip" - - name: "sort" - in: "query" - description: "The comma separated fields used to sort the collection.\nDefault\ - \ sort is ascending, prefix with `-` to sort descending.\n" - required: false - type: "array" - items: - type: "string" - x-exportParamName: "Sort" - - name: "Content-Type" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "ContentType" - - name: "Accept" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "Accept" - - name: "x-org-id" - in: "header" - description: "" - required: false - type: "string" - x-exportParamName: "XOrgId" - responses: - 200: - description: "OK" - schema: - type: "array" - items: - $ref: "#/definitions/Policy" - 500: - description: "Unexpected error." - schema: - $ref: "#/definitions/Error" - security: - - x-api-key: [] - x-stoplight: - afterScript: null - beforeScript: null - id: "policies_list" - mock: - dynamic: false - enabled: false - statusCode: 200 - public: true - post: - tags: - - "Policies" - summary: "Create a new Policy" - description: "This endpoint allows you to create a policy. Given the amount\ - \ of configurable parameters required to create a Policy, we suggest you use\ - \ the JumpCloud Admin Console to create new policies.\n\n##### Sample Request\n\ - ```\ncurl -X POST https://console.jumpcloud.com/api/v2/policies \\\n -H 'Accept:\ - \ application/json' \\\n -H 'Content-Type: application/json' \\\n -H 'x-api-key:\ - \ {API_KEY}' \\\n -d '{\n {Policy_Parameters}\n}'\n\n```" - operationId: "policies_post" - parameters: - - in: "body" - name: "body" - required: false - schema: - $ref: "#/definitions/PolicyRequest" - x-exportParamName: "Body" - - name: "Content-Type" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "ContentType" - - name: "Accept" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "Accept" - - name: "x-org-id" - in: "header" - description: "" - required: false - type: "string" - x-exportParamName: "XOrgId" - responses: - 201: - description: "Created" - schema: - $ref: "#/definitions/PolicyWithDetails" - security: - - x-api-key: [] - x-stoplight: - afterScript: null - beforeScript: null - id: "policies_post" - mock: - dynamic: false - enabled: false - statusCode: 200 - public: true - /policies/{id}: - get: - tags: - - "Policies" - summary: "Gets a specific Policy." - description: "This endpoint returns a specific policy.\n\n###### Sample Request\n\ - \n```\n curl -X GET https://console.jumpcloud.com/api/v2/policies/{PolicyID}\ - \ \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\ - \ \\\n -H 'x-api-key: {API_KEY}'\n ```" - operationId: "policies_get" - parameters: - - name: "id" - in: "path" - description: "ObjectID of the Policy object." - required: true - type: "string" - x-exportParamName: "Id" - - name: "Content-Type" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "ContentType" - - name: "Accept" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "Accept" - - name: "x-org-id" - in: "header" - description: "" - required: false - type: "string" - x-exportParamName: "XOrgId" - responses: - 200: - description: "OK" - schema: - $ref: "#/definitions/PolicyWithDetails" - security: - - x-api-key: [] - x-stoplight: - afterScript: null - beforeScript: null - id: "policies_get" - mock: - dynamic: false - enabled: false - statusCode: 200 - public: true - put: - tags: - - "Policies" - summary: "Update an existing Policy" - description: "This endpoint allows you to update a policy. Given the amount\ - \ of configurable parameters required to update a Policy, we suggest you use\ - \ the JumpCloud Admin Console to create new policies.\n\n\n##### Sample Request\n\ - ```\ncurl -X PUT https://console.jumpcloud.com/api/v2/policies/59fced45c9118022172547ff\ - \ \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\ - \ \\\n -H 'x-api-key: {API_KEY' \\\n -d '{\n {Policy_Parameters}\n}'\n\ - ```" - operationId: "policies_put" - parameters: - - name: "id" - in: "path" - description: "ObjectID of the Policy object." - required: true - type: "string" - x-exportParamName: "Id" - - in: "body" - name: "body" - required: false - schema: - $ref: "#/definitions/PolicyRequest" - x-exportParamName: "Body" - - name: "x-org-id" - in: "header" - description: "" - required: false - type: "string" - x-exportParamName: "XOrgId" - responses: - 200: - description: "OK" - schema: - $ref: "#/definitions/Policy" - security: - - x-api-key: [] - x-stoplight: - afterScript: null - beforeScript: null - id: "policies_put" - mock: - dynamic: false - enabled: false - statusCode: 200 - public: true - delete: - tags: - - "Policies" - summary: "Deletes a Policy" - description: "This endpoint allows you to delete a policy.\n\n#### Sample Request\n\ - \n```\ncurl -X DELETE https://console.jumpcloud.com/api/v2/policies/5a837ecd232e110d4291e6b9\ - \ \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\ - \ \\\n -H 'x-api-key: {API_KEY}'\n ```" - operationId: "policies_delete" - parameters: - - name: "id" - in: "path" - description: "ObjectID of the Policy object." - required: true - type: "string" - x-exportParamName: "Id" - - name: "Content-Type" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "ContentType" - - name: "Accept" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "Accept" - - name: "x-org-id" - in: "header" - description: "" - required: false - type: "string" - x-exportParamName: "XOrgId" - responses: - 204: - description: "No Content" - security: - - x-api-key: [] - x-stoplight: - afterScript: null - beforeScript: null - id: "policies_delete" - mock: - dynamic: false - enabled: false - statusCode: 200 - public: true - /policies/{policy_id}/associations: - get: - tags: - - "Graph" - - "Policies" - summary: "List the associations of a Policy" - description: "This endpoint returns the _direct_ associations of a Policy.\n\ - \nA direct association can be a non-homogeneous relationship between 2 different\ - \ objects, for example Policies and Systems.\n\n#### Sample Request\n```\n\ - curl -X GET 'https://console.jumpcloud.com/api/v2/policies/{Policy_ID}/associations?targets=system_group\ - \ \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\ - \ \\\n -H 'x-api-key: {API_KEY}'\n```" - operationId: "graph_policyAssociationsList" - parameters: - - name: "policy_id" - in: "path" - description: "ObjectID of the Policy." - required: true - type: "string" - x-exportParamName: "PolicyId" - - name: "targets" - in: "query" - description: "" - required: true - type: "array" - items: - type: "string" - enum: - - "active_directory" - - "application" - - "command" - - "g_suite" - - "ldap_server" - - "office_365" - - "policy" - - "radius_server" - - "system" - - "system_group" - - "user" - - "user_group" - x-exportParamName: "Targets" - - name: "limit" - in: "query" - description: "The number of records to return at once. Limited to 100." - required: false - type: "integer" - default: 10 - x-exportParamName: "Limit" - - name: "Content-Type" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "ContentType" - - name: "Accept" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "Accept" - - name: "skip" - in: "query" - description: "The offset into the records to return." - required: false - type: "integer" - default: 0 - minimum: 0 - x-exportParamName: "Skip" - - name: "x-org-id" - in: "header" - description: "" - required: false - type: "string" - x-exportParamName: "XOrgId" - responses: - 200: - description: "OK" - schema: - type: "array" - items: - $ref: "#/definitions/GraphConnection" - security: - - x-api-key: [] - x-stoplight: - afterScript: null - beforeScript: null - id: "graph_policyAssociationsList" - mock: - dynamic: false - enabled: false - statusCode: 200 - public: true - post: - tags: - - "Graph" - - "Policies" - summary: "Manage the associations of a Policy" - description: "This endpoint allows you to manage the _direct_ associations of\ - \ a Policy.\n\nA direct association can be a non-homogeneous relationship\ - \ between 2 different objects, for example Policies and Systems.\n\n#### Sample\ - \ Request\n```\ncurl -X POST https://console.jumpcloud.com/api/v2/policies/{Policy_ID}/associations/\ - \ \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\ - \ \\\n -H 'x-api-key: {API_KEY}' \\\n -d '{\n \"op\": \"add\",\n \"\ - type\": \"system_group\",\n \"id\": \"{Group_ID}\"\n}'\n```" - operationId: "graph_policyAssociationsPost" - parameters: - - name: "policy_id" - in: "path" - description: "ObjectID of the Policy." - required: true - type: "string" - x-exportParamName: "PolicyId" - - in: "body" - name: "body" - required: false - schema: - $ref: "#/definitions/GraphManagementReq" - x-exportParamName: "Body" - - name: "Content-Type" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "ContentType" - - name: "Accept" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "Accept" - - name: "x-org-id" - in: "header" - description: "" - required: false - type: "string" - x-exportParamName: "XOrgId" - responses: - 204: - description: "" - security: - - x-api-key: [] - x-stoplight: - afterScript: null - beforeScript: null - id: "graph_policyAssociationsPost" - mock: - dynamic: false - enabled: false - statusCode: 200 - public: true - /policies/{policy_id}/policyresults: - get: - tags: - - "Policies" - summary: "Lists all the policy results of a policy." - description: "This endpoint returns all policies results for a specific policy.\n\ - \n##### Sample Request\n\n```\n curl -X GET https://console.jumpcloud.com/api/v2/policies/{Policy_ID}/policyresults\ - \ \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\ - \ \\\n -H 'x-api-key: {API_KEY}'\n ```" - operationId: "policyresults_list" - parameters: - - name: "policy_id" - in: "path" - required: true - type: "string" - x-exportParamName: "PolicyId" - - name: "fields" - in: "query" - description: "The comma separated fields included in the returned records.\n\ - If omitted, the default list of fields will be returned.\n" - required: false - type: "array" - items: - type: "string" - x-exportParamName: "Fields" - - name: "filter" - in: "query" - description: "Supported operators are: eq, ne, gt, ge, lt, le, between, search,\ - \ in" - required: false - type: "array" - items: - type: "string" - x-exportParamName: "Filter" - - name: "limit" - in: "query" - description: "The number of records to return at once. Limited to 100." - required: false - type: "integer" - default: 10 - x-exportParamName: "Limit" - - name: "x-org-id" - in: "header" - description: "" - required: false - type: "string" - x-exportParamName: "XOrgId" - - name: "Content-Type" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "ContentType" - - name: "Accept" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "Accept" - - name: "skip" - in: "query" - description: "The offset into the records to return." - required: false - type: "integer" - default: 0 - minimum: 0 - x-exportParamName: "Skip" - - name: "sort" - in: "query" - description: "The comma separated fields used to sort the collection.\nDefault\ - \ sort is ascending, prefix with `-` to sort descending.\n" - required: false - type: "array" - items: - type: "string" - x-exportParamName: "Sort" - responses: - 200: - description: "" - schema: - type: "array" - items: - $ref: "#/definitions/PolicyResult" - security: - - x-api-key: [] - x-stoplight: - afterScript: null - beforeScript: null - id: "policyresults_list" - mock: - dynamic: false - enabled: false - statusCode: 200 - public: true - /policies/{policy_id}/policystatuses: - get: - tags: - - "Policies" - summary: "Lists the latest policy results of a policy." - description: "This endpoint returns the latest policies results for a specific\ - \ policy.\n\n##### Sample Request\n\n```\n curl -X GET https://console.jumpcloud.com/api/v2/policies/{Policy_ID}/policystatuses\ - \ \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\ - \ \\\n -H 'x-api-key: {API_KEY}'\n ```" - operationId: "policystatuses_list" - parameters: - - name: "policy_id" - in: "path" - required: true - type: "string" - x-exportParamName: "PolicyId" - - name: "fields" - in: "query" - description: "The comma separated fields included in the returned records.\n\ - If omitted, the default list of fields will be returned.\n" - required: false - type: "array" - items: - type: "string" - x-exportParamName: "Fields" - - name: "filter" - in: "query" - description: "Supported operators are: eq, ne, gt, ge, lt, le, between, search,\ - \ in" - required: false - type: "array" - items: - type: "string" - x-exportParamName: "Filter" - - name: "limit" - in: "query" - description: "The number of records to return at once. Limited to 100." - required: false - type: "integer" - default: 10 - x-exportParamName: "Limit" - - name: "Content-Type" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "ContentType" - - name: "Accept" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "Accept" - - name: "skip" - in: "query" - description: "The offset into the records to return." - required: false - type: "integer" - default: 0 - minimum: 0 - x-exportParamName: "Skip" - - name: "sort" - in: "query" - description: "The comma separated fields used to sort the collection.\nDefault\ - \ sort is ascending, prefix with `-` to sort descending.\n" - required: false - type: "array" - items: - type: "string" - x-exportParamName: "Sort" - - name: "x-org-id" - in: "header" - description: "" - required: false - type: "string" - x-exportParamName: "XOrgId" - responses: - 200: - description: "" - schema: - type: "array" - items: - $ref: "#/definitions/PolicyResult" - security: - - x-api-key: [] - x-stoplight: - afterScript: null - beforeScript: null - id: "policystatuses_list" - mock: - dynamic: false - enabled: false - statusCode: 200 - public: true - /policies/{policy_id}/systemgroups: - get: - tags: - - "Graph" - - "Policies" - summary: "List the System Groups bound to a Policy" - description: "This endpoint will return all Systems Groups bound to a Policy,\ - \ either directly or indirectly, essentially traversing the JumpCloud Graph\ - \ for your Organization.\n\nEach element will contain the group's type, id,\ - \ attributes and paths.\n\nThe `attributes` object is a key/value hash of\ - \ compiled graph attributes for all paths followed.\n\nThe `paths` array enumerates\ - \ each path from this Policy to the corresponding System Group; this array\ - \ represents all grouping and/or associations that would have to be removed\ - \ to deprovision the System Group from this Policy.\n\nSee `/members` and\ - \ `/associations` endpoints to manage those collections.\n\n#### Sample Request\n\ - ```\ncurl -X GET https://console.jumpcloud.com/api/v2/policies/{Policy_ID}/systemgroups\ - \ \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\ - \ \\\n -H 'x-api-key: {API_KEY}'\n```" - operationId: "graph_policyTraverseSystemGroup" - parameters: - - name: "policy_id" - in: "path" - description: "ObjectID of the Command." - required: true - type: "string" - x-exportParamName: "PolicyId" - - name: "limit" - in: "query" - description: "The number of records to return at once. Limited to 100." - required: false - type: "integer" - default: 10 - x-exportParamName: "Limit" - - name: "x-org-id" - in: "header" - description: "" - required: false - type: "string" - x-exportParamName: "XOrgId" - - name: "Content-Type" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "ContentType" - - name: "Accept" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "Accept" - - name: "skip" - in: "query" - description: "The offset into the records to return." - required: false - type: "integer" - default: 0 - minimum: 0 - x-exportParamName: "Skip" - - name: "filter" - in: "query" - description: "Supported operators are: eq, ne, gt, ge, lt, le, between, search,\ - \ in" - required: false - type: "array" - items: - type: "string" - x-exportParamName: "Filter" - responses: - 200: - description: "OK" - schema: - type: "array" - items: - $ref: "#/definitions/GraphObjectWithPaths" - security: - - x-api-key: [] - x-stoplight: - afterScript: null - beforeScript: null - id: "graph_policyTraverseSystemGroup" - mock: - dynamic: false - enabled: false - statusCode: 200 - public: true - /policies/{policy_id}/systems: - get: - tags: - - "Graph" - - "Policies" - summary: "List the Systems bound to a Policy" - description: "This endpoint will return all Systems bound to a Policy, either\ - \ directly or indirectly, essentially traversing the JumpCloud Graph for your\ - \ Organization.\n\nEach element will contain the type, id, attributes and\ - \ paths.\n\nThe `attributes` object is a key/value hash of compiled graph\ - \ attributes for all paths followed.\n\nThe `paths` array enumerates each\ - \ path from this Policy to the corresponding System; this array represents\ - \ all grouping and/or associations that would have to be removed to deprovision\ - \ the System from this Policy.\n\nSee `/members` and `/associations` endpoints\ - \ to manage those collections.\n\n#### Sample Request\n```\ncurl -X GET https://console.jumpcloud.com/api/v2/policies/{Policy_ID}/systems\ - \ \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\ - \ \\\n -H 'x-api-key: {API_KEY}'\n```" - operationId: "graph_policyTraverseSystem" - parameters: - - name: "policy_id" - in: "path" - description: "ObjectID of the Command." - required: true - type: "string" - x-exportParamName: "PolicyId" - - name: "limit" - in: "query" - description: "The number of records to return at once. Limited to 100." - required: false - type: "integer" - default: 10 - x-exportParamName: "Limit" - - name: "x-org-id" - in: "header" - description: "" - required: false - type: "string" - x-exportParamName: "XOrgId" - - name: "Content-Type" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "ContentType" - - name: "Accept" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "Accept" - - name: "skip" - in: "query" - description: "The offset into the records to return." - required: false - type: "integer" - default: 0 - minimum: 0 - x-exportParamName: "Skip" - - name: "filter" - in: "query" - description: "Supported operators are: eq, ne, gt, ge, lt, le, between, search,\ - \ in" - required: false - type: "array" - items: - type: "string" - x-exportParamName: "Filter" - responses: - 200: - description: "OK" - schema: - type: "array" - items: - $ref: "#/definitions/GraphObjectWithPaths" - security: - - x-api-key: [] - x-stoplight: - afterScript: null - beforeScript: null - id: "graph_policyTraverseSystem" - mock: - dynamic: false - enabled: false - statusCode: 200 - public: true - /policyresults: - get: - tags: - - "Policies" - summary: "Lists all the policy results for an organization." - description: "This endpoint returns all policies results for an organization.\n\ - \n##### Sample Request\n\n```\n curl -X GET https://console.jumpcloud.com/api/v2/policyresults\ - \ \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\ - \ \\\n -H 'x-api-key: {API_KEY}'\n ```" - operationId: "policyresults_org_list" - parameters: - - name: "fields" - in: "query" - description: "The comma separated fields included in the returned records.\n\ - If omitted, the default list of fields will be returned.\n" - required: false - type: "array" - items: - type: "string" - x-exportParamName: "Fields" - - name: "filter" - in: "query" - description: "Supported operators are: eq, ne, gt, ge, lt, le, between, search,\ - \ in" - required: false - type: "array" - items: - type: "string" - x-exportParamName: "Filter" - - name: "limit" - in: "query" - description: "The number of records to return at once. Limited to 100." - required: false - type: "integer" - default: 10 - x-exportParamName: "Limit" - - name: "x-org-id" - in: "header" - description: "" - required: false - type: "string" - x-exportParamName: "XOrgId" - - name: "Content-Type" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "ContentType" - - name: "Accept" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "Accept" - - name: "skip" - in: "query" - description: "The offset into the records to return." - required: false - type: "integer" - default: 0 - minimum: 0 - x-exportParamName: "Skip" - - name: "sort" - in: "query" - description: "The comma separated fields used to sort the collection.\nDefault\ - \ sort is ascending, prefix with `-` to sort descending.\n" - required: false - type: "array" - items: - type: "string" - x-exportParamName: "Sort" - responses: - 200: - description: "" - schema: - type: "array" - items: - $ref: "#/definitions/PolicyResult" - security: - - x-api-key: [] - x-stoplight: - afterScript: null - beforeScript: null - id: "policyresults_org_list" - mock: - dynamic: false - enabled: false - statusCode: 200 - public: true - /policyresults/{id}: - get: - tags: - - "Policies" - summary: "Get a specific Policy Result." - description: "This endpoint will return the policy results for a specific policy.\n\ - \n##### Sample Request\n```\ncurl -X GET https://console.jumpcloud.com/api/v2/policyresults/{Policy_ID}\ - \ \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\ - \ \\\n -H 'x-api-key: {API_KEY}'\n ```" - operationId: "policyresults_get" - parameters: - - name: "id" - in: "path" - description: "ObjectID of the Policy Result." - required: true - type: "string" - x-exportParamName: "Id" - - name: "Content-Type" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "ContentType" - - name: "Accept" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "Accept" - - name: "x-org-id" - in: "header" - description: "" - required: false - type: "string" - x-exportParamName: "XOrgId" - responses: - 200: - description: "OK" - schema: - $ref: "#/definitions/PolicyResult" - security: - - x-api-key: [] - x-stoplight: - afterScript: null - beforeScript: null - id: "policyresults_get" - mock: - dynamic: false - enabled: false - statusCode: 200 - public: true - /policytemplates: - get: - tags: - - "Policytemplates" - - "Policies" - summary: "Lists all of the Policy Templates" - description: "This endpoint returns all policy templates.\n\n#### Sample Request\n\ - ```\ncurl -X GET https://console.jumpcloud.com/api/v2/policytemplates \\\n\ - \ -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\ - \ \\\n -H 'x-api-key: {API_KEY}'\n ```" - operationId: "policytemplates_list" - parameters: - - name: "fields" - in: "query" - description: "The comma separated fields included in the returned records.\n\ - If omitted, the default list of fields will be returned.\n" - required: false - type: "array" - items: - type: "string" - x-exportParamName: "Fields" - - name: "filter" - in: "query" - description: "Supported operators are: eq, ne, gt, ge, lt, le, between, search,\ - \ in" - required: false - type: "array" - items: - type: "string" - x-exportParamName: "Filter" - - name: "limit" - in: "query" - description: "The number of records to return at once. Limited to 100." - required: false - type: "integer" - default: 10 - x-exportParamName: "Limit" - - name: "skip" - in: "query" - description: "The offset into the records to return." - required: false - type: "integer" - default: 0 - minimum: 0 - x-exportParamName: "Skip" - - name: "sort" - in: "query" - description: "The comma separated fields used to sort the collection.\nDefault\ - \ sort is ascending, prefix with `-` to sort descending.\n" - required: false - type: "array" - items: - type: "string" - x-exportParamName: "Sort" - - name: "Content-Type" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "ContentType" - - name: "Accept" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "Accept" - - name: "x-org-id" - in: "header" - description: "" - required: false - type: "string" - x-exportParamName: "XOrgId" - responses: - 200: - description: "OK" - schema: - type: "array" - items: - $ref: "#/definitions/PolicyTemplate" - 500: - description: "Unexpected error." - schema: - $ref: "#/definitions/Error" - security: - - x-api-key: [] - x-stoplight: - afterScript: "function (ctx, request, response) {\n // Your javascript code\ - \ here.\n}" - beforeScript: null - id: "policytemplates_list" - mock: - dynamic: false - enabled: false - statusCode: 200 - public: true - /policytemplates/{id}: - get: - tags: - - "Policytemplates" - - "Policies" - summary: "Get a specific Policy Template" - description: "This endpoint returns a specific policy template.\n\n#### Sample\ - \ Request\n```\n curl -X GET https://console.jumpcloud.com/api/v2/policies/{Policy_ID}\\\ - \n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\ - \ \\\n -H 'x-api-key: {API_KEY}'\n```" - operationId: "policytemplates_get" - parameters: - - name: "id" - in: "path" - description: "ObjectID of the Policy Template." - required: true - type: "string" - x-exportParamName: "Id" - - name: "Content-Type" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "ContentType" - - name: "Accept" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "Accept" - - name: "x-org-id" - in: "header" - description: "" - required: false - type: "string" - x-exportParamName: "XOrgId" - responses: - 200: - description: "OK" - schema: - $ref: "#/definitions/PolicyTemplateWithDetails" - security: - - x-api-key: [] - x-stoplight: - afterScript: null - beforeScript: null - id: "policytemplates_get" - mock: - dynamic: false - enabled: false - statusCode: 200 - public: true - /providers/{provider_id}/administrators: - get: - tags: - - "Providers" - summary: "List Provider Administrators" - description: "This endpoint returns a list of the Administrators associated\ - \ with the Provider.\n\n#### Sample Request\n```\ncurl -X GET https://console.jumpcloud.com/api/v2/providers/{ProviderID}/administrators\ - \ \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\ - \ \\\n -H 'x-api-key: {API_KEY}'\n```" - operationId: "providers_listAdministrators" - parameters: - - name: "provider_id" - in: "path" - required: true - type: "string" - x-exportParamName: "ProviderId" - - name: "fields" - in: "query" - description: "The comma separated fields included in the returned records.\n\ - If omitted, the default list of fields will be returned.\n" - required: false - type: "array" - items: - type: "string" - x-exportParamName: "Fields" - - name: "filter" - in: "query" - description: "Supported operators are: eq, ne, gt, ge, lt, le, between, search,\ - \ in" - required: false - type: "array" - items: - type: "string" - x-exportParamName: "Filter" - - name: "limit" - in: "query" - description: "The number of records to return at once. Limited to 100." - required: false - type: "integer" - default: 10 - x-exportParamName: "Limit" - - name: "Content-Type" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "ContentType" - - name: "Accept" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "Accept" - - name: "skip" - in: "query" - description: "The offset into the records to return." - required: false - type: "integer" - default: 0 - minimum: 0 - x-exportParamName: "Skip" - - name: "sort" - in: "query" - description: "The comma separated fields used to sort the collection.\nDefault\ - \ sort is ascending, prefix with `-` to sort descending.\n" - required: false - type: "array" - items: - type: "string" - x-exportParamName: "Sort" - responses: - 200: - description: "" - schema: - $ref: "#/definitions/inline_response_200_1" - examples: - application/json: - results: - - _id: "5c3536e9e0a6840001872782" - email: "joe@example.com" - enableMultiFactor: false - firstname: "" - lastname: "" - registered: true - - _id: "5c35370ae0a6840001872784" - email: "mildred@example.com" - enableMultiFactor: false - firstname: "" - lastname: "" - registered: true - totalCount: 2 - 401: - description: "" - schema: - $ref: "#/definitions/inline_response_400" - examples: - application/json: - message: "Unauthorized" - security: - - x-api-key: [] - x-stoplight: - afterScript: null - beforeScript: null - id: "providers_listAdministrators" - mock: - dynamic: false - enabled: false - statusCode: 200 - public: true - post: - tags: - - "Providers" - summary: "Create a new Provider Administrator" - description: "This endpoint allows you to create a provider administrator. You\ - \ must be associated to the provider to use this route.\n\n**Sample Request**\n\ - \n```\ncurl -X POST https://console.jumpcloud.com/api/v2/providers/{ProviderID}/administrators\ - \ \\\n -H 'Accept: application/json' \\\n -H 'Context-Type: application/json'\ - \ \\\n -H 'x-api-key: {API_KEY}' \\\n -d '{\n \"email\":\"{ADMIN_EMAIL}\"\ - \n }'\n```" - operationId: "providers_postAdmins" - parameters: - - name: "provider_id" - in: "path" - required: true - type: "string" - x-exportParamName: "ProviderId" - - in: "body" - name: "body" - required: false - schema: - $ref: "#/definitions/ProviderAdminReq" - x-exportParamName: "Body" - - name: "Content-Type" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "ContentType" - - name: "Accept" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "Accept" - responses: - 200: - description: "" - schema: - $ref: "#/definitions/Administrator" - 401: - description: "" - schema: - $ref: "#/definitions/inline_response_400" - security: - - x-api-key: [] - x-stoplight: - afterScript: null - beforeScript: null - id: "providers_postAdmins" - mock: - dynamic: false - enabled: false - statusCode: 200 - public: true - x-swagger-authorization: - - "user" - - "providerTenancy" - - "noOrgHeaderSelection" - x-swagger-grouping-strategies: [] - x-swagger-user-roles: - - "administrator" - /radiusservers/{radiusserver_id}/associations: - get: - tags: - - "Graph" - - "RADIUS Servers" - summary: "List the associations of a RADIUS Server" - description: "This endpoint returns the _direct_ associations of a Radius Server.\n\ - \nA direct association can be a non-homogeneous relationship between 2 different\ - \ objects, for example Radius Servers and Users.\n\n#### Sample Request\n\ - ```\ncurl -X GET https://console.jumpcloud.com/api/v2/radiusservers/{RADIUS_ID}/associations?targets=user_group\ - \ \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\ - \ \\\n -H 'x-api-key: {API_KEY}'\n```" - operationId: "graph_radiusServerAssociationsList" - parameters: - - name: "radiusserver_id" - in: "path" - description: "ObjectID of the Radius Server." - required: true - type: "string" - x-exportParamName: "RadiusserverId" - - name: "targets" - in: "query" - description: "" - required: true - type: "array" - items: - type: "string" - enum: - - "active_directory" - - "application" - - "command" - - "g_suite" - - "ldap_server" - - "office_365" - - "policy" - - "radius_server" - - "system" - - "system_group" - - "user" - - "user_group" - x-exportParamName: "Targets" - - name: "limit" - in: "query" - description: "The number of records to return at once. Limited to 100." - required: false - type: "integer" - default: 10 - x-exportParamName: "Limit" - - name: "Content-Type" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "ContentType" - - name: "Accept" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "Accept" - - name: "skip" - in: "query" - description: "The offset into the records to return." - required: false - type: "integer" - default: 0 - minimum: 0 - x-exportParamName: "Skip" - - name: "x-org-id" - in: "header" - description: "" - required: false - type: "string" - x-exportParamName: "XOrgId" - responses: - 200: - description: "OK" - schema: - type: "array" - items: - $ref: "#/definitions/GraphConnection" - security: - - x-api-key: [] - x-stoplight: - afterScript: null - beforeScript: null - id: "graph_radiusServerAssociationsList" - mock: - dynamic: false - enabled: false - statusCode: 200 - public: true - post: - tags: - - "Graph" - - "RADIUS Servers" - summary: "Manage the associations of a RADIUS Server" - description: "This endpoint allows you to manage the _direct_ associations of\ - \ a Radius Server.\n\nA direct association can be a non-homogeneous relationship\ - \ between 2 different objects, for example Radius Servers and Users.\n\n####\ - \ Sample Request\n```\ncurl -X POST https://console.jumpcloud.com/api/v2/radiusservers/{RADIUS_ID}/associations\ - \ \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\ - \ \\\n -H 'x-api-key: {API_KEY}' \\\n -d '{\n\t\n\"type\":\"user\", \n\"\ - id\":\"{USER_ID}\", \n\"op\":\"add\"\n\t\n}'\n```" - operationId: "graph_radiusServerAssociationsPost" - parameters: - - name: "radiusserver_id" - in: "path" - description: "ObjectID of the Radius Server." - required: true - type: "string" - x-exportParamName: "RadiusserverId" - - in: "body" - name: "body" - required: false - schema: - $ref: "#/definitions/GraphManagementReq" - x-exportParamName: "Body" - - name: "Content-Type" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "ContentType" - - name: "Accept" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "Accept" - - name: "x-org-id" - in: "header" - description: "" - required: false - type: "string" - x-exportParamName: "XOrgId" - responses: - 204: - description: "OK" - security: - - x-api-key: [] - x-stoplight: - afterScript: null - beforeScript: null - id: "graph_radiusServerAssociationsPost" - mock: - dynamic: false - enabled: false - statusCode: 200 - public: true - x-swagger-jumpcloud-auto-insert: true - /radiusservers/{radiusserver_id}/usergroups: - get: - tags: - - "Graph" - - "RADIUS Servers" - summary: "List the User Groups bound to a RADIUS Server" - description: "This endpoint will return all Users Groups bound to a RADIUS Server,\ - \ either directly or indirectly, essentially traversing the JumpCloud Graph\ - \ for your Organization.\n\nEach element will contain the group's type, id,\ - \ attributes and paths.\n\nThe `attributes` object is a key/value hash of\ - \ compiled graph attributes for all paths followed.\n\nThe `paths` array enumerates\ - \ each path from this RADIUS server instance to the corresponding User Group;\ - \ this array represents all grouping and/or associations that would have to\ - \ be removed to deprovision the User Group from this RADIUS server instance.\n\ - \nSee `/members` and `/associations` endpoints to manage those collections.\n\ - \n#### Sample Request\n```\ncurl -X GET https://console.jumpcloud.com/api/v2/radiusservers/{RADIUS_ID}/usergroups\ - \ \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\ - \ \\\n -H 'x-api-key: {API_KEY}'\n```" - operationId: "graph_radiusServerTraverseUserGroup" - parameters: - - name: "radiusserver_id" - in: "path" - description: "ObjectID of the Radius Server." - required: true - type: "string" - x-exportParamName: "RadiusserverId" - - name: "limit" - in: "query" - description: "The number of records to return at once. Limited to 100." - required: false - type: "integer" - default: 10 - x-exportParamName: "Limit" - - name: "x-org-id" - in: "header" - description: "" - required: false - type: "string" - x-exportParamName: "XOrgId" - - name: "Content-Type" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "ContentType" - - name: "Accept" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "Accept" - - name: "skip" - in: "query" - description: "The offset into the records to return." - required: false - type: "integer" - default: 0 - minimum: 0 - x-exportParamName: "Skip" - - name: "filter" - in: "query" - description: "Supported operators are: eq, ne, gt, ge, lt, le, between, search,\ - \ in" - required: false - type: "array" - items: - type: "string" - x-exportParamName: "Filter" - responses: - 200: - description: "OK" - schema: - type: "array" - items: - $ref: "#/definitions/GraphObjectWithPaths" - security: - - x-api-key: [] - x-stoplight: - afterScript: null - beforeScript: null - id: "graph_radiusServerTraverseUserGroup" - mock: - dynamic: false - enabled: false - statusCode: 200 - public: true - /radiusservers/{radiusserver_id}/users: - get: - tags: - - "Graph" - - "RADIUS Servers" - summary: "List the Users bound to a RADIUS Server" - description: "This endpoint will return all Users bound to a RADIUS Server,\ - \ either directly or indirectly, essentially traversing the JumpCloud Graph\ - \ for your Organization.\n\nEach element will contain the type, id, attributes\ - \ and paths.\n\nThe `attributes` object is a key/value hash of compiled graph\ - \ attributes for all paths followed.\n\nThe `paths` array enumerates each\ - \ path from this RADIUS server instance to the corresponding User; this array\ - \ represents all grouping and/or associations that would have to be removed\ - \ to deprovision the User from this RADIUS server instance.\n\nSee `/members`\ - \ and `/associations` endpoints to manage those collections.\n\n\n#### Sample\ - \ Request\n```\ncurl -X GET https://console.jumpcloud.com/api/v2/ldapservers/{LDAP_ID}/users\ - \ \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\ - \ \\\n -H 'x-api-key: {API_KEY}'\n ```" - operationId: "graph_radiusServerTraverseUser" - parameters: - - name: "radiusserver_id" - in: "path" - description: "ObjectID of the Radius Server." - required: true - type: "string" - x-exportParamName: "RadiusserverId" - - name: "limit" - in: "query" - description: "The number of records to return at once. Limited to 100." - required: false - type: "integer" - default: 10 - x-exportParamName: "Limit" - - name: "x-org-id" - in: "header" - description: "" - required: false - type: "string" - x-exportParamName: "XOrgId" - - name: "Content-Type" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "ContentType" - - name: "Accept" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "Accept" - - name: "skip" - in: "query" - description: "The offset into the records to return." - required: false - type: "integer" - default: 0 - minimum: 0 - x-exportParamName: "Skip" - - name: "filter" - in: "query" - description: "Supported operators are: eq, ne, gt, ge, lt, le, between, search,\ - \ in" - required: false - type: "array" - items: - type: "string" - x-exportParamName: "Filter" - responses: - 200: - description: "OK" - schema: - type: "array" - items: - $ref: "#/definitions/GraphObjectWithPaths" - security: - - x-api-key: [] - x-stoplight: - afterScript: null - beforeScript: null - id: "graph_radiusServerTraverseUser" - mock: - dynamic: false - enabled: false - statusCode: 200 - public: true - /systemgroups: - get: - tags: - - "System Groups" - summary: "List all System Groups" - description: "This endpoint returns all System Groups.\n\nAvailable filter fields:\n\ - \ - `name`\n - `disabled`\n - `type`\n\n#### Sample Request\n\n```\ncurl\ - \ -X GET https://console.jumpcloud.com/api/v2/systemgroups \\\n -H 'Accept:\ - \ application/json' \\\n -H 'Content-Type: application/json' \\\n -H 'x-api-key:\ - \ {API_KEY}'\n```" - operationId: "groups_system_list" - parameters: - - name: "fields" - in: "query" - description: "The comma separated fields included in the returned records.\n\ - If omitted, the default list of fields will be returned.\n" - required: false - type: "array" - items: - type: "string" - x-exportParamName: "Fields" - - name: "filter" - in: "query" - description: "Supported operators are: eq, ne, gt, ge, lt, le, between, search,\ - \ in" - required: false - type: "array" - items: - type: "string" - x-exportParamName: "Filter" - - name: "limit" - in: "query" - description: "The number of records to return at once. Limited to 100." - required: false - type: "integer" - default: 10 - x-exportParamName: "Limit" - - name: "skip" - in: "query" - description: "The offset into the records to return." - required: false - type: "integer" - default: 0 - minimum: 0 - x-exportParamName: "Skip" - - name: "sort" - in: "query" - description: "The comma separated fields used to sort the collection.\nDefault\ - \ sort is ascending, prefix with `-` to sort descending.\n" - required: false - type: "array" - items: - type: "string" - x-exportParamName: "Sort" - - name: "Content-Type" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "ContentType" - - name: "Accept" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "Accept" - - name: "x-org-id" - in: "header" - description: "" - required: false - type: "string" - x-exportParamName: "XOrgId" - responses: - 200: - description: "OK" - schema: - type: "array" - items: - $ref: "#/definitions/SystemGroup" - examples: - application/json: - - id: "000000" - - type: "system_group" - - id: "000000" - name: "group1" - default: - description: "Unexpected error" - schema: - $ref: "#/definitions/Error" - security: - - x-api-key: [] - x-stoplight: - afterScript: null - beforeScript: null - id: "groups_system_list" - mock: - dynamic: false - enabled: false - statusCode: 200 - public: true - post: - tags: - - "System Groups" - summary: "Create a new System Group" - description: "This endpoint allows you to create a new System Group.\n\n####\ - \ Sample Request\n\n```\ncurl -X POST https://console.jumpcloud.com/api/v2/systemgroups\ - \ \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\ - \ \\\n -H 'x-api-key: {API_KEY}' \\\n -d '{\n \"name\": \"{Group_Name}\"\ - \n}'\n\n```" - operationId: "groups_system_post" - parameters: - - in: "body" - name: "body" - required: false - schema: - $ref: "#/definitions/SystemGroupData" - x-exportParamName: "Body" - - name: "Content-Type" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "ContentType" - - name: "Accept" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "Accept" - - name: "x-org-id" - in: "header" - description: "" - required: false - type: "string" - x-exportParamName: "XOrgId" - responses: - 201: - description: "Created" - schema: - $ref: "#/definitions/SystemGroup" - security: - - x-api-key: [] - x-stoplight: - afterScript: null - beforeScript: null - id: "groups_system_post" - mock: - dynamic: false - enabled: false - statusCode: 200 - public: true - /systemgroups/{group_id}/associations: - get: - tags: - - "Graph" - - "System Groups" - - "System Group Associations" - summary: "List the associations of a System Group" - description: "This endpoint returns the _direct_ associations of a System Group.\n\ - \nA direct association can be a non-homogeneous relationship between 2 different\ - \ objects, for example System Groups and Users.\n\n\n#### Sample Request\n\ - ```\ncurl -X GET https://console.jumpcloud.com/api/v2/systemgroups/{GroupID}/associations?targets=user\ - \ \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\ - \ \\\n -H 'x-api-key: {API_KEY}'\n```" - operationId: "graph_systemGroupAssociationsList" - parameters: - - name: "group_id" - in: "path" - description: "ObjectID of the System Group." - required: true - type: "string" - x-exportParamName: "GroupId" - - name: "limit" - in: "query" - description: "The number of records to return at once. Limited to 100." - required: false - type: "integer" - default: 10 - x-exportParamName: "Limit" - - name: "Content-Type" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "ContentType" - - name: "Accept" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "Accept" - - name: "skip" - in: "query" - description: "The offset into the records to return." - required: false - type: "integer" - default: 0 - minimum: 0 - x-exportParamName: "Skip" - - name: "targets" - in: "query" - description: "" - required: true - type: "array" - items: - type: "string" - enum: - - "active_directory" - - "application" - - "command" - - "g_suite" - - "ldap_server" - - "office_365" - - "policy" - - "radius_server" - - "user" - - "user_group" - x-exportParamName: "Targets" - - name: "x-org-id" - in: "header" - description: "" - required: false - type: "string" - x-exportParamName: "XOrgId" - responses: - 200: - description: "OK" - schema: - type: "array" - items: - $ref: "#/definitions/GraphConnection" - security: - - x-api-key: [] - x-stoplight: - afterScript: null - beforeScript: null - id: "graph_systemGroupAssociationsList" - mock: - dynamic: false - enabled: false - statusCode: 200 - public: true - post: - tags: - - "Graph" - - "System Groups" - - "System Group Associations" - summary: "Manage the associations of a System Group" - description: "This endpoint allows you to manage the _direct_ associations of\ - \ a System Group.\n\nA direct association can be a non-homogeneous relationship\ - \ between 2 different objects, for example System Groups and Users.\n\n\n\ - #### Sample Request\n```\ncurl -X POST https://console.jumpcloud.com/api/v2/systemgroups/{GroupID}/associations\ - \ \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\ - \ \\\n -H 'x-api-key: {API_KEY}' \\\n -d '{\n \"op\": \"add\",\n \"\ - type\": \"user\",\n \"id\": \"{UserID}\"\n}'\n\n```" - operationId: "graph_systemGroupAssociationsPost" - parameters: - - name: "group_id" - in: "path" - description: "ObjectID of the System Group." - required: true - type: "string" - x-exportParamName: "GroupId" - - in: "body" - name: "body" - required: false - schema: - $ref: "#/definitions/SystemGroupGraphManagementReq" - x-exportParamName: "Body" - - name: "Content-Type" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "ContentType" - - name: "Accept" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "Accept" - - name: "x-org-id" - in: "header" - description: "" - required: false - type: "string" - x-exportParamName: "XOrgId" - responses: - 204: - description: "OK" - security: - - x-api-key: [] - x-stoplight: - afterScript: null - beforeScript: null - id: "graph_systemGroupAssociationsPost" - mock: - dynamic: false - enabled: false - statusCode: 200 - public: true - x-swagger-jumpcloud-auto-insert: true - /systemgroups/{group_id}/commands: - get: - tags: - - "Graph" - - "System Group Associations" - summary: "List the Commands bound to a System Group" - description: "This endpoint will return all Commands bound to a System Group,\ - \ either directly or indirectly, essentially traversing the JumpCloud Graph\ - \ for your Organization.\n\nEach element will contain the group's type, id,\ - \ attributes and paths.\n\nThe `attributes` object is a key/value hash of\ - \ compiled graph attributes for all paths followed.\n\nThe `paths` array enumerates\ - \ each path from this System Group to the corresponding Command; this array\ - \ represents all grouping and/or associations that would have to be removed\ - \ to deprovision the Command from this System Group.\n\nSee `/members` and\ - \ `/associations` endpoints to manage those collections.\n\n#### Sample Request\n\ - ```\ncurl -X GET https://console.jumpcloud.com/api/v2/systemgroups/{GroupID}/commands\ - \ \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\ - \ \\\n -H 'x-api-key: {API_KEY}'\n```" - operationId: "graph_systemGroupTraverseCommand" - parameters: - - name: "group_id" - in: "path" - description: "ObjectID of the System Group." - required: true - type: "string" - x-exportParamName: "GroupId" - - name: "limit" - in: "query" - description: "The number of records to return at once. Limited to 100." - required: false - type: "integer" - default: 10 - x-exportParamName: "Limit" - - name: "x-org-id" - in: "header" - description: "" - required: false - type: "string" - x-exportParamName: "XOrgId" - - name: "Content-Type" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "ContentType" - - name: "Accept" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "Accept" - - name: "skip" - in: "query" - description: "The offset into the records to return." - required: false - type: "integer" - default: 0 - minimum: 0 - x-exportParamName: "Skip" - - name: "filter" - in: "query" - description: "Supported operators are: eq, ne, gt, ge, lt, le, between, search,\ - \ in" - required: false - type: "array" - items: - type: "string" - x-exportParamName: "Filter" - responses: - 200: - description: "OK" - schema: - type: "array" - items: - $ref: "#/definitions/GraphObjectWithPaths" - security: - - x-api-key: [] - x-stoplight: - afterScript: null - beforeScript: null - id: "graph_systemGroupTraverseCommand" - mock: - dynamic: false - enabled: false - statusCode: 200 - public: true - /systemgroups/{group_id}/memberof: - get: - tags: - - "Graph" - - "System Groups" - - "System Group Members & Membership" - summary: "List the System Group's parents" - description: "This endpoint returns all System Groups a System Group is a member\ - \ of.\n\nThis endpoint is not yet public as we haven't completed the code\ - \ yet." - operationId: "graph_systemGroupMemberOf" - parameters: - - name: "group_id" - in: "path" - description: "ObjectID of the System Group." - required: true - type: "string" - x-exportParamName: "GroupId" - - name: "filter" - in: "query" - description: "Supported operators are: eq, ne, gt, ge, lt, le, between, search,\ - \ in" - required: false - type: "array" - items: - type: "string" - x-exportParamName: "Filter" - - name: "limit" - in: "query" - description: "The number of records to return at once. Limited to 100." - required: false - type: "integer" - default: 10 - x-exportParamName: "Limit" - - name: "Content-Type" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "ContentType" - - name: "Accept" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "Accept" - - name: "skip" - in: "query" - description: "The offset into the records to return." - required: false - type: "integer" - default: 0 - minimum: 0 - x-exportParamName: "Skip" - - name: "sort" - in: "query" - description: "The comma separated fields used to sort the collection.\nDefault\ - \ sort is ascending, prefix with `-` to sort descending.\n" - required: false - type: "array" - items: - type: "string" - x-exportParamName: "Sort" - - name: "x-org-id" - in: "header" - description: "" - required: false - type: "string" - x-exportParamName: "XOrgId" - responses: - 200: - description: "OK" - schema: - type: "array" - items: - $ref: "#/definitions/GraphObjectWithPaths" - security: - - x-api-key: [] - x-stoplight: - afterScript: null - beforeScript: null - id: "graph_systemGroupMemberOf" - mock: - dynamic: false - enabled: false - statusCode: 200 - public: false - /systemgroups/{group_id}/members: - get: - tags: - - "Graph" - - "System Groups" - - "System Group Members & Membership" - summary: "List the members of a System Group" - description: "This endpoint returns the system members of a System Group.\n\n\ - #### Sample Request\n```\ncurl -X GET https://console.jumpcloud.com/api/v2/systemgroups/{Group_ID}/members\ - \ \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\ - \ \\\n -H 'x-api-key: {API_KEY}'\n\n```" - operationId: "graph_systemGroupMembersList" - parameters: - - name: "group_id" - in: "path" - description: "ObjectID of the System Group." - required: true - type: "string" - x-exportParamName: "GroupId" - - name: "limit" - in: "query" - description: "The number of records to return at once. Limited to 100." - required: false - type: "integer" - default: 10 - x-exportParamName: "Limit" - - name: "Content-Type" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "ContentType" - - name: "Accept" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "Accept" - - name: "skip" - in: "query" - description: "The offset into the records to return." - required: false - type: "integer" - default: 0 - minimum: 0 - x-exportParamName: "Skip" - - name: "x-org-id" - in: "header" - description: "" - required: false - type: "string" - x-exportParamName: "XOrgId" - responses: - 200: - description: "OK" - schema: - type: "array" - items: - $ref: "#/definitions/GraphConnection" - security: - - x-api-key: [] - x-stoplight: - afterScript: null - beforeScript: null - id: "graph_systemGroupMembersList" - mock: - dynamic: false - enabled: false - statusCode: 200 - public: true - post: - tags: - - "Graph" - - "System Groups" - - "System Group Members & Membership" - summary: "Manage the members of a System Group" - description: "This endpoint allows you to manage the system members of a System\ - \ Group.\n\n#### Sample Request\n```\ncurl -X POST https://console.jumpcloud.com/api/v2/systemgroups/{Group_ID}/members\ - \ \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\ - \ \\\n -H 'x-api-key: {API_KEY}' \\\n -d '{\n \"op\": \"add\",\n \"\ - type\": \"system\",\n \"id\": \"{System_ID}\"\n}'\n```" - operationId: "graph_systemGroupMembersPost" - parameters: - - name: "group_id" - in: "path" - description: "ObjectID of the System Group." - required: true - type: "string" - x-exportParamName: "GroupId" - - in: "body" - name: "body" - required: false - schema: - $ref: "#/definitions/SystemGroupMembersReq" - x-exportParamName: "Body" - - name: "Content-Type" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "ContentType" - - name: "Accept" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "Accept" - - name: "Date" - in: "header" - description: "Current date header for the System Context API" - required: false - type: "string" - x-exportParamName: "Date" - - name: "Authorization" - in: "header" - description: "Authorization header for the System Context API" - required: false - type: "string" - x-exportParamName: "Authorization" - - name: "x-org-id" - in: "header" - description: "" - required: false - type: "string" - x-exportParamName: "XOrgId" - responses: - 204: - description: "OK" - security: - - x-api-key: [] - x-stoplight: - afterScript: null - beforeScript: null - id: "graph_systemGroupMembersPost" - mock: - dynamic: false - enabled: false - statusCode: 200 - public: true - x-swagger-jumpcloud-auto-insert: true - /systemgroups/{group_id}/membership: - get: - tags: - - "Graph" - - "System Groups" - - "System Group Members & Membership" - summary: "List the System Group's membership" - description: "This endpoint returns all Systems that are a member of this System\ - \ Group.\n\n#### Sample Request\n```\ncurl -X GET https://console.jumpcloud.com/api/v2/systemgroups/{Group_ID/membership\ - \ \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\ - \ \\\n -H 'x-api-key: {API_KEY}'\n\n```" - operationId: "graph_systemGroupMembership" - parameters: - - name: "group_id" - in: "path" - description: "ObjectID of the System Group." - required: true - type: "string" - x-exportParamName: "GroupId" - - name: "limit" - in: "query" - description: "The number of records to return at once. Limited to 100." - required: false - type: "integer" - default: 10 - x-exportParamName: "Limit" - - name: "Content-Type" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "ContentType" - - name: "Accept" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "Accept" - - name: "skip" - in: "query" - description: "The offset into the records to return." - required: false - type: "integer" - default: 0 - minimum: 0 - x-exportParamName: "Skip" - - name: "sort" - in: "query" - description: "The comma separated fields used to sort the collection.\nDefault\ - \ sort is ascending, prefix with `-` to sort descending.\n" - required: false - type: "array" - items: - type: "string" - x-exportParamName: "Sort" - - name: "filter" - in: "query" - description: "Supported operators are: eq, ne, gt, ge, lt, le, between, search,\ - \ in" - required: false - type: "array" - items: - type: "string" - x-exportParamName: "Filter" - - name: "x-org-id" - in: "header" - description: "" - required: false - type: "string" - x-exportParamName: "XOrgId" - responses: - 200: - description: "OK" - schema: - type: "array" - items: - $ref: "#/definitions/GraphObjectWithPaths" - security: - - x-api-key: [] - x-stoplight: - afterScript: null - beforeScript: null - id: "graph_systemGroupMembership" - mock: - dynamic: false - enabled: false - statusCode: 200 - public: true - /systemgroups/{group_id}/policies: - get: - tags: - - "Graph" - - "System Groups" - - "System Group Associations" - summary: "List the Policies bound to a System Group" - description: "This endpoint will return all Policies bound to a System Group,\ - \ either directly or indirectly, essentially traversing the JumpCloud Graph\ - \ for your Organization.\n\nEach element will contain the type, id, attributes\ - \ and paths.\n\nThe `attributes` object is a key/value hash of compiled graph\ - \ attributes for all paths followed.\n\nThe `paths` array enumerates each\ - \ path from this System Group to the corresponding Policy; this array represents\ - \ all grouping and/or associations that would have to be removed to deprovision\ - \ the Policy from this System Group.\n\nSee `/members` and `/associations`\ - \ endpoints to manage those collections.\n\nThis endpoint is not public yet\ - \ as we haven't finished the code.\n\n##### Sample Request\n```\ncurl -X GET\ - \ https://console.jumpcloud.com/api/v2/systemgroups/{GroupID}/policies \\\n\ - \ -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\ - \ \\\n -H 'x-api-key: {API_KEY}'\n```" - operationId: "graph_systemGroupTraversePolicy" - parameters: - - name: "group_id" - in: "path" - description: "ObjectID of the System Group." - required: true - type: "string" - x-exportParamName: "GroupId" - - name: "limit" - in: "query" - description: "The number of records to return at once. Limited to 100." - required: false - type: "integer" - default: 10 - x-exportParamName: "Limit" - - name: "x-org-id" - in: "header" - description: "" - required: false - type: "string" - x-exportParamName: "XOrgId" - - name: "Content-Type" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "ContentType" - - name: "Accept" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "Accept" - - name: "skip" - in: "query" - description: "The offset into the records to return." - required: false - type: "integer" - default: 0 - minimum: 0 - x-exportParamName: "Skip" - - name: "filter" - in: "query" - description: "Supported operators are: eq, ne, gt, ge, lt, le, between, search,\ - \ in" - required: false - type: "array" - items: - type: "string" - x-exportParamName: "Filter" - responses: - 200: - description: "OK" - schema: - type: "array" - items: - $ref: "#/definitions/GraphObjectWithPaths" - security: - - x-api-key: [] - x-stoplight: - afterScript: null - beforeScript: null - id: "graph_systemGroupTraversePolicy" - mock: - dynamic: false - enabled: false - statusCode: 200 - public: true - /systemgroups/{group_id}/usergroups: - get: - tags: - - "Graph" - - "System Groups" - - "System Group Associations" - summary: "List the User Groups bound to a System Group" - description: "This endpoint will return all User Groups bound to a System Group,\ - \ either directly or indirectly, essentially traversing the JumpCloud Graph\ - \ for your Organization.\n\nEach element will contain the type, id, attributes\ - \ and paths.\n\nThe `attributes` object is a key/value hash of compiled graph\ - \ attributes for all paths followed.\n\nThe `paths` array enumerates each\ - \ path from this System Group to the corresponding User Group; this array\ - \ represents all grouping and/or associations that would have to be removed\ - \ to deprovision the User Group from this System Group.\n\nSee `/members`\ - \ and `/associations` endpoints to manage those collections.\n\n#### Sample\ - \ Request\n```\ncurl -X GET https://console.jumpcloud.com/api/v2/systemgroups/{GroupID}/usergroups\ - \ \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\ - \ \\\n -H 'x-api-key: {API_KEY}'\n\n```" - operationId: "graph_systemGroupTraverseUserGroup" - parameters: - - name: "group_id" - in: "path" - description: "ObjectID of the System Group." - required: true - type: "string" - x-exportParamName: "GroupId" - - name: "limit" - in: "query" - description: "The number of records to return at once. Limited to 100." - required: false - type: "integer" - default: 10 - x-exportParamName: "Limit" - - name: "x-org-id" - in: "header" - description: "" - required: false - type: "string" - x-exportParamName: "XOrgId" - - name: "Content-Type" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "ContentType" - - name: "Accept" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "Accept" - - name: "skip" - in: "query" - description: "The offset into the records to return." - required: false - type: "integer" - default: 0 - minimum: 0 - x-exportParamName: "Skip" - - name: "filter" - in: "query" - description: "Supported operators are: eq, ne, gt, ge, lt, le, between, search,\ - \ in" - required: false - type: "array" - items: - type: "string" - x-exportParamName: "Filter" - responses: - 200: - description: "OK" - schema: - type: "array" - items: - $ref: "#/definitions/GraphObjectWithPaths" - security: - - x-api-key: [] - x-stoplight: - afterScript: null - beforeScript: null - id: "graph_systemGroupTraverseUserGroup" - mock: - dynamic: false - enabled: false - statusCode: 200 - public: true - /systemgroups/{group_id}/users: - get: - tags: - - "Graph" - - "System Groups" - - "System Group Associations" - summary: "List the Users bound to a System Group" - description: "This endpoint will return all Users bound to a System Group, either\ - \ directly or indirectly, essentially traversing the JumpCloud Graph for your\ - \ Organization.\n\nEach element will contain the type, id, attributes and\ - \ paths.\n\nThe `attributes` object is a key/value hash of compiled graph\ - \ attributes for all paths followed.\n\nThe `paths` array enumerates each\ - \ path from this System Group to the corresponding User; this array represents\ - \ all grouping and/or associations that would have to be removed to deprovision\ - \ the User from this System Group.\n\nSee `/members` and `/associations` endpoints\ - \ to manage those collections.\n\n#### Sample Request\n```\ncurl -X GET https://console.jumpcloud.com/api/v2/systemgroups/{GroupID}/users\ - \ \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\ - \ \\\n -H 'x-api-key: {API_KEY}'\n```" - operationId: "graph_systemGroupTraverseUser" - parameters: - - name: "group_id" - in: "path" - description: "ObjectID of the System Group." - required: true - type: "string" - x-exportParamName: "GroupId" - - name: "limit" - in: "query" - description: "The number of records to return at once. Limited to 100." - required: false - type: "integer" - default: 10 - x-exportParamName: "Limit" - - name: "x-org-id" - in: "header" - description: "" - required: false - type: "string" - x-exportParamName: "XOrgId" - - name: "Content-Type" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "ContentType" - - name: "Accept" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "Accept" - - name: "skip" - in: "query" - description: "The offset into the records to return." - required: false - type: "integer" - default: 0 - minimum: 0 - x-exportParamName: "Skip" - - name: "filter" - in: "query" - description: "Supported operators are: eq, ne, gt, ge, lt, le, between, search,\ - \ in" - required: false - type: "array" - items: - type: "string" - x-exportParamName: "Filter" - responses: - 200: - description: "OK" - schema: - type: "array" - items: - $ref: "#/definitions/GraphObjectWithPaths" - security: - - x-api-key: [] - x-stoplight: - afterScript: null - beforeScript: null - id: "graph_systemGroupTraverseUser" - mock: - dynamic: false - enabled: false - statusCode: 200 - public: true - /systemgroups/{id}: - get: - tags: - - "System Groups" - summary: "View an individual System Group details" - description: "This endpoint returns the details of a System Group.\n\n#### Sample\ - \ Request\n```\ncurl -X GET https://console.jumpcloud.com/api/v2/systemgroups/{Group_ID}\ - \ \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\ - \ \\\n -H 'x-api-key: {API_KEY}'\n```" - operationId: "groups_system_get" - parameters: - - name: "id" - in: "path" - description: "ObjectID of the System Group." - required: true - type: "string" - x-exportParamName: "Id" - - name: "Content-Type" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "ContentType" - - name: "Accept" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "Accept" - - name: "x-org-id" - in: "header" - description: "" - required: false - type: "string" - x-exportParamName: "XOrgId" - responses: - 200: - description: "OK" - schema: - $ref: "#/definitions/SystemGroup" - examples: - application/json: - id: "000000" - name: "group1" - type: "system_group" - security: - - x-api-key: [] - x-stoplight: - afterScript: null - beforeScript: null - id: "groups_system_get" - mock: - dynamic: false - enabled: false - statusCode: 200 - public: true - put: - tags: - - "System Groups" - summary: "Update a System Group" - description: "This endpoint allows you to do a full update of the System Group.\n\ - \n#### Sample Request\n```\ncurl -X PUT https://console.jumpcloud.com/api/v2/systemgroups/{Group_ID}\ - \ \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\ - \ \\\n -H 'x-api-key: {API_KEY}' \\\n -d '{\n \"name\": \"Name_Update\"\n\ - }'\n```" - operationId: "groups_system_put" - parameters: - - name: "id" - in: "path" - description: "ObjectID of the System Group." - required: true - type: "string" - x-exportParamName: "Id" - - in: "body" - name: "body" - required: false - schema: - $ref: "#/definitions/SystemGroupData" - x-exportParamName: "Body" - - name: "Content-Type" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "ContentType" - - name: "Accept" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "Accept" - - name: "x-org-id" - in: "header" - description: "" - required: false - type: "string" - x-exportParamName: "XOrgId" - responses: - 200: - description: "OK" - schema: - $ref: "#/definitions/SystemGroup" - examples: - application/json: - id: "00000" - name: "group1" - type: "system_group" - security: - - x-api-key: [] - x-stoplight: - afterScript: null - beforeScript: null - id: "groups_system_put" - mock: - dynamic: false - enabled: false - statusCode: 200 - public: true - delete: - tags: - - "System Groups" - summary: "Delete a System Group" - description: "This endpoint allows you to delete a System Group.\n\n#### Sample\ - \ Request\n```\ncurl -X DELETE https://console.jumpcloud.com/api/v2/systemgroups/{Group_ID}\ - \ \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\ - \ \\\n -H 'x-api-key: {API_KEY}'\n\n```" - operationId: "groups_system_delete" - parameters: - - name: "id" - in: "path" - description: "ObjectID of the System Group." - required: true - type: "string" - x-exportParamName: "Id" - - name: "Content-Type" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "ContentType" - - name: "Accept" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "Accept" - - name: "x-org-id" - in: "header" - description: "" - required: false - type: "string" - x-exportParamName: "XOrgId" - responses: - 204: - description: "No Content" - security: - - x-api-key: [] - x-stoplight: - afterScript: null - beforeScript: null - id: "groups_system_delete" - mock: - dynamic: false - enabled: false - statusCode: 200 - public: true - patch: - tags: - - "System Groups" - summary: "Partial update a System Group" - description: "We have hidden PATCH on the systemgroups and usergroups for now;\ - \ we don't have that implemented correctly yet, people should use PUT until\ - \ we do a true PATCH operation.\n\n#### Sample Request\n```\nhttps://console.jumpcloud.com/api/v2/systemgroups/{id}\n\ - ```" - operationId: "groups_system_patch" - parameters: - - name: "id" - in: "path" - description: "ObjectID of the System Group." - required: true - type: "string" - x-exportParamName: "Id" - - in: "body" - name: "body" - required: false - schema: - $ref: "#/definitions/SystemGroupData" - x-exportParamName: "Body" - - name: "Content-Type" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "ContentType" - - name: "Accept" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "Accept" - - name: "x-org-id" - in: "header" - description: "" - required: false - type: "string" - x-exportParamName: "XOrgId" - responses: - 200: - description: "OK" - schema: - $ref: "#/definitions/SystemGroup" - examples: - application/json: - id: "00000" - name: "group1" - type: "system_group" - security: - - x-api-key: [] - x-stoplight: - afterScript: null - beforeScript: null - id: "groups_system_patch" - mock: - dynamic: false - enabled: false - statusCode: 200 - public: false - /systeminsights/apps: - get: - tags: - - "System Insights" - summary: "List System Insights Apps" - description: "Valid filter fields are `system_id` and `bundle_name`." - operationId: "systeminsights_list_apps" - parameters: - - name: "limit" - in: "query" - required: false - type: "integer" - default: 10 - maximum: 100 - minimum: 0 - x-exportParamName: "Limit" - - name: "x-org-id" - in: "header" - description: "" - required: false - type: "string" - x-exportParamName: "XOrgId" - - name: "skip" - in: "query" - description: "The offset into the records to return." - required: false - type: "integer" - default: 0 - minimum: 0 - x-exportParamName: "Skip" - - name: "filter" - in: "query" - description: "Supported operators are: eq" - required: false - type: "array" - items: - type: "string" - x-exportParamName: "Filter" - - name: "Content-Type" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "ContentType" - - name: "Accept" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "Accept" - responses: - 200: - description: "" - schema: - type: "array" - items: - $ref: "#/definitions/system-insights-apps" - security: - - x-api-key: [] - x-stoplight: - afterScript: null - beforeScript: null - id: "systeminsights_list_apps" - mock: - dynamic: false - enabled: false - statusCode: 200 - public: true - /systeminsights/battery: - get: - tags: - - "System Insights" - summary: "List System Insights Battery" - description: "Valid filter fields are `system_id` and `health`." - operationId: "systeminsights_list_battery" - parameters: - - name: "limit" - in: "query" - required: false - type: "integer" - default: 10 - maximum: 100 - minimum: 0 - x-exportParamName: "Limit" - - name: "x-org-id" - in: "header" - description: "" - required: false - type: "string" - x-exportParamName: "XOrgId" - - name: "Content-Type" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "ContentType" - - name: "Accept" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "Accept" - - name: "skip" - in: "query" - description: "The offset into the records to return." - required: false - type: "integer" - default: 0 - minimum: 0 - x-exportParamName: "Skip" - - name: "filter" - in: "query" - description: "Supported operators are: eq" - required: false - type: "array" - items: - type: "string" - x-exportParamName: "Filter" - responses: - 200: - description: "" - schema: - type: "array" - items: - $ref: "#/definitions/system-insights-battery" - security: - - x-api-key: [] - x-stoplight: - afterScript: null - beforeScript: null - id: "systeminsights_list_battery" - mock: - dynamic: false - enabled: false - statusCode: 200 - public: false - /systeminsights/bitlocker_info: - get: - tags: - - "System Insights" - summary: "List System Insights Bitlocker Info" - description: "Valid filter fields are `system_id` and `protection_status`." - operationId: "systeminsights_list_bitlocker_info" - parameters: - - name: "limit" - in: "query" - required: false - type: "integer" - default: 10 - maximum: 100 - minimum: 0 - x-exportParamName: "Limit" - - name: "skip" - in: "query" - description: "The offset into the records to return." - required: false - type: "integer" - default: 0 - minimum: 0 - x-exportParamName: "Skip" - - name: "filter" - in: "query" - description: "Supported operators are: eq" - required: false - type: "array" - items: - type: "string" - x-exportParamName: "Filter" - - name: "x-org-id" - in: "header" - description: "" - required: false - type: "string" - x-exportParamName: "XOrgId" - - name: "Content-Type" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "ContentType" - - name: "Accept" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "Accept" - responses: - 200: - description: "" - schema: - type: "array" - items: - $ref: "#/definitions/system-insights-bitlocker-info" - security: - - x-api-key: [] - x-stoplight: - afterScript: null - beforeScript: null - id: "systeminsights_list_bitlocker_info" - mock: - dynamic: false - enabled: false - statusCode: 200 - public: true - /systeminsights/browser_plugins: - get: - tags: - - "System Insights" - summary: "List System Insights Browser Plugins" - description: "Valid filter fields are `system_id` and `name`." - operationId: "systeminsights_list_browser_plugins" - parameters: - - name: "limit" - in: "query" - required: false - type: "integer" - default: 10 - maximum: 100 - minimum: 0 - x-exportParamName: "Limit" - - name: "skip" - in: "query" - description: "The offset into the records to return." - required: false - type: "integer" - default: 0 - minimum: 0 - x-exportParamName: "Skip" - - name: "filter" - in: "query" - description: "Supported operators are: eq" - required: false - type: "array" - items: - type: "string" - x-exportParamName: "Filter" - - name: "x-org-id" - in: "header" - description: "" - required: false - type: "string" - x-exportParamName: "XOrgId" - - name: "Content-Type" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "ContentType" - - name: "Accept" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "Accept" - responses: - 200: - description: "" - schema: - type: "array" - items: - $ref: "#/definitions/system-insights-browser-plugins" - security: - - x-api-key: [] - x-stoplight: - afterScript: null - beforeScript: null - id: "systeminsights_list_browser_plugins" - mock: - dynamic: false - enabled: false - statusCode: 200 - public: true - /systeminsights/chrome_extensions: - get: - tags: - - "System Insights" - summary: "List System Insights Chrome Extensions" - description: "Valid filter fields are `system_id` and `name`." - operationId: "systeminsights_list_chrome_extensions" - parameters: - - name: "limit" - in: "query" - required: false - type: "integer" - default: 10 - maximum: 100 - minimum: 0 - x-exportParamName: "Limit" - - name: "skip" - in: "query" - description: "The offset into the records to return." - required: false - type: "integer" - default: 0 - minimum: 0 - x-exportParamName: "Skip" - - name: "filter" - in: "query" - description: "Supported operators are: eq" - required: false - type: "array" - items: - type: "string" - x-exportParamName: "Filter" - - name: "x-org-id" - in: "header" - description: "" - required: false - type: "string" - x-exportParamName: "XOrgId" - - name: "Content-Type" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "ContentType" - - name: "Accept" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "Accept" - responses: - 200: - description: "" - schema: - type: "array" - items: - $ref: "#/definitions/system-insights-chrome-extensions" - security: - - x-api-key: [] - x-stoplight: - afterScript: null - beforeScript: null - id: "systeminsights_list_chrome_extensions" - mock: - dynamic: false - enabled: false - statusCode: 200 - public: true - /systeminsights/crashes: - get: - tags: - - "System Insights" - summary: "List System Insights Crashes" - description: "Valid filter fields are `system_id` and `identifier`." - operationId: "systeminsights_list_crashes" - parameters: - - name: "limit" - in: "query" - required: false - type: "integer" - default: 10 - maximum: 100 - minimum: 0 - x-exportParamName: "Limit" - - name: "x-org-id" - in: "header" - description: "" - required: false - type: "string" - x-exportParamName: "XOrgId" - - name: "Content-Type" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "ContentType" - - name: "Accept" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "Accept" - - name: "skip" - in: "query" - description: "The offset into the records to return." - required: false - type: "integer" - default: 0 - minimum: 0 - x-exportParamName: "Skip" - - name: "filter" - in: "query" - description: "Supported operators are: eq" - required: false - type: "array" - items: - type: "string" - x-exportParamName: "Filter" - responses: - 200: - description: "" - schema: - type: "array" - items: - $ref: "#/definitions/system-insights-crashes" - security: - - x-api-key: [] - x-stoplight: - afterScript: null - beforeScript: null - id: "systeminsights_list_crashes" - mock: - dynamic: false - enabled: false - statusCode: 200 - public: false - /systeminsights/disk_encryption: - get: - tags: - - "System Insights" - summary: "List System Insights Disk Encryption" - description: "Valid filter fields are `system_id` and `encryption_status`." - operationId: "systeminsights_list_disk_encryption" - parameters: - - name: "limit" - in: "query" - required: false - type: "integer" - default: 10 - maximum: 100 - minimum: 0 - x-exportParamName: "Limit" - - name: "skip" - in: "query" - description: "The offset into the records to return." - required: false - type: "integer" - default: 0 - minimum: 0 - x-exportParamName: "Skip" - - name: "filter" - in: "query" - description: "Supported operators are: eq" - required: false - type: "array" - items: - type: "string" - x-exportParamName: "Filter" - - name: "x-org-id" - in: "header" - description: "" - required: false - type: "string" - x-exportParamName: "XOrgId" - - name: "Content-Type" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "ContentType" - - name: "Accept" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "Accept" - responses: - 200: - description: "" - schema: - type: "array" - items: - $ref: "#/definitions/system-insights-disk-encryption" - security: - - x-api-key: [] - x-stoplight: - afterScript: null - beforeScript: null - id: "systeminsights_list_disk_encryption" - mock: - dynamic: false - enabled: false - statusCode: 200 - public: true - /systeminsights/disk_info: - get: - tags: - - "System Insights" - summary: "List System Insights Disk Info" - description: "Valid filter fields are `system_id` and `disk_index`." - operationId: "systeminsights_list_disk_info" - parameters: - - name: "limit" - in: "query" - required: false - type: "integer" - default: 10 - maximum: 100 - minimum: 0 - x-exportParamName: "Limit" - - name: "skip" - in: "query" - description: "The offset into the records to return." - required: false - type: "integer" - default: 0 - minimum: 0 - x-exportParamName: "Skip" - - name: "filter" - in: "query" - description: "Supported operators are: eq" - required: false - type: "array" - items: - type: "string" - x-exportParamName: "Filter" - - name: "x-org-id" - in: "header" - description: "" - required: false - type: "string" - x-exportParamName: "XOrgId" - - name: "Content-Type" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "ContentType" - - name: "Accept" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "Accept" - responses: - 200: - description: "" - schema: - type: "array" - items: - $ref: "#/definitions/system-insights-disk-info" - security: - - x-api-key: [] - x-stoplight: - afterScript: null - beforeScript: null - id: "systeminsights_list_disk_info" - mock: - dynamic: false - enabled: false - statusCode: 200 - public: true - /systeminsights/etc_hosts: - get: - tags: - - "System Insights" - summary: "List System Insights Etc Hosts" - description: "Valid filter fields are `system_id` and `address`." - operationId: "systeminsights_list_etc_hosts" - parameters: - - name: "limit" - in: "query" - required: false - type: "integer" - default: 10 - maximum: 100 - minimum: 0 - x-exportParamName: "Limit" - - name: "skip" - in: "query" - description: "The offset into the records to return." - required: false - type: "integer" - default: 0 - minimum: 0 - x-exportParamName: "Skip" - - name: "filter" - in: "query" - description: "Supported operators are: eq" - required: false - type: "array" - items: - type: "string" - x-exportParamName: "Filter" - - name: "x-org-id" - in: "header" - description: "" - required: false - type: "string" - x-exportParamName: "XOrgId" - - name: "Content-Type" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "ContentType" - - name: "Accept" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "Accept" - responses: - 200: - description: "" - schema: - type: "array" - items: - $ref: "#/definitions/system-insights-etc-hosts" - security: - - x-api-key: [] - x-stoplight: - afterScript: null - beforeScript: null - id: "systeminsights_list_etc_hosts" - mock: - dynamic: false - enabled: false - statusCode: 200 - public: true - /systeminsights/firefox_addons: - get: - tags: - - "System Insights" - summary: "List System Insights Firefox Addons" - description: "Valid filter fields are `system_id` and `name`." - operationId: "systeminsights_list_firefox_addons" - parameters: - - name: "limit" - in: "query" - required: false - type: "integer" - default: 10 - maximum: 100 - minimum: 0 - x-exportParamName: "Limit" - - name: "skip" - in: "query" - description: "The offset into the records to return." - required: false - type: "integer" - default: 0 - minimum: 0 - x-exportParamName: "Skip" - - name: "filter" - in: "query" - description: "Supported operators are: eq" - required: false - type: "array" - items: - type: "string" - x-exportParamName: "Filter" - - name: "x-org-id" - in: "header" - description: "" - required: false - type: "string" - x-exportParamName: "XOrgId" - - name: "Content-Type" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "ContentType" - - name: "Accept" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "Accept" - responses: - 200: - description: "" - schema: - type: "array" - items: - $ref: "#/definitions/system-insights-firefox-addons" - security: - - x-api-key: [] - x-stoplight: - afterScript: null - beforeScript: null - id: "systeminsights_list_firefox_addons" - mock: - dynamic: false - enabled: false - statusCode: 200 - public: true - /systeminsights/groups: - get: - tags: - - "System Insights" - summary: "List System Insights Groups" - description: "Valid filter fields are `system_id` and `groupname`." - operationId: "systeminsights_list_groups" - parameters: - - name: "limit" - in: "query" - required: false - type: "integer" - default: 10 - maximum: 100 - minimum: 0 - x-exportParamName: "Limit" - - name: "skip" - in: "query" - description: "The offset into the records to return." - required: false - type: "integer" - default: 0 - minimum: 0 - x-exportParamName: "Skip" - - name: "filter" - in: "query" - description: "Supported operators are: eq" - required: false - type: "array" - items: - type: "string" - x-exportParamName: "Filter" - - name: "x-org-id" - in: "header" - description: "" - required: false - type: "string" - x-exportParamName: "XOrgId" - - name: "Content-Type" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "ContentType" - - name: "Accept" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "Accept" - responses: - 200: - description: "" - schema: - type: "array" - items: - $ref: "#/definitions/system-insights-groups" - security: - - x-api-key: [] - x-stoplight: - afterScript: null - beforeScript: null - id: "systeminsights_list_groups" - mock: - dynamic: false - enabled: false - statusCode: 200 - public: true - /systeminsights/ie_extensions: - get: - tags: - - "System Insights" - summary: "List System Insights IE Extensions" - description: "Valid filter fields are `system_id` and `name`." - operationId: "systeminsights_list_ie_extensions" - parameters: - - name: "limit" - in: "query" - required: false - type: "integer" - default: 10 - maximum: 100 - minimum: 0 - x-exportParamName: "Limit" - - name: "x-org-id" - in: "header" - description: "" - required: false - type: "string" - x-exportParamName: "XOrgId" - - name: "Content-Type" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "ContentType" - - name: "Accept" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "Accept" - - name: "skip" - in: "query" - description: "The offset into the records to return." - required: false - type: "integer" - default: 0 - minimum: 0 - x-exportParamName: "Skip" - - name: "filter" - in: "query" - description: "Supported operators are: eq" - required: false - type: "array" - items: - type: "string" - x-exportParamName: "Filter" - responses: - 200: - description: "" - schema: - type: "array" - items: - $ref: "#/definitions/system-insights-ie-extensions" - security: - - x-api-key: [] - x-stoplight: - afterScript: null - beforeScript: null - id: "systeminsights_list_ie_extensions" - mock: - dynamic: false - enabled: false - statusCode: 200 - public: false - /systeminsights/interface_addresses: - get: - tags: - - "System Insights" - summary: "List System Insights Interface Addresses" - description: "Valid filter fields are `system_id` and `address`." - operationId: "systeminsights_list_interface_addresses" - parameters: - - name: "limit" - in: "query" - required: false - type: "integer" - default: 10 - maximum: 100 - minimum: 0 - x-exportParamName: "Limit" - - name: "skip" - in: "query" - description: "The offset into the records to return." - required: false - type: "integer" - default: 0 - minimum: 0 - x-exportParamName: "Skip" - - name: "filter" - in: "query" - description: "Supported operators are: eq" - required: false - type: "array" - items: - type: "string" - x-exportParamName: "Filter" - - name: "x-org-id" - in: "header" - description: "" - required: false - type: "string" - x-exportParamName: "XOrgId" - - name: "Content-Type" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "ContentType" - - name: "Accept" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "Accept" - responses: - 200: - description: "" - schema: - type: "array" - items: - $ref: "#/definitions/system-insights-interface-addresses" - security: - - x-api-key: [] - x-stoplight: - afterScript: null - beforeScript: null - id: "systeminsights_list_interface_addresses" - mock: - dynamic: false - enabled: false - statusCode: 200 - public: true - /systeminsights/kernel_info: - get: - tags: - - "System Insights" - summary: "List System Insights Kernel Info" - description: "Valid filter fields are `system_id` and `version`." - operationId: "systeminsights_list_kernel_info" - parameters: - - name: "limit" - in: "query" - required: false - type: "integer" - default: 10 - maximum: 100 - minimum: 0 - x-exportParamName: "Limit" - - name: "skip" - in: "query" - description: "The offset into the records to return." - required: false - type: "integer" - default: 0 - minimum: 0 - x-exportParamName: "Skip" - - name: "filter" - in: "query" - description: "Supported operators are: eq" - required: false - type: "array" - items: - type: "string" - x-exportParamName: "Filter" - - name: "x-org-id" - in: "header" - description: "" - required: false - type: "string" - x-exportParamName: "XOrgId" - - name: "Content-Type" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "ContentType" - - name: "Accept" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "Accept" - responses: - 200: - description: "" - schema: - type: "array" - items: - $ref: "#/definitions/system-insights-kernel-info" - security: - - x-api-key: [] - x-stoplight: - afterScript: null - beforeScript: null - id: "systeminsights_list_kernel_info" - mock: - dynamic: false - enabled: false - statusCode: 200 - public: true - /systeminsights/launchd: - get: - tags: - - "System Insights" - summary: "List System Insights Launchd" - description: "Valid filter fields are `system_id` and `name`." - operationId: "systeminsights_list_launchd" - parameters: - - name: "limit" - in: "query" - required: false - type: "integer" - default: 10 - maximum: 100 - minimum: 0 - x-exportParamName: "Limit" - - name: "x-org-id" - in: "header" - description: "" - required: false - type: "string" - x-exportParamName: "XOrgId" - - name: "Content-Type" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "ContentType" - - name: "Accept" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "Accept" - - name: "skip" - in: "query" - description: "The offset into the records to return." - required: false - type: "integer" - default: 0 - minimum: 0 - x-exportParamName: "Skip" - - name: "filter" - in: "query" - description: "Supported operators are: eq" - required: false - type: "array" - items: - type: "string" - x-exportParamName: "Filter" - responses: - 200: - description: "" - schema: - type: "array" - items: - $ref: "#/definitions/system-insights-launchd" - security: - - x-api-key: [] - x-stoplight: - afterScript: null - beforeScript: null - id: "systeminsights_list_launchd" - mock: - dynamic: false - enabled: false - statusCode: 200 - public: false - /systeminsights/logged_in_users: - get: - tags: - - "System Insights" - summary: "List System Insights Logged-In Users" - description: "Valid filter fields are `system_id` and `user`." - operationId: "systeminsights_list_logged_in_users" - parameters: - - name: "limit" - in: "query" - required: false - type: "integer" - default: 10 - maximum: 100 - minimum: 0 - x-exportParamName: "Limit" - - name: "x-org-id" - in: "header" - description: "" - required: false - type: "string" - x-exportParamName: "XOrgId" - - name: "Content-Type" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "ContentType" - - name: "Accept" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "Accept" - - name: "skip" - in: "query" - description: "The offset into the records to return." - required: false - type: "integer" - default: 0 - minimum: 0 - x-exportParamName: "Skip" - - name: "filter" - in: "query" - description: "Supported operators are: eq" - required: false - type: "array" - items: - type: "string" - x-exportParamName: "Filter" - responses: - 200: - description: "" - schema: - type: "array" - items: - $ref: "#/definitions/system-insights-logged-in-users" - security: - - x-api-key: [] - x-stoplight: - afterScript: null - beforeScript: null - id: "systeminsights_list_logged_in_users" - mock: - dynamic: false - enabled: false - statusCode: 200 - public: false - /systeminsights/logical_drives: - get: - tags: - - "System Insights" - summary: "List System Insights Logical Drives" - description: "Valid filter fields are `system_id` and `device_id`." - operationId: "systeminsights_list_logical_drives" - parameters: - - name: "limit" - in: "query" - required: false - type: "integer" - default: 10 - maximum: 100 - minimum: 0 - x-exportParamName: "Limit" - - name: "skip" - in: "query" - description: "The offset into the records to return." - required: false - type: "integer" - default: 0 - minimum: 0 - x-exportParamName: "Skip" - - name: "filter" - in: "query" - description: "Supported operators are: eq" - required: false - type: "array" - items: - type: "string" - x-exportParamName: "Filter" - - name: "x-org-id" - in: "header" - description: "" - required: false - type: "string" - x-exportParamName: "XOrgId" - - name: "Content-Type" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "ContentType" - - name: "Accept" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "Accept" - responses: - 200: - description: "" - schema: - type: "array" - items: - $ref: "#/definitions/system-insights-logical-drvies" - security: - - x-api-key: [] - x-stoplight: - afterScript: null - beforeScript: null - id: "systeminsights_list_logical_drives" - mock: - dynamic: false - enabled: false - statusCode: 200 - public: true - /systeminsights/mounts: - get: - tags: - - "System Insights" - summary: "List System Insights Mounts" - description: "Valid filter fields are `system_id` and `path`." - operationId: "systeminsights_list_mounts" - parameters: - - name: "limit" - in: "query" - required: false - type: "integer" - default: 10 - maximum: 100 - minimum: 0 - x-exportParamName: "Limit" - - name: "skip" - in: "query" - description: "The offset into the records to return." - required: false - type: "integer" - default: 0 - minimum: 0 - x-exportParamName: "Skip" - - name: "filter" - in: "query" - description: "Supported operators are: eq" - required: false - type: "array" - items: - type: "string" - x-exportParamName: "Filter" - - name: "x-org-id" - in: "header" - description: "" - required: false - type: "string" - x-exportParamName: "XOrgId" - - name: "Content-Type" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "ContentType" - - name: "Accept" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "Accept" - responses: - 200: - description: "" - schema: - type: "array" - items: - $ref: "#/definitions/system-insights-mounts" - security: - - x-api-key: [] - x-stoplight: - afterScript: null - beforeScript: null - id: "systeminsights_list_mounts" - mock: - dynamic: false - enabled: false - statusCode: 200 - public: true - /systeminsights/os_version: - get: - tags: - - "System Insights" - summary: "List System Insights OS Version" - description: "Valid filter fields are `system_id` and `version`." - operationId: "systeminsights_list_os_version" - parameters: - - name: "limit" - in: "query" - required: false - type: "integer" - default: 10 - maximum: 100 - minimum: 0 - x-exportParamName: "Limit" - - name: "skip" - in: "query" - description: "The offset into the records to return." - required: false - type: "integer" - default: 0 - minimum: 0 - x-exportParamName: "Skip" - - name: "filter" - in: "query" - description: "Supported operators are: eq" - required: false - type: "array" - items: - type: "string" - x-exportParamName: "Filter" - - name: "x-org-id" - in: "header" - description: "" - required: false - type: "string" - x-exportParamName: "XOrgId" - - name: "Content-Type" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "ContentType" - - name: "Accept" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "Accept" - responses: - 200: - description: "" - schema: - type: "array" - items: - $ref: "#/definitions/system-insights-os-version" - security: - - x-api-key: [] - x-stoplight: - afterScript: null - beforeScript: null - id: "systeminsights_list_os_version" - mock: - dynamic: false - enabled: false - statusCode: 200 - public: true - /systeminsights/patches: - get: - tags: - - "System Insights" - summary: "List System Insights Patches" - description: "Valid filter fields are `system_id` and `hotfix_id`." - operationId: "systeminsights_list_patches" - parameters: - - name: "limit" - in: "query" - required: false - type: "integer" - default: 10 - maximum: 100 - minimum: 0 - x-exportParamName: "Limit" - - name: "skip" - in: "query" - description: "The offset into the records to return." - required: false - type: "integer" - default: 0 - minimum: 0 - x-exportParamName: "Skip" - - name: "filter" - in: "query" - description: "Supported operators are: eq" - required: false - type: "array" - items: - type: "string" - x-exportParamName: "Filter" - - name: "x-org-id" - in: "header" - description: "" - required: false - type: "string" - x-exportParamName: "XOrgId" - - name: "Content-Type" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "ContentType" - - name: "Accept" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "Accept" - responses: - 200: - description: "" - schema: - type: "array" - items: - $ref: "#/definitions/system-insights-patches" - security: - - x-api-key: [] - x-stoplight: - afterScript: null - beforeScript: null - id: "systeminsights_list_patches" - mock: - dynamic: false - enabled: false - statusCode: 200 - public: true - /systeminsights/programs: - get: - tags: - - "System Insights" - summary: "List System Insights Programs" - description: "Valid filter fields are `system_id` and `name`." - operationId: "systeminsights_list_programs" - parameters: - - name: "limit" - in: "query" - required: false - type: "integer" - default: 10 - maximum: 100 - minimum: 0 - x-exportParamName: "Limit" - - name: "skip" - in: "query" - description: "The offset into the records to return." - required: false - type: "integer" - default: 0 - minimum: 0 - x-exportParamName: "Skip" - - name: "filter" - in: "query" - description: "Supported operators are: eq" - required: false - type: "array" - items: - type: "string" - x-exportParamName: "Filter" - - name: "x-org-id" - in: "header" - description: "" - required: false - type: "string" - x-exportParamName: "XOrgId" - - name: "Content-Type" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "ContentType" - - name: "Accept" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "Accept" - responses: - 200: - description: "" - schema: - type: "array" - items: - $ref: "#/definitions/system-insights-programs" - security: - - x-api-key: [] - x-stoplight: - afterScript: null - beforeScript: null - id: "systeminsights_list_programs" - mock: - dynamic: false - enabled: false - statusCode: 200 - public: true - /systeminsights/safari_extensions: - get: - tags: - - "System Insights" - summary: "List System Insights Safari Extensions" - description: "Valid filter fields are `system_id` and `name`." - operationId: "systeminsights_list_safari_extensions" - parameters: - - name: "limit" - in: "query" - required: false - type: "integer" - default: 10 - maximum: 100 - minimum: 0 - x-exportParamName: "Limit" - - name: "skip" - in: "query" - description: "The offset into the records to return." - required: false - type: "integer" - default: 0 - minimum: 0 - x-exportParamName: "Skip" - - name: "filter" - in: "query" - description: "Supported operators are: eq" - required: false - type: "array" - items: - type: "string" - x-exportParamName: "Filter" - - name: "x-org-id" - in: "header" - description: "" - required: false - type: "string" - x-exportParamName: "XOrgId" - - name: "Content-Type" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "ContentType" - - name: "Accept" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "Accept" - responses: - 200: - description: "" - schema: - type: "array" - items: - $ref: "#/definitions/system-insights-safari-extensions" - security: - - x-api-key: [] - x-stoplight: - afterScript: null - beforeScript: null - id: "systeminsights_list_safari_extensions" - mock: - dynamic: false - enabled: false - statusCode: 200 - public: true - /systeminsights/system_controls: - get: - tags: - - "System Insights" - summary: "List System Insights System Control" - description: "Valid filter fields are `system_id` and `name`." - operationId: "systeminsights_list_system_controls" - parameters: - - name: "limit" - in: "query" - required: false - type: "integer" - default: 10 - maximum: 100 - minimum: 0 - x-exportParamName: "Limit" - - name: "skip" - in: "query" - description: "The offset into the records to return." - required: false - type: "integer" - default: 0 - minimum: 0 - x-exportParamName: "Skip" - - name: "filter" - in: "query" - description: "Supported operators are: eq" - required: false - type: "array" - items: - type: "string" - x-exportParamName: "Filter" - - name: "x-org-id" - in: "header" - description: "" - required: false - type: "string" - x-exportParamName: "XOrgId" - - name: "Content-Type" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "ContentType" - - name: "Accept" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "Accept" - responses: - 200: - description: "" - schema: - type: "array" - items: - $ref: "#/definitions/system-insights-system-controls" - security: - - x-api-key: [] - x-stoplight: - afterScript: null - beforeScript: null - id: "systeminsights_list_system_controls" - mock: - dynamic: false - enabled: false - statusCode: 200 - public: true - /systeminsights/system_info: - get: - tags: - - "System Insights" - summary: "List System Insights System Info" - description: "Valid filter fields are `system_id` and `cpu_subtype`." - operationId: "systeminsights_list_system_info" - parameters: - - name: "limit" - in: "query" - required: false - type: "integer" - default: 10 - maximum: 100 - minimum: 0 - x-exportParamName: "Limit" - - name: "skip" - in: "query" - description: "The offset into the records to return." - required: false - type: "integer" - default: 0 - minimum: 0 - x-exportParamName: "Skip" - - name: "filter" - in: "query" - description: "Supported operators are: eq" - required: false - type: "array" - items: - type: "string" - x-exportParamName: "Filter" - - name: "x-org-id" - in: "header" - description: "" - required: false - type: "string" - x-exportParamName: "XOrgId" - - name: "Content-Type" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "ContentType" - - name: "Accept" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "Accept" - responses: - 200: - description: "" - schema: - type: "array" - items: - $ref: "#/definitions/system-insights-system-info" - security: - - x-api-key: [] - x-stoplight: - afterScript: null - beforeScript: null - id: "systeminsights_list_system_info" - mock: - dynamic: false - enabled: false - statusCode: 200 - public: true - /systeminsights/uptime: - get: - tags: - - "System Insights" - summary: "List System Insights Uptime" - description: "Valid filter fields are `system_id` and `days`." - operationId: "systeminsights_list_uptime" - parameters: - - name: "limit" - in: "query" - required: false - type: "integer" - default: 10 - maximum: 100 - minimum: 0 - x-exportParamName: "Limit" - - name: "skip" - in: "query" - description: "The offset into the records to return." - required: false - type: "integer" - default: 0 - minimum: 0 - x-exportParamName: "Skip" - - name: "filter" - in: "query" - description: "Supported operators are: eq" - required: false - type: "array" - items: - type: "string" - x-exportParamName: "Filter" - - name: "x-org-id" - in: "header" - description: "" - required: false - type: "string" - x-exportParamName: "XOrgId" - - name: "Content-Type" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "ContentType" - - name: "Accept" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "Accept" - responses: - 200: - description: "" - schema: - type: "array" - items: - $ref: "#/definitions/system-insights-uptime" - security: - - x-api-key: [] - x-stoplight: - afterScript: null - beforeScript: null - id: "systeminsights_list_uptime" - mock: - dynamic: false - enabled: false - statusCode: 200 - public: true - /systeminsights/usb_devices: - get: - tags: - - "System Insights" - summary: "List System Insights USB Devices" - description: "Valid filter fields are `system_id` and `model`." - operationId: "systeminsights_list_usb_devices" - parameters: - - name: "limit" - in: "query" - required: false - type: "integer" - default: 10 - maximum: 100 - minimum: 0 - x-exportParamName: "Limit" - - name: "x-org-id" - in: "header" - description: "" - required: false - type: "string" - x-exportParamName: "XOrgId" - - name: "Content-Type" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "ContentType" - - name: "Accept" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "Accept" - - name: "skip" - in: "query" - description: "The offset into the records to return." - required: false - type: "integer" - default: 0 - minimum: 0 - x-exportParamName: "Skip" - - name: "filter" - in: "query" - description: "Supported operators are: eq" - required: false - type: "array" - items: - type: "string" - x-exportParamName: "Filter" - responses: - 200: - description: "" - schema: - type: "array" - items: - $ref: "#/definitions/system-insights-usb-devices" - security: - - x-api-key: [] - x-stoplight: - afterScript: null - beforeScript: null - id: "systeminsights_list_usb_devices" - mock: - dynamic: false - enabled: false - statusCode: 200 - public: false - /systeminsights/user_groups: - get: - tags: - - "System Insights" - summary: "List System Insights User Groups" - description: "Only valid filter field is `system_id`." - operationId: "systeminsights_list_user_groups" - parameters: - - name: "limit" - in: "query" - required: false - type: "integer" - default: 10 - maximum: 100 - minimum: 0 - x-exportParamName: "Limit" - - name: "x-org-id" - in: "header" - description: "" - required: false - type: "string" - x-exportParamName: "XOrgId" - - name: "Content-Type" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "ContentType" - - name: "Accept" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "Accept" - - name: "skip" - in: "query" - description: "The offset into the records to return." - required: false - type: "integer" - default: 0 - minimum: 0 - x-exportParamName: "Skip" - - name: "filter" - in: "query" - description: "Supported operators are: eq" - required: false - type: "array" - items: - type: "string" - x-exportParamName: "Filter" - responses: - 200: - description: "" - schema: - type: "array" - items: - $ref: "#/definitions/system-insights-user-groups" - security: - - x-api-key: [] - x-stoplight: - afterScript: null - beforeScript: null - id: "systeminsights_list_user_groups" - mock: - dynamic: false - enabled: false - statusCode: 200 - public: false - /systeminsights/users: - get: - tags: - - "System Insights" - summary: "List System Insights Users" - description: "Valid filter fields are `system_id` and `username`." - operationId: "systeminsights_list_users" - parameters: - - name: "limit" - in: "query" - required: false - type: "integer" - default: 10 - maximum: 100 - minimum: 0 - x-exportParamName: "Limit" - - name: "skip" - in: "query" - description: "The offset into the records to return." - required: false - type: "integer" - default: 0 - minimum: 0 - x-exportParamName: "Skip" - - name: "filter" - in: "query" - description: "Supported operators are: eq" - required: false - type: "array" - items: - type: "string" - x-exportParamName: "Filter" - - name: "x-org-id" - in: "header" - description: "" - required: false - type: "string" - x-exportParamName: "XOrgId" - - name: "Content-Type" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "ContentType" - - name: "Accept" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "Accept" - responses: - 200: - description: "" - schema: - type: "array" - items: - $ref: "#/definitions/system-insights-users" - security: - - x-api-key: [] - x-stoplight: - afterScript: null - beforeScript: null - id: "systeminsights_list_users" - mock: - dynamic: false - enabled: false - statusCode: 200 - public: true - /systeminsights/windows_crashes: - get: - tags: - - "System Insights" - summary: "List System Insights Windows Crashes" - description: "Valid filter fields are `system_id` and `type`." - operationId: "systeminsights_list_windows_crashes" - parameters: - - name: "limit" - in: "query" - required: false - type: "integer" - default: 10 - maximum: 100 - minimum: 0 - x-exportParamName: "Limit" - - name: "x-org-id" - in: "header" - description: "" - required: false - type: "string" - x-exportParamName: "XOrgId" - - name: "skip" - in: "query" - description: "The offset into the records to return." - required: false - type: "integer" - default: 0 - minimum: 0 - x-exportParamName: "Skip" - - name: "filter" - in: "query" - description: "Supported operators are: eq" - required: false - type: "array" - items: - type: "string" - x-exportParamName: "Filter" - - name: "Content-Type" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "ContentType" - - name: "Accept" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "Accept" - responses: - 200: - description: "" - schema: - type: "array" - items: - $ref: "#/definitions/system-insights-windows-crashes" - security: - - x-api-key: [] - x-stoplight: - afterScript: null - beforeScript: null - id: "systeminsights_list_windows_crashes" - mock: - dynamic: false - enabled: false - statusCode: 200 - public: false - /systeminsights/{system_id}/apps: - get: - tags: - - "System Insights" - summary: "List System Insights System Apps" - description: "Valid filter fields are `bundle_name`." - operationId: "systeminsights_list_system_apps" - parameters: - - name: "system_id" - in: "path" - required: true - type: "string" - x-exportParamName: "SystemId" - - name: "limit" - in: "query" - required: false - type: "integer" - default: 10 - maximum: 100 - minimum: 0 - x-exportParamName: "Limit" - - name: "skip" - in: "query" - description: "The offset into the records to return." - required: false - type: "integer" - default: 0 - minimum: 0 - x-exportParamName: "Skip" - - name: "filter" - in: "query" - description: "Supported operators are: eq" - required: false - type: "array" - items: - type: "string" - x-exportParamName: "Filter" - - name: "x-org-id" - in: "header" - description: "" - required: false - type: "string" - x-exportParamName: "XOrgId" - - name: "Content-Type" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "ContentType" - - name: "Accept" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "Accept" - responses: - 200: - description: "" - schema: - type: "array" - items: - $ref: "#/definitions/system-insights-apps" - security: - - x-api-key: [] - x-stoplight: - afterScript: null - beforeScript: null - id: "systeminsights_list_system_apps" - mock: - dynamic: false - enabled: false - statusCode: 200 - public: true - /systeminsights/{system_id}/bitlocker_info: - get: - tags: - - "System Insights" - summary: "List System Insights System Bitlocker Info" - description: "Valid filter fields are `protection_status`." - operationId: "systeminsights_list_system_bitlocker_info" - parameters: - - name: "system_id" - in: "path" - required: true - type: "string" - x-exportParamName: "SystemId" - - name: "limit" - in: "query" - required: false - type: "integer" - default: 10 - maximum: 100 - minimum: 0 - x-exportParamName: "Limit" - - name: "skip" - in: "query" - description: "The offset into the records to return." - required: false - type: "integer" - default: 0 - minimum: 0 - x-exportParamName: "Skip" - - name: "filter" - in: "query" - description: "Supported operators are: eq" - required: false - type: "array" - items: - type: "string" - x-exportParamName: "Filter" - - name: "x-org-id" - in: "header" - description: "" - required: false - type: "string" - x-exportParamName: "XOrgId" - - name: "Content-Type" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "ContentType" - - name: "Accept" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "Accept" - responses: - 200: - description: "" - schema: - type: "array" - items: - $ref: "#/definitions/system-insights-bitlocker-info" - security: - - x-api-key: [] - x-stoplight: - afterScript: null - beforeScript: null - id: "systeminsights_list_system_bitlocker_info" - mock: - dynamic: false - enabled: false - statusCode: 200 - public: true - /systeminsights/{system_id}/browser_plugins: - get: - tags: - - "System Insights" - summary: "List System Insights System Browser Plugins" - description: "Valid filter fields are `name`." - operationId: "systeminsights_list_system_browser_plugins" - parameters: - - name: "system_id" - in: "path" - required: true - type: "string" - x-exportParamName: "SystemId" - - name: "limit" - in: "query" - required: false - type: "integer" - default: 10 - maximum: 100 - minimum: 0 - x-exportParamName: "Limit" - - name: "skip" - in: "query" - description: "The offset into the records to return." - required: false - type: "integer" - default: 0 - minimum: 0 - x-exportParamName: "Skip" - - name: "filter" - in: "query" - description: "Supported operators are: eq" - required: false - type: "array" - items: - type: "string" - x-exportParamName: "Filter" - - name: "x-org-id" - in: "header" - description: "" - required: false - type: "string" - x-exportParamName: "XOrgId" - - name: "Content-Type" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "ContentType" - - name: "Accept" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "Accept" - responses: - 200: - description: "" - schema: - type: "array" - items: - $ref: "#/definitions/system-insights-browser-plugins" - security: - - x-api-key: [] - x-stoplight: - afterScript: null - beforeScript: null - id: "systeminsights_list_system_browser_plugins" - mock: - dynamic: false - enabled: false - statusCode: 200 - public: true - /systeminsights/{system_id}/chrome_extensions: - get: - tags: - - "System Insights" - summary: "List System Insights System Chrome Extensions" - description: "Valid filter fields are `name`." - operationId: "systeminsights_list_system_chrome_extensions" - parameters: - - name: "system_id" - in: "path" - required: true - type: "string" - x-exportParamName: "SystemId" - - name: "limit" - in: "query" - required: false - type: "integer" - default: 10 - maximum: 100 - minimum: 0 - x-exportParamName: "Limit" - - name: "skip" - in: "query" - description: "The offset into the records to return." - required: false - type: "integer" - default: 0 - minimum: 0 - x-exportParamName: "Skip" - - name: "filter" - in: "query" - description: "Supported operators are: eq" - required: false - type: "array" - items: - type: "string" - x-exportParamName: "Filter" - - name: "x-org-id" - in: "header" - description: "" - required: false - type: "string" - x-exportParamName: "XOrgId" - - name: "Content-Type" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "ContentType" - - name: "Accept" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "Accept" - responses: - 200: - description: "" - schema: - type: "array" - items: - $ref: "#/definitions/system-insights-chrome-extensions" - security: - - x-api-key: [] - x-stoplight: - afterScript: null - beforeScript: null - id: "systeminsights_list_system_chrome_extensions" - mock: - dynamic: false - enabled: false - statusCode: 200 - public: true - /systeminsights/{system_id}/disk_encryption: - get: - tags: - - "System Insights" - summary: "List System Insights System Disk Encryption" - description: "Valid filter fields are `encryption_status`." - operationId: "systeminsights_list_system_disk_encryption" - parameters: - - name: "system_id" - in: "path" - required: true - type: "string" - x-exportParamName: "SystemId" - - name: "limit" - in: "query" - required: false - type: "integer" - default: 10 - maximum: 100 - minimum: 0 - x-exportParamName: "Limit" - - name: "skip" - in: "query" - description: "The offset into the records to return." - required: false - type: "integer" - default: 0 - minimum: 0 - x-exportParamName: "Skip" - - name: "filter" - in: "query" - description: "Supported operators are: eq" - required: false - type: "array" - items: - type: "string" - x-exportParamName: "Filter" - - name: "x-org-id" - in: "header" - description: "" - required: false - type: "string" - x-exportParamName: "XOrgId" - - name: "Content-Type" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "ContentType" - - name: "Accept" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "Accept" - responses: - 200: - description: "" - schema: - type: "array" - items: - $ref: "#/definitions/system-insights-disk-encryption" - security: - - x-api-key: [] - x-stoplight: - afterScript: null - beforeScript: null - id: "systeminsights_list_system_disk_encryption" - mock: - dynamic: false - enabled: false - statusCode: 200 - public: true - /systeminsights/{system_id}/disk_info: - get: - tags: - - "System Insights" - summary: "List System Insights System Disk Info" - description: "Valid filter fields are `disk_index`." - operationId: "systeminsights_list_system_disk_info" - parameters: - - name: "system_id" - in: "path" - required: true - type: "string" - x-exportParamName: "SystemId" - - name: "limit" - in: "query" - required: false - type: "integer" - default: 10 - maximum: 100 - minimum: 0 - x-exportParamName: "Limit" - - name: "skip" - in: "query" - description: "The offset into the records to return." - required: false - type: "integer" - default: 0 - minimum: 0 - x-exportParamName: "Skip" - - name: "filter" - in: "query" - description: "Supported operators are: eq" - required: false - type: "array" - items: - type: "string" - x-exportParamName: "Filter" - - name: "x-org-id" - in: "header" - description: "" - required: false - type: "string" - x-exportParamName: "XOrgId" - - name: "Content-Type" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "ContentType" - - name: "Accept" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "Accept" - responses: - 200: - description: "" - schema: - type: "array" - items: - $ref: "#/definitions/system-insights-bitlocker-info" - security: - - x-api-key: [] - x-stoplight: - afterScript: null - beforeScript: null - id: "systeminsights_list_system_disk_info" - mock: - dynamic: false - enabled: false - statusCode: 200 - public: true - /systeminsights/{system_id}/etc_hosts: - get: - tags: - - "System Insights" - summary: "List System Insights System Etc Hosts" - description: "Valid filter fields are `address`." - operationId: "systeminsights_list_system_etc_hosts" - parameters: - - name: "system_id" - in: "path" - required: true - type: "string" - x-exportParamName: "SystemId" - - name: "limit" - in: "query" - required: false - type: "integer" - default: 10 - maximum: 100 - minimum: 0 - x-exportParamName: "Limit" - - name: "skip" - in: "query" - description: "The offset into the records to return." - required: false - type: "integer" - default: 0 - minimum: 0 - x-exportParamName: "Skip" - - name: "filter" - in: "query" - description: "Supported operators are: eq" - required: false - type: "array" - items: - type: "string" - x-exportParamName: "Filter" - - name: "x-org-id" - in: "header" - description: "" - required: false - type: "string" - x-exportParamName: "XOrgId" - - name: "Content-Type" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "ContentType" - - name: "Accept" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "Accept" - responses: - 200: - description: "" - schema: - type: "array" - items: - $ref: "#/definitions/system-insights-bitlocker-info" - security: - - x-api-key: [] - x-stoplight: - afterScript: null - beforeScript: null - id: "systeminsights_list_system_etc_hosts" - mock: - dynamic: false - enabled: false - statusCode: 200 - public: true - /systeminsights/{system_id}/firefox_addons: - get: - tags: - - "System Insights" - summary: "List System Insights System Firefox Addons" - description: "Valid filter fields are `name`." - operationId: "systeminsights_list_system_firefox_addons" - parameters: - - name: "system_id" - in: "path" - required: true - type: "string" - x-exportParamName: "SystemId" - - name: "limit" - in: "query" - required: false - type: "integer" - default: 10 - maximum: 100 - minimum: 0 - x-exportParamName: "Limit" - - name: "skip" - in: "query" - description: "The offset into the records to return." - required: false - type: "integer" - default: 0 - minimum: 0 - x-exportParamName: "Skip" - - name: "filter" - in: "query" - description: "Supported operators are: eq" - required: false - type: "array" - items: - type: "string" - x-exportParamName: "Filter" - - name: "x-org-id" - in: "header" - description: "" - required: false - type: "string" - x-exportParamName: "XOrgId" - - name: "Content-Type" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "ContentType" - - name: "Accept" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "Accept" - responses: - 200: - description: "" - schema: - type: "array" - items: - $ref: "#/definitions/system-insights-firefox-addons" - security: - - x-api-key: [] - x-stoplight: - afterScript: null - beforeScript: null - id: "systeminsights_list_system_firefox_addons" - mock: - dynamic: false - enabled: false - statusCode: 200 - public: true - /systeminsights/{system_id}/groups: - get: - tags: - - "System Insights" - summary: "List System Insights System Groups" - description: "Valid filter fields are `groupname`." - operationId: "systeminsights_list_system_groups" - parameters: - - name: "system_id" - in: "path" - required: true - type: "string" - x-exportParamName: "SystemId" - - name: "limit" - in: "query" - required: false - type: "integer" - default: 10 - maximum: 100 - minimum: 0 - x-exportParamName: "Limit" - - name: "skip" - in: "query" - description: "The offset into the records to return." - required: false - type: "integer" - default: 0 - minimum: 0 - x-exportParamName: "Skip" - - name: "filter" - in: "query" - description: "Supported operators are: eq" - required: false - type: "array" - items: - type: "string" - x-exportParamName: "Filter" - - name: "x-org-id" - in: "header" - description: "" - required: false - type: "string" - x-exportParamName: "XOrgId" - - name: "Content-Type" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "ContentType" - - name: "Accept" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "Accept" - responses: - 200: - description: "" - schema: - type: "array" - items: - $ref: "#/definitions/system-insights-groups" - security: - - x-api-key: [] - x-stoplight: - afterScript: null - beforeScript: null - id: "systeminsights_list_system_groups" - mock: - dynamic: false - enabled: false - statusCode: 200 - public: true - /systeminsights/{system_id}/interface_addresses: - get: - tags: - - "System Insights" - summary: "List System Insights System Interface Addresses" - description: "Valid filter fields are `address`." - operationId: "systeminsights_list_system_interface_addresses" - parameters: - - name: "system_id" - in: "path" - required: true - type: "string" - x-exportParamName: "SystemId" - - name: "limit" - in: "query" - required: false - type: "integer" - default: 10 - maximum: 100 - minimum: 0 - x-exportParamName: "Limit" - - name: "skip" - in: "query" - description: "The offset into the records to return." - required: false - type: "integer" - default: 0 - minimum: 0 - x-exportParamName: "Skip" - - name: "filter" - in: "query" - description: "Supported operators are: eq" - required: false - type: "array" - items: - type: "string" - x-exportParamName: "Filter" - - name: "x-org-id" - in: "header" - description: "" - required: false - type: "string" - x-exportParamName: "XOrgId" - - name: "Content-Type" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "ContentType" - - name: "Accept" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "Accept" - responses: - 200: - description: "" - schema: - type: "array" - items: - $ref: "#/definitions/system-insights-interface-addresses" - security: - - x-api-key: [] - x-stoplight: - afterScript: null - beforeScript: null - id: "systeminsights_list_system_interface_addresses" - mock: - dynamic: false - enabled: false - statusCode: 200 - public: true - /systeminsights/{system_id}/kernel_info: - get: - tags: - - "System Insights" - summary: "List System Insights System Kernel Info" - description: "Valid filter fields are `version`." - operationId: "systeminsights_list_system_kernel_info" - parameters: - - name: "system_id" - in: "path" - required: true - type: "string" - x-exportParamName: "SystemId" - - name: "limit" - in: "query" - required: false - type: "integer" - default: 10 - maximum: 100 - minimum: 0 - x-exportParamName: "Limit" - - name: "skip" - in: "query" - description: "The offset into the records to return." - required: false - type: "integer" - default: 0 - minimum: 0 - x-exportParamName: "Skip" - - name: "filter" - in: "query" - description: "Supported operators are: eq" - required: false - type: "array" - items: - type: "string" - x-exportParamName: "Filter" - - name: "x-org-id" - in: "header" - description: "" - required: false - type: "string" - x-exportParamName: "XOrgId" - - name: "Content-Type" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "ContentType" - - name: "Accept" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "Accept" - responses: - 200: - description: "" - schema: - type: "array" - items: - $ref: "#/definitions/system-insights-kernel-info" - security: - - x-api-key: [] - x-stoplight: - afterScript: null - beforeScript: null - id: "systeminsights_list_system_kernel_info" - mock: - dynamic: false - enabled: false - statusCode: 200 - public: true - /systeminsights/{system_id}/logical_drives: - get: - tags: - - "System Insights" - summary: "List System Insights System Logical Drives" - description: "Valid filter fields are `device_id`." - operationId: "systeminsights_list_system_logical_drives" - parameters: - - name: "system_id" - in: "path" - required: true - type: "string" - x-exportParamName: "SystemId" - - name: "limit" - in: "query" - required: false - type: "integer" - default: 10 - maximum: 100 - minimum: 0 - x-exportParamName: "Limit" - - name: "skip" - in: "query" - description: "The offset into the records to return." - required: false - type: "integer" - default: 0 - minimum: 0 - x-exportParamName: "Skip" - - name: "filter" - in: "query" - description: "Supported operators are: eq" - required: false - type: "array" - items: - type: "string" - x-exportParamName: "Filter" - - name: "x-org-id" - in: "header" - description: "" - required: false - type: "string" - x-exportParamName: "XOrgId" - - name: "Content-Type" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "ContentType" - - name: "Accept" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "Accept" - responses: - 200: - description: "" - schema: - type: "array" - items: - $ref: "#/definitions/system-insights-logical-drvies" - security: - - x-api-key: [] - x-stoplight: - afterScript: null - beforeScript: null - id: "systeminsights_list_system_logical_drives" - mock: - dynamic: false - enabled: false - statusCode: 200 - public: true - /systeminsights/{system_id}/mounts: - get: - tags: - - "System Insights" - summary: "List System Insights System Mounts" - description: "Valid filter fields are `path`." - operationId: "systeminsights_list_system_mounts" - parameters: - - name: "system_id" - in: "path" - required: true - type: "string" - x-exportParamName: "SystemId" - - name: "limit" - in: "query" - required: false - type: "integer" - default: 10 - maximum: 100 - minimum: 0 - x-exportParamName: "Limit" - - name: "skip" - in: "query" - description: "The offset into the records to return." - required: false - type: "integer" - default: 0 - minimum: 0 - x-exportParamName: "Skip" - - name: "filter" - in: "query" - description: "Supported operators are: eq" - required: false - type: "array" - items: - type: "string" - x-exportParamName: "Filter" - - name: "x-org-id" - in: "header" - description: "" - required: false - type: "string" - x-exportParamName: "XOrgId" - - name: "Content-Type" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "ContentType" - - name: "Accept" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "Accept" - responses: - 200: - description: "" - schema: - type: "array" - items: - $ref: "#/definitions/system-insights-mounts" - security: - - x-api-key: [] - x-stoplight: - afterScript: null - beforeScript: null - id: "systeminsights_list_system_mounts" - mock: - dynamic: false - enabled: false - statusCode: 200 - public: true - /systeminsights/{system_id}/os_version: - get: - tags: - - "System Insights" - summary: "List System Insights System OS Version" - description: "Valid filter fields are `version`." - operationId: "systeminsights_list_system_os_version" - parameters: - - name: "system_id" - in: "path" - required: true - type: "string" - x-exportParamName: "SystemId" - - name: "limit" - in: "query" - required: false - type: "integer" - default: 10 - maximum: 100 - minimum: 0 - x-exportParamName: "Limit" - - name: "skip" - in: "query" - description: "The offset into the records to return." - required: false - type: "integer" - default: 0 - minimum: 0 - x-exportParamName: "Skip" - - name: "filter" - in: "query" - description: "Supported operators are: eq" - required: false - type: "array" - items: - type: "string" - x-exportParamName: "Filter" - - name: "x-org-id" - in: "header" - description: "" - required: false - type: "string" - x-exportParamName: "XOrgId" - - name: "Content-Type" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "ContentType" - - name: "Accept" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "Accept" - responses: - 200: - description: "" - schema: - type: "array" - items: - $ref: "#/definitions/system-insights-os-version" - security: - - x-api-key: [] - x-stoplight: - afterScript: null - beforeScript: null - id: "systeminsights_list_system_os_version" - mock: - dynamic: false - enabled: false - statusCode: 200 - public: true - /systeminsights/{system_id}/patches: - get: - tags: - - "System Insights" - summary: "List System Insights System Patches" - description: "Valid filter fields are `hotfix_id `." - operationId: "systeminsights_list_system_patches" - parameters: - - name: "system_id" - in: "path" - required: true - type: "string" - x-exportParamName: "SystemId" - - name: "limit" - in: "query" - required: false - type: "integer" - default: 10 - maximum: 100 - minimum: 0 - x-exportParamName: "Limit" - - name: "skip" - in: "query" - description: "The offset into the records to return." - required: false - type: "integer" - default: 0 - minimum: 0 - x-exportParamName: "Skip" - - name: "filter" - in: "query" - description: "Supported operators are: eq" - required: false - type: "array" - items: - type: "string" - x-exportParamName: "Filter" - - name: "x-org-id" - in: "header" - description: "" - required: false - type: "string" - x-exportParamName: "XOrgId" - - name: "Content-Type" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "ContentType" - - name: "Accept" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "Accept" - responses: - 200: - description: "" - schema: - type: "array" - items: - $ref: "#/definitions/system-insights-patches" - security: - - x-api-key: [] - x-stoplight: - afterScript: null - beforeScript: null - id: "systeminsights_list_system_patches" - mock: - dynamic: false - enabled: false - statusCode: 200 - public: true - /systeminsights/{system_id}/programs: - get: - tags: - - "System Insights" - summary: "List System Insights System Programs" - description: "Valid filter fields are `name`." - operationId: "systeminsights_list_system_programs" - parameters: - - name: "system_id" - in: "path" - required: true - type: "string" - x-exportParamName: "SystemId" - - name: "limit" - in: "query" - required: false - type: "integer" - default: 10 - maximum: 100 - minimum: 0 - x-exportParamName: "Limit" - - name: "skip" - in: "query" - description: "The offset into the records to return." - required: false - type: "integer" - default: 0 - minimum: 0 - x-exportParamName: "Skip" - - name: "filter" - in: "query" - description: "Supported operators are: eq" - required: false - type: "array" - items: - type: "string" - x-exportParamName: "Filter" - - name: "x-org-id" - in: "header" - description: "" - required: false - type: "string" - x-exportParamName: "XOrgId" - - name: "Content-Type" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "ContentType" - - name: "Accept" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "Accept" - responses: - 200: - description: "" - schema: - type: "array" - items: - $ref: "#/definitions/system-insights-programs" - security: - - x-api-key: [] - x-stoplight: - afterScript: null - beforeScript: null - id: "systeminsights_list_system_programs" - mock: - dynamic: false - enabled: false - statusCode: 200 - public: true - /systeminsights/{system_id}/safari_extensions: - get: - tags: - - "System Insights" - summary: "List System Insights System Safari Extensions" - description: "Valid filter fields are `name`." - operationId: "systeminsights_list_system_safari_extensions" - parameters: - - name: "system_id" - in: "path" - required: true - type: "string" - x-exportParamName: "SystemId" - - name: "limit" - in: "query" - required: false - type: "integer" - default: 10 - maximum: 100 - minimum: 0 - x-exportParamName: "Limit" - - name: "skip" - in: "query" - description: "The offset into the records to return." - required: false - type: "integer" - default: 0 - minimum: 0 - x-exportParamName: "Skip" - - name: "filter" - in: "query" - description: "Supported operators are: eq" - required: false - type: "array" - items: - type: "string" - x-exportParamName: "Filter" - - name: "x-org-id" - in: "header" - description: "" - required: false - type: "string" - x-exportParamName: "XOrgId" - - name: "Content-Type" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "ContentType" - - name: "Accept" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "Accept" - responses: - 200: - description: "" - schema: - type: "array" - items: - $ref: "#/definitions/system-insights-safari-extensions" - security: - - x-api-key: [] - x-stoplight: - afterScript: null - beforeScript: null - id: "systeminsights_list_system_safari_extensions" - mock: - dynamic: false - enabled: false - statusCode: 200 - public: true - /systeminsights/{system_id}/system_controls: - get: - tags: - - "System Insights" - summary: "List System Insights System System Controls" - description: "Valid filter fields are `name`." - operationId: "systeminsights_list_system_system_controls" - parameters: - - name: "system_id" - in: "path" - required: true - type: "string" - x-exportParamName: "SystemId" - - name: "limit" - in: "query" - required: false - type: "integer" - default: 10 - maximum: 100 - minimum: 0 - x-exportParamName: "Limit" - - name: "skip" - in: "query" - description: "The offset into the records to return." - required: false - type: "integer" - default: 0 - minimum: 0 - x-exportParamName: "Skip" - - name: "filter" - in: "query" - description: "Supported operators are: eq" - required: false - type: "array" - items: - type: "string" - x-exportParamName: "Filter" - - name: "x-org-id" - in: "header" - description: "" - required: false - type: "string" - x-exportParamName: "XOrgId" - - name: "Content-Type" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "ContentType" - - name: "Accept" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "Accept" - responses: - 200: - description: "" - schema: - type: "array" - items: - $ref: "#/definitions/system-insights-system-controls" - security: - - x-api-key: [] - x-stoplight: - afterScript: null - beforeScript: null - id: "systeminsights_list_system_system_controls" - mock: - dynamic: false - enabled: false - statusCode: 200 - public: true - /systeminsights/{system_id}/system_info: - get: - tags: - - "System Insights" - summary: "List System Insights System System Info" - description: "Valid filter fields are `cpu_subtype`." - operationId: "systeminsights_list_system_system_info" - parameters: - - name: "system_id" - in: "path" - required: true - type: "string" - x-exportParamName: "SystemId" - - name: "limit" - in: "query" - required: false - type: "integer" - default: 10 - maximum: 100 - minimum: 0 - x-exportParamName: "Limit" - - name: "skip" - in: "query" - description: "The offset into the records to return." - required: false - type: "integer" - default: 0 - minimum: 0 - x-exportParamName: "Skip" - - name: "filter" - in: "query" - description: "Supported operators are: eq" - required: false - type: "array" - items: - type: "string" - x-exportParamName: "Filter" - - name: "x-org-id" - in: "header" - description: "" - required: false - type: "string" - x-exportParamName: "XOrgId" - - name: "Content-Type" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "ContentType" - - name: "Accept" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "Accept" - responses: - 200: - description: "" - schema: - type: "array" - items: - $ref: "#/definitions/system-insights-system-info" - security: - - x-api-key: [] - x-stoplight: - afterScript: null - beforeScript: null - id: "systeminsights_list_system_system_info" - mock: - dynamic: false - enabled: false - statusCode: 200 - public: true - /systeminsights/{system_id}/uptime: - get: - tags: - - "System Insights" - summary: "List System Insights System Uptime" - description: "Valid filter fields are `days`." - operationId: "systeminsights_list_system_uptime" - parameters: - - name: "system_id" - in: "path" - required: true - type: "string" - x-exportParamName: "SystemId" - - name: "limit" - in: "query" - required: false - type: "integer" - default: 10 - maximum: 100 - minimum: 0 - x-exportParamName: "Limit" - - name: "skip" - in: "query" - description: "The offset into the records to return." - required: false - type: "integer" - default: 0 - minimum: 0 - x-exportParamName: "Skip" - - name: "filter" - in: "query" - description: "Supported operators are: eq" - required: false - type: "array" - items: - type: "string" - x-exportParamName: "Filter" - - name: "x-org-id" - in: "header" - description: "" - required: false - type: "string" - x-exportParamName: "XOrgId" - - name: "Content-Type" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "ContentType" - - name: "Accept" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "Accept" - responses: - 200: - description: "" - schema: - type: "array" - items: - $ref: "#/definitions/system-insights-uptime" - security: - - x-api-key: [] - x-stoplight: - afterScript: null - beforeScript: null - id: "systeminsights_list_system_uptime" - mock: - dynamic: false - enabled: false - statusCode: 200 - public: true - /systeminsights/{system_id}/users: - get: - tags: - - "System Insights" - summary: "List System Insights System Users" - description: "Valid filter fields are `username`." - operationId: "systeminsights_list_system_users" - parameters: - - name: "system_id" - in: "path" - required: true - type: "string" - x-exportParamName: "SystemId" - - name: "limit" - in: "query" - required: false - type: "integer" - default: 10 - maximum: 100 - minimum: 0 - x-exportParamName: "Limit" - - name: "skip" - in: "query" - description: "The offset into the records to return." - required: false - type: "integer" - default: 0 - minimum: 0 - x-exportParamName: "Skip" - - name: "filter" - in: "query" - description: "Supported operators are: eq" - required: false - type: "array" - items: - type: "string" - x-exportParamName: "Filter" - - name: "x-org-id" - in: "header" - description: "" - required: false - type: "string" - x-exportParamName: "XOrgId" - - name: "Content-Type" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "ContentType" - - name: "Accept" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "Accept" - responses: - 200: - description: "" - schema: - type: "array" - items: - $ref: "#/definitions/system-insights-users" - security: - - x-api-key: [] - x-stoplight: - afterScript: null - beforeScript: null - id: "systeminsights_list_system_users" - mock: - dynamic: false - enabled: false - statusCode: 200 - public: true - /systems/{system_id}/associations: - get: - tags: - - "Graph" - - "Systems" - summary: "List the associations of a System" - description: "This endpoint returns the _direct_ associations of a System.\n\ - \nA direct association can be a non-homogeneous relationship between 2 different\ - \ objects, for example Systems and Users.\n\n\n#### Sample Request\n```\n\ - curl -X GET https://console.jumpcloud.com/api/v2/systems/{System_ID}/associations?targets=user\ - \ \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\ - \ \\\n -H 'x-api-key: {API_KEY}'\n\n```" - operationId: "graph_systemAssociationsList" - parameters: - - name: "system_id" - in: "path" - description: "ObjectID of the System." - required: true - type: "string" - x-exportParamName: "SystemId" - - name: "limit" - in: "query" - description: "The number of records to return at once. Limited to 100." - required: false - type: "integer" - default: 10 - x-exportParamName: "Limit" - - name: "Content-Type" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "ContentType" - - name: "Accept" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "Accept" - - name: "skip" - in: "query" - description: "The offset into the records to return." - required: false - type: "integer" - default: 0 - minimum: 0 - x-exportParamName: "Skip" - - name: "Date" - in: "header" - description: "Current date header for the System Context API" - required: false - type: "string" - x-exportParamName: "Date" - - name: "Authorization" - in: "header" - description: "Authorization header for the System Context API" - required: false - type: "string" - x-exportParamName: "Authorization" - - name: "targets" - in: "query" - description: "" - required: true - type: "array" - items: - type: "string" - enum: - - "active_directory" - - "application" - - "command" - - "g_suite" - - "ldap_server" - - "office_365" - - "policy" - - "radius_server" - - "user" - - "user_group" - x-exportParamName: "Targets" - - name: "x-org-id" - in: "header" - description: "" - required: false - type: "string" - x-exportParamName: "XOrgId" - responses: - 200: - description: "OK" - schema: - type: "array" - items: - $ref: "#/definitions/GraphConnection" - security: - - x-api-key: [] - x-stoplight: - afterScript: null - beforeScript: null - id: "graph_systemAssociationsList" - mock: - dynamic: false - enabled: false - statusCode: 200 - public: true - post: - tags: - - "Graph" - - "Systems" - summary: "Manage associations of a System" - description: "This endpoint allows you to manage the _direct_ associations of\ - \ a System.\n\nA direct association can be a non-homogeneous relationship\ - \ between 2 different objects, for example Systems and Users.\n\n\n#### Sample\ - \ Request\n```\ncurl -X POST https://console.jumpcloud.com/api/v2/systems/{System_ID}/associations\ - \ \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\ - \ \\\n -H 'x-api-key: {API_KEY}' \\\n -d '{\n \"attributes\": {\n \ - \ \"sudo\": {\n \"enabled\": true,\n \"withoutPassword\"\ - : false\n }\n },\n \"op\": \"add\",\n \"type\": \"user\",\n \ - \ \"id\": \"UserID\"\n}'\n\n```" - operationId: "graph_systemAssociationsPost" - parameters: - - name: "system_id" - in: "path" - description: "ObjectID of the System." - required: true - type: "string" - x-exportParamName: "SystemId" - - in: "body" - name: "body" - required: false - schema: - $ref: "#/definitions/SystemGraphManagementReq" - x-exportParamName: "Body" - - name: "Content-Type" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "ContentType" - - name: "Accept" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "Accept" - - name: "Date" - in: "header" - description: "Current date header for the System Context API" - required: false - type: "string" - x-exportParamName: "Date" - - name: "Authorization" - in: "header" - description: "Authorization header for the System Context API" - required: false - type: "string" - x-exportParamName: "Authorization" - - name: "x-org-id" - in: "header" - description: "" - required: false - type: "string" - x-exportParamName: "XOrgId" - responses: - 204: - description: "OK" - security: - - x-api-key: [] - x-stoplight: - afterScript: null - beforeScript: null - id: "graph_systemAssociationsPost" - mock: - dynamic: false - enabled: false - statusCode: 200 - public: true - x-swagger-jumpcloud-auto-insert: true - /systems/{system_id}/commands: - get: - tags: - - "Graph" - - "Systems" - summary: "List the Commands bound to a System" - description: "This endpoint will return all Commands bound to a System, either\ - \ directly or indirectly, essentially traversing the JumpCloud Graph for your\ - \ Organization.\n\nEach element will contain the type, id, attributes and\ - \ paths.\n\nThe `attributes` object is a key/value hash of compiled graph\ - \ attributes for all paths followed.\n\nThe `paths` array enumerates each\ - \ path from this System to the corresponding Command; this array represents\ - \ all grouping and/or associations that would have to be removed to deprovision\ - \ the Command from this System.\n\nSee `/members` and `/associations` endpoints\ - \ to manage those collections.\n\n#### Sample Request\n```\ncurl -X GET https://console.jumpcloud.com/api/v2/systems/{System_ID}/commands\ - \ \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\ - \ \\\n -H 'x-api-key: {API_KEY}'\n\n```" - operationId: "graph_systemTraverseCommand" - parameters: - - name: "system_id" - in: "path" - description: "ObjectID of the System." - required: true - type: "string" - x-exportParamName: "SystemId" - - name: "limit" - in: "query" - description: "The number of records to return at once. Limited to 100." - required: false - type: "integer" - default: 10 - x-exportParamName: "Limit" - - name: "x-org-id" - in: "header" - description: "" - required: false - type: "string" - x-exportParamName: "XOrgId" - - name: "Content-Type" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "ContentType" - - name: "Accept" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "Accept" - - name: "skip" - in: "query" - description: "The offset into the records to return." - required: false - type: "integer" - default: 0 - minimum: 0 - x-exportParamName: "Skip" - - name: "filter" - in: "query" - description: "Supported operators are: eq, ne, gt, ge, lt, le, between, search,\ - \ in" - required: false - type: "array" - items: - type: "string" - x-exportParamName: "Filter" - responses: - 200: - description: "OK" - schema: - type: "array" - items: - $ref: "#/definitions/GraphObjectWithPaths" - security: - - x-api-key: [] - x-stoplight: - afterScript: null - beforeScript: null - id: "graph_systemTraverseCommand" - mock: - dynamic: false - enabled: false - statusCode: 200 - public: true - /systems/{system_id}/fdekey: - get: - tags: - - "fde" - - "Systems" - summary: "Get System FDE Key" - description: "This endpoint will return the current (latest) fde key saved for\ - \ a system." - operationId: "systems_getFDEKey" - parameters: - - name: "system_id" - in: "path" - required: true - type: "string" - x-exportParamName: "SystemId" - - name: "x-org-id" - in: "header" - description: "" - required: false - type: "string" - x-exportParamName: "XOrgId" - responses: - 200: - description: "" - schema: - $ref: "#/definitions/systemfdekey" - examples: - application/json: - key: "cupidatat consequat occaecat proident" - 400: - description: "" - schema: - $ref: "#/definitions/errorresponse" - 401: - description: "" - schema: - $ref: "#/definitions/errorresponse" - 403: - description: "" - schema: - $ref: "#/definitions/errorresponse" - 404: - description: "" - schema: - $ref: "#/definitions/errorresponse" - 409: - description: "" - schema: - $ref: "#/definitions/errorresponse" - 500: - description: "" - schema: - $ref: "#/definitions/errorresponse" - security: - - x-api-key: [] - x-stoplight: - afterScript: null - beforeScript: null - id: "systems_getFDEKey" - mock: - dynamic: false - enabled: false - statusCode: 200 - public: true - /systems/{system_id}/memberof: - get: - tags: - - "Graph" - - "Systems" - summary: "List the parent Groups of a System" - description: "This endpoint returns all the System Groups a System is a member\ - \ of.\n\n#### Sample Request\n```\ncurl -X GET https://console.jumpcloud.com/api/v2/systems/{System_ID}/memberof\ - \ \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\ - \ \\\n -H 'x-api-key: {API_KEY}'\n\n```" - operationId: "graph_systemMemberOf" - parameters: - - name: "system_id" - in: "path" - description: "ObjectID of the System." - required: true - type: "string" - x-exportParamName: "SystemId" - - name: "filter" - in: "query" - description: "Supported operators are: eq, ne, gt, ge, lt, le, between, search,\ - \ in" - required: false - type: "array" - items: - type: "string" - x-exportParamName: "Filter" - - name: "limit" - in: "query" - description: "The number of records to return at once. Limited to 100." - required: false - type: "integer" - default: 10 - x-exportParamName: "Limit" - - name: "Content-Type" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "ContentType" - - name: "Accept" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "Accept" - - name: "skip" - in: "query" - description: "The offset into the records to return." - required: false - type: "integer" - default: 0 - minimum: 0 - x-exportParamName: "Skip" - - name: "Date" - in: "header" - description: "Current date header for the System Context API" - required: false - type: "string" - x-exportParamName: "Date" - - name: "Authorization" - in: "header" - description: "Authorization header for the System Context API" - required: false - type: "string" - x-exportParamName: "Authorization" - - name: "sort" - in: "query" - description: "The comma separated fields used to sort the collection.\nDefault\ - \ sort is ascending, prefix with `-` to sort descending.\n" - required: false - type: "array" - items: - type: "string" - x-exportParamName: "Sort" - - name: "x-org-id" - in: "header" - description: "" - required: false - type: "string" - x-exportParamName: "XOrgId" - responses: - 200: - description: "OK" - schema: - type: "array" - items: - $ref: "#/definitions/GraphObjectWithPaths" - security: - - x-api-key: [] - x-stoplight: - afterScript: null - beforeScript: null - id: "graph_systemMemberOf" - mock: - dynamic: false - enabled: false - statusCode: 200 - public: true - /systems/{system_id}/policies: - get: - tags: - - "Graph" - - "Systems" - summary: "List the Policies bound to a System" - description: "This endpoint will return all Policies bound to a System, either\ - \ directly or indirectly, essentially traversing the JumpCloud Graph for your\ - \ Organization.\n\nEach element will contain the type, id, attributes and\ - \ paths.\n\nThe `attributes` object is a key/value hash of compiled graph\ - \ attributes for all paths followed.\n\nThe `paths` array enumerates each\ - \ path from this System to the corresponding Policy; this array represents\ - \ all grouping and/or associations that would have to be removed to deprovision\ - \ the Policy from this System.\n\nSee `/members` and `/associations` endpoints\ - \ to manage those collections.\n\nThis endpoint is not yet public as we have\ - \ finish the code.\n\n##### Sample Request\n\n```\ncurl -X GET https://console.jumpcloud.com/api/v2/{System_ID}/policies\ - \ \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\ - \ \\\n -H 'x-api-key: {API_KEY}'\n\n```" - operationId: "graph_systemTraversePolicy" - parameters: - - name: "system_id" - in: "path" - description: "ObjectID of the System." - required: true - type: "string" - x-exportParamName: "SystemId" - - name: "limit" - in: "query" - description: "The number of records to return at once. Limited to 100." - required: false - type: "integer" - default: 10 - x-exportParamName: "Limit" - - name: "x-org-id" - in: "header" - description: "" - required: false - type: "string" - x-exportParamName: "XOrgId" - - name: "Content-Type" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "ContentType" - - name: "Accept" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "Accept" - - name: "skip" - in: "query" - description: "The offset into the records to return." - required: false - type: "integer" - default: 0 - minimum: 0 - x-exportParamName: "Skip" - - name: "filter" - in: "query" - description: "Supported operators are: eq, ne, gt, ge, lt, le, between, search,\ - \ in" - required: false - type: "array" - items: - type: "string" - x-exportParamName: "Filter" - responses: - 200: - description: "OK" - schema: - type: "array" - items: - $ref: "#/definitions/GraphObjectWithPaths" - security: - - x-api-key: [] - x-stoplight: - afterScript: null - beforeScript: null - id: "graph_systemTraversePolicy" - mock: - dynamic: false - enabled: false - statusCode: 200 - public: true - /systems/{system_id}/policystatuses: - get: - tags: - - "Graph" - - "Policies" - summary: "List the policy statuses for a system" - description: "This endpoint returns the policy results for a particular system.\n\ - \n##### Sample Request\n\n```\ncurl -X GET https://console.jumpcloud.com/api/v2/systems/{System_ID}/policystatuses\ - \ \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\ - \ \\\n -H 'x-api-key: {API_KEY}'\n\n```" - operationId: "policystatuses_list" - parameters: - - name: "system_id" - in: "path" - description: "ObjectID of the System." - required: true - type: "string" - x-exportParamName: "SystemId" - - name: "fields" - in: "query" - description: "The comma separated fields included in the returned records.\n\ - If omitted, the default list of fields will be returned.\n" - required: false - type: "array" - items: - type: "string" - x-exportParamName: "Fields" - - name: "filter" - in: "query" - description: "Supported operators are: eq, ne, gt, ge, lt, le, between, search,\ - \ in" - required: false - type: "array" - items: - type: "string" - x-exportParamName: "Filter" - - name: "limit" - in: "query" - description: "The number of records to return at once. Limited to 100." - required: false - type: "integer" - default: 10 - x-exportParamName: "Limit" - - name: "Content-Type" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "ContentType" - - name: "Accept" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "Accept" - - name: "skip" - in: "query" - description: "The offset into the records to return." - required: false - type: "integer" - default: 0 - minimum: 0 - x-exportParamName: "Skip" - - name: "sort" - in: "query" - description: "The comma separated fields used to sort the collection.\nDefault\ - \ sort is ascending, prefix with `-` to sort descending.\n" - required: false - type: "array" - items: - type: "string" - x-exportParamName: "Sort" - - name: "x-org-id" - in: "header" - description: "" - required: false - type: "string" - x-exportParamName: "XOrgId" - responses: - 200: - description: "OK" - schema: - type: "array" - items: - $ref: "#/definitions/PolicyResult" - security: - - x-api-key: [] - x-stoplight: - afterScript: null - beforeScript: null - id: "policystatuses_list" - mock: - dynamic: false - enabled: false - statusCode: 200 - public: true - /systems/{system_id}/usergroups: - get: - tags: - - "Graph" - - "Systems" - summary: "List the User Groups bound to a System" - description: "This endpoint will return all User Groups bound to a System, either\ - \ directly or indirectly essentially traversing the JumpCloud Graph for your\ - \ Organization.\n\nEach element will contain the type, id, attributes and\ - \ paths.\n\nThe `attributes` object is a key/value hash of compiled graph\ - \ attributes for all paths followed.\n\nThe `paths` array enumerates each\ - \ path from this System to the corresponding User Group; this array represents\ - \ all grouping and/or associations that would have to be removed to deprovision\ - \ the User Group from this System.\n\nSee `/members` and `/associations` endpoints\ - \ to manage those collections.\n\n#### Sample Request\n```\ncurl -X GET https://console.jumpcloud.com/api/v2/systems/{System_ID}/usergroups\ - \ \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\ - \ \\\n -H 'x-api-key: {API_KEY}'\n\n```" - operationId: "graph_systemTraverseUserGroup" - parameters: - - name: "system_id" - in: "path" - description: "ObjectID of the System." - required: true - type: "string" - x-exportParamName: "SystemId" - - name: "limit" - in: "query" - description: "The number of records to return at once. Limited to 100." - required: false - type: "integer" - default: 10 - x-exportParamName: "Limit" - - name: "x-org-id" - in: "header" - description: "" - required: false - type: "string" - x-exportParamName: "XOrgId" - - name: "Content-Type" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "ContentType" - - name: "Accept" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "Accept" - - name: "skip" - in: "query" - description: "The offset into the records to return." - required: false - type: "integer" - default: 0 - minimum: 0 - x-exportParamName: "Skip" - - name: "Date" - in: "header" - description: "Current date header for the System Context API" - required: false - type: "string" - x-exportParamName: "Date" - - name: "Authorization" - in: "header" - description: "Authorization header for the System Context API" - required: false - type: "string" - x-exportParamName: "Authorization" - - name: "filter" - in: "query" - description: "Supported operators are: eq, ne, gt, ge, lt, le, between, search,\ - \ in" - required: false - type: "array" - items: - type: "string" - x-exportParamName: "Filter" - responses: - 200: - description: "OK" - schema: - type: "array" - items: - $ref: "#/definitions/GraphObjectWithPaths" - security: - - x-api-key: [] - x-stoplight: - afterScript: null - beforeScript: null - id: "graph_systemTraverseUserGroup" - mock: - dynamic: false - enabled: false - statusCode: 200 - public: true - /systems/{system_id}/users: - get: - tags: - - "Graph" - - "Systems" - summary: "List the Users bound to a System" - description: "This endpoint will return all Users bound to a System, either\ - \ directly or indirectly essentially traversing the JumpCloud Graph for your\ - \ Organization.\n\nEach element will contain the type, id, attributes and\ - \ paths.\n\nThe `attributes` object is a key/value hash of compiled graph\ - \ attributes for all paths followed.\n\nThe `paths` array enumerates each\ - \ path from this System to the corresponding User; this array represents all\ - \ grouping and/or associations that would have to be removed to deprovision\ - \ the User from this System.\n\nSee `/members` and `/associations` endpoints\ - \ to manage those collections.\n\n#### Sample Request\n```\ncurl -X GET https://console.jumpcloud.com/api/v2/systems/{System_ID}/users\ - \ \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\ - \ \\\n -H 'x-api-key: {API_KEY}'\n\n```" - operationId: "graph_systemTraverseUser" - parameters: - - name: "system_id" - in: "path" - description: "ObjectID of the System." - required: true - type: "string" - x-exportParamName: "SystemId" - - name: "limit" - in: "query" - description: "The number of records to return at once. Limited to 100." - required: false - type: "integer" - default: 10 - x-exportParamName: "Limit" - - name: "x-org-id" - in: "header" - description: "" - required: false - type: "string" - x-exportParamName: "XOrgId" - - name: "Content-Type" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "ContentType" - - name: "Accept" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "Accept" - - name: "skip" - in: "query" - description: "The offset into the records to return." - required: false - type: "integer" - default: 0 - minimum: 0 - x-exportParamName: "Skip" - - name: "Date" - in: "header" - description: "Current date header for the System Context API" - required: false - type: "string" - x-exportParamName: "Date" - - name: "Authorization" - in: "header" - description: "Authorization header for the System Context API" - required: false - type: "string" - x-exportParamName: "Authorization" - - name: "filter" - in: "query" - description: "Supported operators are: eq, ne, gt, ge, lt, le, between, search,\ - \ in" - required: false - type: "array" - items: - type: "string" - x-exportParamName: "Filter" - responses: - 200: - description: "OK" - schema: - type: "array" - items: - $ref: "#/definitions/GraphObjectWithPaths" - security: - - x-api-key: [] - x-stoplight: - afterScript: null - beforeScript: null - id: "graph_systemTraverseUser" - mock: - dynamic: false - enabled: false - statusCode: 200 - public: true - /usergroups: - get: - tags: - - "User Groups" - summary: "List all User Groups" - description: "This endpoint returns all User Groups.\n\nAvailable filter fields:\n\ - \ - `name`\n - `disabled`\n - `type`\n\n#### Sample Request\n```\ncurl\ - \ -X GET https://console.jumpcloud.com/api/v2/usergroups \\\n -H 'Accept:\ - \ application/json' \\\n -H 'Content-Type: application/json' \\\n -H 'x-api-key:\ - \ {API_KEY}'\n```" - operationId: "groups_user_list" - parameters: - - name: "fields" - in: "query" - description: "The comma separated fields included in the returned records.\n\ - If omitted, the default list of fields will be returned.\n" - required: false - type: "array" - items: - type: "string" - x-exportParamName: "Fields" - - name: "filter" - in: "query" - description: "Supported operators are: eq, ne, gt, ge, lt, le, between, search,\ - \ in" - required: false - type: "array" - items: - type: "string" - x-exportParamName: "Filter" - - name: "limit" - in: "query" - description: "The number of records to return at once. Limited to 100." - required: false - type: "integer" - default: 10 - x-exportParamName: "Limit" - - name: "skip" - in: "query" - description: "The offset into the records to return." - required: false - type: "integer" - default: 0 - minimum: 0 - x-exportParamName: "Skip" - - name: "sort" - in: "query" - description: "The comma separated fields used to sort the collection.\nDefault\ - \ sort is ascending, prefix with `-` to sort descending.\n" - required: false - type: "array" - items: - type: "string" - x-exportParamName: "Sort" - - name: "Content-Type" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "ContentType" - - name: "Accept" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "Accept" - - name: "x-org-id" - in: "header" - description: "" - required: false - type: "string" - x-exportParamName: "XOrgId" - responses: - 200: - description: "OK" - schema: - type: "array" - items: - $ref: "#/definitions/UserGroup" - default: - description: "Unexpected error" - schema: - $ref: "#/definitions/Error" - security: - - x-api-key: [] - x-stoplight: - afterScript: null - beforeScript: null - id: "groups_user_list" - mock: - dynamic: false - enabled: false - statusCode: 200 - public: true - post: - tags: - - "User Groups" - summary: "Create a new User Group" - description: "This endpoint allows you to create a new User Group.\n\n#### Sample\ - \ Request\n```\ncurl -X POST https://console.jumpcloud.com/api/v2/usergroups\ - \ \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\ - \ \\\n -H 'x-api-key: {API_KEY}' \\\n -d '{\n \"name\": \"{Group_Name}\"\ - \n}'\n\n```" - operationId: "groups_user_post" - parameters: - - in: "body" - name: "body" - required: false - schema: - $ref: "#/definitions/UserGroupPost" - x-exportParamName: "Body" - - name: "Content-Type" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "ContentType" - - name: "Accept" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "Accept" - - name: "x-org-id" - in: "header" - description: "" - required: false - type: "string" - x-exportParamName: "XOrgId" - responses: - 201: - description: "Created" - schema: - $ref: "#/definitions/UserGroup" - security: - - x-api-key: [] - x-stoplight: - afterScript: null - beforeScript: null - id: "groups_user_post" - mock: - dynamic: false - enabled: false - statusCode: 200 - public: true - /usergroups/{group_id}/activedirectories: - get: - tags: - - "Graph" - - "User Groups" - - "User Group Associations" - summary: "List the Active Directories bound to a User Group" - description: "This endpoint will return all Active Directory Instances bound\ - \ to a User Group, either directly or indirectly, essentially traversing the\ - \ JumpCloud Graph for your Organization.\n\nThe `attributes` object is a key/value\ - \ hash of compiled graph attributes for all paths followed.\n\nThe `paths`\ - \ array enumerates each path from this User Group to the corresponding Active\ - \ Directory; this array represents all grouping and/or associations that would\ - \ have to be removed to deprovision the Active Directory from this User Group.\n\ - \nSee `/members` and `/associations` endpoints to manage those collections.\n\ - \n#### Sample Request\n```\ncurl -X GET https://console.jumpcloud.com/api/v2/usergroups/{GroupID}/activedirectories\ - \ \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\ - \ \\\n -H 'x-api-key: {API_KEY}'\n```" - operationId: "graph_userGroupTraverseActiveDirectory" - parameters: - - name: "group_id" - in: "path" - description: "ObjectID of the User Group." - required: true - type: "string" - x-exportParamName: "GroupId" - - name: "limit" - in: "query" - description: "The number of records to return at once. Limited to 100." - required: false - type: "integer" - default: 10 - x-exportParamName: "Limit" - - name: "x-org-id" - in: "header" - description: "" - required: false - type: "string" - x-exportParamName: "XOrgId" - - name: "Content-Type" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "ContentType" - - name: "Accept" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "Accept" - - name: "skip" - in: "query" - description: "The offset into the records to return." - required: false - type: "integer" - default: 0 - minimum: 0 - x-exportParamName: "Skip" - - name: "filter" - in: "query" - description: "Supported operators are: eq, ne, gt, ge, lt, le, between, search,\ - \ in" - required: false - type: "array" - items: - type: "string" - x-exportParamName: "Filter" - responses: - 200: - description: "" - schema: - type: "array" - items: - $ref: "#/definitions/GraphObjectWithPaths" - security: - - x-api-key: [] - x-stoplight: - afterScript: null - beforeScript: null - id: "graph_userGroupTraverseActiveDirectory" - mock: - dynamic: false - enabled: false - statusCode: 200 - public: false - /usergroups/{group_id}/applications: - get: - tags: - - "Graph" - - "User Groups" - - "User Group Associations" - summary: "List the Applications bound to a User Group" - description: "This endpoint will return all Applications bound to a User Group,\ - \ either directly or indirectly, essentially traversing the JumpCloud Graph\ - \ for your Organization.\n\nEach element will contain the type, id, attributes\ - \ and paths\n\nThe `attributes` object is a key/value hash of compiled graph\ - \ attributes for all paths followed.\n\nThe `paths` array enumerates each\ - \ path from this User Group to the corresponding Application; this array represents\ - \ all grouping and/or associations that would have to be removed to deprovision\ - \ the Application from this User Group.\n\nSee `/members` and `/associations`\ - \ endpoints to manage those collections.\n\n#### Sample Request\n```\ncurl\ - \ -X GET https://console.jumpcloud.com/api/v2/usergroups/{GroupID}/applications\ - \ \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\ - \ \\\n -H 'x-api-key: {API_KEY}'\n```" - operationId: "graph_userGroupTraverseApplication" - parameters: - - name: "group_id" - in: "path" - description: "ObjectID of the User Group." - required: true - type: "string" - x-exportParamName: "GroupId" - - name: "limit" - in: "query" - description: "The number of records to return at once. Limited to 100." - required: false - type: "integer" - default: 10 - x-exportParamName: "Limit" - - name: "x-org-id" - in: "header" - description: "" - required: false - type: "string" - x-exportParamName: "XOrgId" - - name: "Content-Type" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "ContentType" - - name: "Accept" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "Accept" - - name: "skip" - in: "query" - description: "The offset into the records to return." - required: false - type: "integer" - default: 0 - minimum: 0 - x-exportParamName: "Skip" - - name: "filter" - in: "query" - description: "Supported operators are: eq, ne, gt, ge, lt, le, between, search,\ - \ in" - required: false - type: "array" - items: - type: "string" - x-exportParamName: "Filter" - responses: - 200: - description: "OK" - schema: - type: "array" - items: - $ref: "#/definitions/GraphObjectWithPaths" - security: - - x-api-key: [] - x-stoplight: - afterScript: null - beforeScript: null - id: "graph_userGroupTraverseApplication" - mock: - dynamic: false - enabled: false - statusCode: 200 - public: true - /usergroups/{group_id}/associations: - get: - tags: - - "Graph" - - "User Groups" - - "User Group Associations" - summary: "List the associations of a User Group." - description: "This endpoint returns the _direct_ associations of this User Group.\n\ - \nA direct association can be a non-homogeneous relationship between 2 different\ - \ objects, for example User Groups and Users.\n\n\n#### Sample Request\n```\n\ - curl -X GET https://console.jumpcloud.com/api/v2/usergroups/{GroupID}/associations?targets=system\ - \ \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\ - \ \\\n -H 'x-api-key: {API_KEY}'\n```" - operationId: "graph_userGroupAssociationsList" - parameters: - - name: "group_id" - in: "path" - description: "ObjectID of the User Group." - required: true - type: "string" - x-exportParamName: "GroupId" - - name: "limit" - in: "query" - description: "The number of records to return at once. Limited to 100." - required: false - type: "integer" - default: 10 - x-exportParamName: "Limit" - - name: "Content-Type" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "ContentType" - - name: "Accept" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "Accept" - - name: "skip" - in: "query" - description: "The offset into the records to return." - required: false - type: "integer" - default: 0 - minimum: 0 - x-exportParamName: "Skip" - - name: "targets" - in: "query" - description: "" - required: true - type: "array" - items: - type: "string" - enum: - - "active_directory" - - "application" - - "command" - - "g_suite" - - "ldap_server" - - "office_365" - - "policy" - - "radius_server" - - "system" - - "system_group" - x-exportParamName: "Targets" - - name: "x-org-id" - in: "header" - description: "" - required: false - type: "string" - x-exportParamName: "XOrgId" - responses: - 200: - description: "OK" - schema: - type: "array" - items: - $ref: "#/definitions/GraphConnection" - security: - - x-api-key: [] - x-stoplight: - afterScript: null - beforeScript: null - id: "graph_userGroupAssociationsList" - mock: - dynamic: false - enabled: false - statusCode: 200 - public: true - post: - tags: - - "Graph" - - "User Groups" - - "User Group Associations" - summary: "Manage the associations of a User Group" - description: "This endpoint manages the _direct_ associations of this User Group.\n\ - \nA direct association can be a non-homogeneous relationship between 2 different\ - \ objects, for example User Groups and Users.\n\n\n#### Sample Request\n```\n\ - curl -X POST https://console.jumpcloud.com/api/v2/usergroups/{GroupID}/associations\ - \ \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\ - \ \\\n -H 'x-api-key: {API_KEY}' \\\n -d '{\n \"op\": \"add\",\n \"\ - type\": \"system\",\n \"id\": \"{SystemID}\"\n}'\n\n```" - operationId: "graph_userGroupAssociationsPost" - parameters: - - name: "group_id" - in: "path" - description: "ObjectID of the User Group." - required: true - type: "string" - x-exportParamName: "GroupId" - - in: "body" - name: "body" - required: false - schema: - $ref: "#/definitions/UserGroupGraphManagementReq" - x-exportParamName: "Body" - - name: "Content-Type" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "ContentType" - - name: "Accept" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "Accept" - - name: "x-org-id" - in: "header" - description: "" - required: false - type: "string" - x-exportParamName: "XOrgId" - responses: - 204: - description: "OK" - security: - - x-api-key: [] - x-stoplight: - afterScript: null - beforeScript: null - id: "graph_userGroupAssociationsPost" - mock: - dynamic: false - enabled: false - statusCode: 200 - public: true - x-swagger-jumpcloud-auto-insert: true - /usergroups/{group_id}/directories: - get: - tags: - - "Graph" - - "User Groups" - - "User Group Associations" - summary: "List the Directories bound to a User Group" - description: "This endpoint will return all Directories bound to a User Group,\ - \ either directly or indirectly, essentially traversing the JumpCloud Graph\ - \ for your Organization.\n\nEach element will contain the type, id, attributes\ - \ and paths\n\nThe `attributes` object is a key/value hash of compiled graph\ - \ attributes for all paths followed.\n\nThe `paths` array enumerates each\ - \ path from this User Group to the corresponding Directory; this array represents\ - \ all grouping and/or associations that would have to be removed to deprovision\ - \ the Directories from this User Group.\n\nSee `/members` and `/associations`\ - \ endpoints to manage those collections.\n\n#### Sample Request\n```\ncurl\ - \ -X GET https://console.jumpcloud.com/api/v2/usergroups/{GroupID}/directories\ - \ \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\ - \ \\\n -H 'x-api-key: {API_KEY}'\n\n```" - operationId: "graph_userGroupTraverseDirectory" - parameters: - - name: "group_id" - in: "path" - description: "ObjectID of the User Group." - required: true - type: "string" - x-exportParamName: "GroupId" - - name: "limit" - in: "query" - description: "The number of records to return at once. Limited to 100." - required: false - type: "integer" - default: 10 - x-exportParamName: "Limit" - - name: "x-org-id" - in: "header" - description: "" - required: false - type: "string" - x-exportParamName: "XOrgId" - - name: "Content-Type" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "ContentType" - - name: "Accept" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "Accept" - - name: "skip" - in: "query" - description: "The offset into the records to return." - required: false - type: "integer" - default: 0 - minimum: 0 - x-exportParamName: "Skip" - - name: "filter" - in: "query" - description: "Supported operators are: eq, ne, gt, ge, lt, le, between, search,\ - \ in" - required: false - type: "array" - items: - type: "string" - x-exportParamName: "Filter" - responses: - 200: - description: "OK" - schema: - type: "array" - items: - $ref: "#/definitions/GraphObjectWithPaths" - security: - - x-api-key: [] - x-stoplight: - afterScript: null - beforeScript: null - id: "graph_userGroupTraverseDirectory" - mock: - dynamic: false - enabled: false - statusCode: 200 - public: true - /usergroups/{group_id}/gsuites: - get: - tags: - - "Graph" - - "User Groups" - - "User Group Associations" - summary: "List the G Suite instances bound to a User Group" - description: "This endpoint will return all G Suite Instances bound to a User\ - \ Group, either directly or indirectly, essentially traversing the JumpCloud\ - \ Graph for your Organization.\n\nEach element will contain the type, id,\ - \ attributes and paths\n\nThe `attributes` object is a key/value hash of compiled\ - \ graph attributes for all paths followed.\n\nThe `paths` array enumerates\ - \ each path from this User Group to the corresponding G Suite instance; this\ - \ array represents all grouping and/or associations that would have to be\ - \ removed to deprovision the G Suite instance from this User Group.\n\nSee\ - \ `/members` and `/associations` endpoints to manage those collections.\n\n\ - #### Sample Request\n```\ncurl -X GET https://console.jumpcloud.com/api/v2/usergroups/{GroupID/gsuites\ - \ \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\ - \ \\\n -H 'x-api-key: {API_KEY}'\n\n```" - operationId: "graph_userGroupTraverseGSuite" - parameters: - - name: "group_id" - in: "path" - description: "ObjectID of the User Group." - required: true - type: "string" - x-exportParamName: "GroupId" - - name: "limit" - in: "query" - description: "The number of records to return at once. Limited to 100." - required: false - type: "integer" - default: 10 - x-exportParamName: "Limit" - - name: "x-org-id" - in: "header" - description: "" - required: false - type: "string" - x-exportParamName: "XOrgId" - - name: "Content-Type" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "ContentType" - - name: "Accept" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "Accept" - - name: "skip" - in: "query" - description: "The offset into the records to return." - required: false - type: "integer" - default: 0 - minimum: 0 - x-exportParamName: "Skip" - - name: "filter" - in: "query" - description: "Supported operators are: eq, ne, gt, ge, lt, le, between, search,\ - \ in" - required: false - type: "array" - items: - type: "string" - x-exportParamName: "Filter" - responses: - 200: - description: "OK" - schema: - type: "array" - items: - $ref: "#/definitions/GraphObjectWithPaths" - security: - - x-api-key: [] - x-stoplight: - afterScript: null - beforeScript: null - id: "graph_userGroupTraverseGSuite" - mock: - dynamic: false - enabled: false - statusCode: 200 - public: true - /usergroups/{group_id}/ldapservers: - get: - tags: - - "Graph" - - "User Groups" - - "User Group Associations" - summary: "List the LDAP Servers bound to a User Group" - description: "This endpoint will return all LDAP Servers bound to a User Group,\ - \ either directly or indirectly, essentially traversing the JumpCloud Graph\ - \ for your Organization.\n\nEach element will contain the type, id, attributes\ - \ and paths\n\nThe `attributes` object is a key/value hash of compiled graph\ - \ attributes for all paths followed.\n\nThe `paths` array enumerates each\ - \ path from this User Group to the corresponding LDAP Server; this array represents\ - \ all grouping and/or associations that would have to be removed to deprovision\ - \ the LDAP Server from this User Group.\n\nSee `/members` and `/associations`\ - \ endpoints to manage those collections.\n\n#### Sample Request\n```\ncurl\ - \ -X GET https://console.jumpcloud.com/api/v2/usergroups/{GroupID}/ldapservers\ - \ \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\ - \ \\\n -H 'x-api-key: {API_KEY}'\n```" - operationId: "graph_userGroupTraverseLdapServer" - parameters: - - name: "group_id" - in: "path" - description: "ObjectID of the User Group." - required: true - type: "string" - x-exportParamName: "GroupId" - - name: "limit" - in: "query" - description: "The number of records to return at once. Limited to 100." - required: false - type: "integer" - default: 10 - x-exportParamName: "Limit" - - name: "x-org-id" - in: "header" - description: "" - required: false - type: "string" - x-exportParamName: "XOrgId" - - name: "Content-Type" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "ContentType" - - name: "Accept" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "Accept" - - name: "skip" - in: "query" - description: "The offset into the records to return." - required: false - type: "integer" - default: 0 - minimum: 0 - x-exportParamName: "Skip" - - name: "filter" - in: "query" - description: "Supported operators are: eq, ne, gt, ge, lt, le, between, search,\ - \ in" - required: false - type: "array" - items: - type: "string" - x-exportParamName: "Filter" - responses: - 200: - description: "OK" - schema: - type: "array" - items: - $ref: "#/definitions/GraphObjectWithPaths" - security: - - x-api-key: [] - x-stoplight: - afterScript: null - beforeScript: null - id: "graph_userGroupTraverseLdapServer" - mock: - dynamic: false - enabled: false - statusCode: 200 - public: true - /usergroups/{group_id}/memberof: - get: - tags: - - "Graph" - - "User Groups" - - "User Group Members & Membership" - summary: "List the User Group's parents" - description: "This endpoint returns all User Groups a User Group is a member\ - \ of.\n\n#### Sample Request\n```\nhttps://console.jumpcloud.com/api/v2/usergroups/{group_id}/memberof\n\ - ```\n\nNot public yet, as the code is not finished," - operationId: "graph_userGroupMemberOf" - parameters: - - name: "group_id" - in: "path" - description: "ObjectID of the User Group." - required: true - type: "string" - x-exportParamName: "GroupId" - - name: "filter" - in: "query" - description: "Supported operators are: eq, ne, gt, ge, lt, le, between, search,\ - \ in" - required: false - type: "array" - items: - type: "string" - x-exportParamName: "Filter" - - name: "limit" - in: "query" - description: "The number of records to return at once. Limited to 100." - required: false - type: "integer" - default: 10 - x-exportParamName: "Limit" - - name: "Content-Type" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "ContentType" - - name: "Accept" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "Accept" - - name: "skip" - in: "query" - description: "The offset into the records to return." - required: false - type: "integer" - default: 0 - minimum: 0 - x-exportParamName: "Skip" - - name: "sort" - in: "query" - description: "The comma separated fields used to sort the collection.\nDefault\ - \ sort is ascending, prefix with `-` to sort descending.\n" - required: false - type: "array" - items: - type: "string" - x-exportParamName: "Sort" - - name: "x-org-id" - in: "header" - description: "" - required: false - type: "string" - x-exportParamName: "XOrgId" - responses: - 200: - description: "OK" - schema: - type: "array" - items: - $ref: "#/definitions/GraphObjectWithPaths" - security: - - x-api-key: [] - x-stoplight: - afterScript: null - beforeScript: null - id: "graph_userGroupMemberOf" - mock: - dynamic: false - enabled: false - statusCode: 200 - public: false - /usergroups/{group_id}/members: - get: - tags: - - "Graph" - - "User Groups" - - "User Group Members & Membership" - summary: "List the members of a User Group" - description: "This endpoint returns the user members of a User Group.\n\n####\ - \ Sample Request\n```\ncurl -X GET https://console.jumpcloud.com/api/v2/usergroups/{GroupID}/members\ - \ \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\ - \ \\\n -H 'x-api-key: {API_KEY}'\n```" - operationId: "graph_userGroupMembersList" - parameters: - - name: "group_id" - in: "path" - description: "ObjectID of the User Group." - required: true - type: "string" - x-exportParamName: "GroupId" - - name: "limit" - in: "query" - description: "The number of records to return at once. Limited to 100." - required: false - type: "integer" - default: 10 - x-exportParamName: "Limit" - - name: "Content-Type" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "ContentType" - - name: "Accept" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "Accept" - - name: "skip" - in: "query" - description: "The offset into the records to return." - required: false - type: "integer" - default: 0 - minimum: 0 - x-exportParamName: "Skip" - - name: "x-org-id" - in: "header" - description: "" - required: false - type: "string" - x-exportParamName: "XOrgId" - responses: - 200: - description: "OK" - schema: - type: "array" - items: - $ref: "#/definitions/GraphConnection" - security: - - x-api-key: [] - x-stoplight: - afterScript: null - beforeScript: null - id: "graph_userGroupMembersList" - mock: - dynamic: false - enabled: false - statusCode: 200 - public: true - post: - tags: - - "Graph" - - "User Groups" - - "User Group Members & Membership" - summary: "Manage the members of a User Group" - description: "This endpoint allows you to manage the user members of a User\ - \ Group.\n\n#### Sample Request\n```\ncurl -X POST https://console.jumpcloud.com/api/v2/usergroups/{GroupID}/members\ - \ \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\ - \ \\\n -H 'x-api-key: {API_KEY}' \\\n -d '{\n \"op\": \"add\",\n \"\ - type\": \"user\",\n \"id\": \"{User_ID}\"\n}'\n```" - operationId: "graph_userGroupMembersPost" - parameters: - - name: "group_id" - in: "path" - description: "ObjectID of the User Group." - required: true - type: "string" - x-exportParamName: "GroupId" - - in: "body" - name: "body" - required: false - schema: - $ref: "#/definitions/UserGroupMembersReq" - x-exportParamName: "Body" - - name: "Content-Type" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "ContentType" - - name: "Accept" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "Accept" - - name: "x-org-id" - in: "header" - description: "" - required: false - type: "string" - x-exportParamName: "XOrgId" - responses: - 204: - description: "OK" - security: - - x-api-key: [] - x-stoplight: - afterScript: null - beforeScript: null - id: "graph_userGroupMembersPost" - mock: - dynamic: false - enabled: false - statusCode: 200 - public: true - x-swagger-jumpcloud-auto-insert: true - /usergroups/{group_id}/membership: - get: - tags: - - "Graph" - - "User Groups" - - "User Group Members & Membership" - summary: "List the User Group's membership" - description: "This endpoint returns all users members that are a member of this\ - \ User Group.\n\n#### Sample Request\n```\ncurl -X GET https://console.jumpcloud.com/api/v2/usergroups/{GroupID}/membership\ - \ \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\ - \ \\\n -H 'x-api-key: {API_KEY}'\n```" - operationId: "graph_userGroupMembership" - parameters: - - name: "group_id" - in: "path" - description: "ObjectID of the User Group." - required: true - type: "string" - x-exportParamName: "GroupId" - - name: "filter" - in: "query" - description: "Supported operators are: eq, ne, gt, ge, lt, le, between, search,\ - \ in" - required: false - type: "array" - items: - type: "string" - x-exportParamName: "Filter" - - name: "limit" - in: "query" - description: "The number of records to return at once. Limited to 100." - required: false - type: "integer" - default: 10 - x-exportParamName: "Limit" - - name: "Content-Type" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "ContentType" - - name: "Accept" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "Accept" - - name: "skip" - in: "query" - description: "The offset into the records to return." - required: false - type: "integer" - default: 0 - minimum: 0 - x-exportParamName: "Skip" - - name: "sort" - in: "query" - description: "The comma separated fields used to sort the collection.\nDefault\ - \ sort is ascending, prefix with `-` to sort descending.\n" - required: false - type: "array" - items: - type: "string" - x-exportParamName: "Sort" - - name: "x-org-id" - in: "header" - description: "" - required: false - type: "string" - x-exportParamName: "XOrgId" - responses: - 200: - description: "OK" - schema: - type: "array" - items: - $ref: "#/definitions/GraphObjectWithPaths" - security: - - x-api-key: [] - x-stoplight: - afterScript: null - beforeScript: null - id: "graph_userGroupMembership" - mock: - dynamic: false - enabled: false - statusCode: 200 - public: true - /usergroups/{group_id}/office365s: - get: - tags: - - "Graph" - - "User Groups" - - "User Group Associations" - summary: "List the Office 365 instances bound to a User Group" - description: "This endpoint will return all Office 365 instances bound to a\ - \ User Group, either directly or indirectly, essentially traversing the JumpCloud\ - \ Graph for your Organization.\n\nEach element will contain the type, id,\ - \ attributes and paths\n\nThe `attributes` object is a key/value hash of compiled\ - \ graph attributes for all paths followed.\n\nThe `paths` array enumerates\ - \ each path from this User Group to the corresponding Office 365 instance;\ - \ this array represents all grouping and/or associations that would have to\ - \ be removed to deprovision the Office 365 instance from this User Group.\n\ - \nSee `/members` and `/associations` endpoints to manage those collections.\n\ - \n#### Sample Request\n```\ncurl -X GET https://console.jumpcloud.com/api/v2/usergroups/{GroupID}/office365s\ - \ \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\ - \ \\\n -H 'x-api-key: {API_KEY}'\n```" - operationId: "graph_userGroupTraverseOffice365" - parameters: - - name: "group_id" - in: "path" - description: "ObjectID of the User Group." - required: true - type: "string" - x-exportParamName: "GroupId" - - name: "limit" - in: "query" - description: "The number of records to return at once. Limited to 100." - required: false - type: "integer" - default: 10 - x-exportParamName: "Limit" - - name: "x-org-id" - in: "header" - description: "" - required: false - type: "string" - x-exportParamName: "XOrgId" - - name: "Content-Type" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "ContentType" - - name: "Accept" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "Accept" - - name: "skip" - in: "query" - description: "The offset into the records to return." - required: false - type: "integer" - default: 0 - minimum: 0 - x-exportParamName: "Skip" - - name: "filter" - in: "query" - description: "Supported operators are: eq, ne, gt, ge, lt, le, between, search,\ - \ in" - required: false - type: "array" - items: - type: "string" - x-exportParamName: "Filter" - responses: - 200: - description: "OK" - schema: - type: "array" - items: - $ref: "#/definitions/GraphObjectWithPaths" - security: - - x-api-key: [] - x-stoplight: - afterScript: null - beforeScript: null - id: "graph_userGroupTraverseOffice365" - mock: - dynamic: false - enabled: false - statusCode: 200 - public: true - /usergroups/{group_id}/radiusservers: - get: - tags: - - "Graph" - - "User Groups" - - "User Group Associations" - summary: "List the RADIUS Servers bound to a User Group" - description: "This endpoint will return all RADIUS servers bound to a User Group,\ - \ either directly or indirectly, essentially traversing the JumpCloud Graph\ - \ for your Organization.\n\nEach element will contain the type, id, attributes\ - \ and paths\n\nThe `attributes` object is a key/value hash of compiled graph\ - \ attributes for all paths followed.\n\nThe `paths` array enumerates each\ - \ path from this User Group to the corresponding RADIUS Server; this array\ - \ represents all grouping and/or associations that would have to be removed\ - \ to deprovision the RADIUS Server from this User Group.\n\nSee `/members`\ - \ and `/associations` endpoints to manage those collections.\n\n#### Sample\ - \ Request\n```\ncurl -X GET https://console.jumpcloud.com/api/v2/usergroups/{GroupID}/radiusservers\ - \ \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\ - \ \\\n -H 'x-api-key: {API_KEY}'\n\n```" - operationId: "graph_userGroupTraverseRadiusServer" - parameters: - - name: "group_id" - in: "path" - description: "ObjectID of the User Group." - required: true - type: "string" - x-exportParamName: "GroupId" - - name: "limit" - in: "query" - description: "The number of records to return at once. Limited to 100." - required: false - type: "integer" - default: 10 - x-exportParamName: "Limit" - - name: "x-org-id" - in: "header" - description: "" - required: false - type: "string" - x-exportParamName: "XOrgId" - - name: "Content-Type" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "ContentType" - - name: "Accept" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "Accept" - - name: "skip" - in: "query" - description: "The offset into the records to return." - required: false - type: "integer" - default: 0 - minimum: 0 - x-exportParamName: "Skip" - - name: "filter" - in: "query" - description: "Supported operators are: eq, ne, gt, ge, lt, le, between, search,\ - \ in" - required: false - type: "array" - items: - type: "string" - x-exportParamName: "Filter" - responses: - 200: - description: "OK" - schema: - type: "array" - items: - $ref: "#/definitions/GraphObjectWithPaths" - security: - - x-api-key: [] - x-stoplight: - afterScript: null - beforeScript: null - id: "graph_userGroupTraverseRadiusServer" - mock: - dynamic: false - enabled: false - statusCode: 200 - public: true - /usergroups/{group_id}/systemgroups: - get: - tags: - - "Graph" - - "User Groups" - - "User Group Associations" - summary: "List the System Groups bound to User Groups" - description: "This endpoint will return all System Groups bound to a User Group,\ - \ either directly or indirectly, essentially traversing the JumpCloud Graph\ - \ for your Organization.\n\nEach element will contain the type, id, attributes\ - \ and paths.\n\nThe `attributes` object is a key/value hash of compiled graph\ - \ attributes for all paths followed.\n\nThe `paths` array enumerates each\ - \ path from this User Group to the corresponding System Group; this array\ - \ represents all grouping and/or associations that would have to be removed\ - \ to deprovision the System Group from this User Group.\n\nSee `/members`\ - \ and `/associations` endpoints to manage those collections.\n\n#### Sample\ - \ Request\n```\ncurl -X GET https://console.jumpcloud.com/api/v2/usergroups/{GroupID}/systemgroups\ - \ \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\ - \ \\\n -H 'x-api-key: {API_KEY}'\n```" - operationId: "graph_userGroupTraverseSystemGroup" - parameters: - - name: "group_id" - in: "path" - description: "ObjectID of the User Group." - required: true - type: "string" - x-exportParamName: "GroupId" - - name: "limit" - in: "query" - description: "The number of records to return at once. Limited to 100." - required: false - type: "integer" - default: 10 - x-exportParamName: "Limit" - - name: "x-org-id" - in: "header" - description: "" - required: false - type: "string" - x-exportParamName: "XOrgId" - - name: "Content-Type" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "ContentType" - - name: "Accept" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "Accept" - - name: "skip" - in: "query" - description: "The offset into the records to return." - required: false - type: "integer" - default: 0 - minimum: 0 - x-exportParamName: "Skip" - - name: "filter" - in: "query" - description: "Supported operators are: eq, ne, gt, ge, lt, le, between, search,\ - \ in" - required: false - type: "array" - items: - type: "string" - x-exportParamName: "Filter" - responses: - 200: - description: "OK" - schema: - type: "array" - items: - $ref: "#/definitions/GraphObjectWithPaths" - security: - - x-api-key: [] - x-stoplight: - afterScript: null - beforeScript: null - id: "graph_userGroupTraverseSystemGroup" - mock: - dynamic: false - enabled: false - statusCode: 200 - public: true - /usergroups/{group_id}/systems: - get: - tags: - - "Graph" - - "User Groups" - - "User Group Associations" - summary: "List the Systems bound to a User Group" - description: "This endpoint will return all Systems bound to a User Group, either\ - \ directly or indirectly, essentially traversing the JumpCloud Graph for your\ - \ Organization.\n\nEach element will contain the type, id, attributes and\ - \ paths\n\nThe `attributes` object is a key/value hash of compiled graph attributes\ - \ for all paths followed.\n\nThe `paths` array enumerates each path from this\ - \ User Group to the corresponding System; this array represents all grouping\ - \ and/or associations that would have to be removed to deprovision the System\ - \ from this User Group.\n\nSee `/members` and `/associations` endpoints to\ - \ manage those collections.\n\n#### Sample Request\n```\ncurl -X GET https://console.jumpcloud.com/api/v2/usergroups/{GroupID}/systems\ - \ \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\ - \ \\\n -H 'x-api-key: {API_KEY}'\n```" - operationId: "graph_userGroupTraverseSystem" - parameters: - - name: "group_id" - in: "path" - description: "ObjectID of the User Group." - required: true - type: "string" - x-exportParamName: "GroupId" - - name: "limit" - in: "query" - description: "The number of records to return at once. Limited to 100." - required: false - type: "integer" - default: 10 - x-exportParamName: "Limit" - - name: "x-org-id" - in: "header" - description: "" - required: false - type: "string" - x-exportParamName: "XOrgId" - - name: "Content-Type" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "ContentType" - - name: "Accept" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "Accept" - - name: "skip" - in: "query" - description: "The offset into the records to return." - required: false - type: "integer" - default: 0 - minimum: 0 - x-exportParamName: "Skip" - - name: "filter" - in: "query" - description: "Supported operators are: eq, ne, gt, ge, lt, le, between, search,\ - \ in" - required: false - type: "array" - items: - type: "string" - x-exportParamName: "Filter" - responses: - 200: - description: "OK" - schema: - type: "array" - items: - $ref: "#/definitions/GraphObjectWithPaths" - security: - - x-api-key: [] - x-stoplight: - afterScript: null - beforeScript: null - id: "graph_userGroupTraverseSystem" - mock: - dynamic: false - enabled: false - statusCode: 200 - public: true - /usergroups/{id}: - get: - tags: - - "User Groups" - summary: "View an individual User Group details" - description: "This endpoint returns the details of a User Group.\n\n#### Sample\ - \ Request\n```\ncurl -X GET https://console.jumpcloud.com/api/v2/usergroups/{GroupID}\ - \ \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\ - \ \\\n -H 'x-api-key: {API_KEY}'\n```" - operationId: "groups_user_get" - parameters: - - name: "id" - in: "path" - description: "ObjectID of the User Group." - required: true - type: "string" - x-exportParamName: "Id" - - name: "Content-Type" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "ContentType" - - name: "Accept" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "Accept" - - name: "x-org-id" - in: "header" - description: "" - required: false - type: "string" - x-exportParamName: "XOrgId" - responses: - 200: - description: "OK" - schema: - $ref: "#/definitions/UserGroup" - security: - - x-api-key: [] - x-stoplight: - afterScript: null - beforeScript: null - id: "groups_user_get" - mock: - dynamic: false - enabled: false - statusCode: 200 - public: true - put: - tags: - - "User Groups" - summary: "Update a User Group" - description: "This endpoint allows you to do a full update of the User Group.\n\ - \n#### Sample Request\n```\ncurl -X PUT https://console.jumpcloud.com/api/v2/usergroups/{Group_ID}\ - \ \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\ - \ \\\n -H 'x-api-key: {API_KEY' \\\n -d '{\n \"name\": \"group_update\"\n\ - }'\n\n```" - operationId: "groups_user_put" - parameters: - - name: "id" - in: "path" - description: "ObjectID of the User Group." - required: true - type: "string" - x-exportParamName: "Id" - - in: "body" - name: "body" - required: false - schema: - $ref: "#/definitions/UserGroupPut" - x-exportParamName: "Body" - - name: "Content-Type" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "ContentType" - - name: "Accept" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "Accept" - - name: "x-org-id" - in: "header" - description: "" - required: false - type: "string" - x-exportParamName: "XOrgId" - responses: - 200: - description: "OK" - schema: - $ref: "#/definitions/UserGroup" - security: - - x-api-key: [] - x-stoplight: - afterScript: null - beforeScript: null - id: "groups_user_put" - mock: - dynamic: false - enabled: false - statusCode: 200 - public: true - delete: - tags: - - "User Groups" - summary: "Delete a User Group" - description: "This endpoint allows you to delete a User Group.\n\n#### Sample\ - \ Request\n```\ncurl -X DELETE https://console.jumpcloud.com/api/v2/usergroups/{GroupID}\ - \ \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\ - \ \\\n -H 'x-api-key: {API_KEY}'\n\n```" - operationId: "groups_user_delete" - parameters: - - name: "id" - in: "path" - description: "ObjectID of the User Group." - required: true - type: "string" - x-exportParamName: "Id" - - name: "Content-Type" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "ContentType" - - name: "Accept" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "Accept" - - name: "x-org-id" - in: "header" - description: "" - required: false - type: "string" - x-exportParamName: "XOrgId" - responses: - 204: - description: "No Content" - security: - - x-api-key: [] - x-stoplight: - afterScript: null - beforeScript: null - id: "groups_user_delete" - mock: - dynamic: false - enabled: false - statusCode: 200 - public: true - patch: - tags: - - "User Groups" - summary: "Partial update a User Group" - description: "We have hidden PATCH on the systemgroups and usergroups for now;\ - \ we don't have that implemented correctly yet, people should use PUT until\ - \ we do a true PATCH operation.\n\n#### Sample Request\n```\nhttps://console.jumpcloud.com/api/v2/usergroups/{id}\n\ - ```" - operationId: "groups_user_patch" - parameters: - - name: "id" - in: "path" - description: "ObjectID of the User Group." - required: true - type: "string" - x-exportParamName: "Id" - - in: "body" - name: "body" - required: false - schema: - $ref: "#/definitions/UserGroupPost" - x-exportParamName: "Body" - - name: "Content-Type" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "ContentType" - - name: "Accept" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "Accept" - - name: "x-org-id" - in: "header" - description: "" - required: false - type: "string" - x-exportParamName: "XOrgId" - responses: - 200: - description: "OK" - schema: - $ref: "#/definitions/UserGroup" - security: - - x-api-key: [] - x-stoplight: - afterScript: null - beforeScript: null - id: "groups_user_patch" - mock: - dynamic: false - enabled: false - statusCode: 200 - public: false - /users/{user_id}/activedirectories: - get: - tags: - - "Graph" - summary: "List the Active Directory instances bound to a User" - description: "This endpoint will return all Active Directory Instances bound\ - \ to a User, either directly or indirectly, essentially traversing the JumpCloud\ - \ Graph for your Organization.\n\nEach element will contain the type, id,\ - \ attributes and paths.\n\nThe `attributes` object is a key/value hash of\ - \ compiled graph attributes for all paths followed.\n\nThe `paths` array enumerates\ - \ each path from this User to the corresponding Active Directory instance;\ - \ this array represents all grouping and/or associations that would have to\ - \ be removed to deprovision the Active Directory instance from this User.\n\ - \nSee `/members` and `/associations` endpoints to manage those collections.\n\ - \n#### Sample Request\n```\ncurl -X GET https://console.jumpcloud.com/api/v2/users/{UserID}/activedirectories\ - \ \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\ - \ \\\n -H 'x-api-key: {API_KEY}'\n```" - operationId: "graph_userTraverseActiveDirectory" - parameters: - - name: "user_id" - in: "path" - description: "ObjectID of the User." - required: true - type: "string" - x-exportParamName: "UserId" - - name: "filter" - in: "query" - description: "Supported operators are: eq, ne, gt, ge, lt, le, between, search,\ - \ in" - required: false - type: "array" - items: - type: "string" - x-exportParamName: "Filter" - - name: "limit" - in: "query" - description: "The number of records to return at once. Limited to 100." - required: false - type: "integer" - default: 10 - x-exportParamName: "Limit" - - name: "x-org-id" - in: "header" - description: "" - required: false - type: "string" - x-exportParamName: "XOrgId" - - name: "Content-Type" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "ContentType" - - name: "Accept" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "Accept" - - name: "skip" - in: "query" - description: "The offset into the records to return." - required: false - type: "integer" - default: 0 - minimum: 0 - x-exportParamName: "Skip" - responses: - 200: - description: "" - schema: - type: "array" - items: - $ref: "#/definitions/GraphObjectWithPaths" - security: - - x-api-key: [] - x-stoplight: - afterScript: null - beforeScript: null - id: "graph_userTraverseActiveDirectory" - mock: - dynamic: false - enabled: false - statusCode: 200 - public: false - /users/{user_id}/applications: - get: - tags: - - "Graph" - - "Users" - summary: "List the Applications bound to a User" - description: "This endpoint will return all Applications bound to a User, either\ - \ directly or indirectly, essentially traversing the JumpCloud Graph for your\ - \ Organization.\n\nEach element will contain the type, id, attributes and\ - \ paths.\n\nThe `attributes` object is a key/value hash of compiled graph\ - \ attributes for all paths followed.\n\nThe `paths` array enumerates each\ - \ path from this User to the corresponding Application; this array represents\ - \ all grouping and/or associations that would have to be removed to deprovision\ - \ the Application from this User.\n\nSee `/members` and `/associations` endpoints\ - \ to manage those collections.\n\n#### Sample Request\n```\ncurl -X GET https://console.jumpcloud.com/api/v2/users/{UserID}/applications\ - \ \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\ - \ \\\n -H 'x-api-key: {API_KEY}'\n```" - operationId: "graph_userTraverseApplication" - parameters: - - name: "user_id" - in: "path" - description: "ObjectID of the User." - required: true - type: "string" - x-exportParamName: "UserId" - - name: "limit" - in: "query" - description: "The number of records to return at once. Limited to 100." - required: false - type: "integer" - default: 10 - x-exportParamName: "Limit" - - name: "x-org-id" - in: "header" - description: "" - required: false - type: "string" - x-exportParamName: "XOrgId" - - name: "Content-Type" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "ContentType" - - name: "Accept" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "Accept" - - name: "skip" - in: "query" - description: "The offset into the records to return." - required: false - type: "integer" - default: 0 - minimum: 0 - x-exportParamName: "Skip" - - name: "filter" - in: "query" - description: "Supported operators are: eq, ne, gt, ge, lt, le, between, search,\ - \ in" - required: false - type: "array" - items: - type: "string" - x-exportParamName: "Filter" - responses: - 200: - description: "OK" - schema: - type: "array" - items: - $ref: "#/definitions/GraphObjectWithPaths" - security: - - x-api-key: [] - x-stoplight: - afterScript: null - beforeScript: null - id: "graph_userTraverseApplication" - mock: - dynamic: false - enabled: false - statusCode: 200 - public: true - /users/{user_id}/associations: - get: - tags: - - "Graph" - - "Users" - summary: "List the associations of a User" - description: "This endpoint returns the _direct_ associations of a User.\n\n\ - A direct association can be a non-homogeneous relationship between 2 different\ - \ objects, for example Users and Systems.\n\n\n#### Sample Request\n```\n\ - curl -X GET https://console.jumpcloud.com/api/v2/users/{UserID}/associations?targets=system_group\ - \ \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\ - \ \\\n -H 'x-api-key: {API_KEY}'\n\n```" - operationId: "graph_userAssociationsList" - parameters: - - name: "user_id" - in: "path" - description: "ObjectID of the User." - required: true - type: "string" - x-exportParamName: "UserId" - - name: "limit" - in: "query" - description: "The number of records to return at once. Limited to 100." - required: false - type: "integer" - default: 10 - x-exportParamName: "Limit" - - name: "Content-Type" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "ContentType" - - name: "Accept" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "Accept" - - name: "skip" - in: "query" - description: "The offset into the records to return." - required: false - type: "integer" - default: 0 - minimum: 0 - x-exportParamName: "Skip" - - name: "targets" - in: "query" - description: "" - required: true - type: "array" - items: - type: "string" - enum: - - "active_directory" - - "application" - - "command" - - "g_suite" - - "ldap_server" - - "office_365" - - "policy" - - "radius_server" - - "system" - - "system_group" - x-exportParamName: "Targets" - - name: "x-org-id" - in: "header" - description: "" - required: false - type: "string" - x-exportParamName: "XOrgId" - responses: - 200: - description: "OK" - schema: - type: "array" - items: - $ref: "#/definitions/GraphConnection" - security: - - x-api-key: [] - x-stoplight: - afterScript: null - beforeScript: null - id: "graph_userAssociationsList" - mock: - dynamic: false - enabled: false - statusCode: 200 - public: true - post: - tags: - - "Graph" - - "Users" - summary: "Manage the associations of a User" - description: "This endpoint allows you to manage the _direct_ associations of\ - \ a User.\n\nA direct association can be a non-homogeneous relationship between\ - \ 2 different objects, for example Users and Systems.\n\n\n#### Sample Request\n\ - ```\ncurl -X POST https://console.jumpcloud.com/api/v2/users/{UserID}/associations\ - \ \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\ - \ \\\n -H 'x-api-key: {API_KEY}' \\\n -d '{\n \"attributes\": {\n \ - \ \"sudo\": {\n \"enabled\": true,\n \"withoutPassword\"\ - : false\n }\n },\n \"op\": \"add\",\n \"type\": \"system_group\"\ - ,\n \"id\": \"{GroupID}\"\n}'" - operationId: "graph_userAssociationsPost" - parameters: - - name: "user_id" - in: "path" - description: "ObjectID of the User." - required: true - type: "string" - x-exportParamName: "UserId" - - in: "body" - name: "body" - required: false - schema: - $ref: "#/definitions/UserGraphManagementReq" - x-exportParamName: "Body" - - name: "Content-Type" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "ContentType" - - name: "Accept" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "Accept" - - name: "x-org-id" - in: "header" - description: "" - required: false - type: "string" - x-exportParamName: "XOrgId" - responses: - 204: - description: "OK" - security: - - x-api-key: [] - x-stoplight: - afterScript: null - beforeScript: null - id: "graph_userAssociationsPost" - mock: - dynamic: false - enabled: false - statusCode: 200 - public: true - x-swagger-jumpcloud-auto-insert: true - /users/{user_id}/directories: - get: - tags: - - "Graph" - - "Users" - summary: "List the Directories bound to a User" - description: "This endpoint will return all Directories bound to a User, either\ - \ directly or indirectly, essentially traversing the JumpCloud Graph for your\ - \ Organization.\n\nEach element will contain the type, id, attributes and\ - \ paths.\n\nThe `attributes` object is a key/value hash of compiled graph\ - \ attributes for all paths followed.\n\nThe `paths` array enumerates each\ - \ path from this User to the corresponding Directory; this array represents\ - \ all grouping and/or associations that would have to be removed to deprovision\ - \ the Directory from this User.\n\nSee `/members` and `/associations` endpoints\ - \ to manage those collections.\n\n#### Sample Request\n```\ncurl -X GET https://console.jumpcloud.com/api/v2/users/{UserID}/directories\ - \ \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\ - \ \\\n -H 'x-api-key: {API_KEY}'\n```" - operationId: "graph_userTraverseDirectory" - parameters: - - name: "user_id" - in: "path" - description: "ObjectID of the User." - required: true - type: "string" - x-exportParamName: "UserId" - - name: "limit" - in: "query" - description: "The number of records to return at once. Limited to 100." - required: false - type: "integer" - default: 10 - x-exportParamName: "Limit" - - name: "x-org-id" - in: "header" - description: "" - required: false - type: "string" - x-exportParamName: "XOrgId" - - name: "Content-Type" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "ContentType" - - name: "Accept" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "Accept" - - name: "skip" - in: "query" - description: "The offset into the records to return." - required: false - type: "integer" - default: 0 - minimum: 0 - x-exportParamName: "Skip" - - name: "filter" - in: "query" - description: "Supported operators are: eq, ne, gt, ge, lt, le, between, search,\ - \ in" - required: false - type: "array" - items: - type: "string" - x-exportParamName: "Filter" - responses: - 200: - description: "OK" - schema: - type: "array" - items: - $ref: "#/definitions/GraphObjectWithPaths" - security: - - x-api-key: [] - x-stoplight: - afterScript: null - beforeScript: null - id: "graph_userTraverseDirectory" - mock: - dynamic: false - enabled: false - statusCode: 200 - public: true - /users/{user_id}/emails: - post: - tags: - - "Users" - summary: "Send User Emails" - description: "This endpoint allows you to send a specific email to a user without\ - \ waiting for or triggering a workflow." - operationId: "users_sendEmails" - parameters: - - name: "user_id" - in: "path" - description: "ObjectID of the User." - required: true - type: "string" - x-exportParamName: "UserId" - - in: "body" - name: "body" - required: false - schema: - $ref: "#/definitions/emailrequest" - x-exportParamName: "Body" - - name: "Content-Type" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "ContentType" - - name: "Accept" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "Accept" - - name: "x-org-id" - in: "header" - description: "" - required: false - type: "string" - x-exportParamName: "XOrgId" - responses: - 204: - description: "OK" - security: - - x-api-key: [] - x-stoplight: - afterScript: null - beforeScript: null - id: "users_sendEmails" - mock: - dynamic: false - enabled: false - statusCode: 200 - public: false - /users/{user_id}/gsuites: - get: - tags: - - "Graph" - - "Users" - summary: "List the G Suite instances bound to a User" - description: "This endpoint will return all G-Suite Instances bound to a User,\ - \ either directly or indirectly, essentially traversing the JumpCloud Graph\ - \ for your Organization.\n\nEach element will contain the type, id, attributes\ - \ and paths.\n\nThe `attributes` object is a key/value hash of compiled graph\ - \ attributes for all paths followed.\n\nThe `paths` array enumerates each\ - \ path from this User to the corresponding G Suite instance; this array represents\ - \ all grouping and/or associations that would have to be removed to deprovision\ - \ the G Suite instance from this User.\n\nSee `/members` and `/associations`\ - \ endpoints to manage those collections.\n\n#### Sample Request\n```\ncurl\ - \ -X GET https://console.jumpcloud.com/api/v2/users/{UserID}/gsuites \\\n\ - \ -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\ - \ \\\n -H 'x-api-key: {API_KEY}'\n```" - operationId: "graph_userTraverseGSuite" - parameters: - - name: "user_id" - in: "path" - description: "ObjectID of the User." - required: true - type: "string" - x-exportParamName: "UserId" - - name: "limit" - in: "query" - description: "The number of records to return at once. Limited to 100." - required: false - type: "integer" - default: 10 - x-exportParamName: "Limit" - - name: "x-org-id" - in: "header" - description: "" - required: false - type: "string" - x-exportParamName: "XOrgId" - - name: "Content-Type" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "ContentType" - - name: "Accept" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "Accept" - - name: "skip" - in: "query" - description: "The offset into the records to return." - required: false - type: "integer" - default: 0 - minimum: 0 - x-exportParamName: "Skip" - - name: "filter" - in: "query" - description: "Supported operators are: eq, ne, gt, ge, lt, le, between, search,\ - \ in" - required: false - type: "array" - items: - type: "string" - x-exportParamName: "Filter" - responses: - 200: - description: "OK" - schema: - type: "array" - items: - $ref: "#/definitions/GraphObjectWithPaths" - security: - - x-api-key: [] - x-stoplight: - afterScript: null - beforeScript: null - id: "graph_userTraverseGSuite" - mock: - dynamic: false - enabled: false - statusCode: 200 - public: true - /users/{user_id}/ldapservers: - get: - tags: - - "Graph" - - "Users" - summary: "List the LDAP servers bound to a User" - description: "This endpoint will return all LDAP Servers bound to a User, either\ - \ directly or indirectly, essentially traversing the JumpCloud Graph for your\ - \ Organization.\n\nEach element will contain the type, id, attributes and\ - \ paths.\n\nThe `attributes` object is a key/value hash of compiled graph\ - \ attributes for all paths followed.\n\nThe `paths` array enumerates each\ - \ path from this User to the corresponding LDAP Server; this array represents\ - \ all grouping and/or associations that would have to be removed to deprovision\ - \ the LDAP Server from this User.\n\nSee `/members` and `/associations` endpoints\ - \ to manage those collections.\n\n#### Sample Request\n```\ncurl -X GET https://console.jumpcloud.com/api/v2/users/{UserID}/ldapservers\ - \ \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\ - \ \\\n -H 'x-api-key: {API_KEY}'\n```" - operationId: "graph_userTraverseLdapServer" - parameters: - - name: "user_id" - in: "path" - description: "ObjectID of the User." - required: true - type: "string" - x-exportParamName: "UserId" - - name: "limit" - in: "query" - description: "The number of records to return at once. Limited to 100." - required: false - type: "integer" - default: 10 - x-exportParamName: "Limit" - - name: "x-org-id" - in: "header" - description: "" - required: false - type: "string" - x-exportParamName: "XOrgId" - - name: "Content-Type" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "ContentType" - - name: "Accept" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "Accept" - - name: "skip" - in: "query" - description: "The offset into the records to return." - required: false - type: "integer" - default: 0 - minimum: 0 - x-exportParamName: "Skip" - - name: "filter" - in: "query" - description: "Supported operators are: eq, ne, gt, ge, lt, le, between, search,\ - \ in" - required: false - type: "array" - items: - type: "string" - x-exportParamName: "Filter" - responses: - 200: - description: "OK" - schema: - type: "array" - items: - $ref: "#/definitions/GraphObjectWithPaths" - security: - - x-api-key: [] - x-stoplight: - afterScript: null - beforeScript: null - id: "graph_userTraverseLdapServer" - mock: - dynamic: false - enabled: false - statusCode: 200 - public: true - /users/{user_id}/memberof: - get: - tags: - - "Graph" - - "Users" - summary: "List the parent Groups of a User" - description: "This endpoint returns all the User Groups a User is a member of.\n\ - \n#### Sample Request\n```\ncurl -X GET https://console.jumpcloud.com/api/v2/users/{UserID}/memberof\ - \ \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\ - \ \\\n -H 'x-api-key: {API_KEY}'\n```" - operationId: "graph_userMemberOf" - parameters: - - name: "user_id" - in: "path" - description: "ObjectID of the User." - required: true - type: "string" - x-exportParamName: "UserId" - - name: "filter" - in: "query" - description: "Supported operators are: eq, ne, gt, ge, lt, le, between, search,\ - \ in" - required: false - type: "array" - items: - type: "string" - x-exportParamName: "Filter" - - name: "limit" - in: "query" - description: "The number of records to return at once. Limited to 100." - required: false - type: "integer" - default: 10 - x-exportParamName: "Limit" - - name: "Content-Type" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "ContentType" - - name: "Accept" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "Accept" - - name: "skip" - in: "query" - description: "The offset into the records to return." - required: false - type: "integer" - default: 0 - minimum: 0 - x-exportParamName: "Skip" - - name: "sort" - in: "query" - description: "The comma separated fields used to sort the collection.\nDefault\ - \ sort is ascending, prefix with `-` to sort descending.\n" - required: false - type: "array" - items: - type: "string" - x-exportParamName: "Sort" - - name: "x-org-id" - in: "header" - description: "" - required: false - type: "string" - x-exportParamName: "XOrgId" - responses: - 200: - description: "OK" - schema: - type: "array" - items: - $ref: "#/definitions/GraphObjectWithPaths" - security: - - x-api-key: [] - x-stoplight: - afterScript: null - beforeScript: null - id: "graph_userMemberOf" - mock: - dynamic: false - enabled: false - statusCode: 200 - public: true - /users/{user_id}/office365s: - get: - tags: - - "Graph" - - "Users" - summary: "List the Office 365 instances bound to a User" - description: "This endpoint will return all Office 365 Instances bound to a\ - \ User, either directly or indirectly, essentially traversing the JumpCloud\ - \ Graph for your Organization.\n\nEach element will contain the type, id,\ - \ attributes and paths.\n\nThe `attributes` object is a key/value hash of\ - \ compiled graph attributes for all paths followed.\n\nThe `paths` array enumerates\ - \ each path from this User to the corresponding Office 365 instance; this\ - \ array represents all grouping and/or associations that would have to be\ - \ removed to deprovision the Office 365 instance from this User.\n\nSee `/members`\ - \ and `/associations` endpoints to manage those collections.\n\n#### Sample\ - \ Request\n```\ncurl -X GET https://console.jumpcloud.com/api/v2/users/{UserID}/office365s\ - \ \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\ - \ \\\n -H 'x-api-key: {API_KEY}'\n```" - operationId: "graph_userTraverseOffice365" - parameters: - - name: "user_id" - in: "path" - description: "ObjectID of the User." - required: true - type: "string" - x-exportParamName: "UserId" - - name: "limit" - in: "query" - description: "The number of records to return at once. Limited to 100." - required: false - type: "integer" - default: 10 - x-exportParamName: "Limit" - - name: "x-org-id" - in: "header" - description: "" - required: false - type: "string" - x-exportParamName: "XOrgId" - - name: "Content-Type" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "ContentType" - - name: "Accept" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "Accept" - - name: "skip" - in: "query" - description: "The offset into the records to return." - required: false - type: "integer" - default: 0 - minimum: 0 - x-exportParamName: "Skip" - - name: "filter" - in: "query" - description: "Supported operators are: eq, ne, gt, ge, lt, le, between, search,\ - \ in" - required: false - type: "array" - items: - type: "string" - x-exportParamName: "Filter" - responses: - 200: - description: "OK" - schema: - type: "array" - items: - $ref: "#/definitions/GraphObjectWithPaths" - security: - - x-api-key: [] - x-stoplight: - afterScript: null - beforeScript: null - id: "graph_userTraverseOffice365" - mock: - dynamic: false - enabled: false - statusCode: 200 - public: true - /users/{user_id}/radiusservers: - get: - tags: - - "Graph" - - "Users" - summary: "List the RADIUS Servers bound to a User" - description: "This endpoint will return all RADIUS Servers bound to a User,\ - \ either directly or indirectly, essentially traversing the JumpCloud Graph\ - \ for your Organization.\n\nEach element will contain the type, id, attributes\ - \ and paths.\n\nThe `attributes` object is a key/value hash of compiled graph\ - \ attributes for all paths followed.\n\nThe `paths` array enumerates each\ - \ path from this User to the corresponding RADIUS Server; this array represents\ - \ all grouping and/or associations that would have to be removed to deprovision\ - \ the RADIUS Server from this User.\n\nSee `/members` and `/associations`\ - \ endpoints to manage those collections.\n\n#### Sample Request\n```\ncurl\ - \ -X GET https://console.jumpcloud.com/api/v2/users/{UserID}/radiusservers\ - \ \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\ - \ \\\n -H 'x-api-key: {API_KEY}'\n```" - operationId: "graph_userTraverseRadiusServer" - parameters: - - name: "user_id" - in: "path" - description: "ObjectID of the User." - required: true - type: "string" - x-exportParamName: "UserId" - - name: "limit" - in: "query" - description: "The number of records to return at once. Limited to 100." - required: false - type: "integer" - default: 10 - x-exportParamName: "Limit" - - name: "x-org-id" - in: "header" - description: "" - required: false - type: "string" - x-exportParamName: "XOrgId" - - name: "Content-Type" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "ContentType" - - name: "Accept" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "Accept" - - name: "skip" - in: "query" - description: "The offset into the records to return." - required: false - type: "integer" - default: 0 - minimum: 0 - x-exportParamName: "Skip" - - name: "filter" - in: "query" - description: "Supported operators are: eq, ne, gt, ge, lt, le, between, search,\ - \ in" - required: false - type: "array" - items: - type: "string" - x-exportParamName: "Filter" - responses: - 200: - description: "OK" - schema: - type: "array" - items: - $ref: "#/definitions/GraphObjectWithPaths" - security: - - x-api-key: [] - x-stoplight: - afterScript: null - beforeScript: null - id: "graph_userTraverseRadiusServer" - mock: - dynamic: false - enabled: false - statusCode: 200 - public: true - /users/{user_id}/systemgroups: - get: - tags: - - "Graph" - - "Users" - summary: "List the System Groups bound to a User" - description: "This endpoint will return all System Groups bound to a User, either\ - \ directly or indirectly, essentially traversing the JumpCloud Graph for your\ - \ Organization.\n\nEach element will contain the type, id, attributes and\ - \ paths.\n\nThe `attributes` object is a key/value hash of compiled graph\ - \ attributes for all paths followed.\n\nThe `paths` array enumerates each\ - \ path from this User to the corresponding System Group; this array represents\ - \ all grouping and/or associations that would have to be removed to deprovision\ - \ the System Group from this User.\n\nSee `/members` and `/associations` endpoints\ - \ to manage those collections.\n\n#### Sample Request\n```\ncurl -X GET https://console.jumpcloud.com/api/v2/users/{UserID}/systemgroups\\\ - \n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\ - \ \\\n -H 'x-api-key: {API_KEY}'\n```" - operationId: "graph_userTraverseSystemGroup" - parameters: - - name: "user_id" - in: "path" - description: "ObjectID of the User." - required: true - type: "string" - x-exportParamName: "UserId" - - name: "limit" - in: "query" - description: "The number of records to return at once. Limited to 100." - required: false - type: "integer" - default: 10 - x-exportParamName: "Limit" - - name: "x-org-id" - in: "header" - description: "" - required: false - type: "string" - x-exportParamName: "XOrgId" - - name: "Content-Type" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "ContentType" - - name: "Accept" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "Accept" - - name: "skip" - in: "query" - description: "The offset into the records to return." - required: false - type: "integer" - default: 0 - minimum: 0 - x-exportParamName: "Skip" - - name: "filter" - in: "query" - description: "Supported operators are: eq, ne, gt, ge, lt, le, between, search,\ - \ in" - required: false - type: "array" - items: - type: "string" - x-exportParamName: "Filter" - responses: - 200: - description: "OK" - schema: - type: "array" - items: - $ref: "#/definitions/GraphObjectWithPaths" - security: - - x-api-key: [] - x-stoplight: - afterScript: null - beforeScript: null - id: "graph_userTraverseSystemGroup" - mock: - dynamic: false - enabled: false - statusCode: 200 - public: true - /users/{user_id}/systems: - get: - tags: - - "Graph" - - "Users" - summary: "List the Systems bound to a User" - description: "This endpoint will return all Systems bound to a User, either\ - \ directly or indirectly, essentially traversing the JumpCloud Graph for your\ - \ Organization.\n\nEach element will contain the type, id, attributes and\ - \ paths.\n\nThe `attributes` object is a key/value hash of compiled graph\ - \ attributes for all paths followed.\n\nThe `paths` array enumerates each\ - \ path from this User to the corresponding System; this array represents all\ - \ grouping and/or associations that would have to be removed to deprovision\ - \ the System from this User.\n\nSee `/members` and `/associations` endpoints\ - \ to manage those collections.\n\n#### Sample Request\n```\ncurl -X GET https://console.jumpcloud.com/api/v2/users/{UserID}/systems\\\ - \n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\ - \ \\\n -H 'x-api-key: {API_KEY}'\n```" - operationId: "graph_userTraverseSystem" - parameters: - - name: "user_id" - in: "path" - description: "ObjectID of the User." - required: true - type: "string" - x-exportParamName: "UserId" - - name: "limit" - in: "query" - description: "The number of records to return at once. Limited to 100." - required: false - type: "integer" - default: 10 - x-exportParamName: "Limit" - - name: "x-org-id" - in: "header" - description: "" - required: false - type: "string" - x-exportParamName: "XOrgId" - - name: "Content-Type" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "ContentType" - - name: "Accept" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "Accept" - - name: "skip" - in: "query" - description: "The offset into the records to return." - required: false - type: "integer" - default: 0 - minimum: 0 - x-exportParamName: "Skip" - - name: "filter" - in: "query" - description: "Supported operators are: eq, ne, gt, ge, lt, le, between, search,\ - \ in" - required: false - type: "array" - items: - type: "string" - x-exportParamName: "Filter" - responses: - 200: - description: "OK" - schema: - type: "array" - items: - $ref: "#/definitions/GraphObjectWithPaths" - security: - - x-api-key: [] - x-stoplight: - afterScript: null - beforeScript: null - id: "graph_userTraverseSystem" - mock: - dynamic: false - enabled: false - statusCode: 200 - public: true - /workdays: - get: - tags: - - "Workday Import" - summary: "List Workdays" - description: "This endpoint will return all the available information about\ - \ all your instances of Workday.\n\n##### Sample Request\n```\ncurl -X GET\ - \ https://console.jumpcloud.com/api/v2/workdays/ \\\n -H 'Accept: application/json'\ - \ \\\n -H 'Content-Type: application/json' \\\n -H 'x-api-key: {API_KEY}'\n\ - \ ```" - operationId: "workdays_list" - parameters: - - name: "fields" - in: "query" - description: "The comma separated fields included in the returned records.\n\ - If omitted, the default list of fields will be returned.\n" - required: false - type: "array" - items: - type: "string" - x-exportParamName: "Fields" - - name: "limit" - in: "query" - description: "The number of records to return at once. Limited to 100." - required: false - type: "integer" - default: 10 - x-exportParamName: "Limit" - - name: "Content-Type" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "ContentType" - - name: "Accept" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "Accept" - - name: "skip" - in: "query" - description: "The offset into the records to return." - required: false - type: "integer" - default: 0 - minimum: 0 - x-exportParamName: "Skip" - - name: "sort" - in: "query" - description: "The comma separated fields used to sort the collection.\nDefault\ - \ sort is ascending, prefix with `-` to sort descending.\n" - required: false - type: "array" - items: - type: "string" - x-exportParamName: "Sort" - - name: "filter" - in: "query" - description: "Supported operators are: eq, ne, gt, ge, lt, le, between, search,\ - \ in" - required: false - type: "array" - items: - type: "string" - x-exportParamName: "Filter" - - name: "x-org-id" - in: "header" - description: "" - required: false - type: "string" - x-exportParamName: "XOrgId" - responses: - 200: - description: "" - schema: - type: "array" - items: - $ref: "#/definitions/workday-output" - security: - - x-api-key: [] - x-stoplight: - afterScript: null - beforeScript: null - id: "workdays_list" - mock: - dynamic: false - enabled: false - statusCode: 200 - public: true - post: - tags: - - "Workday Import" - summary: "Create new Workday" - description: "This endpoint allows you to create a new workday instance.\n\n\ - You must supply a username and password for `Basic Authentication` that is\ - \ the same as your WorkDay Integrator System User. Failure to provide these\ - \ credentials will result in the request being rejected.\n\nCurrently `O-Auth`\ - \ isn't a supported authentication protocol for WorkDay, but will be in the\ - \ future.\n\nCurrently, only one instance is allowed and it must be `Workday\ - \ Import`.\n\n#### Sample Request\n```\ncurl -X POST https://console.jumpcloud.com/api/v2/workdays/\ - \ \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\ - \ \\\n -H 'x-api-key: {API_KEY}' \\\n -d '{\n \"name\": \"Workday2\",\n\ - \ \"reportUrl\":\"https://workday.com/ccx/service/customreport2/gms/user/reportname?format=json\"\ - ,\n \"auth\": {\n \"basic\": {\n \"username\": \"someDeveloper\"\ - ,\n \"password\": \"notTheRealPassword\"\n }\n }\n}'\n```" - operationId: "workdays_post" - parameters: - - in: "body" - name: "body" - required: false - schema: - $ref: "#/definitions/workday-input" - x-exportParamName: "Body" - - name: "Content-Type" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "ContentType" - - name: "Accept" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "Accept" - - name: "x-org-id" - in: "header" - description: "" - required: false - type: "string" - x-exportParamName: "XOrgId" - responses: - 200: - description: "" - 201: - description: "" - schema: - $ref: "#/definitions/workday-output" - security: - - x-api-key: [] - x-stoplight: - afterScript: null - beforeScript: null - id: "workdays_post" - mock: - dynamic: false - enabled: false - statusCode: 200 - public: true - /workdays/settings: - get: - tags: - - "Workday Import" - summary: "Get Workday Settings (incomplete)" - description: "This endpoint allows you to obtain all settings needed for creating\ - \ a workday instance, specifically the URL to initiate Basic Authentication\ - \ with WorkDay.\n\n**This functionality is currently not enable for users.**" - operationId: "workdays_settings" - parameters: - - name: "state" - in: "query" - required: false - type: "string" - x-exportParamName: "State" - - name: "Content-Type" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "ContentType" - - name: "Accept" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "Accept" - - name: "x-org-id" - in: "header" - description: "" - required: false - type: "string" - x-exportParamName: "XOrgId" - responses: - 200: - description: "" - security: - - x-api-key: [] - x-stoplight: - afterScript: null - beforeScript: null - id: "workdays_settings" - mock: - dynamic: false - enabled: false - statusCode: 200 - public: false - /workdays/{id}: - get: - tags: - - "Workday Import" - summary: "Get Workday" - description: "This endpoint will return all the available information about\ - \ an instance of Workday.\n\n#### Sample Request\n\n```\ncurl -X GET https://console.jumpcloud.com/api/v2/workdays/\ - \ \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\ - \ \\\n -H 'x-api-key: {API_KEY}'\n ```" - operationId: "workdays_get" - parameters: - - name: "id" - in: "path" - required: true - type: "string" - x-exportParamName: "Id" - - name: "Content-Type" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "ContentType" - - name: "Accept" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "Accept" - - name: "x-org-id" - in: "header" - description: "" - required: false - type: "string" - x-exportParamName: "XOrgId" - responses: - 200: - description: "" - schema: - $ref: "#/definitions/workday-output" - security: - - x-api-key: [] - x-stoplight: - afterScript: null - beforeScript: null - id: "workdays_get" - mock: - dynamic: false - enabled: false - statusCode: 200 - public: true - put: - tags: - - "Workday Import" - summary: "Update Workday" - description: "This endpoint allows you to update the name and Custom Report\ - \ URL for a Workday Instance.\n\nCurrently, the name can not be changed from\ - \ the default of `Workday Import`.\n\n##### Sample Request\n```\ncurl -X PUT\ - \ https://console.jumpcloud.com/api/v2/workdays/{WorkdayID} \\\n -H 'Accept:\ - \ application/json' \\\n -H 'Content-Type: application/json' \\\n -H 'x-api-key:\ - \ {API_KEY}' \\\n -d '{\n\t\"reportUrl\":\"{Report_URL}\",\n\t\"name\":\"\ - {Name}\"\n}\t'\n```" - operationId: "workdays_put" - parameters: - - name: "id" - in: "path" - required: true - type: "string" - x-exportParamName: "Id" - - in: "body" - name: "body" - required: false - schema: - $ref: "#/definitions/workday-fields" - x-exportParamName: "Body" - - name: "Content-Type" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "ContentType" - - name: "Accept" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "Accept" - - name: "x-org-id" - in: "header" - description: "" - required: false - type: "string" - x-exportParamName: "XOrgId" - responses: - 200: - description: "" - schema: - $ref: "#/definitions/workday-output" - security: - - x-api-key: [] - x-stoplight: - afterScript: null - beforeScript: null - id: "workdays_put" - mock: - dynamic: false - enabled: false - statusCode: 200 - public: true - delete: - tags: - - "Workday Import" - summary: "Delete Workday" - description: "This endpoint allows you to delete an instance of Workday.\n\n\ - **This functionality is currently not enable for users.**" - operationId: "workdays_delete" - parameters: - - name: "id" - in: "path" - required: true - type: "string" - x-exportParamName: "Id" - - name: "Content-Type" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "ContentType" - - name: "Accept" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "Accept" - - name: "x-org-id" - in: "header" - description: "" - required: false - type: "string" - x-exportParamName: "XOrgId" - responses: - 204: - description: "" - schema: - type: "object" - properties: {} - security: - - x-api-key: [] - x-stoplight: - afterScript: null - beforeScript: null - id: "workdays_delete" - mock: - dynamic: false - enabled: false - statusCode: 200 - public: false - /workdays/{id}/import/{job_id}/results: - get: - tags: - - "Workday Import" - summary: "List Import Results" - description: "This endpoint provides a list of job results from the workday\ - \ import and will contain all imported data from Workday.\n\n#### Sample Request\n\ - ```\ncurl -X GET https://console.jumpcloud.com/api/v2/workdays/{WorkdayID}/import/{ImportJobID}/results\ - \ \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\ - \ \\\n -H 'x-api-key: {API_KEY}'\n```" - operationId: "workdays_importresults" - parameters: - - name: "id" - in: "path" - required: true - type: "string" - x-exportParamName: "Id" - - name: "job_id" - in: "path" - required: true - type: "string" - x-exportParamName: "JobId" - - name: "limit" - in: "query" - description: "The number of records to return at once. Limited to 100." - required: false - type: "integer" - default: 10 - x-exportParamName: "Limit" - - name: "skip" - in: "query" - description: "The offset into the records to return." - required: false - type: "integer" - default: 0 - minimum: 0 - x-exportParamName: "Skip" - - name: "Content-Type" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "ContentType" - - name: "Accept" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "Accept" - - name: "x-org-id" - in: "header" - description: "" - required: false - type: "string" - x-exportParamName: "XOrgId" - responses: - 200: - description: "" - schema: - type: "array" - items: - $ref: "#/definitions/job-workresult" - security: - - x-api-key: [] - x-stoplight: - afterScript: null - beforeScript: null - id: "workdays_importresults" - mock: - dynamic: false - enabled: false - statusCode: 200 - public: true - /workdays/{workday_id}/auth: - post: - tags: - - "Workday Import" - summary: "Authorize Workday" - description: "This endpoint adds an authorization method to a workday instance.\n\ - \nYou must supply a username and password for `Basic Authentication` that\ - \ is the same as your WorkDay Integrator System User. Failure to provide\ - \ these credentials will result in the request being rejected.\n\nCurrently\ - \ `O-Auth` isn't a supported authentication protocol for WorkDay, but will\ - \ be in the future.\n\n#### Sample Request\n\n```\ncurl -X POST https://console.jumpcloud.com/api/v2/workdays/{WorkDayID}/auth\ - \ \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\ - \ \\\n -H 'x-api-key: {API_KEY}' \\\n -d '{\n\t\"auth\":{\n\t \"basic\"\ - : {\n\t\t\"username\": \"someDeveloper\",\t \n\t\t\"password\": \"notTheRealPassword\"\ - \n\n\t }\n\t}\n}'\n\n```" - operationId: "workdays_authorize" - parameters: - - name: "workday_id" - in: "path" - required: true - type: "string" - x-exportParamName: "WorkdayId" - - in: "body" - name: "body" - required: false - schema: - $ref: "#/definitions/auth-input-object" - x-exportParamName: "Body" - - name: "Content-Type" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "ContentType" - - name: "Accept" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "Accept" - - name: "x-org-id" - in: "header" - description: "" - required: false - type: "string" - x-exportParamName: "XOrgId" - responses: - 204: - description: "" - security: - - x-api-key: [] - x-stoplight: - afterScript: null - beforeScript: null - id: "workdays_authorize" - mock: - dynamic: false - enabled: false - statusCode: 200 - public: true - delete: - tags: - - "Workday Import" - summary: "Deauthorize Workday" - description: "Removes any and all authorization methods from the workday instance\n\ - \n##### Sample Request\n```\ncurl -X DELETE https://console.jumpcloud.com/api/v2/workdays/{WorkDayID}/auth\ - \ \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\ - \ \\\n -H 'x-api-key: {API_KEY}'\n```" - operationId: "workdays_deauthorize" - parameters: - - name: "workday_id" - in: "path" - required: true - type: "string" - x-exportParamName: "WorkdayId" - - name: "Content-Type" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "ContentType" - - name: "Accept" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "Accept" - - name: "x-org-id" - in: "header" - description: "" - required: false - type: "string" - x-exportParamName: "XOrgId" - responses: - 204: - description: "" - security: - - x-api-key: [] - x-stoplight: - afterScript: null - beforeScript: null - id: "workdays_deauthorize" - mock: - dynamic: false - enabled: false - statusCode: 200 - public: true - /workdays/{workday_id}/import: - post: - tags: - - "Workday Import" - summary: "Workday Import" - description: "The endpoint allows you to create a Workday Import request.\n\n\ - #### Sample Request \n```\ncurl -X POST https://console.jumpcloud.com/api/v2/workdays/{WorkdayID}/import\ - \ \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\ - \ \\\n -H 'x-api-key: {API_KEY}' \\\n -d '[\n\t{\n\t\t\"email\":\"{email}\"\ - ,\n\t\t\"firstname\":\"{firstname}\",\n\t\t\"lastname\":\"{firstname}\",\n\ - \t\t\"username\":\"{username}\",\n\t\t\"attributes\":[\n\t\t\t{\"name\":\"\ - EmployeeID\",\"value\":\"0000\"},\n\t\t\t{\"name\":\"WorkdayID\",\"value\"\ - :\"name.name\"}\n\t\t\t]\n\t\t\n\t}\n]\n```" - operationId: "workdays_import" - parameters: - - name: "workday_id" - in: "path" - required: true - type: "string" - x-exportParamName: "WorkdayId" - - in: "body" - name: "body" - required: false - schema: - type: "array" - items: - $ref: "#/definitions/bulk-user-create" - x-exportParamName: "Body" - - name: "Content-Type" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "ContentType" - - name: "Accept" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "Accept" - - name: "x-org-id" - in: "header" - description: "" - required: false - type: "string" - x-exportParamName: "XOrgId" - responses: - 201: - description: "" - schema: - $ref: "#/definitions/job-id" - security: - - x-api-key: [] - x-stoplight: - afterScript: null - beforeScript: null - id: "workdays_import" - mock: - dynamic: false - enabled: false - statusCode: 200 - public: true - /workdays/{workday_id}/workers: - get: - tags: - - "Workday Import" - summary: "List Workday Workers" - description: "This endpoint will return all of the data in your WorkDay Custom\ - \ Report that has been associated with your WorkDay Instance in JumpCloud.\n\ - \n##### Sample Request\n\n```\ncurl -X GET https://console.jumpcloud.com/api/v2/workdays/{WorkDayID}/workers\ - \ \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\ - \ \\\n -H 'x-api-key: {API_KEY}'\n\n\n```" - operationId: "workdays_workers" - parameters: - - name: "workday_id" - in: "path" - required: true - type: "string" - x-exportParamName: "WorkdayId" - - name: "limit" - in: "query" - description: "The number of records to return at once. Limited to 100." - required: false - type: "integer" - default: 10 - x-exportParamName: "Limit" - - name: "Content-Type" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "ContentType" - - name: "Accept" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "Accept" - - name: "skip" - in: "query" - description: "The offset into the records to return." - required: false - type: "integer" - default: 0 - minimum: 0 - x-exportParamName: "Skip" - - name: "sort" - in: "query" - description: "The comma separated fields used to sort the collection.\nDefault\ - \ sort is ascending, prefix with `-` to sort descending.\n" - required: false - type: "array" - items: - type: "string" - x-exportParamName: "Sort" - - name: "x-org-id" - in: "header" - description: "" - required: false - type: "string" - x-exportParamName: "XOrgId" - responses: - 200: - description: "" - schema: - type: "array" - items: - $ref: "#/definitions/workday-worker" - examples: - application/json: - - lastName: "sint dolore Excepteur ad" - - attributes: {} - email: "nostrud tempor anim ips" - firstName: "et ad" - username: "Excepteur culpa nulla aliqua" - - attributes: {} - email: "veniam ullamco" - - {} - - lastName: "do" - security: - - x-api-key: [] - x-stoplight: - afterScript: null - beforeScript: null - id: "workdays_workers" - mock: - dynamic: false - enabled: false - statusCode: 200 - public: true -securityDefinitions: - x-api-key: - type: "apiKey" - name: "x-api-key" - in: "header" -definitions: - Administrator: - type: "object" - properties: - email: - type: "string" - enableMultiFactor: - type: "boolean" - firstname: - type: "string" - id: - type: "string" - lastname: - type: "string" - registered: - type: "boolean" - title: "Administrator" - example: - email: "joe@example.com" - enableMultiFactor: true - firstname: "Joe" - id: "0123456789abcdef01234567" - lastname: "Blough" - registered: false - x-stoplight: - id: "Administrator" - name: "Administrator" - public: true - AppleMDM: - type: "object" - required: - - "id" - properties: - apnsPushTopic: - type: "string" - description: "The push topic assigned to this enrollment by Apple after uploading\ - \ the Signed CSR plist." - id: - type: "string" - description: "ObjectId uniquely identifying an MDM Enrollment," - name: - type: "string" - description: "A friendly name to identify this enrollment. Not required to\ - \ be unique." - maxLength: 255 - title: "AppleMDM" - example: - apnsPushTopic: "apnsPushTopic" - name: "name" - id: "id" - x-stoplight: - id: "AppleMDM" - name: "AppleMDM" - public: true - Directory: - type: "object" - required: - - "id" - - "name" - - "type" - properties: - id: - type: "string" - description: "The ObjectID of the directory." - name: - type: "string" - description: "The name of the directory." - type: - type: "string" - description: "The type of directory." - enum: - - "active_directory" - - "g_suite" - - "ldap_server" - - "office_365" - - "workday" - title: "Directory" - example: - name: "name" - id: "id" - type: "active_directory" - x-stoplight: - id: "Directory" - name: "Directory" - public: true - DuoAccount: - type: "object" - required: - - "id" - properties: - id: - type: "string" - description: "object ID" - name: - type: "string" - description: "Duo application name." - title: "DuoAccount" - example: - name: "name" - id: "id" - x-stoplight: - id: "DuoAccount" - name: "DuoAccount" - public: true - DuoApplication: - type: "object" - required: - - "apiHost" - - "id" - - "integrationKey" - - "name" - properties: - apiHost: - type: "string" - id: - type: "string" - integrationKey: - type: "string" - name: - type: "string" - title: "DuoApplication" - example: - apiHost: "apiHost" - name: "name" - id: "id" - integrationKey: "integrationKey" - x-stoplight: - id: "DuoApplication" - name: "DuoApplication" - public: true - DuoApplicationReq: - type: "object" - required: - - "apiHost" - - "integrationKey" - - "name" - - "secretKey" - properties: - apiHost: - type: "string" - integrationKey: - type: "string" - name: - type: "string" - secretKey: - type: "string" - title: "DuoApplicationReq" - example: - secretKey: "secretKey" - apiHost: "apiHost" - name: "name" - integrationKey: "integrationKey" - x-stoplight: - id: "DuoApplicationReq" - name: "DuoApplicationReq" - public: true - DuoApplicationUpdateReq: - type: "object" - properties: - apiHost: - type: "string" - integrationKey: - type: "string" - name: - type: "string" - secretKey: - type: "string" - title: "DuoApplicationUpdateReq" - example: - secretKey: "secretKey" - apiHost: "apiHost" - name: "name" - integrationKey: "integrationKey" - x-stoplight: - id: "DuoApplicationUpdateReq" - name: "DuoApplicationUpdateReq" - public: true - DuoRegistrationApplication: - type: "object" - required: - - "apiHost" - - "integrationKey" - - "secretKey" - properties: - apiHost: - type: "string" - description: "Duo Application host name." - integrationKey: - type: "string" - description: "Duo Application integration key." - secretKey: - type: "string" - description: "Duo Application secret key." - title: "DuoRegistrationApplication" - x-stoplight: - id: "DuoRegistrationApplication" - name: "DuoRegistrationApplication" - public: true - DuoRegistrationApplicationReq: - type: "object" - required: - - "registrationApplication" - properties: - registrationApplication: - $ref: "#/definitions/DuoRegistrationApplication" - title: "DuoRegistrationApplicationReq" - x-stoplight: - id: "DuoRegistrationApplicationReq" - name: "DuoRegistrationApplicationReq" - public: true - Error: - type: "object" - properties: - code: - type: "integer" - format: "int32" - fields: - type: "string" - message: - type: "string" - title: "Error" - x-stoplight: - id: "Error" - name: "Error" - public: true - GSuiteBuiltinTranslation: - type: "string" - title: "G Suite BuiltIn Translation" - description: "Built-in translations for G Suite export:\n* `user_home_addresses`\ - \ - Translate all JumpCloud user addresses of type `home` to G Suite Directory\ - \ user addresses of type `home`\n* `user_work_addresses` - Translate all JumpCloud\ - \ user addresses of type `work` to G Suite Directory user addresses of type\ - \ `work`\n* `user_other_addresses` - Translate all JumpCloud user addresses\ - \ of type `other` to G Suite Directory user addresses of type `other`\n* `user_home_phone_numbers`\ - \ - Translate all JumpCloud user phoneNumbers of type `home` to G Suite Directory\ - \ user phones of type `home`\n* `user_mobile_phone_numbers` - Translate all\ - \ JumpCloud user phoneNumbers of type `mobile` to G Suite Directory user phones\ - \ of type `mobile`\n* `user_other_phone_numbers` - Translate all JumpCloud user\ - \ phoneNumbers of type `other` to G Suite Directory user phones of type `other`\n\ - * `user_work_phone_numbers` - Translate all JumpCloud user phoneNumbers of type\ - \ `work` to G Suite Directory user phones of type `work`\n* `user_work_fax_phone_numbers`\ - \ - Translate all JumpCloud user phoneNumbers of type `work_fax` to G Suite\ - \ Directory user phones of type `work_fax`\n* `user_work_mobile_phone_numbers`\ - \ - Translate all JumpCloud user phoneNumbers of type `work_mobile` to G Suite\ - \ Directory user phones of type `work_mobile`\n* `user_primary_organization_cost_center`\ - \ - Translate JumpCloud user `costCenter` to G Suite Directory user `costCenter`\ - \ for `primary` organization\n* `user_primary_organization_department` - Translate\ - \ JumpCloud user `department` to G Suite Directory user `department` for `primary`\ - \ organization\n* `user_primary_organization_description` - Translate JumpCloud\ - \ user `employeeType` to G Suite Directory user `description` for `primary`\ - \ organization\n* `user_primary_organization_employee_id` - Translate JumpCloud\ - \ user `employeeIdentifier` to G Suite Directory user `externalIds` element\ - \ of type `organization`\n* `user_primary_organization_title` - Translate JumpCloud\ - \ user `jobTitle` to G Suite Directory user `title` for `primary` organization\n" - enum: - - "user_home_addresses" - - "user_work_addresses" - - "user_other_addresses" - - "user_home_phone_numbers" - - "user_mobile_phone_numbers" - - "user_other_phone_numbers" - - "user_work_phone_numbers" - - "user_work_fax_phone_numbers" - - "user_work_mobile_phone_numbers" - - "user_primary_organization_cost_center" - - "user_primary_organization_department" - - "user_primary_organization_description" - - "user_primary_organization_employee_id" - - "user_primary_organization_title" - x-stoplight: - id: "GSuiteBuiltinTranslation" - name: "G Suite BuiltIn Translation" - public: true - GSuiteTranslationRule: - type: "object" - properties: - builtIn: - $ref: "#/definitions/GSuiteBuiltinTranslation" - id: - type: "string" - description: "ObjectId uniquely identifying a Translation Rule." - title: "G Suite Translation Rule" - example: - builtIn: {} - id: "id" - x-stoplight: - id: "GSuiteTranslationRule" - name: "G Suite Translation Rule" - public: true - GSuiteTranslationRuleRequest: - type: "object" - properties: - builtIn: - $ref: "#/definitions/GSuiteBuiltinTranslation" - title: "G Suite Translation Rule Request" - example: - builtIn: "user_home_addresses" - x-stoplight: - id: "GSuiteTranslationRuleRequest" - name: "G Suite Translation Rule Request" - public: true - GraphConnection: - type: "object" - required: - - "to" - properties: - from: - $ref: "#/definitions/GraphObject" - to: - $ref: "#/definitions/GraphObject" - title: "GraphConnection" - description: "Represents an edge between two graph objects. From can be omitted\ - \ if it is clear from context." - example: - from: - id: "id" - type: "type" - to: - id: "id" - type: "type" - x-stoplight: - id: "GraphConnection" - name: "GraphConnection" - public: true - GraphManagementReq: - type: "object" - required: - - "id" - - "op" - - "type" - properties: - id: - type: "string" - description: "The ObjectID of graph object being added or removed as an association." - op: - type: "string" - description: "How to modify the graph connection." - enum: - - "add" - - "remove" - - "update" - type: - $ref: "#/definitions/GraphType" - title: "GraphManagementReq" - example: - op: "add" - id: "id" - type: {} - x-stoplight: - id: "GraphManagementReq" - name: "GraphManagementReq" - public: true - GraphObject: - type: "object" - required: - - "id" - - "type" - properties: - id: - type: "string" - description: "The ObjectID of the graph object." - type: - type: "string" - description: "The type of graph object." - title: "GraphObject" - example: - id: "id" - type: "type" - x-stoplight: - id: "GraphObject" - name: "GraphObject" - public: true - GraphObjectWithPaths: - type: "object" - required: - - "id" - - "paths" - - "type" - properties: - id: - type: "string" - description: "Object ID of this graph object." - paths: - type: "array" - description: "A path through the graph between two graph objects." - items: - type: "array" - items: - $ref: "#/definitions/GraphConnection" - type: - $ref: "#/definitions/GraphType" - title: "GraphObjectWithPaths" - example: - paths: - - - from: - id: "id" - type: "type" - to: - id: "id" - type: "type" - - from: - id: "id" - type: "type" - to: - id: "id" - type: "type" - - - from: - id: "id" - type: "type" - to: - id: "id" - type: "type" - - from: - id: "id" - type: "type" - to: - id: "id" - type: "type" - id: "id" - type: {} - x-stoplight: - id: "GraphObjectWithPaths" - name: "GraphObjectWithPaths" - public: true - GraphType: - type: "string" - title: "GraphType" - description: "The graph type." - enum: - - "active_directory" - - "application" - - "command" - - "g_suite" - - "ldap_server" - - "office_365" - - "policy" - - "radius_server" - - "system" - - "system_group" - - "user" - - "user_group" - x-stoplight: - id: "GraphType" - name: "GraphType" - public: true - Group: - type: "object" - properties: - id: - type: "string" - description: "ObjectId uniquely identifying a Group." - name: - type: "string" - description: "Display name of a Group." - type: - $ref: "#/definitions/GroupType" - title: "Group" - example: - name: "name" - id: "id" - type: {} - x-stoplight: - id: "Group" - name: "Group" - public: true - GroupType: - type: "string" - title: "GroupType" - description: "The group type." - enum: - - "system_group" - - "user_group" - x-stoplight: - id: "GroupType" - name: "GroupType" - public: true - LdapServerAction: - type: "string" - title: "LDAP Server Action" - enum: - - "disable" - - "remove" - x-stoplight: - id: "LdapServerAction" - name: "LDAP Server Action" - public: true - Office365BuiltinTranslation: - type: "string" - title: "Office 365 BuiltIn Translation" - description: "Built-in translations for Office 365 (Microsoft Graph) export:\n\ - * `user_street_address` - Translate `streetAddress` field of JumpCloud user\ - \ address of type `work` to `city` field of Microsoft Graph user\n* `user_city`\ - \ - Translate `locality` field of JumpCloud user address of type `work` to `city`\ - \ field of Microsoft Graph user\n* `user_state` - Translate `region` field of\ - \ JumpCloud user address of type `work` to `state` field of Microsoft Graph\ - \ `user`\n* `user_country` - Translate `country` field of JumpCloud user address\ - \ of type `work` to `country` field of Microsoft Graph `user`\n* `user_postal_code`\ - \ - Translate `postalCode` field of JumpCloud user address of type `work` to\ - \ `postalCode` field of Microsoft Graph `user`\n* `user_business_phones` - Translate\ - \ `number` field of first JumpCloud user `phoneNumber` of type `work` to `businessPhones`\ - \ field of Microsoft Graph `user`\n* `user_mobile_phone` - Translate `number`\ - \ field of first JumpCloud user `phoneNumber` of type `mobile` to `mobilePhone`\ - \ field of Microsoft Graph `user`\n* `user_department` - Translate `department`\ - \ field of JumpCloud user to `department` field of Microsoft Graph `user`\n\ - * `user_job_title` - Translate `jobTitle` field of JumpCloud user to `jobTitle`\ - \ field of Microsoft Graph `user`\n* `user_office_location` - Translate `location`\ - \ field of JumpCloud user to `officeLocation` field of Microsoft Graph `user`" - enum: - - "user_street_address" - - "user_city" - - "user_state" - - "user_country" - - "user_postal_code" - - "user_business_phones" - - "user_mobile_phone" - - "user_department" - - "user_job_title" - - "user_office_location" - x-stoplight: - id: "Office365BuiltinTranslation" - name: "Office 365 BuiltIn Translation" - public: true - Office365TranslationRule: - type: "object" - properties: - builtIn: - $ref: "#/definitions/Office365BuiltinTranslation" - id: - type: "string" - description: "ObjectId uniquely identifying a Translation Rule." - title: "Office 365 Translation Rule" - example: - builtIn: {} - id: "id" - x-stoplight: - id: "Office365TranslationRule" - name: "Office 365 Translation Rule" - public: true - Office365TranslationRuleRequest: - type: "object" - properties: - builtIn: - $ref: "#/definitions/Office365BuiltinTranslation" - title: "Office 365 Translation Rule Request" - example: - builtIn: "user_department" - x-stoplight: - id: "Office365TranslationRuleRequest" - name: "Office 365 Translation Rule Request" - public: true - Policy: - type: "object" - properties: - id: - type: "string" - description: "ObjectId uniquely identifying a Policy." - name: - type: "string" - description: "The description for this specific Policy." - template: - $ref: "#/definitions/PolicyTemplate" - title: "Policy" - description: "An instance of a policy template." - example: - template: - displayName: "displayName" - osMetaFamily: "linux" - name: "name" - description: "description" - id: "id" - state: "state" - activation: "activation" - behavior: "behavior" - name: "name" - id: "id" - x-stoplight: - id: "Policy" - name: "Policy" - public: true - PolicyRequest: - type: "object" - required: - - "name" - properties: - name: - type: "string" - description: "The description for this specific Policy." - template: - $ref: "#/definitions/PolicyRequest_template" - values: - type: "array" - items: - $ref: "#/definitions/PolicyValue" - title: "PolicyRequest" - description: "An instance of a policy template." - example: - template: - id: "id" - values: - - configFieldID: "configFieldID" - - configFieldID: "configFieldID" - name: "name" - x-stoplight: - id: "PolicyRequest" - name: "PolicyRequest" - public: true - PolicyResult: - type: "object" - properties: - detail: - type: "string" - description: "Details pertaining to the policy result." - endedAt: - type: "string" - format: "date-time" - description: "The end of the policy application." - exitStatus: - type: "integer" - description: "The 32-bit unsigned exit status from the applying the policy." - id: - type: "string" - description: "ObjectId uniquely identifying a Policy Result." - policyID: - type: "string" - description: "ObjectId uniquely identifying the parent Policy." - startedAt: - type: "string" - format: "date-time" - description: "The start of the policy application." - state: - type: "string" - description: "Enumeration describing the state of the policy. Success, failed,\ - \ or pending." - stdErr: - type: "string" - description: "The STDERR output from applying the policy." - stdOut: - type: "string" - description: "The STDOUT output from applying the policy." - success: - type: "boolean" - description: "True if the policy was successfully applied; false otherwise." - systemID: - type: "string" - description: "ObjectId uniquely identifying the parent System." - title: "PolicyResult" - example: - systemID: "systemID" - policyID: "policyID" - stdOut: "stdOut" - endedAt: "2000-01-23T04:56:07.000+00:00" - success: true - startedAt: "2000-01-23T04:56:07.000+00:00" - detail: "detail" - id: "id" - state: "state" - stdErr: "stdErr" - exitStatus: 0 - x-stoplight: - id: "PolicyResult" - name: "PolicyResult" - public: true - PolicyTemplate: - type: "object" - properties: - activation: - type: "string" - description: "Requirements before the policy can be activated." - behavior: - type: "string" - description: "Specifics about the behavior of the policy." - description: - type: "string" - description: "The default description for the Policy." - displayName: - type: "string" - description: "The default display name for the Policy." - id: - type: "string" - description: "ObjectId uniquely identifying a Policy Template." - name: - type: "string" - description: "The unique name for the Policy Template." - osMetaFamily: - type: "string" - enum: - - "linux" - - "darwin" - - "windows" - state: - type: "string" - description: "String describing the release status of the policy template." - default: "" - title: "PolicyTemplate" - description: "The shallow information about a Policy Template." - example: - displayName: "displayName" - osMetaFamily: "linux" - name: "name" - description: "description" - id: "id" - state: "state" - activation: "activation" - behavior: "behavior" - x-stoplight: - id: "PolicyTemplate" - name: "PolicyTemplate" - public: true - PolicyTemplateConfigField: - type: "object" - required: - - "id" - - "name" - properties: - displayType: - type: "string" - description: "The default rendering for this field." - enum: - - "checkbox" - - "date" - - "email" - - "number" - - "select" - - "text" - - "textarea" - id: - type: "string" - description: "ObjectId uniquely identifying a Policy Template Configuration\ - \ Field" - label: - type: "string" - description: "The default label for this field." - name: - type: "string" - description: "A unique name identifying this config field." - position: - type: "number" - description: "The default position to render this field." - readOnly: - type: "boolean" - description: "If an admin is allowed to modify this field." - required: - type: "boolean" - description: "If this field is required for this field." - tooltip: - $ref: "#/definitions/PolicyTemplateConfigField_tooltip" - title: "PolicyTemplateConfigField" - example: - displayType: "checkbox" - name: "name" - tooltip: - template: "template" - variables: - icon: "icon" - message: "message" - readOnly: true - id: "id" - label: "label" - position: 0.80082819046101150206595775671303272247314453125 - required: true - x-stoplight: - id: "PolicyTemplateConfigField" - name: "PolicyTemplateConfigField" - public: true - PolicyTemplateWithDetails: - type: "object" - properties: - activation: - type: "string" - description: "Requirements before the policy can be activated." - behavior: - type: "string" - description: "Specifics about the behavior of the policy." - configFields: - type: "array" - description: "An unordered list of all the fields that can be configured for\ - \ this Policy Template." - items: - $ref: "#/definitions/PolicyTemplateConfigField" - description: - type: "string" - description: "The default description for the Policy." - displayName: - type: "string" - description: "The default display name for the Policy." - id: - type: "string" - description: "ObjectId uniquely identifying a Policy Template." - name: - type: "string" - description: "The unique name for the Policy Template." - osMetaFamily: - type: "string" - enum: - - "linux" - - "darwin" - - "windows" - title: "PolicyTemplateWithDetails" - description: "The shallow information about a Policy Template." - example: - displayName: "displayName" - osMetaFamily: "linux" - name: "name" - description: "description" - id: "id" - activation: "activation" - behavior: "behavior" - configFields: - - displayType: "checkbox" - name: "name" - tooltip: - template: "template" - variables: - icon: "icon" - message: "message" - readOnly: true - id: "id" - label: "label" - position: 0.80082819046101150206595775671303272247314453125 - required: true - - displayType: "checkbox" - name: "name" - tooltip: - template: "template" - variables: - icon: "icon" - message: "message" - readOnly: true - id: "id" - label: "label" - position: 0.80082819046101150206595775671303272247314453125 - required: true - x-stoplight: - id: "PolicyTemplateWithDetails" - name: "PolicyTemplateWithDetails" - public: true - PolicyValue: - type: "object" - properties: - configFieldID: - type: "string" - description: "The ObjectId of the corresponding Policy Template configuration\ - \ field." - title: "PolicyValue" - example: - configFieldID: "configFieldID" - x-stoplight: - id: "PolicyValue" - name: "PolicyValue" - public: true - PolicyWithDetails: - type: "object" - properties: - configFields: - type: "array" - items: - $ref: "#/definitions/PolicyTemplateConfigField" - id: - type: "string" - description: "ObjectId uniquely identifying a Policy." - name: - type: "string" - description: "The description for this specific Policy." - template: - $ref: "#/definitions/PolicyTemplate" - values: - type: "array" - items: - $ref: "#/definitions/PolicyValue" - title: "PolicyWithDetails" - description: "An instance of a policy template." - example: - template: - displayName: "displayName" - osMetaFamily: "linux" - name: "name" - description: "description" - id: "id" - state: "state" - activation: "activation" - behavior: "behavior" - values: - - configFieldID: "configFieldID" - - configFieldID: "configFieldID" - name: "name" - id: "id" - configFields: - - displayType: "checkbox" - name: "name" - tooltip: - template: "template" - variables: - icon: "icon" - message: "message" - readOnly: true - id: "id" - label: "label" - position: 0.80082819046101150206595775671303272247314453125 - required: true - - displayType: "checkbox" - name: "name" - tooltip: - template: "template" - variables: - icon: "icon" - message: "message" - readOnly: true - id: "id" - label: "label" - position: 0.80082819046101150206595775671303272247314453125 - required: true - x-stoplight: - id: "PolicyWithDetails" - name: "PolicyWithDetails" - public: true - Provider: - type: "object" - properties: - contact: - $ref: "#/definitions/Provider_contact" - name: - type: "string" - title: "Provider" - example: - contact: - email: "joe.blough@example.com" - name: "Joe Blough" - name: "Joe Bloughs MSP" - x-stoplight: - id: "Provider" - name: "Provider" - public: true - ProviderAdminReq: - type: "object" - required: - - "email" - properties: - email: - type: "string" - enableMultiFactor: - type: "boolean" - firstname: - type: "string" - lastname: - type: "string" - title: "ProviderAdminReq" - example: - firstname: "firstname" - enableMultiFactor: true - email: "email" - lastname: "lastname" - x-stoplight: - id: "ProviderAdminReq" - name: "ProviderAdminReq" - public: true - SystemGraphManagementReq: - type: "object" - required: - - "id" - - "op" - - "type" - properties: - attributes: - $ref: "#/definitions/SystemGraphManagementReq_attributes" - id: - type: "string" - description: "The ObjectID of graph object being added or removed as an association." - op: - type: "string" - description: "How to modify the graph connection." - enum: - - "add" - - "remove" - - "update" - type: - type: "string" - enum: - - "active_directory" - - "application" - - "command" - - "g_suite" - - "ldap_server" - - "office_365" - - "policy" - - "radius_server" - - "user" - - "user_group" - title: "SystemGraphManagementReq" - example: - op: "add" - attributes: - sudo: - withoutPassword: true - enabled: true - id: "id" - type: "active_directory" - x-stoplight: - id: "SystemGraphManagementReq" - name: "SystemGraphManagementReq" - public: true - SystemGroup: - type: "object" - properties: - id: - type: "string" - description: "ObjectId uniquely identifying a System Group." - name: - type: "string" - description: "Display name of a System Group." - type: - type: "string" - description: "The type of the group; always 'system' for a System Group." - enum: - - "system_group" - title: "SystemGroup" - example: - name: "name" - id: "id" - type: "system_group" - x-stoplight: - id: "SystemGroup" - name: "SystemGroup" - public: true - SystemGroupData: - type: "object" - required: - - "name" - properties: - name: - type: "string" - description: "Display name of a System Group." - title: "SystemGroupData" - example: - name: "name" - x-stoplight: - id: "SystemGroupData" - name: "SystemGroupData" - public: true - SystemGroupGraphManagementReq: - type: "object" - required: - - "id" - - "op" - - "type" - properties: - id: - type: "string" - description: "The ObjectID of graph object being added or removed as an association." - op: - type: "string" - description: "How to modify the graph connection." - enum: - - "add" - - "remove" - - "update" - type: - type: "string" - enum: - - "active_directory" - - "application" - - "command" - - "g_suite" - - "ldap_server" - - "office_365" - - "policy" - - "radius_server" - - "user" - - "user_group" - title: "SystemGroupGraphManagementReq" - example: - op: "add" - id: "id" - type: "active_directory" - x-stoplight: - id: "SystemGroupGraphManagementReq" - name: "SystemGroupGraphManagementReq" - public: true - SystemGroupMembersReq: - type: "object" - required: - - "id" - - "op" - - "type" - properties: - id: - type: "string" - description: "The ObjectID of member being added or removed." - op: - type: "string" - description: "How to modify the membership connection." - enum: - - "add" - - "remove" - type: - type: "string" - description: "The member type." - enum: - - "system" - title: "SystemGroupMembersReq" - example: - op: "add" - id: "id" - type: "system" - x-stoplight: - id: "SystemGroupMembersReq" - name: "SystemGroupMembersReq" - public: true - UserGraphManagementReq: - type: "object" - required: - - "id" - - "op" - - "type" - properties: - attributes: - $ref: "#/definitions/SystemGraphManagementReq_attributes" - id: - type: "string" - description: "The ObjectID of graph object being added or removed as an association." - op: - type: "string" - description: "How to modify the graph connection." - enum: - - "add" - - "remove" - - "update" - type: - type: "string" - enum: - - "active_directory" - - "application" - - "command" - - "g_suite" - - "ldap_server" - - "office_365" - - "policy" - - "radius_server" - - "system" - - "system_group" - title: "UserGraphManagementReq" - example: - op: "add" - attributes: - sudo: - withoutPassword: true - enabled: true - id: "id" - type: "active_directory" - x-stoplight: - id: "UserGraphManagementReq" - name: "UserGraphManagementReq" - public: true - UserGroup: - type: "object" - properties: - attributes: - $ref: "#/definitions/UserGroupAttributes" - id: - type: "string" - description: "ObjectId uniquely identifying a User Group." - name: - type: "string" - description: "Display name of a User Group." - type: - type: "string" - description: "The type of the group." - enum: - - "user_group" - title: "UserGroup" - example: - name: "name" - attributes: - sambaEnabled: true - posixGroups: - - name: "name" - id: 0 - - name: "name" - id: 0 - id: "id" - type: "user_group" - x-stoplight: - id: "UserGroup" - name: "UserGroup" - public: true - UserGroupAttributes: - properties: - posixGroups: - type: "array" - items: - $ref: "#/definitions/UserGroupAttributes_posixGroups" - sambaEnabled: - type: "boolean" - title: "UserGroupAttributes" - example: - sambaEnabled: true - posixGroups: - - name: "name" - id: 0 - - name: "name" - id: 0 - x-stoplight: - id: "UserGroupAttributes" - name: "UserGroupAttributes" - public: true - UserGroupGraphManagementReq: - type: "object" - required: - - "id" - - "op" - - "type" - properties: - id: - type: "string" - description: "The ObjectID of graph object being added or removed as an association." - op: - type: "string" - description: "How to modify the graph connection." - enum: - - "add" - - "remove" - - "update" - type: - type: "string" - description: "The graph type" - enum: - - "active_directory" - - "application" - - "command" - - "g_suite" - - "ldap_server" - - "office_365" - - "policy" - - "radius_server" - - "system" - - "system_group" - title: "UserGroupGraphManagementReq" - example: - op: "add" - id: "id" - type: "active_directory" - x-stoplight: - id: "UserGroupGraphManagementReq" - name: "UserGroupGraphManagementReq" - public: true - UserGroupMembersReq: - type: "object" - required: - - "id" - - "op" - - "type" - properties: - id: - type: "string" - description: "The ObjectID of member being added or removed." - op: - type: "string" - description: "How to modify the membership connection." - enum: - - "add" - - "remove" - type: - type: "string" - description: "The member type." - enum: - - "user" - title: "UserGroupMembersReq" - example: - op: "add" - id: "id" - type: "user" - x-stoplight: - id: "UserGroupMembersReq" - name: "UserGroupMembersReq" - public: true - UserGroupPost: - type: "object" - required: - - "name" - properties: - attributes: - $ref: "#/definitions/UserGroupAttributes" - name: - type: "string" - description: "Display name of a User Group." - title: "UserGroupPost" - example: - name: "name" - attributes: - sambaEnabled: true - posixGroups: - - name: "name" - id: 0 - - name: "name" - id: 0 - x-stoplight: - id: "UserGroupPost" - name: "UserGroupPost" - public: true - UserGroupPut: - type: "object" - required: - - "name" - properties: - attributes: - $ref: "#/definitions/UserGroupAttributes" - name: - type: "string" - description: "Display name of a User Group." - title: "UserGroupPut" - example: - name: "name" - attributes: - sambaEnabled: true - posixGroups: - - name: "name" - id: 0 - - name: "name" - id: 0 - x-stoplight: - id: "UserGroupPut" - name: "UserGroupPut" - public: true - active-directory-agent-get-output: - type: "object" - required: - - "id" - properties: - connectKey: - type: "string" - description: "The connect key to use when installing the Agent on a Domain\ - \ Controller." - id: - type: "string" - description: "ObjectID of this Active Directory Agent." - title: "Active Directory Agent Get Output" - example: - connectKey: "connectKey" - id: "id" - x-stoplight: - id: "active-directory-agent-get-output" - name: "Active Directory Agent Get Output" - public: true - active-directory-agent-input: - type: "object" - title: "Active Directory Agent Input" - x-stoplight: - id: "active-directory-agent-input" - name: "Active Directory Agent Input" - public: true - active-directory-agent-list-output: - type: "object" - properties: - id: - type: "string" - description: "ObjectID of this Active Directory Agent." - state: - type: "string" - enum: - - "unsealed" - - "active" - - "inactive" - title: "Active Directory Agent List Output" - example: - id: "id" - state: "unsealed" - x-stoplight: - id: "active-directory-agent-list-output" - name: "Active Directory Agent List Output" - public: true - active-directory-input: - type: "object" - properties: - domain: - type: "string" - description: "Domain name for this Active Directory instance." - title: "Active Directory Input" - x-stoplight: - id: "active-directory-input" - name: "Active Directory Input" - public: true - active-directory-output: - title: "Active Directory Output" - allOf: - - type: "object" - required: - - "id" - properties: - id: - type: "string" - description: "ObjectID of this Active Directory instance." - - $ref: "#/definitions/active-directory-input" - x-stoplight: - id: "active-directory-output" - name: "Active Directory Output" - public: true - apple-mdm-patch-input: - type: "object" - properties: - appleSignedCert: - type: "string" - description: "A signed certificate obtained from Apple after providing Apple\ - \ with the plist file provided on POST." - name: - type: "string" - description: "A new name for the Apple MDM configuration." - maxLength: 255 - title: "Apple MDM Patch Input" - x-stoplight: - id: "apple-mdm-patch-input" - name: "Apple MDM Patch Input" - public: true - auth-info: - type: "object" - properties: - expiry: - type: "string" - isValid: - type: "boolean" - message: - type: "string" - title: "Auth Info" - example: - isValid: true - expiry: "expiry" - message: "message" - x-stoplight: - id: "auth-info" - name: "Auth Info" - public: true - auth-input: - type: "object" - properties: - basic: - $ref: "#/definitions/authinput_basic" - oauth: - $ref: "#/definitions/authinput_oauth" - title: "Auth Input" - x-stoplight: - id: "auth-input" - name: "Auth Input" - public: true - auth-input-object: - type: "object" - properties: - auth: - $ref: "#/definitions/auth-input" - title: "Auth Input Object" - x-stoplight: - id: "auth-input-object" - name: "Auth Input Object" - public: true - bulk-user-create: - type: "object" - properties: - attributes: - type: "array" - description: "Map of additional attributes." - items: - type: "object" - properties: {} - email: - type: "string" - firstname: - type: "string" - lastname: - type: "string" - username: - type: "string" - title: "Bulk User Create" - description: "See [V1 system user creation](https://docs.jumpcloud.com/1.0/systemusers/create-a-system-user)\ - \ for full list of attributes." - x-stoplight: - id: "bulk-user-create" - name: "Bulk User Create" - public: true - bulk-user-update: - type: "object" - properties: - attributes: - type: "array" - description: "Map of additional attributes." - items: - type: "object" - properties: {} - email: - type: "string" - firstname: - type: "string" - id: - type: "string" - description: "Object ID of the systemuser being updated" - lastname: - type: "string" - username: - type: "string" - title: "Bulk User Update" - description: "See [V1 system user update](https://docs.jumpcloud.com/1.0/systemusers/update-a-system-user)\ - \ for full list of attributes." - x-stoplight: - id: "bulk-user-update" - name: "Bulk User Update" - public: true - emailrequest: - type: "object" - properties: - emailType: - type: "string" - enum: - - "activation" - title: "EmailRequest" - example: - emailType: "activation" - x-stoplight: - id: "emailrequest" - name: "EmailRequest" - public: true - enrollment-profile: - type: "object" - properties: - appleMdmId: - type: "string" - id: - type: "string" - title: "Enrollment Profile" - x-stoplight: - id: "enrollment-profile" - name: "Enrollment Profile" - public: true - errorresponse: - type: "object" - properties: - message: - type: "string" - title: "ErrorResponse" - x-stoplight: - id: "errorresponse" - name: "ErrorResponse" - public: true - gsuite-output: - title: "GSuite Output" - allOf: - - properties: - id: - type: "string" - userLockoutAction: - type: "string" - enum: - - "suspend" - - "maintain" - userPasswordExpirationAction: - type: "string" - enum: - - "suspend" - - "maintain" - x-stoplight: - id: "gsuite-output" - name: "GSuite Output" - public: true - gsuite-patch-input: - type: "object" - properties: - userLockoutAction: - type: "string" - enum: - - "suspend" - - "maintain" - userPasswordExpirationAction: - type: "string" - enum: - - "suspend" - - "maintain" - title: "GSuite Patch Input" - x-stoplight: - id: "gsuite-patch-input" - name: "GSuite Patch Input" - public: true - jc-enrollment-profile: - type: "object" - properties: - groups: - type: "array" - items: - type: "string" - id: - type: "string" - name: - type: "string" - organization: - type: "string" - users: - type: "array" - items: - type: "string" - title: "Enrollment Profile" - example: - organization: "organization" - name: "name" - groups: - - "groups" - - "groups" - id: "id" - users: - - "users" - - "users" - x-stoplight: - id: "jc-enrollment-profile" - name: "Enrollment Profile" - public: true - job-details: - type: "object" - properties: - adminId: - type: "string" - id: - type: "string" - meta: - type: "object" - properties: {} - name: - type: "string" - persistedFields: - type: "array" - items: - type: "string" - status: - type: "string" - updatedAt: - type: "string" - workUnitsCount: - type: "integer" - title: "Job Details" - example: - workUnitsCount: 0 - meta: "{}" - adminId: "adminId" - name: "name" - id: "id" - persistedFields: - - "persistedFields" - - "persistedFields" - status: "status" - updatedAt: "updatedAt" - x-stoplight: - id: "job-details" - name: "Job Details" - public: true - job-id: - type: "object" - properties: - jobId: - type: "string" - title: "Job ID" - example: - jobId: "jobId" - x-stoplight: - id: "job-id" - name: "Job ID" - public: true - job-workresult: - type: "object" - properties: - meta: - type: "object" - properties: {} - title: "Job WorkResult" - example: - meta: "{}" - x-stoplight: - id: "job-workresult" - name: "Job WorkResult" - public: true - ldap-server-input: - type: "object" - properties: - name: - type: "string" - description: "The name of this LDAP server" - userLockoutAction: - type: "string" - description: "action to take; one of 'remove' or 'disable'" - enum: - - "disable" - - "remove" - userPasswordExpirationAction: - type: "string" - description: "action to take; one of 'remove' or 'disable'" - enum: - - "disable" - - "remove" - title: "LDAP Server Input" - x-stoplight: - id: "ldap-server-input" - name: "LDAP Server Input" - public: true - ldap-server-output: - title: "LDAP Server Output" - allOf: - - type: "object" - required: - - "id" - properties: - id: - type: "string" - description: "Unique identifier of this LDAP server" - - $ref: "#/definitions/ldap-server-input" - x-stoplight: - id: "ldap-server-output" - name: "LDAP Server Output" - public: true - mfa: - type: "object" - properties: - configured: - type: "boolean" - exclusion: - type: "boolean" - exclusionUntil: - type: "string" - format: "date-time" - title: "mfa" - x-stoplight: - id: "mfa" - name: "mfa" - public: true - mobileconfig: - type: "string" - title: "mobileconfig" - x-stoplight: - id: "mobileconfig" - name: "mobileconfig" - public: true - oauth-code-input: - type: "object" - properties: - code: - type: "string" - title: "OAuth Code Input" - x-stoplight: - id: "oauth-code-input" - name: "OAuth Code Input" - public: true - org-crypto-settings: - type: "object" - properties: - sshKeys: - $ref: "#/definitions/orgcryptosettings_sshKeys" - title: "Org Crypto Settings" - example: - sshKeys: - keySize: 0 - validateKeySize: true - validate: true - x-stoplight: - id: "org-crypto-settings" - name: "Org Crypto Settings" - public: true - salesforce-knowledge-list-output: - title: "Salesforce Knowledge List Output" - type: "array" - items: - $ref: "#/definitions/salesforceknowledgelistoutput_inner" - x-stoplight: - id: "salesforce-knowledge-list-output" - name: "Salesforce Knowledge List Output" - public: true - samba-domain-input: - type: "object" - required: - - "name" - - "sid" - properties: - name: - type: "string" - description: "Name of this domain's WorkGroup" - sid: - type: "string" - description: "Security identifier of this domain" - title: "Samba Domain Input" - x-stoplight: - id: "samba-domain-input" - name: "Samba Domain Input" - public: true - samba-domain-output: - title: "Samba Domain Output" - allOf: - - type: "object" - required: - - "id" - properties: - id: - type: "string" - description: "Unique identifier of this domain" - - $ref: "#/definitions/samba-domain-input" - x-stoplight: - id: "samba-domain-output" - name: "Samba Domain Output" - public: true - sshkeylist: - type: "object" - properties: - _id: - type: "string" - description: "The ID of the SSH key." - create_date: - type: "string" - description: "The date the SSH key was created." - name: - type: "string" - description: "The name of the SSH key." - public_key: - type: "string" - description: "The Public SSH key." - title: "SSHKeyList" - x-stoplight: - id: "sshkeylist" - name: "SSHKeyList" - public: true - system-insights-apps: - type: "object" - properties: - applescript_enabled: - type: "string" - bundle_executable: - type: "string" - bundle_identifier: - type: "string" - bundle_name: - type: "string" - bundle_package_type: - type: "string" - bundle_short_version: - type: "string" - bundle_version: - type: "string" - category: - type: "string" - collection_time: - type: "string" - compiler: - type: "string" - copyright: - type: "string" - development_region: - type: "string" - display_name: - type: "string" - element: - type: "string" - environment: - type: "string" - info_string: - type: "string" - last_opened_time: - type: "number" - minimum_system_version: - type: "string" - name: - type: "string" - path: - type: "string" - system_id: - type: "string" - title: "System Insights Apps" - example: - applescript_enabled: "1" - bundle_executable: "App Store" - bundle_identifier: "com.apple.appstore" - bundle_name: "App Store" - bundle_package_type: "APPL" - bundle_short_version: "2.4" - bundle_version: "658.1" - category: "public.app-category.utilities" - collection_time: "2019-06-03T19:41:30.658Z" - compiler: "com.apple.compilers.llvm.clang.1_0" - copyright: "" - development_region: "English" - display_name: "App Store" - element: "" - environment: "" - info_string: "" - last_opened_time: 1.55668896350383E9 - minimum_system_version: "10.13" - name: "App Store.app" - path: "/Applications/App Store.app" - system_id: "5c9e51a13c5146f89bae12d9" - x-stoplight: - id: "system-insights-apps" - name: "System Insights Apps" - public: true - system-insights-battery: - type: "object" - properties: - amgerage: - type: "integer" - charged: - type: "integer" - charging: - type: "integer" - collection_time: - type: "string" - condition: - type: "string" - current_capacity: - type: "integer" - cycle_count: - type: "integer" - designed_capacity: - type: "integer" - health: - type: "string" - manufacture_date: - type: "integer" - manufacturer: - type: "string" - max_capacity: - type: "integer" - minutes_to_full_charge: - type: "integer" - minutes_until_empty: - type: "integer" - model: - type: "string" - percent_remaining: - type: "integer" - serial_number: - type: "string" - state: - type: "string" - system_id: - type: "string" - voltage: - type: "integer" - title: "System Insights Battery" - example: - amgerage: 93836453 - charged: 63086136 - charging: 6577424 - collection_time: "anim in dolor" - condition: "magna Ut dolor laborum" - current_capacity: 95829126 - cycle_count: -58203101 - designed_capacity: 51607498 - health: "ipsum Duis amet magna sint" - manufacture_date: 66625366 - manufacturer: "laboris" - max_capacity: 407375 - minutes_to_full_charge: -43087634 - minutes_until_empty: 56660087 - model: "cupidatat quis esse tempor nostr" - percent_remaining: -77798506 - serial_number: "est do nisi anim eu" - state: "Duis qui eu labore" - system_id: "elit nulla cillum et" - voltage: -79728034 - x-stoplight: - id: "system-insights-battery" - name: "System Insights Battery" - public: true - system-insights-bitlocker-info: - type: "object" - properties: - collection_time: - type: "string" - conversion_status: - type: "integer" - device_id: - type: "string" - drive_letter: - type: "string" - encryption_method: - type: "string" - persistent_volume_id: - type: "string" - protection_status: - type: "integer" - system_id: - type: "string" - title: "System Insights Bitlocker Info" - example: - collection_time: "2019-06-03T19:41:30.658Z" - conversion_status: 0 - devide_id: "\\\\\\\\?\\\\Volume{3ba5cc52-e0fd-45fa-b8b8-5c88f44f8b17}\\" - drive_letter: "C:" - encryption_method: "None" - persistent_volume_id: "" - protection_status: 0 - system_id: "5c9e51a13c5146f89bae12d9" - x-stoplight: - id: "system-insights-bitlocker-info" - name: "System Insights Bitlocker Info" - public: true - system-insights-browser-plugins: - type: "object" - properties: - collection_time: - type: "string" - description: - type: "string" - development_region: - type: "string" - disabled: - type: "integer" - identifier: - type: "string" - name: - type: "string" - native: - type: "integer" - path: - type: "string" - sdk: - type: "string" - system_id: - type: "string" - uid: - type: "string" - version: - type: "string" - title: "System Insights Browser Plugins" - example: - collection_time: "2019-06-03T19:41:30.858Z" - description: "LastPass Plugin" - development_region: "en-US" - disabled: 0 - identifier: "com.lastpass.nplastpass" - name: "LastPass" - native: 0 - path: "/Library/Internet Plug-Ins/nplastpass.plugin/" - sdk: "7D175" - system_id: "5c9e51a13c5146f89bae12d9" - uid: "0" - version: "4.1.7" - x-stoplight: - id: "system-insights-browser-plugins" - name: "System Insights Browser Plugins" - public: true - system-insights-chrome-extensions: - type: "object" - properties: - author: - type: "string" - collection_time: - type: "string" - description: - type: "string" - identifier: - type: "string" - locale: - type: "string" - name: - type: "string" - path: - type: "string" - permissions: - type: "string" - persistent: - type: "integer" - system_id: - type: "string" - uid: - type: "string" - update_url: - type: "string" - version: - type: "string" - title: "System Insights Chrome Extensions" - example: - author: "" - collection_time: "2019-06-03T19:41:31.125Z" - description: "Provider for discovery and services for mirroring of Chrome Media\ - \ Router" - identifier: "pkedcjkdefgpdelpbcmbmeomcjbeemfm" - locale: "en" - name: "Chrome Media Router" - path: "/Users/thomas/Library/Application Support/Google/Chrome/Default/Extensions/pkedcjkdefgpdelpbcmbmeomcjbeemfm/7419.311.0.1_0/" - permissions: "alarms, cast, cast.streaming, declarativeWebRequest, desktopCapture,\ - \ gcm, http://*/*, identity, identity.email, management, mdns, mediaRouterPrivate,\ - \ metricsPrivate, networkingPrivate, processes, storage, system.cpu, settingsPrivate,\ - \ tabCapture, tabs, webview, https://hangouts.google.com/*, https://*.google.com/cast/chromecast/home/gsse" - persistent: 0 - system_id: "5c9e51a13c5146f89bae12d9" - uid: "501" - update_url: "https://clients2.google.com/service/update2/crx" - version: "7419.311.0.1" - x-stoplight: - id: "system-insights-chrome-extensions" - name: "System Insights Chrome Extensions" - public: true - system-insights-crashes: - type: "object" - properties: - crash_path: - type: "string" - crashed_thread: - type: "string" - datetime: - type: "string" - exception_codes: - type: "string" - exception_notes: - type: "string" - exception_type: - type: "string" - identifier: - type: "string" - parent: - type: "string" - path: - type: "string" - pid: - type: "string" - registers: - type: "string" - responsible: - type: "string" - stack_trace: - type: "string" - type: - type: "string" - uid: - type: "integer" - version: - type: "string" - title: "System Insights Crashes" - example: - identifier: "identifier" - parent: "parent" - crashed_thread: "crashed_thread" - pid: "pid" - type: "type" - version: "version" - exception_notes: "exception_notes" - path: "path" - uid: 0 - datetime: "datetime" - exception_codes: "exception_codes" - responsible: "responsible" - crash_path: "crash_path" - exception_type: "exception_type" - registers: "registers" - stack_trace: "stack_trace" - x-stoplight: - id: "system-insights-crashes" - name: "System Insights Crashes" - public: true - system-insights-disk-encryption: - type: "object" - properties: - collection_time: - type: "string" - encrypted: - type: "integer" - encryption_status: - type: "string" - name: - type: "string" - system_id: - type: "string" - type: - type: "string" - uid: - type: "string" - user_uuid: - type: "string" - uuid: - type: "string" - title: "System Insights Disk Encryption" - example: - collection_time: "2019-06-03T19:41:31.557Z" - encrypted: 0 - encryption_status: "undefined" - name: "/dev/disk8" - system_id: "5c9e51a13c5146f89bae12d9" - type: "" - uid: "" - user_uuid: "" - uuid: "" - x-stoplight: - id: "system-insights-disk-encryption" - name: "System Insights Disk Encryption" - public: true - system-insights-disk-info: - type: "object" - properties: - collection_time: - type: "string" - description: - type: "string" - disk_index: - type: "integer" - disk_size: - type: "string" - hardware_model: - type: "string" - id: - type: "string" - manufacturer: - type: "string" - name: - type: "string" - partitions: - type: "integer" - pnp_device_id: - type: "string" - serial: - type: "string" - system_id: - type: "string" - type: - type: "string" - title: "System Insights Disk Info" - example: - collection_time: "2019-06-03T19:41:30.658Z" - description: "Disk drive" - disk_index: 0 - disk_size: "64420392960" - hardware_model: "VMware, VMware Virtual S SCSI Disk Device" - id: "\\\\.\\PHYSICALDRIVE0" - manufacturer: "(Standard disk drives)" - name: "\\\\.\\PHYSICALDRIVE0" - partitions: 3 - pnp_device_id: "SCSI\\DISK&VEN_VMWARE_&PROD_VMWARE_VIRTUAL_S\\5&1EC51BF7&0&000000" - serial: "" - system_id: "5c9e51a13c5146f89bae12d9" - type: "SCSI" - x-stoplight: - id: "system-insights-disk-info" - name: "System Insights Disk Info" - public: true - system-insights-etc-hosts: - type: "object" - properties: - address: - type: "string" - collection_time: - type: "string" - hostnames: - type: "string" - system_id: - type: "string" - title: "System Insights Etc Hosts" - example: - address: "192.168.2.21" - collection_time: "2019-06-03T19:41:30.658Z" - hostnames: "hosty hosty.local" - system_id: "5c9e51a13c5146f89bae12d9" - x-stoplight: - id: "system-insights-etc-hosts" - name: "System Insights Etc Hosts" - public: true - system-insights-firefox-addons: - type: "object" - properties: - active: - type: "integer" - autoupdate: - type: "integer" - collection_time: - type: "string" - creator: - type: "string" - description: - type: "string" - disabled: - type: "integer" - identifier: - type: "string" - location: - type: "string" - name: - type: "string" - path: - type: "string" - source_url: - type: "string" - system_id: - type: "string" - type: - type: "string" - uid: - type: "string" - version: - type: "string" - visible: - type: "integer" - title: "System Insights Firefox Addons" - example: - active: 1 - autoupdate: 1 - collection_time: "2019-06-03T19:41:31.204Z" - creator: "null" - description: "" - disabled: 0 - identifier: "fxmonitor@mozilla.org" - location: "app-system-addons" - name: "Firefox Monitor" - path: "" - source_url: "file:///var/folders/dn/zjm_0lzn4lv6bgnt5b3nkgxh0000gn/T/tmpaddon-9fb449" - system_id: "5c9e51a13c5146f89bae12d9" - type: "extension" - uid: "501" - version: "2.8" - visible: 1 - x-stoplight: - id: "system-insights-firefox-addons" - name: "System Insights Firefox Addons" - public: true - system-insights-groups: - type: "object" - properties: - collection_time: - type: "string" - comment: - type: "string" - gid: - type: "string" - gid_signed: - type: "string" - group_sid: - type: "string" - groupname: - type: "string" - system_id: - type: "string" - title: "System Insights Groups" - example: - collection_time: "2019-06-03T19:41:31.673Z" - comment: "" - gid: "701" - gid_signed: "701" - group_sid: "" - groupname: "1" - system_id: "5c9e51a13c5146f89bae12d9" - x-stoplight: - id: "system-insights-groups" - name: "System Insights Groups" - public: true - system-insights-ie-extensions: - type: "object" - properties: - collection_time: - type: "string" - name: - type: "string" - path: - type: "string" - registry_path: - type: "string" - system_id: - type: "string" - version: - type: "string" - title: "System Insights IE Extensions" - example: - path: "path" - system_id: "system_id" - name: "name" - collection_time: "collection_time" - version: "version" - registry_path: "registry_path" - x-stoplight: - id: "system-insights-ie-extensions" - name: "System Insights IE Extensions" - public: true - system-insights-interface-addresses: - type: "object" - properties: - address: - type: "string" - broadcast: - type: "string" - collection_time: - type: "string" - friendly_name: - type: "string" - interface: - type: "string" - mask: - type: "string" - point_to_point: - type: "string" - system_id: - type: "string" - type: - type: "string" - title: "System Insights Interface Addresses" - example: - address: "::1" - broadcast: "" - collection_time: "2019-06-03T19:41:31.008Z" - friendly_name: "" - interface: "lo0" - mask: "ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff" - point_to_point: "::1" - system_id: "5c9e51a13c5146f89bae12d9" - type: "unknown" - x-stoplight: - id: "system-insights-interface-addresses" - name: "System Insights Interface Addresses" - public: true - system-insights-kernel-info: - type: "object" - properties: - arguments: - type: "string" - collection_time: - type: "string" - device: - type: "string" - path: - type: "string" - system_id: - type: "string" - version: - type: "string" - title: "System Insights Kernel Info" - example: - path: "path" - system_id: "system_id" - arguments: "arguments" - collection_time: "collection_time" - device: "device" - version: "version" - x-stoplight: - id: "system-insights-kernel-info" - name: "System Insights Kernel Info" - public: true - system-insights-launchd: - type: "object" - properties: - collection_time: - type: "string" - disabled: - type: "string" - groupname: - type: "string" - inetd_compatibility: - type: "string" - keep_alive: - type: "string" - label: - type: "string" - name: - type: "string" - on_demand: - type: "string" - path: - type: "string" - process_type: - type: "string" - program: - type: "string" - program_arguments: - type: "string" - queue_directories: - type: "string" - root_directory: - type: "string" - run_at_load: - type: "string" - start_interval: - type: "string" - start_on_mount: - type: "string" - stderr_path: - type: "string" - stdout_path: - type: "string" - system_id: - type: "string" - username: - type: "string" - watch_paths: - type: "string" - working_directory: - type: "string" - title: "System Insights LaunchD" - example: - program_arguments: "program_arguments" - start_on_mount: "start_on_mount" - stdout_path: "stdout_path" - run_at_load: "run_at_load" - system_id: "system_id" - watch_paths: "watch_paths" - working_directory: "working_directory" - label: "label" - program: "program" - root_directory: "root_directory" - groupname: "groupname" - on_demand: "on_demand" - path: "path" - stderr_path: "stderr_path" - start_interval: "start_interval" - name: "name" - disabled: "disabled" - process_type: "process_type" - collection_time: "collection_time" - keep_alive: "keep_alive" - inetd_compatibility: "inetd_compatibility" - queue_directories: "queue_directories" - username: "username" - x-stoplight: - id: "system-insights-launchd" - name: "System Insights LaunchD" - public: true - system-insights-logged-in-users: - type: "object" - properties: - collection_time: - type: "string" - host: - type: "string" - pid: - type: "integer" - system_id: - type: "string" - time: - type: "integer" - tty: - type: "string" - type: - type: "string" - user: - type: "string" - title: "System Insights Logged-In Users" - example: - system_id: "system_id" - host: "host" - tty: "tty" - pid: 0 - collection_time: "collection_time" - time: 6 - type: "type" - user: "user" - x-stoplight: - id: "system-insights-logged-in-users" - name: "System Insights Logged-In Users" - public: true - system-insights-logical-drvies: - type: "object" - properties: - boot_partition: - type: "integer" - collection_time: - type: "string" - device_id: - type: "string" - file_system: - type: "string" - free_space: - type: "string" - size: - type: "string" - system_id: - type: "string" - type: - type: "string" - title: "System Insights Logical Drvies" - example: - boot_partition: 0 - collection_time: "2019-06-03T19:41:30.658Z" - device_id: "C:" - file_system: "NTFS" - free_space: "43194331136" - size: "63778582528" - system_id: "5c9e51a13c5146f89bae12d9" - type: "Unknown" - x-stoplight: - id: "system-insights-logical-drvies" - name: "System Insights Logical Drvies" - public: true - system-insights-mounts: - type: "object" - properties: - blocks: - type: "string" - blocks_available: - type: "string" - blocks_free: - type: "string" - blocks_size: - type: "string" - collection_time: - type: "string" - device: - type: "string" - device_alias: - type: "string" - flags: - type: "string" - inodes: - type: "string" - inodes_free: - type: "string" - path: - type: "string" - system_id: - type: "string" - type: - type: "string" - title: "System Insights Mounts" - example: - blocks: "388086" - blocks_available: "95135" - blocks_free: "95135" - blocks_size: "4096" - collection_time: "2019-06-03T19:41:31.746Z" - device: "/dev/disk5s1" - device_alias: "/dev/disk5s1" - flags: "70292505" - inodes: "4294967279" - inodes_free: "4294966853" - path: "/private/var/folders/zz/zyxvpxvq6csfxvn_n0000000000000/T/.vbfolder_1dQavK" - system_id: "5c9e51a13c5146f89bae12d9" - type: "hfs" - x-stoplight: - id: "system-insights-mounts" - name: "System Insights Mounts" - public: true - system-insights-os-version: - type: "object" - properties: - build: - type: "string" - codename: - type: "string" - collection_time: - type: "string" - install_date: - type: "string" - major: - type: "integer" - minor: - type: "integer" - name: - type: "string" - patch: - type: "integer" - platform: - type: "string" - platform_like: - type: "string" - system_id: - type: "string" - version: - type: "string" - title: "System Insights OS Version" - example: - build: "17G65" - codename: "" - collection_time: "2019-06-03T19:41:30.933Z" - install_date: "" - major: 10 - minor: 13 - name: "Mac OS X" - patch: 6 - platform: "darwin" - platform_like: "darwin" - system_id: "5c9e51a13c5146f89bae12d9" - version: "10.13.6" - x-stoplight: - id: "system-insights-os-version" - name: "System Insights OS Version" - public: true - system-insights-patches: - type: "object" - properties: - caption: - type: "string" - collection_time: - type: "string" - csname: - type: "string" - description: - type: "string" - fix_comments: - type: "string" - hotfix_id: - type: "string" - install_date: - type: "string" - installed_by: - type: "string" - installed_on: - type: "string" - system_id: - type: "string" - title: "System Insights Patches" - example: - caption: "http://support.microsoft.com/?kbid=4503308" - collection_time: "2019-06-03T19:41:31.673Z" - csname: "DESKTOP-B17DUKP" - description: "Security Update" - fix_comments: "" - hotfix_id: "KB4503308" - install_date: "" - installed_by: "NT AUTHORITY\\SYSTEM" - installed_on: "7/30/2019" - system_id: "5c9e51a13c5146f89bae12d9" - x-stoplight: - id: "system-insights-patches" - name: "System Insights Patches" - public: true - system-insights-programs: - type: "object" - properties: - collection_time: - type: "string" - identifying_number: - type: "string" - install_date: - type: "string" - install_location: - type: "string" - install_source: - type: "string" - language: - type: "string" - name: - type: "string" - publisher: - type: "string" - system_id: - type: "string" - uninstall_string: - type: "string" - version: - type: "string" - title: "System Insights Programs" - example: - collection_time: "2019-06-03T19:41:31.673Z" - identifying_number: "{2E8B8BDD-03DF-4C1C-8C99-E6A4BCBF43CE}" - install_date: "20190724" - install_location: "" - install_source: "C:\\Windows\\SoftwareDistribution\\Download\\b78f29c88063bd09e7afd48e257d0126\\\ - img\\" - language: "0" - name: "Update for Windows 10 for x64-based Systems (KB4480730)" - publisher: "Microsoft Corporation" - system_id: "5c9e51a13c5146f89bae12d9" - uninstall_string: "MsiExec.exe /X{2E8B8BDD-03DF-4C1C-8C99-E6A4BCBF43CE}" - version: "2.51.0.0" - x-stoplight: - id: "system-insights-programs" - name: "System Insights Programs" - public: true - system-insights-safari-extensions: - type: "object" - properties: - author: - type: "string" - collection_time: - type: "string" - description: - type: "string" - developer_id: - type: "string" - identifier: - type: "string" - name: - type: "string" - path: - type: "string" - sdk: - type: "string" - system_id: - type: "string" - uid: - type: "string" - update_url: - type: "string" - version: - type: "string" - title: "System Insights Safari Extensions" - example: - author: "Eyeo GmbH" - collection_time: "2019-05-16T18:58:15.673Z" - description: "Used by over 50 million people, a free ad blocker that blocks\ - \ ALL annoying ads, malware and tracking." - developer_id: "GRYYZR985A" - identifier: "org.adblockplus.adblockplussafari" - name: "Adblock Plus" - path: "/Users/samuelharvanek/Library/Safari/Extensions/Adblock Plus.safariextz" - sdk: "6.0" - system_id: "5cdb13e85a0e0719283583c0" - uid: "501" - update_url: "https://update.adblockplus.org/adblockplussafari/updates.plist" - version: "1.12.5" - x-stoplight: - id: "system-insights-safari-extensions" - name: "System Insights Safari Extensions" - public: true - system-insights-system-controls: - type: "object" - properties: - collection_time: - type: "string" - config_value: - type: "string" - current_value: - type: "string" - field_name: - type: "string" - name: - type: "string" - oid: - type: "string" - subsystem: - type: "string" - system_id: - type: "string" - type: - type: "string" - title: "System Insights System Controls" - example: - config_value: "config_value" - system_id: "system_id" - name: "name" - subsystem: "subsystem" - collection_time: "collection_time" - oid: "oid" - type: "type" - current_value: "current_value" - field_name: "field_name" - x-stoplight: - id: "system-insights-system-controls" - name: "System Insights System Controls" - public: true - system-insights-system-info: - type: "object" - properties: - collection_time: - type: "string" - computer_name: - type: "string" - cpu_brand: - type: "string" - cpu_logical_cores: - type: "integer" - cpu_microcode: - type: "string" - cpu_physical_cores: - type: "integer" - cpu_subtype: - type: "string" - cpu_type: - type: "string" - hardware_model: - type: "string" - hardware_serial: - type: "string" - hardware_vendor: - type: "string" - hardware_version: - type: "string" - hostname: - type: "string" - local_hostname: - type: "string" - physical_memory: - type: "string" - system_id: - type: "string" - uuid: - type: "string" - title: "System Insights System Info" - example: - collection_time: "2019-06-03T19:41:30.771Z" - computer_name: "Johnny’s MacBook Pro (2)" - cpu_brand: "Intel(R) Core(TM) i7-7820HQ CPU @ 2.90GHz" - cpu_logical_cores: 8 - cpu_microcode: "" - cpu_physical_cores: 4 - cpu_subtype: "Intel x86-64h Haswell" - cpu_type: "x86_64h" - hardware_model: "MacBookPro14,3 " - hardware_serial: "111111FFFFFF" - hardware_vendor: "Apple Inc. " - hardware_version: "1.0 " - hostname: "johnnys-macbook-pro-2.local" - local_hostname: "Jonnys-MacBook-Pro-2" - physical_memory: "17179869184" - system_id: "5c9e51a13c5146f89bae12d9" - uuid: "11111111-FFFF-1111-FFFF-111111111111" - x-stoplight: - id: "system-insights-system-info" - name: "System Insights System Info" - public: true - system-insights-uptime: - type: "object" - properties: - collection_time: - type: "string" - days: - type: "integer" - hours: - type: "integer" - minutes: - type: "integer" - seconds: - type: "integer" - system_id: - type: "string" - total_seconds: - type: "string" - title: "System Insights Uptime" - example: - hours: 6 - seconds: 5 - total_seconds: "total_seconds" - minutes: 1 - system_id: "system_id" - days: 0 - collection_time: "collection_time" - x-stoplight: - id: "system-insights-uptime" - name: "System Insights Uptime" - public: true - system-insights-usb-devices: - type: "object" - properties: - class: - type: "string" - collection_time: - type: "string" - model: - type: "string" - model_id: - type: "string" - protocol: - type: "string" - removable: - type: "integer" - serial: - type: "string" - subclass: - type: "string" - system_id: - type: "string" - usb_address: - type: "integer" - usb_port: - type: "integer" - vendor: - type: "string" - vendor_id: - type: "string" - version: - type: "string" - title: "System Insights USB Devices" - example: - usb_address: 6 - system_id: "system_id" - model_id: "model_id" - version: "version" - protocol: "protocol" - serial: "serial" - removable: 0 - vendor: "vendor" - vendor_id: "vendor_id" - subclass: "subclass" - model: "model" - collection_time: "collection_time" - usb_port: 1 - class: "class" - x-stoplight: - id: "system-insights-usb-devices" - name: "System Insights USB Devices" - public: true - system-insights-user-groups: - type: "object" - properties: - collection_time: - type: "string" - gid: - type: "string" - system_id: - type: "string" - uid: - type: "string" - title: "System Insights User Groups" - example: - uid: "uid" - gid: "gid" - system_id: "system_id" - collection_time: "collection_time" - x-stoplight: - id: "system-insights-user-groups" - name: "System Insights User Groups" - public: true - system-insights-users: - type: "object" - properties: - collection_time: - type: "string" - description: - type: "string" - directory: - type: "string" - gid: - type: "string" - gid_signed: - type: "string" - shell: - type: "string" - system_id: - type: "string" - type: - type: "string" - uid: - type: "string" - uid_signed: - type: "string" - username: - type: "string" - uuid: - type: "string" - title: "System Insights Users" - example: - collection_time: "2019-06-03T19:41:29.710Z" - description: "AppleEvents Daemon" - directory: "/var/empty" - gid: "55" - gid_signed: "55" - shell: "/usr/bin/false" - system_id: "5c9e51a13c5146f89bae12d9" - type: "" - uid: "55" - uid_signed: "55" - username: "_appleevents" - uuid: "FFFFEEEE-DDDD-CCCC-BBBB-AAAA00000037" - x-stoplight: - id: "system-insights-users" - name: "System Insights Users" - public: true - system-insights-windows-crashes: - type: "object" - properties: - build_number: - type: "integer" - command_line: - type: "string" - crash_path: - type: "string" - current_directory: - type: "string" - datetime: - type: "string" - exception_address: - type: "string" - exception_code: - type: "string" - exception_message: - type: "string" - machine_name: - type: "string" - major_version: - type: "integer" - minor_version: - type: "integer" - module: - type: "string" - path: - type: "string" - pid: - type: "string" - process_uptime: - type: "string" - registers: - type: "string" - stack_trace: - type: "string" - tid: - type: "string" - type: - type: "string" - username: - type: "string" - version: - type: "string" - title: "System Insights Windows Crashes" - example: - exception_address: "exception_address" - module: "module" - pid: "pid" - machine_name: "machine_name" - type: "type" - version: "version" - tid: "tid" - exception_message: "exception_message" - minor_version: 1 - path: "path" - datetime: "datetime" - major_version: 6 - exception_code: "exception_code" - process_uptime: "process_uptime" - crash_path: "crash_path" - build_number: 0 - registers: "registers" - current_directory: "current_directory" - stack_trace: "stack_trace" - command_line: "command_line" - username: "username" - x-stoplight: - id: "system-insights-windows-crashes" - name: "System Insights Windows Crashes" - public: true - systemfdekey: - type: "object" - required: - - "key" - properties: - key: - type: "string" - title: "SystemFDEKey" - x-stoplight: - id: "systemfdekey" - name: "SystemFDEKey" - public: true - systemuser: - type: "object" - properties: - _id: - type: "string" - account_locked: - type: "boolean" - activated: - type: "boolean" - allow_public_key: - type: "boolean" - associatedTagCount: - type: "integer" - minimum: 0 - attributes: - type: "array" - items: - type: "object" - properties: {} - company: - type: "string" - maxLength: 1024 - costCenter: - type: "string" - maxLength: 1024 - created: - type: "string" - department: - type: "string" - maxLength: 1024 - description: - type: "string" - maxLength: 1024 - displayname: - type: "string" - maxLength: 1024 - email: - type: "string" - maxLength: 1024 - employeeIdentifier: - type: "string" - description: "Must be unique per user. " - maxLength: 256 - employeeType: - type: "string" - maxLength: 1024 - enable_managed_uid: - type: "boolean" - enable_user_portal_multifactor: - type: "boolean" - external_dn: - type: "string" - external_source_type: - type: "string" - externally_managed: - type: "boolean" - firstname: - type: "string" - maxLength: 1024 - jobTitle: - type: "string" - maxLength: 1024 - lastname: - type: "string" - maxLength: 1024 - ldap_binding_user: - type: "boolean" - location: - type: "string" - maxLength: 1024 - mfa: - $ref: "#/definitions/mfa" - middlename: - type: "string" - maxLength: 1024 - password_expiration_date: - type: "string" - password_expired: - type: "boolean" - password_never_expires: - type: "boolean" - passwordless_sudo: - type: "boolean" - public_key: - type: "string" - samba_service_user: - type: "boolean" - ssh_keys: - type: "array" - items: - $ref: "#/definitions/sshkeylist" - sudo: - type: "boolean" - suspended: - type: "boolean" - tags: - type: "array" - items: - type: "string" - totp_enabled: - type: "boolean" - unix_guid: - type: "integer" - minimum: 1 - unix_uid: - type: "integer" - minimum: 1 - username: - type: "string" - maxLength: 1024 - title: "SystemUser" - x-stoplight: - id: "systemuser" - name: "SystemUser" - public: true - systemuserputpost: - type: "object" - required: - - "email" - - "username" - properties: - account_locked: - type: "boolean" - activated: - type: "boolean" - addresses: - type: "array" - items: - $ref: "#/definitions/systemuserputpost_addresses" - allow_public_key: - type: "boolean" - attributes: - type: "array" - items: - type: "object" - properties: {} - company: - type: "string" - costCenter: - type: "string" - department: - type: "string" - description: - type: "string" - maxLength: 1024 - displayname: - type: "string" - email: - type: "string" - maxLength: 1024 - employeeIdentifier: - type: "string" - description: "Must be unique per user. " - maxLength: 256 - employeeType: - type: "string" - enable_managed_uid: - type: "boolean" - enable_user_portal_multifactor: - type: "boolean" - external_dn: - type: "string" - external_source_type: - type: "string" - externally_managed: - type: "boolean" - firstname: - type: "string" - jobTitle: - type: "string" - lastname: - type: "string" - ldap_binding_user: - type: "boolean" - location: - type: "string" - mfa: - $ref: "#/definitions/mfa" - middlename: - type: "string" - password: - type: "string" - password_never_expires: - type: "boolean" - passwordless_sudo: - type: "boolean" - phoneNumbers: - type: "array" - items: - $ref: "#/definitions/systemuserputpost_phoneNumbers" - public_key: - type: "string" - relationships: - type: "array" - items: - type: "object" - properties: {} - samba_service_user: - type: "boolean" - sudo: - type: "boolean" - suspended: - type: "boolean" - tags: - type: "array" - items: - type: "string" - unix_guid: - type: "integer" - minimum: 1 - unix_uid: - type: "integer" - minimum: 1 - username: - type: "string" - title: "SystemUserPost" - x-stoplight: - id: "systemuserputpost" - name: "SystemUserPost" - public: true - workday-fields: - type: "object" - properties: - name: - type: "string" - reportUrl: - type: "string" - title: "Workday Fields" - x-stoplight: - id: "workday-fields" - name: "Workday Fields" - public: true - workday-input: - type: "object" - properties: - auth: - $ref: "#/definitions/auth-input" - name: - type: "string" - reportUrl: - type: "string" - title: "Workday Input" - example: - auth: - auth: - ? - : domain: "veniam" - credentials: - password: "cillum occaecat id eiusmod ullamco" - username: "mollit ex" - name: "in voluptate ullamco" - reportUrl: "eu est sint Lorem" - x-stoplight: - id: "workday-input" - name: "Workday Input" - public: true - workday-output: - type: "object" - properties: - auth: - $ref: "#/definitions/workdayoutput_auth" - id: - type: "string" - lastImport: - type: "string" - name: - type: "string" - reportUrl: - type: "string" - title: "Workday Output" - example: - lastImport: "lastImport" - auth: - basic: - isValid: true - expiry: "expiry" - message: "message" - oauth: - isValid: true - expiry: "expiry" - message: "message" - name: "name" - id: "id" - reportUrl: "reportUrl" - x-stoplight: - id: "workday-output" - name: "Workday Output" - public: true - workday-request: - type: "object" - properties: - name: - type: "string" - objectId: - type: "string" - title: "Workday Request" - x-stoplight: - id: "workday-request" - name: "Workday Request" - public: true - workday-worker: - type: "object" - properties: - attributes: - type: "object" - properties: {} - email: - type: "string" - firstName: - type: "string" - lastName: - type: "string" - username: - type: "string" - title: "Workday Worker" - x-stoplight: - id: "workday-worker" - name: "Workday Worker" - public: true - body: - type: "object" - properties: - name: - type: "string" - description: "The name used to identify this AppleMDM." - maxLength: 255 - inline_response_201: - properties: - appleMdm: - $ref: "#/definitions/AppleMDM" - signedCsrPlist: - type: "string" - example: - appleMdm: - apnsPushTopic: "apnsPushTopic" - name: "name" - id: "id" - signedCsrPlist: "signedCsrPlist" - body_1: - type: "object" - properties: - groups: - type: "array" - items: - type: "string" - name: - type: "string" - users: - type: "array" - items: - type: "string" - body_2: - type: "object" - properties: - groups: - type: "array" - items: - type: "string" - name: - type: "string" - users: - type: "array" - items: - type: "string" - body_3: - type: "object" - properties: - id: - type: "string" - userLockoutAction: - $ref: "#/definitions/LdapServerAction" - userPasswordExpirationAction: - $ref: "#/definitions/LdapServerAction" - inline_response_200: - properties: - id: - type: "string" - name: - type: "string" - userLockoutAction: - $ref: "#/definitions/LdapServerAction" - userPasswordExpirationAction: - $ref: "#/definitions/LdapServerAction" - example: - userLockoutAction: {} - name: "name" - userPasswordExpirationAction: null - id: "id" - inline_response_400: - properties: - message: - type: "string" - inline_response_200_1: - properties: - results: - type: "array" - items: - $ref: "#/definitions/Administrator" - totalCount: - type: "integer" - PolicyRequest_template: - properties: - id: - type: "string" - description: "ObjectId uniquely identifying a Policy instance; only allowed\ - \ on POST requests." - example: - id: "id" - PolicyTemplateConfigField_tooltip_variables: - properties: - icon: - type: "string" - message: - type: "string" - example: - icon: "icon" - message: "message" - PolicyTemplateConfigField_tooltip: - properties: - template: - type: "string" - variables: - $ref: "#/definitions/PolicyTemplateConfigField_tooltip_variables" - example: - template: "template" - variables: - icon: "icon" - message: "message" - Provider_contact: - properties: - email: - type: "string" - name: - type: "string" - SystemGraphManagementReq_attributes_sudo: - properties: - enabled: - type: "boolean" - withoutPassword: - type: "boolean" - example: - withoutPassword: true - enabled: true - SystemGraphManagementReq_attributes: - properties: - sudo: - $ref: "#/definitions/SystemGraphManagementReq_attributes_sudo" - description: "The graph connection's attributes" - example: - sudo: - withoutPassword: true - enabled: true - UserGroupAttributes_posixGroups: - properties: - id: - type: "integer" - name: - type: "string" - example: - name: "name" - id: 0 - authinput_basic: - properties: - password: - type: "string" - username: - type: "string" - authinput_oauth: - properties: - code: - type: "string" - orgcryptosettings_sshKeys: - properties: - keySize: - type: "integer" - validate: - type: "boolean" - validateKeySize: - type: "boolean" - example: - keySize: 0 - validateKeySize: true - validate: true - salesforceknowledgelistoutput_inner: - properties: - id: - type: "string" - systemuserputpost_addresses: - properties: - country: - type: "string" - extendedAddress: - type: "string" - locality: - type: "string" - poBox: - type: "string" - postalCode: - type: "string" - region: - type: "string" - streetAddress: - type: "string" - type: - type: "string" - systemuserputpost_phoneNumbers: - properties: - number: - type: "string" - type: - type: "string" - workdayoutput_auth: - properties: - basic: - $ref: "#/definitions/auth-info" - oauth: - $ref: "#/definitions/auth-info" - example: - basic: - isValid: true - expiry: "expiry" - message: "message" - oauth: - isValid: true - expiry: "expiry" - message: "message" -parameters: - trait:aggregate:aggregate: - name: "aggregate" - in: "query" - required: false - type: "array" - items: - type: "string" - trait:fields:fields: - name: "fields" - in: "query" - description: "The comma separated fields included in the returned records.\nIf\ - \ omitted, the default list of fields will be returned.\n" - required: false - type: "array" - items: - type: "string" - x-exportParamName: "Fields" - trait:filter:filter: - name: "filter" - in: "query" - description: "Supported operators are: eq, ne, gt, ge, lt, le, between, search,\ - \ in" - required: false - type: "array" - items: - type: "string" - x-exportParamName: "Filter" - trait:graphSystemGroupTargets:targets: - name: "targets" - in: "query" - description: "" - required: true - type: "array" - items: - type: "string" - enum: - - "active_directory" - - "application" - - "command" - - "g_suite" - - "ldap_server" - - "office_365" - - "policy" - - "radius_server" - - "user" - - "user_group" - x-exportParamName: "Targets" - trait:graphSystemTargets:targets: - name: "targets" - in: "query" - description: "" - required: true - type: "array" - items: - type: "string" - enum: - - "active_directory" - - "application" - - "command" - - "g_suite" - - "ldap_server" - - "office_365" - - "policy" - - "radius_server" - - "user" - - "user_group" - x-exportParamName: "Targets" - trait:graphTargets:targets: - name: "targets" - in: "query" - description: "" - required: true - type: "array" - items: - type: "string" - enum: - - "active_directory" - - "application" - - "command" - - "g_suite" - - "ldap_server" - - "office_365" - - "policy" - - "radius_server" - - "system" - - "system_group" - - "user" - - "user_group" - x-exportParamName: "Targets" - trait:graphUserGroupTargets:targets: - name: "targets" - in: "query" - description: "" - required: true - type: "array" - items: - type: "string" - enum: - - "active_directory" - - "application" - - "command" - - "g_suite" - - "ldap_server" - - "office_365" - - "policy" - - "radius_server" - - "system" - - "system_group" - x-exportParamName: "Targets" - trait:graphUserTargets:targets: - name: "targets" - in: "query" - description: "" - required: true - type: "array" - items: - type: "string" - enum: - - "active_directory" - - "application" - - "command" - - "g_suite" - - "ldap_server" - - "office_365" - - "policy" - - "radius_server" - - "system" - - "system_group" - x-exportParamName: "Targets" - trait:limit:limit: - name: "limit" - in: "query" - description: "The number of records to return at once. Limited to 100." - required: false - type: "integer" - default: 10 - x-exportParamName: "Limit" - trait:limitMax100:limit: - name: "limit" - in: "query" - required: false - type: "integer" - default: 10 - maximum: 100 - minimum: 0 - x-exportParamName: "Limit" - trait:listCount:x-total-count: - name: "x-total-count" - in: "header" - required: false - type: "integer" - trait:multiTenantRequestHeaders:x-org-id: - name: "x-org-id" - in: "header" - description: "" - required: false - type: "string" - x-exportParamName: "XOrgId" - trait:requestHeaders:Accept: - name: "Accept" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "Accept" - trait:requestHeaders:Content-Type: - name: "Content-Type" - in: "header" - required: true - type: "string" - default: "application/json" - x-exportParamName: "ContentType" - trait:skip:skip: - name: "skip" - in: "query" - description: "The offset into the records to return." - required: false - type: "integer" - default: 0 - minimum: 0 - x-exportParamName: "Skip" - trait:sort:sort: - name: "sort" - in: "query" - description: "The comma separated fields used to sort the collection.\nDefault\ - \ sort is ascending, prefix with `-` to sort descending.\n" - required: false - type: "array" - items: - type: "string" - x-exportParamName: "Sort" - trait:systemContextAuth:Authorization: - name: "Authorization" - in: "header" - description: "Authorization header for the System Context API" - required: false - type: "string" - x-exportParamName: "Authorization" - trait:systemContextAuth:Date: - name: "Date" - in: "header" - description: "Current date header for the System Context API" - required: false - type: "string" - x-exportParamName: "Date" - trait:systemInsightsFilter:filter: - name: "filter" - in: "query" - description: "Supported operators are: eq" - required: false - type: "array" - items: - type: "string" - x-exportParamName: "Filter" -responses: - trait:standardErrors:400: - description: "" - schema: - $ref: "#/definitions/errorresponse" - trait:standardErrors:401: - description: "" - schema: - $ref: "#/definitions/errorresponse" - trait:standardErrors:403: - description: "" - schema: - $ref: "#/definitions/errorresponse" - trait:standardErrors:404: - description: "" - schema: - $ref: "#/definitions/errorresponse" - trait:standardErrors:409: - description: "" - schema: - $ref: "#/definitions/errorresponse" - trait:standardErrors:500: - description: "" - schema: - $ref: "#/definitions/errorresponse" -x-stoplight: - afterScript: "" - beforeScript: "" - functions: {} - mock: - dynamic: false - enabled: false - textSections: - api-changelog: - content: "A history of API changes introduced as of August 2018.\n\n### 08-01-2018\n\ - \n`minor release`\n\n- [Multi-Tenant x-org-id](https://docs.jumpcloud.com/2.0/authentication-and-authorization/multi-tenant-organization-api-headers)\ - \ documentation and functionality.\n- PolicyTemplate Config Model corrections.\n\ - \n- Removed workday import results & row functionality.\n\n\n### 09-12-2018\n\ - \n`minor release`\n\n- X-Org-Id Request Header\n- Misc Text Section updates\n\ - - GET System FDE Key endpoint" - id: "api-changelog" - name: "API Changelog" - public: true - authentication-and-authorization-overview: - content: "#### Access Your API Key\n\nTo locate your API Key:\n1. Log into the\ - \ [JumpCloud Admin Console](https://console.jumpcloud.com/)\n2. Go to the\ - \ username drop down located in the top-right of the Console.\n3. Retrieve\ - \ your API key from API Settings.\n\n#### API Key Considerations\n\nThis API\ - \ key is associated to the currently logged in administrator. Other admins\ - \ will have different API keys.\n\nPlease keep this API key secret, as it\ - \ grants full access to any data accessible via your JumpCloud console account.\n\ - \nYou can also reset your API key in the same location in the JumpCloud Admin\ - \ Console.\n\n##### Recycling or Resetting Your API Key\n\nIn order to revoke\ - \ access with the current API key, simply reset your API key. This will render\ - \ all calls using the previous API key inaccessible.\n\nFor API V2 the API\ - \ key will be passed in as a header with the header name \"x-api-key\".\n\n\ - **Example**\n```\ncurl -H \"x-api-key: [YOUR_API_KEY_HERE]\" \"https://console.jumpcloud.com/api/v2/systemgroups\"\ - \n```" - id: "authentication-and-authorization-overview" - name: "API Key" - public: true - multi-tenant-organization-api-headers: - content: "Multi-Tenant Organization API Headers are available for JumpCloud\ - \ Admins to use when making API requests from Organizations that have multiple\ - \ managed organizations.\n\nThe `x-org-id` is a required header for all multi-tenant\ - \ admins when making API requests to Jumpcloud as this header will define\ - \ what organization you would like to make the request for.\n\nPlease note\ - \ that Single Tenant Admins do not need to provide this header when making\ - \ an API request.\n\n#### Header Value\n\n`x-org-id`\n\n#### API Response\ - \ Codes\n\n- `400` Malformed ID.\n- `400` x-org-id and Organization path ID\ - \ do not match.\n- `401` ID not included for multi-tenant admin\n- `403` ID\ - \ included on unsupported route.\n- `404` Organization ID Not Found.\n\n####\ - \ Sample Request\n```\ncurl -X GET https://console.jumpcloud.com/api/v2/directories\ - \ \\\n -H 'accept: application/json' \\\n -H 'content-type: application/json'\ - \ \\\n -H 'x-api-key: {API_KEY}' \\\n -H 'x-org-id: {ORG_ID}'\n\n```\n\n\ - #### To Obtain an Individual Organization ID via the UI\n\nAs a prerequisite\ - \ your Primary Organization will need to be setup for Multi-Tenancy which\ - \ will give you access to the Multi-Tenant Organization Admin Portal.\n\n\ - 1. Log into JumpCloud [Admin Console](https://console.jumpcloud.com). If you\ - \ are a multi-tenant Admin, you will automatically be routed to the Multi-Tenant\ - \ Admin Portal.\n2. From the Multi-Tenant Portal's primary navigation bar,\ - \ select the Organization you'd like to access.\n3. You will automatically\ - \ be routed to that Organization's Admin Console.\n4. Go to Settings in the\ - \ sub-tenant's primary navigation.\n5. You can obtain your Organization ID\ - \ below your Organization's Contact Information on the Settings page.\n\n\ - #### To Obtain All Organization IDs via the API\n\n1. You can make an API\ - \ request to this endpoint using the API key of your Primary Organization.\ - \ `https://console.jumpcloud.com/api/organizations/` This will return all\ - \ your managed organizations.\n\n#### Sample Request\n```\ncurl -X GET \\\n\ - \ https://console.jumpcloud.com/api/organizations/ \\\n -H 'Accept: application/json'\ - \ \\\n -H 'Content-Type: application/json' \\\n -H 'x-api-key: {API_KEY}'\n\ - \n```" - id: "multi-tenant-organization-api-headers" - name: "Multi Tenant Organization API Headers" - public: true - system-context: - content: "* [Introduction](#introduction)\n* [Supported endpoints](#supported-endpoints)\n\ - * [Response codes](#response-codes)\n* [Authentication](#authentication)\n\ - * [Additional examples](#additional-examples)\n* [Third party](#third-party)\n\ - \n### Introduction\n\nJumpCloud System Context Authorization is an alternative\ - \ way to authenticate with a subset of JumpCloud's REST APIs. Using this method\ - \ a system can manage its information and resource associations, allowing\ - \ modern auto provisioning environments to scale as needed.\n\n**Note: The\ - \ following documentation applies to Linux Operating Systems only.**\n\n###\ - \ Supported Endpoints\n\nJumpCloud System Context Authorization can be used\ - \ in conjunction with Systems endpoints found in the V1 API and certain System\ - \ Group endpoints found in the v2 API.\n\n- A system may fetch, alter, and\ - \ delete metadata about itself, including manipulating a system's Group and\ - \ Systemuser associations,\n - `/api/systems/{system_id}` | [`GET`](https://docs.jumpcloud.com/1.0/systems/list-an-individual-system)\ - \ [`PUT`](https://docs.jumpcloud.com/1.0/systems/update-a-system)\n- A system\ - \ may delete itself from your JumpCloud organization\n - `/api/systems/{system_id}`\ - \ | [`DELETE`](https://docs.jumpcloud.com/1.0/systems/delete-a-system)\n-\ - \ A system may fetch its direct resource associations under v2 (Groups)\n\ - \ - `/api/v2/systems/{system_id}/memberof` | [`GET`](https://docs.jumpcloud.com/2.0/systems/list-a-systems-group-membership)\n\ - \ - `/api/v2/systems/{system_id}/associations` | [`GET`](https://docs.jumpcloud.com/2.0/systems/list-associations-of-a-system)\n\ - \ - `/api/v2/systems/{system_id}/users` | [`GET`](https://docs.jumpcloud.com/2.0/systems/list-the-users-associated-with-a-system)\n\ - - A system may alter its direct resource associations under v2 (Groups)\n\ - \ - `/api/v2/systems/{system_id}/associations` | [`POST`](https://docs.jumpcloud.com/2.0/systems/manage-associations-of-a-system)\n\ - - A system may alter its System Group associations\n - `/api/v2/systemgroups/{systemgroup_id}/members`\ - \ | [`POST`](https://docs.jumpcloud.com/2.0/system-groups/update-a-system-group)\n\ - \ - _NOTE_ If a system attempts to alter the system group membership of\ - \ a different system the request will be rejected\n\n\n### Response Codes\n\ - \nIf endpoints other than those described above are called using the System\ - \ Context API the server will return a `401` response.\n\n### Authentication\n\ - \nTo allow for secure access to our APIs, you must authenticate each API request.\n\ - JumpCloud System Context Authorization uses [HTTP Signatures](https://tools.ietf.org/html/draft-cavage-http-signatures-00)\ - \ to authenticate API requests.\nThe HTTP Signatures sent with each request\ - \ are similar to the signatures used by the Amazon Web Services REST API.\n\ - To help with the request-signing process, we have provided an [example bash\ - \ script](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh).\ - \ This example API request simply requests the entire system record. You must\ - \ be root, or have permissions to access the contents of the `/opt/jc` directory\ - \ to generate a signature.\n\n\nHere is a breakdown of the example script,\ - \ with explanations.\n\nThe first thing the script does is extract the systemKey\ - \ from the JSON formatted `/opt/jc/jcagent.conf` file.\n\n```\n#!/bin/bash\n\ - \nconf=\"`cat /opt/jc/jcagent.conf`\"\nregex=\"systemKey\\\":\\\"(\\w+)\\\"\ - \"\n\nif [[ $conf =~ $regex ]] ; then\n systemKey=\"${BASH_REMATCH[1]}\"\n\ - fi\n```\n\nThen the script retrieves the current date in the correct format.\n\ - \n```\nnow=`date -u \"+%a, %d %h %Y %H:%M:%S GMT\"`;\n```\n\nNext we build\ - \ a signing string to demonstrate the expected signature format. The signed\ - \ string must consist of the [request-line](https://tools.ietf.org/html/rfc2616#page-35)\ - \ and the date header, separated by a newline character.\n\n```\nsignstr=\"\ - GET /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\"\n```\n\nThe next step\ - \ is to calculate and apply the signature. This is a two-step process:\n\n\ - 1. Create a signature from the signing string using the JumpCloud Agent private\ - \ key: ``printf \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key``\n\ - 1. Then Base64-encode the signature string and trim off the newline characters:\ - \ ``| openssl enc -e -a | tr -d '\\n'``\n\nThe combined steps above result\ - \ in:\n\n```\nsignature=`printf \"$signstr\" | openssl dgst -sha256 -sign\ - \ /opt/jc/client.key | openssl enc -e -a | tr -d '\\n'` ;\n```\n\nFinally,\ - \ we make sure the API call sending the signature has the same Authorization\ - \ and Date header values, HTTP method, and URL that were used in the signing\ - \ string.\n\n```\ncurl -iq \\\n -H \"Accept: application/json\" \\\n -H\ - \ \"Content-Type: application/json\" \\\n -H \"Date: ${now}\" \\\n -H \"\ - Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"request-line\ - \ date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\"\" \\\ - \n --url https://console.jumpcloud.com/api/systems/${systemKey}\n```\n\n\ - #### Input Data\n\nAll PUT and POST methods should use the HTTP Content-Type\ - \ header with a value of 'application/json'. PUT methods are used for updating\ - \ a record. POST methods are used to create a record.\n\nThe following example\ - \ demonstrates how to update the `displayName` of the system.\n\n```\nsignstr=\"\ - PUT /api/systems/${systemKey} HTTP/1.1\\ndate: ${now}\"\nsignature=`printf\ - \ \"$signstr\" | openssl dgst -sha256 -sign /opt/jc/client.key | openssl enc\ - \ -e -a | tr -d '\\n'` ;\n\ncurl -iq \\\n -d \"{\\\"displayName\\\" : \\\"\ - updated-system-name-1\\\"}\" \\\n -X \"PUT\" \\\n -H \"Content-Type: application/json\"\ - \ \\\n -H \"Accept: application/json\" \\\n -H \"Date: ${now}\" \\\n -H\ - \ \"Authorization: Signature keyId=\\\"system/${systemKey}\\\",headers=\\\"\ - request-line date\\\",algorithm=\\\"rsa-sha256\\\",signature=\\\"${signature}\\\ - \"\" \\\n --url https://console.jumpcloud.com/api/systems/${systemKey}\n\ - ```\n\n\n#### Output Data\n\nAll results will be formatted as JSON.\n\nHere\ - \ is an abbreviated example of response output:\n\n```\n{\n \"__v\": 0,\n\ - \ \"_id\": \"525ee96f52e144993e000015\",\n \"agentServer\": \"lappy386\"\ - ,\n \"agentVersion\": \"0.9.42\",\n \"arch\": \"x86_64\",\n \"connectionKey\"\ - : \"127.0.0.1_51812\",\n \"displayName\": \"ubuntu-1204\",\n \"firstContact\"\ - : \"2013-10-16T19:30:55.611Z\",\n \"hostname\": \"ubuntu-1204\"\n ...\n\ - ```\n\n\n### Additional Examples\n\n#### Signing Authentication Example\n\n\ - This example demonstrates how to make an authenticated request to fetch the\ - \ JumpCloud record for this system.\n\n[SigningExample.sh](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/shell/SigningExample.sh)\n\ - \n\n#### Shutdown Hook\n\nThis example demonstrates how to make authenticated\ - \ request on system shutdown.\nUsing an init.d script registered at run level\ - \ 0, you can call the System Context API as the system is shutting down.\n\ - \n[Instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd)\ - \ is an example of an init.d script that only runs at system shutdown.\n\n\ - After customizing the [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd)\ - \ script, you should install it on the system(s) running the JumpCloud agent...\n\ - \n1. Copy the modified [instance-shutdown-initd](https://github.com/TheJumpCloud/SystemContextAPI/blob/master/examples/instance-shutdown-initd)\ - \ to `/etc/init.d/instance-shutdown`\n2. On Ubuntu systems, run `update-rc.d\ - \ instance-shutdown defaults`. On RedHat/CentOS systems, run `chkconfig --add\ - \ instance-shutdown`\n\n\n### Third Party\n\n#### Chef Cookbooks\n\n[https://github.com/nshenry03/jumpcloud](https://github.com/nshenry03/jumpcloud)\n\ - \n[https://github.com/cjs226/jumpcloud](https://github.com/cjs226/jumpcloud)" - id: "system-context" - name: "System Context" - public: true - v2-api: - content: "### Directory Objects\n\nOur new API offers the ability to interact\ - \ with some of our core features; otherwise known as Directory Objects. The\ - \ Directory Objects are:\n\n* Commands\n* Policies\n* Applications\n* Systems\n\ - * Users\n* User Groups\n* System Groups\n* Radius Servers\n* Directories:\ - \ Office 365, LDAP,G-Suite, Active Directory\n* Duo accounts and applications.\n\ - \nThe Directory Object is an important concept to understand in order to successfully\ - \ use JumpCloud APIs.\n\n### JumpCloud Graph\n\nWe've also introduced the\ - \ concept of the JumpCloud Graph along with Directory Objects. The Graph\ - \ is a powerful aspect of our platform which will enable you to associate\ - \ objects with each other, or establish membership for certain objects to\ - \ become members of other objects.\n\nSpecific `GET` endpoints will allow\ - \ you to traverse the JumpCloud Graph to return all indirect and directly\ - \ bound objects in your organization.\n\n\n### JumpCloud Graph Model Example\n\ - \nThe diagram below highlights our association and membership model as it\ - \ relates to Directory Objects.\n\n![alt text](https://s3.amazonaws.com/jumpcloud-kb/Knowledge+Base+Photos/API+Docs/jumpcloud_graph.png\ - \ \"JumpCloud Graph Model Example\")\n\n\n### API Considerations\n\nWe are\ - \ currently in the process of migrating our [API V1](https://docs.jumpcloud.com/1.0)\ - \ features to API V2. Depending on your type of integration you may be required\ - \ to use both V1 and V2 APIs.\n\nPlease refer to our [API V1](https://docs.jumpcloud.com/1.0)\ - \ docs to understand the functionality still available in that API set.\n\n\ - ### API SDKs\n\nYou can find language specific SDKs that can help you kickstart\ - \ your Integration with JumpCloud in the following GitHub repositories:\n\n\ - * [Python](https://github.com/TheJumpCloud/jcapi-python)\n* [Go](https://github.com/TheJumpCloud/jcapi-go)\n\ - * [Ruby](https://github.com/TheJumpCloud/jcapi-ruby)\n* [Java](https://github.com/TheJumpCloud/jcapi-java)" - id: "v2-api" - name: "V2 API" - public: true - version: - groups: - docs: - - divider: false - items: - - _id: "applemdms_post" - type: "endpoints" - - _id: "applemdms_list" - type: "endpoints" - - _id: "applemdms_delete" - type: "endpoints" - - _id: "applemdms_put" - type: "endpoints" - - _id: "AppleMDM" - type: "schemas" - - _id: "apple-mdm-patch-input" - type: "schemas" - - _id: "enrollmentprofiles_list" - type: "endpoints" - - _id: "enrollmentprofiles_get" - type: "endpoints" - - _id: "enrollment-profile" - type: "schemas" - - _id: "mobileconfig" - type: "schemas" - name: "Apple MDM" - - divider: false - items: [] - name: "Application Templates" - - divider: false - items: - - _id: "org_crypto_put" - type: "endpoints" - - _id: "org_crypto_get" - type: "endpoints" - name: "Organizations" - - divider: false - items: - - _id: "v2-api" - type: "docTextSections" - - _id: "api-changelog" - type: "docTextSections" - name: "API Overview" - - description: "" - divider: false - items: - - _id: "authentication-and-authorization-overview" - type: "docTextSections" - - _id: "system-context" - type: "docTextSections" - - _id: "multi-tenant-organization-api-headers" - type: "docTextSections" - name: "Authentication & Authorization" - - description: "You can associate your groups of users to Active Directory." - divider: false - items: - - _id: "graph_activeDirectoryAssociationsPost" - type: "endpoints" - - _id: "activedirectories_post" - type: "endpoints" - - _id: "activedirectories_delete" - type: "endpoints" - - _id: "activedirectories_list" - type: "endpoints" - - _id: "activedirectories_get" - type: "endpoints" - - _id: "graph_activeDirectoryTraverseUserGroup" - type: "endpoints" - - _id: "graph_activeDirectoryAssociationsList" - type: "endpoints" - - _id: "activedirectories_agentsList" - type: "endpoints" - - _id: "activedirectories_agentsGet" - type: "endpoints" - - _id: "activedirectories_agentsDelete" - type: "endpoints" - - _id: "activedirectories_agentsPost" - type: "endpoints" - name: "Active Directory" - - description: "You can associate your Groups of Users with Applications that\ - \ are SSO enabled for easy access via JumpCloud's User Portal.\n\nPlease\ - \ see [this page](https://jumpcloud.com/daas-product/sso-single-sign-on)\ - \ for a full list of supported SSO apps." - divider: false - items: - - _id: "oSvkKjXMXDRCDigPW" - type: "endpoints" - - _id: "graph_applicationAssociationsPost" - type: "endpoints" - - _id: "graph_applicationAssociationsList" - type: "endpoints" - - _id: "graph_applicationTraverseUser" - type: "endpoints" - - _id: "graph_applicationTraverseUserGroup" - type: "endpoints" - - _id: "GpsCqv5EJe7C8g3gi" - type: "endpoints" - name: "Applications" - - divider: false - items: - - _id: "bulk_usersCreateResults" - type: "endpoints" - - _id: "bulk_usersCreate" - type: "endpoints" - - _id: "bulk_usersUpdate" - type: "endpoints" - - _id: "jobs_results" - type: "endpoints" - - _id: "jobs_get" - type: "endpoints" - name: "Bulk Job Requests" - - description: "You can associate your Groups of Users or Systems with Commands.\n\ - \nPlease see [this page](https://support.jumpcloud.com/support/s/article/using-the-commands-tab1)\ - \ for more information on Commands." - divider: false - items: - - _id: "4b2YvGPq7gRTpuNsk" - type: "endpoints" - - _id: "cubfZCh9HKWWqnSR7" - type: "endpoints" - - _id: "graph_commandAssociationsPost" - type: "endpoints" - - _id: "graph_commandAssociationsList" - type: "endpoints" - - _id: "graph_commandTraverseSystem" - type: "endpoints" - - _id: "graph_commandTraverseSystemGroup" - type: "endpoints" - - _id: "AC9tCEFMSDqk9hFKD" - type: "schemas" - - _id: "TkDovo4uYnDm6qNyj" - type: "schemas" - - _id: "5jEQyXrx8qSkQMm9q" - type: "schemas" - - _id: "Qs6Z9YexBXkHyTsPs" - type: "schemas" - - _id: "bbn5ztJs444czn3y7" - type: "schemas" - - _id: "aTdhv6ygRuaJZWEJp" - type: "schemas" - - _id: "WbYr4KDRGCQ2oj5wM" - type: "schemas" - - _id: "RCxMohSZD4WvRxB6e" - type: "schemas" - - _id: "p7ZrNkR7taQZ8xo5D" - type: "schemas" - - _id: "RRyEu9v9r8HRpGRHm" - type: "schemas" - - _id: "hXuvCC7TpQpMcoorZ" - type: "schemas" - - _id: "iGqpCFo43kXixJ4KE" - type: "schemas" - - _id: "cSMXzBSc73d3wLynW" - type: "schemas" - - _id: "QeMiCzxyEWwWb2BhL" - type: "schemas" - - _id: "fkLhQizgqFPsieegx" - type: "schemas" - - _id: "GYBhpRAqNLXBvTkfd" - type: "schemas" - - _id: "wBsqbJSy99t4xbq8f" - type: "schemas" - - _id: "icghut8wyMFmSD2fc" - type: "schemas" - - _id: "3YZP8o94zNs3TboQC" - type: "schemas" - - _id: "ar4AvRE4hLCyR3C5f" - type: "schemas" - - _id: "W9GEzqnBsESKuvRwp" - type: "schemas" - - _id: "J8Ju9fhzBZh5E94nH" - type: "schemas" - name: "Commands" - - description: "You can associate your groups of users or systems with Directories.\ - \ (LDAP, Office 365, or G-Suite.)\n\nPlease see [this page](https://jumpcloud.com/daas-product/directory-services)\ - \ for more information on JumpCloud's Directories Services." - divider: false - items: - - _id: "xaK74AR4z9LZSWQjy" - type: "endpoints" - - _id: "directories_list" - type: "endpoints" - - _id: "bt7NrBLGW3hjTcqFu" - type: "endpoints" - - _id: "fKHEZEPiAoAjdNnrs" - type: "endpoints" - - _id: "p78rXxMWTeeRazsHw" - type: "endpoints" - name: "Directories" - - divider: false - items: - - _id: "duo_accountPost" - type: "endpoints" - - _id: "duo_accountGet" - type: "endpoints" - - _id: "duo_accountList" - type: "endpoints" - - _id: "duo_applicationPost" - type: "endpoints" - - _id: "duo_applicationGet" - type: "endpoints" - - _id: "duo_applicationList" - type: "endpoints" - - _id: "duo_applicationDelete" - type: "endpoints" - - _id: "duo_applicationUpdate" - type: "endpoints" - - _id: "duo_accountDelete" - type: "endpoints" - name: "Duo" - - description: "Groups are designed to enhance JumpCloud's existing grouping\ - \ functionality which relied heavily on flexible “tags” to allow you to\ - \ organize users, systems and applications into hierarchies.\n\nOur Tagging\ - \ functionality worked well in the early days of JumpCloud, but as our our\ - \ users became more sophisticated, and our product’s reach has expanding\ - \ deeper into IT infrastructure we thought it was time to offer a more traditional\ - \ way of managing a directory’s hierarchy.\n\nYou can find more information\ - \ on Groups on [this page](https://support.jumpcloud.com/customer/en/portal/articles/2703450-getting-started-groups)." - divider: false - items: - - _id: "byrbFjvbPaELLWEm9" - type: "endpoints" - - _id: "groups_list" - type: "endpoints" - name: "Groups" - - description: "You can associate your Groups of Users to G-Suite.\nPlease see\ - \ [this page](https://support.jumpcloud.com/support/s/article/g-suite-user-import-provisioning-and-sync1)\ - \ for more information on G-Suite." - divider: false - items: - - _id: "gsuites_get" - type: "endpoints" - - _id: "gsuites_patch" - type: "endpoints" - - _id: "FDG6kMMJrX3kMJ9cn" - type: "endpoints" - - _id: "SSStLReXcKe4Dr4LD" - type: "endpoints" - - _id: "graph_gSuiteAssociationsPost" - type: "endpoints" - - _id: "graph_gSuiteAssociationsList" - type: "endpoints" - - _id: "graph_gSuiteTraverseUser" - type: "endpoints" - - _id: "graph_gSuiteTraverseUserGroup" - type: "endpoints" - - _id: "translationRules_gSuiteList" - type: "endpoints" - - _id: "translationRules_gSuitePost" - type: "endpoints" - - _id: "translationRules_gSuiteGet" - type: "endpoints" - - _id: "translationRules_gSuiteDelete" - type: "endpoints" - name: "G Suite" - - divider: false - items: - - _id: "knowledge_salesforceList" - type: "endpoints" - name: "Knowledge" - - description: "You can associate your groups of users to LDAP. Please see\ - \ [this page](https://support.jumpcloud.com/customer/en/portal/topics/926832-ldap-as-a-service)\ - \ for more information on LDAP." - divider: false - items: - - _id: "DG46bmf92DFRKBRuE" - type: "endpoints" - - _id: "XuTD8jvsNtCrbu3Sa" - type: "endpoints" - - _id: "graph_ldapServerAssociationsPost" - type: "endpoints" - - _id: "graph_ldapServerAssociationsList" - type: "endpoints" - - _id: "graph_ldapServerTraverseUser" - type: "endpoints" - - _id: "graph_ldapServerTraverseUserGroup" - type: "endpoints" - - _id: "ldapservers_list" - type: "endpoints" - - _id: "ldapservers_get" - type: "endpoints" - - _id: "ldapservers_patch" - type: "endpoints" - name: "LDAP Servers" - - description: "You can associate your groups of users to Office 365. Please\ - \ see [this page](https://support.jumpcloud.com/support/s/topic/0TO1M000000EUx5WAG/office-365-integration)\ - \ for more information on Office 365." - divider: false - items: - - _id: "A7g5bR8ox8wEBLB6d" - type: "endpoints" - - _id: "graph_office365AssociationsPost" - type: "endpoints" - - _id: "graph_office365AssociationsList" - type: "endpoints" - - _id: "graph_office365TraverseUser" - type: "endpoints" - - _id: "graph_office365TraverseUserGroup" - type: "endpoints" - - _id: "translationRules_office365List" - type: "endpoints" - - _id: "translationRules_office365Post" - type: "endpoints" - - _id: "translationRules_office365Get" - type: "endpoints" - - _id: "translationRules_office365Delete" - type: "endpoints" - name: "Office 365" - - description: "Jumpcloud provides a library of policy templates for Windows,\ - \ Mac and Linux which provide administrators the capability to set security\ - \ features or apply uniform configurations across a range of systems. These\ - \ endpoints allow you to interact with our Policies feature via the JumpCloud\ - \ API." - divider: false - items: - - _id: "3j7iRXfuA4cJrRJi8" - type: "endpoints" - - _id: "policies_list" - type: "endpoints" - - _id: "policies_post" - type: "endpoints" - - _id: "policies_get" - type: "endpoints" - - _id: "policies_put" - type: "endpoints" - - _id: "policyresults_list" - type: "endpoints" - - _id: "policies_delete" - type: "endpoints" - - _id: "policystatuses_list" - type: "endpoints" - - _id: "graph_policyTraverseSystem" - type: "endpoints" - - _id: "graph_policyTraverseSystemGroup" - type: "endpoints" - - _id: "graph_policyAssociationsList" - type: "endpoints" - - _id: "graph_policyAssociationsPost" - type: "endpoints" - - _id: "policytemplates_list" - type: "endpoints" - - _id: "policytemplates_get" - type: "endpoints" - - _id: "policyresults_org_list" - type: "endpoints" - - _id: "policyresults_get" - type: "endpoints" - name: "Policies" - - description: "Please contact support to get your ProviderID." - divider: false - items: - - _id: "providers_listAdministrators" - type: "endpoints" - - _id: "providers_postAdmins" - type: "endpoints" - name: "Providers" - - description: "You can associate your groups of users to Radius Servers. \ - \ Please see [this page](https://support.jumpcloud.com/support/s/article/jumpclouds-radius-as-a-service-overview1)\ - \ for more information on Radius." - divider: false - items: - - _id: "graph_radiusServerAssociationsPost" - type: "endpoints" - - _id: "graph_radiusServerAssociationsList" - type: "endpoints" - - _id: "graph_radiusServerTraverseUser" - type: "endpoints" - - _id: "graph_radiusServerTraverseUserGroup" - type: "endpoints" - name: "RADIUS Servers" - - divider: false - items: - - _id: "ldapservers_sambaDomainsPost" - type: "endpoints" - - _id: "ldapservers_sambaDomainsPut" - type: "endpoints" - - _id: "ldapservers_sambaDomainsDelete" - type: "endpoints" - - _id: "ldapservers_sambaDomainsList" - type: "endpoints" - - _id: "ldapservers_sambaDomainsGet" - type: "endpoints" - name: "Samba Domains" - - description: "You can associate your Groups of Users with systems.\n\nTo obtain\ - \ your System IDs, you can use our [V1 Endpoints for Systems](https://docs.jumpcloud.com/1.0/systemusers).\n\ - \nPlease see [this page](https://support.jumpcloud.com/support/s/article/getting-started-groups)\ - \ for more information on Groups and Systems." - divider: false - items: - - _id: "4DjML5aWZnY3GXcDM" - type: "endpoints" - - _id: "Zdf254ynsk9DJR9oL" - type: "endpoints" - - _id: "graph_systemAssociationsPost" - type: "endpoints" - - _id: "graph_systemMemberOf" - type: "endpoints" - - _id: "graph_systemAssociationsList" - type: "endpoints" - - _id: "graph_systemTraversePolicy" - type: "endpoints" - - _id: "graph_systemTraverseUser" - type: "endpoints" - - _id: "graph_systemTraverseCommand" - type: "endpoints" - - _id: "graph_systemTraverseUserGroup" - type: "endpoints" - - _id: "policystatuses_list" - type: "endpoints" - - _id: "systems_getFDEKey" - type: "endpoints" - - _id: "6hSYwFNZPG6QLTd8o" - type: "endpoints" - - _id: "PqS5zb3kXFunF9FHs" - type: "endpoints" - name: "Systems" - - description: "System Groups are designed to enhance JumpCloud's existing grouping\ - \ functionality which relied heavily on flexible “tags” to allow you to\ - \ organize users, systems and applications into hierarchies.\n\nWith System\ - \ Groups you can easily group Systems together and assign them to Groups\ - \ of Users.\n\nYou can find more information on Groups on [this page](https://support.jumpcloud.com/support/s/article/getting-started-groups)." - divider: false - items: - - _id: "e3ufsPvtsKCqCmPpA" - type: "endpoints" - - _id: "m5hjYe7nHomt75ghs" - type: "endpoints" - - _id: "jPih8cFWBWkA6x3cJ" - type: "endpoints" - - _id: "k3wxKsnGWNg6EhpnJ" - type: "endpoints" - - _id: "groups_system_post" - type: "endpoints" - - _id: "groups_system_put" - type: "endpoints" - - _id: "groups_system_patch" - type: "endpoints" - - _id: "groups_system_delete" - type: "endpoints" - - _id: "groups_system_list" - type: "endpoints" - - _id: "groups_system_get" - type: "endpoints" - name: "System Groups" - - description: "Any Directory Object that supports grouping also has the ability\ - \ to allow management of the group members. This includes listing, adding\ - \ and removing Directory Objects and Groups of Directory Objects to and\ - \ from the Group. These endpoints allow you to control the members and membership\ - \ of System Objects.\n\nMembers are the direct objects of an object group.\n\ - \nMembership is defined as the direct and indirect members of an object\ - \ group." - divider: false - items: - - _id: "graph_systemGroupMembersPost" - type: "endpoints" - - _id: "graph_systemGroupMemberOf" - type: "endpoints" - - _id: "graph_systemGroupMembership" - type: "endpoints" - - _id: "graph_systemGroupMembersList" - type: "endpoints" - name: "System Group Members & Membership" - - description: "Directory Objects can be associated to one another to create\ - \ bidirectional member associations, i.e. users to systems, commands to\ - \ systems, users to applications, etc. JumpCloud controls the types of\ - \ Directory Objects that exist and the pairings that can exist; but with\ - \ these set of endpoints we will allow you to leverage the JumpCloud Graph\ - \ to have more control over your System Group Associations." - divider: false - items: - - _id: "graph_systemGroupAssociationsPost" - type: "endpoints" - - _id: "graph_systemGroupTraverseUser" - type: "endpoints" - - _id: "graph_systemGroupTraverseUserGroup" - type: "endpoints" - - _id: "graph_systemGroupTraversePolicy" - type: "endpoints" - - _id: "graph_systemGroupAssociationsList" - type: "endpoints" - - _id: "graph_systemGroupTraverseCommand" - type: "endpoints" - name: "System Group Associations" - - divider: false - items: - - _id: "w3WqrWL3DFGYGzaaY" - type: "endpoints" - - _id: "systeminsights_list_chrome_extensions" - type: "endpoints" - - _id: "systeminsights_list_system_chrome_extensions" - type: "endpoints" - - _id: "system-insights-chrome-extensions" - type: "schemas" - - _id: "systeminsights_list_safari_extensions" - type: "endpoints" - - _id: "systeminsights_list_system_safari_extensions" - type: "endpoints" - - _id: "system-insights-safari-extensions" - type: "schemas" - - _id: "systeminsights_list_mounts" - type: "endpoints" - - _id: "systeminsights_list_system_mounts" - type: "endpoints" - - _id: "system-insights-mounts" - type: "schemas" - - _id: "systeminsights_list_browser_plugins" - type: "endpoints" - - _id: "systeminsights_list_system_browser_plugins" - type: "endpoints" - - _id: "system-insights-browser-plugins" - type: "schemas" - - _id: "systeminsights_list_firefox_addons" - type: "endpoints" - - _id: "systeminsights_list_system_firefox_addons" - type: "endpoints" - - _id: "system-insights-firefox-addons" - type: "schemas" - - _id: "systeminsights_list_apps" - type: "endpoints" - - _id: "systeminsights_list_system_apps" - type: "endpoints" - - _id: "system-insights-apps" - type: "schemas" - - _id: "systeminsights_list_disk_encryption" - type: "endpoints" - - _id: "systeminsights_list_system_disk_encryption" - type: "endpoints" - - _id: "system-insights-disk-encryption" - type: "schemas" - - _id: "systeminsights_list_os_version" - type: "endpoints" - - _id: "systeminsights_list_system_os_version" - type: "endpoints" - - _id: "system-insights-os-version" - type: "schemas" - - _id: "systeminsights_list_interface_addresses" - type: "endpoints" - - _id: "systeminsights_list_system_interface_addresses" - type: "endpoints" - - _id: "system-insights-interface-addresses" - type: "schemas" - - _id: "systeminsights_list_groups" - type: "endpoints" - - _id: "systeminsights_list_system_groups" - type: "endpoints" - - _id: "system-insights-groups" - type: "schemas" - - _id: "systeminsights_list_users" - type: "endpoints" - - _id: "systeminsights_list_system_users" - type: "endpoints" - - _id: "system-insights-users" - type: "schemas" - - _id: "systeminsights_list_system_info" - type: "endpoints" - - _id: "systeminsights_list_system_system_info" - type: "endpoints" - - _id: "system-insights-system-info" - type: "schemas" - - _id: "systeminsights_list_bitlocker_info" - type: "endpoints" - - _id: "systeminsights_list_system_bitlocker_info" - type: "endpoints" - - _id: "system-insights-bitlocker-info" - type: "schemas" - - _id: "systeminsights_list_disk_info" - type: "endpoints" - - _id: "systeminsights_list_system_disk_info" - type: "endpoints" - - _id: "system-insights-disk-info" - type: "schemas" - - _id: "systeminsights_list_etc_hosts" - type: "endpoints" - - _id: "systeminsights_list_system_etc_hosts" - type: "endpoints" - - _id: "system-insights-etc-hosts" - type: "schemas" - - _id: "systeminsights_list_logical_drives" - type: "endpoints" - - _id: "systeminsights_list_system_logical_drives" - type: "endpoints" - - _id: "system-insights-logical-drvies" - type: "schemas" - - _id: "systeminsights_list_patches" - type: "endpoints" - - _id: "systeminsights_list_system_patches" - type: "endpoints" - - _id: "system-insights-patches" - type: "schemas" - - _id: "systeminsights_list_programs" - type: "endpoints" - - _id: "systeminsights_list_system_programs" - type: "endpoints" - - _id: "system-insights-programs" - type: "schemas" - - _id: "systeminsights_list_kernel_info" - type: "endpoints" - - _id: "systeminsights_list_system_kernel_info" - type: "endpoints" - - _id: "system-insights-kernel-info" - type: "schemas" - - _id: "systeminsights_list_system_controls" - type: "endpoints" - - _id: "systeminsights_list_system_system_controls" - type: "endpoints" - - _id: "system-insights-system-controls" - type: "schemas" - - _id: "systeminsights_list_uptime" - type: "endpoints" - - _id: "systeminsights_list_system_uptime" - type: "endpoints" - - _id: "system-insights-uptime" - type: "schemas" - - _id: "systeminsights_list_battery" - type: "endpoints" - - _id: "system-insights-battery" - type: "schemas" - - _id: "xTwHys9wz3xkkAKnT" - type: "schemas" - - _id: "systeminsights_list_ie_extensions" - type: "endpoints" - - _id: "system-insights-ie-extensions" - type: "schemas" - - _id: "systeminsights_list_launchd" - type: "endpoints" - - _id: "system-insights-launchd" - type: "schemas" - - _id: "systeminsights_list_logged_in_users" - type: "endpoints" - - _id: "system-insights-logged-in-users" - type: "schemas" - - _id: "systeminsights_list_usb_devices" - type: "endpoints" - - _id: "system-insights-usb-devices" - type: "schemas" - - _id: "systeminsights_list_user_groups" - type: "endpoints" - - _id: "system-insights-user-groups" - type: "schemas" - - _id: "systeminsights_list_crashes" - type: "endpoints" - - _id: "system-insights-crashes" - type: "schemas" - - _id: "systeminsights_list_windows_crashes" - type: "endpoints" - - _id: "system-insights-windows-crashes" - type: "schemas" - name: "System Insights" - - description: "You can associate your Users with groups of Users, Systems,\ - \ Applications, Radius Servers, Commands and Directories.\n\nTo obtain you\ - \ your User IDs, you can use our V1 Endpoints for [System Users](https://docs.jumpcloud.com/1.0/systemusers)\n\ - \nPlease see [this page](https://support.jumpcloud.com/support/s/article/getting-started-groups)\ - \ for more information on Groups and Systems." - divider: false - items: - - _id: "5aNya5RzjgJed6BmL" - type: "endpoints" - - _id: "XpjQonbguJ55dy4TQ" - type: "endpoints" - - _id: "4uQMx676oTq4RTqF2" - type: "endpoints" - - _id: "BHuLmHMsdsTkF5f6H" - type: "endpoints" - - _id: "graph_userAssociationsPost" - type: "endpoints" - - _id: "graph_userMemberOf" - type: "endpoints" - - _id: "graph_userAssociationsList" - type: "endpoints" - - _id: "graph_userTraverseApplication" - type: "endpoints" - - _id: "graph_userTraverseDirectory" - type: "endpoints" - - _id: "graph_userTraverseGSuite" - type: "endpoints" - - _id: "graph_userTraverseLdapServer" - type: "endpoints" - - _id: "graph_userTraverseOffice365" - type: "endpoints" - - _id: "graph_userTraverseSystem" - type: "endpoints" - - _id: "graph_userTraverseRadiusServer" - type: "endpoints" - - _id: "graph_userTraverseSystemGroup" - type: "endpoints" - - _id: "users_sendEmails" - type: "endpoints" - name: "Users" - - description: "User Groups are designed to enhance JumpCloud's existing grouping\ - \ functionality which relied heavily on flexible “tags” to allow you to\ - \ organize users, systems and applications into hierarchies.\n\nWith User\ - \ Groups you can easily group Users together and assign them to Systems.\n\ - \nYou can find more information on Groups on [this page](https://support.jumpcloud.com/support/s/article/getting-started-groups)." - divider: false - items: - - _id: "groups_user_post" - type: "endpoints" - - _id: "groups_user_put" - type: "endpoints" - - _id: "groups_user_patch" - type: "endpoints" - - _id: "groups_user_delete" - type: "endpoints" - - _id: "vycgDSzsLqZ4Ntdjk" - type: "endpoints" - - _id: "ExyRxHQtM8tZCmKiS" - type: "endpoints" - - _id: "HxDaihcTN24XfxTYT" - type: "endpoints" - - _id: "ycnNWjNDDW7b94ch2" - type: "endpoints" - - _id: "GbLmbD8YRLFqhaab8" - type: "endpoints" - - _id: "gF7r9PNuQ2PCkazSW" - type: "endpoints" - - _id: "h6EK4LxjcAFCx5pE2" - type: "endpoints" - - _id: "groups_user_list" - type: "endpoints" - - _id: "groups_user_get" - type: "endpoints" - name: "User Groups" - - description: "Any Directory Object that supports grouping also has the ability\ - \ to allow management of the group members. This includes listing, adding\ - \ and removing Directory Objects and Groups of Directory Objects to and\ - \ from the Group. These endpoints allow you to control the members and membership\ - \ of User Objects.\n\nMembers are the direct objects of an object group.\n\ - \nMembership is defined as the direct and indirect members of an object\ - \ group." - divider: false - items: - - _id: "graph_userGroupMembersPost" - type: "endpoints" - - _id: "graph_userGroupMemberOf" - type: "endpoints" - - _id: "graph_userGroupMembership" - type: "endpoints" - - _id: "graph_userGroupMembersList" - type: "endpoints" - name: "User Group Members & Membership" - - description: "Directory Objects can be associated to one another to create\ - \ bidirectional membership associations, i.e. users to systems, commands\ - \ to systems, users to applications, etc. JumpCloud controls the types of\ - \ Directory Objects that exist and the pairings that can exist; but with\ - \ these set of endpoints we will allow you to leverage the JumpCloud Graph\ - \ to have more control over your User Group Associations." - divider: false - items: - - _id: "graph_userGroupAssociationsPost" - type: "endpoints" - - _id: "graph_userGroupTraverseActiveDirectory" - type: "endpoints" - - _id: "graph_userGroupTraverseSystemGroup" - type: "endpoints" - - _id: "graph_userGroupAssociationsList" - type: "endpoints" - - _id: "graph_userGroupTraverseSystem" - type: "endpoints" - - _id: "graph_userGroupTraverseRadiusServer" - type: "endpoints" - - _id: "graph_userGroupTraverseOffice365" - type: "endpoints" - - _id: "graph_userGroupTraverseLdapServer" - type: "endpoints" - - _id: "graph_userGroupTraverseGSuite" - type: "endpoints" - - _id: "graph_userGroupTraverseDirectory" - type: "endpoints" - - _id: "graph_userGroupTraverseApplication" - type: "endpoints" - name: "User Group Associations" - - divider: false - items: - - _id: "workdays_delete" - type: "endpoints" - - _id: "workdays_post" - type: "endpoints" - - _id: "workdays_get" - type: "endpoints" - - _id: "workdays_list" - type: "endpoints" - - _id: "workdays_put" - type: "endpoints" - - _id: "workdays_workers" - type: "endpoints" - - _id: "workdays_authorize" - type: "endpoints" - - _id: "workdays_deauthorize" - type: "endpoints" - - _id: "workdays_importresults" - type: "endpoints" - - _id: "workdays_import" - type: "endpoints" - - _id: "workdays_settings" - type: "endpoints" - name: "Workday Import" - - description: "Models make up the core input and output structures in this\ - \ API. They are used in endpoint request and response bodies." - divider: false - items: - - _id: "Administrator" - type: "schemas" - - _id: "auth-info" - type: "schemas" - - _id: "auth-input" - type: "schemas" - - _id: "auth-input-object" - type: "schemas" - - _id: "active-directory-output" - type: "schemas" - - _id: "active-directory-input" - type: "schemas" - - _id: "active-directory-agent-list-output" - type: "schemas" - - _id: "active-directory-agent-get-output" - type: "schemas" - - _id: "active-directory-agent-input" - type: "schemas" - - _id: "bulk-user-create" - type: "schemas" - - _id: "bulk-user-update" - type: "schemas" - - _id: "Directory" - type: "schemas" - - _id: "Error" - type: "schemas" - - _id: "GraphConnection" - type: "schemas" - - _id: "GraphManagementReq" - type: "schemas" - - _id: "GraphObject" - type: "schemas" - - _id: "GraphObjectWithPaths" - type: "schemas" - - _id: "GraphType" - type: "schemas" - - _id: "Group" - type: "schemas" - - _id: "GroupType" - type: "schemas" - - _id: "job-id" - type: "schemas" - - _id: "job-details" - type: "schemas" - - _id: "job-workresult" - type: "schemas" - - _id: "LdapServerAction" - type: "schemas" - - _id: "ldap-server-input" - type: "schemas" - - _id: "ldap-server-output" - type: "schemas" - - _id: "oauth-code-input" - type: "schemas" - - _id: "Policy" - type: "schemas" - - _id: "PolicyRequest" - type: "schemas" - - _id: "PolicyResult" - type: "schemas" - - _id: "PolicyTemplateConfigField" - type: "schemas" - - _id: "PolicyTemplate" - type: "schemas" - - _id: "PolicyTemplateWithDetails" - type: "schemas" - - _id: "PolicyValue" - type: "schemas" - - _id: "PolicyWithDetails" - type: "schemas" - - _id: "Provider" - type: "schemas" - - _id: "ProviderAdminReq" - type: "schemas" - - _id: "salesforce-knowledge-list-output" - type: "schemas" - - _id: "samba-domain-input" - type: "schemas" - - _id: "samba-domain-output" - type: "schemas" - - _id: "systemfdekey" - type: "schemas" - - _id: "SystemGraphManagementReq" - type: "schemas" - - _id: "SystemGroup" - type: "schemas" - - _id: "SystemGroupData" - type: "schemas" - - _id: "SystemGroupMembersReq" - type: "schemas" - - _id: "SystemGroupGraphManagementReq" - type: "schemas" - - _id: "UserGroup" - type: "schemas" - - _id: "UserGroupAttributes" - type: "schemas" - - _id: "UserGraphManagementReq" - type: "schemas" - - _id: "UserGroupGraphManagementReq" - type: "schemas" - - _id: "UserGroupMembersReq" - type: "schemas" - - _id: "UserGroupPut" - type: "schemas" - - _id: "UserGroupPost" - type: "schemas" - - _id: "hitWKRiHhPaZpAx7q" - type: "schemas" - - _id: "HaivXzJCYeryM9e35" - type: "schemas" - - _id: "workday-fields" - type: "schemas" - - _id: "workday-input" - type: "schemas" - - _id: "workday-output" - type: "schemas" - - _id: "workday-request" - type: "schemas" - - _id: "workday-worker" - type: "schemas" - - _id: "RY8pzvgBAsxtLMcXz" - type: "schemas" - - _id: "RaTvCDQQ3CezKdm3f" - type: "schemas" - - _id: "emailrequest" - type: "schemas" - - _id: "GSuiteBuiltinTranslation" - type: "schemas" - - _id: "Office365BuiltinTranslation" - type: "schemas" - - _id: "GSuiteTranslationRule" - type: "schemas" - - _id: "Office365TranslationRule" - type: "schemas" - - _id: "GSuiteTranslationRuleRequest" - type: "schemas" - - _id: "Office365TranslationRuleRequest" - type: "schemas" - - _id: "org-crypto-settings" - type: "schemas" - - _id: "gsuite-patch-input" - type: "schemas" - - _id: "gsuite-output" - type: "schemas" - - _id: "DuoAccount" - type: "schemas" - - _id: "DuoRegistrationApplication" - type: "schemas" - - _id: "DuoRegistrationApplicationReq" - type: "schemas" - - _id: "DuoApplication" - type: "schemas" - - _id: "DuoApplicationReq" - type: "schemas" - - _id: "DuoApplicationUpdateReq" - type: "schemas" - name: "Models" - - description: "These Traits describe the common behaviors or structures in\ - \ this API." - divider: false - items: - - _id: "aggregate" - type: "traits" - - _id: "fields" - type: "traits" - - _id: "filter" - type: "traits" - - _id: "graphTargets" - type: "traits" - - _id: "graphSystemGroupTargets" - type: "traits" - - _id: "graphSystemTargets" - type: "traits" - - _id: "graphUserGroupTargets" - type: "traits" - - _id: "graphUserTargets" - type: "traits" - - _id: "limit" - type: "traits" - - _id: "listCount" - type: "traits" - - _id: "multiTenantRequestHeaders" - type: "traits" - - _id: "requestHeaders" - type: "traits" - - _id: "skip" - type: "traits" - - _id: "sort" - type: "traits" - - _id: "systemContextAuth" - type: "traits" - - _id: "limitMax100" - type: "traits" - - _id: "systemInsightsFilter" - type: "traits" - name: "Traits" - savedEntries: [] - tests: [] - traits: [] - utilFuncs: [] -x-tests: {} diff --git a/v2/api_client.go b/v2/api_client.go deleted file mode 100644 index f2c5aba..0000000 --- a/v2/api_client.go +++ /dev/null @@ -1,488 +0,0 @@ -/* - * JumpCloud APIs - * - * JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. - * - * API version: 2.0 - * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) - */ - -package v2 - -import ( - "bytes" - "encoding/json" - "encoding/xml" - "fmt" - "errors" - "io" - "mime/multipart" - "golang.org/x/oauth2" - "golang.org/x/net/context" - "net/http" - "net/url" - "time" - "os" - "path/filepath" - "reflect" - "regexp" - "strings" - "unicode/utf8" - "strconv" -) - -var ( - jsonCheck = regexp.MustCompile("(?i:[application|text]/json)") - xmlCheck = regexp.MustCompile("(?i:[application|text]/xml)") -) - -// APIClient manages communication with the JumpCloud APIs API v2.0 -// In most cases there should be only one, shared, APIClient. -type APIClient struct { - cfg *Configuration - common service // Reuse a single struct instead of allocating one for each service on the heap. - - // API Services - ActiveDirectoryApi *ActiveDirectoryApiService - AppleMDMApi *AppleMDMApiService - ApplicationsApi *ApplicationsApiService - BulkJobRequestsApi *BulkJobRequestsApiService - CommandsApi *CommandsApiService - DefaultApi *DefaultApiService - DirectoriesApi *DirectoriesApiService - DuoApi *DuoApiService - FdeApi *FdeApiService - GSuiteApi *GSuiteApiService - GraphApi *GraphApiService - GroupsApi *GroupsApiService - KnowledgeApi *KnowledgeApiService - LDAPServersApi *LDAPServersApiService - Office365Api *Office365ApiService - OrganizationsApi *OrganizationsApiService - PoliciesApi *PoliciesApiService - PolicytemplatesApi *PolicytemplatesApiService - ProvidersApi *ProvidersApiService - RADIUSServersApi *RADIUSServersApiService - SambaDomainsApi *SambaDomainsApiService - SystemGroupAssociationsApi *SystemGroupAssociationsApiService - SystemGroupMembersMembershipApi *SystemGroupMembersMembershipApiService - SystemGroupsApi *SystemGroupsApiService - SystemInsightsApi *SystemInsightsApiService - SystemsApi *SystemsApiService - UserGroupAssociationsApi *UserGroupAssociationsApiService - UserGroupMembersMembershipApi *UserGroupMembersMembershipApiService - UserGroupsApi *UserGroupsApiService - UsersApi *UsersApiService - WorkdayImportApi *WorkdayImportApiService -} - -type service struct { - client *APIClient -} - -// NewAPIClient creates a new API client. Requires a userAgent string describing your application. -// optionally a custom http.Client to allow for advanced features such as caching. -func NewAPIClient(cfg *Configuration) *APIClient { - if cfg.HTTPClient == nil { - cfg.HTTPClient = http.DefaultClient - } - - c := &APIClient{} - c.cfg = cfg - c.common.client = c - - // API Services - c.ActiveDirectoryApi = (*ActiveDirectoryApiService)(&c.common) - c.AppleMDMApi = (*AppleMDMApiService)(&c.common) - c.ApplicationsApi = (*ApplicationsApiService)(&c.common) - c.BulkJobRequestsApi = (*BulkJobRequestsApiService)(&c.common) - c.CommandsApi = (*CommandsApiService)(&c.common) - c.DefaultApi = (*DefaultApiService)(&c.common) - c.DirectoriesApi = (*DirectoriesApiService)(&c.common) - c.DuoApi = (*DuoApiService)(&c.common) - c.FdeApi = (*FdeApiService)(&c.common) - c.GSuiteApi = (*GSuiteApiService)(&c.common) - c.GraphApi = (*GraphApiService)(&c.common) - c.GroupsApi = (*GroupsApiService)(&c.common) - c.KnowledgeApi = (*KnowledgeApiService)(&c.common) - c.LDAPServersApi = (*LDAPServersApiService)(&c.common) - c.Office365Api = (*Office365ApiService)(&c.common) - c.OrganizationsApi = (*OrganizationsApiService)(&c.common) - c.PoliciesApi = (*PoliciesApiService)(&c.common) - c.PolicytemplatesApi = (*PolicytemplatesApiService)(&c.common) - c.ProvidersApi = (*ProvidersApiService)(&c.common) - c.RADIUSServersApi = (*RADIUSServersApiService)(&c.common) - c.SambaDomainsApi = (*SambaDomainsApiService)(&c.common) - c.SystemGroupAssociationsApi = (*SystemGroupAssociationsApiService)(&c.common) - c.SystemGroupMembersMembershipApi = (*SystemGroupMembersMembershipApiService)(&c.common) - c.SystemGroupsApi = (*SystemGroupsApiService)(&c.common) - c.SystemInsightsApi = (*SystemInsightsApiService)(&c.common) - c.SystemsApi = (*SystemsApiService)(&c.common) - c.UserGroupAssociationsApi = (*UserGroupAssociationsApiService)(&c.common) - c.UserGroupMembersMembershipApi = (*UserGroupMembersMembershipApiService)(&c.common) - c.UserGroupsApi = (*UserGroupsApiService)(&c.common) - c.UsersApi = (*UsersApiService)(&c.common) - c.WorkdayImportApi = (*WorkdayImportApiService)(&c.common) - - return c -} - -func atoi(in string) (int, error) { - return strconv.Atoi(in) -} - - -// selectHeaderContentType select a content type from the available list. -func selectHeaderContentType(contentTypes []string) string { - if len(contentTypes) == 0 { - return "" - } - if contains(contentTypes, "application/json") { - return "application/json" - } - return contentTypes[0] // use the first content type specified in 'consumes' -} - -// selectHeaderAccept join all accept types and return -func selectHeaderAccept(accepts []string) string { - if len(accepts) == 0 { - return "" - } - - if contains(accepts, "application/json") { - return "application/json" - } - - return strings.Join(accepts, ",") -} - -// contains is a case insenstive match, finding needle in a haystack -func contains(haystack []string, needle string) bool { - for _, a := range haystack { - if strings.ToLower(a) == strings.ToLower(needle) { - return true - } - } - return false -} - -// Verify optional parameters are of the correct type. -func typeCheckParameter(obj interface{}, expected string, name string) error { - // Make sure there is an object. - if obj == nil { - return nil - } - - // Check the type is as expected. - if reflect.TypeOf(obj).String() != expected { - return fmt.Errorf("Expected %s to be of type %s but received %s.", name, expected, reflect.TypeOf(obj).String()) - } - return nil -} - -// parameterToString convert interface{} parameters to string, using a delimiter if format is provided. -func parameterToString(obj interface{}, collectionFormat string) string { - var delimiter string - - switch collectionFormat { - case "pipes": - delimiter = "|" - case "ssv": - delimiter = " " - case "tsv": - delimiter = "\t" - case "csv": - delimiter = "," - } - - if reflect.TypeOf(obj).Kind() == reflect.Slice { - return strings.Trim(strings.Replace(fmt.Sprint(obj), " ", delimiter, -1), "[]") - } - - return fmt.Sprintf("%v", obj) -} - -// callAPI do the request. -func (c *APIClient) callAPI(request *http.Request) (*http.Response, error) { - return c.cfg.HTTPClient.Do(request) -} - -// Change base path to allow switching to mocks -func (c *APIClient) ChangeBasePath (path string) { - c.cfg.BasePath = path -} - -// prepareRequest build the request -func (c *APIClient) prepareRequest ( - ctx context.Context, - path string, method string, - postBody interface{}, - headerParams map[string]string, - queryParams url.Values, - formParams url.Values, - fileName string, - fileBytes []byte) (localVarRequest *http.Request, err error) { - - var body *bytes.Buffer - - // Detect postBody type and post. - if postBody != nil { - contentType := headerParams["Content-Type"] - if contentType == "" { - contentType = detectContentType(postBody) - headerParams["Content-Type"] = contentType - } - - body, err = setBody(postBody, contentType) - if err != nil { - return nil, err - } - } - - // add form parameters and file if available. - if len(formParams) > 0 || (len(fileBytes) > 0 && fileName != "") { - if body != nil { - return nil, errors.New("Cannot specify postBody and multipart form at the same time.") - } - body = &bytes.Buffer{} - w := multipart.NewWriter(body) - - for k, v := range formParams { - for _, iv := range v { - if strings.HasPrefix(k, "@") { // file - err = addFile(w, k[1:], iv) - if err != nil { - return nil, err - } - } else { // form value - w.WriteField(k, iv) - } - } - } - if len(fileBytes) > 0 && fileName != "" { - w.Boundary() - //_, fileNm := filepath.Split(fileName) - part, err := w.CreateFormFile("file", filepath.Base(fileName)) - if err != nil { - return nil, err - } - _, err = part.Write(fileBytes) - if err != nil { - return nil, err - } - // Set the Boundary in the Content-Type - headerParams["Content-Type"] = w.FormDataContentType() - } - - // Set Content-Length - headerParams["Content-Length"] = fmt.Sprintf("%d", body.Len()) - w.Close() - } - - // Setup path and query parameters - url, err := url.Parse(path) - if err != nil { - return nil, err - } - - // Adding Query Param - query := url.Query() - for k, v := range queryParams { - for _, iv := range v { - query.Add(k, iv) - } - } - - // Encode the parameters. - url.RawQuery = query.Encode() - - // Generate a new request - if body != nil { - localVarRequest, err = http.NewRequest(method, url.String(), body) - } else { - localVarRequest, err = http.NewRequest(method, url.String(), nil) - } - if err != nil { - return nil, err - } - - // add header parameters, if any - if len(headerParams) > 0 { - headers := http.Header{} - for h, v := range headerParams { - headers.Set(h, v) - } - localVarRequest.Header = headers - } - - // Override request host, if applicable - if c.cfg.Host != "" { - localVarRequest.Host = c.cfg.Host - } - - // Add the user agent to the request. - localVarRequest.Header.Add("User-Agent", c.cfg.UserAgent) - - - if ctx != nil { - // add context to the request - localVarRequest = localVarRequest.WithContext(ctx) - - // Walk through any authentication. - - // OAuth2 authentication - if tok, ok := ctx.Value(ContextOAuth2).(oauth2.TokenSource); ok { - // We were able to grab an oauth2 token from the context - var latestToken *oauth2.Token - if latestToken, err = tok.Token(); err != nil { - return nil, err - } - - latestToken.SetAuthHeader(localVarRequest) - } - - // Basic HTTP Authentication - if auth, ok := ctx.Value(ContextBasicAuth).(BasicAuth); ok { - localVarRequest.SetBasicAuth(auth.UserName, auth.Password) - } - - // AccessToken Authentication - if auth, ok := ctx.Value(ContextAccessToken).(string); ok { - localVarRequest.Header.Add("Authorization", "Bearer " + auth) - } - } - - for header, value := range c.cfg.DefaultHeader { - localVarRequest.Header.Add(header, value) - } - - return localVarRequest, nil -} - - -// Add a file to the multipart request -func addFile(w *multipart.Writer, fieldName, path string) error { - file, err := os.Open(path) - if err != nil { - return err - } - defer file.Close() - - part, err := w.CreateFormFile(fieldName, filepath.Base(path)) - if err != nil { - return err - } - _, err = io.Copy(part, file) - - return err -} - -// Prevent trying to import "fmt" -func reportError(format string, a ...interface{}) (error) { - return fmt.Errorf(format, a...) -} - -// Set request body from an interface{} -func setBody(body interface{}, contentType string) (bodyBuf *bytes.Buffer, err error) { - if bodyBuf == nil { - bodyBuf = &bytes.Buffer{} - } - - if reader, ok := body.(io.Reader); ok { - _, err = bodyBuf.ReadFrom(reader) - } else if b, ok := body.([]byte); ok { - _, err = bodyBuf.Write(b) - } else if s, ok := body.(string); ok { - _, err = bodyBuf.WriteString(s) - } else if jsonCheck.MatchString(contentType) { - err = json.NewEncoder(bodyBuf).Encode(body) - } else if xmlCheck.MatchString(contentType) { - xml.NewEncoder(bodyBuf).Encode(body) - } - - if err != nil { - return nil, err - } - - if bodyBuf.Len() == 0 { - err = fmt.Errorf("Invalid body type %s\n", contentType) - return nil, err - } - return bodyBuf, nil -} - -// detectContentType method is used to figure out `Request.Body` content type for request header -func detectContentType(body interface{}) string { - contentType := "text/plain; charset=utf-8" - kind := reflect.TypeOf(body).Kind() - - switch kind { - case reflect.Struct, reflect.Map, reflect.Ptr: - contentType = "application/json; charset=utf-8" - case reflect.String: - contentType = "text/plain; charset=utf-8" - default: - if b, ok := body.([]byte); ok { - contentType = http.DetectContentType(b) - } else if kind == reflect.Slice { - contentType = "application/json; charset=utf-8" - } - } - - return contentType -} - - -// Ripped from https://github.com/gregjones/httpcache/blob/master/httpcache.go -type cacheControl map[string]string - -func parseCacheControl(headers http.Header) cacheControl { - cc := cacheControl{} - ccHeader := headers.Get("Cache-Control") - for _, part := range strings.Split(ccHeader, ",") { - part = strings.Trim(part, " ") - if part == "" { - continue - } - if strings.ContainsRune(part, '=') { - keyval := strings.Split(part, "=") - cc[strings.Trim(keyval[0], " ")] = strings.Trim(keyval[1], ",") - } else { - cc[part] = "" - } - } - return cc -} - -// CacheExpires helper function to determine remaining time before repeating a request. -func CacheExpires(r *http.Response) (time.Time) { - // Figure out when the cache expires. - var expires time.Time - now, err := time.Parse(time.RFC1123, r.Header.Get("date")) - if err != nil { - return time.Now() - } - respCacheControl := parseCacheControl(r.Header) - - if maxAge, ok := respCacheControl["max-age"]; ok { - lifetime, err := time.ParseDuration(maxAge + "s") - if err != nil { - expires = now - } - expires = now.Add(lifetime) - } else { - expiresHeader := r.Header.Get("Expires") - if expiresHeader != "" { - expires, err = time.Parse(time.RFC1123, expiresHeader) - if err != nil { - expires = now - } - } - } - return expires -} - -func strlen(s string) (int) { - return utf8.RuneCountInString(s) -} - diff --git a/v2/api_response.go b/v2/api_response.go deleted file mode 100644 index 32d90f0..0000000 --- a/v2/api_response.go +++ /dev/null @@ -1,43 +0,0 @@ -/* - * JumpCloud APIs - * - * JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. - * - * API version: 2.0 - * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) - */ - -package v2 - -import ( - "net/http" -) - -type APIResponse struct { - *http.Response `json:"-"` - Message string `json:"message,omitempty"` - // Operation is the name of the swagger operation. - Operation string `json:"operation,omitempty"` - // RequestURL is the request URL. This value is always available, even if the - // embedded *http.Response is nil. - RequestURL string `json:"url,omitempty"` - // Method is the HTTP method used for the request. This value is always - // available, even if the embedded *http.Response is nil. - Method string `json:"method,omitempty"` - // Payload holds the contents of the response body (which may be nil or empty). - // This is provided here as the raw response.Body() reader will have already - // been drained. - Payload []byte `json:"-"` -} - -func NewAPIResponse(r *http.Response) *APIResponse { - - response := &APIResponse{Response: r} - return response -} - -func NewAPIResponseWithError(errorMessage string) *APIResponse { - - response := &APIResponse{Message: errorMessage} - return response -} diff --git a/v2/apple_mdm.go b/v2/apple_mdm.go deleted file mode 100644 index ccba00c..0000000 --- a/v2/apple_mdm.go +++ /dev/null @@ -1,22 +0,0 @@ -/* - * JumpCloud APIs - * - * JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. - * - * API version: 2.0 - * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) - */ - -package v2 - -type AppleMdm struct { - - // The push topic assigned to this enrollment by Apple after uploading the Signed CSR plist. - ApnsPushTopic string `json:"apnsPushTopic,omitempty"` - - // ObjectId uniquely identifying an MDM Enrollment, - Id string `json:"id"` - - // A friendly name to identify this enrollment. Not required to be unique. - Name string `json:"name,omitempty"` -} diff --git a/v2/apple_mdm_api.go b/v2/apple_mdm_api.go deleted file mode 100644 index d5b6382..0000000 --- a/v2/apple_mdm_api.go +++ /dev/null @@ -1,571 +0,0 @@ -/* - * JumpCloud APIs - * - * JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. - * - * API version: 2.0 - * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) - */ - -package v2 - -import ( - "io/ioutil" - "net/url" - "net/http" - "strings" - "golang.org/x/net/context" - "encoding/json" - "fmt" -) - -// Linger please -var ( - _ context.Context -) - -type AppleMDMApiService service - - -/* AppleMDMApiService Delete an Apple MDM - Removes an Apple MDM configuration. Warning: This is a destructive operation and will remove your Apple Push Certificates. We will no longer be able to manage your devices and the only recovery option is to re-register all devices into MDM. #### Sample Request ``` curl -X DELETE https://console.jumpcloud.com/api/v2/applemdms/{id} \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - * @param ctx context.Context for authentication, logging, tracing, etc. - @param appleMdmId - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "xOrgId" (string) - @return AppleMdm*/ -func (a *AppleMDMApiService) ApplemdmsDelete(ctx context.Context, appleMdmId string, contentType string, accept string, localVarOptionals map[string]interface{}) (AppleMdm, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Delete") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload AppleMdm - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/applemdms/{apple_mdm_id}" - localVarPath = strings.Replace(localVarPath, "{"+"apple_mdm_id"+"}", fmt.Sprintf("%v", appleMdmId), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return successPayload, nil, err - } - - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* AppleMDMApiService List Apple MDMs - Get a list of all Apple MDM configurations. An empty topic indicates that a signed certificate from Apple has not been provided to the PUT endpoint yet. Note: currently only one MDM configuration per organization is supported. #### Sample Request ``` curl https://console.jumpcloud.com/api/v2/applemdms \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - * @param ctx context.Context for authentication, logging, tracing, etc. - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "xOrgId" (string) - @return []AppleMdm*/ -func (a *AppleMDMApiService) ApplemdmsList(ctx context.Context, contentType string, accept string, localVarOptionals map[string]interface{}) ([]AppleMdm, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload []AppleMdm - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/applemdms" - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return successPayload, nil, err - } - - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* AppleMDMApiService Create Apple MDM - Creates an Apple MDM Enrollment for an organization. Only one enrollment per organization will be allowed. Note that this is the first step in completly setting up an MDM Enrollment. The user must supply the returned plist to Apple for signing, and then provide the certificate provided by Apple back into the PUT API. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/organizations/{Organization_ID}/mdm \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{}' ``` - * @param ctx context.Context for authentication, logging, tracing, etc. - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "body" (Body) - @param "xOrgId" (string) - @return InlineResponse201*/ -func (a *AppleMDMApiService) ApplemdmsPost(ctx context.Context, contentType string, accept string, localVarOptionals map[string]interface{}) (InlineResponse201, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Post") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload InlineResponse201 - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/applemdms" - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return successPayload, nil, err - } - - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - // body params - if localVarTempParam, localVarOk := localVarOptionals["body"].(Body); localVarOk { - localVarPostBody = &localVarTempParam - } - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* AppleMDMApiService Update an Apple MDM - Updates an Apple MDM configuration. This endpoint is used to supply JumpCloud with a signed certificate from Apple in order to finalize the setup and allow JumpCloud to manage your devices. #### Sample Request ``` curl -X PUT https://console.jumpcloud.com/api/v2/applemdms/{ID} \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"name\": \"MDM name\", \"appleSignedCert\": \"{CERTIFICATE}\" }' ``` - * @param ctx context.Context for authentication, logging, tracing, etc. - @param appleMdmId - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "body" (AppleMdmPatchInput) - @param "xOrgId" (string) - @return AppleMdm*/ -func (a *AppleMDMApiService) ApplemdmsPut(ctx context.Context, appleMdmId string, contentType string, accept string, localVarOptionals map[string]interface{}) (AppleMdm, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Put") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload AppleMdm - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/applemdms/{apple_mdm_id}" - localVarPath = strings.Replace(localVarPath, "{"+"apple_mdm_id"+"}", fmt.Sprintf("%v", appleMdmId), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return successPayload, nil, err - } - - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - // body params - if localVarTempParam, localVarOk := localVarOptionals["body"].(AppleMdmPatchInput); localVarOk { - localVarPostBody = &localVarTempParam - } - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* AppleMDMApiService Get an Apple MDM Enrollment Profile - Get an enrollment profile Currently only requesting the mobileconfig is supported. #### Sample Request ``` curl https://console.jumpcloud.com/api/v2/applemdms/{APPLE_MDM_ID}/enrollmentprofiles/{ENROLLMENT_PROFILE_ID} \\ -H 'accept: application/x-apple-aspen-config' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - * @param ctx context.Context for authentication, logging, tracing, etc. - @param appleMdmId - @param enrollmentProfileId - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "xOrgId" (string) - @return Mobileconfig*/ -func (a *AppleMDMApiService) EnrollmentprofilesGet(ctx context.Context, appleMdmId string, enrollmentProfileId string, contentType string, accept string, localVarOptionals map[string]interface{}) (Mobileconfig, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload Mobileconfig - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/applemdms/{apple_mdm_id}/enrollmentprofiles/{enrollment_profile_id}" - localVarPath = strings.Replace(localVarPath, "{"+"apple_mdm_id"+"}", fmt.Sprintf("%v", appleMdmId), -1) - localVarPath = strings.Replace(localVarPath, "{"+"enrollment_profile_id"+"}", fmt.Sprintf("%v", enrollmentProfileId), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return successPayload, nil, err - } - - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/x-apple-aspen-config", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* AppleMDMApiService List Apple MDM Enrollment Profiles - Get a list of enrollment profiles for an apple mdm. Note: currently only one enrollment profile is supported. #### Sample Request ``` curl https://console.jumpcloud.com/api/v2/applemdms/{APPLE_MDM_ID}/enrollmentprofiles \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - * @param ctx context.Context for authentication, logging, tracing, etc. - @param appleMdmId - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "xOrgId" (string) - @return []AppleMdm*/ -func (a *AppleMDMApiService) EnrollmentprofilesList(ctx context.Context, appleMdmId string, contentType string, accept string, localVarOptionals map[string]interface{}) ([]AppleMdm, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload []AppleMdm - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/applemdms/{apple_mdm_id}/enrollmentprofiles" - localVarPath = strings.Replace(localVarPath, "{"+"apple_mdm_id"+"}", fmt.Sprintf("%v", appleMdmId), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return successPayload, nil, err - } - - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - diff --git a/v2/apple_mdm_patch_input.go b/v2/apple_mdm_patch_input.go deleted file mode 100644 index 0200540..0000000 --- a/v2/apple_mdm_patch_input.go +++ /dev/null @@ -1,19 +0,0 @@ -/* - * JumpCloud APIs - * - * JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. - * - * API version: 2.0 - * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) - */ - -package v2 - -type AppleMdmPatchInput struct { - - // A signed certificate obtained from Apple after providing Apple with the plist file provided on POST. - AppleSignedCert string `json:"appleSignedCert,omitempty"` - - // A new name for the Apple MDM configuration. - Name string `json:"name,omitempty"` -} diff --git a/v2/applications_api.go b/v2/applications_api.go deleted file mode 100644 index 3c83888..0000000 --- a/v2/applications_api.go +++ /dev/null @@ -1,436 +0,0 @@ -/* - * JumpCloud APIs - * - * JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. - * - * API version: 2.0 - * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) - */ - -package v2 - -import ( - "io/ioutil" - "net/url" - "net/http" - "strings" - "golang.org/x/net/context" - "encoding/json" - "fmt" -) - -// Linger please -var ( - _ context.Context -) - -type ApplicationsApiService service - - -/* ApplicationsApiService List the associations of an Application - This endpoint will return the _direct_ associations of an Application. A direct association can be a non-homogeneous relationship between 2 different objects, for example Applications and User Groups. #### Sample Request ``` curl -X GET 'https://console.jumpcloud.com/api/v2/applications/{Application_ID}/associations?targets=user_group \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - * @param ctx context.Context for authentication, logging, tracing, etc. - @param applicationId ObjectID of the Application. - @param targets - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "limit" (int32) The number of records to return at once. Limited to 100. - @param "skip" (int32) The offset into the records to return. - @param "xOrgId" (string) - @return []GraphConnection*/ -func (a *ApplicationsApiService) GraphApplicationAssociationsList(ctx context.Context, applicationId string, targets []string, contentType string, accept string, localVarOptionals map[string]interface{}) ([]GraphConnection, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload []GraphConnection - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/applications/{application_id}/associations" - localVarPath = strings.Replace(localVarPath, "{"+"application_id"+"}", fmt.Sprintf("%v", applicationId), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["limit"], "int32", "limit"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["skip"], "int32", "skip"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return successPayload, nil, err - } - - localVarQueryParams.Add("targets", parameterToString(targets, "csv")) - if localVarTempParam, localVarOk := localVarOptionals["limit"].(int32); localVarOk { - localVarQueryParams.Add("limit", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["skip"].(int32); localVarOk { - localVarQueryParams.Add("skip", parameterToString(localVarTempParam, "")) - } - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* ApplicationsApiService Manage the associations of an Application - This endpoint allows you to manage the _direct_ associations of an Application. A direct association can be a non-homogeneous relationship between 2 different objects, for example Application and User Groups. #### Sample Request ``` curl -X POST 'https://console.jumpcloud.com/api/v2/applications/{Application_ID}/associations' \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"op\": \"add\", \"type\": \"user_group\", \"id\": \"{Group_ID}\" }' ``` - * @param ctx context.Context for authentication, logging, tracing, etc. - @param applicationId ObjectID of the Application. - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "body" (GraphManagementReq) - @param "xOrgId" (string) - @return */ -func (a *ApplicationsApiService) GraphApplicationAssociationsPost(ctx context.Context, applicationId string, contentType string, accept string, localVarOptionals map[string]interface{}) ( *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Post") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/applications/{application_id}/associations" - localVarPath = strings.Replace(localVarPath, "{"+"application_id"+"}", fmt.Sprintf("%v", applicationId), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return nil, err - } - - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - // body params - if localVarTempParam, localVarOk := localVarOptionals["body"].(GraphManagementReq); localVarOk { - localVarPostBody = &localVarTempParam - } - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - return localVarHttpResponse, err -} - -/* ApplicationsApiService List the Users bound to an Application - This endpoint will return all Users bound to an Application, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this Application to the corresponding User; this array represents all grouping and/or associations that would have to be removed to deprovision the User from this Application. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/applications/{Application_ID}/users \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - * @param ctx context.Context for authentication, logging, tracing, etc. - @param applicationId ObjectID of the Application. - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "limit" (int32) The number of records to return at once. Limited to 100. - @param "xOrgId" (string) - @param "skip" (int32) The offset into the records to return. - @param "filter" ([]string) Supported operators are: eq, ne, gt, ge, lt, le, between, search, in - @return []GraphObjectWithPaths*/ -func (a *ApplicationsApiService) GraphApplicationTraverseUser(ctx context.Context, applicationId string, contentType string, accept string, localVarOptionals map[string]interface{}) ([]GraphObjectWithPaths, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload []GraphObjectWithPaths - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/applications/{application_id}/users" - localVarPath = strings.Replace(localVarPath, "{"+"application_id"+"}", fmt.Sprintf("%v", applicationId), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["limit"], "int32", "limit"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["skip"], "int32", "skip"); err != nil { - return successPayload, nil, err - } - - if localVarTempParam, localVarOk := localVarOptionals["limit"].(int32); localVarOk { - localVarQueryParams.Add("limit", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["skip"].(int32); localVarOk { - localVarQueryParams.Add("skip", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["filter"].([]string); localVarOk { - localVarQueryParams.Add("filter", parameterToString(localVarTempParam, "csv")) - } - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* ApplicationsApiService List the User Groups bound to an Application - This endpoint will return all Users Groups bound to an Application, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the group's type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this Application to the corresponding User Group; this array represents all grouping and/or associations that would have to be removed to deprovision the User Group from this Application. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/applications/{Application_ID}/usergroups \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - * @param ctx context.Context for authentication, logging, tracing, etc. - @param applicationId ObjectID of the Application. - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "limit" (int32) The number of records to return at once. Limited to 100. - @param "xOrgId" (string) - @param "skip" (int32) The offset into the records to return. - @param "filter" ([]string) Supported operators are: eq, ne, gt, ge, lt, le, between, search, in - @return []GraphObjectWithPaths*/ -func (a *ApplicationsApiService) GraphApplicationTraverseUserGroup(ctx context.Context, applicationId string, contentType string, accept string, localVarOptionals map[string]interface{}) ([]GraphObjectWithPaths, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload []GraphObjectWithPaths - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/applications/{application_id}/usergroups" - localVarPath = strings.Replace(localVarPath, "{"+"application_id"+"}", fmt.Sprintf("%v", applicationId), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["limit"], "int32", "limit"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["skip"], "int32", "skip"); err != nil { - return successPayload, nil, err - } - - if localVarTempParam, localVarOk := localVarOptionals["limit"].(int32); localVarOk { - localVarQueryParams.Add("limit", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["skip"].(int32); localVarOk { - localVarQueryParams.Add("skip", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["filter"].([]string); localVarOk { - localVarQueryParams.Add("filter", parameterToString(localVarTempParam, "csv")) - } - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - diff --git a/v2/auth_info.go b/v2/auth_info.go deleted file mode 100644 index a591d61..0000000 --- a/v2/auth_info.go +++ /dev/null @@ -1,19 +0,0 @@ -/* - * JumpCloud APIs - * - * JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. - * - * API version: 2.0 - * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) - */ - -package v2 - -type AuthInfo struct { - - Expiry string `json:"expiry,omitempty"` - - IsValid bool `json:"isValid,omitempty"` - - Message string `json:"message,omitempty"` -} diff --git a/v2/auth_input.go b/v2/auth_input.go deleted file mode 100644 index 36e1875..0000000 --- a/v2/auth_input.go +++ /dev/null @@ -1,17 +0,0 @@ -/* - * JumpCloud APIs - * - * JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. - * - * API version: 2.0 - * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) - */ - -package v2 - -type AuthInput struct { - - Basic *AuthinputBasic `json:"basic,omitempty"` - - Oauth *AuthinputOauth `json:"oauth,omitempty"` -} diff --git a/v2/auth_input_object.go b/v2/auth_input_object.go deleted file mode 100644 index 7c14954..0000000 --- a/v2/auth_input_object.go +++ /dev/null @@ -1,15 +0,0 @@ -/* - * JumpCloud APIs - * - * JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. - * - * API version: 2.0 - * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) - */ - -package v2 - -type AuthInputObject struct { - - Auth *AuthInput `json:"auth,omitempty"` -} diff --git a/v2/authinput_basic.go b/v2/authinput_basic.go deleted file mode 100644 index a58379e..0000000 --- a/v2/authinput_basic.go +++ /dev/null @@ -1,17 +0,0 @@ -/* - * JumpCloud APIs - * - * JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. - * - * API version: 2.0 - * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) - */ - -package v2 - -type AuthinputBasic struct { - - Password string `json:"password,omitempty"` - - Username string `json:"username,omitempty"` -} diff --git a/v2/authinput_oauth.go b/v2/authinput_oauth.go deleted file mode 100644 index 76c6ea4..0000000 --- a/v2/authinput_oauth.go +++ /dev/null @@ -1,15 +0,0 @@ -/* - * JumpCloud APIs - * - * JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. - * - * API version: 2.0 - * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) - */ - -package v2 - -type AuthinputOauth struct { - - Code string `json:"code,omitempty"` -} diff --git a/v2/body.go b/v2/body.go deleted file mode 100644 index 55d5ea4..0000000 --- a/v2/body.go +++ /dev/null @@ -1,16 +0,0 @@ -/* - * JumpCloud APIs - * - * JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. - * - * API version: 2.0 - * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) - */ - -package v2 - -type Body struct { - - // The name used to identify this AppleMDM. - Name string `json:"name,omitempty"` -} diff --git a/v2/body_1.go b/v2/body_1.go deleted file mode 100644 index 5ea7c77..0000000 --- a/v2/body_1.go +++ /dev/null @@ -1,19 +0,0 @@ -/* - * JumpCloud APIs - * - * JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. - * - * API version: 2.0 - * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) - */ - -package v2 - -type Body1 struct { - - Groups []string `json:"groups,omitempty"` - - Name string `json:"name,omitempty"` - - Users []string `json:"users,omitempty"` -} diff --git a/v2/body_2.go b/v2/body_2.go deleted file mode 100644 index 107df2a..0000000 --- a/v2/body_2.go +++ /dev/null @@ -1,19 +0,0 @@ -/* - * JumpCloud APIs - * - * JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. - * - * API version: 2.0 - * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) - */ - -package v2 - -type Body2 struct { - - Groups []string `json:"groups,omitempty"` - - Name string `json:"name,omitempty"` - - Users []string `json:"users,omitempty"` -} diff --git a/v2/body_3.go b/v2/body_3.go deleted file mode 100644 index 36cf1d9..0000000 --- a/v2/body_3.go +++ /dev/null @@ -1,19 +0,0 @@ -/* - * JumpCloud APIs - * - * JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. - * - * API version: 2.0 - * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) - */ - -package v2 - -type Body3 struct { - - Id string `json:"id,omitempty"` - - UserLockoutAction *LdapServerAction `json:"userLockoutAction,omitempty"` - - UserPasswordExpirationAction *LdapServerAction `json:"userPasswordExpirationAction,omitempty"` -} diff --git a/v2/bulk_job_requests_api.go b/v2/bulk_job_requests_api.go deleted file mode 100644 index d010401..0000000 --- a/v2/bulk_job_requests_api.go +++ /dev/null @@ -1,508 +0,0 @@ -/* - * JumpCloud APIs - * - * JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. - * - * API version: 2.0 - * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) - */ - -package v2 - -import ( - "io/ioutil" - "net/url" - "net/http" - "strings" - "golang.org/x/net/context" - "encoding/json" - "fmt" -) - -// Linger please -var ( - _ context.Context -) - -type BulkJobRequestsApiService service - - -/* BulkJobRequestsApiService Bulk Users Create - The endpoint allows you to create a bulk job to asynchronously create users. See [Create a System User](https://docs.jumpcloud.com/1.0/systemusers/create-a-system-user) for full list of attributes. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/bulk/users \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '[ { \"email\":\"{email}\", \"firstname\":\"{firstname}\", \"lastname\":\"{firstname}\", \"username\":\"{username}\", \"attributes\":[ {\"name\":\"EmployeeID\",\"value\":\"0000\"}, {\"name\":\"Custom\",\"value\":\"attribute\"} ] } ] ``` - * @param ctx context.Context for authentication, logging, tracing, etc. - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "body" ([]BulkUserCreate) - @param "xOrgId" (string) - @return JobId*/ -func (a *BulkJobRequestsApiService) BulkUsersCreate(ctx context.Context, contentType string, accept string, localVarOptionals map[string]interface{}) (JobId, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Post") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload JobId - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/bulk/users" - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return successPayload, nil, err - } - - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - // body params - if localVarTempParam, localVarOk := localVarOptionals["body"].([]BulkUserCreate); localVarOk { - localVarPostBody = &localVarTempParam - } - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* BulkJobRequestsApiService List Bulk Users Results - This endpoint will return the results of particular user import or update job request. #### Sample Request ``` curl -X GET \\ https://console.jumpcloud.com/api/v2/bulk/users/{ImportJobID}/results \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - * @param ctx context.Context for authentication, logging, tracing, etc. - @param jobId - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "limit" (int32) The number of records to return at once. Limited to 100. - @param "skip" (int32) The offset into the records to return. - @param "xOrgId" (string) - @return []JobWorkresult*/ -func (a *BulkJobRequestsApiService) BulkUsersCreateResults(ctx context.Context, jobId string, contentType string, accept string, localVarOptionals map[string]interface{}) ([]JobWorkresult, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload []JobWorkresult - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/bulk/users/{job_id}/results" - localVarPath = strings.Replace(localVarPath, "{"+"job_id"+"}", fmt.Sprintf("%v", jobId), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["limit"], "int32", "limit"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["skip"], "int32", "skip"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return successPayload, nil, err - } - - if localVarTempParam, localVarOk := localVarOptionals["limit"].(int32); localVarOk { - localVarQueryParams.Add("limit", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["skip"].(int32); localVarOk { - localVarQueryParams.Add("skip", parameterToString(localVarTempParam, "")) - } - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* BulkJobRequestsApiService Bulk Users Update - The endpoint allows you to create a bulk job to asynchronously update users. See [Update a System User](https://docs.jumpcloud.com/1.0/systemusers/update-a-system-user) for full list of attributes. #### Sample Request ``` curl -X PATCH https://console.jumpcloud.com/api/v2/bulk/users \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '[ { \"id\":\"5be9fb4ddb01290001e85109\", \"firstname\":\"{UPDATED_FIRSTNAME}\", \"department\":\"{UPDATED_DEPARTMENT}\", \"attributes\":[ {\"name\":\"Custom\",\"value\":\"{ATTRIBUTE_VALUE}\"} ] }, { \"id\":\"5be9fb4ddb01290001e85109\", \"firstname\":\"{UPDATED_FIRSTNAME}\", \"costCenter\":\"{UPDATED_COST_CENTER}\", \"phoneNumbers\":[ {\"type\":\"home\",\"number\":\"{HOME_PHONE_NUMBER}\"}, {\"type\":\"work\",\"number\":\"{WORK_PHONE_NUMBER}\"} ] } ] ``` - * @param ctx context.Context for authentication, logging, tracing, etc. - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "body" ([]BulkUserUpdate) - @param "xOrgId" (string) - @return JobId*/ -func (a *BulkJobRequestsApiService) BulkUsersUpdate(ctx context.Context, contentType string, accept string, localVarOptionals map[string]interface{}) (JobId, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Patch") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload JobId - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/bulk/users" - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return successPayload, nil, err - } - - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - // body params - if localVarTempParam, localVarOk := localVarOptionals["body"].([]BulkUserUpdate); localVarOk { - localVarPostBody = &localVarTempParam - } - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* BulkJobRequestsApiService Get Job (incomplete) - **This endpoint is not complete and should remain hidden as it's not functional yet.** - * @param ctx context.Context for authentication, logging, tracing, etc. - @param id - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "xOrgId" (string) - @return JobDetails*/ -func (a *BulkJobRequestsApiService) JobsGet(ctx context.Context, id string, contentType string, accept string, localVarOptionals map[string]interface{}) (JobDetails, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload JobDetails - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/jobs/{id}" - localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return successPayload, nil, err - } - - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* BulkJobRequestsApiService List Job Results - This endpoint will return the results of particular import job request. #### Sample Request ``` curl -X GET \\ https://console.jumpcloud.com/api/v2/jobs/{ImportJobID}/results \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - * @param ctx context.Context for authentication, logging, tracing, etc. - @param id - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "limit" (int32) The number of records to return at once. Limited to 100. - @param "skip" (int32) The offset into the records to return. - @param "xOrgId" (string) - @return []JobWorkresult*/ -func (a *BulkJobRequestsApiService) JobsResults(ctx context.Context, id string, contentType string, accept string, localVarOptionals map[string]interface{}) ([]JobWorkresult, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload []JobWorkresult - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/jobs/{id}/results" - localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["limit"], "int32", "limit"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["skip"], "int32", "skip"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return successPayload, nil, err - } - - if localVarTempParam, localVarOk := localVarOptionals["limit"].(int32); localVarOk { - localVarQueryParams.Add("limit", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["skip"].(int32); localVarOk { - localVarQueryParams.Add("skip", parameterToString(localVarTempParam, "")) - } - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - diff --git a/v2/bulk_user_create.go b/v2/bulk_user_create.go deleted file mode 100644 index 419c8a8..0000000 --- a/v2/bulk_user_create.go +++ /dev/null @@ -1,25 +0,0 @@ -/* - * JumpCloud APIs - * - * JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. - * - * API version: 2.0 - * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) - */ - -package v2 - -// See [V1 system user creation](https://docs.jumpcloud.com/1.0/systemusers/create-a-system-user) for full list of attributes. -type BulkUserCreate struct { - - // Map of additional attributes. - Attributes []interface{} `json:"attributes,omitempty"` - - Email string `json:"email,omitempty"` - - Firstname string `json:"firstname,omitempty"` - - Lastname string `json:"lastname,omitempty"` - - Username string `json:"username,omitempty"` -} diff --git a/v2/bulk_user_update.go b/v2/bulk_user_update.go deleted file mode 100644 index 807671c..0000000 --- a/v2/bulk_user_update.go +++ /dev/null @@ -1,28 +0,0 @@ -/* - * JumpCloud APIs - * - * JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. - * - * API version: 2.0 - * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) - */ - -package v2 - -// See [V1 system user update](https://docs.jumpcloud.com/1.0/systemusers/update-a-system-user) for full list of attributes. -type BulkUserUpdate struct { - - // Map of additional attributes. - Attributes []interface{} `json:"attributes,omitempty"` - - Email string `json:"email,omitempty"` - - Firstname string `json:"firstname,omitempty"` - - // Object ID of the systemuser being updated - Id string `json:"id,omitempty"` - - Lastname string `json:"lastname,omitempty"` - - Username string `json:"username,omitempty"` -} diff --git a/v2/commands_api.go b/v2/commands_api.go deleted file mode 100644 index 771ee9c..0000000 --- a/v2/commands_api.go +++ /dev/null @@ -1,436 +0,0 @@ -/* - * JumpCloud APIs - * - * JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. - * - * API version: 2.0 - * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) - */ - -package v2 - -import ( - "io/ioutil" - "net/url" - "net/http" - "strings" - "golang.org/x/net/context" - "encoding/json" - "fmt" -) - -// Linger please -var ( - _ context.Context -) - -type CommandsApiService service - - -/* CommandsApiService List the associations of a Command - This endpoint will return the _direct_ associations of this Command. A direct association can be a non-homogeneous relationship between 2 different objects, for example Commands and User Groups. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/commands/{Command_ID}/associations?targets=system_group \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - * @param ctx context.Context for authentication, logging, tracing, etc. - @param commandId ObjectID of the Command. - @param targets - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "limit" (int32) The number of records to return at once. Limited to 100. - @param "skip" (int32) The offset into the records to return. - @param "xOrgId" (string) - @return []GraphConnection*/ -func (a *CommandsApiService) GraphCommandAssociationsList(ctx context.Context, commandId string, targets []string, contentType string, accept string, localVarOptionals map[string]interface{}) ([]GraphConnection, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload []GraphConnection - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/commands/{command_id}/associations" - localVarPath = strings.Replace(localVarPath, "{"+"command_id"+"}", fmt.Sprintf("%v", commandId), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["limit"], "int32", "limit"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["skip"], "int32", "skip"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return successPayload, nil, err - } - - localVarQueryParams.Add("targets", parameterToString(targets, "csv")) - if localVarTempParam, localVarOk := localVarOptionals["limit"].(int32); localVarOk { - localVarQueryParams.Add("limit", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["skip"].(int32); localVarOk { - localVarQueryParams.Add("skip", parameterToString(localVarTempParam, "")) - } - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* CommandsApiService Manage the associations of a Command - This endpoint will allow you to manage the _direct_ associations of this Command. A direct association can be a non-homogeneous relationship between 2 different objects, for example Commands and User Groups. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/commands/{Command_ID}/associations \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"op\": \"add\", \"type\": \"system_group\", \"id\": \"Group_ID\" }' ``` - * @param ctx context.Context for authentication, logging, tracing, etc. - @param commandId ObjectID of the Command. - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "body" (GraphManagementReq) - @param "xOrgId" (string) - @return */ -func (a *CommandsApiService) GraphCommandAssociationsPost(ctx context.Context, commandId string, contentType string, accept string, localVarOptionals map[string]interface{}) ( *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Post") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/commands/{command_id}/associations" - localVarPath = strings.Replace(localVarPath, "{"+"command_id"+"}", fmt.Sprintf("%v", commandId), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return nil, err - } - - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - // body params - if localVarTempParam, localVarOk := localVarOptionals["body"].(GraphManagementReq); localVarOk { - localVarPostBody = &localVarTempParam - } - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - return localVarHttpResponse, err -} - -/* CommandsApiService List the Systems bound to a Command - This endpoint will return all Systems bound to a Command, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this Command to the corresponding System; this array represents all grouping and/or associations that would have to be removed to deprovision the System from this Command. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/commands/{Command_ID}/systems \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - * @param ctx context.Context for authentication, logging, tracing, etc. - @param commandId ObjectID of the Command. - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "limit" (int32) The number of records to return at once. Limited to 100. - @param "xOrgId" (string) - @param "skip" (int32) The offset into the records to return. - @param "filter" ([]string) Supported operators are: eq, ne, gt, ge, lt, le, between, search, in - @return []GraphObjectWithPaths*/ -func (a *CommandsApiService) GraphCommandTraverseSystem(ctx context.Context, commandId string, contentType string, accept string, localVarOptionals map[string]interface{}) ([]GraphObjectWithPaths, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload []GraphObjectWithPaths - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/commands/{command_id}/systems" - localVarPath = strings.Replace(localVarPath, "{"+"command_id"+"}", fmt.Sprintf("%v", commandId), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["limit"], "int32", "limit"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["skip"], "int32", "skip"); err != nil { - return successPayload, nil, err - } - - if localVarTempParam, localVarOk := localVarOptionals["limit"].(int32); localVarOk { - localVarQueryParams.Add("limit", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["skip"].(int32); localVarOk { - localVarQueryParams.Add("skip", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["filter"].([]string); localVarOk { - localVarQueryParams.Add("filter", parameterToString(localVarTempParam, "csv")) - } - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* CommandsApiService List the System Groups bound to a Command - This endpoint will return all System Groups bound to a Command, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the group's type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this Command to the corresponding System Group; this array represents all grouping and/or associations that would have to be removed to deprovision the System Group from this Command. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/commands/{Command_ID}/systemgroups \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - * @param ctx context.Context for authentication, logging, tracing, etc. - @param commandId ObjectID of the Command. - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "limit" (int32) The number of records to return at once. Limited to 100. - @param "xOrgId" (string) - @param "skip" (int32) The offset into the records to return. - @param "filter" ([]string) Supported operators are: eq, ne, gt, ge, lt, le, between, search, in - @return []GraphObjectWithPaths*/ -func (a *CommandsApiService) GraphCommandTraverseSystemGroup(ctx context.Context, commandId string, contentType string, accept string, localVarOptionals map[string]interface{}) ([]GraphObjectWithPaths, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload []GraphObjectWithPaths - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/commands/{command_id}/systemgroups" - localVarPath = strings.Replace(localVarPath, "{"+"command_id"+"}", fmt.Sprintf("%v", commandId), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["limit"], "int32", "limit"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["skip"], "int32", "skip"); err != nil { - return successPayload, nil, err - } - - if localVarTempParam, localVarOk := localVarOptionals["limit"].(int32); localVarOk { - localVarQueryParams.Add("limit", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["skip"].(int32); localVarOk { - localVarQueryParams.Add("skip", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["filter"].([]string); localVarOk { - localVarQueryParams.Add("filter", parameterToString(localVarTempParam, "csv")) - } - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - diff --git a/v2/configuration.go b/v2/configuration.go deleted file mode 100644 index b26da2e..0000000 --- a/v2/configuration.go +++ /dev/null @@ -1,72 +0,0 @@ -/* - * JumpCloud APIs - * - * JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. - * - * API version: 2.0 - * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) - */ - -package v2 - -import ( - "net/http" -) - -// contextKeys are used to identify the type of value in the context. -// Since these are string, it is possible to get a short description of the -// context key for logging and debugging using key.String(). - -type contextKey string - -func (c contextKey) String() string { - return "auth " + string(c) -} - -var ( - // ContextOAuth2 takes a oauth2.TokenSource as authentication for the request. - ContextOAuth2 = contextKey("token") - - // ContextBasicAuth takes BasicAuth as authentication for the request. - ContextBasicAuth = contextKey("basic") - - // ContextAccessToken takes a string oauth2 access token as authentication for the request. - ContextAccessToken = contextKey("accesstoken") - - // ContextAPIKey takes an APIKey as authentication for the request - ContextAPIKey = contextKey("apikey") -) - -// BasicAuth provides basic http authentication to a request passed via context using ContextBasicAuth -type BasicAuth struct { - UserName string `json:"userName,omitempty"` - Password string `json:"password,omitempty"` -} - -// APIKey provides API key based authentication to a request passed via context using ContextAPIKey -type APIKey struct { - Key string - Prefix string -} - -type Configuration struct { - BasePath string `json:"basePath,omitempty"` - Host string `json:"host,omitempty"` - Scheme string `json:"scheme,omitempty"` - DefaultHeader map[string]string `json:"defaultHeader,omitempty"` - UserAgent string `json:"userAgent,omitempty"` - HTTPClient *http.Client -} - -func NewConfiguration() *Configuration { - cfg := &Configuration{ - BasePath: "https://console.jumpcloud.com/api/v2", - DefaultHeader: make(map[string]string), - UserAgent: "Swagger-Codegen/3.0.0/go", - } - return cfg -} - -func (c *Configuration) AddDefaultHeader(key string, value string) { - c.DefaultHeader[key] = value -} \ No newline at end of file diff --git a/v2/default_api.go b/v2/default_api.go deleted file mode 100644 index d242b24..0000000 --- a/v2/default_api.go +++ /dev/null @@ -1,432 +0,0 @@ -/* - * JumpCloud APIs - * - * JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. - * - * API version: 2.0 - * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) - */ - -package v2 - -import ( - "io/ioutil" - "net/url" - "net/http" - "strings" - "golang.org/x/net/context" - "encoding/json" - "fmt" -) - -// Linger please -var ( - _ context.Context -) - -type DefaultApiService service - - -/* DefaultApiService Delete Enrollment Profile - * @param ctx context.Context for authentication, logging, tracing, etc. - @param enrollmentProfileId - @return JcEnrollmentProfile*/ -func (a *DefaultApiService) JcEnrollmentProfilesDelete(ctx context.Context, enrollmentProfileId string) (JcEnrollmentProfile, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Delete") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload JcEnrollmentProfile - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/enrollmentprofiles/{enrollment_profile_id}" - localVarPath = strings.Replace(localVarPath, "{"+"enrollment_profile_id"+"}", fmt.Sprintf("%v", enrollmentProfileId), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* DefaultApiService Get Enrollment Profile - * @param ctx context.Context for authentication, logging, tracing, etc. - @param enrollmentProfileId - @param optional (nil or map[string]interface{}) with one or more of: - @param "body" (JcEnrollmentProfile) - @return */ -func (a *DefaultApiService) JcEnrollmentProfilesGet(ctx context.Context, enrollmentProfileId string, localVarOptionals map[string]interface{}) ( *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/enrollmentprofiles/{enrollment_profile_id}" - localVarPath = strings.Replace(localVarPath, "{"+"enrollment_profile_id"+"}", fmt.Sprintf("%v", enrollmentProfileId), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - // body params - if localVarTempParam, localVarOk := localVarOptionals["body"].(JcEnrollmentProfile); localVarOk { - localVarPostBody = &localVarTempParam - } - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - return localVarHttpResponse, err -} - -/* DefaultApiService List Enrollment Profiles - * @param ctx context.Context for authentication, logging, tracing, etc. - @param optional (nil or map[string]interface{}) with one or more of: - @param "limit" (int32) - @param "skip" (int32) The offset into the records to return. - @return []JcEnrollmentProfile*/ -func (a *DefaultApiService) JcEnrollmentProfilesList(ctx context.Context, localVarOptionals map[string]interface{}) ([]JcEnrollmentProfile, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload []JcEnrollmentProfile - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/enrollmentprofiles" - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["limit"], "int32", "limit"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["skip"], "int32", "skip"); err != nil { - return successPayload, nil, err - } - - if localVarTempParam, localVarOk := localVarOptionals["limit"].(int32); localVarOk { - localVarQueryParams.Add("limit", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["skip"].(int32); localVarOk { - localVarQueryParams.Add("skip", parameterToString(localVarTempParam, "")) - } - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* DefaultApiService Create new Enrollment Profile - * @param ctx context.Context for authentication, logging, tracing, etc. - @param optional (nil or map[string]interface{}) with one or more of: - @param "body" (Body1) - @return JcEnrollmentProfile*/ -func (a *DefaultApiService) JcEnrollmentProfilesPost(ctx context.Context, localVarOptionals map[string]interface{}) (JcEnrollmentProfile, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Post") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload JcEnrollmentProfile - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/enrollmentprofiles" - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - // body params - if localVarTempParam, localVarOk := localVarOptionals["body"].(Body1); localVarOk { - localVarPostBody = &localVarTempParam - } - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* DefaultApiService Update Enrollment Profile - * @param ctx context.Context for authentication, logging, tracing, etc. - @param enrollmentProfileId - @param optional (nil or map[string]interface{}) with one or more of: - @param "body" (Body2) - @return JcEnrollmentProfile*/ -func (a *DefaultApiService) JcEnrollmentProfilesPut(ctx context.Context, enrollmentProfileId string, localVarOptionals map[string]interface{}) (JcEnrollmentProfile, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Put") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload JcEnrollmentProfile - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/enrollmentprofiles/{enrollment_profile_id}" - localVarPath = strings.Replace(localVarPath, "{"+"enrollment_profile_id"+"}", fmt.Sprintf("%v", enrollmentProfileId), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - // body params - if localVarTempParam, localVarOk := localVarOptionals["body"].(Body2); localVarOk { - localVarPostBody = &localVarTempParam - } - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - diff --git a/v2/directories_api.go b/v2/directories_api.go deleted file mode 100644 index 8804004..0000000 --- a/v2/directories_api.go +++ /dev/null @@ -1,137 +0,0 @@ -/* - * JumpCloud APIs - * - * JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. - * - * API version: 2.0 - * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) - */ - -package v2 - -import ( - "io/ioutil" - "net/url" - "net/http" - "strings" - "golang.org/x/net/context" - "encoding/json" -) - -// Linger please -var ( - _ context.Context -) - -type DirectoriesApiService service - - -/* DirectoriesApiService List All Directories - This endpoint returns all active directories (LDAP, O365 Suite, G-Suite). #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - * @param ctx context.Context for authentication, logging, tracing, etc. - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "fields" ([]string) The comma separated fields included in the returned records. If omitted, the default list of fields will be returned. - @param "limit" (int32) The number of records to return at once. Limited to 100. - @param "sort" ([]string) The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. - @param "skip" (int32) The offset into the records to return. - @param "xOrgId" (string) - @return []Directory*/ -func (a *DirectoriesApiService) DirectoriesList(ctx context.Context, contentType string, accept string, localVarOptionals map[string]interface{}) ([]Directory, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload []Directory - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/directories" - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["limit"], "int32", "limit"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["skip"], "int32", "skip"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return successPayload, nil, err - } - - if localVarTempParam, localVarOk := localVarOptionals["fields"].([]string); localVarOk { - localVarQueryParams.Add("fields", parameterToString(localVarTempParam, "csv")) - } - if localVarTempParam, localVarOk := localVarOptionals["limit"].(int32); localVarOk { - localVarQueryParams.Add("limit", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["sort"].([]string); localVarOk { - localVarQueryParams.Add("sort", parameterToString(localVarTempParam, "csv")) - } - if localVarTempParam, localVarOk := localVarOptionals["skip"].(int32); localVarOk { - localVarQueryParams.Add("skip", parameterToString(localVarTempParam, "")) - } - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - diff --git a/v2/directory.go b/v2/directory.go deleted file mode 100644 index ebed1ae..0000000 --- a/v2/directory.go +++ /dev/null @@ -1,22 +0,0 @@ -/* - * JumpCloud APIs - * - * JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. - * - * API version: 2.0 - * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) - */ - -package v2 - -type Directory struct { - - // The ObjectID of the directory. - Id string `json:"id"` - - // The name of the directory. - Name string `json:"name"` - - // The type of directory. - Type_ string `json:"type"` -} diff --git a/v2/docs/ActiveDirectoryAgentGetOutput.md b/v2/docs/ActiveDirectoryAgentGetOutput.md deleted file mode 100644 index 79f3b1c..0000000 --- a/v2/docs/ActiveDirectoryAgentGetOutput.md +++ /dev/null @@ -1,11 +0,0 @@ -# ActiveDirectoryAgentGetOutput - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**ConnectKey** | **string** | The connect key to use when installing the Agent on a Domain Controller. | [optional] [default to null] -**Id** | **string** | ObjectID of this Active Directory Agent. | [default to null] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/v2/docs/ActiveDirectoryAgentListOutput.md b/v2/docs/ActiveDirectoryAgentListOutput.md deleted file mode 100644 index 3dd5c19..0000000 --- a/v2/docs/ActiveDirectoryAgentListOutput.md +++ /dev/null @@ -1,11 +0,0 @@ -# ActiveDirectoryAgentListOutput - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Id** | **string** | ObjectID of this Active Directory Agent. | [optional] [default to null] -**State** | **string** | | [optional] [default to null] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/v2/docs/ActiveDirectoryApi.md b/v2/docs/ActiveDirectoryApi.md deleted file mode 100644 index 16d156a..0000000 --- a/v2/docs/ActiveDirectoryApi.md +++ /dev/null @@ -1,486 +0,0 @@ -# \ActiveDirectoryApi - -All URIs are relative to *https://console.jumpcloud.com/api/v2* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**ActivedirectoriesAgentsDelete**](ActiveDirectoryApi.md#ActivedirectoriesAgentsDelete) | **Delete** /activedirectories/{activedirectory_id}/agents/{agent_id} | Delete Active Directory Agent -[**ActivedirectoriesAgentsGet**](ActiveDirectoryApi.md#ActivedirectoriesAgentsGet) | **Get** /activedirectories/{activedirectory_id}/agents/{agent_id} | Get Active Directory Agent -[**ActivedirectoriesAgentsList**](ActiveDirectoryApi.md#ActivedirectoriesAgentsList) | **Get** /activedirectories/{activedirectory_id}/agents | List Active Directory Agents -[**ActivedirectoriesAgentsPost**](ActiveDirectoryApi.md#ActivedirectoriesAgentsPost) | **Post** /activedirectories/{activedirectory_id}/agents | Create a new Active Directory Agent -[**ActivedirectoriesDelete**](ActiveDirectoryApi.md#ActivedirectoriesDelete) | **Delete** /activedirectories/{id} | Delete an Active Directory -[**ActivedirectoriesGet**](ActiveDirectoryApi.md#ActivedirectoriesGet) | **Get** /activedirectories/{id} | Get an Active Directory -[**ActivedirectoriesList**](ActiveDirectoryApi.md#ActivedirectoriesList) | **Get** /activedirectories | List Active Directories -[**ActivedirectoriesPost**](ActiveDirectoryApi.md#ActivedirectoriesPost) | **Post** /activedirectories | Create a new Active Directory -[**GraphActiveDirectoryAssociationsList**](ActiveDirectoryApi.md#GraphActiveDirectoryAssociationsList) | **Get** /activedirectories/{activedirectory_id}/associations | List the associations of an Active Directory instance -[**GraphActiveDirectoryAssociationsPost**](ActiveDirectoryApi.md#GraphActiveDirectoryAssociationsPost) | **Post** /activedirectories/{activedirectory_id}/associations | Manage the associations of an Active Directory instance -[**GraphActiveDirectoryTraverseUserGroup**](ActiveDirectoryApi.md#GraphActiveDirectoryTraverseUserGroup) | **Get** /activedirectories/{activedirectory_id}/usergroups | List the User Groups bound to an Active Directory instance - - -# **ActivedirectoriesAgentsDelete** -> ActivedirectoriesAgentsDelete(ctx, activedirectoryId, agentId, contentType, accept, optional) -Delete Active Directory Agent - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **activedirectoryId** | **string**| | - **agentId** | **string**| | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **activedirectoryId** | **string**| | - **agentId** | **string**| | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **xOrgId** | **string**| | [default to ] - -### Return type - - (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **ActivedirectoriesAgentsGet** -> ActiveDirectoryAgentListOutput ActivedirectoriesAgentsGet(ctx, activedirectoryId, agentId, contentType, accept, optional) -Get Active Directory Agent - -This endpoint returns a specific active directory agent. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/activedirectories/{activedirectory_id}/agents/{agent_id} \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **activedirectoryId** | **string**| | - **agentId** | **string**| | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **activedirectoryId** | **string**| | - **agentId** | **string**| | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **xOrgId** | **string**| | [default to ] - -### Return type - -[**ActiveDirectoryAgentListOutput**](active-directory-agent-list-output.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **ActivedirectoriesAgentsList** -> []ActiveDirectoryAgentListOutput ActivedirectoriesAgentsList(ctx, activedirectoryId, contentType, accept, optional) -List Active Directory Agents - -This endpoint allows you to list all your Active Directory Agents for a given Instance. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/activedirectories/{activedirectory_id}/agents \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **activedirectoryId** | **string**| | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **activedirectoryId** | **string**| | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **limit** | **int32**| The number of records to return at once. Limited to 100. | [default to 10] - **skip** | **int32**| The offset into the records to return. | [default to 0] - **sort** | [**[]string**](string.md)| The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. | - **xOrgId** | **string**| | [default to ] - -### Return type - -[**[]ActiveDirectoryAgentListOutput**](active-directory-agent-list-output.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **ActivedirectoriesAgentsPost** -> ActiveDirectoryAgentGetOutput ActivedirectoriesAgentsPost(ctx, activedirectoryId, contentType, accept, optional) -Create a new Active Directory Agent - -This endpoint allows you to create a new Active Directory Agent. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/activedirectories/{activedirectory_id}/agents \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{}' ``` - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **activedirectoryId** | **string**| | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **activedirectoryId** | **string**| | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **body** | [**ActiveDirectoryAgentInput**](ActiveDirectoryAgentInput.md)| | - **xOrgId** | **string**| | [default to ] - -### Return type - -[**ActiveDirectoryAgentGetOutput**](active-directory-agent-get-output.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **ActivedirectoriesDelete** -> ActivedirectoriesDelete(ctx, id, contentType, accept, optional) -Delete an Active Directory - -This endpoint allows you to delete an Active Directory Instance. #### Sample Request ``` curl -X DELETE https://console.jumpcloud.com/api/v2/activedirectories/{ActiveDirectory_ID} \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY' ``` - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **id** | **string**| ObjectID of this Active Directory instance. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **id** | **string**| ObjectID of this Active Directory instance. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **xOrgId** | **string**| | [default to ] - -### Return type - - (empty response body) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **ActivedirectoriesGet** -> ActiveDirectoryOutput ActivedirectoriesGet(ctx, id, contentType, accept, optional) -Get an Active Directory - -This endpoint returns a specific Active Directory. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/activedirectories/{ActiveDirectory_ID} \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **id** | **string**| ObjectID of this Active Directory instance. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **id** | **string**| ObjectID of this Active Directory instance. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **xOrgId** | **string**| | [default to ] - -### Return type - -[**ActiveDirectoryOutput**](active-directory-output.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **ActivedirectoriesList** -> []ActiveDirectoryOutput ActivedirectoriesList(ctx, contentType, accept, optional) -List Active Directories - -This endpoint allows you to list all your Active Directory Instances. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/activedirectories/ \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **fields** | [**[]string**](string.md)| The comma separated fields included in the returned records. If omitted, the default list of fields will be returned. | - **filter** | [**[]string**](string.md)| Supported operators are: eq, ne, gt, ge, lt, le, between, search, in | - **limit** | **int32**| The number of records to return at once. Limited to 100. | [default to 10] - **skip** | **int32**| The offset into the records to return. | [default to 0] - **sort** | [**[]string**](string.md)| The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. | - **xOrgId** | **string**| | [default to ] - -### Return type - -[**[]ActiveDirectoryOutput**](active-directory-output.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **ActivedirectoriesPost** -> ActiveDirectoryOutput ActivedirectoriesPost(ctx, contentType, accept, optional) -Create a new Active Directory - -This endpoint allows you to create a new Active Directory. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/activedirectories/ \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"domain\": \"{DC=AD_domain_name;DC=com}\" } ' ``` - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **body** | [**ActiveDirectoryInput**](ActiveDirectoryInput.md)| | - **xOrgId** | **string**| | [default to ] - -### Return type - -[**ActiveDirectoryOutput**](active-directory-output.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **GraphActiveDirectoryAssociationsList** -> []GraphConnection GraphActiveDirectoryAssociationsList(ctx, activedirectoryId, targets, contentType, accept, optional) -List the associations of an Active Directory instance - -This endpoint returns the direct associations of this Active Directory instance. A direct association can be a non-homogeneous relationship between 2 different objects, for example Active Directory and Users. #### Sample Request ``` curl -X GET 'https://console.jumpcloud.com/api/v2/activedirectories/{ActiveDirectory_ID}/associations?targets=user \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **activedirectoryId** | **string**| | - **targets** | [**[]string**](string.md)| | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **activedirectoryId** | **string**| | - **targets** | [**[]string**](string.md)| | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **limit** | **int32**| The number of records to return at once. Limited to 100. | [default to 10] - **skip** | **int32**| The offset into the records to return. | [default to 0] - **xOrgId** | **string**| | [default to ] - -### Return type - -[**[]GraphConnection**](GraphConnection.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **GraphActiveDirectoryAssociationsPost** -> GraphActiveDirectoryAssociationsPost(ctx, activedirectoryId, contentType, accept, optional) -Manage the associations of an Active Directory instance - -This endpoint allows you to manage the _direct_ associations of an Active Directory instance. A direct association can be a non-homogeneous relationship between 2 different objects, for example Active Directory and Users. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/activedirectories/{AD_Instance_ID}/associations \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"op\": \"add\", \"type\": \"user\", \"id\": \"{User_ID}\" } ' ``` - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **activedirectoryId** | **string**| | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **activedirectoryId** | **string**| | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **body** | [**GraphManagementReq**](GraphManagementReq.md)| | - **xOrgId** | **string**| | [default to ] - -### Return type - - (empty response body) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **GraphActiveDirectoryTraverseUserGroup** -> []GraphObjectWithPaths GraphActiveDirectoryTraverseUserGroup(ctx, activedirectoryId, contentType, accept, optional) -List the User Groups bound to an Active Directory instance - -This endpoint will return all Users Groups bound to an Active Directory instance, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the group's type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this Active Directory instance to the corresponding User Group; this array represents all grouping and/or associations that would have to be removed to deprovision the User Group from this Active Directory instance. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/activedirectories/{ActiveDirectory_ID}/usergroups \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **activedirectoryId** | **string**| ObjectID of the Active Directory instance. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **activedirectoryId** | **string**| ObjectID of the Active Directory instance. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **limit** | **int32**| The number of records to return at once. Limited to 100. | [default to 10] - **xOrgId** | **string**| | [default to ] - **skip** | **int32**| The offset into the records to return. | [default to 0] - **filter** | [**[]string**](string.md)| Supported operators are: eq, ne, gt, ge, lt, le, between, search, in | - -### Return type - -[**[]GraphObjectWithPaths**](GraphObjectWithPaths.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - diff --git a/v2/docs/Administrator.md b/v2/docs/Administrator.md deleted file mode 100644 index f45bfbd..0000000 --- a/v2/docs/Administrator.md +++ /dev/null @@ -1,15 +0,0 @@ -# Administrator - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Email** | **string** | | [optional] [default to null] -**EnableMultiFactor** | **bool** | | [optional] [default to null] -**Firstname** | **string** | | [optional] [default to null] -**Id** | **string** | | [optional] [default to null] -**Lastname** | **string** | | [optional] [default to null] -**Registered** | **bool** | | [optional] [default to null] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/v2/docs/AppleMDMApi.md b/v2/docs/AppleMDMApi.md deleted file mode 100644 index 71dda15..0000000 --- a/v2/docs/AppleMDMApi.md +++ /dev/null @@ -1,260 +0,0 @@ -# \AppleMDMApi - -All URIs are relative to *https://console.jumpcloud.com/api/v2* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**ApplemdmsDelete**](AppleMDMApi.md#ApplemdmsDelete) | **Delete** /applemdms/{apple_mdm_id} | Delete an Apple MDM -[**ApplemdmsList**](AppleMDMApi.md#ApplemdmsList) | **Get** /applemdms | List Apple MDMs -[**ApplemdmsPost**](AppleMDMApi.md#ApplemdmsPost) | **Post** /applemdms | Create Apple MDM -[**ApplemdmsPut**](AppleMDMApi.md#ApplemdmsPut) | **Put** /applemdms/{apple_mdm_id} | Update an Apple MDM -[**EnrollmentprofilesGet**](AppleMDMApi.md#EnrollmentprofilesGet) | **Get** /applemdms/{apple_mdm_id}/enrollmentprofiles/{enrollment_profile_id} | Get an Apple MDM Enrollment Profile -[**EnrollmentprofilesList**](AppleMDMApi.md#EnrollmentprofilesList) | **Get** /applemdms/{apple_mdm_id}/enrollmentprofiles | List Apple MDM Enrollment Profiles - - -# **ApplemdmsDelete** -> AppleMdm ApplemdmsDelete(ctx, appleMdmId, contentType, accept, optional) -Delete an Apple MDM - -Removes an Apple MDM configuration. Warning: This is a destructive operation and will remove your Apple Push Certificates. We will no longer be able to manage your devices and the only recovery option is to re-register all devices into MDM. #### Sample Request ``` curl -X DELETE https://console.jumpcloud.com/api/v2/applemdms/{id} \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **appleMdmId** | **string**| | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **appleMdmId** | **string**| | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **xOrgId** | **string**| | [default to ] - -### Return type - -[**AppleMdm**](AppleMDM.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **ApplemdmsList** -> []AppleMdm ApplemdmsList(ctx, contentType, accept, optional) -List Apple MDMs - -Get a list of all Apple MDM configurations. An empty topic indicates that a signed certificate from Apple has not been provided to the PUT endpoint yet. Note: currently only one MDM configuration per organization is supported. #### Sample Request ``` curl https://console.jumpcloud.com/api/v2/applemdms \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **xOrgId** | **string**| | [default to ] - -### Return type - -[**[]AppleMdm**](AppleMDM.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **ApplemdmsPost** -> InlineResponse201 ApplemdmsPost(ctx, contentType, accept, optional) -Create Apple MDM - -Creates an Apple MDM Enrollment for an organization. Only one enrollment per organization will be allowed. Note that this is the first step in completly setting up an MDM Enrollment. The user must supply the returned plist to Apple for signing, and then provide the certificate provided by Apple back into the PUT API. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/organizations/{Organization_ID}/mdm \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{}' ``` - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **body** | [**Body**](Body.md)| | - **xOrgId** | **string**| | [default to ] - -### Return type - -[**InlineResponse201**](inline_response_201.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **ApplemdmsPut** -> AppleMdm ApplemdmsPut(ctx, appleMdmId, contentType, accept, optional) -Update an Apple MDM - -Updates an Apple MDM configuration. This endpoint is used to supply JumpCloud with a signed certificate from Apple in order to finalize the setup and allow JumpCloud to manage your devices. #### Sample Request ``` curl -X PUT https://console.jumpcloud.com/api/v2/applemdms/{ID} \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"name\": \"MDM name\", \"appleSignedCert\": \"{CERTIFICATE}\" }' ``` - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **appleMdmId** | **string**| | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **appleMdmId** | **string**| | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **body** | [**AppleMdmPatchInput**](AppleMdmPatchInput.md)| | - **xOrgId** | **string**| | [default to ] - -### Return type - -[**AppleMdm**](AppleMDM.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **EnrollmentprofilesGet** -> Mobileconfig EnrollmentprofilesGet(ctx, appleMdmId, enrollmentProfileId, contentType, accept, optional) -Get an Apple MDM Enrollment Profile - -Get an enrollment profile Currently only requesting the mobileconfig is supported. #### Sample Request ``` curl https://console.jumpcloud.com/api/v2/applemdms/{APPLE_MDM_ID}/enrollmentprofiles/{ENROLLMENT_PROFILE_ID} \\ -H 'accept: application/x-apple-aspen-config' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **appleMdmId** | **string**| | - **enrollmentProfileId** | **string**| | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **appleMdmId** | **string**| | - **enrollmentProfileId** | **string**| | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **xOrgId** | **string**| | [default to ] - -### Return type - -[**Mobileconfig**](mobileconfig.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/x-apple-aspen-config - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **EnrollmentprofilesList** -> []AppleMdm EnrollmentprofilesList(ctx, appleMdmId, contentType, accept, optional) -List Apple MDM Enrollment Profiles - -Get a list of enrollment profiles for an apple mdm. Note: currently only one enrollment profile is supported. #### Sample Request ``` curl https://console.jumpcloud.com/api/v2/applemdms/{APPLE_MDM_ID}/enrollmentprofiles \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **appleMdmId** | **string**| | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **appleMdmId** | **string**| | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **xOrgId** | **string**| | [default to ] - -### Return type - -[**[]AppleMdm**](AppleMDM.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - diff --git a/v2/docs/AppleMdm.md b/v2/docs/AppleMdm.md deleted file mode 100644 index 0e76650..0000000 --- a/v2/docs/AppleMdm.md +++ /dev/null @@ -1,12 +0,0 @@ -# AppleMdm - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**ApnsPushTopic** | **string** | The push topic assigned to this enrollment by Apple after uploading the Signed CSR plist. | [optional] [default to null] -**Id** | **string** | ObjectId uniquely identifying an MDM Enrollment, | [default to null] -**Name** | **string** | A friendly name to identify this enrollment. Not required to be unique. | [optional] [default to null] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/v2/docs/AppleMdmPatchInput.md b/v2/docs/AppleMdmPatchInput.md deleted file mode 100644 index 37d4dc9..0000000 --- a/v2/docs/AppleMdmPatchInput.md +++ /dev/null @@ -1,11 +0,0 @@ -# AppleMdmPatchInput - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**AppleSignedCert** | **string** | A signed certificate obtained from Apple after providing Apple with the plist file provided on POST. | [optional] [default to null] -**Name** | **string** | A new name for the Apple MDM configuration. | [optional] [default to null] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/v2/docs/ApplicationsApi.md b/v2/docs/ApplicationsApi.md deleted file mode 100644 index 60388f3..0000000 --- a/v2/docs/ApplicationsApi.md +++ /dev/null @@ -1,187 +0,0 @@ -# \ApplicationsApi - -All URIs are relative to *https://console.jumpcloud.com/api/v2* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**GraphApplicationAssociationsList**](ApplicationsApi.md#GraphApplicationAssociationsList) | **Get** /applications/{application_id}/associations | List the associations of an Application -[**GraphApplicationAssociationsPost**](ApplicationsApi.md#GraphApplicationAssociationsPost) | **Post** /applications/{application_id}/associations | Manage the associations of an Application -[**GraphApplicationTraverseUser**](ApplicationsApi.md#GraphApplicationTraverseUser) | **Get** /applications/{application_id}/users | List the Users bound to an Application -[**GraphApplicationTraverseUserGroup**](ApplicationsApi.md#GraphApplicationTraverseUserGroup) | **Get** /applications/{application_id}/usergroups | List the User Groups bound to an Application - - -# **GraphApplicationAssociationsList** -> []GraphConnection GraphApplicationAssociationsList(ctx, applicationId, targets, contentType, accept, optional) -List the associations of an Application - -This endpoint will return the _direct_ associations of an Application. A direct association can be a non-homogeneous relationship between 2 different objects, for example Applications and User Groups. #### Sample Request ``` curl -X GET 'https://console.jumpcloud.com/api/v2/applications/{Application_ID}/associations?targets=user_group \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **applicationId** | **string**| ObjectID of the Application. | - **targets** | [**[]string**](string.md)| | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **applicationId** | **string**| ObjectID of the Application. | - **targets** | [**[]string**](string.md)| | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **limit** | **int32**| The number of records to return at once. Limited to 100. | [default to 10] - **skip** | **int32**| The offset into the records to return. | [default to 0] - **xOrgId** | **string**| | [default to ] - -### Return type - -[**[]GraphConnection**](GraphConnection.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **GraphApplicationAssociationsPost** -> GraphApplicationAssociationsPost(ctx, applicationId, contentType, accept, optional) -Manage the associations of an Application - -This endpoint allows you to manage the _direct_ associations of an Application. A direct association can be a non-homogeneous relationship between 2 different objects, for example Application and User Groups. #### Sample Request ``` curl -X POST 'https://console.jumpcloud.com/api/v2/applications/{Application_ID}/associations' \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"op\": \"add\", \"type\": \"user_group\", \"id\": \"{Group_ID}\" }' ``` - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **applicationId** | **string**| ObjectID of the Application. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **applicationId** | **string**| ObjectID of the Application. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **body** | [**GraphManagementReq**](GraphManagementReq.md)| | - **xOrgId** | **string**| | [default to ] - -### Return type - - (empty response body) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **GraphApplicationTraverseUser** -> []GraphObjectWithPaths GraphApplicationTraverseUser(ctx, applicationId, contentType, accept, optional) -List the Users bound to an Application - -This endpoint will return all Users bound to an Application, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this Application to the corresponding User; this array represents all grouping and/or associations that would have to be removed to deprovision the User from this Application. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/applications/{Application_ID}/users \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **applicationId** | **string**| ObjectID of the Application. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **applicationId** | **string**| ObjectID of the Application. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **limit** | **int32**| The number of records to return at once. Limited to 100. | [default to 10] - **xOrgId** | **string**| | [default to ] - **skip** | **int32**| The offset into the records to return. | [default to 0] - **filter** | [**[]string**](string.md)| Supported operators are: eq, ne, gt, ge, lt, le, between, search, in | - -### Return type - -[**[]GraphObjectWithPaths**](GraphObjectWithPaths.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **GraphApplicationTraverseUserGroup** -> []GraphObjectWithPaths GraphApplicationTraverseUserGroup(ctx, applicationId, contentType, accept, optional) -List the User Groups bound to an Application - -This endpoint will return all Users Groups bound to an Application, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the group's type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this Application to the corresponding User Group; this array represents all grouping and/or associations that would have to be removed to deprovision the User Group from this Application. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/applications/{Application_ID}/usergroups \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **applicationId** | **string**| ObjectID of the Application. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **applicationId** | **string**| ObjectID of the Application. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **limit** | **int32**| The number of records to return at once. Limited to 100. | [default to 10] - **xOrgId** | **string**| | [default to ] - **skip** | **int32**| The offset into the records to return. | [default to 0] - **filter** | [**[]string**](string.md)| Supported operators are: eq, ne, gt, ge, lt, le, between, search, in | - -### Return type - -[**[]GraphObjectWithPaths**](GraphObjectWithPaths.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - diff --git a/v2/docs/Body.md b/v2/docs/Body.md deleted file mode 100644 index 61b403f..0000000 --- a/v2/docs/Body.md +++ /dev/null @@ -1,10 +0,0 @@ -# Body - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Name** | **string** | The name used to identify this AppleMDM. | [optional] [default to null] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/v2/docs/Body1.md b/v2/docs/Body1.md deleted file mode 100644 index 91d4e81..0000000 --- a/v2/docs/Body1.md +++ /dev/null @@ -1,12 +0,0 @@ -# Body1 - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Groups** | **[]string** | | [optional] [default to null] -**Name** | **string** | | [optional] [default to null] -**Users** | **[]string** | | [optional] [default to null] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/v2/docs/Body2.md b/v2/docs/Body2.md deleted file mode 100644 index e752fd1..0000000 --- a/v2/docs/Body2.md +++ /dev/null @@ -1,12 +0,0 @@ -# Body2 - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Groups** | **[]string** | | [optional] [default to null] -**Name** | **string** | | [optional] [default to null] -**Users** | **[]string** | | [optional] [default to null] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/v2/docs/Body3.md b/v2/docs/Body3.md deleted file mode 100644 index a6904cb..0000000 --- a/v2/docs/Body3.md +++ /dev/null @@ -1,12 +0,0 @@ -# Body3 - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Id** | **string** | | [optional] [default to null] -**UserLockoutAction** | [***LdapServerAction**](LdapServerAction.md) | | [optional] [default to null] -**UserPasswordExpirationAction** | [***LdapServerAction**](LdapServerAction.md) | | [optional] [default to null] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/v2/docs/BulkJobRequestsApi.md b/v2/docs/BulkJobRequestsApi.md deleted file mode 100644 index f045c13..0000000 --- a/v2/docs/BulkJobRequestsApi.md +++ /dev/null @@ -1,220 +0,0 @@ -# \BulkJobRequestsApi - -All URIs are relative to *https://console.jumpcloud.com/api/v2* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**BulkUsersCreate**](BulkJobRequestsApi.md#BulkUsersCreate) | **Post** /bulk/users | Bulk Users Create -[**BulkUsersCreateResults**](BulkJobRequestsApi.md#BulkUsersCreateResults) | **Get** /bulk/users/{job_id}/results | List Bulk Users Results -[**BulkUsersUpdate**](BulkJobRequestsApi.md#BulkUsersUpdate) | **Patch** /bulk/users | Bulk Users Update -[**JobsGet**](BulkJobRequestsApi.md#JobsGet) | **Get** /jobs/{id} | Get Job (incomplete) -[**JobsResults**](BulkJobRequestsApi.md#JobsResults) | **Get** /jobs/{id}/results | List Job Results - - -# **BulkUsersCreate** -> JobId BulkUsersCreate(ctx, contentType, accept, optional) -Bulk Users Create - -The endpoint allows you to create a bulk job to asynchronously create users. See [Create a System User](https://docs.jumpcloud.com/1.0/systemusers/create-a-system-user) for full list of attributes. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/bulk/users \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '[ { \"email\":\"{email}\", \"firstname\":\"{firstname}\", \"lastname\":\"{firstname}\", \"username\":\"{username}\", \"attributes\":[ {\"name\":\"EmployeeID\",\"value\":\"0000\"}, {\"name\":\"Custom\",\"value\":\"attribute\"} ] } ] ``` - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **body** | [**[]BulkUserCreate**](bulk-user-create.md)| | - **xOrgId** | **string**| | [default to ] - -### Return type - -[**JobId**](job-id.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **BulkUsersCreateResults** -> []JobWorkresult BulkUsersCreateResults(ctx, jobId, contentType, accept, optional) -List Bulk Users Results - -This endpoint will return the results of particular user import or update job request. #### Sample Request ``` curl -X GET \\ https://console.jumpcloud.com/api/v2/bulk/users/{ImportJobID}/results \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **jobId** | **string**| | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **jobId** | **string**| | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **limit** | **int32**| The number of records to return at once. Limited to 100. | [default to 10] - **skip** | **int32**| The offset into the records to return. | [default to 0] - **xOrgId** | **string**| | [default to ] - -### Return type - -[**[]JobWorkresult**](job-workresult.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **BulkUsersUpdate** -> JobId BulkUsersUpdate(ctx, contentType, accept, optional) -Bulk Users Update - -The endpoint allows you to create a bulk job to asynchronously update users. See [Update a System User](https://docs.jumpcloud.com/1.0/systemusers/update-a-system-user) for full list of attributes. #### Sample Request ``` curl -X PATCH https://console.jumpcloud.com/api/v2/bulk/users \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '[ { \"id\":\"5be9fb4ddb01290001e85109\", \"firstname\":\"{UPDATED_FIRSTNAME}\", \"department\":\"{UPDATED_DEPARTMENT}\", \"attributes\":[ {\"name\":\"Custom\",\"value\":\"{ATTRIBUTE_VALUE}\"} ] }, { \"id\":\"5be9fb4ddb01290001e85109\", \"firstname\":\"{UPDATED_FIRSTNAME}\", \"costCenter\":\"{UPDATED_COST_CENTER}\", \"phoneNumbers\":[ {\"type\":\"home\",\"number\":\"{HOME_PHONE_NUMBER}\"}, {\"type\":\"work\",\"number\":\"{WORK_PHONE_NUMBER}\"} ] } ] ``` - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **body** | [**[]BulkUserUpdate**](bulk-user-update.md)| | - **xOrgId** | **string**| | [default to ] - -### Return type - -[**JobId**](job-id.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **JobsGet** -> JobDetails JobsGet(ctx, id, contentType, accept, optional) -Get Job (incomplete) - -**This endpoint is not complete and should remain hidden as it's not functional yet.** - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **id** | **string**| | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **id** | **string**| | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **xOrgId** | **string**| | [default to ] - -### Return type - -[**JobDetails**](job-details.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **JobsResults** -> []JobWorkresult JobsResults(ctx, id, contentType, accept, optional) -List Job Results - -This endpoint will return the results of particular import job request. #### Sample Request ``` curl -X GET \\ https://console.jumpcloud.com/api/v2/jobs/{ImportJobID}/results \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **id** | **string**| | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **id** | **string**| | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **limit** | **int32**| The number of records to return at once. Limited to 100. | [default to 10] - **skip** | **int32**| The offset into the records to return. | [default to 0] - **xOrgId** | **string**| | [default to ] - -### Return type - -[**[]JobWorkresult**](job-workresult.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - diff --git a/v2/docs/CommandsApi.md b/v2/docs/CommandsApi.md deleted file mode 100644 index d86caac..0000000 --- a/v2/docs/CommandsApi.md +++ /dev/null @@ -1,187 +0,0 @@ -# \CommandsApi - -All URIs are relative to *https://console.jumpcloud.com/api/v2* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**GraphCommandAssociationsList**](CommandsApi.md#GraphCommandAssociationsList) | **Get** /commands/{command_id}/associations | List the associations of a Command -[**GraphCommandAssociationsPost**](CommandsApi.md#GraphCommandAssociationsPost) | **Post** /commands/{command_id}/associations | Manage the associations of a Command -[**GraphCommandTraverseSystem**](CommandsApi.md#GraphCommandTraverseSystem) | **Get** /commands/{command_id}/systems | List the Systems bound to a Command -[**GraphCommandTraverseSystemGroup**](CommandsApi.md#GraphCommandTraverseSystemGroup) | **Get** /commands/{command_id}/systemgroups | List the System Groups bound to a Command - - -# **GraphCommandAssociationsList** -> []GraphConnection GraphCommandAssociationsList(ctx, commandId, targets, contentType, accept, optional) -List the associations of a Command - -This endpoint will return the _direct_ associations of this Command. A direct association can be a non-homogeneous relationship between 2 different objects, for example Commands and User Groups. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/commands/{Command_ID}/associations?targets=system_group \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **commandId** | **string**| ObjectID of the Command. | - **targets** | [**[]string**](string.md)| | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **commandId** | **string**| ObjectID of the Command. | - **targets** | [**[]string**](string.md)| | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **limit** | **int32**| The number of records to return at once. Limited to 100. | [default to 10] - **skip** | **int32**| The offset into the records to return. | [default to 0] - **xOrgId** | **string**| | [default to ] - -### Return type - -[**[]GraphConnection**](GraphConnection.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **GraphCommandAssociationsPost** -> GraphCommandAssociationsPost(ctx, commandId, contentType, accept, optional) -Manage the associations of a Command - -This endpoint will allow you to manage the _direct_ associations of this Command. A direct association can be a non-homogeneous relationship between 2 different objects, for example Commands and User Groups. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/commands/{Command_ID}/associations \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"op\": \"add\", \"type\": \"system_group\", \"id\": \"Group_ID\" }' ``` - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **commandId** | **string**| ObjectID of the Command. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **commandId** | **string**| ObjectID of the Command. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **body** | [**GraphManagementReq**](GraphManagementReq.md)| | - **xOrgId** | **string**| | [default to ] - -### Return type - - (empty response body) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **GraphCommandTraverseSystem** -> []GraphObjectWithPaths GraphCommandTraverseSystem(ctx, commandId, contentType, accept, optional) -List the Systems bound to a Command - -This endpoint will return all Systems bound to a Command, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this Command to the corresponding System; this array represents all grouping and/or associations that would have to be removed to deprovision the System from this Command. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/commands/{Command_ID}/systems \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **commandId** | **string**| ObjectID of the Command. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **commandId** | **string**| ObjectID of the Command. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **limit** | **int32**| The number of records to return at once. Limited to 100. | [default to 10] - **xOrgId** | **string**| | [default to ] - **skip** | **int32**| The offset into the records to return. | [default to 0] - **filter** | [**[]string**](string.md)| Supported operators are: eq, ne, gt, ge, lt, le, between, search, in | - -### Return type - -[**[]GraphObjectWithPaths**](GraphObjectWithPaths.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **GraphCommandTraverseSystemGroup** -> []GraphObjectWithPaths GraphCommandTraverseSystemGroup(ctx, commandId, contentType, accept, optional) -List the System Groups bound to a Command - -This endpoint will return all System Groups bound to a Command, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the group's type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this Command to the corresponding System Group; this array represents all grouping and/or associations that would have to be removed to deprovision the System Group from this Command. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/commands/{Command_ID}/systemgroups \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **commandId** | **string**| ObjectID of the Command. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **commandId** | **string**| ObjectID of the Command. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **limit** | **int32**| The number of records to return at once. Limited to 100. | [default to 10] - **xOrgId** | **string**| | [default to ] - **skip** | **int32**| The offset into the records to return. | [default to 0] - **filter** | [**[]string**](string.md)| Supported operators are: eq, ne, gt, ge, lt, le, between, search, in | - -### Return type - -[**[]GraphObjectWithPaths**](GraphObjectWithPaths.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - diff --git a/v2/docs/DefaultApi.md b/v2/docs/DefaultApi.md deleted file mode 100644 index a60ea6b..0000000 --- a/v2/docs/DefaultApi.md +++ /dev/null @@ -1,176 +0,0 @@ -# \DefaultApi - -All URIs are relative to *https://console.jumpcloud.com/api/v2* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**JcEnrollmentProfilesDelete**](DefaultApi.md#JcEnrollmentProfilesDelete) | **Delete** /enrollmentprofiles/{enrollment_profile_id} | Delete Enrollment Profile -[**JcEnrollmentProfilesGet**](DefaultApi.md#JcEnrollmentProfilesGet) | **Get** /enrollmentprofiles/{enrollment_profile_id} | Get Enrollment Profile -[**JcEnrollmentProfilesList**](DefaultApi.md#JcEnrollmentProfilesList) | **Get** /enrollmentprofiles | List Enrollment Profiles -[**JcEnrollmentProfilesPost**](DefaultApi.md#JcEnrollmentProfilesPost) | **Post** /enrollmentprofiles | Create new Enrollment Profile -[**JcEnrollmentProfilesPut**](DefaultApi.md#JcEnrollmentProfilesPut) | **Put** /enrollmentprofiles/{enrollment_profile_id} | Update Enrollment Profile - - -# **JcEnrollmentProfilesDelete** -> JcEnrollmentProfile JcEnrollmentProfilesDelete(ctx, enrollmentProfileId) -Delete Enrollment Profile - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **enrollmentProfileId** | **string**| | - -### Return type - -[**JcEnrollmentProfile**](jc-enrollment-profile.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **JcEnrollmentProfilesGet** -> JcEnrollmentProfilesGet(ctx, enrollmentProfileId, optional) -Get Enrollment Profile - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **enrollmentProfileId** | **string**| | - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **enrollmentProfileId** | **string**| | - **body** | [**JcEnrollmentProfile**](JcEnrollmentProfile.md)| | - -### Return type - - (empty response body) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **JcEnrollmentProfilesList** -> []JcEnrollmentProfile JcEnrollmentProfilesList(ctx, optional) -List Enrollment Profiles - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **limit** | **int32**| | [default to 10] - **skip** | **int32**| The offset into the records to return. | [default to 0] - -### Return type - -[**[]JcEnrollmentProfile**](jc-enrollment-profile.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **JcEnrollmentProfilesPost** -> JcEnrollmentProfile JcEnrollmentProfilesPost(ctx, optional) -Create new Enrollment Profile - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**Body1**](Body1.md)| | - -### Return type - -[**JcEnrollmentProfile**](jc-enrollment-profile.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **JcEnrollmentProfilesPut** -> JcEnrollmentProfile JcEnrollmentProfilesPut(ctx, enrollmentProfileId, optional) -Update Enrollment Profile - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **enrollmentProfileId** | **string**| | - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **enrollmentProfileId** | **string**| | - **body** | [**Body2**](Body2.md)| | - -### Return type - -[**JcEnrollmentProfile**](jc-enrollment-profile.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - diff --git a/v2/docs/DirectoriesApi.md b/v2/docs/DirectoriesApi.md deleted file mode 100644 index 9eed4cf..0000000 --- a/v2/docs/DirectoriesApi.md +++ /dev/null @@ -1,52 +0,0 @@ -# \DirectoriesApi - -All URIs are relative to *https://console.jumpcloud.com/api/v2* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**DirectoriesList**](DirectoriesApi.md#DirectoriesList) | **Get** /directories | List All Directories - - -# **DirectoriesList** -> []Directory DirectoriesList(ctx, contentType, accept, optional) -List All Directories - -This endpoint returns all active directories (LDAP, O365 Suite, G-Suite). #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/directories \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **fields** | [**[]string**](string.md)| The comma separated fields included in the returned records. If omitted, the default list of fields will be returned. | - **limit** | **int32**| The number of records to return at once. Limited to 100. | [default to 10] - **sort** | [**[]string**](string.md)| The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. | - **skip** | **int32**| The offset into the records to return. | [default to 0] - **xOrgId** | **string**| | [default to ] - -### Return type - -[**[]Directory**](Directory.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - diff --git a/v2/docs/DuoApi.md b/v2/docs/DuoApi.md deleted file mode 100644 index 23e685d..0000000 --- a/v2/docs/DuoApi.md +++ /dev/null @@ -1,390 +0,0 @@ -# \DuoApi - -All URIs are relative to *https://console.jumpcloud.com/api/v2* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**DuoAccountDelete**](DuoApi.md#DuoAccountDelete) | **Delete** /duo/accounts/{id} | Delete a Duo Account -[**DuoAccountGet**](DuoApi.md#DuoAccountGet) | **Get** /duo/accounts/{id} | Get a Duo Acount -[**DuoAccountList**](DuoApi.md#DuoAccountList) | **Get** /duo/accounts | List Duo Acounts -[**DuoAccountPost**](DuoApi.md#DuoAccountPost) | **Post** /duo/accounts | Create Duo Account -[**DuoApplicationDelete**](DuoApi.md#DuoApplicationDelete) | **Delete** /duo/accounts/{account_id}/applications/{application_id} | Delete a Duo Application -[**DuoApplicationGet**](DuoApi.md#DuoApplicationGet) | **Get** /duo/accounts/{account_id}/applications/{application_id} | Get a Duo application -[**DuoApplicationList**](DuoApi.md#DuoApplicationList) | **Get** /duo/accounts/{account_id}/applications | List Duo Applications -[**DuoApplicationPost**](DuoApi.md#DuoApplicationPost) | **Post** /duo/accounts/{account_id}/applications | Create Duo Application -[**DuoApplicationUpdate**](DuoApi.md#DuoApplicationUpdate) | **Put** /duo/accounts/{account_id}/applications/{application_id} | Update Duo Application - - -# **DuoAccountDelete** -> DuoAccount DuoAccountDelete(ctx, id, contentType, accept, optional) -Delete a Duo Account - -Removes the specified Duo account, an error will be returned if the account has some Duo application used in a protected resource. #### Sample Request ``` curl -X DELETE https://console.jumpcloud.com/api/v2/duo/accounts/{id} \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **id** | **string**| ObjectID of the Duo Account | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **id** | **string**| ObjectID of the Duo Account | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **xOrgId** | **string**| | [default to ] - -### Return type - -[**DuoAccount**](DuoAccount.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **DuoAccountGet** -> DuoAccount DuoAccountGet(ctx, id, contentType, accept, optional) -Get a Duo Acount - -This endpoint returns a specific Duo account. #### Sample Request ``` curl https://console.jumpcloud.com/api/v2/duo/accounts/{id} \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **id** | **string**| ObjectID of the Duo Account | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **id** | **string**| ObjectID of the Duo Account | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **xOrgId** | **string**| | [default to ] - -### Return type - -[**DuoAccount**](DuoAccount.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **DuoAccountList** -> []DuoAccount DuoAccountList(ctx, contentType, accept, optional) -List Duo Acounts - -This endpoint returns all the Duo accounts for your organization. Note: There can currently only be one Duo account for your organization. #### Sample Request ``` curl https://console.jumpcloud.com/api/v2/duo/accounts \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **xOrgId** | **string**| | [default to ] - -### Return type - -[**[]DuoAccount**](DuoAccount.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **DuoAccountPost** -> DuoAccount DuoAccountPost(ctx, contentType, accept, optional) -Create Duo Account - -Registers a Duo account for an organization. Only one Duo account will be allowed, in case an organization has a Duo account already a 409 (Conflict) code will be returned. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/duo/accounts \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{}' ``` - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **xOrgId** | **string**| | [default to ] - -### Return type - -[**DuoAccount**](DuoAccount.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **DuoApplicationDelete** -> DuoApplication DuoApplicationDelete(ctx, accountId, applicationId, contentType, accept, optional) -Delete a Duo Application - -Deletes the specified Duo application, an error will be returned if the application is used in a protected resource. #### Sample Request ``` curl -X DELETE https://console.jumpcloud.com/api/v2/duo/accounts/{ACCOUNT_ID}/applications/{APPLICATION_ID} \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}'' ``` - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **accountId** | **string**| | - **applicationId** | **string**| | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **accountId** | **string**| | - **applicationId** | **string**| | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **xOrgId** | **string**| | [default to ] - -### Return type - -[**DuoApplication**](DuoApplication.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **DuoApplicationGet** -> DuoApplication DuoApplicationGet(ctx, accountId, applicationId, contentType, accept, optional) -Get a Duo application - -This endpoint returns a specific Duo application that is associated with the specified Duo account. #### Sample Request ``` curl https://console.jumpcloud.com/api/v2/duo/accounts/{ACCOUNT_ID}/applications/{APPLICATION_ID} \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **accountId** | **string**| | - **applicationId** | **string**| | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **accountId** | **string**| | - **applicationId** | **string**| | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **xOrgId** | **string**| | [default to ] - -### Return type - -[**DuoApplication**](DuoApplication.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **DuoApplicationList** -> []DuoApplication DuoApplicationList(ctx, accountId, contentType, accept, optional) -List Duo Applications - -This endpoint returns all the Duo applications for the specified Duo account. Note: There can currently only be one Duo application for your organization. #### Sample Request ``` curl https://console.jumpcloud.com/api/v2/duo/accounts/{ACCOUNT_ID}/applications \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **accountId** | **string**| | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **accountId** | **string**| | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **xOrgId** | **string**| | [default to ] - -### Return type - -[**[]DuoApplication**](DuoApplication.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **DuoApplicationPost** -> DuoApplication DuoApplicationPost(ctx, accountId, contentType, accept, optional) -Create Duo Application - -Creates a Duo application for your organization and the specified account. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/duo/accounts/{ACCOUNT_ID}/applications \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"name\": \"Application Name\", \"apiHost\": \"api-1234.duosecurity.com\", \"integrationKey\": \"1234\", \"secretKey\": \"5678\" }' ``` - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **accountId** | **string**| | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **accountId** | **string**| | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **body** | [**DuoApplicationReq**](DuoApplicationReq.md)| | - **xOrgId** | **string**| | [default to ] - -### Return type - -[**DuoApplication**](DuoApplication.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **DuoApplicationUpdate** -> DuoApplication DuoApplicationUpdate(ctx, accountId, applicationId, contentType, accept, optional) -Update Duo Application - -Updates the specified Duo application. #### Sample Request ``` curl -X PUT https://console.jumpcloud.com/api/v2/duo/accounts/{ACCOUNT_ID}/applications/{APPLICATION_ID} \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"name\": \"Application Name\", \"apiHost\": \"api-1234.duosecurity.com\", \"integrationKey\": \"1234\", \"secretKey\": \"5678\" }' ``` - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **accountId** | **string**| | - **applicationId** | **string**| | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **accountId** | **string**| | - **applicationId** | **string**| | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **body** | [**DuoApplicationUpdateReq**](DuoApplicationUpdateReq.md)| | - **xOrgId** | **string**| | [default to ] - -### Return type - -[**DuoApplication**](DuoApplication.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - diff --git a/v2/docs/DuoApplicationUpdateReq.md b/v2/docs/DuoApplicationUpdateReq.md deleted file mode 100644 index 11fefd5..0000000 --- a/v2/docs/DuoApplicationUpdateReq.md +++ /dev/null @@ -1,13 +0,0 @@ -# DuoApplicationUpdateReq - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**ApiHost** | **string** | | [optional] [default to null] -**IntegrationKey** | **string** | | [optional] [default to null] -**Name** | **string** | | [optional] [default to null] -**SecretKey** | **string** | | [optional] [default to null] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/v2/docs/DuoRegistrationApplication.md b/v2/docs/DuoRegistrationApplication.md deleted file mode 100644 index 234e955..0000000 --- a/v2/docs/DuoRegistrationApplication.md +++ /dev/null @@ -1,12 +0,0 @@ -# DuoRegistrationApplication - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**ApiHost** | **string** | Duo Application host name. | [default to null] -**IntegrationKey** | **string** | Duo Application integration key. | [default to null] -**SecretKey** | **string** | Duo Application secret key. | [default to null] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/v2/docs/DuoRegistrationApplicationReq.md b/v2/docs/DuoRegistrationApplicationReq.md deleted file mode 100644 index c9feae1..0000000 --- a/v2/docs/DuoRegistrationApplicationReq.md +++ /dev/null @@ -1,10 +0,0 @@ -# DuoRegistrationApplicationReq - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**RegistrationApplication** | [***DuoRegistrationApplication**](DuoRegistrationApplication.md) | | [default to null] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/v2/docs/Emailrequest.md b/v2/docs/Emailrequest.md deleted file mode 100644 index 11fb090..0000000 --- a/v2/docs/Emailrequest.md +++ /dev/null @@ -1,10 +0,0 @@ -# Emailrequest - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**EmailType** | **string** | | [optional] [default to null] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/v2/docs/EnrollmentProfile.md b/v2/docs/EnrollmentProfile.md deleted file mode 100644 index 71700ab..0000000 --- a/v2/docs/EnrollmentProfile.md +++ /dev/null @@ -1,11 +0,0 @@ -# EnrollmentProfile - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**AppleMdmId** | **string** | | [optional] [default to null] -**Id** | **string** | | [optional] [default to null] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/v2/docs/Errorresponse.md b/v2/docs/Errorresponse.md deleted file mode 100644 index 0227c32..0000000 --- a/v2/docs/Errorresponse.md +++ /dev/null @@ -1,10 +0,0 @@ -# Errorresponse - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Message** | **string** | | [optional] [default to null] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/v2/docs/FdeApi.md b/v2/docs/FdeApi.md deleted file mode 100644 index ee8f511..0000000 --- a/v2/docs/FdeApi.md +++ /dev/null @@ -1,46 +0,0 @@ -# \FdeApi - -All URIs are relative to *https://console.jumpcloud.com/api/v2* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**SystemsGetFDEKey**](FdeApi.md#SystemsGetFDEKey) | **Get** /systems/{system_id}/fdekey | Get System FDE Key - - -# **SystemsGetFDEKey** -> Systemfdekey SystemsGetFDEKey(ctx, systemId, optional) -Get System FDE Key - -This endpoint will return the current (latest) fde key saved for a system. - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **systemId** | **string**| | - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **systemId** | **string**| | - **xOrgId** | **string**| | [default to ] - -### Return type - -[**Systemfdekey**](systemfdekey.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - diff --git a/v2/docs/GSuiteApi.md b/v2/docs/GSuiteApi.md deleted file mode 100644 index e262988..0000000 --- a/v2/docs/GSuiteApi.md +++ /dev/null @@ -1,420 +0,0 @@ -# \GSuiteApi - -All URIs are relative to *https://console.jumpcloud.com/api/v2* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**GraphGSuiteAssociationsList**](GSuiteApi.md#GraphGSuiteAssociationsList) | **Get** /gsuites/{gsuite_id}/associations | List the associations of a G Suite instance -[**GraphGSuiteAssociationsPost**](GSuiteApi.md#GraphGSuiteAssociationsPost) | **Post** /gsuites/{gsuite_id}/associations | Manage the associations of a G Suite instance -[**GraphGSuiteTraverseUser**](GSuiteApi.md#GraphGSuiteTraverseUser) | **Get** /gsuites/{gsuite_id}/users | List the Users bound to a G Suite instance -[**GraphGSuiteTraverseUserGroup**](GSuiteApi.md#GraphGSuiteTraverseUserGroup) | **Get** /gsuites/{gsuite_id}/usergroups | List the User Groups bound to a G Suite instance -[**GsuitesGet**](GSuiteApi.md#GsuitesGet) | **Get** /gsuites/{id} | Get G Suite -[**GsuitesPatch**](GSuiteApi.md#GsuitesPatch) | **Patch** /gsuites/{id} | Update existing G Suite -[**TranslationRulesGSuiteDelete**](GSuiteApi.md#TranslationRulesGSuiteDelete) | **Delete** /gsuites/{gsuite_id}/translationrules/{id} | Deletes a G Suite translation rule -[**TranslationRulesGSuiteGet**](GSuiteApi.md#TranslationRulesGSuiteGet) | **Get** /gsuites/{gsuite_id}/translationrules/{id} | Gets a specific G Suite translation rule -[**TranslationRulesGSuiteList**](GSuiteApi.md#TranslationRulesGSuiteList) | **Get** /gsuites/{gsuite_id}/translationrules | List all the G Suite Translation Rules -[**TranslationRulesGSuitePost**](GSuiteApi.md#TranslationRulesGSuitePost) | **Post** /gsuites/{gsuite_id}/translationrules | Create a new G Suite Translation Rule - - -# **GraphGSuiteAssociationsList** -> []GraphConnection GraphGSuiteAssociationsList(ctx, gsuiteId, targets, contentType, accept, optional) -List the associations of a G Suite instance - -This endpoint returns the _direct_ associations of this G Suite instance. A direct association can be a non-homogeneous relationship between 2 different objects, for example G Suite and Users. #### Sample Request ``` curl -X GET 'https://console.jumpcloud.com/api/v2/gsuites/{Gsuite_ID}/associations?targets=user_group \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **gsuiteId** | **string**| ObjectID of the G Suite instance. | - **targets** | [**[]string**](string.md)| | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **gsuiteId** | **string**| ObjectID of the G Suite instance. | - **targets** | [**[]string**](string.md)| | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **limit** | **int32**| The number of records to return at once. Limited to 100. | [default to 10] - **skip** | **int32**| The offset into the records to return. | [default to 0] - **xOrgId** | **string**| | [default to ] - -### Return type - -[**[]GraphConnection**](GraphConnection.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **GraphGSuiteAssociationsPost** -> GraphGSuiteAssociationsPost(ctx, gsuiteId, optional) -Manage the associations of a G Suite instance - -This endpoint returns the _direct_ associations of this G Suite instance. A direct association can be a non-homogeneous relationship between 2 different objects, for example G Suite and Users. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/gsuites/{Gsuite_ID}/associations \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"op\": \"add\", \"type\": \"user_group\", \"id\": \"{Group_ID}\" }' ``` - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **gsuiteId** | **string**| ObjectID of the G Suite instance. | - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **gsuiteId** | **string**| ObjectID of the G Suite instance. | - **body** | [**GraphManagementReq**](GraphManagementReq.md)| | - **xOrgId** | **string**| | [default to ] - -### Return type - - (empty response body) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **GraphGSuiteTraverseUser** -> []GraphObjectWithPaths GraphGSuiteTraverseUser(ctx, gsuiteId, contentType, accept, optional) -List the Users bound to a G Suite instance - -This endpoint will return all Users bound to a G Suite instance, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this G Suite instance to the corresponding User; this array represents all grouping and/or associations that would have to be removed to deprovision the User from this G Suite instance. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/gsuites/{Gsuite_ID}/users \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **gsuiteId** | **string**| ObjectID of the G Suite instance. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **gsuiteId** | **string**| ObjectID of the G Suite instance. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **limit** | **int32**| The number of records to return at once. Limited to 100. | [default to 10] - **xOrgId** | **string**| | [default to ] - **skip** | **int32**| The offset into the records to return. | [default to 0] - **filter** | [**[]string**](string.md)| Supported operators are: eq, ne, gt, ge, lt, le, between, search, in | - -### Return type - -[**[]GraphObjectWithPaths**](GraphObjectWithPaths.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **GraphGSuiteTraverseUserGroup** -> []GraphObjectWithPaths GraphGSuiteTraverseUserGroup(ctx, gsuiteId, contentType, accept, optional) -List the User Groups bound to a G Suite instance - -This endpoint will return all User Groups bound to an G Suite instance, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the group's type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this G Suite instance to the corresponding User Group; this array represents all grouping and/or associations that would have to be removed to deprovision the User Group from this G Suite instance. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/gsuites/{GSuite_ID}/usergroups \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **gsuiteId** | **string**| ObjectID of the G Suite instance. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **gsuiteId** | **string**| ObjectID of the G Suite instance. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **limit** | **int32**| The number of records to return at once. Limited to 100. | [default to 10] - **xOrgId** | **string**| | [default to ] - **skip** | **int32**| The offset into the records to return. | [default to 0] - **filter** | [**[]string**](string.md)| Supported operators are: eq, ne, gt, ge, lt, le, between, search, in | - -### Return type - -[**[]GraphObjectWithPaths**](GraphObjectWithPaths.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **GsuitesGet** -> GsuiteOutput GsuitesGet(ctx, id, contentType, accept, optional) -Get G Suite - -This endpoint returns a specific G Suite. ##### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/gsuites/{GSUITE_ID} \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **id** | **string**| Unique identifier of the GSuite. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **id** | **string**| Unique identifier of the GSuite. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **xOrgId** | **string**| | [default to ] - -### Return type - -[**GsuiteOutput**](gsuite-output.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **GsuitesPatch** -> GsuiteOutput GsuitesPatch(ctx, id, contentType, accept, optional) -Update existing G Suite - -This endpoint allows updating some attributes of a G Suite. ##### Sample Request ``` curl -X PATCH https://console.jumpcloud.com/api/v2/gsuites/{GSUITE_ID} \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"userLockoutAction\": \"remove\", \"userPasswordExpirationAction\": \"disable\" }' ``` - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **id** | **string**| Unique identifier of the GSuite. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **id** | **string**| Unique identifier of the GSuite. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **body** | [**GsuitePatchInput**](GsuitePatchInput.md)| | - **xOrgId** | **string**| | [default to ] - -### Return type - -[**GsuiteOutput**](gsuite-output.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **TranslationRulesGSuiteDelete** -> TranslationRulesGSuiteDelete(ctx, gsuiteId, id, contentType, accept) -Deletes a G Suite translation rule - -This endpoint allows you to delete a translation rule for a specific G Suite instance. These rules specify how JumpCloud attributes translate to [G Suite Admin SDK](https://developers.google.com/admin-sdk/directory/) attributes. #### Sample Request ``` curl -X DELETE https://console.jumpcloud.com/api/v2/gsuites/{gsuite_id}/translationrules/{id} \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **gsuiteId** | **string**| | - **id** | **string**| | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - -### Return type - - (empty response body) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **TranslationRulesGSuiteGet** -> GSuiteTranslationRule TranslationRulesGSuiteGet(ctx, gsuiteId, id, contentType, accept) -Gets a specific G Suite translation rule - -This endpoint returns a specific translation rule for a specific G Suite instance. These rules specify how JumpCloud attributes translate to [G Suite Admin SDK](https://developers.google.com/admin-sdk/directory/) attributes. ###### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/gsuites/{gsuite_id}/translationrules/{id} \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **gsuiteId** | **string**| | - **id** | **string**| | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - -### Return type - -[**GSuiteTranslationRule**](GSuiteTranslationRule.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **TranslationRulesGSuiteList** -> []GSuiteTranslationRule TranslationRulesGSuiteList(ctx, gsuiteId, contentType, accept, optional) -List all the G Suite Translation Rules - -This endpoint returns all graph translation rules for a specific G Suite instance. These rules specify how JumpCloud attributes translate to [G Suite Admin SDK](https://developers.google.com/admin-sdk/directory/) attributes. ##### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/gsuites/{gsuite_id}/translationrules \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **gsuiteId** | **string**| | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **gsuiteId** | **string**| | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **fields** | [**[]string**](string.md)| The comma separated fields included in the returned records. If omitted, the default list of fields will be returned. | - **filter** | [**[]string**](string.md)| Supported operators are: eq, ne, gt, ge, lt, le, between, search, in | - **limit** | **int32**| The number of records to return at once. Limited to 100. | [default to 10] - **skip** | **int32**| The offset into the records to return. | [default to 0] - **sort** | [**[]string**](string.md)| The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. | - -### Return type - -[**[]GSuiteTranslationRule**](GSuiteTranslationRule.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **TranslationRulesGSuitePost** -> GSuiteTranslationRule TranslationRulesGSuitePost(ctx, gsuiteId, contentType, accept, optional) -Create a new G Suite Translation Rule - -This endpoint allows you to create a translation rule for a specific G Suite instance. These rules specify how JumpCloud attributes translate to [G Suite Admin SDK](https://developers.google.com/admin-sdk/directory/) attributes. ##### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/gsuites/{gsuite_id}/translationrules \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ {Translation Rule Parameters} }' ``` - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **gsuiteId** | **string**| | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **gsuiteId** | **string**| | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **body** | [**GSuiteTranslationRuleRequest**](GSuiteTranslationRuleRequest.md)| | - -### Return type - -[**GSuiteTranslationRule**](GSuiteTranslationRule.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - diff --git a/v2/docs/GraphApi.md b/v2/docs/GraphApi.md deleted file mode 100644 index fca7143..0000000 --- a/v2/docs/GraphApi.md +++ /dev/null @@ -1,3471 +0,0 @@ -# \GraphApi - -All URIs are relative to *https://console.jumpcloud.com/api/v2* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**GraphActiveDirectoryAssociationsList**](GraphApi.md#GraphActiveDirectoryAssociationsList) | **Get** /activedirectories/{activedirectory_id}/associations | List the associations of an Active Directory instance -[**GraphActiveDirectoryAssociationsPost**](GraphApi.md#GraphActiveDirectoryAssociationsPost) | **Post** /activedirectories/{activedirectory_id}/associations | Manage the associations of an Active Directory instance -[**GraphActiveDirectoryTraverseUser**](GraphApi.md#GraphActiveDirectoryTraverseUser) | **Get** /activedirectories/{activedirectory_id}/users | List the Users bound to an Active Directory instance -[**GraphActiveDirectoryTraverseUserGroup**](GraphApi.md#GraphActiveDirectoryTraverseUserGroup) | **Get** /activedirectories/{activedirectory_id}/usergroups | List the User Groups bound to an Active Directory instance -[**GraphApplicationAssociationsList**](GraphApi.md#GraphApplicationAssociationsList) | **Get** /applications/{application_id}/associations | List the associations of an Application -[**GraphApplicationAssociationsPost**](GraphApi.md#GraphApplicationAssociationsPost) | **Post** /applications/{application_id}/associations | Manage the associations of an Application -[**GraphApplicationTraverseUser**](GraphApi.md#GraphApplicationTraverseUser) | **Get** /applications/{application_id}/users | List the Users bound to an Application -[**GraphApplicationTraverseUserGroup**](GraphApi.md#GraphApplicationTraverseUserGroup) | **Get** /applications/{application_id}/usergroups | List the User Groups bound to an Application -[**GraphCommandAssociationsList**](GraphApi.md#GraphCommandAssociationsList) | **Get** /commands/{command_id}/associations | List the associations of a Command -[**GraphCommandAssociationsPost**](GraphApi.md#GraphCommandAssociationsPost) | **Post** /commands/{command_id}/associations | Manage the associations of a Command -[**GraphCommandTraverseSystem**](GraphApi.md#GraphCommandTraverseSystem) | **Get** /commands/{command_id}/systems | List the Systems bound to a Command -[**GraphCommandTraverseSystemGroup**](GraphApi.md#GraphCommandTraverseSystemGroup) | **Get** /commands/{command_id}/systemgroups | List the System Groups bound to a Command -[**GraphGSuiteAssociationsList**](GraphApi.md#GraphGSuiteAssociationsList) | **Get** /gsuites/{gsuite_id}/associations | List the associations of a G Suite instance -[**GraphGSuiteAssociationsPost**](GraphApi.md#GraphGSuiteAssociationsPost) | **Post** /gsuites/{gsuite_id}/associations | Manage the associations of a G Suite instance -[**GraphGSuiteTraverseUser**](GraphApi.md#GraphGSuiteTraverseUser) | **Get** /gsuites/{gsuite_id}/users | List the Users bound to a G Suite instance -[**GraphGSuiteTraverseUserGroup**](GraphApi.md#GraphGSuiteTraverseUserGroup) | **Get** /gsuites/{gsuite_id}/usergroups | List the User Groups bound to a G Suite instance -[**GraphLdapServerAssociationsList**](GraphApi.md#GraphLdapServerAssociationsList) | **Get** /ldapservers/{ldapserver_id}/associations | List the associations of a LDAP Server -[**GraphLdapServerAssociationsPost**](GraphApi.md#GraphLdapServerAssociationsPost) | **Post** /ldapservers/{ldapserver_id}/associations | Manage the associations of a LDAP Server -[**GraphLdapServerTraverseUser**](GraphApi.md#GraphLdapServerTraverseUser) | **Get** /ldapservers/{ldapserver_id}/users | List the Users bound to a LDAP Server -[**GraphLdapServerTraverseUserGroup**](GraphApi.md#GraphLdapServerTraverseUserGroup) | **Get** /ldapservers/{ldapserver_id}/usergroups | List the User Groups bound to a LDAP Server -[**GraphOffice365AssociationsList**](GraphApi.md#GraphOffice365AssociationsList) | **Get** /office365s/{office365_id}/associations | List the associations of an Office 365 instance -[**GraphOffice365AssociationsPost**](GraphApi.md#GraphOffice365AssociationsPost) | **Post** /office365s/{office365_id}/associations | Manage the associations of an Office 365 instance -[**GraphOffice365TraverseUser**](GraphApi.md#GraphOffice365TraverseUser) | **Get** /office365s/{office365_id}/users | List the Users bound to an Office 365 instance -[**GraphOffice365TraverseUserGroup**](GraphApi.md#GraphOffice365TraverseUserGroup) | **Get** /office365s/{office365_id}/usergroups | List the User Groups bound to an Office 365 instance -[**GraphPolicyAssociationsList**](GraphApi.md#GraphPolicyAssociationsList) | **Get** /policies/{policy_id}/associations | List the associations of a Policy -[**GraphPolicyAssociationsPost**](GraphApi.md#GraphPolicyAssociationsPost) | **Post** /policies/{policy_id}/associations | Manage the associations of a Policy -[**GraphPolicyTraverseSystem**](GraphApi.md#GraphPolicyTraverseSystem) | **Get** /policies/{policy_id}/systems | List the Systems bound to a Policy -[**GraphPolicyTraverseSystemGroup**](GraphApi.md#GraphPolicyTraverseSystemGroup) | **Get** /policies/{policy_id}/systemgroups | List the System Groups bound to a Policy -[**GraphRadiusServerAssociationsList**](GraphApi.md#GraphRadiusServerAssociationsList) | **Get** /radiusservers/{radiusserver_id}/associations | List the associations of a RADIUS Server -[**GraphRadiusServerAssociationsPost**](GraphApi.md#GraphRadiusServerAssociationsPost) | **Post** /radiusservers/{radiusserver_id}/associations | Manage the associations of a RADIUS Server -[**GraphRadiusServerTraverseUser**](GraphApi.md#GraphRadiusServerTraverseUser) | **Get** /radiusservers/{radiusserver_id}/users | List the Users bound to a RADIUS Server -[**GraphRadiusServerTraverseUserGroup**](GraphApi.md#GraphRadiusServerTraverseUserGroup) | **Get** /radiusservers/{radiusserver_id}/usergroups | List the User Groups bound to a RADIUS Server -[**GraphSystemAssociationsList**](GraphApi.md#GraphSystemAssociationsList) | **Get** /systems/{system_id}/associations | List the associations of a System -[**GraphSystemAssociationsPost**](GraphApi.md#GraphSystemAssociationsPost) | **Post** /systems/{system_id}/associations | Manage associations of a System -[**GraphSystemGroupAssociationsList**](GraphApi.md#GraphSystemGroupAssociationsList) | **Get** /systemgroups/{group_id}/associations | List the associations of a System Group -[**GraphSystemGroupAssociationsPost**](GraphApi.md#GraphSystemGroupAssociationsPost) | **Post** /systemgroups/{group_id}/associations | Manage the associations of a System Group -[**GraphSystemGroupMemberOf**](GraphApi.md#GraphSystemGroupMemberOf) | **Get** /systemgroups/{group_id}/memberof | List the System Group's parents -[**GraphSystemGroupMembersList**](GraphApi.md#GraphSystemGroupMembersList) | **Get** /systemgroups/{group_id}/members | List the members of a System Group -[**GraphSystemGroupMembersPost**](GraphApi.md#GraphSystemGroupMembersPost) | **Post** /systemgroups/{group_id}/members | Manage the members of a System Group -[**GraphSystemGroupMembership**](GraphApi.md#GraphSystemGroupMembership) | **Get** /systemgroups/{group_id}/membership | List the System Group's membership -[**GraphSystemGroupTraverseCommand**](GraphApi.md#GraphSystemGroupTraverseCommand) | **Get** /systemgroups/{group_id}/commands | List the Commands bound to a System Group -[**GraphSystemGroupTraversePolicy**](GraphApi.md#GraphSystemGroupTraversePolicy) | **Get** /systemgroups/{group_id}/policies | List the Policies bound to a System Group -[**GraphSystemGroupTraverseUser**](GraphApi.md#GraphSystemGroupTraverseUser) | **Get** /systemgroups/{group_id}/users | List the Users bound to a System Group -[**GraphSystemGroupTraverseUserGroup**](GraphApi.md#GraphSystemGroupTraverseUserGroup) | **Get** /systemgroups/{group_id}/usergroups | List the User Groups bound to a System Group -[**GraphSystemMemberOf**](GraphApi.md#GraphSystemMemberOf) | **Get** /systems/{system_id}/memberof | List the parent Groups of a System -[**GraphSystemTraverseCommand**](GraphApi.md#GraphSystemTraverseCommand) | **Get** /systems/{system_id}/commands | List the Commands bound to a System -[**GraphSystemTraversePolicy**](GraphApi.md#GraphSystemTraversePolicy) | **Get** /systems/{system_id}/policies | List the Policies bound to a System -[**GraphSystemTraverseUser**](GraphApi.md#GraphSystemTraverseUser) | **Get** /systems/{system_id}/users | List the Users bound to a System -[**GraphSystemTraverseUserGroup**](GraphApi.md#GraphSystemTraverseUserGroup) | **Get** /systems/{system_id}/usergroups | List the User Groups bound to a System -[**GraphUserAssociationsList**](GraphApi.md#GraphUserAssociationsList) | **Get** /users/{user_id}/associations | List the associations of a User -[**GraphUserAssociationsPost**](GraphApi.md#GraphUserAssociationsPost) | **Post** /users/{user_id}/associations | Manage the associations of a User -[**GraphUserGroupAssociationsList**](GraphApi.md#GraphUserGroupAssociationsList) | **Get** /usergroups/{group_id}/associations | List the associations of a User Group. -[**GraphUserGroupAssociationsPost**](GraphApi.md#GraphUserGroupAssociationsPost) | **Post** /usergroups/{group_id}/associations | Manage the associations of a User Group -[**GraphUserGroupMemberOf**](GraphApi.md#GraphUserGroupMemberOf) | **Get** /usergroups/{group_id}/memberof | List the User Group's parents -[**GraphUserGroupMembersList**](GraphApi.md#GraphUserGroupMembersList) | **Get** /usergroups/{group_id}/members | List the members of a User Group -[**GraphUserGroupMembersPost**](GraphApi.md#GraphUserGroupMembersPost) | **Post** /usergroups/{group_id}/members | Manage the members of a User Group -[**GraphUserGroupMembership**](GraphApi.md#GraphUserGroupMembership) | **Get** /usergroups/{group_id}/membership | List the User Group's membership -[**GraphUserGroupTraverseActiveDirectory**](GraphApi.md#GraphUserGroupTraverseActiveDirectory) | **Get** /usergroups/{group_id}/activedirectories | List the Active Directories bound to a User Group -[**GraphUserGroupTraverseApplication**](GraphApi.md#GraphUserGroupTraverseApplication) | **Get** /usergroups/{group_id}/applications | List the Applications bound to a User Group -[**GraphUserGroupTraverseDirectory**](GraphApi.md#GraphUserGroupTraverseDirectory) | **Get** /usergroups/{group_id}/directories | List the Directories bound to a User Group -[**GraphUserGroupTraverseGSuite**](GraphApi.md#GraphUserGroupTraverseGSuite) | **Get** /usergroups/{group_id}/gsuites | List the G Suite instances bound to a User Group -[**GraphUserGroupTraverseLdapServer**](GraphApi.md#GraphUserGroupTraverseLdapServer) | **Get** /usergroups/{group_id}/ldapservers | List the LDAP Servers bound to a User Group -[**GraphUserGroupTraverseOffice365**](GraphApi.md#GraphUserGroupTraverseOffice365) | **Get** /usergroups/{group_id}/office365s | List the Office 365 instances bound to a User Group -[**GraphUserGroupTraverseRadiusServer**](GraphApi.md#GraphUserGroupTraverseRadiusServer) | **Get** /usergroups/{group_id}/radiusservers | List the RADIUS Servers bound to a User Group -[**GraphUserGroupTraverseSystem**](GraphApi.md#GraphUserGroupTraverseSystem) | **Get** /usergroups/{group_id}/systems | List the Systems bound to a User Group -[**GraphUserGroupTraverseSystemGroup**](GraphApi.md#GraphUserGroupTraverseSystemGroup) | **Get** /usergroups/{group_id}/systemgroups | List the System Groups bound to User Groups -[**GraphUserMemberOf**](GraphApi.md#GraphUserMemberOf) | **Get** /users/{user_id}/memberof | List the parent Groups of a User -[**GraphUserTraverseActiveDirectory**](GraphApi.md#GraphUserTraverseActiveDirectory) | **Get** /users/{user_id}/activedirectories | List the Active Directory instances bound to a User -[**GraphUserTraverseApplication**](GraphApi.md#GraphUserTraverseApplication) | **Get** /users/{user_id}/applications | List the Applications bound to a User -[**GraphUserTraverseDirectory**](GraphApi.md#GraphUserTraverseDirectory) | **Get** /users/{user_id}/directories | List the Directories bound to a User -[**GraphUserTraverseGSuite**](GraphApi.md#GraphUserTraverseGSuite) | **Get** /users/{user_id}/gsuites | List the G Suite instances bound to a User -[**GraphUserTraverseLdapServer**](GraphApi.md#GraphUserTraverseLdapServer) | **Get** /users/{user_id}/ldapservers | List the LDAP servers bound to a User -[**GraphUserTraverseOffice365**](GraphApi.md#GraphUserTraverseOffice365) | **Get** /users/{user_id}/office365s | List the Office 365 instances bound to a User -[**GraphUserTraverseRadiusServer**](GraphApi.md#GraphUserTraverseRadiusServer) | **Get** /users/{user_id}/radiusservers | List the RADIUS Servers bound to a User -[**GraphUserTraverseSystem**](GraphApi.md#GraphUserTraverseSystem) | **Get** /users/{user_id}/systems | List the Systems bound to a User -[**GraphUserTraverseSystemGroup**](GraphApi.md#GraphUserTraverseSystemGroup) | **Get** /users/{user_id}/systemgroups | List the System Groups bound to a User -[**PolicystatusesList**](GraphApi.md#PolicystatusesList) | **Get** /systems/{system_id}/policystatuses | List the policy statuses for a system - - -# **GraphActiveDirectoryAssociationsList** -> []GraphConnection GraphActiveDirectoryAssociationsList(ctx, activedirectoryId, targets, contentType, accept, optional) -List the associations of an Active Directory instance - -This endpoint returns the direct associations of this Active Directory instance. A direct association can be a non-homogeneous relationship between 2 different objects, for example Active Directory and Users. #### Sample Request ``` curl -X GET 'https://console.jumpcloud.com/api/v2/activedirectories/{ActiveDirectory_ID}/associations?targets=user \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **activedirectoryId** | **string**| | - **targets** | [**[]string**](string.md)| | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **activedirectoryId** | **string**| | - **targets** | [**[]string**](string.md)| | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **limit** | **int32**| The number of records to return at once. Limited to 100. | [default to 10] - **skip** | **int32**| The offset into the records to return. | [default to 0] - **xOrgId** | **string**| | [default to ] - -### Return type - -[**[]GraphConnection**](GraphConnection.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **GraphActiveDirectoryAssociationsPost** -> GraphActiveDirectoryAssociationsPost(ctx, activedirectoryId, contentType, accept, optional) -Manage the associations of an Active Directory instance - -This endpoint allows you to manage the _direct_ associations of an Active Directory instance. A direct association can be a non-homogeneous relationship between 2 different objects, for example Active Directory and Users. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/activedirectories/{AD_Instance_ID}/associations \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"op\": \"add\", \"type\": \"user\", \"id\": \"{User_ID}\" } ' ``` - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **activedirectoryId** | **string**| | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **activedirectoryId** | **string**| | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **body** | [**GraphManagementReq**](GraphManagementReq.md)| | - **xOrgId** | **string**| | [default to ] - -### Return type - - (empty response body) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **GraphActiveDirectoryTraverseUser** -> []GraphObjectWithPaths GraphActiveDirectoryTraverseUser(ctx, activedirectoryId, contentType, accept, optional) -List the Users bound to an Active Directory instance - -This endpoint will return all Users bound to an Active Directory instance, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this Active Directory instance to the corresponding User; this array represents all grouping and/or associations that would have to be removed to deprovision the User from this Active Directory instance. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/activedirectories/{ActiveDirectory_ID}/users \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **activedirectoryId** | **string**| ObjectID of the Active Directory instance. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **activedirectoryId** | **string**| ObjectID of the Active Directory instance. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **filter** | [**[]string**](string.md)| Supported operators are: eq, ne, gt, ge, lt, le, between, search, in | - **limit** | **int32**| The number of records to return at once. Limited to 100. | [default to 10] - **xOrgId** | **string**| | [default to ] - **skip** | **int32**| The offset into the records to return. | [default to 0] - -### Return type - -[**[]GraphObjectWithPaths**](GraphObjectWithPaths.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **GraphActiveDirectoryTraverseUserGroup** -> []GraphObjectWithPaths GraphActiveDirectoryTraverseUserGroup(ctx, activedirectoryId, contentType, accept, optional) -List the User Groups bound to an Active Directory instance - -This endpoint will return all Users Groups bound to an Active Directory instance, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the group's type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this Active Directory instance to the corresponding User Group; this array represents all grouping and/or associations that would have to be removed to deprovision the User Group from this Active Directory instance. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/activedirectories/{ActiveDirectory_ID}/usergroups \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **activedirectoryId** | **string**| ObjectID of the Active Directory instance. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **activedirectoryId** | **string**| ObjectID of the Active Directory instance. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **limit** | **int32**| The number of records to return at once. Limited to 100. | [default to 10] - **xOrgId** | **string**| | [default to ] - **skip** | **int32**| The offset into the records to return. | [default to 0] - **filter** | [**[]string**](string.md)| Supported operators are: eq, ne, gt, ge, lt, le, between, search, in | - -### Return type - -[**[]GraphObjectWithPaths**](GraphObjectWithPaths.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **GraphApplicationAssociationsList** -> []GraphConnection GraphApplicationAssociationsList(ctx, applicationId, targets, contentType, accept, optional) -List the associations of an Application - -This endpoint will return the _direct_ associations of an Application. A direct association can be a non-homogeneous relationship between 2 different objects, for example Applications and User Groups. #### Sample Request ``` curl -X GET 'https://console.jumpcloud.com/api/v2/applications/{Application_ID}/associations?targets=user_group \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **applicationId** | **string**| ObjectID of the Application. | - **targets** | [**[]string**](string.md)| | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **applicationId** | **string**| ObjectID of the Application. | - **targets** | [**[]string**](string.md)| | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **limit** | **int32**| The number of records to return at once. Limited to 100. | [default to 10] - **skip** | **int32**| The offset into the records to return. | [default to 0] - **xOrgId** | **string**| | [default to ] - -### Return type - -[**[]GraphConnection**](GraphConnection.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **GraphApplicationAssociationsPost** -> GraphApplicationAssociationsPost(ctx, applicationId, contentType, accept, optional) -Manage the associations of an Application - -This endpoint allows you to manage the _direct_ associations of an Application. A direct association can be a non-homogeneous relationship between 2 different objects, for example Application and User Groups. #### Sample Request ``` curl -X POST 'https://console.jumpcloud.com/api/v2/applications/{Application_ID}/associations' \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"op\": \"add\", \"type\": \"user_group\", \"id\": \"{Group_ID}\" }' ``` - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **applicationId** | **string**| ObjectID of the Application. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **applicationId** | **string**| ObjectID of the Application. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **body** | [**GraphManagementReq**](GraphManagementReq.md)| | - **xOrgId** | **string**| | [default to ] - -### Return type - - (empty response body) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **GraphApplicationTraverseUser** -> []GraphObjectWithPaths GraphApplicationTraverseUser(ctx, applicationId, contentType, accept, optional) -List the Users bound to an Application - -This endpoint will return all Users bound to an Application, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this Application to the corresponding User; this array represents all grouping and/or associations that would have to be removed to deprovision the User from this Application. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/applications/{Application_ID}/users \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **applicationId** | **string**| ObjectID of the Application. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **applicationId** | **string**| ObjectID of the Application. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **limit** | **int32**| The number of records to return at once. Limited to 100. | [default to 10] - **xOrgId** | **string**| | [default to ] - **skip** | **int32**| The offset into the records to return. | [default to 0] - **filter** | [**[]string**](string.md)| Supported operators are: eq, ne, gt, ge, lt, le, between, search, in | - -### Return type - -[**[]GraphObjectWithPaths**](GraphObjectWithPaths.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **GraphApplicationTraverseUserGroup** -> []GraphObjectWithPaths GraphApplicationTraverseUserGroup(ctx, applicationId, contentType, accept, optional) -List the User Groups bound to an Application - -This endpoint will return all Users Groups bound to an Application, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the group's type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this Application to the corresponding User Group; this array represents all grouping and/or associations that would have to be removed to deprovision the User Group from this Application. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/applications/{Application_ID}/usergroups \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **applicationId** | **string**| ObjectID of the Application. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **applicationId** | **string**| ObjectID of the Application. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **limit** | **int32**| The number of records to return at once. Limited to 100. | [default to 10] - **xOrgId** | **string**| | [default to ] - **skip** | **int32**| The offset into the records to return. | [default to 0] - **filter** | [**[]string**](string.md)| Supported operators are: eq, ne, gt, ge, lt, le, between, search, in | - -### Return type - -[**[]GraphObjectWithPaths**](GraphObjectWithPaths.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **GraphCommandAssociationsList** -> []GraphConnection GraphCommandAssociationsList(ctx, commandId, targets, contentType, accept, optional) -List the associations of a Command - -This endpoint will return the _direct_ associations of this Command. A direct association can be a non-homogeneous relationship between 2 different objects, for example Commands and User Groups. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/commands/{Command_ID}/associations?targets=system_group \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **commandId** | **string**| ObjectID of the Command. | - **targets** | [**[]string**](string.md)| | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **commandId** | **string**| ObjectID of the Command. | - **targets** | [**[]string**](string.md)| | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **limit** | **int32**| The number of records to return at once. Limited to 100. | [default to 10] - **skip** | **int32**| The offset into the records to return. | [default to 0] - **xOrgId** | **string**| | [default to ] - -### Return type - -[**[]GraphConnection**](GraphConnection.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **GraphCommandAssociationsPost** -> GraphCommandAssociationsPost(ctx, commandId, contentType, accept, optional) -Manage the associations of a Command - -This endpoint will allow you to manage the _direct_ associations of this Command. A direct association can be a non-homogeneous relationship between 2 different objects, for example Commands and User Groups. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/commands/{Command_ID}/associations \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"op\": \"add\", \"type\": \"system_group\", \"id\": \"Group_ID\" }' ``` - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **commandId** | **string**| ObjectID of the Command. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **commandId** | **string**| ObjectID of the Command. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **body** | [**GraphManagementReq**](GraphManagementReq.md)| | - **xOrgId** | **string**| | [default to ] - -### Return type - - (empty response body) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **GraphCommandTraverseSystem** -> []GraphObjectWithPaths GraphCommandTraverseSystem(ctx, commandId, contentType, accept, optional) -List the Systems bound to a Command - -This endpoint will return all Systems bound to a Command, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this Command to the corresponding System; this array represents all grouping and/or associations that would have to be removed to deprovision the System from this Command. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/commands/{Command_ID}/systems \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **commandId** | **string**| ObjectID of the Command. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **commandId** | **string**| ObjectID of the Command. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **limit** | **int32**| The number of records to return at once. Limited to 100. | [default to 10] - **xOrgId** | **string**| | [default to ] - **skip** | **int32**| The offset into the records to return. | [default to 0] - **filter** | [**[]string**](string.md)| Supported operators are: eq, ne, gt, ge, lt, le, between, search, in | - -### Return type - -[**[]GraphObjectWithPaths**](GraphObjectWithPaths.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **GraphCommandTraverseSystemGroup** -> []GraphObjectWithPaths GraphCommandTraverseSystemGroup(ctx, commandId, contentType, accept, optional) -List the System Groups bound to a Command - -This endpoint will return all System Groups bound to a Command, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the group's type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this Command to the corresponding System Group; this array represents all grouping and/or associations that would have to be removed to deprovision the System Group from this Command. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/commands/{Command_ID}/systemgroups \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **commandId** | **string**| ObjectID of the Command. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **commandId** | **string**| ObjectID of the Command. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **limit** | **int32**| The number of records to return at once. Limited to 100. | [default to 10] - **xOrgId** | **string**| | [default to ] - **skip** | **int32**| The offset into the records to return. | [default to 0] - **filter** | [**[]string**](string.md)| Supported operators are: eq, ne, gt, ge, lt, le, between, search, in | - -### Return type - -[**[]GraphObjectWithPaths**](GraphObjectWithPaths.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **GraphGSuiteAssociationsList** -> []GraphConnection GraphGSuiteAssociationsList(ctx, gsuiteId, targets, contentType, accept, optional) -List the associations of a G Suite instance - -This endpoint returns the _direct_ associations of this G Suite instance. A direct association can be a non-homogeneous relationship between 2 different objects, for example G Suite and Users. #### Sample Request ``` curl -X GET 'https://console.jumpcloud.com/api/v2/gsuites/{Gsuite_ID}/associations?targets=user_group \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **gsuiteId** | **string**| ObjectID of the G Suite instance. | - **targets** | [**[]string**](string.md)| | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **gsuiteId** | **string**| ObjectID of the G Suite instance. | - **targets** | [**[]string**](string.md)| | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **limit** | **int32**| The number of records to return at once. Limited to 100. | [default to 10] - **skip** | **int32**| The offset into the records to return. | [default to 0] - **xOrgId** | **string**| | [default to ] - -### Return type - -[**[]GraphConnection**](GraphConnection.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **GraphGSuiteAssociationsPost** -> GraphGSuiteAssociationsPost(ctx, gsuiteId, optional) -Manage the associations of a G Suite instance - -This endpoint returns the _direct_ associations of this G Suite instance. A direct association can be a non-homogeneous relationship between 2 different objects, for example G Suite and Users. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/gsuites/{Gsuite_ID}/associations \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"op\": \"add\", \"type\": \"user_group\", \"id\": \"{Group_ID}\" }' ``` - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **gsuiteId** | **string**| ObjectID of the G Suite instance. | - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **gsuiteId** | **string**| ObjectID of the G Suite instance. | - **body** | [**GraphManagementReq**](GraphManagementReq.md)| | - **xOrgId** | **string**| | [default to ] - -### Return type - - (empty response body) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **GraphGSuiteTraverseUser** -> []GraphObjectWithPaths GraphGSuiteTraverseUser(ctx, gsuiteId, contentType, accept, optional) -List the Users bound to a G Suite instance - -This endpoint will return all Users bound to a G Suite instance, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this G Suite instance to the corresponding User; this array represents all grouping and/or associations that would have to be removed to deprovision the User from this G Suite instance. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/gsuites/{Gsuite_ID}/users \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **gsuiteId** | **string**| ObjectID of the G Suite instance. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **gsuiteId** | **string**| ObjectID of the G Suite instance. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **limit** | **int32**| The number of records to return at once. Limited to 100. | [default to 10] - **xOrgId** | **string**| | [default to ] - **skip** | **int32**| The offset into the records to return. | [default to 0] - **filter** | [**[]string**](string.md)| Supported operators are: eq, ne, gt, ge, lt, le, between, search, in | - -### Return type - -[**[]GraphObjectWithPaths**](GraphObjectWithPaths.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **GraphGSuiteTraverseUserGroup** -> []GraphObjectWithPaths GraphGSuiteTraverseUserGroup(ctx, gsuiteId, contentType, accept, optional) -List the User Groups bound to a G Suite instance - -This endpoint will return all User Groups bound to an G Suite instance, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the group's type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this G Suite instance to the corresponding User Group; this array represents all grouping and/or associations that would have to be removed to deprovision the User Group from this G Suite instance. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/gsuites/{GSuite_ID}/usergroups \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **gsuiteId** | **string**| ObjectID of the G Suite instance. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **gsuiteId** | **string**| ObjectID of the G Suite instance. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **limit** | **int32**| The number of records to return at once. Limited to 100. | [default to 10] - **xOrgId** | **string**| | [default to ] - **skip** | **int32**| The offset into the records to return. | [default to 0] - **filter** | [**[]string**](string.md)| Supported operators are: eq, ne, gt, ge, lt, le, between, search, in | - -### Return type - -[**[]GraphObjectWithPaths**](GraphObjectWithPaths.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **GraphLdapServerAssociationsList** -> []GraphConnection GraphLdapServerAssociationsList(ctx, ldapserverId, targets, contentType, accept, optional) -List the associations of a LDAP Server - -This endpoint returns the _direct_ associations of this LDAP Server. A direct association can be a non-homogeneous relationship between 2 different objects, for example LDAP and Users. #### Sample Request ``` curl -X GET 'https://console.jumpcloud.com/api/v2/ldapservers/{LDAP_ID}/associations?targets=user_group \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **ldapserverId** | **string**| ObjectID of the LDAP Server. | - **targets** | [**[]string**](string.md)| | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ldapserverId** | **string**| ObjectID of the LDAP Server. | - **targets** | [**[]string**](string.md)| | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **limit** | **int32**| The number of records to return at once. Limited to 100. | [default to 10] - **skip** | **int32**| The offset into the records to return. | [default to 0] - **xOrgId** | **string**| | [default to ] - -### Return type - -[**[]GraphConnection**](GraphConnection.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **GraphLdapServerAssociationsPost** -> GraphLdapServerAssociationsPost(ctx, ldapserverId, contentType, accept, optional) -Manage the associations of a LDAP Server - -This endpoint allows you to manage the _direct_ associations of a LDAP Server. A direct association can be a non-homogeneous relationship between 2 different objects, for example LDAP and Users. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/ldapservers/{LDAP_ID}/associations \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"op\": \"add\", \"type\": \"user\", \"id\": \"{User_ID}\" }' ``` - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **ldapserverId** | **string**| ObjectID of the LDAP Server. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ldapserverId** | **string**| ObjectID of the LDAP Server. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **body** | [**GraphManagementReq**](GraphManagementReq.md)| | - **xOrgId** | **string**| | [default to ] - -### Return type - - (empty response body) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **GraphLdapServerTraverseUser** -> []GraphObjectWithPaths GraphLdapServerTraverseUser(ctx, ldapserverId, contentType, accept, optional) -List the Users bound to a LDAP Server - -This endpoint will return all Users bound to an LDAP Server, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this LDAP server instance to the corresponding User; this array represents all grouping and/or associations that would have to be removed to deprovision the User from this LDAP server instance. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/ldapservers/{LDAP_ID}/users \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **ldapserverId** | **string**| ObjectID of the LDAP Server. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ldapserverId** | **string**| ObjectID of the LDAP Server. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **limit** | **int32**| The number of records to return at once. Limited to 100. | [default to 10] - **xOrgId** | **string**| | [default to ] - **skip** | **int32**| The offset into the records to return. | [default to 0] - **filter** | [**[]string**](string.md)| Supported operators are: eq, ne, gt, ge, lt, le, between, search, in | - -### Return type - -[**[]GraphObjectWithPaths**](GraphObjectWithPaths.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **GraphLdapServerTraverseUserGroup** -> []GraphObjectWithPaths GraphLdapServerTraverseUserGroup(ctx, ldapserverId, contentType, accept, optional) -List the User Groups bound to a LDAP Server - -This endpoint will return all Users Groups bound to a LDAP Server, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the group's type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this LDAP server instance to the corresponding User Group; this array represents all grouping and/or associations that would have to be removed to deprovision the User Group from this LDAP server instance. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/ldapservers/{LDAP_ID}/usergroups \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **ldapserverId** | **string**| ObjectID of the LDAP Server. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ldapserverId** | **string**| ObjectID of the LDAP Server. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **limit** | **int32**| The number of records to return at once. Limited to 100. | [default to 10] - **xOrgId** | **string**| | [default to ] - **skip** | **int32**| The offset into the records to return. | [default to 0] - **filter** | [**[]string**](string.md)| Supported operators are: eq, ne, gt, ge, lt, le, between, search, in | - -### Return type - -[**[]GraphObjectWithPaths**](GraphObjectWithPaths.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **GraphOffice365AssociationsList** -> []GraphConnection GraphOffice365AssociationsList(ctx, office365Id, targets, contentType, accept, optional) -List the associations of an Office 365 instance - -This endpoint returns _direct_ associations of an Office 365 instance. A direct association can be a non-homogeneous relationship between 2 different objects, for example Office 365 and Users. #### Sample Request ``` curl -X GET 'https://console.jumpcloud.com/api/v2/office365s/{O365_ID}/associations?targets=user_group \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **office365Id** | **string**| ObjectID of the Office 365 instance. | - **targets** | [**[]string**](string.md)| | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **office365Id** | **string**| ObjectID of the Office 365 instance. | - **targets** | [**[]string**](string.md)| | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **limit** | **int32**| The number of records to return at once. Limited to 100. | [default to 10] - **skip** | **int32**| The offset into the records to return. | [default to 0] - **xOrgId** | **string**| | [default to ] - -### Return type - -[**[]GraphConnection**](GraphConnection.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **GraphOffice365AssociationsPost** -> GraphOffice365AssociationsPost(ctx, office365Id, contentType, accept, optional) -Manage the associations of an Office 365 instance - -This endpoint allows you to manage the _direct_ associations of a Office 365 instance. A direct association can be a non-homogeneous relationship between 2 different objects, for example Office 365 and Users. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/office365s/{O365_ID}/associations \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"op\": \"add\", \"type\": \"user_group\", \"id\": \"{Group_ID}\" }' ``` - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **office365Id** | **string**| ObjectID of the Office 365 instance. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **office365Id** | **string**| ObjectID of the Office 365 instance. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **body** | [**GraphManagementReq**](GraphManagementReq.md)| | - **xOrgId** | **string**| | [default to ] - -### Return type - - (empty response body) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **GraphOffice365TraverseUser** -> []GraphObjectWithPaths GraphOffice365TraverseUser(ctx, office365Id, contentType, accept, optional) -List the Users bound to an Office 365 instance - -This endpoint will return all Users bound to an Office 365 instance, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this Office 365 instance to the corresponding User; this array represents all grouping and/or associations that would have to be removed to deprovision the User from this Office 365 instance. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/office365s/{O365_ID}/users \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **office365Id** | **string**| ObjectID of the Office 365 suite. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **office365Id** | **string**| ObjectID of the Office 365 suite. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **limit** | **int32**| The number of records to return at once. Limited to 100. | [default to 10] - **xOrgId** | **string**| | [default to ] - **skip** | **int32**| The offset into the records to return. | [default to 0] - **filter** | [**[]string**](string.md)| Supported operators are: eq, ne, gt, ge, lt, le, between, search, in | - -### Return type - -[**[]GraphObjectWithPaths**](GraphObjectWithPaths.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **GraphOffice365TraverseUserGroup** -> []GraphObjectWithPaths GraphOffice365TraverseUserGroup(ctx, office365Id, contentType, accept, optional) -List the User Groups bound to an Office 365 instance - -This endpoint will return all Users Groups bound to an Office 365 instance, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the group's type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this Office 365 instance to the corresponding User Group; this array represents all grouping and/or associations that would have to be removed to deprovision the User Group from this Office 365 instance. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/office365s/{O365_ID/usergroups \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **office365Id** | **string**| ObjectID of the Office 365 suite. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **office365Id** | **string**| ObjectID of the Office 365 suite. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **limit** | **int32**| The number of records to return at once. Limited to 100. | [default to 10] - **xOrgId** | **string**| | [default to ] - **skip** | **int32**| The offset into the records to return. | [default to 0] - **filter** | [**[]string**](string.md)| Supported operators are: eq, ne, gt, ge, lt, le, between, search, in | - -### Return type - -[**[]GraphObjectWithPaths**](GraphObjectWithPaths.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **GraphPolicyAssociationsList** -> []GraphConnection GraphPolicyAssociationsList(ctx, policyId, targets, contentType, accept, optional) -List the associations of a Policy - -This endpoint returns the _direct_ associations of a Policy. A direct association can be a non-homogeneous relationship between 2 different objects, for example Policies and Systems. #### Sample Request ``` curl -X GET 'https://console.jumpcloud.com/api/v2/policies/{Policy_ID}/associations?targets=system_group \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **policyId** | **string**| ObjectID of the Policy. | - **targets** | [**[]string**](string.md)| | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **policyId** | **string**| ObjectID of the Policy. | - **targets** | [**[]string**](string.md)| | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **limit** | **int32**| The number of records to return at once. Limited to 100. | [default to 10] - **skip** | **int32**| The offset into the records to return. | [default to 0] - **xOrgId** | **string**| | [default to ] - -### Return type - -[**[]GraphConnection**](GraphConnection.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **GraphPolicyAssociationsPost** -> GraphPolicyAssociationsPost(ctx, policyId, contentType, accept, optional) -Manage the associations of a Policy - -This endpoint allows you to manage the _direct_ associations of a Policy. A direct association can be a non-homogeneous relationship between 2 different objects, for example Policies and Systems. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/policies/{Policy_ID}/associations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"op\": \"add\", \"type\": \"system_group\", \"id\": \"{Group_ID}\" }' ``` - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **policyId** | **string**| ObjectID of the Policy. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **policyId** | **string**| ObjectID of the Policy. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **body** | [**GraphManagementReq**](GraphManagementReq.md)| | - **xOrgId** | **string**| | [default to ] - -### Return type - - (empty response body) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **GraphPolicyTraverseSystem** -> []GraphObjectWithPaths GraphPolicyTraverseSystem(ctx, policyId, contentType, accept, optional) -List the Systems bound to a Policy - -This endpoint will return all Systems bound to a Policy, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this Policy to the corresponding System; this array represents all grouping and/or associations that would have to be removed to deprovision the System from this Policy. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/policies/{Policy_ID}/systems \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **policyId** | **string**| ObjectID of the Command. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **policyId** | **string**| ObjectID of the Command. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **limit** | **int32**| The number of records to return at once. Limited to 100. | [default to 10] - **xOrgId** | **string**| | [default to ] - **skip** | **int32**| The offset into the records to return. | [default to 0] - **filter** | [**[]string**](string.md)| Supported operators are: eq, ne, gt, ge, lt, le, between, search, in | - -### Return type - -[**[]GraphObjectWithPaths**](GraphObjectWithPaths.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **GraphPolicyTraverseSystemGroup** -> []GraphObjectWithPaths GraphPolicyTraverseSystemGroup(ctx, policyId, contentType, accept, optional) -List the System Groups bound to a Policy - -This endpoint will return all Systems Groups bound to a Policy, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the group's type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this Policy to the corresponding System Group; this array represents all grouping and/or associations that would have to be removed to deprovision the System Group from this Policy. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/policies/{Policy_ID}/systemgroups \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **policyId** | **string**| ObjectID of the Command. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **policyId** | **string**| ObjectID of the Command. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **limit** | **int32**| The number of records to return at once. Limited to 100. | [default to 10] - **xOrgId** | **string**| | [default to ] - **skip** | **int32**| The offset into the records to return. | [default to 0] - **filter** | [**[]string**](string.md)| Supported operators are: eq, ne, gt, ge, lt, le, between, search, in | - -### Return type - -[**[]GraphObjectWithPaths**](GraphObjectWithPaths.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **GraphRadiusServerAssociationsList** -> []GraphConnection GraphRadiusServerAssociationsList(ctx, radiusserverId, targets, contentType, accept, optional) -List the associations of a RADIUS Server - -This endpoint returns the _direct_ associations of a Radius Server. A direct association can be a non-homogeneous relationship between 2 different objects, for example Radius Servers and Users. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/radiusservers/{RADIUS_ID}/associations?targets=user_group \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **radiusserverId** | **string**| ObjectID of the Radius Server. | - **targets** | [**[]string**](string.md)| | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **radiusserverId** | **string**| ObjectID of the Radius Server. | - **targets** | [**[]string**](string.md)| | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **limit** | **int32**| The number of records to return at once. Limited to 100. | [default to 10] - **skip** | **int32**| The offset into the records to return. | [default to 0] - **xOrgId** | **string**| | [default to ] - -### Return type - -[**[]GraphConnection**](GraphConnection.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **GraphRadiusServerAssociationsPost** -> GraphRadiusServerAssociationsPost(ctx, radiusserverId, contentType, accept, optional) -Manage the associations of a RADIUS Server - -This endpoint allows you to manage the _direct_ associations of a Radius Server. A direct association can be a non-homogeneous relationship between 2 different objects, for example Radius Servers and Users. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/radiusservers/{RADIUS_ID}/associations \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"type\":\"user\", \"id\":\"{USER_ID}\", \"op\":\"add\" }' ``` - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **radiusserverId** | **string**| ObjectID of the Radius Server. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **radiusserverId** | **string**| ObjectID of the Radius Server. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **body** | [**GraphManagementReq**](GraphManagementReq.md)| | - **xOrgId** | **string**| | [default to ] - -### Return type - - (empty response body) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **GraphRadiusServerTraverseUser** -> []GraphObjectWithPaths GraphRadiusServerTraverseUser(ctx, radiusserverId, contentType, accept, optional) -List the Users bound to a RADIUS Server - -This endpoint will return all Users bound to a RADIUS Server, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this RADIUS server instance to the corresponding User; this array represents all grouping and/or associations that would have to be removed to deprovision the User from this RADIUS server instance. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/ldapservers/{LDAP_ID}/users \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **radiusserverId** | **string**| ObjectID of the Radius Server. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **radiusserverId** | **string**| ObjectID of the Radius Server. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **limit** | **int32**| The number of records to return at once. Limited to 100. | [default to 10] - **xOrgId** | **string**| | [default to ] - **skip** | **int32**| The offset into the records to return. | [default to 0] - **filter** | [**[]string**](string.md)| Supported operators are: eq, ne, gt, ge, lt, le, between, search, in | - -### Return type - -[**[]GraphObjectWithPaths**](GraphObjectWithPaths.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **GraphRadiusServerTraverseUserGroup** -> []GraphObjectWithPaths GraphRadiusServerTraverseUserGroup(ctx, radiusserverId, contentType, accept, optional) -List the User Groups bound to a RADIUS Server - -This endpoint will return all Users Groups bound to a RADIUS Server, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the group's type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this RADIUS server instance to the corresponding User Group; this array represents all grouping and/or associations that would have to be removed to deprovision the User Group from this RADIUS server instance. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/radiusservers/{RADIUS_ID}/usergroups \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **radiusserverId** | **string**| ObjectID of the Radius Server. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **radiusserverId** | **string**| ObjectID of the Radius Server. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **limit** | **int32**| The number of records to return at once. Limited to 100. | [default to 10] - **xOrgId** | **string**| | [default to ] - **skip** | **int32**| The offset into the records to return. | [default to 0] - **filter** | [**[]string**](string.md)| Supported operators are: eq, ne, gt, ge, lt, le, between, search, in | - -### Return type - -[**[]GraphObjectWithPaths**](GraphObjectWithPaths.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **GraphSystemAssociationsList** -> []GraphConnection GraphSystemAssociationsList(ctx, systemId, contentType, accept, targets, optional) -List the associations of a System - -This endpoint returns the _direct_ associations of a System. A direct association can be a non-homogeneous relationship between 2 different objects, for example Systems and Users. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/systems/{System_ID}/associations?targets=user \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **systemId** | **string**| ObjectID of the System. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **targets** | [**[]string**](string.md)| | - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **systemId** | **string**| ObjectID of the System. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **targets** | [**[]string**](string.md)| | - **limit** | **int32**| The number of records to return at once. Limited to 100. | [default to 10] - **skip** | **int32**| The offset into the records to return. | [default to 0] - **date** | **string**| Current date header for the System Context API | - **authorization** | **string**| Authorization header for the System Context API | - **xOrgId** | **string**| | [default to ] - -### Return type - -[**[]GraphConnection**](GraphConnection.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **GraphSystemAssociationsPost** -> GraphSystemAssociationsPost(ctx, systemId, contentType, accept, optional) -Manage associations of a System - -This endpoint allows you to manage the _direct_ associations of a System. A direct association can be a non-homogeneous relationship between 2 different objects, for example Systems and Users. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/systems/{System_ID}/associations \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"attributes\": { \"sudo\": { \"enabled\": true, \"withoutPassword\": false } }, \"op\": \"add\", \"type\": \"user\", \"id\": \"UserID\" }' ``` - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **systemId** | **string**| ObjectID of the System. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **systemId** | **string**| ObjectID of the System. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **body** | [**SystemGraphManagementReq**](SystemGraphManagementReq.md)| | - **date** | **string**| Current date header for the System Context API | - **authorization** | **string**| Authorization header for the System Context API | - **xOrgId** | **string**| | [default to ] - -### Return type - - (empty response body) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **GraphSystemGroupAssociationsList** -> []GraphConnection GraphSystemGroupAssociationsList(ctx, groupId, contentType, accept, targets, optional) -List the associations of a System Group - -This endpoint returns the _direct_ associations of a System Group. A direct association can be a non-homogeneous relationship between 2 different objects, for example System Groups and Users. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/systemgroups/{GroupID}/associations?targets=user \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **groupId** | **string**| ObjectID of the System Group. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **targets** | [**[]string**](string.md)| | - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **groupId** | **string**| ObjectID of the System Group. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **targets** | [**[]string**](string.md)| | - **limit** | **int32**| The number of records to return at once. Limited to 100. | [default to 10] - **skip** | **int32**| The offset into the records to return. | [default to 0] - **xOrgId** | **string**| | [default to ] - -### Return type - -[**[]GraphConnection**](GraphConnection.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **GraphSystemGroupAssociationsPost** -> GraphSystemGroupAssociationsPost(ctx, groupId, contentType, accept, optional) -Manage the associations of a System Group - -This endpoint allows you to manage the _direct_ associations of a System Group. A direct association can be a non-homogeneous relationship between 2 different objects, for example System Groups and Users. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/systemgroups/{GroupID}/associations \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"op\": \"add\", \"type\": \"user\", \"id\": \"{UserID}\" }' ``` - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **groupId** | **string**| ObjectID of the System Group. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **groupId** | **string**| ObjectID of the System Group. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **body** | [**SystemGroupGraphManagementReq**](SystemGroupGraphManagementReq.md)| | - **xOrgId** | **string**| | [default to ] - -### Return type - - (empty response body) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **GraphSystemGroupMemberOf** -> []GraphObjectWithPaths GraphSystemGroupMemberOf(ctx, groupId, contentType, accept, optional) -List the System Group's parents - -This endpoint returns all System Groups a System Group is a member of. This endpoint is not yet public as we haven't completed the code yet. - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **groupId** | **string**| ObjectID of the System Group. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **groupId** | **string**| ObjectID of the System Group. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **filter** | [**[]string**](string.md)| Supported operators are: eq, ne, gt, ge, lt, le, between, search, in | - **limit** | **int32**| The number of records to return at once. Limited to 100. | [default to 10] - **skip** | **int32**| The offset into the records to return. | [default to 0] - **sort** | [**[]string**](string.md)| The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. | - **xOrgId** | **string**| | [default to ] - -### Return type - -[**[]GraphObjectWithPaths**](GraphObjectWithPaths.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **GraphSystemGroupMembersList** -> []GraphConnection GraphSystemGroupMembersList(ctx, groupId, contentType, accept, optional) -List the members of a System Group - -This endpoint returns the system members of a System Group. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/systemgroups/{Group_ID}/members \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **groupId** | **string**| ObjectID of the System Group. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **groupId** | **string**| ObjectID of the System Group. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **limit** | **int32**| The number of records to return at once. Limited to 100. | [default to 10] - **skip** | **int32**| The offset into the records to return. | [default to 0] - **xOrgId** | **string**| | [default to ] - -### Return type - -[**[]GraphConnection**](GraphConnection.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **GraphSystemGroupMembersPost** -> GraphSystemGroupMembersPost(ctx, groupId, contentType, accept, optional) -Manage the members of a System Group - -This endpoint allows you to manage the system members of a System Group. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/systemgroups/{Group_ID}/members \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"op\": \"add\", \"type\": \"system\", \"id\": \"{System_ID}\" }' ``` - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **groupId** | **string**| ObjectID of the System Group. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **groupId** | **string**| ObjectID of the System Group. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **body** | [**SystemGroupMembersReq**](SystemGroupMembersReq.md)| | - **date** | **string**| Current date header for the System Context API | - **authorization** | **string**| Authorization header for the System Context API | - **xOrgId** | **string**| | [default to ] - -### Return type - - (empty response body) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **GraphSystemGroupMembership** -> []GraphObjectWithPaths GraphSystemGroupMembership(ctx, groupId, contentType, accept, optional) -List the System Group's membership - -This endpoint returns all Systems that are a member of this System Group. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/systemgroups/{Group_ID/membership \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **groupId** | **string**| ObjectID of the System Group. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **groupId** | **string**| ObjectID of the System Group. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **limit** | **int32**| The number of records to return at once. Limited to 100. | [default to 10] - **skip** | **int32**| The offset into the records to return. | [default to 0] - **sort** | [**[]string**](string.md)| The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. | - **filter** | [**[]string**](string.md)| Supported operators are: eq, ne, gt, ge, lt, le, between, search, in | - **xOrgId** | **string**| | [default to ] - -### Return type - -[**[]GraphObjectWithPaths**](GraphObjectWithPaths.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **GraphSystemGroupTraverseCommand** -> []GraphObjectWithPaths GraphSystemGroupTraverseCommand(ctx, groupId, contentType, accept, optional) -List the Commands bound to a System Group - -This endpoint will return all Commands bound to a System Group, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the group's type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this System Group to the corresponding Command; this array represents all grouping and/or associations that would have to be removed to deprovision the Command from this System Group. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/systemgroups/{GroupID}/commands \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **groupId** | **string**| ObjectID of the System Group. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **groupId** | **string**| ObjectID of the System Group. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **limit** | **int32**| The number of records to return at once. Limited to 100. | [default to 10] - **xOrgId** | **string**| | [default to ] - **skip** | **int32**| The offset into the records to return. | [default to 0] - **filter** | [**[]string**](string.md)| Supported operators are: eq, ne, gt, ge, lt, le, between, search, in | - -### Return type - -[**[]GraphObjectWithPaths**](GraphObjectWithPaths.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **GraphSystemGroupTraversePolicy** -> []GraphObjectWithPaths GraphSystemGroupTraversePolicy(ctx, groupId, contentType, accept, optional) -List the Policies bound to a System Group - -This endpoint will return all Policies bound to a System Group, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this System Group to the corresponding Policy; this array represents all grouping and/or associations that would have to be removed to deprovision the Policy from this System Group. See `/members` and `/associations` endpoints to manage those collections. This endpoint is not public yet as we haven't finished the code. ##### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/systemgroups/{GroupID}/policies \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **groupId** | **string**| ObjectID of the System Group. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **groupId** | **string**| ObjectID of the System Group. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **limit** | **int32**| The number of records to return at once. Limited to 100. | [default to 10] - **xOrgId** | **string**| | [default to ] - **skip** | **int32**| The offset into the records to return. | [default to 0] - **filter** | [**[]string**](string.md)| Supported operators are: eq, ne, gt, ge, lt, le, between, search, in | - -### Return type - -[**[]GraphObjectWithPaths**](GraphObjectWithPaths.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **GraphSystemGroupTraverseUser** -> []GraphObjectWithPaths GraphSystemGroupTraverseUser(ctx, groupId, contentType, accept, optional) -List the Users bound to a System Group - -This endpoint will return all Users bound to a System Group, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this System Group to the corresponding User; this array represents all grouping and/or associations that would have to be removed to deprovision the User from this System Group. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/systemgroups/{GroupID}/users \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **groupId** | **string**| ObjectID of the System Group. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **groupId** | **string**| ObjectID of the System Group. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **limit** | **int32**| The number of records to return at once. Limited to 100. | [default to 10] - **xOrgId** | **string**| | [default to ] - **skip** | **int32**| The offset into the records to return. | [default to 0] - **filter** | [**[]string**](string.md)| Supported operators are: eq, ne, gt, ge, lt, le, between, search, in | - -### Return type - -[**[]GraphObjectWithPaths**](GraphObjectWithPaths.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **GraphSystemGroupTraverseUserGroup** -> []GraphObjectWithPaths GraphSystemGroupTraverseUserGroup(ctx, groupId, contentType, accept, optional) -List the User Groups bound to a System Group - -This endpoint will return all User Groups bound to a System Group, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this System Group to the corresponding User Group; this array represents all grouping and/or associations that would have to be removed to deprovision the User Group from this System Group. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/systemgroups/{GroupID}/usergroups \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **groupId** | **string**| ObjectID of the System Group. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **groupId** | **string**| ObjectID of the System Group. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **limit** | **int32**| The number of records to return at once. Limited to 100. | [default to 10] - **xOrgId** | **string**| | [default to ] - **skip** | **int32**| The offset into the records to return. | [default to 0] - **filter** | [**[]string**](string.md)| Supported operators are: eq, ne, gt, ge, lt, le, between, search, in | - -### Return type - -[**[]GraphObjectWithPaths**](GraphObjectWithPaths.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **GraphSystemMemberOf** -> []GraphObjectWithPaths GraphSystemMemberOf(ctx, systemId, contentType, accept, optional) -List the parent Groups of a System - -This endpoint returns all the System Groups a System is a member of. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/systems/{System_ID}/memberof \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **systemId** | **string**| ObjectID of the System. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **systemId** | **string**| ObjectID of the System. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **filter** | [**[]string**](string.md)| Supported operators are: eq, ne, gt, ge, lt, le, between, search, in | - **limit** | **int32**| The number of records to return at once. Limited to 100. | [default to 10] - **skip** | **int32**| The offset into the records to return. | [default to 0] - **date** | **string**| Current date header for the System Context API | - **authorization** | **string**| Authorization header for the System Context API | - **sort** | [**[]string**](string.md)| The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. | - **xOrgId** | **string**| | [default to ] - -### Return type - -[**[]GraphObjectWithPaths**](GraphObjectWithPaths.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **GraphSystemTraverseCommand** -> []GraphObjectWithPaths GraphSystemTraverseCommand(ctx, systemId, contentType, accept, optional) -List the Commands bound to a System - -This endpoint will return all Commands bound to a System, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this System to the corresponding Command; this array represents all grouping and/or associations that would have to be removed to deprovision the Command from this System. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/systems/{System_ID}/commands \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **systemId** | **string**| ObjectID of the System. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **systemId** | **string**| ObjectID of the System. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **limit** | **int32**| The number of records to return at once. Limited to 100. | [default to 10] - **xOrgId** | **string**| | [default to ] - **skip** | **int32**| The offset into the records to return. | [default to 0] - **filter** | [**[]string**](string.md)| Supported operators are: eq, ne, gt, ge, lt, le, between, search, in | - -### Return type - -[**[]GraphObjectWithPaths**](GraphObjectWithPaths.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **GraphSystemTraversePolicy** -> []GraphObjectWithPaths GraphSystemTraversePolicy(ctx, systemId, contentType, accept, optional) -List the Policies bound to a System - -This endpoint will return all Policies bound to a System, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this System to the corresponding Policy; this array represents all grouping and/or associations that would have to be removed to deprovision the Policy from this System. See `/members` and `/associations` endpoints to manage those collections. This endpoint is not yet public as we have finish the code. ##### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/{System_ID}/policies \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **systemId** | **string**| ObjectID of the System. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **systemId** | **string**| ObjectID of the System. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **limit** | **int32**| The number of records to return at once. Limited to 100. | [default to 10] - **xOrgId** | **string**| | [default to ] - **skip** | **int32**| The offset into the records to return. | [default to 0] - **filter** | [**[]string**](string.md)| Supported operators are: eq, ne, gt, ge, lt, le, between, search, in | - -### Return type - -[**[]GraphObjectWithPaths**](GraphObjectWithPaths.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **GraphSystemTraverseUser** -> []GraphObjectWithPaths GraphSystemTraverseUser(ctx, systemId, contentType, accept, optional) -List the Users bound to a System - -This endpoint will return all Users bound to a System, either directly or indirectly essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this System to the corresponding User; this array represents all grouping and/or associations that would have to be removed to deprovision the User from this System. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/systems/{System_ID}/users \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **systemId** | **string**| ObjectID of the System. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **systemId** | **string**| ObjectID of the System. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **limit** | **int32**| The number of records to return at once. Limited to 100. | [default to 10] - **xOrgId** | **string**| | [default to ] - **skip** | **int32**| The offset into the records to return. | [default to 0] - **date** | **string**| Current date header for the System Context API | - **authorization** | **string**| Authorization header for the System Context API | - **filter** | [**[]string**](string.md)| Supported operators are: eq, ne, gt, ge, lt, le, between, search, in | - -### Return type - -[**[]GraphObjectWithPaths**](GraphObjectWithPaths.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **GraphSystemTraverseUserGroup** -> []GraphObjectWithPaths GraphSystemTraverseUserGroup(ctx, systemId, contentType, accept, optional) -List the User Groups bound to a System - -This endpoint will return all User Groups bound to a System, either directly or indirectly essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this System to the corresponding User Group; this array represents all grouping and/or associations that would have to be removed to deprovision the User Group from this System. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/systems/{System_ID}/usergroups \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **systemId** | **string**| ObjectID of the System. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **systemId** | **string**| ObjectID of the System. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **limit** | **int32**| The number of records to return at once. Limited to 100. | [default to 10] - **xOrgId** | **string**| | [default to ] - **skip** | **int32**| The offset into the records to return. | [default to 0] - **date** | **string**| Current date header for the System Context API | - **authorization** | **string**| Authorization header for the System Context API | - **filter** | [**[]string**](string.md)| Supported operators are: eq, ne, gt, ge, lt, le, between, search, in | - -### Return type - -[**[]GraphObjectWithPaths**](GraphObjectWithPaths.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **GraphUserAssociationsList** -> []GraphConnection GraphUserAssociationsList(ctx, userId, contentType, accept, targets, optional) -List the associations of a User - -This endpoint returns the _direct_ associations of a User. A direct association can be a non-homogeneous relationship between 2 different objects, for example Users and Systems. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/users/{UserID}/associations?targets=system_group \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **userId** | **string**| ObjectID of the User. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **targets** | [**[]string**](string.md)| | - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **userId** | **string**| ObjectID of the User. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **targets** | [**[]string**](string.md)| | - **limit** | **int32**| The number of records to return at once. Limited to 100. | [default to 10] - **skip** | **int32**| The offset into the records to return. | [default to 0] - **xOrgId** | **string**| | [default to ] - -### Return type - -[**[]GraphConnection**](GraphConnection.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **GraphUserAssociationsPost** -> GraphUserAssociationsPost(ctx, userId, contentType, accept, optional) -Manage the associations of a User - -This endpoint allows you to manage the _direct_ associations of a User. A direct association can be a non-homogeneous relationship between 2 different objects, for example Users and Systems. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/users/{UserID}/associations \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"attributes\": { \"sudo\": { \"enabled\": true, \"withoutPassword\": false } }, \"op\": \"add\", \"type\": \"system_group\", \"id\": \"{GroupID}\" }' - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **userId** | **string**| ObjectID of the User. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **userId** | **string**| ObjectID of the User. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **body** | [**UserGraphManagementReq**](UserGraphManagementReq.md)| | - **xOrgId** | **string**| | [default to ] - -### Return type - - (empty response body) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **GraphUserGroupAssociationsList** -> []GraphConnection GraphUserGroupAssociationsList(ctx, groupId, contentType, accept, targets, optional) -List the associations of a User Group. - -This endpoint returns the _direct_ associations of this User Group. A direct association can be a non-homogeneous relationship between 2 different objects, for example User Groups and Users. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/usergroups/{GroupID}/associations?targets=system \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **groupId** | **string**| ObjectID of the User Group. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **targets** | [**[]string**](string.md)| | - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **groupId** | **string**| ObjectID of the User Group. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **targets** | [**[]string**](string.md)| | - **limit** | **int32**| The number of records to return at once. Limited to 100. | [default to 10] - **skip** | **int32**| The offset into the records to return. | [default to 0] - **xOrgId** | **string**| | [default to ] - -### Return type - -[**[]GraphConnection**](GraphConnection.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **GraphUserGroupAssociationsPost** -> GraphUserGroupAssociationsPost(ctx, groupId, contentType, accept, optional) -Manage the associations of a User Group - -This endpoint manages the _direct_ associations of this User Group. A direct association can be a non-homogeneous relationship between 2 different objects, for example User Groups and Users. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/usergroups/{GroupID}/associations \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"op\": \"add\", \"type\": \"system\", \"id\": \"{SystemID}\" }' ``` - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **groupId** | **string**| ObjectID of the User Group. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **groupId** | **string**| ObjectID of the User Group. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **body** | [**UserGroupGraphManagementReq**](UserGroupGraphManagementReq.md)| | - **xOrgId** | **string**| | [default to ] - -### Return type - - (empty response body) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **GraphUserGroupMemberOf** -> []GraphObjectWithPaths GraphUserGroupMemberOf(ctx, groupId, contentType, accept, optional) -List the User Group's parents - -This endpoint returns all User Groups a User Group is a member of. #### Sample Request ``` https://console.jumpcloud.com/api/v2/usergroups/{group_id}/memberof ``` Not public yet, as the code is not finished, - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **groupId** | **string**| ObjectID of the User Group. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **groupId** | **string**| ObjectID of the User Group. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **filter** | [**[]string**](string.md)| Supported operators are: eq, ne, gt, ge, lt, le, between, search, in | - **limit** | **int32**| The number of records to return at once. Limited to 100. | [default to 10] - **skip** | **int32**| The offset into the records to return. | [default to 0] - **sort** | [**[]string**](string.md)| The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. | - **xOrgId** | **string**| | [default to ] - -### Return type - -[**[]GraphObjectWithPaths**](GraphObjectWithPaths.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **GraphUserGroupMembersList** -> []GraphConnection GraphUserGroupMembersList(ctx, groupId, contentType, accept, optional) -List the members of a User Group - -This endpoint returns the user members of a User Group. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/usergroups/{GroupID}/members \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **groupId** | **string**| ObjectID of the User Group. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **groupId** | **string**| ObjectID of the User Group. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **limit** | **int32**| The number of records to return at once. Limited to 100. | [default to 10] - **skip** | **int32**| The offset into the records to return. | [default to 0] - **xOrgId** | **string**| | [default to ] - -### Return type - -[**[]GraphConnection**](GraphConnection.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **GraphUserGroupMembersPost** -> GraphUserGroupMembersPost(ctx, groupId, contentType, accept, optional) -Manage the members of a User Group - -This endpoint allows you to manage the user members of a User Group. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/usergroups/{GroupID}/members \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"op\": \"add\", \"type\": \"user\", \"id\": \"{User_ID}\" }' ``` - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **groupId** | **string**| ObjectID of the User Group. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **groupId** | **string**| ObjectID of the User Group. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **body** | [**UserGroupMembersReq**](UserGroupMembersReq.md)| | - **xOrgId** | **string**| | [default to ] - -### Return type - - (empty response body) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **GraphUserGroupMembership** -> []GraphObjectWithPaths GraphUserGroupMembership(ctx, groupId, contentType, accept, optional) -List the User Group's membership - -This endpoint returns all users members that are a member of this User Group. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/usergroups/{GroupID}/membership \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **groupId** | **string**| ObjectID of the User Group. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **groupId** | **string**| ObjectID of the User Group. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **filter** | [**[]string**](string.md)| Supported operators are: eq, ne, gt, ge, lt, le, between, search, in | - **limit** | **int32**| The number of records to return at once. Limited to 100. | [default to 10] - **skip** | **int32**| The offset into the records to return. | [default to 0] - **sort** | [**[]string**](string.md)| The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. | - **xOrgId** | **string**| | [default to ] - -### Return type - -[**[]GraphObjectWithPaths**](GraphObjectWithPaths.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **GraphUserGroupTraverseActiveDirectory** -> []GraphObjectWithPaths GraphUserGroupTraverseActiveDirectory(ctx, groupId, contentType, accept, optional) -List the Active Directories bound to a User Group - -This endpoint will return all Active Directory Instances bound to a User Group, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this User Group to the corresponding Active Directory; this array represents all grouping and/or associations that would have to be removed to deprovision the Active Directory from this User Group. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/usergroups/{GroupID}/activedirectories \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **groupId** | **string**| ObjectID of the User Group. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **groupId** | **string**| ObjectID of the User Group. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **limit** | **int32**| The number of records to return at once. Limited to 100. | [default to 10] - **xOrgId** | **string**| | [default to ] - **skip** | **int32**| The offset into the records to return. | [default to 0] - **filter** | [**[]string**](string.md)| Supported operators are: eq, ne, gt, ge, lt, le, between, search, in | - -### Return type - -[**[]GraphObjectWithPaths**](GraphObjectWithPaths.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **GraphUserGroupTraverseApplication** -> []GraphObjectWithPaths GraphUserGroupTraverseApplication(ctx, groupId, contentType, accept, optional) -List the Applications bound to a User Group - -This endpoint will return all Applications bound to a User Group, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this User Group to the corresponding Application; this array represents all grouping and/or associations that would have to be removed to deprovision the Application from this User Group. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/usergroups/{GroupID}/applications \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **groupId** | **string**| ObjectID of the User Group. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **groupId** | **string**| ObjectID of the User Group. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **limit** | **int32**| The number of records to return at once. Limited to 100. | [default to 10] - **xOrgId** | **string**| | [default to ] - **skip** | **int32**| The offset into the records to return. | [default to 0] - **filter** | [**[]string**](string.md)| Supported operators are: eq, ne, gt, ge, lt, le, between, search, in | - -### Return type - -[**[]GraphObjectWithPaths**](GraphObjectWithPaths.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **GraphUserGroupTraverseDirectory** -> []GraphObjectWithPaths GraphUserGroupTraverseDirectory(ctx, groupId, contentType, accept, optional) -List the Directories bound to a User Group - -This endpoint will return all Directories bound to a User Group, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this User Group to the corresponding Directory; this array represents all grouping and/or associations that would have to be removed to deprovision the Directories from this User Group. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/usergroups/{GroupID}/directories \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **groupId** | **string**| ObjectID of the User Group. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **groupId** | **string**| ObjectID of the User Group. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **limit** | **int32**| The number of records to return at once. Limited to 100. | [default to 10] - **xOrgId** | **string**| | [default to ] - **skip** | **int32**| The offset into the records to return. | [default to 0] - **filter** | [**[]string**](string.md)| Supported operators are: eq, ne, gt, ge, lt, le, between, search, in | - -### Return type - -[**[]GraphObjectWithPaths**](GraphObjectWithPaths.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **GraphUserGroupTraverseGSuite** -> []GraphObjectWithPaths GraphUserGroupTraverseGSuite(ctx, groupId, contentType, accept, optional) -List the G Suite instances bound to a User Group - -This endpoint will return all G Suite Instances bound to a User Group, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this User Group to the corresponding G Suite instance; this array represents all grouping and/or associations that would have to be removed to deprovision the G Suite instance from this User Group. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/usergroups/{GroupID/gsuites \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **groupId** | **string**| ObjectID of the User Group. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **groupId** | **string**| ObjectID of the User Group. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **limit** | **int32**| The number of records to return at once. Limited to 100. | [default to 10] - **xOrgId** | **string**| | [default to ] - **skip** | **int32**| The offset into the records to return. | [default to 0] - **filter** | [**[]string**](string.md)| Supported operators are: eq, ne, gt, ge, lt, le, between, search, in | - -### Return type - -[**[]GraphObjectWithPaths**](GraphObjectWithPaths.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **GraphUserGroupTraverseLdapServer** -> []GraphObjectWithPaths GraphUserGroupTraverseLdapServer(ctx, groupId, contentType, accept, optional) -List the LDAP Servers bound to a User Group - -This endpoint will return all LDAP Servers bound to a User Group, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this User Group to the corresponding LDAP Server; this array represents all grouping and/or associations that would have to be removed to deprovision the LDAP Server from this User Group. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/usergroups/{GroupID}/ldapservers \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **groupId** | **string**| ObjectID of the User Group. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **groupId** | **string**| ObjectID of the User Group. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **limit** | **int32**| The number of records to return at once. Limited to 100. | [default to 10] - **xOrgId** | **string**| | [default to ] - **skip** | **int32**| The offset into the records to return. | [default to 0] - **filter** | [**[]string**](string.md)| Supported operators are: eq, ne, gt, ge, lt, le, between, search, in | - -### Return type - -[**[]GraphObjectWithPaths**](GraphObjectWithPaths.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **GraphUserGroupTraverseOffice365** -> []GraphObjectWithPaths GraphUserGroupTraverseOffice365(ctx, groupId, contentType, accept, optional) -List the Office 365 instances bound to a User Group - -This endpoint will return all Office 365 instances bound to a User Group, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this User Group to the corresponding Office 365 instance; this array represents all grouping and/or associations that would have to be removed to deprovision the Office 365 instance from this User Group. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/usergroups/{GroupID}/office365s \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **groupId** | **string**| ObjectID of the User Group. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **groupId** | **string**| ObjectID of the User Group. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **limit** | **int32**| The number of records to return at once. Limited to 100. | [default to 10] - **xOrgId** | **string**| | [default to ] - **skip** | **int32**| The offset into the records to return. | [default to 0] - **filter** | [**[]string**](string.md)| Supported operators are: eq, ne, gt, ge, lt, le, between, search, in | - -### Return type - -[**[]GraphObjectWithPaths**](GraphObjectWithPaths.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **GraphUserGroupTraverseRadiusServer** -> []GraphObjectWithPaths GraphUserGroupTraverseRadiusServer(ctx, groupId, contentType, accept, optional) -List the RADIUS Servers bound to a User Group - -This endpoint will return all RADIUS servers bound to a User Group, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this User Group to the corresponding RADIUS Server; this array represents all grouping and/or associations that would have to be removed to deprovision the RADIUS Server from this User Group. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/usergroups/{GroupID}/radiusservers \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **groupId** | **string**| ObjectID of the User Group. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **groupId** | **string**| ObjectID of the User Group. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **limit** | **int32**| The number of records to return at once. Limited to 100. | [default to 10] - **xOrgId** | **string**| | [default to ] - **skip** | **int32**| The offset into the records to return. | [default to 0] - **filter** | [**[]string**](string.md)| Supported operators are: eq, ne, gt, ge, lt, le, between, search, in | - -### Return type - -[**[]GraphObjectWithPaths**](GraphObjectWithPaths.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **GraphUserGroupTraverseSystem** -> []GraphObjectWithPaths GraphUserGroupTraverseSystem(ctx, groupId, contentType, accept, optional) -List the Systems bound to a User Group - -This endpoint will return all Systems bound to a User Group, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this User Group to the corresponding System; this array represents all grouping and/or associations that would have to be removed to deprovision the System from this User Group. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/usergroups/{GroupID}/systems \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **groupId** | **string**| ObjectID of the User Group. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **groupId** | **string**| ObjectID of the User Group. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **limit** | **int32**| The number of records to return at once. Limited to 100. | [default to 10] - **xOrgId** | **string**| | [default to ] - **skip** | **int32**| The offset into the records to return. | [default to 0] - **filter** | [**[]string**](string.md)| Supported operators are: eq, ne, gt, ge, lt, le, between, search, in | - -### Return type - -[**[]GraphObjectWithPaths**](GraphObjectWithPaths.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **GraphUserGroupTraverseSystemGroup** -> []GraphObjectWithPaths GraphUserGroupTraverseSystemGroup(ctx, groupId, contentType, accept, optional) -List the System Groups bound to User Groups - -This endpoint will return all System Groups bound to a User Group, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this User Group to the corresponding System Group; this array represents all grouping and/or associations that would have to be removed to deprovision the System Group from this User Group. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/usergroups/{GroupID}/systemgroups \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **groupId** | **string**| ObjectID of the User Group. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **groupId** | **string**| ObjectID of the User Group. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **limit** | **int32**| The number of records to return at once. Limited to 100. | [default to 10] - **xOrgId** | **string**| | [default to ] - **skip** | **int32**| The offset into the records to return. | [default to 0] - **filter** | [**[]string**](string.md)| Supported operators are: eq, ne, gt, ge, lt, le, between, search, in | - -### Return type - -[**[]GraphObjectWithPaths**](GraphObjectWithPaths.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **GraphUserMemberOf** -> []GraphObjectWithPaths GraphUserMemberOf(ctx, userId, contentType, accept, optional) -List the parent Groups of a User - -This endpoint returns all the User Groups a User is a member of. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/users/{UserID}/memberof \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **userId** | **string**| ObjectID of the User. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **userId** | **string**| ObjectID of the User. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **filter** | [**[]string**](string.md)| Supported operators are: eq, ne, gt, ge, lt, le, between, search, in | - **limit** | **int32**| The number of records to return at once. Limited to 100. | [default to 10] - **skip** | **int32**| The offset into the records to return. | [default to 0] - **sort** | [**[]string**](string.md)| The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. | - **xOrgId** | **string**| | [default to ] - -### Return type - -[**[]GraphObjectWithPaths**](GraphObjectWithPaths.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **GraphUserTraverseActiveDirectory** -> []GraphObjectWithPaths GraphUserTraverseActiveDirectory(ctx, userId, contentType, accept, optional) -List the Active Directory instances bound to a User - -This endpoint will return all Active Directory Instances bound to a User, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this User to the corresponding Active Directory instance; this array represents all grouping and/or associations that would have to be removed to deprovision the Active Directory instance from this User. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/users/{UserID}/activedirectories \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **userId** | **string**| ObjectID of the User. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **userId** | **string**| ObjectID of the User. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **filter** | [**[]string**](string.md)| Supported operators are: eq, ne, gt, ge, lt, le, between, search, in | - **limit** | **int32**| The number of records to return at once. Limited to 100. | [default to 10] - **xOrgId** | **string**| | [default to ] - **skip** | **int32**| The offset into the records to return. | [default to 0] - -### Return type - -[**[]GraphObjectWithPaths**](GraphObjectWithPaths.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **GraphUserTraverseApplication** -> []GraphObjectWithPaths GraphUserTraverseApplication(ctx, userId, contentType, accept, optional) -List the Applications bound to a User - -This endpoint will return all Applications bound to a User, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this User to the corresponding Application; this array represents all grouping and/or associations that would have to be removed to deprovision the Application from this User. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/users/{UserID}/applications \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **userId** | **string**| ObjectID of the User. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **userId** | **string**| ObjectID of the User. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **limit** | **int32**| The number of records to return at once. Limited to 100. | [default to 10] - **xOrgId** | **string**| | [default to ] - **skip** | **int32**| The offset into the records to return. | [default to 0] - **filter** | [**[]string**](string.md)| Supported operators are: eq, ne, gt, ge, lt, le, between, search, in | - -### Return type - -[**[]GraphObjectWithPaths**](GraphObjectWithPaths.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **GraphUserTraverseDirectory** -> []GraphObjectWithPaths GraphUserTraverseDirectory(ctx, userId, contentType, accept, optional) -List the Directories bound to a User - -This endpoint will return all Directories bound to a User, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this User to the corresponding Directory; this array represents all grouping and/or associations that would have to be removed to deprovision the Directory from this User. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/users/{UserID}/directories \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **userId** | **string**| ObjectID of the User. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **userId** | **string**| ObjectID of the User. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **limit** | **int32**| The number of records to return at once. Limited to 100. | [default to 10] - **xOrgId** | **string**| | [default to ] - **skip** | **int32**| The offset into the records to return. | [default to 0] - **filter** | [**[]string**](string.md)| Supported operators are: eq, ne, gt, ge, lt, le, between, search, in | - -### Return type - -[**[]GraphObjectWithPaths**](GraphObjectWithPaths.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **GraphUserTraverseGSuite** -> []GraphObjectWithPaths GraphUserTraverseGSuite(ctx, userId, contentType, accept, optional) -List the G Suite instances bound to a User - -This endpoint will return all G-Suite Instances bound to a User, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this User to the corresponding G Suite instance; this array represents all grouping and/or associations that would have to be removed to deprovision the G Suite instance from this User. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/users/{UserID}/gsuites \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **userId** | **string**| ObjectID of the User. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **userId** | **string**| ObjectID of the User. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **limit** | **int32**| The number of records to return at once. Limited to 100. | [default to 10] - **xOrgId** | **string**| | [default to ] - **skip** | **int32**| The offset into the records to return. | [default to 0] - **filter** | [**[]string**](string.md)| Supported operators are: eq, ne, gt, ge, lt, le, between, search, in | - -### Return type - -[**[]GraphObjectWithPaths**](GraphObjectWithPaths.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **GraphUserTraverseLdapServer** -> []GraphObjectWithPaths GraphUserTraverseLdapServer(ctx, userId, contentType, accept, optional) -List the LDAP servers bound to a User - -This endpoint will return all LDAP Servers bound to a User, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this User to the corresponding LDAP Server; this array represents all grouping and/or associations that would have to be removed to deprovision the LDAP Server from this User. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/users/{UserID}/ldapservers \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **userId** | **string**| ObjectID of the User. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **userId** | **string**| ObjectID of the User. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **limit** | **int32**| The number of records to return at once. Limited to 100. | [default to 10] - **xOrgId** | **string**| | [default to ] - **skip** | **int32**| The offset into the records to return. | [default to 0] - **filter** | [**[]string**](string.md)| Supported operators are: eq, ne, gt, ge, lt, le, between, search, in | - -### Return type - -[**[]GraphObjectWithPaths**](GraphObjectWithPaths.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **GraphUserTraverseOffice365** -> []GraphObjectWithPaths GraphUserTraverseOffice365(ctx, userId, contentType, accept, optional) -List the Office 365 instances bound to a User - -This endpoint will return all Office 365 Instances bound to a User, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this User to the corresponding Office 365 instance; this array represents all grouping and/or associations that would have to be removed to deprovision the Office 365 instance from this User. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/users/{UserID}/office365s \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **userId** | **string**| ObjectID of the User. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **userId** | **string**| ObjectID of the User. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **limit** | **int32**| The number of records to return at once. Limited to 100. | [default to 10] - **xOrgId** | **string**| | [default to ] - **skip** | **int32**| The offset into the records to return. | [default to 0] - **filter** | [**[]string**](string.md)| Supported operators are: eq, ne, gt, ge, lt, le, between, search, in | - -### Return type - -[**[]GraphObjectWithPaths**](GraphObjectWithPaths.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **GraphUserTraverseRadiusServer** -> []GraphObjectWithPaths GraphUserTraverseRadiusServer(ctx, userId, contentType, accept, optional) -List the RADIUS Servers bound to a User - -This endpoint will return all RADIUS Servers bound to a User, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this User to the corresponding RADIUS Server; this array represents all grouping and/or associations that would have to be removed to deprovision the RADIUS Server from this User. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/users/{UserID}/radiusservers \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **userId** | **string**| ObjectID of the User. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **userId** | **string**| ObjectID of the User. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **limit** | **int32**| The number of records to return at once. Limited to 100. | [default to 10] - **xOrgId** | **string**| | [default to ] - **skip** | **int32**| The offset into the records to return. | [default to 0] - **filter** | [**[]string**](string.md)| Supported operators are: eq, ne, gt, ge, lt, le, between, search, in | - -### Return type - -[**[]GraphObjectWithPaths**](GraphObjectWithPaths.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **GraphUserTraverseSystem** -> []GraphObjectWithPaths GraphUserTraverseSystem(ctx, userId, contentType, accept, optional) -List the Systems bound to a User - -This endpoint will return all Systems bound to a User, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this User to the corresponding System; this array represents all grouping and/or associations that would have to be removed to deprovision the System from this User. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/users/{UserID}/systems\\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **userId** | **string**| ObjectID of the User. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **userId** | **string**| ObjectID of the User. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **limit** | **int32**| The number of records to return at once. Limited to 100. | [default to 10] - **xOrgId** | **string**| | [default to ] - **skip** | **int32**| The offset into the records to return. | [default to 0] - **filter** | [**[]string**](string.md)| Supported operators are: eq, ne, gt, ge, lt, le, between, search, in | - -### Return type - -[**[]GraphObjectWithPaths**](GraphObjectWithPaths.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **GraphUserTraverseSystemGroup** -> []GraphObjectWithPaths GraphUserTraverseSystemGroup(ctx, userId, contentType, accept, optional) -List the System Groups bound to a User - -This endpoint will return all System Groups bound to a User, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this User to the corresponding System Group; this array represents all grouping and/or associations that would have to be removed to deprovision the System Group from this User. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/users/{UserID}/systemgroups\\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **userId** | **string**| ObjectID of the User. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **userId** | **string**| ObjectID of the User. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **limit** | **int32**| The number of records to return at once. Limited to 100. | [default to 10] - **xOrgId** | **string**| | [default to ] - **skip** | **int32**| The offset into the records to return. | [default to 0] - **filter** | [**[]string**](string.md)| Supported operators are: eq, ne, gt, ge, lt, le, between, search, in | - -### Return type - -[**[]GraphObjectWithPaths**](GraphObjectWithPaths.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **PolicystatusesList** -> []PolicyResult PolicystatusesList(ctx, systemId, contentType, accept, optional) -List the policy statuses for a system - -This endpoint returns the policy results for a particular system. ##### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/systems/{System_ID}/policystatuses \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **systemId** | **string**| ObjectID of the System. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **systemId** | **string**| ObjectID of the System. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **fields** | [**[]string**](string.md)| The comma separated fields included in the returned records. If omitted, the default list of fields will be returned. | - **filter** | [**[]string**](string.md)| Supported operators are: eq, ne, gt, ge, lt, le, between, search, in | - **limit** | **int32**| The number of records to return at once. Limited to 100. | [default to 10] - **skip** | **int32**| The offset into the records to return. | [default to 0] - **sort** | [**[]string**](string.md)| The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. | - **xOrgId** | **string**| | [default to ] - -### Return type - -[**[]PolicyResult**](PolicyResult.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - diff --git a/v2/docs/GraphManagementReq.md b/v2/docs/GraphManagementReq.md deleted file mode 100644 index a2ec1f9..0000000 --- a/v2/docs/GraphManagementReq.md +++ /dev/null @@ -1,12 +0,0 @@ -# GraphManagementReq - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Id** | **string** | The ObjectID of graph object being added or removed as an association. | [default to null] -**Op** | **string** | How to modify the graph connection. | [default to null] -**Type_** | [***GraphType**](GraphType.md) | | [default to null] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/v2/docs/Group.md b/v2/docs/Group.md deleted file mode 100644 index dfced99..0000000 --- a/v2/docs/Group.md +++ /dev/null @@ -1,12 +0,0 @@ -# Group - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Id** | **string** | ObjectId uniquely identifying a Group. | [optional] [default to null] -**Name** | **string** | Display name of a Group. | [optional] [default to null] -**Type_** | [***GroupType**](GroupType.md) | | [optional] [default to null] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/v2/docs/GroupsApi.md b/v2/docs/GroupsApi.md deleted file mode 100644 index f9004af..0000000 --- a/v2/docs/GroupsApi.md +++ /dev/null @@ -1,53 +0,0 @@ -# \GroupsApi - -All URIs are relative to *https://console.jumpcloud.com/api/v2* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**GroupsList**](GroupsApi.md#GroupsList) | **Get** /groups | List All Groups - - -# **GroupsList** -> []Group GroupsList(ctx, contentType, accept, optional) -List All Groups - -This endpoint returns all Groups that exist in your organization. #### Available filter fields: - `name` - `disabled` - `type` #### Sample Request ``` curl -X GET \\ https://console.jumpcloud.com/api/v2/groups \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **fields** | [**[]string**](string.md)| The comma separated fields included in the returned records. If omitted, the default list of fields will be returned. | - **filter** | [**[]string**](string.md)| Supported operators are: eq, ne, gt, ge, lt, le, between, search, in | - **limit** | **int32**| The number of records to return at once. Limited to 100. | [default to 10] - **skip** | **int32**| The offset into the records to return. | [default to 0] - **sort** | [**[]string**](string.md)| The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. | - **xOrgId** | **string**| | [default to ] - -### Return type - -[**[]Group**](Group.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - diff --git a/v2/docs/InlineResponse200.md b/v2/docs/InlineResponse200.md deleted file mode 100644 index 717ff49..0000000 --- a/v2/docs/InlineResponse200.md +++ /dev/null @@ -1,13 +0,0 @@ -# InlineResponse200 - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Id** | **string** | | [optional] [default to null] -**Name** | **string** | | [optional] [default to null] -**UserLockoutAction** | [***LdapServerAction**](LdapServerAction.md) | | [optional] [default to null] -**UserPasswordExpirationAction** | [***LdapServerAction**](LdapServerAction.md) | | [optional] [default to null] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/v2/docs/InlineResponse2001.md b/v2/docs/InlineResponse2001.md deleted file mode 100644 index 8be9810..0000000 --- a/v2/docs/InlineResponse2001.md +++ /dev/null @@ -1,11 +0,0 @@ -# InlineResponse2001 - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Results** | [**[]Administrator**](Administrator.md) | | [optional] [default to null] -**TotalCount** | **int32** | | [optional] [default to null] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/v2/docs/InlineResponse201.md b/v2/docs/InlineResponse201.md deleted file mode 100644 index 82fa445..0000000 --- a/v2/docs/InlineResponse201.md +++ /dev/null @@ -1,11 +0,0 @@ -# InlineResponse201 - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**AppleMdm** | [***AppleMdm**](AppleMDM.md) | | [optional] [default to null] -**SignedCsrPlist** | **string** | | [optional] [default to null] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/v2/docs/JcEnrollmentProfile.md b/v2/docs/JcEnrollmentProfile.md deleted file mode 100644 index d20edbd..0000000 --- a/v2/docs/JcEnrollmentProfile.md +++ /dev/null @@ -1,14 +0,0 @@ -# JcEnrollmentProfile - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Groups** | **[]string** | | [optional] [default to null] -**Id** | **string** | | [optional] [default to null] -**Name** | **string** | | [optional] [default to null] -**Organization** | **string** | | [optional] [default to null] -**Users** | **[]string** | | [optional] [default to null] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/v2/docs/JobDetails.md b/v2/docs/JobDetails.md deleted file mode 100644 index bff566d..0000000 --- a/v2/docs/JobDetails.md +++ /dev/null @@ -1,17 +0,0 @@ -# JobDetails - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**AdminId** | **string** | | [optional] [default to null] -**Id** | **string** | | [optional] [default to null] -**Meta** | [***interface{}**](interface{}.md) | | [optional] [default to null] -**Name** | **string** | | [optional] [default to null] -**PersistedFields** | **[]string** | | [optional] [default to null] -**Status** | **string** | | [optional] [default to null] -**UpdatedAt** | **string** | | [optional] [default to null] -**WorkUnitsCount** | **int32** | | [optional] [default to null] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/v2/docs/JobWorkresult.md b/v2/docs/JobWorkresult.md deleted file mode 100644 index 7e314e2..0000000 --- a/v2/docs/JobWorkresult.md +++ /dev/null @@ -1,10 +0,0 @@ -# JobWorkresult - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Meta** | [***interface{}**](interface{}.md) | | [optional] [default to null] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/v2/docs/KnowledgeApi.md b/v2/docs/KnowledgeApi.md deleted file mode 100644 index 94f5204..0000000 --- a/v2/docs/KnowledgeApi.md +++ /dev/null @@ -1,48 +0,0 @@ -# \KnowledgeApi - -All URIs are relative to *https://console.jumpcloud.com/api/v2* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**KnowledgeSalesforceList**](KnowledgeApi.md#KnowledgeSalesforceList) | **Get** /knowledge/salesforce | List Knowledge Articles - - -# **KnowledgeSalesforceList** -> SalesforceKnowledgeListOutput KnowledgeSalesforceList(ctx, optional) -List Knowledge Articles - -This endpoint returns a list of knowledge articles hosted in salesforce. ``` Sample Request curl -X GET https://console.jumpcloud.com/api/v2/knowledge/salesforce \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **fields** | [**[]string**](string.md)| | - **filter** | [**[]string**](string.md)| Supported operators are: eq, ne, gt, ge, lt, le, between, search, in | - **limit** | **int32**| The number of records to return at once. Limited to 100. | [default to 10] - **skip** | **int32**| The offset into the records to return. | [default to 0] - **sort** | [**[]string**](string.md)| The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. | - -### Return type - -[**SalesforceKnowledgeListOutput**](salesforce-knowledge-list-output.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - diff --git a/v2/docs/LDAPServersApi.md b/v2/docs/LDAPServersApi.md deleted file mode 100644 index fafbaae..0000000 --- a/v2/docs/LDAPServersApi.md +++ /dev/null @@ -1,318 +0,0 @@ -# \LDAPServersApi - -All URIs are relative to *https://console.jumpcloud.com/api/v2* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**GraphLdapServerAssociationsList**](LDAPServersApi.md#GraphLdapServerAssociationsList) | **Get** /ldapservers/{ldapserver_id}/associations | List the associations of a LDAP Server -[**GraphLdapServerAssociationsPost**](LDAPServersApi.md#GraphLdapServerAssociationsPost) | **Post** /ldapservers/{ldapserver_id}/associations | Manage the associations of a LDAP Server -[**GraphLdapServerTraverseUser**](LDAPServersApi.md#GraphLdapServerTraverseUser) | **Get** /ldapservers/{ldapserver_id}/users | List the Users bound to a LDAP Server -[**GraphLdapServerTraverseUserGroup**](LDAPServersApi.md#GraphLdapServerTraverseUserGroup) | **Get** /ldapservers/{ldapserver_id}/usergroups | List the User Groups bound to a LDAP Server -[**LdapserversGet**](LDAPServersApi.md#LdapserversGet) | **Get** /ldapservers/{id} | Get LDAP Server -[**LdapserversList**](LDAPServersApi.md#LdapserversList) | **Get** /ldapservers | List LDAP Servers -[**LdapserversPatch**](LDAPServersApi.md#LdapserversPatch) | **Patch** /ldapservers/{id} | Update existing LDAP server - - -# **GraphLdapServerAssociationsList** -> []GraphConnection GraphLdapServerAssociationsList(ctx, ldapserverId, targets, contentType, accept, optional) -List the associations of a LDAP Server - -This endpoint returns the _direct_ associations of this LDAP Server. A direct association can be a non-homogeneous relationship between 2 different objects, for example LDAP and Users. #### Sample Request ``` curl -X GET 'https://console.jumpcloud.com/api/v2/ldapservers/{LDAP_ID}/associations?targets=user_group \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **ldapserverId** | **string**| ObjectID of the LDAP Server. | - **targets** | [**[]string**](string.md)| | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ldapserverId** | **string**| ObjectID of the LDAP Server. | - **targets** | [**[]string**](string.md)| | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **limit** | **int32**| The number of records to return at once. Limited to 100. | [default to 10] - **skip** | **int32**| The offset into the records to return. | [default to 0] - **xOrgId** | **string**| | [default to ] - -### Return type - -[**[]GraphConnection**](GraphConnection.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **GraphLdapServerAssociationsPost** -> GraphLdapServerAssociationsPost(ctx, ldapserverId, contentType, accept, optional) -Manage the associations of a LDAP Server - -This endpoint allows you to manage the _direct_ associations of a LDAP Server. A direct association can be a non-homogeneous relationship between 2 different objects, for example LDAP and Users. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/ldapservers/{LDAP_ID}/associations \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"op\": \"add\", \"type\": \"user\", \"id\": \"{User_ID}\" }' ``` - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **ldapserverId** | **string**| ObjectID of the LDAP Server. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ldapserverId** | **string**| ObjectID of the LDAP Server. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **body** | [**GraphManagementReq**](GraphManagementReq.md)| | - **xOrgId** | **string**| | [default to ] - -### Return type - - (empty response body) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **GraphLdapServerTraverseUser** -> []GraphObjectWithPaths GraphLdapServerTraverseUser(ctx, ldapserverId, contentType, accept, optional) -List the Users bound to a LDAP Server - -This endpoint will return all Users bound to an LDAP Server, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this LDAP server instance to the corresponding User; this array represents all grouping and/or associations that would have to be removed to deprovision the User from this LDAP server instance. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/ldapservers/{LDAP_ID}/users \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **ldapserverId** | **string**| ObjectID of the LDAP Server. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ldapserverId** | **string**| ObjectID of the LDAP Server. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **limit** | **int32**| The number of records to return at once. Limited to 100. | [default to 10] - **xOrgId** | **string**| | [default to ] - **skip** | **int32**| The offset into the records to return. | [default to 0] - **filter** | [**[]string**](string.md)| Supported operators are: eq, ne, gt, ge, lt, le, between, search, in | - -### Return type - -[**[]GraphObjectWithPaths**](GraphObjectWithPaths.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **GraphLdapServerTraverseUserGroup** -> []GraphObjectWithPaths GraphLdapServerTraverseUserGroup(ctx, ldapserverId, contentType, accept, optional) -List the User Groups bound to a LDAP Server - -This endpoint will return all Users Groups bound to a LDAP Server, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the group's type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this LDAP server instance to the corresponding User Group; this array represents all grouping and/or associations that would have to be removed to deprovision the User Group from this LDAP server instance. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/ldapservers/{LDAP_ID}/usergroups \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **ldapserverId** | **string**| ObjectID of the LDAP Server. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ldapserverId** | **string**| ObjectID of the LDAP Server. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **limit** | **int32**| The number of records to return at once. Limited to 100. | [default to 10] - **xOrgId** | **string**| | [default to ] - **skip** | **int32**| The offset into the records to return. | [default to 0] - **filter** | [**[]string**](string.md)| Supported operators are: eq, ne, gt, ge, lt, le, between, search, in | - -### Return type - -[**[]GraphObjectWithPaths**](GraphObjectWithPaths.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **LdapserversGet** -> LdapServerOutput LdapserversGet(ctx, id, contentType, accept, optional) -Get LDAP Server - -This endpoint returns a specific LDAP server. ##### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/ldapservers/{LDAP_ID} \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **id** | **string**| Unique identifier of the LDAP server. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **id** | **string**| Unique identifier of the LDAP server. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **xOrgId** | **string**| | [default to ] - -### Return type - -[**LdapServerOutput**](ldap-server-output.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **LdapserversList** -> []LdapServerOutput LdapserversList(ctx, contentType, accept, optional) -List LDAP Servers - -This endpoint returns the object IDs of your LDAP servers. ##### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/ldapservers/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **fields** | [**[]string**](string.md)| The comma separated fields included in the returned records. If omitted, the default list of fields will be returned. | - **filter** | [**[]string**](string.md)| Supported operators are: eq, ne, gt, ge, lt, le, between, search, in | - **limit** | **int32**| The number of records to return at once. Limited to 100. | [default to 10] - **skip** | **int32**| The offset into the records to return. | [default to 0] - **sort** | [**[]string**](string.md)| The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. | - **xOrgId** | **string**| | [default to ] - -### Return type - -[**[]LdapServerOutput**](ldap-server-output.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **LdapserversPatch** -> InlineResponse200 LdapserversPatch(ctx, id, contentType, accept, optional) -Update existing LDAP server - -This endpoint allows updating some attributes of an LDAP server. Sample Request ``` curl -X PATCH https://console.jumpcloud.com/api/v2/ldapservers/{LDAP_ID} \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"userLockoutAction\": \"remove\", \"userPasswordExpirationAction\": \"disable\" }' ``` - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **id** | **string**| Unique identifier of the LDAP server. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **id** | **string**| Unique identifier of the LDAP server. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **body** | [**Body3**](Body3.md)| | - **xApiKey** | **string**| | - **xOrgId** | **string**| | - -### Return type - -[**InlineResponse200**](inline_response_200.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - diff --git a/v2/docs/LdapServerInput.md b/v2/docs/LdapServerInput.md deleted file mode 100644 index d158818..0000000 --- a/v2/docs/LdapServerInput.md +++ /dev/null @@ -1,12 +0,0 @@ -# LdapServerInput - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Name** | **string** | The name of this LDAP server | [optional] [default to null] -**UserLockoutAction** | **string** | action to take; one of 'remove' or 'disable' | [optional] [default to null] -**UserPasswordExpirationAction** | **string** | action to take; one of 'remove' or 'disable' | [optional] [default to null] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/v2/docs/LdapServerOutput.md b/v2/docs/LdapServerOutput.md deleted file mode 100644 index 2149b5d..0000000 --- a/v2/docs/LdapServerOutput.md +++ /dev/null @@ -1,13 +0,0 @@ -# LdapServerOutput - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Name** | **string** | The name of this LDAP server | [optional] [default to null] -**UserLockoutAction** | **string** | action to take; one of 'remove' or 'disable' | [optional] [default to null] -**UserPasswordExpirationAction** | **string** | action to take; one of 'remove' or 'disable' | [optional] [default to null] -**Id** | **string** | Unique identifier of this LDAP server | [default to null] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/v2/docs/Mfa.md b/v2/docs/Mfa.md deleted file mode 100644 index 3639ccc..0000000 --- a/v2/docs/Mfa.md +++ /dev/null @@ -1,12 +0,0 @@ -# Mfa - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Configured** | **bool** | | [optional] [default to null] -**Exclusion** | **bool** | | [optional] [default to null] -**ExclusionUntil** | [**time.Time**](time.Time.md) | | [optional] [default to null] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/v2/docs/Mobileconfig.md b/v2/docs/Mobileconfig.md deleted file mode 100644 index efd98a3..0000000 --- a/v2/docs/Mobileconfig.md +++ /dev/null @@ -1,9 +0,0 @@ -# Mobileconfig - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/v2/docs/ModelError.md b/v2/docs/ModelError.md deleted file mode 100644 index 42c766a..0000000 --- a/v2/docs/ModelError.md +++ /dev/null @@ -1,12 +0,0 @@ -# ModelError - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Code** | **int32** | | [optional] [default to null] -**Fields** | **string** | | [optional] [default to null] -**Message** | **string** | | [optional] [default to null] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/v2/docs/OauthCodeInput.md b/v2/docs/OauthCodeInput.md deleted file mode 100644 index 8d3c362..0000000 --- a/v2/docs/OauthCodeInput.md +++ /dev/null @@ -1,10 +0,0 @@ -# OauthCodeInput - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Code** | **string** | | [optional] [default to null] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/v2/docs/Office365Api.md b/v2/docs/Office365Api.md deleted file mode 100644 index 2431ba9..0000000 --- a/v2/docs/Office365Api.md +++ /dev/null @@ -1,339 +0,0 @@ -# \Office365Api - -All URIs are relative to *https://console.jumpcloud.com/api/v2* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**GraphOffice365AssociationsList**](Office365Api.md#GraphOffice365AssociationsList) | **Get** /office365s/{office365_id}/associations | List the associations of an Office 365 instance -[**GraphOffice365AssociationsPost**](Office365Api.md#GraphOffice365AssociationsPost) | **Post** /office365s/{office365_id}/associations | Manage the associations of an Office 365 instance -[**GraphOffice365TraverseUser**](Office365Api.md#GraphOffice365TraverseUser) | **Get** /office365s/{office365_id}/users | List the Users bound to an Office 365 instance -[**GraphOffice365TraverseUserGroup**](Office365Api.md#GraphOffice365TraverseUserGroup) | **Get** /office365s/{office365_id}/usergroups | List the User Groups bound to an Office 365 instance -[**TranslationRulesOffice365Delete**](Office365Api.md#TranslationRulesOffice365Delete) | **Delete** /office365s/{office365_id}/translationrules/{id} | Deletes a Office 365 translation rule -[**TranslationRulesOffice365Get**](Office365Api.md#TranslationRulesOffice365Get) | **Get** /office365s/{office365_id}/translationrules/{id} | Gets a specific Office 365 translation rule -[**TranslationRulesOffice365List**](Office365Api.md#TranslationRulesOffice365List) | **Get** /office365s/{office365_id}/translationrules | List all the Office 365 Translation Rules -[**TranslationRulesOffice365Post**](Office365Api.md#TranslationRulesOffice365Post) | **Post** /office365s/{office365_id}/translationrules | Create a new Office 365 Translation Rule - - -# **GraphOffice365AssociationsList** -> []GraphConnection GraphOffice365AssociationsList(ctx, office365Id, targets, contentType, accept, optional) -List the associations of an Office 365 instance - -This endpoint returns _direct_ associations of an Office 365 instance. A direct association can be a non-homogeneous relationship between 2 different objects, for example Office 365 and Users. #### Sample Request ``` curl -X GET 'https://console.jumpcloud.com/api/v2/office365s/{O365_ID}/associations?targets=user_group \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **office365Id** | **string**| ObjectID of the Office 365 instance. | - **targets** | [**[]string**](string.md)| | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **office365Id** | **string**| ObjectID of the Office 365 instance. | - **targets** | [**[]string**](string.md)| | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **limit** | **int32**| The number of records to return at once. Limited to 100. | [default to 10] - **skip** | **int32**| The offset into the records to return. | [default to 0] - **xOrgId** | **string**| | [default to ] - -### Return type - -[**[]GraphConnection**](GraphConnection.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **GraphOffice365AssociationsPost** -> GraphOffice365AssociationsPost(ctx, office365Id, contentType, accept, optional) -Manage the associations of an Office 365 instance - -This endpoint allows you to manage the _direct_ associations of a Office 365 instance. A direct association can be a non-homogeneous relationship between 2 different objects, for example Office 365 and Users. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/office365s/{O365_ID}/associations \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"op\": \"add\", \"type\": \"user_group\", \"id\": \"{Group_ID}\" }' ``` - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **office365Id** | **string**| ObjectID of the Office 365 instance. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **office365Id** | **string**| ObjectID of the Office 365 instance. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **body** | [**GraphManagementReq**](GraphManagementReq.md)| | - **xOrgId** | **string**| | [default to ] - -### Return type - - (empty response body) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **GraphOffice365TraverseUser** -> []GraphObjectWithPaths GraphOffice365TraverseUser(ctx, office365Id, contentType, accept, optional) -List the Users bound to an Office 365 instance - -This endpoint will return all Users bound to an Office 365 instance, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this Office 365 instance to the corresponding User; this array represents all grouping and/or associations that would have to be removed to deprovision the User from this Office 365 instance. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/office365s/{O365_ID}/users \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **office365Id** | **string**| ObjectID of the Office 365 suite. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **office365Id** | **string**| ObjectID of the Office 365 suite. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **limit** | **int32**| The number of records to return at once. Limited to 100. | [default to 10] - **xOrgId** | **string**| | [default to ] - **skip** | **int32**| The offset into the records to return. | [default to 0] - **filter** | [**[]string**](string.md)| Supported operators are: eq, ne, gt, ge, lt, le, between, search, in | - -### Return type - -[**[]GraphObjectWithPaths**](GraphObjectWithPaths.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **GraphOffice365TraverseUserGroup** -> []GraphObjectWithPaths GraphOffice365TraverseUserGroup(ctx, office365Id, contentType, accept, optional) -List the User Groups bound to an Office 365 instance - -This endpoint will return all Users Groups bound to an Office 365 instance, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the group's type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this Office 365 instance to the corresponding User Group; this array represents all grouping and/or associations that would have to be removed to deprovision the User Group from this Office 365 instance. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/office365s/{O365_ID/usergroups \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **office365Id** | **string**| ObjectID of the Office 365 suite. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **office365Id** | **string**| ObjectID of the Office 365 suite. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **limit** | **int32**| The number of records to return at once. Limited to 100. | [default to 10] - **xOrgId** | **string**| | [default to ] - **skip** | **int32**| The offset into the records to return. | [default to 0] - **filter** | [**[]string**](string.md)| Supported operators are: eq, ne, gt, ge, lt, le, between, search, in | - -### Return type - -[**[]GraphObjectWithPaths**](GraphObjectWithPaths.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **TranslationRulesOffice365Delete** -> TranslationRulesOffice365Delete(ctx, office365Id, id, contentType, accept) -Deletes a Office 365 translation rule - -This endpoint allows you to delete a translation rule for a specific Office 365 instance. These rules specify how JumpCloud attributes translate to [Microsoft Graph](https://developer.microsoft.com/en-us/graph) attributes. #### Sample Request ``` curl -X DELETE https://console.jumpcloud.com/api/v2/office365s/{office365_id}/translationrules/{id} \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **office365Id** | **string**| | - **id** | **string**| | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - -### Return type - - (empty response body) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **TranslationRulesOffice365Get** -> Office365TranslationRule TranslationRulesOffice365Get(ctx, office365Id, id, contentType, accept) -Gets a specific Office 365 translation rule - -This endpoint returns a specific translation rule for a specific Office 365 instance. These rules specify how JumpCloud attributes translate to [Microsoft Graph](https://developer.microsoft.com/en-us/graph) attributes. ###### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/office365s/{office365_id}/translationrules/{id} \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **office365Id** | **string**| | - **id** | **string**| | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - -### Return type - -[**Office365TranslationRule**](Office365TranslationRule.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **TranslationRulesOffice365List** -> []Office365TranslationRule TranslationRulesOffice365List(ctx, office365Id, contentType, accept, optional) -List all the Office 365 Translation Rules - -This endpoint returns all translation rules for a specific Office 365 instance. These rules specify how JumpCloud attributes translate to [Microsoft Graph](https://developer.microsoft.com/en-us/graph) attributes. ##### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/office365s/{office365_id}/translationrules \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **office365Id** | **string**| | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **office365Id** | **string**| | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **fields** | [**[]string**](string.md)| The comma separated fields included in the returned records. If omitted, the default list of fields will be returned. | - **filter** | [**[]string**](string.md)| Supported operators are: eq, ne, gt, ge, lt, le, between, search, in | - **limit** | **int32**| The number of records to return at once. Limited to 100. | [default to 10] - **skip** | **int32**| The offset into the records to return. | [default to 0] - **sort** | [**[]string**](string.md)| The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. | - -### Return type - -[**[]Office365TranslationRule**](Office365TranslationRule.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **TranslationRulesOffice365Post** -> Office365TranslationRule TranslationRulesOffice365Post(ctx, office365Id, contentType, accept, optional) -Create a new Office 365 Translation Rule - -This endpoint allows you to create a translation rule for a specific Office 365 instance. These rules specify how JumpCloud attributes translate to [Microsoft Graph](https://developer.microsoft.com/en-us/graph) attributes. ##### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/office365s/{office365_id}/translationrules \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ {Translation Rule Parameters} }' ``` - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **office365Id** | **string**| | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **office365Id** | **string**| | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **body** | [**Office365TranslationRuleRequest**](Office365TranslationRuleRequest.md)| | - -### Return type - -[**Office365TranslationRule**](Office365TranslationRule.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - diff --git a/v2/docs/OrgCryptoSettings.md b/v2/docs/OrgCryptoSettings.md deleted file mode 100644 index f7f3d89..0000000 --- a/v2/docs/OrgCryptoSettings.md +++ /dev/null @@ -1,10 +0,0 @@ -# OrgCryptoSettings - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**SshKeys** | [***OrgcryptosettingsSshKeys**](orgcryptosettings_sshKeys.md) | | [optional] [default to null] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/v2/docs/OrganizationsApi.md b/v2/docs/OrganizationsApi.md deleted file mode 100644 index 659ceb8..0000000 --- a/v2/docs/OrganizationsApi.md +++ /dev/null @@ -1,99 +0,0 @@ -# \OrganizationsApi - -All URIs are relative to *https://console.jumpcloud.com/api/v2* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**OrgCryptoGet**](OrganizationsApi.md#OrgCryptoGet) | **Get** /organizations/{id}/crypto | Get Crypto Settings -[**OrgCryptoPut**](OrganizationsApi.md#OrgCryptoPut) | **Put** /organizations/{id}/crypto | Edit Crypto Settings - - -# **OrgCryptoGet** -> OrgCryptoSettings OrgCryptoGet(ctx, id, contentType, accept, optional) -Get Crypto Settings - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **id** | **string**| | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **id** | **string**| | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **fields** | [**[]string**](string.md)| The comma separated fields included in the returned records. If omitted, the default list of fields will be returned. | - **filter** | [**[]string**](string.md)| Supported operators are: eq, ne, gt, ge, lt, le, between, search, in | - **xOrgId** | **string**| | [default to ] - **skip** | **int32**| The offset into the records to return. | [default to 0] - **sort** | [**[]string**](string.md)| The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. | - **limit** | **int32**| The number of records to return at once. Limited to 100. | [default to 10] - -### Return type - -[**OrgCryptoSettings**](org-crypto-settings.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **OrgCryptoPut** -> interface{} OrgCryptoPut(ctx, id, contentType, accept, optional) -Edit Crypto Settings - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **id** | **string**| | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **id** | **string**| | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **body** | [**OrgCryptoSettings**](OrgCryptoSettings.md)| | - **fields** | [**[]string**](string.md)| The comma separated fields included in the returned records. If omitted, the default list of fields will be returned. | - **filter** | [**[]string**](string.md)| Supported operators are: eq, ne, gt, ge, lt, le, between, search, in | - **xOrgId** | **string**| | [default to ] - **skip** | **int32**| The offset into the records to return. | [default to 0] - **sort** | [**[]string**](string.md)| The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. | - **limit** | **int32**| The number of records to return at once. Limited to 100. | [default to 10] - -### Return type - -[**interface{}**](interface{}.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - diff --git a/v2/docs/OrgcryptosettingsSshKeys.md b/v2/docs/OrgcryptosettingsSshKeys.md deleted file mode 100644 index 6b02e7f..0000000 --- a/v2/docs/OrgcryptosettingsSshKeys.md +++ /dev/null @@ -1,12 +0,0 @@ -# OrgcryptosettingsSshKeys - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**KeySize** | **int32** | | [optional] [default to null] -**Validate** | **bool** | | [optional] [default to null] -**ValidateKeySize** | **bool** | | [optional] [default to null] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/v2/docs/PoliciesApi.md b/v2/docs/PoliciesApi.md deleted file mode 100644 index 480975c..0000000 --- a/v2/docs/PoliciesApi.md +++ /dev/null @@ -1,711 +0,0 @@ -# \PoliciesApi - -All URIs are relative to *https://console.jumpcloud.com/api/v2* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**GraphPolicyAssociationsList**](PoliciesApi.md#GraphPolicyAssociationsList) | **Get** /policies/{policy_id}/associations | List the associations of a Policy -[**GraphPolicyAssociationsPost**](PoliciesApi.md#GraphPolicyAssociationsPost) | **Post** /policies/{policy_id}/associations | Manage the associations of a Policy -[**GraphPolicyTraverseSystem**](PoliciesApi.md#GraphPolicyTraverseSystem) | **Get** /policies/{policy_id}/systems | List the Systems bound to a Policy -[**GraphPolicyTraverseSystemGroup**](PoliciesApi.md#GraphPolicyTraverseSystemGroup) | **Get** /policies/{policy_id}/systemgroups | List the System Groups bound to a Policy -[**PoliciesDelete**](PoliciesApi.md#PoliciesDelete) | **Delete** /policies/{id} | Deletes a Policy -[**PoliciesGet**](PoliciesApi.md#PoliciesGet) | **Get** /policies/{id} | Gets a specific Policy. -[**PoliciesList**](PoliciesApi.md#PoliciesList) | **Get** /policies | Lists all the Policies -[**PoliciesPost**](PoliciesApi.md#PoliciesPost) | **Post** /policies | Create a new Policy -[**PoliciesPut**](PoliciesApi.md#PoliciesPut) | **Put** /policies/{id} | Update an existing Policy -[**PolicyresultsGet**](PoliciesApi.md#PolicyresultsGet) | **Get** /policyresults/{id} | Get a specific Policy Result. -[**PolicyresultsList**](PoliciesApi.md#PolicyresultsList) | **Get** /policies/{policy_id}/policyresults | Lists all the policy results of a policy. -[**PolicyresultsOrgList**](PoliciesApi.md#PolicyresultsOrgList) | **Get** /policyresults | Lists all the policy results for an organization. -[**PolicystatusesList**](PoliciesApi.md#PolicystatusesList) | **Get** /policies/{policy_id}/policystatuses | Lists the latest policy results of a policy. -[**PolicystatusesList_0**](PoliciesApi.md#PolicystatusesList_0) | **Get** /systems/{system_id}/policystatuses | List the policy statuses for a system -[**PolicytemplatesGet**](PoliciesApi.md#PolicytemplatesGet) | **Get** /policytemplates/{id} | Get a specific Policy Template -[**PolicytemplatesList**](PoliciesApi.md#PolicytemplatesList) | **Get** /policytemplates | Lists all of the Policy Templates - - -# **GraphPolicyAssociationsList** -> []GraphConnection GraphPolicyAssociationsList(ctx, policyId, targets, contentType, accept, optional) -List the associations of a Policy - -This endpoint returns the _direct_ associations of a Policy. A direct association can be a non-homogeneous relationship between 2 different objects, for example Policies and Systems. #### Sample Request ``` curl -X GET 'https://console.jumpcloud.com/api/v2/policies/{Policy_ID}/associations?targets=system_group \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **policyId** | **string**| ObjectID of the Policy. | - **targets** | [**[]string**](string.md)| | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **policyId** | **string**| ObjectID of the Policy. | - **targets** | [**[]string**](string.md)| | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **limit** | **int32**| The number of records to return at once. Limited to 100. | [default to 10] - **skip** | **int32**| The offset into the records to return. | [default to 0] - **xOrgId** | **string**| | [default to ] - -### Return type - -[**[]GraphConnection**](GraphConnection.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **GraphPolicyAssociationsPost** -> GraphPolicyAssociationsPost(ctx, policyId, contentType, accept, optional) -Manage the associations of a Policy - -This endpoint allows you to manage the _direct_ associations of a Policy. A direct association can be a non-homogeneous relationship between 2 different objects, for example Policies and Systems. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/policies/{Policy_ID}/associations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"op\": \"add\", \"type\": \"system_group\", \"id\": \"{Group_ID}\" }' ``` - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **policyId** | **string**| ObjectID of the Policy. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **policyId** | **string**| ObjectID of the Policy. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **body** | [**GraphManagementReq**](GraphManagementReq.md)| | - **xOrgId** | **string**| | [default to ] - -### Return type - - (empty response body) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **GraphPolicyTraverseSystem** -> []GraphObjectWithPaths GraphPolicyTraverseSystem(ctx, policyId, contentType, accept, optional) -List the Systems bound to a Policy - -This endpoint will return all Systems bound to a Policy, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this Policy to the corresponding System; this array represents all grouping and/or associations that would have to be removed to deprovision the System from this Policy. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/policies/{Policy_ID}/systems \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **policyId** | **string**| ObjectID of the Command. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **policyId** | **string**| ObjectID of the Command. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **limit** | **int32**| The number of records to return at once. Limited to 100. | [default to 10] - **xOrgId** | **string**| | [default to ] - **skip** | **int32**| The offset into the records to return. | [default to 0] - **filter** | [**[]string**](string.md)| Supported operators are: eq, ne, gt, ge, lt, le, between, search, in | - -### Return type - -[**[]GraphObjectWithPaths**](GraphObjectWithPaths.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **GraphPolicyTraverseSystemGroup** -> []GraphObjectWithPaths GraphPolicyTraverseSystemGroup(ctx, policyId, contentType, accept, optional) -List the System Groups bound to a Policy - -This endpoint will return all Systems Groups bound to a Policy, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the group's type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this Policy to the corresponding System Group; this array represents all grouping and/or associations that would have to be removed to deprovision the System Group from this Policy. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/policies/{Policy_ID}/systemgroups \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **policyId** | **string**| ObjectID of the Command. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **policyId** | **string**| ObjectID of the Command. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **limit** | **int32**| The number of records to return at once. Limited to 100. | [default to 10] - **xOrgId** | **string**| | [default to ] - **skip** | **int32**| The offset into the records to return. | [default to 0] - **filter** | [**[]string**](string.md)| Supported operators are: eq, ne, gt, ge, lt, le, between, search, in | - -### Return type - -[**[]GraphObjectWithPaths**](GraphObjectWithPaths.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **PoliciesDelete** -> PoliciesDelete(ctx, id, contentType, accept, optional) -Deletes a Policy - -This endpoint allows you to delete a policy. #### Sample Request ``` curl -X DELETE https://console.jumpcloud.com/api/v2/policies/5a837ecd232e110d4291e6b9 \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **id** | **string**| ObjectID of the Policy object. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **id** | **string**| ObjectID of the Policy object. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **xOrgId** | **string**| | [default to ] - -### Return type - - (empty response body) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **PoliciesGet** -> PolicyWithDetails PoliciesGet(ctx, id, contentType, accept, optional) -Gets a specific Policy. - -This endpoint returns a specific policy. ###### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/policies/{PolicyID} \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **id** | **string**| ObjectID of the Policy object. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **id** | **string**| ObjectID of the Policy object. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **xOrgId** | **string**| | [default to ] - -### Return type - -[**PolicyWithDetails**](PolicyWithDetails.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **PoliciesList** -> []Policy PoliciesList(ctx, contentType, accept, optional) -Lists all the Policies - -This endpoint returns all policies. ##### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/policies \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **fields** | [**[]string**](string.md)| The comma separated fields included in the returned records. If omitted, the default list of fields will be returned. | - **filter** | [**[]string**](string.md)| Supported operators are: eq, ne, gt, ge, lt, le, between, search, in | - **limit** | **int32**| The number of records to return at once. Limited to 100. | [default to 10] - **skip** | **int32**| The offset into the records to return. | [default to 0] - **sort** | [**[]string**](string.md)| The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. | - **xOrgId** | **string**| | [default to ] - -### Return type - -[**[]Policy**](Policy.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **PoliciesPost** -> PolicyWithDetails PoliciesPost(ctx, contentType, accept, optional) -Create a new Policy - -This endpoint allows you to create a policy. Given the amount of configurable parameters required to create a Policy, we suggest you use the JumpCloud Admin Console to create new policies. ##### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/policies \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ {Policy_Parameters} }' ``` - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **body** | [**PolicyRequest**](PolicyRequest.md)| | - **xOrgId** | **string**| | [default to ] - -### Return type - -[**PolicyWithDetails**](PolicyWithDetails.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **PoliciesPut** -> Policy PoliciesPut(ctx, id, optional) -Update an existing Policy - -This endpoint allows you to update a policy. Given the amount of configurable parameters required to update a Policy, we suggest you use the JumpCloud Admin Console to create new policies. ##### Sample Request ``` curl -X PUT https://console.jumpcloud.com/api/v2/policies/59fced45c9118022172547ff \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY' \\ -d '{ {Policy_Parameters} }' ``` - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **id** | **string**| ObjectID of the Policy object. | - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **id** | **string**| ObjectID of the Policy object. | - **body** | [**PolicyRequest**](PolicyRequest.md)| | - **xOrgId** | **string**| | [default to ] - -### Return type - -[**Policy**](Policy.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **PolicyresultsGet** -> PolicyResult PolicyresultsGet(ctx, id, contentType, accept, optional) -Get a specific Policy Result. - -This endpoint will return the policy results for a specific policy. ##### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/policyresults/{Policy_ID} \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **id** | **string**| ObjectID of the Policy Result. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **id** | **string**| ObjectID of the Policy Result. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **xOrgId** | **string**| | [default to ] - -### Return type - -[**PolicyResult**](PolicyResult.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **PolicyresultsList** -> []PolicyResult PolicyresultsList(ctx, policyId, contentType, accept, optional) -Lists all the policy results of a policy. - -This endpoint returns all policies results for a specific policy. ##### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/policies/{Policy_ID}/policyresults \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **policyId** | **string**| | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **policyId** | **string**| | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **fields** | [**[]string**](string.md)| The comma separated fields included in the returned records. If omitted, the default list of fields will be returned. | - **filter** | [**[]string**](string.md)| Supported operators are: eq, ne, gt, ge, lt, le, between, search, in | - **limit** | **int32**| The number of records to return at once. Limited to 100. | [default to 10] - **xOrgId** | **string**| | [default to ] - **skip** | **int32**| The offset into the records to return. | [default to 0] - **sort** | [**[]string**](string.md)| The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. | - -### Return type - -[**[]PolicyResult**](PolicyResult.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **PolicyresultsOrgList** -> []PolicyResult PolicyresultsOrgList(ctx, contentType, accept, optional) -Lists all the policy results for an organization. - -This endpoint returns all policies results for an organization. ##### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/policyresults \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **fields** | [**[]string**](string.md)| The comma separated fields included in the returned records. If omitted, the default list of fields will be returned. | - **filter** | [**[]string**](string.md)| Supported operators are: eq, ne, gt, ge, lt, le, between, search, in | - **limit** | **int32**| The number of records to return at once. Limited to 100. | [default to 10] - **xOrgId** | **string**| | [default to ] - **skip** | **int32**| The offset into the records to return. | [default to 0] - **sort** | [**[]string**](string.md)| The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. | - -### Return type - -[**[]PolicyResult**](PolicyResult.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **PolicystatusesList** -> []PolicyResult PolicystatusesList(ctx, policyId, contentType, accept, optional) -Lists the latest policy results of a policy. - -This endpoint returns the latest policies results for a specific policy. ##### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/policies/{Policy_ID}/policystatuses \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **policyId** | **string**| | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **policyId** | **string**| | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **fields** | [**[]string**](string.md)| The comma separated fields included in the returned records. If omitted, the default list of fields will be returned. | - **filter** | [**[]string**](string.md)| Supported operators are: eq, ne, gt, ge, lt, le, between, search, in | - **limit** | **int32**| The number of records to return at once. Limited to 100. | [default to 10] - **skip** | **int32**| The offset into the records to return. | [default to 0] - **sort** | [**[]string**](string.md)| The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. | - **xOrgId** | **string**| | [default to ] - -### Return type - -[**[]PolicyResult**](PolicyResult.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **PolicystatusesList_0** -> []PolicyResult PolicystatusesList_0(ctx, systemId, contentType, accept, optional) -List the policy statuses for a system - -This endpoint returns the policy results for a particular system. ##### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/systems/{System_ID}/policystatuses \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **systemId** | **string**| ObjectID of the System. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **systemId** | **string**| ObjectID of the System. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **fields** | [**[]string**](string.md)| The comma separated fields included in the returned records. If omitted, the default list of fields will be returned. | - **filter** | [**[]string**](string.md)| Supported operators are: eq, ne, gt, ge, lt, le, between, search, in | - **limit** | **int32**| The number of records to return at once. Limited to 100. | [default to 10] - **skip** | **int32**| The offset into the records to return. | [default to 0] - **sort** | [**[]string**](string.md)| The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. | - **xOrgId** | **string**| | [default to ] - -### Return type - -[**[]PolicyResult**](PolicyResult.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **PolicytemplatesGet** -> PolicyTemplateWithDetails PolicytemplatesGet(ctx, id, contentType, accept, optional) -Get a specific Policy Template - -This endpoint returns a specific policy template. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/policies/{Policy_ID}\\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **id** | **string**| ObjectID of the Policy Template. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **id** | **string**| ObjectID of the Policy Template. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **xOrgId** | **string**| | [default to ] - -### Return type - -[**PolicyTemplateWithDetails**](PolicyTemplateWithDetails.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **PolicytemplatesList** -> []PolicyTemplate PolicytemplatesList(ctx, contentType, accept, optional) -Lists all of the Policy Templates - -This endpoint returns all policy templates. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/policytemplates \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **fields** | [**[]string**](string.md)| The comma separated fields included in the returned records. If omitted, the default list of fields will be returned. | - **filter** | [**[]string**](string.md)| Supported operators are: eq, ne, gt, ge, lt, le, between, search, in | - **limit** | **int32**| The number of records to return at once. Limited to 100. | [default to 10] - **skip** | **int32**| The offset into the records to return. | [default to 0] - **sort** | [**[]string**](string.md)| The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. | - **xOrgId** | **string**| | [default to ] - -### Return type - -[**[]PolicyTemplate**](PolicyTemplate.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - diff --git a/v2/docs/PolicyTemplate.md b/v2/docs/PolicyTemplate.md deleted file mode 100644 index 14d26e6..0000000 --- a/v2/docs/PolicyTemplate.md +++ /dev/null @@ -1,17 +0,0 @@ -# PolicyTemplate - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Activation** | **string** | Requirements before the policy can be activated. | [optional] [default to null] -**Behavior** | **string** | Specifics about the behavior of the policy. | [optional] [default to null] -**Description** | **string** | The default description for the Policy. | [optional] [default to null] -**DisplayName** | **string** | The default display name for the Policy. | [optional] [default to null] -**Id** | **string** | ObjectId uniquely identifying a Policy Template. | [optional] [default to null] -**Name** | **string** | The unique name for the Policy Template. | [optional] [default to null] -**OsMetaFamily** | **string** | | [optional] [default to null] -**State** | **string** | String describing the release status of the policy template. | [optional] [default to null] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/v2/docs/PolicyTemplateConfigField.md b/v2/docs/PolicyTemplateConfigField.md deleted file mode 100644 index a651f30..0000000 --- a/v2/docs/PolicyTemplateConfigField.md +++ /dev/null @@ -1,17 +0,0 @@ -# PolicyTemplateConfigField - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**DisplayType** | **string** | The default rendering for this field. | [optional] [default to null] -**Id** | **string** | ObjectId uniquely identifying a Policy Template Configuration Field | [default to null] -**Label** | **string** | The default label for this field. | [optional] [default to null] -**Name** | **string** | A unique name identifying this config field. | [default to null] -**Position** | **float32** | The default position to render this field. | [optional] [default to null] -**ReadOnly** | **bool** | If an admin is allowed to modify this field. | [optional] [default to null] -**Required** | **bool** | If this field is required for this field. | [optional] [default to null] -**Tooltip** | [***PolicyTemplateConfigFieldTooltip**](PolicyTemplateConfigField_tooltip.md) | | [optional] [default to null] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/v2/docs/PolicyValue.md b/v2/docs/PolicyValue.md deleted file mode 100644 index ed2b823..0000000 --- a/v2/docs/PolicyValue.md +++ /dev/null @@ -1,10 +0,0 @@ -# PolicyValue - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**ConfigFieldID** | **string** | The ObjectId of the corresponding Policy Template configuration field. | [optional] [default to null] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/v2/docs/PolicytemplatesApi.md b/v2/docs/PolicytemplatesApi.md deleted file mode 100644 index a751d69..0000000 --- a/v2/docs/PolicytemplatesApi.md +++ /dev/null @@ -1,95 +0,0 @@ -# \PolicytemplatesApi - -All URIs are relative to *https://console.jumpcloud.com/api/v2* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**PolicytemplatesGet**](PolicytemplatesApi.md#PolicytemplatesGet) | **Get** /policytemplates/{id} | Get a specific Policy Template -[**PolicytemplatesList**](PolicytemplatesApi.md#PolicytemplatesList) | **Get** /policytemplates | Lists all of the Policy Templates - - -# **PolicytemplatesGet** -> PolicyTemplateWithDetails PolicytemplatesGet(ctx, id, contentType, accept, optional) -Get a specific Policy Template - -This endpoint returns a specific policy template. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/policies/{Policy_ID}\\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **id** | **string**| ObjectID of the Policy Template. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **id** | **string**| ObjectID of the Policy Template. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **xOrgId** | **string**| | [default to ] - -### Return type - -[**PolicyTemplateWithDetails**](PolicyTemplateWithDetails.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **PolicytemplatesList** -> []PolicyTemplate PolicytemplatesList(ctx, contentType, accept, optional) -Lists all of the Policy Templates - -This endpoint returns all policy templates. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/policytemplates \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **fields** | [**[]string**](string.md)| The comma separated fields included in the returned records. If omitted, the default list of fields will be returned. | - **filter** | [**[]string**](string.md)| Supported operators are: eq, ne, gt, ge, lt, le, between, search, in | - **limit** | **int32**| The number of records to return at once. Limited to 100. | [default to 10] - **skip** | **int32**| The offset into the records to return. | [default to 0] - **sort** | [**[]string**](string.md)| The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. | - **xOrgId** | **string**| | [default to ] - -### Return type - -[**[]PolicyTemplate**](PolicyTemplate.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - diff --git a/v2/docs/Provider.md b/v2/docs/Provider.md deleted file mode 100644 index 168e059..0000000 --- a/v2/docs/Provider.md +++ /dev/null @@ -1,11 +0,0 @@ -# Provider - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Contact** | [***ProviderContact**](Provider_contact.md) | | [optional] [default to null] -**Name** | **string** | | [optional] [default to null] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/v2/docs/ProviderAdminReq.md b/v2/docs/ProviderAdminReq.md deleted file mode 100644 index 01bc56d..0000000 --- a/v2/docs/ProviderAdminReq.md +++ /dev/null @@ -1,13 +0,0 @@ -# ProviderAdminReq - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Email** | **string** | | [default to null] -**EnableMultiFactor** | **bool** | | [optional] [default to null] -**Firstname** | **string** | | [optional] [default to null] -**Lastname** | **string** | | [optional] [default to null] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/v2/docs/ProviderContact.md b/v2/docs/ProviderContact.md deleted file mode 100644 index 67e8498..0000000 --- a/v2/docs/ProviderContact.md +++ /dev/null @@ -1,11 +0,0 @@ -# ProviderContact - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Email** | **string** | | [optional] [default to null] -**Name** | **string** | | [optional] [default to null] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/v2/docs/ProvidersApi.md b/v2/docs/ProvidersApi.md deleted file mode 100644 index 046e4e7..0000000 --- a/v2/docs/ProvidersApi.md +++ /dev/null @@ -1,96 +0,0 @@ -# \ProvidersApi - -All URIs are relative to *https://console.jumpcloud.com/api/v2* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**ProvidersListAdministrators**](ProvidersApi.md#ProvidersListAdministrators) | **Get** /providers/{provider_id}/administrators | List Provider Administrators -[**ProvidersPostAdmins**](ProvidersApi.md#ProvidersPostAdmins) | **Post** /providers/{provider_id}/administrators | Create a new Provider Administrator - - -# **ProvidersListAdministrators** -> InlineResponse2001 ProvidersListAdministrators(ctx, providerId, contentType, accept, optional) -List Provider Administrators - -This endpoint returns a list of the Administrators associated with the Provider. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/providers/{ProviderID}/administrators \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **providerId** | **string**| | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **providerId** | **string**| | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **fields** | [**[]string**](string.md)| The comma separated fields included in the returned records. If omitted, the default list of fields will be returned. | - **filter** | [**[]string**](string.md)| Supported operators are: eq, ne, gt, ge, lt, le, between, search, in | - **limit** | **int32**| The number of records to return at once. Limited to 100. | [default to 10] - **skip** | **int32**| The offset into the records to return. | [default to 0] - **sort** | [**[]string**](string.md)| The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. | - -### Return type - -[**InlineResponse2001**](inline_response_200_1.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **ProvidersPostAdmins** -> Administrator ProvidersPostAdmins(ctx, providerId, contentType, accept, optional) -Create a new Provider Administrator - -This endpoint allows you to create a provider administrator. You must be associated to the provider to use this route. **Sample Request** ``` curl -X POST https://console.jumpcloud.com/api/v2/providers/{ProviderID}/administrators \\ -H 'Accept: application/json' \\ -H 'Context-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"email\":\"{ADMIN_EMAIL}\" }' ``` - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **providerId** | **string**| | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **providerId** | **string**| | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **body** | [**ProviderAdminReq**](ProviderAdminReq.md)| | - -### Return type - -[**Administrator**](Administrator.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - diff --git a/v2/docs/RADIUSServersApi.md b/v2/docs/RADIUSServersApi.md deleted file mode 100644 index 68bc25e..0000000 --- a/v2/docs/RADIUSServersApi.md +++ /dev/null @@ -1,187 +0,0 @@ -# \RADIUSServersApi - -All URIs are relative to *https://console.jumpcloud.com/api/v2* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**GraphRadiusServerAssociationsList**](RADIUSServersApi.md#GraphRadiusServerAssociationsList) | **Get** /radiusservers/{radiusserver_id}/associations | List the associations of a RADIUS Server -[**GraphRadiusServerAssociationsPost**](RADIUSServersApi.md#GraphRadiusServerAssociationsPost) | **Post** /radiusservers/{radiusserver_id}/associations | Manage the associations of a RADIUS Server -[**GraphRadiusServerTraverseUser**](RADIUSServersApi.md#GraphRadiusServerTraverseUser) | **Get** /radiusservers/{radiusserver_id}/users | List the Users bound to a RADIUS Server -[**GraphRadiusServerTraverseUserGroup**](RADIUSServersApi.md#GraphRadiusServerTraverseUserGroup) | **Get** /radiusservers/{radiusserver_id}/usergroups | List the User Groups bound to a RADIUS Server - - -# **GraphRadiusServerAssociationsList** -> []GraphConnection GraphRadiusServerAssociationsList(ctx, radiusserverId, targets, contentType, accept, optional) -List the associations of a RADIUS Server - -This endpoint returns the _direct_ associations of a Radius Server. A direct association can be a non-homogeneous relationship between 2 different objects, for example Radius Servers and Users. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/radiusservers/{RADIUS_ID}/associations?targets=user_group \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **radiusserverId** | **string**| ObjectID of the Radius Server. | - **targets** | [**[]string**](string.md)| | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **radiusserverId** | **string**| ObjectID of the Radius Server. | - **targets** | [**[]string**](string.md)| | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **limit** | **int32**| The number of records to return at once. Limited to 100. | [default to 10] - **skip** | **int32**| The offset into the records to return. | [default to 0] - **xOrgId** | **string**| | [default to ] - -### Return type - -[**[]GraphConnection**](GraphConnection.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **GraphRadiusServerAssociationsPost** -> GraphRadiusServerAssociationsPost(ctx, radiusserverId, contentType, accept, optional) -Manage the associations of a RADIUS Server - -This endpoint allows you to manage the _direct_ associations of a Radius Server. A direct association can be a non-homogeneous relationship between 2 different objects, for example Radius Servers and Users. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/radiusservers/{RADIUS_ID}/associations \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"type\":\"user\", \"id\":\"{USER_ID}\", \"op\":\"add\" }' ``` - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **radiusserverId** | **string**| ObjectID of the Radius Server. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **radiusserverId** | **string**| ObjectID of the Radius Server. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **body** | [**GraphManagementReq**](GraphManagementReq.md)| | - **xOrgId** | **string**| | [default to ] - -### Return type - - (empty response body) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **GraphRadiusServerTraverseUser** -> []GraphObjectWithPaths GraphRadiusServerTraverseUser(ctx, radiusserverId, contentType, accept, optional) -List the Users bound to a RADIUS Server - -This endpoint will return all Users bound to a RADIUS Server, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this RADIUS server instance to the corresponding User; this array represents all grouping and/or associations that would have to be removed to deprovision the User from this RADIUS server instance. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/ldapservers/{LDAP_ID}/users \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **radiusserverId** | **string**| ObjectID of the Radius Server. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **radiusserverId** | **string**| ObjectID of the Radius Server. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **limit** | **int32**| The number of records to return at once. Limited to 100. | [default to 10] - **xOrgId** | **string**| | [default to ] - **skip** | **int32**| The offset into the records to return. | [default to 0] - **filter** | [**[]string**](string.md)| Supported operators are: eq, ne, gt, ge, lt, le, between, search, in | - -### Return type - -[**[]GraphObjectWithPaths**](GraphObjectWithPaths.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **GraphRadiusServerTraverseUserGroup** -> []GraphObjectWithPaths GraphRadiusServerTraverseUserGroup(ctx, radiusserverId, contentType, accept, optional) -List the User Groups bound to a RADIUS Server - -This endpoint will return all Users Groups bound to a RADIUS Server, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the group's type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this RADIUS server instance to the corresponding User Group; this array represents all grouping and/or associations that would have to be removed to deprovision the User Group from this RADIUS server instance. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/radiusservers/{RADIUS_ID}/usergroups \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **radiusserverId** | **string**| ObjectID of the Radius Server. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **radiusserverId** | **string**| ObjectID of the Radius Server. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **limit** | **int32**| The number of records to return at once. Limited to 100. | [default to 10] - **xOrgId** | **string**| | [default to ] - **skip** | **int32**| The offset into the records to return. | [default to 0] - **filter** | [**[]string**](string.md)| Supported operators are: eq, ne, gt, ge, lt, le, between, search, in | - -### Return type - -[**[]GraphObjectWithPaths**](GraphObjectWithPaths.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - diff --git a/v2/docs/SalesforceKnowledgeListOutput.md b/v2/docs/SalesforceKnowledgeListOutput.md deleted file mode 100644 index cb6a426..0000000 --- a/v2/docs/SalesforceKnowledgeListOutput.md +++ /dev/null @@ -1,9 +0,0 @@ -# SalesforceKnowledgeListOutput - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/v2/docs/SalesforceknowledgelistoutputInner.md b/v2/docs/SalesforceknowledgelistoutputInner.md deleted file mode 100644 index 0fc2a26..0000000 --- a/v2/docs/SalesforceknowledgelistoutputInner.md +++ /dev/null @@ -1,10 +0,0 @@ -# SalesforceknowledgelistoutputInner - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Id** | **string** | | [optional] [default to null] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/v2/docs/SambaDomainOutput.md b/v2/docs/SambaDomainOutput.md deleted file mode 100644 index d4d4bab..0000000 --- a/v2/docs/SambaDomainOutput.md +++ /dev/null @@ -1,12 +0,0 @@ -# SambaDomainOutput - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Name** | **string** | Name of this domain's WorkGroup | [default to null] -**Sid** | **string** | Security identifier of this domain | [default to null] -**Id** | **string** | Unique identifier of this domain | [default to null] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/v2/docs/SambaDomainsApi.md b/v2/docs/SambaDomainsApi.md deleted file mode 100644 index 6777850..0000000 --- a/v2/docs/SambaDomainsApi.md +++ /dev/null @@ -1,221 +0,0 @@ -# \SambaDomainsApi - -All URIs are relative to *https://console.jumpcloud.com/api/v2* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**LdapserversSambaDomainsDelete**](SambaDomainsApi.md#LdapserversSambaDomainsDelete) | **Delete** /ldapservers/{ldapserver_id}/sambadomains/{id} | Delete Samba Domain -[**LdapserversSambaDomainsGet**](SambaDomainsApi.md#LdapserversSambaDomainsGet) | **Get** /ldapservers/{ldapserver_id}/sambadomains/{id} | Get Samba Domain -[**LdapserversSambaDomainsList**](SambaDomainsApi.md#LdapserversSambaDomainsList) | **Get** /ldapservers/{ldapserver_id}/sambadomains | List Samba Domains -[**LdapserversSambaDomainsPost**](SambaDomainsApi.md#LdapserversSambaDomainsPost) | **Post** /ldapservers/{ldapserver_id}/sambadomains | Create Samba Domain -[**LdapserversSambaDomainsPut**](SambaDomainsApi.md#LdapserversSambaDomainsPut) | **Put** /ldapservers/{ldapserver_id}/sambadomains/{id} | Update Samba Domain - - -# **LdapserversSambaDomainsDelete** -> string LdapserversSambaDomainsDelete(ctx, ldapserverId, id, optional) -Delete Samba Domain - -This endpoint allows you to delete a samba domain from an LDAP server. ##### Sample Request ``` curl -X DELETE https://console.jumpcloud.com/api/v2/ldapservers/{LDAP_ID}/sambadomains/{SAMBA_ID} \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **ldapserverId** | **string**| Unique identifier of the LDAP server. | - **id** | **string**| Unique identifier of the samba domain. | - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ldapserverId** | **string**| Unique identifier of the LDAP server. | - **id** | **string**| Unique identifier of the samba domain. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **xOrgId** | **string**| | [default to ] - -### Return type - -**string** - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **LdapserversSambaDomainsGet** -> SambaDomainOutput LdapserversSambaDomainsGet(ctx, ldapserverId, id, optional) -Get Samba Domain - -This endpoint returns a specific samba domain for an LDAP server. ##### Sample Request ``` curl -X GET \\ https://console.jumpcloud.com/api/v2/ldapservers/ldapservers/{LDAP_ID}/sambadomains/{SAMBA_ID} \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **ldapserverId** | **string**| Unique identifier of the LDAP server. | - **id** | **string**| Unique identifier of the samba domain. | - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ldapserverId** | **string**| Unique identifier of the LDAP server. | - **id** | **string**| Unique identifier of the samba domain. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **xOrgId** | **string**| | [default to ] - -### Return type - -[**SambaDomainOutput**](samba-domain-output.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **LdapserversSambaDomainsList** -> []SambaDomainOutput LdapserversSambaDomainsList(ctx, ldapserverId, optional) -List Samba Domains - -This endpoint returns all samba domains for an LDAP server. ##### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/ldapservers/{LDAP_ID}/sambadomains \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **ldapserverId** | **string**| Unique identifier of the LDAP server. | - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ldapserverId** | **string**| Unique identifier of the LDAP server. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **fields** | [**[]string**](string.md)| The comma separated fields included in the returned records. If omitted, the default list of fields will be returned. | - **filter** | [**[]string**](string.md)| Supported operators are: eq, ne, gt, ge, lt, le, between, search, in | - **limit** | **int32**| The number of records to return at once. Limited to 100. | [default to 10] - **skip** | **int32**| The offset into the records to return. | [default to 0] - **sort** | [**[]string**](string.md)| The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. | - **xOrgId** | **string**| | [default to ] - -### Return type - -[**[]SambaDomainOutput**](samba-domain-output.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **LdapserversSambaDomainsPost** -> SambaDomainOutput LdapserversSambaDomainsPost(ctx, ldapserverId, optional) -Create Samba Domain - -This endpoint allows you to create a samba domain for an LDAP server. ##### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/ldapservers/{LDAP_ID}/sambadomains \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"sid\":\"{SID_ID}\", \"name\":\"{WORKGROUP_NAME}\" }' ``` - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **ldapserverId** | **string**| Unique identifier of the LDAP server. | - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ldapserverId** | **string**| Unique identifier of the LDAP server. | - **body** | [**SambaDomainInput**](SambaDomainInput.md)| | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **xOrgId** | **string**| | [default to ] - -### Return type - -[**SambaDomainOutput**](samba-domain-output.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **LdapserversSambaDomainsPut** -> SambaDomainOutput LdapserversSambaDomainsPut(ctx, ldapserverId, id, optional) -Update Samba Domain - -This endpoint allows you to update the samba domain information for an LDAP server. ##### Sample Request ``` curl -X PUT https://console.jumpcloud.com/api/v2/ldapservers/{LDAP_ID}/sambadomains/{SAMBA_ID} \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"sid\":\"{SID_ID}\", \"name\":\"{WORKGROUP_NAME}\" }' ``` - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **ldapserverId** | **string**| Unique identifier of the LDAP server. | - **id** | **string**| Unique identifier of the samba domain. | - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ldapserverId** | **string**| Unique identifier of the LDAP server. | - **id** | **string**| Unique identifier of the samba domain. | - **body** | [**SambaDomainInput**](SambaDomainInput.md)| | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **xOrgId** | **string**| | [default to ] - -### Return type - -[**SambaDomainOutput**](samba-domain-output.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - diff --git a/v2/docs/Sshkeylist.md b/v2/docs/Sshkeylist.md deleted file mode 100644 index 34fc467..0000000 --- a/v2/docs/Sshkeylist.md +++ /dev/null @@ -1,13 +0,0 @@ -# Sshkeylist - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Id** | **string** | The ID of the SSH key. | [optional] [default to null] -**CreateDate** | **string** | The date the SSH key was created. | [optional] [default to null] -**Name** | **string** | The name of the SSH key. | [optional] [default to null] -**PublicKey** | **string** | The Public SSH key. | [optional] [default to null] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/v2/docs/SystemGraphManagementReq.md b/v2/docs/SystemGraphManagementReq.md deleted file mode 100644 index 8c22252..0000000 --- a/v2/docs/SystemGraphManagementReq.md +++ /dev/null @@ -1,13 +0,0 @@ -# SystemGraphManagementReq - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Attributes** | [***SystemGraphManagementReqAttributes**](SystemGraphManagementReq_attributes.md) | | [optional] [default to null] -**Id** | **string** | The ObjectID of graph object being added or removed as an association. | [default to null] -**Op** | **string** | How to modify the graph connection. | [default to null] -**Type_** | **string** | | [default to null] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/v2/docs/SystemGraphManagementReqAttributes.md b/v2/docs/SystemGraphManagementReqAttributes.md deleted file mode 100644 index 2d8cd56..0000000 --- a/v2/docs/SystemGraphManagementReqAttributes.md +++ /dev/null @@ -1,10 +0,0 @@ -# SystemGraphManagementReqAttributes - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Sudo** | [***SystemGraphManagementReqAttributesSudo**](SystemGraphManagementReq_attributes_sudo.md) | | [optional] [default to null] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/v2/docs/SystemGraphManagementReqAttributesSudo.md b/v2/docs/SystemGraphManagementReqAttributesSudo.md deleted file mode 100644 index 14cd7ff..0000000 --- a/v2/docs/SystemGraphManagementReqAttributesSudo.md +++ /dev/null @@ -1,11 +0,0 @@ -# SystemGraphManagementReqAttributesSudo - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Enabled** | **bool** | | [optional] [default to null] -**WithoutPassword** | **bool** | | [optional] [default to null] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/v2/docs/SystemGroup.md b/v2/docs/SystemGroup.md deleted file mode 100644 index fd3800b..0000000 --- a/v2/docs/SystemGroup.md +++ /dev/null @@ -1,12 +0,0 @@ -# SystemGroup - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Id** | **string** | ObjectId uniquely identifying a System Group. | [optional] [default to null] -**Name** | **string** | Display name of a System Group. | [optional] [default to null] -**Type_** | **string** | The type of the group; always 'system' for a System Group. | [optional] [default to null] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/v2/docs/SystemGroupAssociationsApi.md b/v2/docs/SystemGroupAssociationsApi.md deleted file mode 100644 index ed5bf01..0000000 --- a/v2/docs/SystemGroupAssociationsApi.md +++ /dev/null @@ -1,277 +0,0 @@ -# \SystemGroupAssociationsApi - -All URIs are relative to *https://console.jumpcloud.com/api/v2* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**GraphSystemGroupAssociationsList**](SystemGroupAssociationsApi.md#GraphSystemGroupAssociationsList) | **Get** /systemgroups/{group_id}/associations | List the associations of a System Group -[**GraphSystemGroupAssociationsPost**](SystemGroupAssociationsApi.md#GraphSystemGroupAssociationsPost) | **Post** /systemgroups/{group_id}/associations | Manage the associations of a System Group -[**GraphSystemGroupTraverseCommand**](SystemGroupAssociationsApi.md#GraphSystemGroupTraverseCommand) | **Get** /systemgroups/{group_id}/commands | List the Commands bound to a System Group -[**GraphSystemGroupTraversePolicy**](SystemGroupAssociationsApi.md#GraphSystemGroupTraversePolicy) | **Get** /systemgroups/{group_id}/policies | List the Policies bound to a System Group -[**GraphSystemGroupTraverseUser**](SystemGroupAssociationsApi.md#GraphSystemGroupTraverseUser) | **Get** /systemgroups/{group_id}/users | List the Users bound to a System Group -[**GraphSystemGroupTraverseUserGroup**](SystemGroupAssociationsApi.md#GraphSystemGroupTraverseUserGroup) | **Get** /systemgroups/{group_id}/usergroups | List the User Groups bound to a System Group - - -# **GraphSystemGroupAssociationsList** -> []GraphConnection GraphSystemGroupAssociationsList(ctx, groupId, contentType, accept, targets, optional) -List the associations of a System Group - -This endpoint returns the _direct_ associations of a System Group. A direct association can be a non-homogeneous relationship between 2 different objects, for example System Groups and Users. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/systemgroups/{GroupID}/associations?targets=user \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **groupId** | **string**| ObjectID of the System Group. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **targets** | [**[]string**](string.md)| | - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **groupId** | **string**| ObjectID of the System Group. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **targets** | [**[]string**](string.md)| | - **limit** | **int32**| The number of records to return at once. Limited to 100. | [default to 10] - **skip** | **int32**| The offset into the records to return. | [default to 0] - **xOrgId** | **string**| | [default to ] - -### Return type - -[**[]GraphConnection**](GraphConnection.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **GraphSystemGroupAssociationsPost** -> GraphSystemGroupAssociationsPost(ctx, groupId, contentType, accept, optional) -Manage the associations of a System Group - -This endpoint allows you to manage the _direct_ associations of a System Group. A direct association can be a non-homogeneous relationship between 2 different objects, for example System Groups and Users. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/systemgroups/{GroupID}/associations \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"op\": \"add\", \"type\": \"user\", \"id\": \"{UserID}\" }' ``` - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **groupId** | **string**| ObjectID of the System Group. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **groupId** | **string**| ObjectID of the System Group. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **body** | [**SystemGroupGraphManagementReq**](SystemGroupGraphManagementReq.md)| | - **xOrgId** | **string**| | [default to ] - -### Return type - - (empty response body) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **GraphSystemGroupTraverseCommand** -> []GraphObjectWithPaths GraphSystemGroupTraverseCommand(ctx, groupId, contentType, accept, optional) -List the Commands bound to a System Group - -This endpoint will return all Commands bound to a System Group, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the group's type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this System Group to the corresponding Command; this array represents all grouping and/or associations that would have to be removed to deprovision the Command from this System Group. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/systemgroups/{GroupID}/commands \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **groupId** | **string**| ObjectID of the System Group. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **groupId** | **string**| ObjectID of the System Group. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **limit** | **int32**| The number of records to return at once. Limited to 100. | [default to 10] - **xOrgId** | **string**| | [default to ] - **skip** | **int32**| The offset into the records to return. | [default to 0] - **filter** | [**[]string**](string.md)| Supported operators are: eq, ne, gt, ge, lt, le, between, search, in | - -### Return type - -[**[]GraphObjectWithPaths**](GraphObjectWithPaths.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **GraphSystemGroupTraversePolicy** -> []GraphObjectWithPaths GraphSystemGroupTraversePolicy(ctx, groupId, contentType, accept, optional) -List the Policies bound to a System Group - -This endpoint will return all Policies bound to a System Group, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this System Group to the corresponding Policy; this array represents all grouping and/or associations that would have to be removed to deprovision the Policy from this System Group. See `/members` and `/associations` endpoints to manage those collections. This endpoint is not public yet as we haven't finished the code. ##### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/systemgroups/{GroupID}/policies \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **groupId** | **string**| ObjectID of the System Group. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **groupId** | **string**| ObjectID of the System Group. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **limit** | **int32**| The number of records to return at once. Limited to 100. | [default to 10] - **xOrgId** | **string**| | [default to ] - **skip** | **int32**| The offset into the records to return. | [default to 0] - **filter** | [**[]string**](string.md)| Supported operators are: eq, ne, gt, ge, lt, le, between, search, in | - -### Return type - -[**[]GraphObjectWithPaths**](GraphObjectWithPaths.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **GraphSystemGroupTraverseUser** -> []GraphObjectWithPaths GraphSystemGroupTraverseUser(ctx, groupId, contentType, accept, optional) -List the Users bound to a System Group - -This endpoint will return all Users bound to a System Group, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this System Group to the corresponding User; this array represents all grouping and/or associations that would have to be removed to deprovision the User from this System Group. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/systemgroups/{GroupID}/users \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **groupId** | **string**| ObjectID of the System Group. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **groupId** | **string**| ObjectID of the System Group. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **limit** | **int32**| The number of records to return at once. Limited to 100. | [default to 10] - **xOrgId** | **string**| | [default to ] - **skip** | **int32**| The offset into the records to return. | [default to 0] - **filter** | [**[]string**](string.md)| Supported operators are: eq, ne, gt, ge, lt, le, between, search, in | - -### Return type - -[**[]GraphObjectWithPaths**](GraphObjectWithPaths.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **GraphSystemGroupTraverseUserGroup** -> []GraphObjectWithPaths GraphSystemGroupTraverseUserGroup(ctx, groupId, contentType, accept, optional) -List the User Groups bound to a System Group - -This endpoint will return all User Groups bound to a System Group, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this System Group to the corresponding User Group; this array represents all grouping and/or associations that would have to be removed to deprovision the User Group from this System Group. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/systemgroups/{GroupID}/usergroups \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **groupId** | **string**| ObjectID of the System Group. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **groupId** | **string**| ObjectID of the System Group. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **limit** | **int32**| The number of records to return at once. Limited to 100. | [default to 10] - **xOrgId** | **string**| | [default to ] - **skip** | **int32**| The offset into the records to return. | [default to 0] - **filter** | [**[]string**](string.md)| Supported operators are: eq, ne, gt, ge, lt, le, between, search, in | - -### Return type - -[**[]GraphObjectWithPaths**](GraphObjectWithPaths.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - diff --git a/v2/docs/SystemGroupGraphManagementReq.md b/v2/docs/SystemGroupGraphManagementReq.md deleted file mode 100644 index 6bff94d..0000000 --- a/v2/docs/SystemGroupGraphManagementReq.md +++ /dev/null @@ -1,12 +0,0 @@ -# SystemGroupGraphManagementReq - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Id** | **string** | The ObjectID of graph object being added or removed as an association. | [default to null] -**Op** | **string** | How to modify the graph connection. | [default to null] -**Type_** | **string** | | [default to null] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/v2/docs/SystemGroupMembersMembershipApi.md b/v2/docs/SystemGroupMembersMembershipApi.md deleted file mode 100644 index fbb3c59..0000000 --- a/v2/docs/SystemGroupMembersMembershipApi.md +++ /dev/null @@ -1,189 +0,0 @@ -# \SystemGroupMembersMembershipApi - -All URIs are relative to *https://console.jumpcloud.com/api/v2* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**GraphSystemGroupMemberOf**](SystemGroupMembersMembershipApi.md#GraphSystemGroupMemberOf) | **Get** /systemgroups/{group_id}/memberof | List the System Group's parents -[**GraphSystemGroupMembersList**](SystemGroupMembersMembershipApi.md#GraphSystemGroupMembersList) | **Get** /systemgroups/{group_id}/members | List the members of a System Group -[**GraphSystemGroupMembersPost**](SystemGroupMembersMembershipApi.md#GraphSystemGroupMembersPost) | **Post** /systemgroups/{group_id}/members | Manage the members of a System Group -[**GraphSystemGroupMembership**](SystemGroupMembersMembershipApi.md#GraphSystemGroupMembership) | **Get** /systemgroups/{group_id}/membership | List the System Group's membership - - -# **GraphSystemGroupMemberOf** -> []GraphObjectWithPaths GraphSystemGroupMemberOf(ctx, groupId, contentType, accept, optional) -List the System Group's parents - -This endpoint returns all System Groups a System Group is a member of. This endpoint is not yet public as we haven't completed the code yet. - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **groupId** | **string**| ObjectID of the System Group. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **groupId** | **string**| ObjectID of the System Group. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **filter** | [**[]string**](string.md)| Supported operators are: eq, ne, gt, ge, lt, le, between, search, in | - **limit** | **int32**| The number of records to return at once. Limited to 100. | [default to 10] - **skip** | **int32**| The offset into the records to return. | [default to 0] - **sort** | [**[]string**](string.md)| The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. | - **xOrgId** | **string**| | [default to ] - -### Return type - -[**[]GraphObjectWithPaths**](GraphObjectWithPaths.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **GraphSystemGroupMembersList** -> []GraphConnection GraphSystemGroupMembersList(ctx, groupId, contentType, accept, optional) -List the members of a System Group - -This endpoint returns the system members of a System Group. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/systemgroups/{Group_ID}/members \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **groupId** | **string**| ObjectID of the System Group. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **groupId** | **string**| ObjectID of the System Group. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **limit** | **int32**| The number of records to return at once. Limited to 100. | [default to 10] - **skip** | **int32**| The offset into the records to return. | [default to 0] - **xOrgId** | **string**| | [default to ] - -### Return type - -[**[]GraphConnection**](GraphConnection.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **GraphSystemGroupMembersPost** -> GraphSystemGroupMembersPost(ctx, groupId, contentType, accept, optional) -Manage the members of a System Group - -This endpoint allows you to manage the system members of a System Group. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/systemgroups/{Group_ID}/members \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"op\": \"add\", \"type\": \"system\", \"id\": \"{System_ID}\" }' ``` - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **groupId** | **string**| ObjectID of the System Group. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **groupId** | **string**| ObjectID of the System Group. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **body** | [**SystemGroupMembersReq**](SystemGroupMembersReq.md)| | - **date** | **string**| Current date header for the System Context API | - **authorization** | **string**| Authorization header for the System Context API | - **xOrgId** | **string**| | [default to ] - -### Return type - - (empty response body) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **GraphSystemGroupMembership** -> []GraphObjectWithPaths GraphSystemGroupMembership(ctx, groupId, contentType, accept, optional) -List the System Group's membership - -This endpoint returns all Systems that are a member of this System Group. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/systemgroups/{Group_ID/membership \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **groupId** | **string**| ObjectID of the System Group. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **groupId** | **string**| ObjectID of the System Group. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **limit** | **int32**| The number of records to return at once. Limited to 100. | [default to 10] - **skip** | **int32**| The offset into the records to return. | [default to 0] - **sort** | [**[]string**](string.md)| The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. | - **filter** | [**[]string**](string.md)| Supported operators are: eq, ne, gt, ge, lt, le, between, search, in | - **xOrgId** | **string**| | [default to ] - -### Return type - -[**[]GraphObjectWithPaths**](GraphObjectWithPaths.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - diff --git a/v2/docs/SystemGroupMembersReq.md b/v2/docs/SystemGroupMembersReq.md deleted file mode 100644 index 860af37..0000000 --- a/v2/docs/SystemGroupMembersReq.md +++ /dev/null @@ -1,12 +0,0 @@ -# SystemGroupMembersReq - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Id** | **string** | The ObjectID of member being added or removed. | [default to null] -**Op** | **string** | How to modify the membership connection. | [default to null] -**Type_** | **string** | The member type. | [default to null] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/v2/docs/SystemGroupsApi.md b/v2/docs/SystemGroupsApi.md deleted file mode 100644 index 624e622..0000000 --- a/v2/docs/SystemGroupsApi.md +++ /dev/null @@ -1,669 +0,0 @@ -# \SystemGroupsApi - -All URIs are relative to *https://console.jumpcloud.com/api/v2* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**GraphSystemGroupAssociationsList**](SystemGroupsApi.md#GraphSystemGroupAssociationsList) | **Get** /systemgroups/{group_id}/associations | List the associations of a System Group -[**GraphSystemGroupAssociationsPost**](SystemGroupsApi.md#GraphSystemGroupAssociationsPost) | **Post** /systemgroups/{group_id}/associations | Manage the associations of a System Group -[**GraphSystemGroupMemberOf**](SystemGroupsApi.md#GraphSystemGroupMemberOf) | **Get** /systemgroups/{group_id}/memberof | List the System Group's parents -[**GraphSystemGroupMembersList**](SystemGroupsApi.md#GraphSystemGroupMembersList) | **Get** /systemgroups/{group_id}/members | List the members of a System Group -[**GraphSystemGroupMembersPost**](SystemGroupsApi.md#GraphSystemGroupMembersPost) | **Post** /systemgroups/{group_id}/members | Manage the members of a System Group -[**GraphSystemGroupMembership**](SystemGroupsApi.md#GraphSystemGroupMembership) | **Get** /systemgroups/{group_id}/membership | List the System Group's membership -[**GraphSystemGroupTraversePolicy**](SystemGroupsApi.md#GraphSystemGroupTraversePolicy) | **Get** /systemgroups/{group_id}/policies | List the Policies bound to a System Group -[**GraphSystemGroupTraverseUser**](SystemGroupsApi.md#GraphSystemGroupTraverseUser) | **Get** /systemgroups/{group_id}/users | List the Users bound to a System Group -[**GraphSystemGroupTraverseUserGroup**](SystemGroupsApi.md#GraphSystemGroupTraverseUserGroup) | **Get** /systemgroups/{group_id}/usergroups | List the User Groups bound to a System Group -[**GroupsSystemDelete**](SystemGroupsApi.md#GroupsSystemDelete) | **Delete** /systemgroups/{id} | Delete a System Group -[**GroupsSystemGet**](SystemGroupsApi.md#GroupsSystemGet) | **Get** /systemgroups/{id} | View an individual System Group details -[**GroupsSystemList**](SystemGroupsApi.md#GroupsSystemList) | **Get** /systemgroups | List all System Groups -[**GroupsSystemPatch**](SystemGroupsApi.md#GroupsSystemPatch) | **Patch** /systemgroups/{id} | Partial update a System Group -[**GroupsSystemPost**](SystemGroupsApi.md#GroupsSystemPost) | **Post** /systemgroups | Create a new System Group -[**GroupsSystemPut**](SystemGroupsApi.md#GroupsSystemPut) | **Put** /systemgroups/{id} | Update a System Group - - -# **GraphSystemGroupAssociationsList** -> []GraphConnection GraphSystemGroupAssociationsList(ctx, groupId, contentType, accept, targets, optional) -List the associations of a System Group - -This endpoint returns the _direct_ associations of a System Group. A direct association can be a non-homogeneous relationship between 2 different objects, for example System Groups and Users. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/systemgroups/{GroupID}/associations?targets=user \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **groupId** | **string**| ObjectID of the System Group. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **targets** | [**[]string**](string.md)| | - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **groupId** | **string**| ObjectID of the System Group. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **targets** | [**[]string**](string.md)| | - **limit** | **int32**| The number of records to return at once. Limited to 100. | [default to 10] - **skip** | **int32**| The offset into the records to return. | [default to 0] - **xOrgId** | **string**| | [default to ] - -### Return type - -[**[]GraphConnection**](GraphConnection.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **GraphSystemGroupAssociationsPost** -> GraphSystemGroupAssociationsPost(ctx, groupId, contentType, accept, optional) -Manage the associations of a System Group - -This endpoint allows you to manage the _direct_ associations of a System Group. A direct association can be a non-homogeneous relationship between 2 different objects, for example System Groups and Users. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/systemgroups/{GroupID}/associations \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"op\": \"add\", \"type\": \"user\", \"id\": \"{UserID}\" }' ``` - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **groupId** | **string**| ObjectID of the System Group. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **groupId** | **string**| ObjectID of the System Group. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **body** | [**SystemGroupGraphManagementReq**](SystemGroupGraphManagementReq.md)| | - **xOrgId** | **string**| | [default to ] - -### Return type - - (empty response body) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **GraphSystemGroupMemberOf** -> []GraphObjectWithPaths GraphSystemGroupMemberOf(ctx, groupId, contentType, accept, optional) -List the System Group's parents - -This endpoint returns all System Groups a System Group is a member of. This endpoint is not yet public as we haven't completed the code yet. - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **groupId** | **string**| ObjectID of the System Group. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **groupId** | **string**| ObjectID of the System Group. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **filter** | [**[]string**](string.md)| Supported operators are: eq, ne, gt, ge, lt, le, between, search, in | - **limit** | **int32**| The number of records to return at once. Limited to 100. | [default to 10] - **skip** | **int32**| The offset into the records to return. | [default to 0] - **sort** | [**[]string**](string.md)| The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. | - **xOrgId** | **string**| | [default to ] - -### Return type - -[**[]GraphObjectWithPaths**](GraphObjectWithPaths.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **GraphSystemGroupMembersList** -> []GraphConnection GraphSystemGroupMembersList(ctx, groupId, contentType, accept, optional) -List the members of a System Group - -This endpoint returns the system members of a System Group. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/systemgroups/{Group_ID}/members \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **groupId** | **string**| ObjectID of the System Group. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **groupId** | **string**| ObjectID of the System Group. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **limit** | **int32**| The number of records to return at once. Limited to 100. | [default to 10] - **skip** | **int32**| The offset into the records to return. | [default to 0] - **xOrgId** | **string**| | [default to ] - -### Return type - -[**[]GraphConnection**](GraphConnection.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **GraphSystemGroupMembersPost** -> GraphSystemGroupMembersPost(ctx, groupId, contentType, accept, optional) -Manage the members of a System Group - -This endpoint allows you to manage the system members of a System Group. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/systemgroups/{Group_ID}/members \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"op\": \"add\", \"type\": \"system\", \"id\": \"{System_ID}\" }' ``` - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **groupId** | **string**| ObjectID of the System Group. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **groupId** | **string**| ObjectID of the System Group. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **body** | [**SystemGroupMembersReq**](SystemGroupMembersReq.md)| | - **date** | **string**| Current date header for the System Context API | - **authorization** | **string**| Authorization header for the System Context API | - **xOrgId** | **string**| | [default to ] - -### Return type - - (empty response body) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **GraphSystemGroupMembership** -> []GraphObjectWithPaths GraphSystemGroupMembership(ctx, groupId, contentType, accept, optional) -List the System Group's membership - -This endpoint returns all Systems that are a member of this System Group. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/systemgroups/{Group_ID/membership \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **groupId** | **string**| ObjectID of the System Group. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **groupId** | **string**| ObjectID of the System Group. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **limit** | **int32**| The number of records to return at once. Limited to 100. | [default to 10] - **skip** | **int32**| The offset into the records to return. | [default to 0] - **sort** | [**[]string**](string.md)| The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. | - **filter** | [**[]string**](string.md)| Supported operators are: eq, ne, gt, ge, lt, le, between, search, in | - **xOrgId** | **string**| | [default to ] - -### Return type - -[**[]GraphObjectWithPaths**](GraphObjectWithPaths.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **GraphSystemGroupTraversePolicy** -> []GraphObjectWithPaths GraphSystemGroupTraversePolicy(ctx, groupId, contentType, accept, optional) -List the Policies bound to a System Group - -This endpoint will return all Policies bound to a System Group, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this System Group to the corresponding Policy; this array represents all grouping and/or associations that would have to be removed to deprovision the Policy from this System Group. See `/members` and `/associations` endpoints to manage those collections. This endpoint is not public yet as we haven't finished the code. ##### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/systemgroups/{GroupID}/policies \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **groupId** | **string**| ObjectID of the System Group. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **groupId** | **string**| ObjectID of the System Group. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **limit** | **int32**| The number of records to return at once. Limited to 100. | [default to 10] - **xOrgId** | **string**| | [default to ] - **skip** | **int32**| The offset into the records to return. | [default to 0] - **filter** | [**[]string**](string.md)| Supported operators are: eq, ne, gt, ge, lt, le, between, search, in | - -### Return type - -[**[]GraphObjectWithPaths**](GraphObjectWithPaths.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **GraphSystemGroupTraverseUser** -> []GraphObjectWithPaths GraphSystemGroupTraverseUser(ctx, groupId, contentType, accept, optional) -List the Users bound to a System Group - -This endpoint will return all Users bound to a System Group, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this System Group to the corresponding User; this array represents all grouping and/or associations that would have to be removed to deprovision the User from this System Group. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/systemgroups/{GroupID}/users \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **groupId** | **string**| ObjectID of the System Group. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **groupId** | **string**| ObjectID of the System Group. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **limit** | **int32**| The number of records to return at once. Limited to 100. | [default to 10] - **xOrgId** | **string**| | [default to ] - **skip** | **int32**| The offset into the records to return. | [default to 0] - **filter** | [**[]string**](string.md)| Supported operators are: eq, ne, gt, ge, lt, le, between, search, in | - -### Return type - -[**[]GraphObjectWithPaths**](GraphObjectWithPaths.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **GraphSystemGroupTraverseUserGroup** -> []GraphObjectWithPaths GraphSystemGroupTraverseUserGroup(ctx, groupId, contentType, accept, optional) -List the User Groups bound to a System Group - -This endpoint will return all User Groups bound to a System Group, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this System Group to the corresponding User Group; this array represents all grouping and/or associations that would have to be removed to deprovision the User Group from this System Group. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/systemgroups/{GroupID}/usergroups \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **groupId** | **string**| ObjectID of the System Group. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **groupId** | **string**| ObjectID of the System Group. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **limit** | **int32**| The number of records to return at once. Limited to 100. | [default to 10] - **xOrgId** | **string**| | [default to ] - **skip** | **int32**| The offset into the records to return. | [default to 0] - **filter** | [**[]string**](string.md)| Supported operators are: eq, ne, gt, ge, lt, le, between, search, in | - -### Return type - -[**[]GraphObjectWithPaths**](GraphObjectWithPaths.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **GroupsSystemDelete** -> GroupsSystemDelete(ctx, id, contentType, accept, optional) -Delete a System Group - -This endpoint allows you to delete a System Group. #### Sample Request ``` curl -X DELETE https://console.jumpcloud.com/api/v2/systemgroups/{Group_ID} \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **id** | **string**| ObjectID of the System Group. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **id** | **string**| ObjectID of the System Group. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **xOrgId** | **string**| | [default to ] - -### Return type - - (empty response body) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **GroupsSystemGet** -> SystemGroup GroupsSystemGet(ctx, id, contentType, accept, optional) -View an individual System Group details - -This endpoint returns the details of a System Group. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/systemgroups/{Group_ID} \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **id** | **string**| ObjectID of the System Group. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **id** | **string**| ObjectID of the System Group. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **xOrgId** | **string**| | [default to ] - -### Return type - -[**SystemGroup**](SystemGroup.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **GroupsSystemList** -> []SystemGroup GroupsSystemList(ctx, contentType, accept, optional) -List all System Groups - -This endpoint returns all System Groups. Available filter fields: - `name` - `disabled` - `type` #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/systemgroups \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **fields** | [**[]string**](string.md)| The comma separated fields included in the returned records. If omitted, the default list of fields will be returned. | - **filter** | [**[]string**](string.md)| Supported operators are: eq, ne, gt, ge, lt, le, between, search, in | - **limit** | **int32**| The number of records to return at once. Limited to 100. | [default to 10] - **skip** | **int32**| The offset into the records to return. | [default to 0] - **sort** | [**[]string**](string.md)| The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. | - **xOrgId** | **string**| | [default to ] - -### Return type - -[**[]SystemGroup**](SystemGroup.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **GroupsSystemPatch** -> SystemGroup GroupsSystemPatch(ctx, id, contentType, accept, optional) -Partial update a System Group - -We have hidden PATCH on the systemgroups and usergroups for now; we don't have that implemented correctly yet, people should use PUT until we do a true PATCH operation. #### Sample Request ``` https://console.jumpcloud.com/api/v2/systemgroups/{id} ``` - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **id** | **string**| ObjectID of the System Group. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **id** | **string**| ObjectID of the System Group. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **body** | [**SystemGroupData**](SystemGroupData.md)| | - **xOrgId** | **string**| | [default to ] - -### Return type - -[**SystemGroup**](SystemGroup.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **GroupsSystemPost** -> SystemGroup GroupsSystemPost(ctx, contentType, accept, optional) -Create a new System Group - -This endpoint allows you to create a new System Group. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/systemgroups \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"name\": \"{Group_Name}\" }' ``` - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **body** | [**SystemGroupData**](SystemGroupData.md)| | - **xOrgId** | **string**| | [default to ] - -### Return type - -[**SystemGroup**](SystemGroup.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **GroupsSystemPut** -> SystemGroup GroupsSystemPut(ctx, id, contentType, accept, optional) -Update a System Group - -This endpoint allows you to do a full update of the System Group. #### Sample Request ``` curl -X PUT https://console.jumpcloud.com/api/v2/systemgroups/{Group_ID} \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"name\": \"Name_Update\" }' ``` - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **id** | **string**| ObjectID of the System Group. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **id** | **string**| ObjectID of the System Group. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **body** | [**SystemGroupData**](SystemGroupData.md)| | - **xOrgId** | **string**| | [default to ] - -### Return type - -[**SystemGroup**](SystemGroup.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - diff --git a/v2/docs/SystemInsightsApi.md b/v2/docs/SystemInsightsApi.md deleted file mode 100644 index 52cf2dd..0000000 --- a/v2/docs/SystemInsightsApi.md +++ /dev/null @@ -1,2200 +0,0 @@ -# \SystemInsightsApi - -All URIs are relative to *https://console.jumpcloud.com/api/v2* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**SysteminsightsListApps**](SystemInsightsApi.md#SysteminsightsListApps) | **Get** /systeminsights/apps | List System Insights Apps -[**SysteminsightsListBattery**](SystemInsightsApi.md#SysteminsightsListBattery) | **Get** /systeminsights/battery | List System Insights Battery -[**SysteminsightsListBitlockerInfo**](SystemInsightsApi.md#SysteminsightsListBitlockerInfo) | **Get** /systeminsights/bitlocker_info | List System Insights Bitlocker Info -[**SysteminsightsListBrowserPlugins**](SystemInsightsApi.md#SysteminsightsListBrowserPlugins) | **Get** /systeminsights/browser_plugins | List System Insights Browser Plugins -[**SysteminsightsListChromeExtensions**](SystemInsightsApi.md#SysteminsightsListChromeExtensions) | **Get** /systeminsights/chrome_extensions | List System Insights Chrome Extensions -[**SysteminsightsListCrashes**](SystemInsightsApi.md#SysteminsightsListCrashes) | **Get** /systeminsights/crashes | List System Insights Crashes -[**SysteminsightsListDiskEncryption**](SystemInsightsApi.md#SysteminsightsListDiskEncryption) | **Get** /systeminsights/disk_encryption | List System Insights Disk Encryption -[**SysteminsightsListDiskInfo**](SystemInsightsApi.md#SysteminsightsListDiskInfo) | **Get** /systeminsights/disk_info | List System Insights Disk Info -[**SysteminsightsListEtcHosts**](SystemInsightsApi.md#SysteminsightsListEtcHosts) | **Get** /systeminsights/etc_hosts | List System Insights Etc Hosts -[**SysteminsightsListFirefoxAddons**](SystemInsightsApi.md#SysteminsightsListFirefoxAddons) | **Get** /systeminsights/firefox_addons | List System Insights Firefox Addons -[**SysteminsightsListGroups**](SystemInsightsApi.md#SysteminsightsListGroups) | **Get** /systeminsights/groups | List System Insights Groups -[**SysteminsightsListIeExtensions**](SystemInsightsApi.md#SysteminsightsListIeExtensions) | **Get** /systeminsights/ie_extensions | List System Insights IE Extensions -[**SysteminsightsListInterfaceAddresses**](SystemInsightsApi.md#SysteminsightsListInterfaceAddresses) | **Get** /systeminsights/interface_addresses | List System Insights Interface Addresses -[**SysteminsightsListKernelInfo**](SystemInsightsApi.md#SysteminsightsListKernelInfo) | **Get** /systeminsights/kernel_info | List System Insights Kernel Info -[**SysteminsightsListLaunchd**](SystemInsightsApi.md#SysteminsightsListLaunchd) | **Get** /systeminsights/launchd | List System Insights Launchd -[**SysteminsightsListLoggedInUsers**](SystemInsightsApi.md#SysteminsightsListLoggedInUsers) | **Get** /systeminsights/logged_in_users | List System Insights Logged-In Users -[**SysteminsightsListLogicalDrives**](SystemInsightsApi.md#SysteminsightsListLogicalDrives) | **Get** /systeminsights/logical_drives | List System Insights Logical Drives -[**SysteminsightsListMounts**](SystemInsightsApi.md#SysteminsightsListMounts) | **Get** /systeminsights/mounts | List System Insights Mounts -[**SysteminsightsListOsVersion**](SystemInsightsApi.md#SysteminsightsListOsVersion) | **Get** /systeminsights/os_version | List System Insights OS Version -[**SysteminsightsListPatches**](SystemInsightsApi.md#SysteminsightsListPatches) | **Get** /systeminsights/patches | List System Insights Patches -[**SysteminsightsListPrograms**](SystemInsightsApi.md#SysteminsightsListPrograms) | **Get** /systeminsights/programs | List System Insights Programs -[**SysteminsightsListSafariExtensions**](SystemInsightsApi.md#SysteminsightsListSafariExtensions) | **Get** /systeminsights/safari_extensions | List System Insights Safari Extensions -[**SysteminsightsListSystemApps**](SystemInsightsApi.md#SysteminsightsListSystemApps) | **Get** /systeminsights/{system_id}/apps | List System Insights System Apps -[**SysteminsightsListSystemBitlockerInfo**](SystemInsightsApi.md#SysteminsightsListSystemBitlockerInfo) | **Get** /systeminsights/{system_id}/bitlocker_info | List System Insights System Bitlocker Info -[**SysteminsightsListSystemBrowserPlugins**](SystemInsightsApi.md#SysteminsightsListSystemBrowserPlugins) | **Get** /systeminsights/{system_id}/browser_plugins | List System Insights System Browser Plugins -[**SysteminsightsListSystemChromeExtensions**](SystemInsightsApi.md#SysteminsightsListSystemChromeExtensions) | **Get** /systeminsights/{system_id}/chrome_extensions | List System Insights System Chrome Extensions -[**SysteminsightsListSystemControls**](SystemInsightsApi.md#SysteminsightsListSystemControls) | **Get** /systeminsights/system_controls | List System Insights System Control -[**SysteminsightsListSystemDiskEncryption**](SystemInsightsApi.md#SysteminsightsListSystemDiskEncryption) | **Get** /systeminsights/{system_id}/disk_encryption | List System Insights System Disk Encryption -[**SysteminsightsListSystemDiskInfo**](SystemInsightsApi.md#SysteminsightsListSystemDiskInfo) | **Get** /systeminsights/{system_id}/disk_info | List System Insights System Disk Info -[**SysteminsightsListSystemEtcHosts**](SystemInsightsApi.md#SysteminsightsListSystemEtcHosts) | **Get** /systeminsights/{system_id}/etc_hosts | List System Insights System Etc Hosts -[**SysteminsightsListSystemFirefoxAddons**](SystemInsightsApi.md#SysteminsightsListSystemFirefoxAddons) | **Get** /systeminsights/{system_id}/firefox_addons | List System Insights System Firefox Addons -[**SysteminsightsListSystemGroups**](SystemInsightsApi.md#SysteminsightsListSystemGroups) | **Get** /systeminsights/{system_id}/groups | List System Insights System Groups -[**SysteminsightsListSystemInfo**](SystemInsightsApi.md#SysteminsightsListSystemInfo) | **Get** /systeminsights/system_info | List System Insights System Info -[**SysteminsightsListSystemInterfaceAddresses**](SystemInsightsApi.md#SysteminsightsListSystemInterfaceAddresses) | **Get** /systeminsights/{system_id}/interface_addresses | List System Insights System Interface Addresses -[**SysteminsightsListSystemKernelInfo**](SystemInsightsApi.md#SysteminsightsListSystemKernelInfo) | **Get** /systeminsights/{system_id}/kernel_info | List System Insights System Kernel Info -[**SysteminsightsListSystemLogicalDrives**](SystemInsightsApi.md#SysteminsightsListSystemLogicalDrives) | **Get** /systeminsights/{system_id}/logical_drives | List System Insights System Logical Drives -[**SysteminsightsListSystemMounts**](SystemInsightsApi.md#SysteminsightsListSystemMounts) | **Get** /systeminsights/{system_id}/mounts | List System Insights System Mounts -[**SysteminsightsListSystemOsVersion**](SystemInsightsApi.md#SysteminsightsListSystemOsVersion) | **Get** /systeminsights/{system_id}/os_version | List System Insights System OS Version -[**SysteminsightsListSystemPatches**](SystemInsightsApi.md#SysteminsightsListSystemPatches) | **Get** /systeminsights/{system_id}/patches | List System Insights System Patches -[**SysteminsightsListSystemPrograms**](SystemInsightsApi.md#SysteminsightsListSystemPrograms) | **Get** /systeminsights/{system_id}/programs | List System Insights System Programs -[**SysteminsightsListSystemSafariExtensions**](SystemInsightsApi.md#SysteminsightsListSystemSafariExtensions) | **Get** /systeminsights/{system_id}/safari_extensions | List System Insights System Safari Extensions -[**SysteminsightsListSystemSystemControls**](SystemInsightsApi.md#SysteminsightsListSystemSystemControls) | **Get** /systeminsights/{system_id}/system_controls | List System Insights System System Controls -[**SysteminsightsListSystemSystemInfo**](SystemInsightsApi.md#SysteminsightsListSystemSystemInfo) | **Get** /systeminsights/{system_id}/system_info | List System Insights System System Info -[**SysteminsightsListSystemUptime**](SystemInsightsApi.md#SysteminsightsListSystemUptime) | **Get** /systeminsights/{system_id}/uptime | List System Insights System Uptime -[**SysteminsightsListSystemUsers**](SystemInsightsApi.md#SysteminsightsListSystemUsers) | **Get** /systeminsights/{system_id}/users | List System Insights System Users -[**SysteminsightsListUptime**](SystemInsightsApi.md#SysteminsightsListUptime) | **Get** /systeminsights/uptime | List System Insights Uptime -[**SysteminsightsListUsbDevices**](SystemInsightsApi.md#SysteminsightsListUsbDevices) | **Get** /systeminsights/usb_devices | List System Insights USB Devices -[**SysteminsightsListUserGroups**](SystemInsightsApi.md#SysteminsightsListUserGroups) | **Get** /systeminsights/user_groups | List System Insights User Groups -[**SysteminsightsListUsers**](SystemInsightsApi.md#SysteminsightsListUsers) | **Get** /systeminsights/users | List System Insights Users -[**SysteminsightsListWindowsCrashes**](SystemInsightsApi.md#SysteminsightsListWindowsCrashes) | **Get** /systeminsights/windows_crashes | List System Insights Windows Crashes - - -# **SysteminsightsListApps** -> []SystemInsightsApps SysteminsightsListApps(ctx, contentType, accept, optional) -List System Insights Apps - -Valid filter fields are `system_id` and `bundle_name`. - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **limit** | **int32**| | [default to 10] - **xOrgId** | **string**| | [default to ] - **skip** | **int32**| The offset into the records to return. | [default to 0] - **filter** | [**[]string**](string.md)| Supported operators are: eq | - -### Return type - -[**[]SystemInsightsApps**](system-insights-apps.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **SysteminsightsListBattery** -> []SystemInsightsBattery SysteminsightsListBattery(ctx, contentType, accept, optional) -List System Insights Battery - -Valid filter fields are `system_id` and `health`. - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **limit** | **int32**| | [default to 10] - **xOrgId** | **string**| | [default to ] - **skip** | **int32**| The offset into the records to return. | [default to 0] - **filter** | [**[]string**](string.md)| Supported operators are: eq | - -### Return type - -[**[]SystemInsightsBattery**](system-insights-battery.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **SysteminsightsListBitlockerInfo** -> []SystemInsightsBitlockerInfo SysteminsightsListBitlockerInfo(ctx, contentType, accept, optional) -List System Insights Bitlocker Info - -Valid filter fields are `system_id` and `protection_status`. - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **limit** | **int32**| | [default to 10] - **skip** | **int32**| The offset into the records to return. | [default to 0] - **filter** | [**[]string**](string.md)| Supported operators are: eq | - **xOrgId** | **string**| | [default to ] - -### Return type - -[**[]SystemInsightsBitlockerInfo**](system-insights-bitlocker-info.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **SysteminsightsListBrowserPlugins** -> []SystemInsightsBrowserPlugins SysteminsightsListBrowserPlugins(ctx, contentType, accept, optional) -List System Insights Browser Plugins - -Valid filter fields are `system_id` and `name`. - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **limit** | **int32**| | [default to 10] - **skip** | **int32**| The offset into the records to return. | [default to 0] - **filter** | [**[]string**](string.md)| Supported operators are: eq | - **xOrgId** | **string**| | [default to ] - -### Return type - -[**[]SystemInsightsBrowserPlugins**](system-insights-browser-plugins.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **SysteminsightsListChromeExtensions** -> []SystemInsightsChromeExtensions SysteminsightsListChromeExtensions(ctx, contentType, accept, optional) -List System Insights Chrome Extensions - -Valid filter fields are `system_id` and `name`. - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **limit** | **int32**| | [default to 10] - **skip** | **int32**| The offset into the records to return. | [default to 0] - **filter** | [**[]string**](string.md)| Supported operators are: eq | - **xOrgId** | **string**| | [default to ] - -### Return type - -[**[]SystemInsightsChromeExtensions**](system-insights-chrome-extensions.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **SysteminsightsListCrashes** -> []SystemInsightsCrashes SysteminsightsListCrashes(ctx, contentType, accept, optional) -List System Insights Crashes - -Valid filter fields are `system_id` and `identifier`. - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **limit** | **int32**| | [default to 10] - **xOrgId** | **string**| | [default to ] - **skip** | **int32**| The offset into the records to return. | [default to 0] - **filter** | [**[]string**](string.md)| Supported operators are: eq | - -### Return type - -[**[]SystemInsightsCrashes**](system-insights-crashes.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **SysteminsightsListDiskEncryption** -> []SystemInsightsDiskEncryption SysteminsightsListDiskEncryption(ctx, contentType, accept, optional) -List System Insights Disk Encryption - -Valid filter fields are `system_id` and `encryption_status`. - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **limit** | **int32**| | [default to 10] - **skip** | **int32**| The offset into the records to return. | [default to 0] - **filter** | [**[]string**](string.md)| Supported operators are: eq | - **xOrgId** | **string**| | [default to ] - -### Return type - -[**[]SystemInsightsDiskEncryption**](system-insights-disk-encryption.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **SysteminsightsListDiskInfo** -> []SystemInsightsDiskInfo SysteminsightsListDiskInfo(ctx, contentType, accept, optional) -List System Insights Disk Info - -Valid filter fields are `system_id` and `disk_index`. - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **limit** | **int32**| | [default to 10] - **skip** | **int32**| The offset into the records to return. | [default to 0] - **filter** | [**[]string**](string.md)| Supported operators are: eq | - **xOrgId** | **string**| | [default to ] - -### Return type - -[**[]SystemInsightsDiskInfo**](system-insights-disk-info.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **SysteminsightsListEtcHosts** -> []SystemInsightsEtcHosts SysteminsightsListEtcHosts(ctx, contentType, accept, optional) -List System Insights Etc Hosts - -Valid filter fields are `system_id` and `address`. - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **limit** | **int32**| | [default to 10] - **skip** | **int32**| The offset into the records to return. | [default to 0] - **filter** | [**[]string**](string.md)| Supported operators are: eq | - **xOrgId** | **string**| | [default to ] - -### Return type - -[**[]SystemInsightsEtcHosts**](system-insights-etc-hosts.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **SysteminsightsListFirefoxAddons** -> []SystemInsightsFirefoxAddons SysteminsightsListFirefoxAddons(ctx, contentType, accept, optional) -List System Insights Firefox Addons - -Valid filter fields are `system_id` and `name`. - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **limit** | **int32**| | [default to 10] - **skip** | **int32**| The offset into the records to return. | [default to 0] - **filter** | [**[]string**](string.md)| Supported operators are: eq | - **xOrgId** | **string**| | [default to ] - -### Return type - -[**[]SystemInsightsFirefoxAddons**](system-insights-firefox-addons.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **SysteminsightsListGroups** -> []SystemInsightsGroups SysteminsightsListGroups(ctx, contentType, accept, optional) -List System Insights Groups - -Valid filter fields are `system_id` and `groupname`. - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **limit** | **int32**| | [default to 10] - **skip** | **int32**| The offset into the records to return. | [default to 0] - **filter** | [**[]string**](string.md)| Supported operators are: eq | - **xOrgId** | **string**| | [default to ] - -### Return type - -[**[]SystemInsightsGroups**](system-insights-groups.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **SysteminsightsListIeExtensions** -> []SystemInsightsIeExtensions SysteminsightsListIeExtensions(ctx, contentType, accept, optional) -List System Insights IE Extensions - -Valid filter fields are `system_id` and `name`. - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **limit** | **int32**| | [default to 10] - **xOrgId** | **string**| | [default to ] - **skip** | **int32**| The offset into the records to return. | [default to 0] - **filter** | [**[]string**](string.md)| Supported operators are: eq | - -### Return type - -[**[]SystemInsightsIeExtensions**](system-insights-ie-extensions.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **SysteminsightsListInterfaceAddresses** -> []SystemInsightsInterfaceAddresses SysteminsightsListInterfaceAddresses(ctx, contentType, accept, optional) -List System Insights Interface Addresses - -Valid filter fields are `system_id` and `address`. - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **limit** | **int32**| | [default to 10] - **skip** | **int32**| The offset into the records to return. | [default to 0] - **filter** | [**[]string**](string.md)| Supported operators are: eq | - **xOrgId** | **string**| | [default to ] - -### Return type - -[**[]SystemInsightsInterfaceAddresses**](system-insights-interface-addresses.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **SysteminsightsListKernelInfo** -> []SystemInsightsKernelInfo SysteminsightsListKernelInfo(ctx, contentType, accept, optional) -List System Insights Kernel Info - -Valid filter fields are `system_id` and `version`. - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **limit** | **int32**| | [default to 10] - **skip** | **int32**| The offset into the records to return. | [default to 0] - **filter** | [**[]string**](string.md)| Supported operators are: eq | - **xOrgId** | **string**| | [default to ] - -### Return type - -[**[]SystemInsightsKernelInfo**](system-insights-kernel-info.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **SysteminsightsListLaunchd** -> []SystemInsightsLaunchd SysteminsightsListLaunchd(ctx, contentType, accept, optional) -List System Insights Launchd - -Valid filter fields are `system_id` and `name`. - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **limit** | **int32**| | [default to 10] - **xOrgId** | **string**| | [default to ] - **skip** | **int32**| The offset into the records to return. | [default to 0] - **filter** | [**[]string**](string.md)| Supported operators are: eq | - -### Return type - -[**[]SystemInsightsLaunchd**](system-insights-launchd.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **SysteminsightsListLoggedInUsers** -> []SystemInsightsLoggedInUsers SysteminsightsListLoggedInUsers(ctx, contentType, accept, optional) -List System Insights Logged-In Users - -Valid filter fields are `system_id` and `user`. - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **limit** | **int32**| | [default to 10] - **xOrgId** | **string**| | [default to ] - **skip** | **int32**| The offset into the records to return. | [default to 0] - **filter** | [**[]string**](string.md)| Supported operators are: eq | - -### Return type - -[**[]SystemInsightsLoggedInUsers**](system-insights-logged-in-users.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **SysteminsightsListLogicalDrives** -> []SystemInsightsLogicalDrvies SysteminsightsListLogicalDrives(ctx, contentType, accept, optional) -List System Insights Logical Drives - -Valid filter fields are `system_id` and `device_id`. - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **limit** | **int32**| | [default to 10] - **skip** | **int32**| The offset into the records to return. | [default to 0] - **filter** | [**[]string**](string.md)| Supported operators are: eq | - **xOrgId** | **string**| | [default to ] - -### Return type - -[**[]SystemInsightsLogicalDrvies**](system-insights-logical-drvies.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **SysteminsightsListMounts** -> []SystemInsightsMounts SysteminsightsListMounts(ctx, contentType, accept, optional) -List System Insights Mounts - -Valid filter fields are `system_id` and `path`. - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **limit** | **int32**| | [default to 10] - **skip** | **int32**| The offset into the records to return. | [default to 0] - **filter** | [**[]string**](string.md)| Supported operators are: eq | - **xOrgId** | **string**| | [default to ] - -### Return type - -[**[]SystemInsightsMounts**](system-insights-mounts.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **SysteminsightsListOsVersion** -> []SystemInsightsOsVersion SysteminsightsListOsVersion(ctx, contentType, accept, optional) -List System Insights OS Version - -Valid filter fields are `system_id` and `version`. - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **limit** | **int32**| | [default to 10] - **skip** | **int32**| The offset into the records to return. | [default to 0] - **filter** | [**[]string**](string.md)| Supported operators are: eq | - **xOrgId** | **string**| | [default to ] - -### Return type - -[**[]SystemInsightsOsVersion**](system-insights-os-version.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **SysteminsightsListPatches** -> []SystemInsightsPatches SysteminsightsListPatches(ctx, contentType, accept, optional) -List System Insights Patches - -Valid filter fields are `system_id` and `hotfix_id`. - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **limit** | **int32**| | [default to 10] - **skip** | **int32**| The offset into the records to return. | [default to 0] - **filter** | [**[]string**](string.md)| Supported operators are: eq | - **xOrgId** | **string**| | [default to ] - -### Return type - -[**[]SystemInsightsPatches**](system-insights-patches.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **SysteminsightsListPrograms** -> []SystemInsightsPrograms SysteminsightsListPrograms(ctx, contentType, accept, optional) -List System Insights Programs - -Valid filter fields are `system_id` and `name`. - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **limit** | **int32**| | [default to 10] - **skip** | **int32**| The offset into the records to return. | [default to 0] - **filter** | [**[]string**](string.md)| Supported operators are: eq | - **xOrgId** | **string**| | [default to ] - -### Return type - -[**[]SystemInsightsPrograms**](system-insights-programs.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **SysteminsightsListSafariExtensions** -> []SystemInsightsSafariExtensions SysteminsightsListSafariExtensions(ctx, contentType, accept, optional) -List System Insights Safari Extensions - -Valid filter fields are `system_id` and `name`. - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **limit** | **int32**| | [default to 10] - **skip** | **int32**| The offset into the records to return. | [default to 0] - **filter** | [**[]string**](string.md)| Supported operators are: eq | - **xOrgId** | **string**| | [default to ] - -### Return type - -[**[]SystemInsightsSafariExtensions**](system-insights-safari-extensions.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **SysteminsightsListSystemApps** -> []SystemInsightsApps SysteminsightsListSystemApps(ctx, systemId, contentType, accept, optional) -List System Insights System Apps - -Valid filter fields are `bundle_name`. - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **systemId** | **string**| | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **systemId** | **string**| | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **limit** | **int32**| | [default to 10] - **skip** | **int32**| The offset into the records to return. | [default to 0] - **filter** | [**[]string**](string.md)| Supported operators are: eq | - **xOrgId** | **string**| | [default to ] - -### Return type - -[**[]SystemInsightsApps**](system-insights-apps.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **SysteminsightsListSystemBitlockerInfo** -> []SystemInsightsBitlockerInfo SysteminsightsListSystemBitlockerInfo(ctx, systemId, contentType, accept, optional) -List System Insights System Bitlocker Info - -Valid filter fields are `protection_status`. - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **systemId** | **string**| | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **systemId** | **string**| | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **limit** | **int32**| | [default to 10] - **skip** | **int32**| The offset into the records to return. | [default to 0] - **filter** | [**[]string**](string.md)| Supported operators are: eq | - **xOrgId** | **string**| | [default to ] - -### Return type - -[**[]SystemInsightsBitlockerInfo**](system-insights-bitlocker-info.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **SysteminsightsListSystemBrowserPlugins** -> []SystemInsightsBrowserPlugins SysteminsightsListSystemBrowserPlugins(ctx, systemId, contentType, accept, optional) -List System Insights System Browser Plugins - -Valid filter fields are `name`. - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **systemId** | **string**| | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **systemId** | **string**| | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **limit** | **int32**| | [default to 10] - **skip** | **int32**| The offset into the records to return. | [default to 0] - **filter** | [**[]string**](string.md)| Supported operators are: eq | - **xOrgId** | **string**| | [default to ] - -### Return type - -[**[]SystemInsightsBrowserPlugins**](system-insights-browser-plugins.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **SysteminsightsListSystemChromeExtensions** -> []SystemInsightsChromeExtensions SysteminsightsListSystemChromeExtensions(ctx, systemId, contentType, accept, optional) -List System Insights System Chrome Extensions - -Valid filter fields are `name`. - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **systemId** | **string**| | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **systemId** | **string**| | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **limit** | **int32**| | [default to 10] - **skip** | **int32**| The offset into the records to return. | [default to 0] - **filter** | [**[]string**](string.md)| Supported operators are: eq | - **xOrgId** | **string**| | [default to ] - -### Return type - -[**[]SystemInsightsChromeExtensions**](system-insights-chrome-extensions.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **SysteminsightsListSystemControls** -> []SystemInsightsSystemControls SysteminsightsListSystemControls(ctx, contentType, accept, optional) -List System Insights System Control - -Valid filter fields are `system_id` and `name`. - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **limit** | **int32**| | [default to 10] - **skip** | **int32**| The offset into the records to return. | [default to 0] - **filter** | [**[]string**](string.md)| Supported operators are: eq | - **xOrgId** | **string**| | [default to ] - -### Return type - -[**[]SystemInsightsSystemControls**](system-insights-system-controls.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **SysteminsightsListSystemDiskEncryption** -> []SystemInsightsDiskEncryption SysteminsightsListSystemDiskEncryption(ctx, systemId, contentType, accept, optional) -List System Insights System Disk Encryption - -Valid filter fields are `encryption_status`. - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **systemId** | **string**| | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **systemId** | **string**| | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **limit** | **int32**| | [default to 10] - **skip** | **int32**| The offset into the records to return. | [default to 0] - **filter** | [**[]string**](string.md)| Supported operators are: eq | - **xOrgId** | **string**| | [default to ] - -### Return type - -[**[]SystemInsightsDiskEncryption**](system-insights-disk-encryption.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **SysteminsightsListSystemDiskInfo** -> []SystemInsightsBitlockerInfo SysteminsightsListSystemDiskInfo(ctx, systemId, contentType, accept, optional) -List System Insights System Disk Info - -Valid filter fields are `disk_index`. - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **systemId** | **string**| | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **systemId** | **string**| | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **limit** | **int32**| | [default to 10] - **skip** | **int32**| The offset into the records to return. | [default to 0] - **filter** | [**[]string**](string.md)| Supported operators are: eq | - **xOrgId** | **string**| | [default to ] - -### Return type - -[**[]SystemInsightsBitlockerInfo**](system-insights-bitlocker-info.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **SysteminsightsListSystemEtcHosts** -> []SystemInsightsBitlockerInfo SysteminsightsListSystemEtcHosts(ctx, systemId, contentType, accept, optional) -List System Insights System Etc Hosts - -Valid filter fields are `address`. - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **systemId** | **string**| | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **systemId** | **string**| | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **limit** | **int32**| | [default to 10] - **skip** | **int32**| The offset into the records to return. | [default to 0] - **filter** | [**[]string**](string.md)| Supported operators are: eq | - **xOrgId** | **string**| | [default to ] - -### Return type - -[**[]SystemInsightsBitlockerInfo**](system-insights-bitlocker-info.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **SysteminsightsListSystemFirefoxAddons** -> []SystemInsightsFirefoxAddons SysteminsightsListSystemFirefoxAddons(ctx, systemId, contentType, accept, optional) -List System Insights System Firefox Addons - -Valid filter fields are `name`. - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **systemId** | **string**| | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **systemId** | **string**| | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **limit** | **int32**| | [default to 10] - **skip** | **int32**| The offset into the records to return. | [default to 0] - **filter** | [**[]string**](string.md)| Supported operators are: eq | - **xOrgId** | **string**| | [default to ] - -### Return type - -[**[]SystemInsightsFirefoxAddons**](system-insights-firefox-addons.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **SysteminsightsListSystemGroups** -> []SystemInsightsGroups SysteminsightsListSystemGroups(ctx, systemId, contentType, accept, optional) -List System Insights System Groups - -Valid filter fields are `groupname`. - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **systemId** | **string**| | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **systemId** | **string**| | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **limit** | **int32**| | [default to 10] - **skip** | **int32**| The offset into the records to return. | [default to 0] - **filter** | [**[]string**](string.md)| Supported operators are: eq | - **xOrgId** | **string**| | [default to ] - -### Return type - -[**[]SystemInsightsGroups**](system-insights-groups.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **SysteminsightsListSystemInfo** -> []SystemInsightsSystemInfo SysteminsightsListSystemInfo(ctx, contentType, accept, optional) -List System Insights System Info - -Valid filter fields are `system_id` and `cpu_subtype`. - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **limit** | **int32**| | [default to 10] - **skip** | **int32**| The offset into the records to return. | [default to 0] - **filter** | [**[]string**](string.md)| Supported operators are: eq | - **xOrgId** | **string**| | [default to ] - -### Return type - -[**[]SystemInsightsSystemInfo**](system-insights-system-info.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **SysteminsightsListSystemInterfaceAddresses** -> []SystemInsightsInterfaceAddresses SysteminsightsListSystemInterfaceAddresses(ctx, systemId, contentType, accept, optional) -List System Insights System Interface Addresses - -Valid filter fields are `address`. - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **systemId** | **string**| | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **systemId** | **string**| | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **limit** | **int32**| | [default to 10] - **skip** | **int32**| The offset into the records to return. | [default to 0] - **filter** | [**[]string**](string.md)| Supported operators are: eq | - **xOrgId** | **string**| | [default to ] - -### Return type - -[**[]SystemInsightsInterfaceAddresses**](system-insights-interface-addresses.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **SysteminsightsListSystemKernelInfo** -> []SystemInsightsKernelInfo SysteminsightsListSystemKernelInfo(ctx, systemId, contentType, accept, optional) -List System Insights System Kernel Info - -Valid filter fields are `version`. - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **systemId** | **string**| | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **systemId** | **string**| | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **limit** | **int32**| | [default to 10] - **skip** | **int32**| The offset into the records to return. | [default to 0] - **filter** | [**[]string**](string.md)| Supported operators are: eq | - **xOrgId** | **string**| | [default to ] - -### Return type - -[**[]SystemInsightsKernelInfo**](system-insights-kernel-info.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **SysteminsightsListSystemLogicalDrives** -> []SystemInsightsLogicalDrvies SysteminsightsListSystemLogicalDrives(ctx, systemId, contentType, accept, optional) -List System Insights System Logical Drives - -Valid filter fields are `device_id`. - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **systemId** | **string**| | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **systemId** | **string**| | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **limit** | **int32**| | [default to 10] - **skip** | **int32**| The offset into the records to return. | [default to 0] - **filter** | [**[]string**](string.md)| Supported operators are: eq | - **xOrgId** | **string**| | [default to ] - -### Return type - -[**[]SystemInsightsLogicalDrvies**](system-insights-logical-drvies.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **SysteminsightsListSystemMounts** -> []SystemInsightsMounts SysteminsightsListSystemMounts(ctx, systemId, contentType, accept, optional) -List System Insights System Mounts - -Valid filter fields are `path`. - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **systemId** | **string**| | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **systemId** | **string**| | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **limit** | **int32**| | [default to 10] - **skip** | **int32**| The offset into the records to return. | [default to 0] - **filter** | [**[]string**](string.md)| Supported operators are: eq | - **xOrgId** | **string**| | [default to ] - -### Return type - -[**[]SystemInsightsMounts**](system-insights-mounts.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **SysteminsightsListSystemOsVersion** -> []SystemInsightsOsVersion SysteminsightsListSystemOsVersion(ctx, systemId, contentType, accept, optional) -List System Insights System OS Version - -Valid filter fields are `version`. - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **systemId** | **string**| | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **systemId** | **string**| | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **limit** | **int32**| | [default to 10] - **skip** | **int32**| The offset into the records to return. | [default to 0] - **filter** | [**[]string**](string.md)| Supported operators are: eq | - **xOrgId** | **string**| | [default to ] - -### Return type - -[**[]SystemInsightsOsVersion**](system-insights-os-version.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **SysteminsightsListSystemPatches** -> []SystemInsightsPatches SysteminsightsListSystemPatches(ctx, systemId, contentType, accept, optional) -List System Insights System Patches - -Valid filter fields are `hotfix_id `. - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **systemId** | **string**| | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **systemId** | **string**| | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **limit** | **int32**| | [default to 10] - **skip** | **int32**| The offset into the records to return. | [default to 0] - **filter** | [**[]string**](string.md)| Supported operators are: eq | - **xOrgId** | **string**| | [default to ] - -### Return type - -[**[]SystemInsightsPatches**](system-insights-patches.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **SysteminsightsListSystemPrograms** -> []SystemInsightsPrograms SysteminsightsListSystemPrograms(ctx, systemId, contentType, accept, optional) -List System Insights System Programs - -Valid filter fields are `name`. - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **systemId** | **string**| | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **systemId** | **string**| | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **limit** | **int32**| | [default to 10] - **skip** | **int32**| The offset into the records to return. | [default to 0] - **filter** | [**[]string**](string.md)| Supported operators are: eq | - **xOrgId** | **string**| | [default to ] - -### Return type - -[**[]SystemInsightsPrograms**](system-insights-programs.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **SysteminsightsListSystemSafariExtensions** -> []SystemInsightsSafariExtensions SysteminsightsListSystemSafariExtensions(ctx, systemId, contentType, accept, optional) -List System Insights System Safari Extensions - -Valid filter fields are `name`. - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **systemId** | **string**| | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **systemId** | **string**| | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **limit** | **int32**| | [default to 10] - **skip** | **int32**| The offset into the records to return. | [default to 0] - **filter** | [**[]string**](string.md)| Supported operators are: eq | - **xOrgId** | **string**| | [default to ] - -### Return type - -[**[]SystemInsightsSafariExtensions**](system-insights-safari-extensions.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **SysteminsightsListSystemSystemControls** -> []SystemInsightsSystemControls SysteminsightsListSystemSystemControls(ctx, systemId, contentType, accept, optional) -List System Insights System System Controls - -Valid filter fields are `name`. - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **systemId** | **string**| | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **systemId** | **string**| | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **limit** | **int32**| | [default to 10] - **skip** | **int32**| The offset into the records to return. | [default to 0] - **filter** | [**[]string**](string.md)| Supported operators are: eq | - **xOrgId** | **string**| | [default to ] - -### Return type - -[**[]SystemInsightsSystemControls**](system-insights-system-controls.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **SysteminsightsListSystemSystemInfo** -> []SystemInsightsSystemInfo SysteminsightsListSystemSystemInfo(ctx, systemId, contentType, accept, optional) -List System Insights System System Info - -Valid filter fields are `cpu_subtype`. - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **systemId** | **string**| | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **systemId** | **string**| | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **limit** | **int32**| | [default to 10] - **skip** | **int32**| The offset into the records to return. | [default to 0] - **filter** | [**[]string**](string.md)| Supported operators are: eq | - **xOrgId** | **string**| | [default to ] - -### Return type - -[**[]SystemInsightsSystemInfo**](system-insights-system-info.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **SysteminsightsListSystemUptime** -> []SystemInsightsUptime SysteminsightsListSystemUptime(ctx, systemId, contentType, accept, optional) -List System Insights System Uptime - -Valid filter fields are `days`. - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **systemId** | **string**| | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **systemId** | **string**| | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **limit** | **int32**| | [default to 10] - **skip** | **int32**| The offset into the records to return. | [default to 0] - **filter** | [**[]string**](string.md)| Supported operators are: eq | - **xOrgId** | **string**| | [default to ] - -### Return type - -[**[]SystemInsightsUptime**](system-insights-uptime.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **SysteminsightsListSystemUsers** -> []SystemInsightsUsers SysteminsightsListSystemUsers(ctx, systemId, contentType, accept, optional) -List System Insights System Users - -Valid filter fields are `username`. - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **systemId** | **string**| | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **systemId** | **string**| | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **limit** | **int32**| | [default to 10] - **skip** | **int32**| The offset into the records to return. | [default to 0] - **filter** | [**[]string**](string.md)| Supported operators are: eq | - **xOrgId** | **string**| | [default to ] - -### Return type - -[**[]SystemInsightsUsers**](system-insights-users.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **SysteminsightsListUptime** -> []SystemInsightsUptime SysteminsightsListUptime(ctx, contentType, accept, optional) -List System Insights Uptime - -Valid filter fields are `system_id` and `days`. - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **limit** | **int32**| | [default to 10] - **skip** | **int32**| The offset into the records to return. | [default to 0] - **filter** | [**[]string**](string.md)| Supported operators are: eq | - **xOrgId** | **string**| | [default to ] - -### Return type - -[**[]SystemInsightsUptime**](system-insights-uptime.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **SysteminsightsListUsbDevices** -> []SystemInsightsUsbDevices SysteminsightsListUsbDevices(ctx, contentType, accept, optional) -List System Insights USB Devices - -Valid filter fields are `system_id` and `model`. - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **limit** | **int32**| | [default to 10] - **xOrgId** | **string**| | [default to ] - **skip** | **int32**| The offset into the records to return. | [default to 0] - **filter** | [**[]string**](string.md)| Supported operators are: eq | - -### Return type - -[**[]SystemInsightsUsbDevices**](system-insights-usb-devices.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **SysteminsightsListUserGroups** -> []SystemInsightsUserGroups SysteminsightsListUserGroups(ctx, contentType, accept, optional) -List System Insights User Groups - -Only valid filter field is `system_id`. - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **limit** | **int32**| | [default to 10] - **xOrgId** | **string**| | [default to ] - **skip** | **int32**| The offset into the records to return. | [default to 0] - **filter** | [**[]string**](string.md)| Supported operators are: eq | - -### Return type - -[**[]SystemInsightsUserGroups**](system-insights-user-groups.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **SysteminsightsListUsers** -> []SystemInsightsUsers SysteminsightsListUsers(ctx, contentType, accept, optional) -List System Insights Users - -Valid filter fields are `system_id` and `username`. - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **limit** | **int32**| | [default to 10] - **skip** | **int32**| The offset into the records to return. | [default to 0] - **filter** | [**[]string**](string.md)| Supported operators are: eq | - **xOrgId** | **string**| | [default to ] - -### Return type - -[**[]SystemInsightsUsers**](system-insights-users.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **SysteminsightsListWindowsCrashes** -> []SystemInsightsWindowsCrashes SysteminsightsListWindowsCrashes(ctx, contentType, accept, optional) -List System Insights Windows Crashes - -Valid filter fields are `system_id` and `type`. - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **limit** | **int32**| | [default to 10] - **xOrgId** | **string**| | [default to ] - **skip** | **int32**| The offset into the records to return. | [default to 0] - **filter** | [**[]string**](string.md)| Supported operators are: eq | - -### Return type - -[**[]SystemInsightsWindowsCrashes**](system-insights-windows-crashes.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - diff --git a/v2/docs/SystemInsightsLogicalDrvies.md b/v2/docs/SystemInsightsLogicalDrvies.md deleted file mode 100644 index fae4d1f..0000000 --- a/v2/docs/SystemInsightsLogicalDrvies.md +++ /dev/null @@ -1,17 +0,0 @@ -# SystemInsightsLogicalDrvies - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**BootPartition** | **int32** | | [optional] [default to null] -**CollectionTime** | **string** | | [optional] [default to null] -**DeviceId** | **string** | | [optional] [default to null] -**FileSystem** | **string** | | [optional] [default to null] -**FreeSpace** | **string** | | [optional] [default to null] -**Size** | **string** | | [optional] [default to null] -**SystemId** | **string** | | [optional] [default to null] -**Type_** | **string** | | [optional] [default to null] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/v2/docs/SystemInsightsUsers.md b/v2/docs/SystemInsightsUsers.md deleted file mode 100644 index cd984df..0000000 --- a/v2/docs/SystemInsightsUsers.md +++ /dev/null @@ -1,21 +0,0 @@ -# SystemInsightsUsers - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**CollectionTime** | **string** | | [optional] [default to null] -**Description** | **string** | | [optional] [default to null] -**Directory** | **string** | | [optional] [default to null] -**Gid** | **string** | | [optional] [default to null] -**GidSigned** | **string** | | [optional] [default to null] -**Shell** | **string** | | [optional] [default to null] -**SystemId** | **string** | | [optional] [default to null] -**Type_** | **string** | | [optional] [default to null] -**Uid** | **string** | | [optional] [default to null] -**UidSigned** | **string** | | [optional] [default to null] -**Username** | **string** | | [optional] [default to null] -**Uuid** | **string** | | [optional] [default to null] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/v2/docs/SystemInsightsWindowsCrashes.md b/v2/docs/SystemInsightsWindowsCrashes.md deleted file mode 100644 index 978f9af..0000000 --- a/v2/docs/SystemInsightsWindowsCrashes.md +++ /dev/null @@ -1,30 +0,0 @@ -# SystemInsightsWindowsCrashes - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**BuildNumber** | **int32** | | [optional] [default to null] -**CommandLine** | **string** | | [optional] [default to null] -**CrashPath** | **string** | | [optional] [default to null] -**CurrentDirectory** | **string** | | [optional] [default to null] -**Datetime** | **string** | | [optional] [default to null] -**ExceptionAddress** | **string** | | [optional] [default to null] -**ExceptionCode** | **string** | | [optional] [default to null] -**ExceptionMessage** | **string** | | [optional] [default to null] -**MachineName** | **string** | | [optional] [default to null] -**MajorVersion** | **int32** | | [optional] [default to null] -**MinorVersion** | **int32** | | [optional] [default to null] -**Module** | **string** | | [optional] [default to null] -**Path** | **string** | | [optional] [default to null] -**Pid** | **string** | | [optional] [default to null] -**ProcessUptime** | **string** | | [optional] [default to null] -**Registers** | **string** | | [optional] [default to null] -**StackTrace** | **string** | | [optional] [default to null] -**Tid** | **string** | | [optional] [default to null] -**Type_** | **string** | | [optional] [default to null] -**Username** | **string** | | [optional] [default to null] -**Version** | **string** | | [optional] [default to null] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/v2/docs/SystemsApi.md b/v2/docs/SystemsApi.md deleted file mode 100644 index 0bb9599..0000000 --- a/v2/docs/SystemsApi.md +++ /dev/null @@ -1,371 +0,0 @@ -# \SystemsApi - -All URIs are relative to *https://console.jumpcloud.com/api/v2* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**GraphSystemAssociationsList**](SystemsApi.md#GraphSystemAssociationsList) | **Get** /systems/{system_id}/associations | List the associations of a System -[**GraphSystemAssociationsPost**](SystemsApi.md#GraphSystemAssociationsPost) | **Post** /systems/{system_id}/associations | Manage associations of a System -[**GraphSystemMemberOf**](SystemsApi.md#GraphSystemMemberOf) | **Get** /systems/{system_id}/memberof | List the parent Groups of a System -[**GraphSystemTraverseCommand**](SystemsApi.md#GraphSystemTraverseCommand) | **Get** /systems/{system_id}/commands | List the Commands bound to a System -[**GraphSystemTraversePolicy**](SystemsApi.md#GraphSystemTraversePolicy) | **Get** /systems/{system_id}/policies | List the Policies bound to a System -[**GraphSystemTraverseUser**](SystemsApi.md#GraphSystemTraverseUser) | **Get** /systems/{system_id}/users | List the Users bound to a System -[**GraphSystemTraverseUserGroup**](SystemsApi.md#GraphSystemTraverseUserGroup) | **Get** /systems/{system_id}/usergroups | List the User Groups bound to a System -[**SystemsGetFDEKey**](SystemsApi.md#SystemsGetFDEKey) | **Get** /systems/{system_id}/fdekey | Get System FDE Key - - -# **GraphSystemAssociationsList** -> []GraphConnection GraphSystemAssociationsList(ctx, systemId, contentType, accept, targets, optional) -List the associations of a System - -This endpoint returns the _direct_ associations of a System. A direct association can be a non-homogeneous relationship between 2 different objects, for example Systems and Users. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/systems/{System_ID}/associations?targets=user \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **systemId** | **string**| ObjectID of the System. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **targets** | [**[]string**](string.md)| | - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **systemId** | **string**| ObjectID of the System. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **targets** | [**[]string**](string.md)| | - **limit** | **int32**| The number of records to return at once. Limited to 100. | [default to 10] - **skip** | **int32**| The offset into the records to return. | [default to 0] - **date** | **string**| Current date header for the System Context API | - **authorization** | **string**| Authorization header for the System Context API | - **xOrgId** | **string**| | [default to ] - -### Return type - -[**[]GraphConnection**](GraphConnection.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **GraphSystemAssociationsPost** -> GraphSystemAssociationsPost(ctx, systemId, contentType, accept, optional) -Manage associations of a System - -This endpoint allows you to manage the _direct_ associations of a System. A direct association can be a non-homogeneous relationship between 2 different objects, for example Systems and Users. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/systems/{System_ID}/associations \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"attributes\": { \"sudo\": { \"enabled\": true, \"withoutPassword\": false } }, \"op\": \"add\", \"type\": \"user\", \"id\": \"UserID\" }' ``` - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **systemId** | **string**| ObjectID of the System. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **systemId** | **string**| ObjectID of the System. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **body** | [**SystemGraphManagementReq**](SystemGraphManagementReq.md)| | - **date** | **string**| Current date header for the System Context API | - **authorization** | **string**| Authorization header for the System Context API | - **xOrgId** | **string**| | [default to ] - -### Return type - - (empty response body) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **GraphSystemMemberOf** -> []GraphObjectWithPaths GraphSystemMemberOf(ctx, systemId, contentType, accept, optional) -List the parent Groups of a System - -This endpoint returns all the System Groups a System is a member of. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/systems/{System_ID}/memberof \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **systemId** | **string**| ObjectID of the System. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **systemId** | **string**| ObjectID of the System. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **filter** | [**[]string**](string.md)| Supported operators are: eq, ne, gt, ge, lt, le, between, search, in | - **limit** | **int32**| The number of records to return at once. Limited to 100. | [default to 10] - **skip** | **int32**| The offset into the records to return. | [default to 0] - **date** | **string**| Current date header for the System Context API | - **authorization** | **string**| Authorization header for the System Context API | - **sort** | [**[]string**](string.md)| The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. | - **xOrgId** | **string**| | [default to ] - -### Return type - -[**[]GraphObjectWithPaths**](GraphObjectWithPaths.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **GraphSystemTraverseCommand** -> []GraphObjectWithPaths GraphSystemTraverseCommand(ctx, systemId, contentType, accept, optional) -List the Commands bound to a System - -This endpoint will return all Commands bound to a System, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this System to the corresponding Command; this array represents all grouping and/or associations that would have to be removed to deprovision the Command from this System. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/systems/{System_ID}/commands \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **systemId** | **string**| ObjectID of the System. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **systemId** | **string**| ObjectID of the System. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **limit** | **int32**| The number of records to return at once. Limited to 100. | [default to 10] - **xOrgId** | **string**| | [default to ] - **skip** | **int32**| The offset into the records to return. | [default to 0] - **filter** | [**[]string**](string.md)| Supported operators are: eq, ne, gt, ge, lt, le, between, search, in | - -### Return type - -[**[]GraphObjectWithPaths**](GraphObjectWithPaths.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **GraphSystemTraversePolicy** -> []GraphObjectWithPaths GraphSystemTraversePolicy(ctx, systemId, contentType, accept, optional) -List the Policies bound to a System - -This endpoint will return all Policies bound to a System, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this System to the corresponding Policy; this array represents all grouping and/or associations that would have to be removed to deprovision the Policy from this System. See `/members` and `/associations` endpoints to manage those collections. This endpoint is not yet public as we have finish the code. ##### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/{System_ID}/policies \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **systemId** | **string**| ObjectID of the System. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **systemId** | **string**| ObjectID of the System. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **limit** | **int32**| The number of records to return at once. Limited to 100. | [default to 10] - **xOrgId** | **string**| | [default to ] - **skip** | **int32**| The offset into the records to return. | [default to 0] - **filter** | [**[]string**](string.md)| Supported operators are: eq, ne, gt, ge, lt, le, between, search, in | - -### Return type - -[**[]GraphObjectWithPaths**](GraphObjectWithPaths.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **GraphSystemTraverseUser** -> []GraphObjectWithPaths GraphSystemTraverseUser(ctx, systemId, contentType, accept, optional) -List the Users bound to a System - -This endpoint will return all Users bound to a System, either directly or indirectly essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this System to the corresponding User; this array represents all grouping and/or associations that would have to be removed to deprovision the User from this System. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/systems/{System_ID}/users \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **systemId** | **string**| ObjectID of the System. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **systemId** | **string**| ObjectID of the System. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **limit** | **int32**| The number of records to return at once. Limited to 100. | [default to 10] - **xOrgId** | **string**| | [default to ] - **skip** | **int32**| The offset into the records to return. | [default to 0] - **date** | **string**| Current date header for the System Context API | - **authorization** | **string**| Authorization header for the System Context API | - **filter** | [**[]string**](string.md)| Supported operators are: eq, ne, gt, ge, lt, le, between, search, in | - -### Return type - -[**[]GraphObjectWithPaths**](GraphObjectWithPaths.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **GraphSystemTraverseUserGroup** -> []GraphObjectWithPaths GraphSystemTraverseUserGroup(ctx, systemId, contentType, accept, optional) -List the User Groups bound to a System - -This endpoint will return all User Groups bound to a System, either directly or indirectly essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this System to the corresponding User Group; this array represents all grouping and/or associations that would have to be removed to deprovision the User Group from this System. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/systems/{System_ID}/usergroups \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **systemId** | **string**| ObjectID of the System. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **systemId** | **string**| ObjectID of the System. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **limit** | **int32**| The number of records to return at once. Limited to 100. | [default to 10] - **xOrgId** | **string**| | [default to ] - **skip** | **int32**| The offset into the records to return. | [default to 0] - **date** | **string**| Current date header for the System Context API | - **authorization** | **string**| Authorization header for the System Context API | - **filter** | [**[]string**](string.md)| Supported operators are: eq, ne, gt, ge, lt, le, between, search, in | - -### Return type - -[**[]GraphObjectWithPaths**](GraphObjectWithPaths.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **SystemsGetFDEKey** -> Systemfdekey SystemsGetFDEKey(ctx, systemId, optional) -Get System FDE Key - -This endpoint will return the current (latest) fde key saved for a system. - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **systemId** | **string**| | - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **systemId** | **string**| | - **xOrgId** | **string**| | [default to ] - -### Return type - -[**Systemfdekey**](systemfdekey.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - diff --git a/v2/docs/Systemuser.md b/v2/docs/Systemuser.md deleted file mode 100644 index 4918767..0000000 --- a/v2/docs/Systemuser.md +++ /dev/null @@ -1,50 +0,0 @@ -# Systemuser - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Id** | **string** | | [optional] [default to null] -**AccountLocked** | **bool** | | [optional] [default to null] -**Activated** | **bool** | | [optional] [default to null] -**AllowPublicKey** | **bool** | | [optional] [default to null] -**AssociatedTagCount** | **int32** | | [optional] [default to null] -**Attributes** | [**[]interface{}**](interface{}.md) | | [optional] [default to null] -**Company** | **string** | | [optional] [default to null] -**CostCenter** | **string** | | [optional] [default to null] -**Created** | **string** | | [optional] [default to null] -**Department** | **string** | | [optional] [default to null] -**Description** | **string** | | [optional] [default to null] -**Displayname** | **string** | | [optional] [default to null] -**Email** | **string** | | [optional] [default to null] -**EmployeeIdentifier** | **string** | Must be unique per user. | [optional] [default to null] -**EmployeeType** | **string** | | [optional] [default to null] -**EnableManagedUid** | **bool** | | [optional] [default to null] -**EnableUserPortalMultifactor** | **bool** | | [optional] [default to null] -**ExternalDn** | **string** | | [optional] [default to null] -**ExternalSourceType** | **string** | | [optional] [default to null] -**ExternallyManaged** | **bool** | | [optional] [default to null] -**Firstname** | **string** | | [optional] [default to null] -**JobTitle** | **string** | | [optional] [default to null] -**Lastname** | **string** | | [optional] [default to null] -**LdapBindingUser** | **bool** | | [optional] [default to null] -**Location** | **string** | | [optional] [default to null] -**Mfa** | [***Mfa**](mfa.md) | | [optional] [default to null] -**Middlename** | **string** | | [optional] [default to null] -**PasswordExpirationDate** | **string** | | [optional] [default to null] -**PasswordExpired** | **bool** | | [optional] [default to null] -**PasswordNeverExpires** | **bool** | | [optional] [default to null] -**PasswordlessSudo** | **bool** | | [optional] [default to null] -**PublicKey** | **string** | | [optional] [default to null] -**SambaServiceUser** | **bool** | | [optional] [default to null] -**SshKeys** | [**[]Sshkeylist**](sshkeylist.md) | | [optional] [default to null] -**Sudo** | **bool** | | [optional] [default to null] -**Suspended** | **bool** | | [optional] [default to null] -**Tags** | **[]string** | | [optional] [default to null] -**TotpEnabled** | **bool** | | [optional] [default to null] -**UnixGuid** | **int32** | | [optional] [default to null] -**UnixUid** | **int32** | | [optional] [default to null] -**Username** | **string** | | [optional] [default to null] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/v2/docs/Systemuserputpost.md b/v2/docs/Systemuserputpost.md deleted file mode 100644 index 7a63c52..0000000 --- a/v2/docs/Systemuserputpost.md +++ /dev/null @@ -1,47 +0,0 @@ -# Systemuserputpost - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**AccountLocked** | **bool** | | [optional] [default to null] -**Activated** | **bool** | | [optional] [default to null] -**Addresses** | [**[]SystemuserputpostAddresses**](systemuserputpost_addresses.md) | | [optional] [default to null] -**AllowPublicKey** | **bool** | | [optional] [default to null] -**Attributes** | [**[]interface{}**](interface{}.md) | | [optional] [default to null] -**Company** | **string** | | [optional] [default to null] -**CostCenter** | **string** | | [optional] [default to null] -**Department** | **string** | | [optional] [default to null] -**Description** | **string** | | [optional] [default to null] -**Displayname** | **string** | | [optional] [default to null] -**Email** | **string** | | [default to null] -**EmployeeIdentifier** | **string** | Must be unique per user. | [optional] [default to null] -**EmployeeType** | **string** | | [optional] [default to null] -**EnableManagedUid** | **bool** | | [optional] [default to null] -**EnableUserPortalMultifactor** | **bool** | | [optional] [default to null] -**ExternalDn** | **string** | | [optional] [default to null] -**ExternalSourceType** | **string** | | [optional] [default to null] -**ExternallyManaged** | **bool** | | [optional] [default to null] -**Firstname** | **string** | | [optional] [default to null] -**JobTitle** | **string** | | [optional] [default to null] -**Lastname** | **string** | | [optional] [default to null] -**LdapBindingUser** | **bool** | | [optional] [default to null] -**Location** | **string** | | [optional] [default to null] -**Mfa** | [***Mfa**](mfa.md) | | [optional] [default to null] -**Middlename** | **string** | | [optional] [default to null] -**Password** | **string** | | [optional] [default to null] -**PasswordNeverExpires** | **bool** | | [optional] [default to null] -**PasswordlessSudo** | **bool** | | [optional] [default to null] -**PhoneNumbers** | [**[]SystemuserputpostPhoneNumbers**](systemuserputpost_phoneNumbers.md) | | [optional] [default to null] -**PublicKey** | **string** | | [optional] [default to null] -**Relationships** | [**[]interface{}**](interface{}.md) | | [optional] [default to null] -**SambaServiceUser** | **bool** | | [optional] [default to null] -**Sudo** | **bool** | | [optional] [default to null] -**Suspended** | **bool** | | [optional] [default to null] -**Tags** | **[]string** | | [optional] [default to null] -**UnixGuid** | **int32** | | [optional] [default to null] -**UnixUid** | **int32** | | [optional] [default to null] -**Username** | **string** | | [default to null] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/v2/docs/SystemuserputpostAddresses.md b/v2/docs/SystemuserputpostAddresses.md deleted file mode 100644 index b788ebc..0000000 --- a/v2/docs/SystemuserputpostAddresses.md +++ /dev/null @@ -1,17 +0,0 @@ -# SystemuserputpostAddresses - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Country** | **string** | | [optional] [default to null] -**ExtendedAddress** | **string** | | [optional] [default to null] -**Locality** | **string** | | [optional] [default to null] -**PoBox** | **string** | | [optional] [default to null] -**PostalCode** | **string** | | [optional] [default to null] -**Region** | **string** | | [optional] [default to null] -**StreetAddress** | **string** | | [optional] [default to null] -**Type_** | **string** | | [optional] [default to null] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/v2/docs/SystemuserputpostPhoneNumbers.md b/v2/docs/SystemuserputpostPhoneNumbers.md deleted file mode 100644 index 0d0f196..0000000 --- a/v2/docs/SystemuserputpostPhoneNumbers.md +++ /dev/null @@ -1,11 +0,0 @@ -# SystemuserputpostPhoneNumbers - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Number** | **string** | | [optional] [default to null] -**Type_** | **string** | | [optional] [default to null] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/v2/docs/UserGraphManagementReq.md b/v2/docs/UserGraphManagementReq.md deleted file mode 100644 index e7306f3..0000000 --- a/v2/docs/UserGraphManagementReq.md +++ /dev/null @@ -1,13 +0,0 @@ -# UserGraphManagementReq - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Attributes** | [***SystemGraphManagementReqAttributes**](SystemGraphManagementReq_attributes.md) | | [optional] [default to null] -**Id** | **string** | The ObjectID of graph object being added or removed as an association. | [default to null] -**Op** | **string** | How to modify the graph connection. | [default to null] -**Type_** | **string** | | [default to null] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/v2/docs/UserGroup.md b/v2/docs/UserGroup.md deleted file mode 100644 index 77f1134..0000000 --- a/v2/docs/UserGroup.md +++ /dev/null @@ -1,13 +0,0 @@ -# UserGroup - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Attributes** | [***UserGroupAttributes**](UserGroupAttributes.md) | | [optional] [default to null] -**Id** | **string** | ObjectId uniquely identifying a User Group. | [optional] [default to null] -**Name** | **string** | Display name of a User Group. | [optional] [default to null] -**Type_** | **string** | The type of the group. | [optional] [default to null] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/v2/docs/UserGroupAssociationsApi.md b/v2/docs/UserGroupAssociationsApi.md deleted file mode 100644 index 795f456..0000000 --- a/v2/docs/UserGroupAssociationsApi.md +++ /dev/null @@ -1,502 +0,0 @@ -# \UserGroupAssociationsApi - -All URIs are relative to *https://console.jumpcloud.com/api/v2* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**GraphUserGroupAssociationsList**](UserGroupAssociationsApi.md#GraphUserGroupAssociationsList) | **Get** /usergroups/{group_id}/associations | List the associations of a User Group. -[**GraphUserGroupAssociationsPost**](UserGroupAssociationsApi.md#GraphUserGroupAssociationsPost) | **Post** /usergroups/{group_id}/associations | Manage the associations of a User Group -[**GraphUserGroupTraverseActiveDirectory**](UserGroupAssociationsApi.md#GraphUserGroupTraverseActiveDirectory) | **Get** /usergroups/{group_id}/activedirectories | List the Active Directories bound to a User Group -[**GraphUserGroupTraverseApplication**](UserGroupAssociationsApi.md#GraphUserGroupTraverseApplication) | **Get** /usergroups/{group_id}/applications | List the Applications bound to a User Group -[**GraphUserGroupTraverseDirectory**](UserGroupAssociationsApi.md#GraphUserGroupTraverseDirectory) | **Get** /usergroups/{group_id}/directories | List the Directories bound to a User Group -[**GraphUserGroupTraverseGSuite**](UserGroupAssociationsApi.md#GraphUserGroupTraverseGSuite) | **Get** /usergroups/{group_id}/gsuites | List the G Suite instances bound to a User Group -[**GraphUserGroupTraverseLdapServer**](UserGroupAssociationsApi.md#GraphUserGroupTraverseLdapServer) | **Get** /usergroups/{group_id}/ldapservers | List the LDAP Servers bound to a User Group -[**GraphUserGroupTraverseOffice365**](UserGroupAssociationsApi.md#GraphUserGroupTraverseOffice365) | **Get** /usergroups/{group_id}/office365s | List the Office 365 instances bound to a User Group -[**GraphUserGroupTraverseRadiusServer**](UserGroupAssociationsApi.md#GraphUserGroupTraverseRadiusServer) | **Get** /usergroups/{group_id}/radiusservers | List the RADIUS Servers bound to a User Group -[**GraphUserGroupTraverseSystem**](UserGroupAssociationsApi.md#GraphUserGroupTraverseSystem) | **Get** /usergroups/{group_id}/systems | List the Systems bound to a User Group -[**GraphUserGroupTraverseSystemGroup**](UserGroupAssociationsApi.md#GraphUserGroupTraverseSystemGroup) | **Get** /usergroups/{group_id}/systemgroups | List the System Groups bound to User Groups - - -# **GraphUserGroupAssociationsList** -> []GraphConnection GraphUserGroupAssociationsList(ctx, groupId, contentType, accept, targets, optional) -List the associations of a User Group. - -This endpoint returns the _direct_ associations of this User Group. A direct association can be a non-homogeneous relationship between 2 different objects, for example User Groups and Users. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/usergroups/{GroupID}/associations?targets=system \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **groupId** | **string**| ObjectID of the User Group. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **targets** | [**[]string**](string.md)| | - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **groupId** | **string**| ObjectID of the User Group. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **targets** | [**[]string**](string.md)| | - **limit** | **int32**| The number of records to return at once. Limited to 100. | [default to 10] - **skip** | **int32**| The offset into the records to return. | [default to 0] - **xOrgId** | **string**| | [default to ] - -### Return type - -[**[]GraphConnection**](GraphConnection.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **GraphUserGroupAssociationsPost** -> GraphUserGroupAssociationsPost(ctx, groupId, contentType, accept, optional) -Manage the associations of a User Group - -This endpoint manages the _direct_ associations of this User Group. A direct association can be a non-homogeneous relationship between 2 different objects, for example User Groups and Users. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/usergroups/{GroupID}/associations \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"op\": \"add\", \"type\": \"system\", \"id\": \"{SystemID}\" }' ``` - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **groupId** | **string**| ObjectID of the User Group. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **groupId** | **string**| ObjectID of the User Group. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **body** | [**UserGroupGraphManagementReq**](UserGroupGraphManagementReq.md)| | - **xOrgId** | **string**| | [default to ] - -### Return type - - (empty response body) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **GraphUserGroupTraverseActiveDirectory** -> []GraphObjectWithPaths GraphUserGroupTraverseActiveDirectory(ctx, groupId, contentType, accept, optional) -List the Active Directories bound to a User Group - -This endpoint will return all Active Directory Instances bound to a User Group, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this User Group to the corresponding Active Directory; this array represents all grouping and/or associations that would have to be removed to deprovision the Active Directory from this User Group. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/usergroups/{GroupID}/activedirectories \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **groupId** | **string**| ObjectID of the User Group. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **groupId** | **string**| ObjectID of the User Group. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **limit** | **int32**| The number of records to return at once. Limited to 100. | [default to 10] - **xOrgId** | **string**| | [default to ] - **skip** | **int32**| The offset into the records to return. | [default to 0] - **filter** | [**[]string**](string.md)| Supported operators are: eq, ne, gt, ge, lt, le, between, search, in | - -### Return type - -[**[]GraphObjectWithPaths**](GraphObjectWithPaths.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **GraphUserGroupTraverseApplication** -> []GraphObjectWithPaths GraphUserGroupTraverseApplication(ctx, groupId, contentType, accept, optional) -List the Applications bound to a User Group - -This endpoint will return all Applications bound to a User Group, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this User Group to the corresponding Application; this array represents all grouping and/or associations that would have to be removed to deprovision the Application from this User Group. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/usergroups/{GroupID}/applications \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **groupId** | **string**| ObjectID of the User Group. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **groupId** | **string**| ObjectID of the User Group. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **limit** | **int32**| The number of records to return at once. Limited to 100. | [default to 10] - **xOrgId** | **string**| | [default to ] - **skip** | **int32**| The offset into the records to return. | [default to 0] - **filter** | [**[]string**](string.md)| Supported operators are: eq, ne, gt, ge, lt, le, between, search, in | - -### Return type - -[**[]GraphObjectWithPaths**](GraphObjectWithPaths.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **GraphUserGroupTraverseDirectory** -> []GraphObjectWithPaths GraphUserGroupTraverseDirectory(ctx, groupId, contentType, accept, optional) -List the Directories bound to a User Group - -This endpoint will return all Directories bound to a User Group, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this User Group to the corresponding Directory; this array represents all grouping and/or associations that would have to be removed to deprovision the Directories from this User Group. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/usergroups/{GroupID}/directories \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **groupId** | **string**| ObjectID of the User Group. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **groupId** | **string**| ObjectID of the User Group. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **limit** | **int32**| The number of records to return at once. Limited to 100. | [default to 10] - **xOrgId** | **string**| | [default to ] - **skip** | **int32**| The offset into the records to return. | [default to 0] - **filter** | [**[]string**](string.md)| Supported operators are: eq, ne, gt, ge, lt, le, between, search, in | - -### Return type - -[**[]GraphObjectWithPaths**](GraphObjectWithPaths.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **GraphUserGroupTraverseGSuite** -> []GraphObjectWithPaths GraphUserGroupTraverseGSuite(ctx, groupId, contentType, accept, optional) -List the G Suite instances bound to a User Group - -This endpoint will return all G Suite Instances bound to a User Group, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this User Group to the corresponding G Suite instance; this array represents all grouping and/or associations that would have to be removed to deprovision the G Suite instance from this User Group. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/usergroups/{GroupID/gsuites \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **groupId** | **string**| ObjectID of the User Group. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **groupId** | **string**| ObjectID of the User Group. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **limit** | **int32**| The number of records to return at once. Limited to 100. | [default to 10] - **xOrgId** | **string**| | [default to ] - **skip** | **int32**| The offset into the records to return. | [default to 0] - **filter** | [**[]string**](string.md)| Supported operators are: eq, ne, gt, ge, lt, le, between, search, in | - -### Return type - -[**[]GraphObjectWithPaths**](GraphObjectWithPaths.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **GraphUserGroupTraverseLdapServer** -> []GraphObjectWithPaths GraphUserGroupTraverseLdapServer(ctx, groupId, contentType, accept, optional) -List the LDAP Servers bound to a User Group - -This endpoint will return all LDAP Servers bound to a User Group, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this User Group to the corresponding LDAP Server; this array represents all grouping and/or associations that would have to be removed to deprovision the LDAP Server from this User Group. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/usergroups/{GroupID}/ldapservers \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **groupId** | **string**| ObjectID of the User Group. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **groupId** | **string**| ObjectID of the User Group. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **limit** | **int32**| The number of records to return at once. Limited to 100. | [default to 10] - **xOrgId** | **string**| | [default to ] - **skip** | **int32**| The offset into the records to return. | [default to 0] - **filter** | [**[]string**](string.md)| Supported operators are: eq, ne, gt, ge, lt, le, between, search, in | - -### Return type - -[**[]GraphObjectWithPaths**](GraphObjectWithPaths.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **GraphUserGroupTraverseOffice365** -> []GraphObjectWithPaths GraphUserGroupTraverseOffice365(ctx, groupId, contentType, accept, optional) -List the Office 365 instances bound to a User Group - -This endpoint will return all Office 365 instances bound to a User Group, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this User Group to the corresponding Office 365 instance; this array represents all grouping and/or associations that would have to be removed to deprovision the Office 365 instance from this User Group. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/usergroups/{GroupID}/office365s \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **groupId** | **string**| ObjectID of the User Group. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **groupId** | **string**| ObjectID of the User Group. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **limit** | **int32**| The number of records to return at once. Limited to 100. | [default to 10] - **xOrgId** | **string**| | [default to ] - **skip** | **int32**| The offset into the records to return. | [default to 0] - **filter** | [**[]string**](string.md)| Supported operators are: eq, ne, gt, ge, lt, le, between, search, in | - -### Return type - -[**[]GraphObjectWithPaths**](GraphObjectWithPaths.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **GraphUserGroupTraverseRadiusServer** -> []GraphObjectWithPaths GraphUserGroupTraverseRadiusServer(ctx, groupId, contentType, accept, optional) -List the RADIUS Servers bound to a User Group - -This endpoint will return all RADIUS servers bound to a User Group, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this User Group to the corresponding RADIUS Server; this array represents all grouping and/or associations that would have to be removed to deprovision the RADIUS Server from this User Group. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/usergroups/{GroupID}/radiusservers \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **groupId** | **string**| ObjectID of the User Group. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **groupId** | **string**| ObjectID of the User Group. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **limit** | **int32**| The number of records to return at once. Limited to 100. | [default to 10] - **xOrgId** | **string**| | [default to ] - **skip** | **int32**| The offset into the records to return. | [default to 0] - **filter** | [**[]string**](string.md)| Supported operators are: eq, ne, gt, ge, lt, le, between, search, in | - -### Return type - -[**[]GraphObjectWithPaths**](GraphObjectWithPaths.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **GraphUserGroupTraverseSystem** -> []GraphObjectWithPaths GraphUserGroupTraverseSystem(ctx, groupId, contentType, accept, optional) -List the Systems bound to a User Group - -This endpoint will return all Systems bound to a User Group, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this User Group to the corresponding System; this array represents all grouping and/or associations that would have to be removed to deprovision the System from this User Group. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/usergroups/{GroupID}/systems \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **groupId** | **string**| ObjectID of the User Group. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **groupId** | **string**| ObjectID of the User Group. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **limit** | **int32**| The number of records to return at once. Limited to 100. | [default to 10] - **xOrgId** | **string**| | [default to ] - **skip** | **int32**| The offset into the records to return. | [default to 0] - **filter** | [**[]string**](string.md)| Supported operators are: eq, ne, gt, ge, lt, le, between, search, in | - -### Return type - -[**[]GraphObjectWithPaths**](GraphObjectWithPaths.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **GraphUserGroupTraverseSystemGroup** -> []GraphObjectWithPaths GraphUserGroupTraverseSystemGroup(ctx, groupId, contentType, accept, optional) -List the System Groups bound to User Groups - -This endpoint will return all System Groups bound to a User Group, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this User Group to the corresponding System Group; this array represents all grouping and/or associations that would have to be removed to deprovision the System Group from this User Group. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/usergroups/{GroupID}/systemgroups \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **groupId** | **string**| ObjectID of the User Group. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **groupId** | **string**| ObjectID of the User Group. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **limit** | **int32**| The number of records to return at once. Limited to 100. | [default to 10] - **xOrgId** | **string**| | [default to ] - **skip** | **int32**| The offset into the records to return. | [default to 0] - **filter** | [**[]string**](string.md)| Supported operators are: eq, ne, gt, ge, lt, le, between, search, in | - -### Return type - -[**[]GraphObjectWithPaths**](GraphObjectWithPaths.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - diff --git a/v2/docs/UserGroupAttributes.md b/v2/docs/UserGroupAttributes.md deleted file mode 100644 index 08e2590..0000000 --- a/v2/docs/UserGroupAttributes.md +++ /dev/null @@ -1,11 +0,0 @@ -# UserGroupAttributes - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**PosixGroups** | [**[]UserGroupAttributesPosixGroups**](UserGroupAttributes_posixGroups.md) | | [optional] [default to null] -**SambaEnabled** | **bool** | | [optional] [default to null] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/v2/docs/UserGroupAttributesPosixGroups.md b/v2/docs/UserGroupAttributesPosixGroups.md deleted file mode 100644 index 881f58b..0000000 --- a/v2/docs/UserGroupAttributesPosixGroups.md +++ /dev/null @@ -1,11 +0,0 @@ -# UserGroupAttributesPosixGroups - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Id** | **int32** | | [optional] [default to null] -**Name** | **string** | | [optional] [default to null] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/v2/docs/UserGroupGraphManagementReq.md b/v2/docs/UserGroupGraphManagementReq.md deleted file mode 100644 index 985622c..0000000 --- a/v2/docs/UserGroupGraphManagementReq.md +++ /dev/null @@ -1,12 +0,0 @@ -# UserGroupGraphManagementReq - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Id** | **string** | The ObjectID of graph object being added or removed as an association. | [default to null] -**Op** | **string** | How to modify the graph connection. | [default to null] -**Type_** | **string** | The graph type | [default to null] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/v2/docs/UserGroupMembersMembershipApi.md b/v2/docs/UserGroupMembersMembershipApi.md deleted file mode 100644 index 974c731..0000000 --- a/v2/docs/UserGroupMembersMembershipApi.md +++ /dev/null @@ -1,187 +0,0 @@ -# \UserGroupMembersMembershipApi - -All URIs are relative to *https://console.jumpcloud.com/api/v2* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**GraphUserGroupMemberOf**](UserGroupMembersMembershipApi.md#GraphUserGroupMemberOf) | **Get** /usergroups/{group_id}/memberof | List the User Group's parents -[**GraphUserGroupMembersList**](UserGroupMembersMembershipApi.md#GraphUserGroupMembersList) | **Get** /usergroups/{group_id}/members | List the members of a User Group -[**GraphUserGroupMembersPost**](UserGroupMembersMembershipApi.md#GraphUserGroupMembersPost) | **Post** /usergroups/{group_id}/members | Manage the members of a User Group -[**GraphUserGroupMembership**](UserGroupMembersMembershipApi.md#GraphUserGroupMembership) | **Get** /usergroups/{group_id}/membership | List the User Group's membership - - -# **GraphUserGroupMemberOf** -> []GraphObjectWithPaths GraphUserGroupMemberOf(ctx, groupId, contentType, accept, optional) -List the User Group's parents - -This endpoint returns all User Groups a User Group is a member of. #### Sample Request ``` https://console.jumpcloud.com/api/v2/usergroups/{group_id}/memberof ``` Not public yet, as the code is not finished, - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **groupId** | **string**| ObjectID of the User Group. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **groupId** | **string**| ObjectID of the User Group. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **filter** | [**[]string**](string.md)| Supported operators are: eq, ne, gt, ge, lt, le, between, search, in | - **limit** | **int32**| The number of records to return at once. Limited to 100. | [default to 10] - **skip** | **int32**| The offset into the records to return. | [default to 0] - **sort** | [**[]string**](string.md)| The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. | - **xOrgId** | **string**| | [default to ] - -### Return type - -[**[]GraphObjectWithPaths**](GraphObjectWithPaths.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **GraphUserGroupMembersList** -> []GraphConnection GraphUserGroupMembersList(ctx, groupId, contentType, accept, optional) -List the members of a User Group - -This endpoint returns the user members of a User Group. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/usergroups/{GroupID}/members \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **groupId** | **string**| ObjectID of the User Group. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **groupId** | **string**| ObjectID of the User Group. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **limit** | **int32**| The number of records to return at once. Limited to 100. | [default to 10] - **skip** | **int32**| The offset into the records to return. | [default to 0] - **xOrgId** | **string**| | [default to ] - -### Return type - -[**[]GraphConnection**](GraphConnection.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **GraphUserGroupMembersPost** -> GraphUserGroupMembersPost(ctx, groupId, contentType, accept, optional) -Manage the members of a User Group - -This endpoint allows you to manage the user members of a User Group. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/usergroups/{GroupID}/members \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"op\": \"add\", \"type\": \"user\", \"id\": \"{User_ID}\" }' ``` - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **groupId** | **string**| ObjectID of the User Group. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **groupId** | **string**| ObjectID of the User Group. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **body** | [**UserGroupMembersReq**](UserGroupMembersReq.md)| | - **xOrgId** | **string**| | [default to ] - -### Return type - - (empty response body) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **GraphUserGroupMembership** -> []GraphObjectWithPaths GraphUserGroupMembership(ctx, groupId, contentType, accept, optional) -List the User Group's membership - -This endpoint returns all users members that are a member of this User Group. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/usergroups/{GroupID}/membership \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **groupId** | **string**| ObjectID of the User Group. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **groupId** | **string**| ObjectID of the User Group. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **filter** | [**[]string**](string.md)| Supported operators are: eq, ne, gt, ge, lt, le, between, search, in | - **limit** | **int32**| The number of records to return at once. Limited to 100. | [default to 10] - **skip** | **int32**| The offset into the records to return. | [default to 0] - **sort** | [**[]string**](string.md)| The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. | - **xOrgId** | **string**| | [default to ] - -### Return type - -[**[]GraphObjectWithPaths**](GraphObjectWithPaths.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - diff --git a/v2/docs/UserGroupMembersReq.md b/v2/docs/UserGroupMembersReq.md deleted file mode 100644 index 1dfd474..0000000 --- a/v2/docs/UserGroupMembersReq.md +++ /dev/null @@ -1,12 +0,0 @@ -# UserGroupMembersReq - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Id** | **string** | The ObjectID of member being added or removed. | [default to null] -**Op** | **string** | How to modify the membership connection. | [default to null] -**Type_** | **string** | The member type. | [default to null] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/v2/docs/UserGroupPost.md b/v2/docs/UserGroupPost.md deleted file mode 100644 index 5a3e8f8..0000000 --- a/v2/docs/UserGroupPost.md +++ /dev/null @@ -1,11 +0,0 @@ -# UserGroupPost - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Attributes** | [***UserGroupAttributes**](UserGroupAttributes.md) | | [optional] [default to null] -**Name** | **string** | Display name of a User Group. | [default to null] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/v2/docs/UserGroupPut.md b/v2/docs/UserGroupPut.md deleted file mode 100644 index 595b7ad..0000000 --- a/v2/docs/UserGroupPut.md +++ /dev/null @@ -1,11 +0,0 @@ -# UserGroupPut - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Attributes** | [***UserGroupAttributes**](UserGroupAttributes.md) | | [optional] [default to null] -**Name** | **string** | Display name of a User Group. | [default to null] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/v2/docs/UserGroupsApi.md b/v2/docs/UserGroupsApi.md deleted file mode 100644 index 3964d43..0000000 --- a/v2/docs/UserGroupsApi.md +++ /dev/null @@ -1,937 +0,0 @@ -# \UserGroupsApi - -All URIs are relative to *https://console.jumpcloud.com/api/v2* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**GraphUserGroupAssociationsList**](UserGroupsApi.md#GraphUserGroupAssociationsList) | **Get** /usergroups/{group_id}/associations | List the associations of a User Group. -[**GraphUserGroupAssociationsPost**](UserGroupsApi.md#GraphUserGroupAssociationsPost) | **Post** /usergroups/{group_id}/associations | Manage the associations of a User Group -[**GraphUserGroupMemberOf**](UserGroupsApi.md#GraphUserGroupMemberOf) | **Get** /usergroups/{group_id}/memberof | List the User Group's parents -[**GraphUserGroupMembersList**](UserGroupsApi.md#GraphUserGroupMembersList) | **Get** /usergroups/{group_id}/members | List the members of a User Group -[**GraphUserGroupMembersPost**](UserGroupsApi.md#GraphUserGroupMembersPost) | **Post** /usergroups/{group_id}/members | Manage the members of a User Group -[**GraphUserGroupMembership**](UserGroupsApi.md#GraphUserGroupMembership) | **Get** /usergroups/{group_id}/membership | List the User Group's membership -[**GraphUserGroupTraverseActiveDirectory**](UserGroupsApi.md#GraphUserGroupTraverseActiveDirectory) | **Get** /usergroups/{group_id}/activedirectories | List the Active Directories bound to a User Group -[**GraphUserGroupTraverseApplication**](UserGroupsApi.md#GraphUserGroupTraverseApplication) | **Get** /usergroups/{group_id}/applications | List the Applications bound to a User Group -[**GraphUserGroupTraverseDirectory**](UserGroupsApi.md#GraphUserGroupTraverseDirectory) | **Get** /usergroups/{group_id}/directories | List the Directories bound to a User Group -[**GraphUserGroupTraverseGSuite**](UserGroupsApi.md#GraphUserGroupTraverseGSuite) | **Get** /usergroups/{group_id}/gsuites | List the G Suite instances bound to a User Group -[**GraphUserGroupTraverseLdapServer**](UserGroupsApi.md#GraphUserGroupTraverseLdapServer) | **Get** /usergroups/{group_id}/ldapservers | List the LDAP Servers bound to a User Group -[**GraphUserGroupTraverseOffice365**](UserGroupsApi.md#GraphUserGroupTraverseOffice365) | **Get** /usergroups/{group_id}/office365s | List the Office 365 instances bound to a User Group -[**GraphUserGroupTraverseRadiusServer**](UserGroupsApi.md#GraphUserGroupTraverseRadiusServer) | **Get** /usergroups/{group_id}/radiusservers | List the RADIUS Servers bound to a User Group -[**GraphUserGroupTraverseSystem**](UserGroupsApi.md#GraphUserGroupTraverseSystem) | **Get** /usergroups/{group_id}/systems | List the Systems bound to a User Group -[**GraphUserGroupTraverseSystemGroup**](UserGroupsApi.md#GraphUserGroupTraverseSystemGroup) | **Get** /usergroups/{group_id}/systemgroups | List the System Groups bound to User Groups -[**GroupsUserDelete**](UserGroupsApi.md#GroupsUserDelete) | **Delete** /usergroups/{id} | Delete a User Group -[**GroupsUserGet**](UserGroupsApi.md#GroupsUserGet) | **Get** /usergroups/{id} | View an individual User Group details -[**GroupsUserList**](UserGroupsApi.md#GroupsUserList) | **Get** /usergroups | List all User Groups -[**GroupsUserPatch**](UserGroupsApi.md#GroupsUserPatch) | **Patch** /usergroups/{id} | Partial update a User Group -[**GroupsUserPost**](UserGroupsApi.md#GroupsUserPost) | **Post** /usergroups | Create a new User Group -[**GroupsUserPut**](UserGroupsApi.md#GroupsUserPut) | **Put** /usergroups/{id} | Update a User Group - - -# **GraphUserGroupAssociationsList** -> []GraphConnection GraphUserGroupAssociationsList(ctx, groupId, contentType, accept, targets, optional) -List the associations of a User Group. - -This endpoint returns the _direct_ associations of this User Group. A direct association can be a non-homogeneous relationship between 2 different objects, for example User Groups and Users. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/usergroups/{GroupID}/associations?targets=system \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **groupId** | **string**| ObjectID of the User Group. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **targets** | [**[]string**](string.md)| | - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **groupId** | **string**| ObjectID of the User Group. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **targets** | [**[]string**](string.md)| | - **limit** | **int32**| The number of records to return at once. Limited to 100. | [default to 10] - **skip** | **int32**| The offset into the records to return. | [default to 0] - **xOrgId** | **string**| | [default to ] - -### Return type - -[**[]GraphConnection**](GraphConnection.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **GraphUserGroupAssociationsPost** -> GraphUserGroupAssociationsPost(ctx, groupId, contentType, accept, optional) -Manage the associations of a User Group - -This endpoint manages the _direct_ associations of this User Group. A direct association can be a non-homogeneous relationship between 2 different objects, for example User Groups and Users. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/usergroups/{GroupID}/associations \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"op\": \"add\", \"type\": \"system\", \"id\": \"{SystemID}\" }' ``` - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **groupId** | **string**| ObjectID of the User Group. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **groupId** | **string**| ObjectID of the User Group. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **body** | [**UserGroupGraphManagementReq**](UserGroupGraphManagementReq.md)| | - **xOrgId** | **string**| | [default to ] - -### Return type - - (empty response body) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **GraphUserGroupMemberOf** -> []GraphObjectWithPaths GraphUserGroupMemberOf(ctx, groupId, contentType, accept, optional) -List the User Group's parents - -This endpoint returns all User Groups a User Group is a member of. #### Sample Request ``` https://console.jumpcloud.com/api/v2/usergroups/{group_id}/memberof ``` Not public yet, as the code is not finished, - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **groupId** | **string**| ObjectID of the User Group. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **groupId** | **string**| ObjectID of the User Group. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **filter** | [**[]string**](string.md)| Supported operators are: eq, ne, gt, ge, lt, le, between, search, in | - **limit** | **int32**| The number of records to return at once. Limited to 100. | [default to 10] - **skip** | **int32**| The offset into the records to return. | [default to 0] - **sort** | [**[]string**](string.md)| The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. | - **xOrgId** | **string**| | [default to ] - -### Return type - -[**[]GraphObjectWithPaths**](GraphObjectWithPaths.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **GraphUserGroupMembersList** -> []GraphConnection GraphUserGroupMembersList(ctx, groupId, contentType, accept, optional) -List the members of a User Group - -This endpoint returns the user members of a User Group. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/usergroups/{GroupID}/members \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **groupId** | **string**| ObjectID of the User Group. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **groupId** | **string**| ObjectID of the User Group. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **limit** | **int32**| The number of records to return at once. Limited to 100. | [default to 10] - **skip** | **int32**| The offset into the records to return. | [default to 0] - **xOrgId** | **string**| | [default to ] - -### Return type - -[**[]GraphConnection**](GraphConnection.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **GraphUserGroupMembersPost** -> GraphUserGroupMembersPost(ctx, groupId, contentType, accept, optional) -Manage the members of a User Group - -This endpoint allows you to manage the user members of a User Group. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/usergroups/{GroupID}/members \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"op\": \"add\", \"type\": \"user\", \"id\": \"{User_ID}\" }' ``` - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **groupId** | **string**| ObjectID of the User Group. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **groupId** | **string**| ObjectID of the User Group. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **body** | [**UserGroupMembersReq**](UserGroupMembersReq.md)| | - **xOrgId** | **string**| | [default to ] - -### Return type - - (empty response body) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **GraphUserGroupMembership** -> []GraphObjectWithPaths GraphUserGroupMembership(ctx, groupId, contentType, accept, optional) -List the User Group's membership - -This endpoint returns all users members that are a member of this User Group. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/usergroups/{GroupID}/membership \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **groupId** | **string**| ObjectID of the User Group. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **groupId** | **string**| ObjectID of the User Group. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **filter** | [**[]string**](string.md)| Supported operators are: eq, ne, gt, ge, lt, le, between, search, in | - **limit** | **int32**| The number of records to return at once. Limited to 100. | [default to 10] - **skip** | **int32**| The offset into the records to return. | [default to 0] - **sort** | [**[]string**](string.md)| The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. | - **xOrgId** | **string**| | [default to ] - -### Return type - -[**[]GraphObjectWithPaths**](GraphObjectWithPaths.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **GraphUserGroupTraverseActiveDirectory** -> []GraphObjectWithPaths GraphUserGroupTraverseActiveDirectory(ctx, groupId, contentType, accept, optional) -List the Active Directories bound to a User Group - -This endpoint will return all Active Directory Instances bound to a User Group, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this User Group to the corresponding Active Directory; this array represents all grouping and/or associations that would have to be removed to deprovision the Active Directory from this User Group. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/usergroups/{GroupID}/activedirectories \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **groupId** | **string**| ObjectID of the User Group. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **groupId** | **string**| ObjectID of the User Group. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **limit** | **int32**| The number of records to return at once. Limited to 100. | [default to 10] - **xOrgId** | **string**| | [default to ] - **skip** | **int32**| The offset into the records to return. | [default to 0] - **filter** | [**[]string**](string.md)| Supported operators are: eq, ne, gt, ge, lt, le, between, search, in | - -### Return type - -[**[]GraphObjectWithPaths**](GraphObjectWithPaths.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **GraphUserGroupTraverseApplication** -> []GraphObjectWithPaths GraphUserGroupTraverseApplication(ctx, groupId, contentType, accept, optional) -List the Applications bound to a User Group - -This endpoint will return all Applications bound to a User Group, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this User Group to the corresponding Application; this array represents all grouping and/or associations that would have to be removed to deprovision the Application from this User Group. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/usergroups/{GroupID}/applications \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **groupId** | **string**| ObjectID of the User Group. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **groupId** | **string**| ObjectID of the User Group. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **limit** | **int32**| The number of records to return at once. Limited to 100. | [default to 10] - **xOrgId** | **string**| | [default to ] - **skip** | **int32**| The offset into the records to return. | [default to 0] - **filter** | [**[]string**](string.md)| Supported operators are: eq, ne, gt, ge, lt, le, between, search, in | - -### Return type - -[**[]GraphObjectWithPaths**](GraphObjectWithPaths.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **GraphUserGroupTraverseDirectory** -> []GraphObjectWithPaths GraphUserGroupTraverseDirectory(ctx, groupId, contentType, accept, optional) -List the Directories bound to a User Group - -This endpoint will return all Directories bound to a User Group, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this User Group to the corresponding Directory; this array represents all grouping and/or associations that would have to be removed to deprovision the Directories from this User Group. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/usergroups/{GroupID}/directories \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **groupId** | **string**| ObjectID of the User Group. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **groupId** | **string**| ObjectID of the User Group. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **limit** | **int32**| The number of records to return at once. Limited to 100. | [default to 10] - **xOrgId** | **string**| | [default to ] - **skip** | **int32**| The offset into the records to return. | [default to 0] - **filter** | [**[]string**](string.md)| Supported operators are: eq, ne, gt, ge, lt, le, between, search, in | - -### Return type - -[**[]GraphObjectWithPaths**](GraphObjectWithPaths.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **GraphUserGroupTraverseGSuite** -> []GraphObjectWithPaths GraphUserGroupTraverseGSuite(ctx, groupId, contentType, accept, optional) -List the G Suite instances bound to a User Group - -This endpoint will return all G Suite Instances bound to a User Group, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this User Group to the corresponding G Suite instance; this array represents all grouping and/or associations that would have to be removed to deprovision the G Suite instance from this User Group. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/usergroups/{GroupID/gsuites \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **groupId** | **string**| ObjectID of the User Group. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **groupId** | **string**| ObjectID of the User Group. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **limit** | **int32**| The number of records to return at once. Limited to 100. | [default to 10] - **xOrgId** | **string**| | [default to ] - **skip** | **int32**| The offset into the records to return. | [default to 0] - **filter** | [**[]string**](string.md)| Supported operators are: eq, ne, gt, ge, lt, le, between, search, in | - -### Return type - -[**[]GraphObjectWithPaths**](GraphObjectWithPaths.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **GraphUserGroupTraverseLdapServer** -> []GraphObjectWithPaths GraphUserGroupTraverseLdapServer(ctx, groupId, contentType, accept, optional) -List the LDAP Servers bound to a User Group - -This endpoint will return all LDAP Servers bound to a User Group, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this User Group to the corresponding LDAP Server; this array represents all grouping and/or associations that would have to be removed to deprovision the LDAP Server from this User Group. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/usergroups/{GroupID}/ldapservers \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **groupId** | **string**| ObjectID of the User Group. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **groupId** | **string**| ObjectID of the User Group. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **limit** | **int32**| The number of records to return at once. Limited to 100. | [default to 10] - **xOrgId** | **string**| | [default to ] - **skip** | **int32**| The offset into the records to return. | [default to 0] - **filter** | [**[]string**](string.md)| Supported operators are: eq, ne, gt, ge, lt, le, between, search, in | - -### Return type - -[**[]GraphObjectWithPaths**](GraphObjectWithPaths.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **GraphUserGroupTraverseOffice365** -> []GraphObjectWithPaths GraphUserGroupTraverseOffice365(ctx, groupId, contentType, accept, optional) -List the Office 365 instances bound to a User Group - -This endpoint will return all Office 365 instances bound to a User Group, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this User Group to the corresponding Office 365 instance; this array represents all grouping and/or associations that would have to be removed to deprovision the Office 365 instance from this User Group. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/usergroups/{GroupID}/office365s \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **groupId** | **string**| ObjectID of the User Group. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **groupId** | **string**| ObjectID of the User Group. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **limit** | **int32**| The number of records to return at once. Limited to 100. | [default to 10] - **xOrgId** | **string**| | [default to ] - **skip** | **int32**| The offset into the records to return. | [default to 0] - **filter** | [**[]string**](string.md)| Supported operators are: eq, ne, gt, ge, lt, le, between, search, in | - -### Return type - -[**[]GraphObjectWithPaths**](GraphObjectWithPaths.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **GraphUserGroupTraverseRadiusServer** -> []GraphObjectWithPaths GraphUserGroupTraverseRadiusServer(ctx, groupId, contentType, accept, optional) -List the RADIUS Servers bound to a User Group - -This endpoint will return all RADIUS servers bound to a User Group, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this User Group to the corresponding RADIUS Server; this array represents all grouping and/or associations that would have to be removed to deprovision the RADIUS Server from this User Group. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/usergroups/{GroupID}/radiusservers \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **groupId** | **string**| ObjectID of the User Group. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **groupId** | **string**| ObjectID of the User Group. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **limit** | **int32**| The number of records to return at once. Limited to 100. | [default to 10] - **xOrgId** | **string**| | [default to ] - **skip** | **int32**| The offset into the records to return. | [default to 0] - **filter** | [**[]string**](string.md)| Supported operators are: eq, ne, gt, ge, lt, le, between, search, in | - -### Return type - -[**[]GraphObjectWithPaths**](GraphObjectWithPaths.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **GraphUserGroupTraverseSystem** -> []GraphObjectWithPaths GraphUserGroupTraverseSystem(ctx, groupId, contentType, accept, optional) -List the Systems bound to a User Group - -This endpoint will return all Systems bound to a User Group, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this User Group to the corresponding System; this array represents all grouping and/or associations that would have to be removed to deprovision the System from this User Group. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/usergroups/{GroupID}/systems \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **groupId** | **string**| ObjectID of the User Group. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **groupId** | **string**| ObjectID of the User Group. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **limit** | **int32**| The number of records to return at once. Limited to 100. | [default to 10] - **xOrgId** | **string**| | [default to ] - **skip** | **int32**| The offset into the records to return. | [default to 0] - **filter** | [**[]string**](string.md)| Supported operators are: eq, ne, gt, ge, lt, le, between, search, in | - -### Return type - -[**[]GraphObjectWithPaths**](GraphObjectWithPaths.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **GraphUserGroupTraverseSystemGroup** -> []GraphObjectWithPaths GraphUserGroupTraverseSystemGroup(ctx, groupId, contentType, accept, optional) -List the System Groups bound to User Groups - -This endpoint will return all System Groups bound to a User Group, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this User Group to the corresponding System Group; this array represents all grouping and/or associations that would have to be removed to deprovision the System Group from this User Group. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/usergroups/{GroupID}/systemgroups \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **groupId** | **string**| ObjectID of the User Group. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **groupId** | **string**| ObjectID of the User Group. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **limit** | **int32**| The number of records to return at once. Limited to 100. | [default to 10] - **xOrgId** | **string**| | [default to ] - **skip** | **int32**| The offset into the records to return. | [default to 0] - **filter** | [**[]string**](string.md)| Supported operators are: eq, ne, gt, ge, lt, le, between, search, in | - -### Return type - -[**[]GraphObjectWithPaths**](GraphObjectWithPaths.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **GroupsUserDelete** -> GroupsUserDelete(ctx, id, contentType, accept, optional) -Delete a User Group - -This endpoint allows you to delete a User Group. #### Sample Request ``` curl -X DELETE https://console.jumpcloud.com/api/v2/usergroups/{GroupID} \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **id** | **string**| ObjectID of the User Group. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **id** | **string**| ObjectID of the User Group. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **xOrgId** | **string**| | [default to ] - -### Return type - - (empty response body) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **GroupsUserGet** -> UserGroup GroupsUserGet(ctx, id, contentType, accept, optional) -View an individual User Group details - -This endpoint returns the details of a User Group. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/usergroups/{GroupID} \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **id** | **string**| ObjectID of the User Group. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **id** | **string**| ObjectID of the User Group. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **xOrgId** | **string**| | [default to ] - -### Return type - -[**UserGroup**](UserGroup.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **GroupsUserList** -> []UserGroup GroupsUserList(ctx, contentType, accept, optional) -List all User Groups - -This endpoint returns all User Groups. Available filter fields: - `name` - `disabled` - `type` #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/usergroups \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **fields** | [**[]string**](string.md)| The comma separated fields included in the returned records. If omitted, the default list of fields will be returned. | - **filter** | [**[]string**](string.md)| Supported operators are: eq, ne, gt, ge, lt, le, between, search, in | - **limit** | **int32**| The number of records to return at once. Limited to 100. | [default to 10] - **skip** | **int32**| The offset into the records to return. | [default to 0] - **sort** | [**[]string**](string.md)| The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. | - **xOrgId** | **string**| | [default to ] - -### Return type - -[**[]UserGroup**](UserGroup.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **GroupsUserPatch** -> UserGroup GroupsUserPatch(ctx, id, contentType, accept, optional) -Partial update a User Group - -We have hidden PATCH on the systemgroups and usergroups for now; we don't have that implemented correctly yet, people should use PUT until we do a true PATCH operation. #### Sample Request ``` https://console.jumpcloud.com/api/v2/usergroups/{id} ``` - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **id** | **string**| ObjectID of the User Group. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **id** | **string**| ObjectID of the User Group. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **body** | [**UserGroupPost**](UserGroupPost.md)| | - **xOrgId** | **string**| | [default to ] - -### Return type - -[**UserGroup**](UserGroup.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **GroupsUserPost** -> UserGroup GroupsUserPost(ctx, contentType, accept, optional) -Create a new User Group - -This endpoint allows you to create a new User Group. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/usergroups \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"name\": \"{Group_Name}\" }' ``` - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **body** | [**UserGroupPost**](UserGroupPost.md)| | - **xOrgId** | **string**| | [default to ] - -### Return type - -[**UserGroup**](UserGroup.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **GroupsUserPut** -> UserGroup GroupsUserPut(ctx, id, contentType, accept, optional) -Update a User Group - -This endpoint allows you to do a full update of the User Group. #### Sample Request ``` curl -X PUT https://console.jumpcloud.com/api/v2/usergroups/{Group_ID} \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY' \\ -d '{ \"name\": \"group_update\" }' ``` - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **id** | **string**| ObjectID of the User Group. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **id** | **string**| ObjectID of the User Group. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **body** | [**UserGroupPut**](UserGroupPut.md)| | - **xOrgId** | **string**| | [default to ] - -### Return type - -[**UserGroup**](UserGroup.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - diff --git a/v2/docs/UsersApi.md b/v2/docs/UsersApi.md deleted file mode 100644 index a1172e9..0000000 --- a/v2/docs/UsersApi.md +++ /dev/null @@ -1,546 +0,0 @@ -# \UsersApi - -All URIs are relative to *https://console.jumpcloud.com/api/v2* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**GraphUserAssociationsList**](UsersApi.md#GraphUserAssociationsList) | **Get** /users/{user_id}/associations | List the associations of a User -[**GraphUserAssociationsPost**](UsersApi.md#GraphUserAssociationsPost) | **Post** /users/{user_id}/associations | Manage the associations of a User -[**GraphUserMemberOf**](UsersApi.md#GraphUserMemberOf) | **Get** /users/{user_id}/memberof | List the parent Groups of a User -[**GraphUserTraverseApplication**](UsersApi.md#GraphUserTraverseApplication) | **Get** /users/{user_id}/applications | List the Applications bound to a User -[**GraphUserTraverseDirectory**](UsersApi.md#GraphUserTraverseDirectory) | **Get** /users/{user_id}/directories | List the Directories bound to a User -[**GraphUserTraverseGSuite**](UsersApi.md#GraphUserTraverseGSuite) | **Get** /users/{user_id}/gsuites | List the G Suite instances bound to a User -[**GraphUserTraverseLdapServer**](UsersApi.md#GraphUserTraverseLdapServer) | **Get** /users/{user_id}/ldapservers | List the LDAP servers bound to a User -[**GraphUserTraverseOffice365**](UsersApi.md#GraphUserTraverseOffice365) | **Get** /users/{user_id}/office365s | List the Office 365 instances bound to a User -[**GraphUserTraverseRadiusServer**](UsersApi.md#GraphUserTraverseRadiusServer) | **Get** /users/{user_id}/radiusservers | List the RADIUS Servers bound to a User -[**GraphUserTraverseSystem**](UsersApi.md#GraphUserTraverseSystem) | **Get** /users/{user_id}/systems | List the Systems bound to a User -[**GraphUserTraverseSystemGroup**](UsersApi.md#GraphUserTraverseSystemGroup) | **Get** /users/{user_id}/systemgroups | List the System Groups bound to a User -[**UsersSendEmails**](UsersApi.md#UsersSendEmails) | **Post** /users/{user_id}/emails | Send User Emails - - -# **GraphUserAssociationsList** -> []GraphConnection GraphUserAssociationsList(ctx, userId, contentType, accept, targets, optional) -List the associations of a User - -This endpoint returns the _direct_ associations of a User. A direct association can be a non-homogeneous relationship between 2 different objects, for example Users and Systems. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/users/{UserID}/associations?targets=system_group \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **userId** | **string**| ObjectID of the User. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **targets** | [**[]string**](string.md)| | - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **userId** | **string**| ObjectID of the User. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **targets** | [**[]string**](string.md)| | - **limit** | **int32**| The number of records to return at once. Limited to 100. | [default to 10] - **skip** | **int32**| The offset into the records to return. | [default to 0] - **xOrgId** | **string**| | [default to ] - -### Return type - -[**[]GraphConnection**](GraphConnection.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **GraphUserAssociationsPost** -> GraphUserAssociationsPost(ctx, userId, contentType, accept, optional) -Manage the associations of a User - -This endpoint allows you to manage the _direct_ associations of a User. A direct association can be a non-homogeneous relationship between 2 different objects, for example Users and Systems. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/users/{UserID}/associations \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"attributes\": { \"sudo\": { \"enabled\": true, \"withoutPassword\": false } }, \"op\": \"add\", \"type\": \"system_group\", \"id\": \"{GroupID}\" }' - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **userId** | **string**| ObjectID of the User. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **userId** | **string**| ObjectID of the User. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **body** | [**UserGraphManagementReq**](UserGraphManagementReq.md)| | - **xOrgId** | **string**| | [default to ] - -### Return type - - (empty response body) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **GraphUserMemberOf** -> []GraphObjectWithPaths GraphUserMemberOf(ctx, userId, contentType, accept, optional) -List the parent Groups of a User - -This endpoint returns all the User Groups a User is a member of. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/users/{UserID}/memberof \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **userId** | **string**| ObjectID of the User. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **userId** | **string**| ObjectID of the User. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **filter** | [**[]string**](string.md)| Supported operators are: eq, ne, gt, ge, lt, le, between, search, in | - **limit** | **int32**| The number of records to return at once. Limited to 100. | [default to 10] - **skip** | **int32**| The offset into the records to return. | [default to 0] - **sort** | [**[]string**](string.md)| The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. | - **xOrgId** | **string**| | [default to ] - -### Return type - -[**[]GraphObjectWithPaths**](GraphObjectWithPaths.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **GraphUserTraverseApplication** -> []GraphObjectWithPaths GraphUserTraverseApplication(ctx, userId, contentType, accept, optional) -List the Applications bound to a User - -This endpoint will return all Applications bound to a User, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this User to the corresponding Application; this array represents all grouping and/or associations that would have to be removed to deprovision the Application from this User. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/users/{UserID}/applications \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **userId** | **string**| ObjectID of the User. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **userId** | **string**| ObjectID of the User. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **limit** | **int32**| The number of records to return at once. Limited to 100. | [default to 10] - **xOrgId** | **string**| | [default to ] - **skip** | **int32**| The offset into the records to return. | [default to 0] - **filter** | [**[]string**](string.md)| Supported operators are: eq, ne, gt, ge, lt, le, between, search, in | - -### Return type - -[**[]GraphObjectWithPaths**](GraphObjectWithPaths.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **GraphUserTraverseDirectory** -> []GraphObjectWithPaths GraphUserTraverseDirectory(ctx, userId, contentType, accept, optional) -List the Directories bound to a User - -This endpoint will return all Directories bound to a User, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this User to the corresponding Directory; this array represents all grouping and/or associations that would have to be removed to deprovision the Directory from this User. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/users/{UserID}/directories \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **userId** | **string**| ObjectID of the User. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **userId** | **string**| ObjectID of the User. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **limit** | **int32**| The number of records to return at once. Limited to 100. | [default to 10] - **xOrgId** | **string**| | [default to ] - **skip** | **int32**| The offset into the records to return. | [default to 0] - **filter** | [**[]string**](string.md)| Supported operators are: eq, ne, gt, ge, lt, le, between, search, in | - -### Return type - -[**[]GraphObjectWithPaths**](GraphObjectWithPaths.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **GraphUserTraverseGSuite** -> []GraphObjectWithPaths GraphUserTraverseGSuite(ctx, userId, contentType, accept, optional) -List the G Suite instances bound to a User - -This endpoint will return all G-Suite Instances bound to a User, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this User to the corresponding G Suite instance; this array represents all grouping and/or associations that would have to be removed to deprovision the G Suite instance from this User. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/users/{UserID}/gsuites \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **userId** | **string**| ObjectID of the User. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **userId** | **string**| ObjectID of the User. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **limit** | **int32**| The number of records to return at once. Limited to 100. | [default to 10] - **xOrgId** | **string**| | [default to ] - **skip** | **int32**| The offset into the records to return. | [default to 0] - **filter** | [**[]string**](string.md)| Supported operators are: eq, ne, gt, ge, lt, le, between, search, in | - -### Return type - -[**[]GraphObjectWithPaths**](GraphObjectWithPaths.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **GraphUserTraverseLdapServer** -> []GraphObjectWithPaths GraphUserTraverseLdapServer(ctx, userId, contentType, accept, optional) -List the LDAP servers bound to a User - -This endpoint will return all LDAP Servers bound to a User, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this User to the corresponding LDAP Server; this array represents all grouping and/or associations that would have to be removed to deprovision the LDAP Server from this User. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/users/{UserID}/ldapservers \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **userId** | **string**| ObjectID of the User. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **userId** | **string**| ObjectID of the User. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **limit** | **int32**| The number of records to return at once. Limited to 100. | [default to 10] - **xOrgId** | **string**| | [default to ] - **skip** | **int32**| The offset into the records to return. | [default to 0] - **filter** | [**[]string**](string.md)| Supported operators are: eq, ne, gt, ge, lt, le, between, search, in | - -### Return type - -[**[]GraphObjectWithPaths**](GraphObjectWithPaths.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **GraphUserTraverseOffice365** -> []GraphObjectWithPaths GraphUserTraverseOffice365(ctx, userId, contentType, accept, optional) -List the Office 365 instances bound to a User - -This endpoint will return all Office 365 Instances bound to a User, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this User to the corresponding Office 365 instance; this array represents all grouping and/or associations that would have to be removed to deprovision the Office 365 instance from this User. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/users/{UserID}/office365s \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **userId** | **string**| ObjectID of the User. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **userId** | **string**| ObjectID of the User. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **limit** | **int32**| The number of records to return at once. Limited to 100. | [default to 10] - **xOrgId** | **string**| | [default to ] - **skip** | **int32**| The offset into the records to return. | [default to 0] - **filter** | [**[]string**](string.md)| Supported operators are: eq, ne, gt, ge, lt, le, between, search, in | - -### Return type - -[**[]GraphObjectWithPaths**](GraphObjectWithPaths.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **GraphUserTraverseRadiusServer** -> []GraphObjectWithPaths GraphUserTraverseRadiusServer(ctx, userId, contentType, accept, optional) -List the RADIUS Servers bound to a User - -This endpoint will return all RADIUS Servers bound to a User, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this User to the corresponding RADIUS Server; this array represents all grouping and/or associations that would have to be removed to deprovision the RADIUS Server from this User. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/users/{UserID}/radiusservers \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **userId** | **string**| ObjectID of the User. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **userId** | **string**| ObjectID of the User. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **limit** | **int32**| The number of records to return at once. Limited to 100. | [default to 10] - **xOrgId** | **string**| | [default to ] - **skip** | **int32**| The offset into the records to return. | [default to 0] - **filter** | [**[]string**](string.md)| Supported operators are: eq, ne, gt, ge, lt, le, between, search, in | - -### Return type - -[**[]GraphObjectWithPaths**](GraphObjectWithPaths.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **GraphUserTraverseSystem** -> []GraphObjectWithPaths GraphUserTraverseSystem(ctx, userId, contentType, accept, optional) -List the Systems bound to a User - -This endpoint will return all Systems bound to a User, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this User to the corresponding System; this array represents all grouping and/or associations that would have to be removed to deprovision the System from this User. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/users/{UserID}/systems\\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **userId** | **string**| ObjectID of the User. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **userId** | **string**| ObjectID of the User. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **limit** | **int32**| The number of records to return at once. Limited to 100. | [default to 10] - **xOrgId** | **string**| | [default to ] - **skip** | **int32**| The offset into the records to return. | [default to 0] - **filter** | [**[]string**](string.md)| Supported operators are: eq, ne, gt, ge, lt, le, between, search, in | - -### Return type - -[**[]GraphObjectWithPaths**](GraphObjectWithPaths.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **GraphUserTraverseSystemGroup** -> []GraphObjectWithPaths GraphUserTraverseSystemGroup(ctx, userId, contentType, accept, optional) -List the System Groups bound to a User - -This endpoint will return all System Groups bound to a User, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this User to the corresponding System Group; this array represents all grouping and/or associations that would have to be removed to deprovision the System Group from this User. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/users/{UserID}/systemgroups\\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **userId** | **string**| ObjectID of the User. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **userId** | **string**| ObjectID of the User. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **limit** | **int32**| The number of records to return at once. Limited to 100. | [default to 10] - **xOrgId** | **string**| | [default to ] - **skip** | **int32**| The offset into the records to return. | [default to 0] - **filter** | [**[]string**](string.md)| Supported operators are: eq, ne, gt, ge, lt, le, between, search, in | - -### Return type - -[**[]GraphObjectWithPaths**](GraphObjectWithPaths.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **UsersSendEmails** -> UsersSendEmails(ctx, userId, contentType, accept, optional) -Send User Emails - -This endpoint allows you to send a specific email to a user without waiting for or triggering a workflow. - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **userId** | **string**| ObjectID of the User. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **userId** | **string**| ObjectID of the User. | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **body** | [**Emailrequest**](Emailrequest.md)| | - **xOrgId** | **string**| | [default to ] - -### Return type - - (empty response body) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - diff --git a/v2/docs/WorkdayImportApi.md b/v2/docs/WorkdayImportApi.md deleted file mode 100644 index b93fa1b..0000000 --- a/v2/docs/WorkdayImportApi.md +++ /dev/null @@ -1,481 +0,0 @@ -# \WorkdayImportApi - -All URIs are relative to *https://console.jumpcloud.com/api/v2* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**WorkdaysAuthorize**](WorkdayImportApi.md#WorkdaysAuthorize) | **Post** /workdays/{workday_id}/auth | Authorize Workday -[**WorkdaysDeauthorize**](WorkdayImportApi.md#WorkdaysDeauthorize) | **Delete** /workdays/{workday_id}/auth | Deauthorize Workday -[**WorkdaysDelete**](WorkdayImportApi.md#WorkdaysDelete) | **Delete** /workdays/{id} | Delete Workday -[**WorkdaysGet**](WorkdayImportApi.md#WorkdaysGet) | **Get** /workdays/{id} | Get Workday -[**WorkdaysImport**](WorkdayImportApi.md#WorkdaysImport) | **Post** /workdays/{workday_id}/import | Workday Import -[**WorkdaysImportresults**](WorkdayImportApi.md#WorkdaysImportresults) | **Get** /workdays/{id}/import/{job_id}/results | List Import Results -[**WorkdaysList**](WorkdayImportApi.md#WorkdaysList) | **Get** /workdays | List Workdays -[**WorkdaysPost**](WorkdayImportApi.md#WorkdaysPost) | **Post** /workdays | Create new Workday -[**WorkdaysPut**](WorkdayImportApi.md#WorkdaysPut) | **Put** /workdays/{id} | Update Workday -[**WorkdaysSettings**](WorkdayImportApi.md#WorkdaysSettings) | **Get** /workdays/settings | Get Workday Settings (incomplete) -[**WorkdaysWorkers**](WorkdayImportApi.md#WorkdaysWorkers) | **Get** /workdays/{workday_id}/workers | List Workday Workers - - -# **WorkdaysAuthorize** -> WorkdaysAuthorize(ctx, workdayId, contentType, accept, optional) -Authorize Workday - -This endpoint adds an authorization method to a workday instance. You must supply a username and password for `Basic Authentication` that is the same as your WorkDay Integrator System User. Failure to provide these credentials will result in the request being rejected. Currently `O-Auth` isn't a supported authentication protocol for WorkDay, but will be in the future. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/workdays/{WorkDayID}/auth \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"auth\":{ \"basic\": { \"username\": \"someDeveloper\", \"password\": \"notTheRealPassword\" } } }' ``` - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **workdayId** | **string**| | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **workdayId** | **string**| | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **body** | [**AuthInputObject**](AuthInputObject.md)| | - **xOrgId** | **string**| | [default to ] - -### Return type - - (empty response body) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **WorkdaysDeauthorize** -> WorkdaysDeauthorize(ctx, workdayId, contentType, accept, optional) -Deauthorize Workday - -Removes any and all authorization methods from the workday instance ##### Sample Request ``` curl -X DELETE https://console.jumpcloud.com/api/v2/workdays/{WorkDayID}/auth \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **workdayId** | **string**| | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **workdayId** | **string**| | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **xOrgId** | **string**| | [default to ] - -### Return type - - (empty response body) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **WorkdaysDelete** -> interface{} WorkdaysDelete(ctx, id, contentType, accept, optional) -Delete Workday - -This endpoint allows you to delete an instance of Workday. **This functionality is currently not enable for users.** - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **id** | **string**| | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **id** | **string**| | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **xOrgId** | **string**| | [default to ] - -### Return type - -[**interface{}**](interface{}.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **WorkdaysGet** -> WorkdayOutput WorkdaysGet(ctx, id, contentType, accept, optional) -Get Workday - -This endpoint will return all the available information about an instance of Workday. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/workdays/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **id** | **string**| | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **id** | **string**| | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **xOrgId** | **string**| | [default to ] - -### Return type - -[**WorkdayOutput**](workday-output.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **WorkdaysImport** -> JobId WorkdaysImport(ctx, workdayId, contentType, accept, optional) -Workday Import - -The endpoint allows you to create a Workday Import request. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/workdays/{WorkdayID}/import \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '[ { \"email\":\"{email}\", \"firstname\":\"{firstname}\", \"lastname\":\"{firstname}\", \"username\":\"{username}\", \"attributes\":[ {\"name\":\"EmployeeID\",\"value\":\"0000\"}, {\"name\":\"WorkdayID\",\"value\":\"name.name\"} ] } ] ``` - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **workdayId** | **string**| | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **workdayId** | **string**| | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **body** | [**[]BulkUserCreate**](bulk-user-create.md)| | - **xOrgId** | **string**| | [default to ] - -### Return type - -[**JobId**](job-id.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **WorkdaysImportresults** -> []JobWorkresult WorkdaysImportresults(ctx, id, jobId, contentType, accept, optional) -List Import Results - -This endpoint provides a list of job results from the workday import and will contain all imported data from Workday. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/workdays/{WorkdayID}/import/{ImportJobID}/results \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **id** | **string**| | - **jobId** | **string**| | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **id** | **string**| | - **jobId** | **string**| | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **limit** | **int32**| The number of records to return at once. Limited to 100. | [default to 10] - **skip** | **int32**| The offset into the records to return. | [default to 0] - **xOrgId** | **string**| | [default to ] - -### Return type - -[**[]JobWorkresult**](job-workresult.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **WorkdaysList** -> []WorkdayOutput WorkdaysList(ctx, contentType, accept, optional) -List Workdays - -This endpoint will return all the available information about all your instances of Workday. ##### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/workdays/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **fields** | [**[]string**](string.md)| The comma separated fields included in the returned records. If omitted, the default list of fields will be returned. | - **limit** | **int32**| The number of records to return at once. Limited to 100. | [default to 10] - **skip** | **int32**| The offset into the records to return. | [default to 0] - **sort** | [**[]string**](string.md)| The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. | - **filter** | [**[]string**](string.md)| Supported operators are: eq, ne, gt, ge, lt, le, between, search, in | - **xOrgId** | **string**| | [default to ] - -### Return type - -[**[]WorkdayOutput**](workday-output.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **WorkdaysPost** -> WorkdaysPost(ctx, contentType, accept, optional) -Create new Workday - -This endpoint allows you to create a new workday instance. You must supply a username and password for `Basic Authentication` that is the same as your WorkDay Integrator System User. Failure to provide these credentials will result in the request being rejected. Currently `O-Auth` isn't a supported authentication protocol for WorkDay, but will be in the future. Currently, only one instance is allowed and it must be `Workday Import`. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/workdays/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"name\": \"Workday2\", \"reportUrl\":\"https://workday.com/ccx/service/customreport2/gms/user/reportname?format=json\", \"auth\": { \"basic\": { \"username\": \"someDeveloper\", \"password\": \"notTheRealPassword\" } } }' ``` - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **body** | [**WorkdayInput**](WorkdayInput.md)| | - **xOrgId** | **string**| | [default to ] - -### Return type - - (empty response body) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **WorkdaysPut** -> WorkdayOutput WorkdaysPut(ctx, id, contentType, accept, optional) -Update Workday - -This endpoint allows you to update the name and Custom Report URL for a Workday Instance. Currently, the name can not be changed from the default of `Workday Import`. ##### Sample Request ``` curl -X PUT https://console.jumpcloud.com/api/v2/workdays/{WorkdayID} \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"reportUrl\":\"{Report_URL}\", \"name\":\"{Name}\" } ' ``` - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **id** | **string**| | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **id** | **string**| | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **body** | [**WorkdayFields**](WorkdayFields.md)| | - **xOrgId** | **string**| | [default to ] - -### Return type - -[**WorkdayOutput**](workday-output.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **WorkdaysSettings** -> WorkdaysSettings(ctx, contentType, accept, optional) -Get Workday Settings (incomplete) - -This endpoint allows you to obtain all settings needed for creating a workday instance, specifically the URL to initiate Basic Authentication with WorkDay. **This functionality is currently not enable for users.** - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **state** | **string**| | - **xOrgId** | **string**| | [default to ] - -### Return type - - (empty response body) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - -# **WorkdaysWorkers** -> []WorkdayWorker WorkdaysWorkers(ctx, workdayId, contentType, accept, optional) -List Workday Workers - -This endpoint will return all of the data in your WorkDay Custom Report that has been associated with your WorkDay Instance in JumpCloud. ##### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/workdays/{WorkDayID}/workers \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - -### Required Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **ctx** | **context.Context** | context for logging, tracing, authentication, etc. - **workdayId** | **string**| | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **optional** | **map[string]interface{}** | optional parameters | nil if no parameters - -### Optional Parameters -Optional parameters are passed through a map[string]interface{}. - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **workdayId** | **string**| | - **contentType** | **string**| | [default to application/json] - **accept** | **string**| | [default to application/json] - **limit** | **int32**| The number of records to return at once. Limited to 100. | [default to 10] - **skip** | **int32**| The offset into the records to return. | [default to 0] - **sort** | [**[]string**](string.md)| The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. | - **xOrgId** | **string**| | [default to ] - -### Return type - -[**[]WorkdayWorker**](workday-worker.md) - -### Authorization - -[x-api-key](../README.md#x-api-key) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - -[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) - diff --git a/v2/docs/WorkdayRequest.md b/v2/docs/WorkdayRequest.md deleted file mode 100644 index 3143965..0000000 --- a/v2/docs/WorkdayRequest.md +++ /dev/null @@ -1,11 +0,0 @@ -# WorkdayRequest - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**Name** | **string** | | [optional] [default to null] -**ObjectId** | **string** | | [optional] [default to null] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/v2/duo_account.go b/v2/duo_account.go deleted file mode 100644 index 332f8c0..0000000 --- a/v2/duo_account.go +++ /dev/null @@ -1,19 +0,0 @@ -/* - * JumpCloud APIs - * - * JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. - * - * API version: 2.0 - * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) - */ - -package v2 - -type DuoAccount struct { - - // object ID - Id string `json:"id"` - - // Duo application name. - Name string `json:"name,omitempty"` -} diff --git a/v2/duo_api.go b/v2/duo_api.go deleted file mode 100644 index c8f1ae3..0000000 --- a/v2/duo_api.go +++ /dev/null @@ -1,842 +0,0 @@ -/* - * JumpCloud APIs - * - * JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. - * - * API version: 2.0 - * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) - */ - -package v2 - -import ( - "io/ioutil" - "net/url" - "net/http" - "strings" - "golang.org/x/net/context" - "encoding/json" - "fmt" -) - -// Linger please -var ( - _ context.Context -) - -type DuoApiService service - - -/* DuoApiService Delete a Duo Account - Removes the specified Duo account, an error will be returned if the account has some Duo application used in a protected resource. #### Sample Request ``` curl -X DELETE https://console.jumpcloud.com/api/v2/duo/accounts/{id} \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - * @param ctx context.Context for authentication, logging, tracing, etc. - @param id ObjectID of the Duo Account - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "xOrgId" (string) - @return DuoAccount*/ -func (a *DuoApiService) DuoAccountDelete(ctx context.Context, id string, contentType string, accept string, localVarOptionals map[string]interface{}) (DuoAccount, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Delete") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload DuoAccount - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/duo/accounts/{id}" - localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return successPayload, nil, err - } - - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* DuoApiService Get a Duo Acount - This endpoint returns a specific Duo account. #### Sample Request ``` curl https://console.jumpcloud.com/api/v2/duo/accounts/{id} \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - * @param ctx context.Context for authentication, logging, tracing, etc. - @param id ObjectID of the Duo Account - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "xOrgId" (string) - @return DuoAccount*/ -func (a *DuoApiService) DuoAccountGet(ctx context.Context, id string, contentType string, accept string, localVarOptionals map[string]interface{}) (DuoAccount, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload DuoAccount - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/duo/accounts/{id}" - localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return successPayload, nil, err - } - - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* DuoApiService List Duo Acounts - This endpoint returns all the Duo accounts for your organization. Note: There can currently only be one Duo account for your organization. #### Sample Request ``` curl https://console.jumpcloud.com/api/v2/duo/accounts \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - * @param ctx context.Context for authentication, logging, tracing, etc. - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "xOrgId" (string) - @return []DuoAccount*/ -func (a *DuoApiService) DuoAccountList(ctx context.Context, contentType string, accept string, localVarOptionals map[string]interface{}) ([]DuoAccount, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload []DuoAccount - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/duo/accounts" - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return successPayload, nil, err - } - - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* DuoApiService Create Duo Account - Registers a Duo account for an organization. Only one Duo account will be allowed, in case an organization has a Duo account already a 409 (Conflict) code will be returned. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/duo/accounts \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{}' ``` - * @param ctx context.Context for authentication, logging, tracing, etc. - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "xOrgId" (string) - @return DuoAccount*/ -func (a *DuoApiService) DuoAccountPost(ctx context.Context, contentType string, accept string, localVarOptionals map[string]interface{}) (DuoAccount, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Post") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload DuoAccount - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/duo/accounts" - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return successPayload, nil, err - } - - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* DuoApiService Delete a Duo Application - Deletes the specified Duo application, an error will be returned if the application is used in a protected resource. #### Sample Request ``` curl -X DELETE https://console.jumpcloud.com/api/v2/duo/accounts/{ACCOUNT_ID}/applications/{APPLICATION_ID} \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}'' ``` - * @param ctx context.Context for authentication, logging, tracing, etc. - @param accountId - @param applicationId - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "xOrgId" (string) - @return DuoApplication*/ -func (a *DuoApiService) DuoApplicationDelete(ctx context.Context, accountId string, applicationId string, contentType string, accept string, localVarOptionals map[string]interface{}) (DuoApplication, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Delete") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload DuoApplication - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/duo/accounts/{account_id}/applications/{application_id}" - localVarPath = strings.Replace(localVarPath, "{"+"account_id"+"}", fmt.Sprintf("%v", accountId), -1) - localVarPath = strings.Replace(localVarPath, "{"+"application_id"+"}", fmt.Sprintf("%v", applicationId), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return successPayload, nil, err - } - - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* DuoApiService Get a Duo application - This endpoint returns a specific Duo application that is associated with the specified Duo account. #### Sample Request ``` curl https://console.jumpcloud.com/api/v2/duo/accounts/{ACCOUNT_ID}/applications/{APPLICATION_ID} \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - * @param ctx context.Context for authentication, logging, tracing, etc. - @param accountId - @param applicationId - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "xOrgId" (string) - @return DuoApplication*/ -func (a *DuoApiService) DuoApplicationGet(ctx context.Context, accountId string, applicationId string, contentType string, accept string, localVarOptionals map[string]interface{}) (DuoApplication, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload DuoApplication - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/duo/accounts/{account_id}/applications/{application_id}" - localVarPath = strings.Replace(localVarPath, "{"+"account_id"+"}", fmt.Sprintf("%v", accountId), -1) - localVarPath = strings.Replace(localVarPath, "{"+"application_id"+"}", fmt.Sprintf("%v", applicationId), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return successPayload, nil, err - } - - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* DuoApiService List Duo Applications - This endpoint returns all the Duo applications for the specified Duo account. Note: There can currently only be one Duo application for your organization. #### Sample Request ``` curl https://console.jumpcloud.com/api/v2/duo/accounts/{ACCOUNT_ID}/applications \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - * @param ctx context.Context for authentication, logging, tracing, etc. - @param accountId - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "xOrgId" (string) - @return []DuoApplication*/ -func (a *DuoApiService) DuoApplicationList(ctx context.Context, accountId string, contentType string, accept string, localVarOptionals map[string]interface{}) ([]DuoApplication, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload []DuoApplication - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/duo/accounts/{account_id}/applications" - localVarPath = strings.Replace(localVarPath, "{"+"account_id"+"}", fmt.Sprintf("%v", accountId), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return successPayload, nil, err - } - - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* DuoApiService Create Duo Application - Creates a Duo application for your organization and the specified account. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/duo/accounts/{ACCOUNT_ID}/applications \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"name\": \"Application Name\", \"apiHost\": \"api-1234.duosecurity.com\", \"integrationKey\": \"1234\", \"secretKey\": \"5678\" }' ``` - * @param ctx context.Context for authentication, logging, tracing, etc. - @param accountId - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "body" (DuoApplicationReq) - @param "xOrgId" (string) - @return DuoApplication*/ -func (a *DuoApiService) DuoApplicationPost(ctx context.Context, accountId string, contentType string, accept string, localVarOptionals map[string]interface{}) (DuoApplication, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Post") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload DuoApplication - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/duo/accounts/{account_id}/applications" - localVarPath = strings.Replace(localVarPath, "{"+"account_id"+"}", fmt.Sprintf("%v", accountId), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return successPayload, nil, err - } - - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - // body params - if localVarTempParam, localVarOk := localVarOptionals["body"].(DuoApplicationReq); localVarOk { - localVarPostBody = &localVarTempParam - } - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* DuoApiService Update Duo Application - Updates the specified Duo application. #### Sample Request ``` curl -X PUT https://console.jumpcloud.com/api/v2/duo/accounts/{ACCOUNT_ID}/applications/{APPLICATION_ID} \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"name\": \"Application Name\", \"apiHost\": \"api-1234.duosecurity.com\", \"integrationKey\": \"1234\", \"secretKey\": \"5678\" }' ``` - * @param ctx context.Context for authentication, logging, tracing, etc. - @param accountId - @param applicationId - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "body" (DuoApplicationUpdateReq) - @param "xOrgId" (string) - @return DuoApplication*/ -func (a *DuoApiService) DuoApplicationUpdate(ctx context.Context, accountId string, applicationId string, contentType string, accept string, localVarOptionals map[string]interface{}) (DuoApplication, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Put") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload DuoApplication - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/duo/accounts/{account_id}/applications/{application_id}" - localVarPath = strings.Replace(localVarPath, "{"+"account_id"+"}", fmt.Sprintf("%v", accountId), -1) - localVarPath = strings.Replace(localVarPath, "{"+"application_id"+"}", fmt.Sprintf("%v", applicationId), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return successPayload, nil, err - } - - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - // body params - if localVarTempParam, localVarOk := localVarOptionals["body"].(DuoApplicationUpdateReq); localVarOk { - localVarPostBody = &localVarTempParam - } - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - diff --git a/v2/duo_application.go b/v2/duo_application.go deleted file mode 100644 index 38e9d08..0000000 --- a/v2/duo_application.go +++ /dev/null @@ -1,21 +0,0 @@ -/* - * JumpCloud APIs - * - * JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. - * - * API version: 2.0 - * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) - */ - -package v2 - -type DuoApplication struct { - - ApiHost string `json:"apiHost"` - - Id string `json:"id"` - - IntegrationKey string `json:"integrationKey"` - - Name string `json:"name"` -} diff --git a/v2/duo_application_req.go b/v2/duo_application_req.go deleted file mode 100644 index 0ff72b5..0000000 --- a/v2/duo_application_req.go +++ /dev/null @@ -1,21 +0,0 @@ -/* - * JumpCloud APIs - * - * JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. - * - * API version: 2.0 - * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) - */ - -package v2 - -type DuoApplicationReq struct { - - ApiHost string `json:"apiHost"` - - IntegrationKey string `json:"integrationKey"` - - Name string `json:"name"` - - SecretKey string `json:"secretKey"` -} diff --git a/v2/duo_application_update_req.go b/v2/duo_application_update_req.go deleted file mode 100644 index bc89250..0000000 --- a/v2/duo_application_update_req.go +++ /dev/null @@ -1,21 +0,0 @@ -/* - * JumpCloud APIs - * - * JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. - * - * API version: 2.0 - * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) - */ - -package v2 - -type DuoApplicationUpdateReq struct { - - ApiHost string `json:"apiHost,omitempty"` - - IntegrationKey string `json:"integrationKey,omitempty"` - - Name string `json:"name,omitempty"` - - SecretKey string `json:"secretKey,omitempty"` -} diff --git a/v2/duo_registration_application.go b/v2/duo_registration_application.go deleted file mode 100644 index da32eb2..0000000 --- a/v2/duo_registration_application.go +++ /dev/null @@ -1,22 +0,0 @@ -/* - * JumpCloud APIs - * - * JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. - * - * API version: 2.0 - * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) - */ - -package v2 - -type DuoRegistrationApplication struct { - - // Duo Application host name. - ApiHost string `json:"apiHost"` - - // Duo Application integration key. - IntegrationKey string `json:"integrationKey"` - - // Duo Application secret key. - SecretKey string `json:"secretKey"` -} diff --git a/v2/duo_registration_application_req.go b/v2/duo_registration_application_req.go deleted file mode 100644 index d474892..0000000 --- a/v2/duo_registration_application_req.go +++ /dev/null @@ -1,15 +0,0 @@ -/* - * JumpCloud APIs - * - * JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. - * - * API version: 2.0 - * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) - */ - -package v2 - -type DuoRegistrationApplicationReq struct { - - RegistrationApplication *DuoRegistrationApplication `json:"registrationApplication"` -} diff --git a/v2/emailrequest.go b/v2/emailrequest.go deleted file mode 100644 index 95986d4..0000000 --- a/v2/emailrequest.go +++ /dev/null @@ -1,15 +0,0 @@ -/* - * JumpCloud APIs - * - * JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. - * - * API version: 2.0 - * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) - */ - -package v2 - -type Emailrequest struct { - - EmailType string `json:"emailType,omitempty"` -} diff --git a/v2/enrollment_profile.go b/v2/enrollment_profile.go deleted file mode 100644 index a717900..0000000 --- a/v2/enrollment_profile.go +++ /dev/null @@ -1,17 +0,0 @@ -/* - * JumpCloud APIs - * - * JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. - * - * API version: 2.0 - * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) - */ - -package v2 - -type EnrollmentProfile struct { - - AppleMdmId string `json:"appleMdmId,omitempty"` - - Id string `json:"id,omitempty"` -} diff --git a/v2/errorresponse.go b/v2/errorresponse.go deleted file mode 100644 index 5c74425..0000000 --- a/v2/errorresponse.go +++ /dev/null @@ -1,15 +0,0 @@ -/* - * JumpCloud APIs - * - * JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. - * - * API version: 2.0 - * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) - */ - -package v2 - -type Errorresponse struct { - - Message string `json:"message,omitempty"` -} diff --git a/v2/fde_api.go b/v2/fde_api.go deleted file mode 100644 index 578ad99..0000000 --- a/v2/fde_api.go +++ /dev/null @@ -1,114 +0,0 @@ -/* - * JumpCloud APIs - * - * JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. - * - * API version: 2.0 - * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) - */ - -package v2 - -import ( - "io/ioutil" - "net/url" - "net/http" - "strings" - "golang.org/x/net/context" - "encoding/json" - "fmt" -) - -// Linger please -var ( - _ context.Context -) - -type FdeApiService service - - -/* FdeApiService Get System FDE Key - This endpoint will return the current (latest) fde key saved for a system. - * @param ctx context.Context for authentication, logging, tracing, etc. - @param systemId - @param optional (nil or map[string]interface{}) with one or more of: - @param "xOrgId" (string) - @return Systemfdekey*/ -func (a *FdeApiService) SystemsGetFDEKey(ctx context.Context, systemId string, localVarOptionals map[string]interface{}) (Systemfdekey, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload Systemfdekey - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/systems/{system_id}/fdekey" - localVarPath = strings.Replace(localVarPath, "{"+"system_id"+"}", fmt.Sprintf("%v", systemId), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return successPayload, nil, err - } - - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - diff --git a/v2/g_suite_api.go b/v2/g_suite_api.go deleted file mode 100644 index 2092388..0000000 --- a/v2/g_suite_api.go +++ /dev/null @@ -1,946 +0,0 @@ -/* - * JumpCloud APIs - * - * JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. - * - * API version: 2.0 - * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) - */ - -package v2 - -import ( - "io/ioutil" - "net/url" - "net/http" - "strings" - "golang.org/x/net/context" - "encoding/json" - "fmt" -) - -// Linger please -var ( - _ context.Context -) - -type GSuiteApiService service - - -/* GSuiteApiService List the associations of a G Suite instance - This endpoint returns the _direct_ associations of this G Suite instance. A direct association can be a non-homogeneous relationship between 2 different objects, for example G Suite and Users. #### Sample Request ``` curl -X GET 'https://console.jumpcloud.com/api/v2/gsuites/{Gsuite_ID}/associations?targets=user_group \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - * @param ctx context.Context for authentication, logging, tracing, etc. - @param gsuiteId ObjectID of the G Suite instance. - @param targets - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "limit" (int32) The number of records to return at once. Limited to 100. - @param "skip" (int32) The offset into the records to return. - @param "xOrgId" (string) - @return []GraphConnection*/ -func (a *GSuiteApiService) GraphGSuiteAssociationsList(ctx context.Context, gsuiteId string, targets []string, contentType string, accept string, localVarOptionals map[string]interface{}) ([]GraphConnection, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload []GraphConnection - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/gsuites/{gsuite_id}/associations" - localVarPath = strings.Replace(localVarPath, "{"+"gsuite_id"+"}", fmt.Sprintf("%v", gsuiteId), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["limit"], "int32", "limit"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["skip"], "int32", "skip"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return successPayload, nil, err - } - - localVarQueryParams.Add("targets", parameterToString(targets, "csv")) - if localVarTempParam, localVarOk := localVarOptionals["limit"].(int32); localVarOk { - localVarQueryParams.Add("limit", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["skip"].(int32); localVarOk { - localVarQueryParams.Add("skip", parameterToString(localVarTempParam, "")) - } - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* GSuiteApiService Manage the associations of a G Suite instance - This endpoint returns the _direct_ associations of this G Suite instance. A direct association can be a non-homogeneous relationship between 2 different objects, for example G Suite and Users. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/gsuites/{Gsuite_ID}/associations \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"op\": \"add\", \"type\": \"user_group\", \"id\": \"{Group_ID}\" }' ``` - * @param ctx context.Context for authentication, logging, tracing, etc. - @param gsuiteId ObjectID of the G Suite instance. - @param optional (nil or map[string]interface{}) with one or more of: - @param "body" (GraphManagementReq) - @param "xOrgId" (string) - @return */ -func (a *GSuiteApiService) GraphGSuiteAssociationsPost(ctx context.Context, gsuiteId string, localVarOptionals map[string]interface{}) ( *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Post") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/gsuites/{gsuite_id}/associations" - localVarPath = strings.Replace(localVarPath, "{"+"gsuite_id"+"}", fmt.Sprintf("%v", gsuiteId), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return nil, err - } - - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - // body params - if localVarTempParam, localVarOk := localVarOptionals["body"].(GraphManagementReq); localVarOk { - localVarPostBody = &localVarTempParam - } - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - return localVarHttpResponse, err -} - -/* GSuiteApiService List the Users bound to a G Suite instance - This endpoint will return all Users bound to a G Suite instance, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this G Suite instance to the corresponding User; this array represents all grouping and/or associations that would have to be removed to deprovision the User from this G Suite instance. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/gsuites/{Gsuite_ID}/users \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - * @param ctx context.Context for authentication, logging, tracing, etc. - @param gsuiteId ObjectID of the G Suite instance. - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "limit" (int32) The number of records to return at once. Limited to 100. - @param "xOrgId" (string) - @param "skip" (int32) The offset into the records to return. - @param "filter" ([]string) Supported operators are: eq, ne, gt, ge, lt, le, between, search, in - @return []GraphObjectWithPaths*/ -func (a *GSuiteApiService) GraphGSuiteTraverseUser(ctx context.Context, gsuiteId string, contentType string, accept string, localVarOptionals map[string]interface{}) ([]GraphObjectWithPaths, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload []GraphObjectWithPaths - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/gsuites/{gsuite_id}/users" - localVarPath = strings.Replace(localVarPath, "{"+"gsuite_id"+"}", fmt.Sprintf("%v", gsuiteId), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["limit"], "int32", "limit"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["skip"], "int32", "skip"); err != nil { - return successPayload, nil, err - } - - if localVarTempParam, localVarOk := localVarOptionals["limit"].(int32); localVarOk { - localVarQueryParams.Add("limit", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["skip"].(int32); localVarOk { - localVarQueryParams.Add("skip", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["filter"].([]string); localVarOk { - localVarQueryParams.Add("filter", parameterToString(localVarTempParam, "csv")) - } - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* GSuiteApiService List the User Groups bound to a G Suite instance - This endpoint will return all User Groups bound to an G Suite instance, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the group's type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this G Suite instance to the corresponding User Group; this array represents all grouping and/or associations that would have to be removed to deprovision the User Group from this G Suite instance. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/gsuites/{GSuite_ID}/usergroups \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - * @param ctx context.Context for authentication, logging, tracing, etc. - @param gsuiteId ObjectID of the G Suite instance. - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "limit" (int32) The number of records to return at once. Limited to 100. - @param "xOrgId" (string) - @param "skip" (int32) The offset into the records to return. - @param "filter" ([]string) Supported operators are: eq, ne, gt, ge, lt, le, between, search, in - @return []GraphObjectWithPaths*/ -func (a *GSuiteApiService) GraphGSuiteTraverseUserGroup(ctx context.Context, gsuiteId string, contentType string, accept string, localVarOptionals map[string]interface{}) ([]GraphObjectWithPaths, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload []GraphObjectWithPaths - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/gsuites/{gsuite_id}/usergroups" - localVarPath = strings.Replace(localVarPath, "{"+"gsuite_id"+"}", fmt.Sprintf("%v", gsuiteId), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["limit"], "int32", "limit"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["skip"], "int32", "skip"); err != nil { - return successPayload, nil, err - } - - if localVarTempParam, localVarOk := localVarOptionals["limit"].(int32); localVarOk { - localVarQueryParams.Add("limit", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["skip"].(int32); localVarOk { - localVarQueryParams.Add("skip", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["filter"].([]string); localVarOk { - localVarQueryParams.Add("filter", parameterToString(localVarTempParam, "csv")) - } - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* GSuiteApiService Get G Suite - This endpoint returns a specific G Suite. ##### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/gsuites/{GSUITE_ID} \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - * @param ctx context.Context for authentication, logging, tracing, etc. - @param id Unique identifier of the GSuite. - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "xOrgId" (string) - @return GsuiteOutput*/ -func (a *GSuiteApiService) GsuitesGet(ctx context.Context, id string, contentType string, accept string, localVarOptionals map[string]interface{}) (GsuiteOutput, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload GsuiteOutput - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/gsuites/{id}" - localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return successPayload, nil, err - } - - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* GSuiteApiService Update existing G Suite - This endpoint allows updating some attributes of a G Suite. ##### Sample Request ``` curl -X PATCH https://console.jumpcloud.com/api/v2/gsuites/{GSUITE_ID} \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"userLockoutAction\": \"remove\", \"userPasswordExpirationAction\": \"disable\" }' ``` - * @param ctx context.Context for authentication, logging, tracing, etc. - @param id Unique identifier of the GSuite. - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "body" (GsuitePatchInput) - @param "xOrgId" (string) - @return GsuiteOutput*/ -func (a *GSuiteApiService) GsuitesPatch(ctx context.Context, id string, contentType string, accept string, localVarOptionals map[string]interface{}) (GsuiteOutput, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Patch") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload GsuiteOutput - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/gsuites/{id}" - localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return successPayload, nil, err - } - - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - // body params - if localVarTempParam, localVarOk := localVarOptionals["body"].(GsuitePatchInput); localVarOk { - localVarPostBody = &localVarTempParam - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* GSuiteApiService Deletes a G Suite translation rule - This endpoint allows you to delete a translation rule for a specific G Suite instance. These rules specify how JumpCloud attributes translate to [G Suite Admin SDK](https://developers.google.com/admin-sdk/directory/) attributes. #### Sample Request ``` curl -X DELETE https://console.jumpcloud.com/api/v2/gsuites/{gsuite_id}/translationrules/{id} \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - * @param ctx context.Context for authentication, logging, tracing, etc. - @param gsuiteId - @param id - @param contentType - @param accept - @return */ -func (a *GSuiteApiService) TranslationRulesGSuiteDelete(ctx context.Context, gsuiteId string, id string, contentType string, accept string) ( *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Delete") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/gsuites/{gsuite_id}/translationrules/{id}" - localVarPath = strings.Replace(localVarPath, "{"+"gsuite_id"+"}", fmt.Sprintf("%v", gsuiteId), -1) - localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - return localVarHttpResponse, err -} - -/* GSuiteApiService Gets a specific G Suite translation rule - This endpoint returns a specific translation rule for a specific G Suite instance. These rules specify how JumpCloud attributes translate to [G Suite Admin SDK](https://developers.google.com/admin-sdk/directory/) attributes. ###### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/gsuites/{gsuite_id}/translationrules/{id} \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - * @param ctx context.Context for authentication, logging, tracing, etc. - @param gsuiteId - @param id - @param contentType - @param accept - @return GSuiteTranslationRule*/ -func (a *GSuiteApiService) TranslationRulesGSuiteGet(ctx context.Context, gsuiteId string, id string, contentType string, accept string) (GSuiteTranslationRule, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload GSuiteTranslationRule - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/gsuites/{gsuite_id}/translationrules/{id}" - localVarPath = strings.Replace(localVarPath, "{"+"gsuite_id"+"}", fmt.Sprintf("%v", gsuiteId), -1) - localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* GSuiteApiService List all the G Suite Translation Rules - This endpoint returns all graph translation rules for a specific G Suite instance. These rules specify how JumpCloud attributes translate to [G Suite Admin SDK](https://developers.google.com/admin-sdk/directory/) attributes. ##### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/gsuites/{gsuite_id}/translationrules \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - * @param ctx context.Context for authentication, logging, tracing, etc. - @param gsuiteId - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "fields" ([]string) The comma separated fields included in the returned records. If omitted, the default list of fields will be returned. - @param "filter" ([]string) Supported operators are: eq, ne, gt, ge, lt, le, between, search, in - @param "limit" (int32) The number of records to return at once. Limited to 100. - @param "skip" (int32) The offset into the records to return. - @param "sort" ([]string) The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. - @return []GSuiteTranslationRule*/ -func (a *GSuiteApiService) TranslationRulesGSuiteList(ctx context.Context, gsuiteId string, contentType string, accept string, localVarOptionals map[string]interface{}) ([]GSuiteTranslationRule, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload []GSuiteTranslationRule - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/gsuites/{gsuite_id}/translationrules" - localVarPath = strings.Replace(localVarPath, "{"+"gsuite_id"+"}", fmt.Sprintf("%v", gsuiteId), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["limit"], "int32", "limit"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["skip"], "int32", "skip"); err != nil { - return successPayload, nil, err - } - - if localVarTempParam, localVarOk := localVarOptionals["fields"].([]string); localVarOk { - localVarQueryParams.Add("fields", parameterToString(localVarTempParam, "csv")) - } - if localVarTempParam, localVarOk := localVarOptionals["filter"].([]string); localVarOk { - localVarQueryParams.Add("filter", parameterToString(localVarTempParam, "csv")) - } - if localVarTempParam, localVarOk := localVarOptionals["limit"].(int32); localVarOk { - localVarQueryParams.Add("limit", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["skip"].(int32); localVarOk { - localVarQueryParams.Add("skip", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["sort"].([]string); localVarOk { - localVarQueryParams.Add("sort", parameterToString(localVarTempParam, "csv")) - } - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* GSuiteApiService Create a new G Suite Translation Rule - This endpoint allows you to create a translation rule for a specific G Suite instance. These rules specify how JumpCloud attributes translate to [G Suite Admin SDK](https://developers.google.com/admin-sdk/directory/) attributes. ##### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/gsuites/{gsuite_id}/translationrules \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ {Translation Rule Parameters} }' ``` - * @param ctx context.Context for authentication, logging, tracing, etc. - @param gsuiteId - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "body" (GSuiteTranslationRuleRequest) - @return GSuiteTranslationRule*/ -func (a *GSuiteApiService) TranslationRulesGSuitePost(ctx context.Context, gsuiteId string, contentType string, accept string, localVarOptionals map[string]interface{}) (GSuiteTranslationRule, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Post") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload GSuiteTranslationRule - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/gsuites/{gsuite_id}/translationrules" - localVarPath = strings.Replace(localVarPath, "{"+"gsuite_id"+"}", fmt.Sprintf("%v", gsuiteId), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - // body params - if localVarTempParam, localVarOk := localVarOptionals["body"].(GSuiteTranslationRuleRequest); localVarOk { - localVarPostBody = &localVarTempParam - } - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - diff --git a/v2/g_suite_builtin_translation.go b/v2/g_suite_builtin_translation.go deleted file mode 100644 index 638c428..0000000 --- a/v2/g_suite_builtin_translation.go +++ /dev/null @@ -1,30 +0,0 @@ -/* - * JumpCloud APIs - * - * JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. - * - * API version: 2.0 - * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) - */ - -package v2 -// GSuiteBuiltinTranslation : Built-in translations for G Suite export: * `user_home_addresses` - Translate all JumpCloud user addresses of type `home` to G Suite Directory user addresses of type `home` * `user_work_addresses` - Translate all JumpCloud user addresses of type `work` to G Suite Directory user addresses of type `work` * `user_other_addresses` - Translate all JumpCloud user addresses of type `other` to G Suite Directory user addresses of type `other` * `user_home_phone_numbers` - Translate all JumpCloud user phoneNumbers of type `home` to G Suite Directory user phones of type `home` * `user_mobile_phone_numbers` - Translate all JumpCloud user phoneNumbers of type `mobile` to G Suite Directory user phones of type `mobile` * `user_other_phone_numbers` - Translate all JumpCloud user phoneNumbers of type `other` to G Suite Directory user phones of type `other` * `user_work_phone_numbers` - Translate all JumpCloud user phoneNumbers of type `work` to G Suite Directory user phones of type `work` * `user_work_fax_phone_numbers` - Translate all JumpCloud user phoneNumbers of type `work_fax` to G Suite Directory user phones of type `work_fax` * `user_work_mobile_phone_numbers` - Translate all JumpCloud user phoneNumbers of type `work_mobile` to G Suite Directory user phones of type `work_mobile` * `user_primary_organization_cost_center` - Translate JumpCloud user `costCenter` to G Suite Directory user `costCenter` for `primary` organization * `user_primary_organization_department` - Translate JumpCloud user `department` to G Suite Directory user `department` for `primary` organization * `user_primary_organization_description` - Translate JumpCloud user `employeeType` to G Suite Directory user `description` for `primary` organization * `user_primary_organization_employee_id` - Translate JumpCloud user `employeeIdentifier` to G Suite Directory user `externalIds` element of type `organization` * `user_primary_organization_title` - Translate JumpCloud user `jobTitle` to G Suite Directory user `title` for `primary` organization -type GSuiteBuiltinTranslation string - -// List of GSuiteBuiltinTranslation -const ( - HOME_ADDRESSES GSuiteBuiltinTranslation = "user_home_addresses" - WORK_ADDRESSES GSuiteBuiltinTranslation = "user_work_addresses" - OTHER_ADDRESSES GSuiteBuiltinTranslation = "user_other_addresses" - HOME_PHONE_NUMBERS GSuiteBuiltinTranslation = "user_home_phone_numbers" - MOBILE_PHONE_NUMBERS GSuiteBuiltinTranslation = "user_mobile_phone_numbers" - OTHER_PHONE_NUMBERS GSuiteBuiltinTranslation = "user_other_phone_numbers" - WORK_PHONE_NUMBERS GSuiteBuiltinTranslation = "user_work_phone_numbers" - WORK_FAX_PHONE_NUMBERS GSuiteBuiltinTranslation = "user_work_fax_phone_numbers" - WORK_MOBILE_PHONE_NUMBERS GSuiteBuiltinTranslation = "user_work_mobile_phone_numbers" - PRIMARY_ORGANIZATION_COST_CENTER GSuiteBuiltinTranslation = "user_primary_organization_cost_center" - PRIMARY_ORGANIZATION_DEPARTMENT GSuiteBuiltinTranslation = "user_primary_organization_department" - PRIMARY_ORGANIZATION_DESCRIPTION GSuiteBuiltinTranslation = "user_primary_organization_description" - PRIMARY_ORGANIZATION_EMPLOYEE_ID GSuiteBuiltinTranslation = "user_primary_organization_employee_id" - PRIMARY_ORGANIZATION_TITLE GSuiteBuiltinTranslation = "user_primary_organization_title" -) diff --git a/v2/g_suite_translation_rule.go b/v2/g_suite_translation_rule.go deleted file mode 100644 index a8b2ada..0000000 --- a/v2/g_suite_translation_rule.go +++ /dev/null @@ -1,18 +0,0 @@ -/* - * JumpCloud APIs - * - * JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. - * - * API version: 2.0 - * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) - */ - -package v2 - -type GSuiteTranslationRule struct { - - BuiltIn *GSuiteBuiltinTranslation `json:"builtIn,omitempty"` - - // ObjectId uniquely identifying a Translation Rule. - Id string `json:"id,omitempty"` -} diff --git a/v2/g_suite_translation_rule_request.go b/v2/g_suite_translation_rule_request.go deleted file mode 100644 index 98b4edd..0000000 --- a/v2/g_suite_translation_rule_request.go +++ /dev/null @@ -1,15 +0,0 @@ -/* - * JumpCloud APIs - * - * JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. - * - * API version: 2.0 - * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) - */ - -package v2 - -type GSuiteTranslationRuleRequest struct { - - BuiltIn *GSuiteBuiltinTranslation `json:"builtIn,omitempty"` -} diff --git a/v2/graph_api.go b/v2/graph_api.go deleted file mode 100644 index 91921db..0000000 --- a/v2/graph_api.go +++ /dev/null @@ -1,8082 +0,0 @@ -/* - * JumpCloud APIs - * - * JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. - * - * API version: 2.0 - * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) - */ - -package v2 - -import ( - "io/ioutil" - "net/url" - "net/http" - "strings" - "golang.org/x/net/context" - "encoding/json" - "fmt" -) - -// Linger please -var ( - _ context.Context -) - -type GraphApiService service - - -/* GraphApiService List the associations of an Active Directory instance - This endpoint returns the direct associations of this Active Directory instance. A direct association can be a non-homogeneous relationship between 2 different objects, for example Active Directory and Users. #### Sample Request ``` curl -X GET 'https://console.jumpcloud.com/api/v2/activedirectories/{ActiveDirectory_ID}/associations?targets=user \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - * @param ctx context.Context for authentication, logging, tracing, etc. - @param activedirectoryId - @param targets - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "limit" (int32) The number of records to return at once. Limited to 100. - @param "skip" (int32) The offset into the records to return. - @param "xOrgId" (string) - @return []GraphConnection*/ -func (a *GraphApiService) GraphActiveDirectoryAssociationsList(ctx context.Context, activedirectoryId string, targets []string, contentType string, accept string, localVarOptionals map[string]interface{}) ([]GraphConnection, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload []GraphConnection - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/activedirectories/{activedirectory_id}/associations" - localVarPath = strings.Replace(localVarPath, "{"+"activedirectory_id"+"}", fmt.Sprintf("%v", activedirectoryId), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["limit"], "int32", "limit"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["skip"], "int32", "skip"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return successPayload, nil, err - } - - localVarQueryParams.Add("targets", parameterToString(targets, "csv")) - if localVarTempParam, localVarOk := localVarOptionals["limit"].(int32); localVarOk { - localVarQueryParams.Add("limit", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["skip"].(int32); localVarOk { - localVarQueryParams.Add("skip", parameterToString(localVarTempParam, "")) - } - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* GraphApiService Manage the associations of an Active Directory instance - This endpoint allows you to manage the _direct_ associations of an Active Directory instance. A direct association can be a non-homogeneous relationship between 2 different objects, for example Active Directory and Users. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/activedirectories/{AD_Instance_ID}/associations \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"op\": \"add\", \"type\": \"user\", \"id\": \"{User_ID}\" } ' ``` - * @param ctx context.Context for authentication, logging, tracing, etc. - @param activedirectoryId - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "body" (GraphManagementReq) - @param "xOrgId" (string) - @return */ -func (a *GraphApiService) GraphActiveDirectoryAssociationsPost(ctx context.Context, activedirectoryId string, contentType string, accept string, localVarOptionals map[string]interface{}) ( *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Post") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/activedirectories/{activedirectory_id}/associations" - localVarPath = strings.Replace(localVarPath, "{"+"activedirectory_id"+"}", fmt.Sprintf("%v", activedirectoryId), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return nil, err - } - - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - // body params - if localVarTempParam, localVarOk := localVarOptionals["body"].(GraphManagementReq); localVarOk { - localVarPostBody = &localVarTempParam - } - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - return localVarHttpResponse, err -} - -/* GraphApiService List the Users bound to an Active Directory instance - This endpoint will return all Users bound to an Active Directory instance, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this Active Directory instance to the corresponding User; this array represents all grouping and/or associations that would have to be removed to deprovision the User from this Active Directory instance. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/activedirectories/{ActiveDirectory_ID}/users \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - * @param ctx context.Context for authentication, logging, tracing, etc. - @param activedirectoryId ObjectID of the Active Directory instance. - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "filter" ([]string) Supported operators are: eq, ne, gt, ge, lt, le, between, search, in - @param "limit" (int32) The number of records to return at once. Limited to 100. - @param "xOrgId" (string) - @param "skip" (int32) The offset into the records to return. - @return []GraphObjectWithPaths*/ -func (a *GraphApiService) GraphActiveDirectoryTraverseUser(ctx context.Context, activedirectoryId string, contentType string, accept string, localVarOptionals map[string]interface{}) ([]GraphObjectWithPaths, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload []GraphObjectWithPaths - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/activedirectories/{activedirectory_id}/users" - localVarPath = strings.Replace(localVarPath, "{"+"activedirectory_id"+"}", fmt.Sprintf("%v", activedirectoryId), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["limit"], "int32", "limit"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["skip"], "int32", "skip"); err != nil { - return successPayload, nil, err - } - - if localVarTempParam, localVarOk := localVarOptionals["filter"].([]string); localVarOk { - localVarQueryParams.Add("filter", parameterToString(localVarTempParam, "csv")) - } - if localVarTempParam, localVarOk := localVarOptionals["limit"].(int32); localVarOk { - localVarQueryParams.Add("limit", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["skip"].(int32); localVarOk { - localVarQueryParams.Add("skip", parameterToString(localVarTempParam, "")) - } - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* GraphApiService List the User Groups bound to an Active Directory instance - This endpoint will return all Users Groups bound to an Active Directory instance, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the group's type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this Active Directory instance to the corresponding User Group; this array represents all grouping and/or associations that would have to be removed to deprovision the User Group from this Active Directory instance. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/activedirectories/{ActiveDirectory_ID}/usergroups \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - * @param ctx context.Context for authentication, logging, tracing, etc. - @param activedirectoryId ObjectID of the Active Directory instance. - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "limit" (int32) The number of records to return at once. Limited to 100. - @param "xOrgId" (string) - @param "skip" (int32) The offset into the records to return. - @param "filter" ([]string) Supported operators are: eq, ne, gt, ge, lt, le, between, search, in - @return []GraphObjectWithPaths*/ -func (a *GraphApiService) GraphActiveDirectoryTraverseUserGroup(ctx context.Context, activedirectoryId string, contentType string, accept string, localVarOptionals map[string]interface{}) ([]GraphObjectWithPaths, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload []GraphObjectWithPaths - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/activedirectories/{activedirectory_id}/usergroups" - localVarPath = strings.Replace(localVarPath, "{"+"activedirectory_id"+"}", fmt.Sprintf("%v", activedirectoryId), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["limit"], "int32", "limit"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["skip"], "int32", "skip"); err != nil { - return successPayload, nil, err - } - - if localVarTempParam, localVarOk := localVarOptionals["limit"].(int32); localVarOk { - localVarQueryParams.Add("limit", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["skip"].(int32); localVarOk { - localVarQueryParams.Add("skip", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["filter"].([]string); localVarOk { - localVarQueryParams.Add("filter", parameterToString(localVarTempParam, "csv")) - } - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* GraphApiService List the associations of an Application - This endpoint will return the _direct_ associations of an Application. A direct association can be a non-homogeneous relationship between 2 different objects, for example Applications and User Groups. #### Sample Request ``` curl -X GET 'https://console.jumpcloud.com/api/v2/applications/{Application_ID}/associations?targets=user_group \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - * @param ctx context.Context for authentication, logging, tracing, etc. - @param applicationId ObjectID of the Application. - @param targets - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "limit" (int32) The number of records to return at once. Limited to 100. - @param "skip" (int32) The offset into the records to return. - @param "xOrgId" (string) - @return []GraphConnection*/ -func (a *GraphApiService) GraphApplicationAssociationsList(ctx context.Context, applicationId string, targets []string, contentType string, accept string, localVarOptionals map[string]interface{}) ([]GraphConnection, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload []GraphConnection - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/applications/{application_id}/associations" - localVarPath = strings.Replace(localVarPath, "{"+"application_id"+"}", fmt.Sprintf("%v", applicationId), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["limit"], "int32", "limit"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["skip"], "int32", "skip"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return successPayload, nil, err - } - - localVarQueryParams.Add("targets", parameterToString(targets, "csv")) - if localVarTempParam, localVarOk := localVarOptionals["limit"].(int32); localVarOk { - localVarQueryParams.Add("limit", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["skip"].(int32); localVarOk { - localVarQueryParams.Add("skip", parameterToString(localVarTempParam, "")) - } - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* GraphApiService Manage the associations of an Application - This endpoint allows you to manage the _direct_ associations of an Application. A direct association can be a non-homogeneous relationship between 2 different objects, for example Application and User Groups. #### Sample Request ``` curl -X POST 'https://console.jumpcloud.com/api/v2/applications/{Application_ID}/associations' \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"op\": \"add\", \"type\": \"user_group\", \"id\": \"{Group_ID}\" }' ``` - * @param ctx context.Context for authentication, logging, tracing, etc. - @param applicationId ObjectID of the Application. - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "body" (GraphManagementReq) - @param "xOrgId" (string) - @return */ -func (a *GraphApiService) GraphApplicationAssociationsPost(ctx context.Context, applicationId string, contentType string, accept string, localVarOptionals map[string]interface{}) ( *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Post") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/applications/{application_id}/associations" - localVarPath = strings.Replace(localVarPath, "{"+"application_id"+"}", fmt.Sprintf("%v", applicationId), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return nil, err - } - - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - // body params - if localVarTempParam, localVarOk := localVarOptionals["body"].(GraphManagementReq); localVarOk { - localVarPostBody = &localVarTempParam - } - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - return localVarHttpResponse, err -} - -/* GraphApiService List the Users bound to an Application - This endpoint will return all Users bound to an Application, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this Application to the corresponding User; this array represents all grouping and/or associations that would have to be removed to deprovision the User from this Application. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/applications/{Application_ID}/users \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - * @param ctx context.Context for authentication, logging, tracing, etc. - @param applicationId ObjectID of the Application. - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "limit" (int32) The number of records to return at once. Limited to 100. - @param "xOrgId" (string) - @param "skip" (int32) The offset into the records to return. - @param "filter" ([]string) Supported operators are: eq, ne, gt, ge, lt, le, between, search, in - @return []GraphObjectWithPaths*/ -func (a *GraphApiService) GraphApplicationTraverseUser(ctx context.Context, applicationId string, contentType string, accept string, localVarOptionals map[string]interface{}) ([]GraphObjectWithPaths, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload []GraphObjectWithPaths - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/applications/{application_id}/users" - localVarPath = strings.Replace(localVarPath, "{"+"application_id"+"}", fmt.Sprintf("%v", applicationId), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["limit"], "int32", "limit"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["skip"], "int32", "skip"); err != nil { - return successPayload, nil, err - } - - if localVarTempParam, localVarOk := localVarOptionals["limit"].(int32); localVarOk { - localVarQueryParams.Add("limit", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["skip"].(int32); localVarOk { - localVarQueryParams.Add("skip", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["filter"].([]string); localVarOk { - localVarQueryParams.Add("filter", parameterToString(localVarTempParam, "csv")) - } - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* GraphApiService List the User Groups bound to an Application - This endpoint will return all Users Groups bound to an Application, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the group's type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this Application to the corresponding User Group; this array represents all grouping and/or associations that would have to be removed to deprovision the User Group from this Application. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/applications/{Application_ID}/usergroups \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - * @param ctx context.Context for authentication, logging, tracing, etc. - @param applicationId ObjectID of the Application. - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "limit" (int32) The number of records to return at once. Limited to 100. - @param "xOrgId" (string) - @param "skip" (int32) The offset into the records to return. - @param "filter" ([]string) Supported operators are: eq, ne, gt, ge, lt, le, between, search, in - @return []GraphObjectWithPaths*/ -func (a *GraphApiService) GraphApplicationTraverseUserGroup(ctx context.Context, applicationId string, contentType string, accept string, localVarOptionals map[string]interface{}) ([]GraphObjectWithPaths, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload []GraphObjectWithPaths - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/applications/{application_id}/usergroups" - localVarPath = strings.Replace(localVarPath, "{"+"application_id"+"}", fmt.Sprintf("%v", applicationId), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["limit"], "int32", "limit"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["skip"], "int32", "skip"); err != nil { - return successPayload, nil, err - } - - if localVarTempParam, localVarOk := localVarOptionals["limit"].(int32); localVarOk { - localVarQueryParams.Add("limit", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["skip"].(int32); localVarOk { - localVarQueryParams.Add("skip", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["filter"].([]string); localVarOk { - localVarQueryParams.Add("filter", parameterToString(localVarTempParam, "csv")) - } - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* GraphApiService List the associations of a Command - This endpoint will return the _direct_ associations of this Command. A direct association can be a non-homogeneous relationship between 2 different objects, for example Commands and User Groups. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/commands/{Command_ID}/associations?targets=system_group \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - * @param ctx context.Context for authentication, logging, tracing, etc. - @param commandId ObjectID of the Command. - @param targets - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "limit" (int32) The number of records to return at once. Limited to 100. - @param "skip" (int32) The offset into the records to return. - @param "xOrgId" (string) - @return []GraphConnection*/ -func (a *GraphApiService) GraphCommandAssociationsList(ctx context.Context, commandId string, targets []string, contentType string, accept string, localVarOptionals map[string]interface{}) ([]GraphConnection, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload []GraphConnection - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/commands/{command_id}/associations" - localVarPath = strings.Replace(localVarPath, "{"+"command_id"+"}", fmt.Sprintf("%v", commandId), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["limit"], "int32", "limit"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["skip"], "int32", "skip"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return successPayload, nil, err - } - - localVarQueryParams.Add("targets", parameterToString(targets, "csv")) - if localVarTempParam, localVarOk := localVarOptionals["limit"].(int32); localVarOk { - localVarQueryParams.Add("limit", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["skip"].(int32); localVarOk { - localVarQueryParams.Add("skip", parameterToString(localVarTempParam, "")) - } - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* GraphApiService Manage the associations of a Command - This endpoint will allow you to manage the _direct_ associations of this Command. A direct association can be a non-homogeneous relationship between 2 different objects, for example Commands and User Groups. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/commands/{Command_ID}/associations \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"op\": \"add\", \"type\": \"system_group\", \"id\": \"Group_ID\" }' ``` - * @param ctx context.Context for authentication, logging, tracing, etc. - @param commandId ObjectID of the Command. - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "body" (GraphManagementReq) - @param "xOrgId" (string) - @return */ -func (a *GraphApiService) GraphCommandAssociationsPost(ctx context.Context, commandId string, contentType string, accept string, localVarOptionals map[string]interface{}) ( *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Post") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/commands/{command_id}/associations" - localVarPath = strings.Replace(localVarPath, "{"+"command_id"+"}", fmt.Sprintf("%v", commandId), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return nil, err - } - - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - // body params - if localVarTempParam, localVarOk := localVarOptionals["body"].(GraphManagementReq); localVarOk { - localVarPostBody = &localVarTempParam - } - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - return localVarHttpResponse, err -} - -/* GraphApiService List the Systems bound to a Command - This endpoint will return all Systems bound to a Command, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this Command to the corresponding System; this array represents all grouping and/or associations that would have to be removed to deprovision the System from this Command. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/commands/{Command_ID}/systems \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - * @param ctx context.Context for authentication, logging, tracing, etc. - @param commandId ObjectID of the Command. - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "limit" (int32) The number of records to return at once. Limited to 100. - @param "xOrgId" (string) - @param "skip" (int32) The offset into the records to return. - @param "filter" ([]string) Supported operators are: eq, ne, gt, ge, lt, le, between, search, in - @return []GraphObjectWithPaths*/ -func (a *GraphApiService) GraphCommandTraverseSystem(ctx context.Context, commandId string, contentType string, accept string, localVarOptionals map[string]interface{}) ([]GraphObjectWithPaths, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload []GraphObjectWithPaths - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/commands/{command_id}/systems" - localVarPath = strings.Replace(localVarPath, "{"+"command_id"+"}", fmt.Sprintf("%v", commandId), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["limit"], "int32", "limit"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["skip"], "int32", "skip"); err != nil { - return successPayload, nil, err - } - - if localVarTempParam, localVarOk := localVarOptionals["limit"].(int32); localVarOk { - localVarQueryParams.Add("limit", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["skip"].(int32); localVarOk { - localVarQueryParams.Add("skip", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["filter"].([]string); localVarOk { - localVarQueryParams.Add("filter", parameterToString(localVarTempParam, "csv")) - } - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* GraphApiService List the System Groups bound to a Command - This endpoint will return all System Groups bound to a Command, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the group's type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this Command to the corresponding System Group; this array represents all grouping and/or associations that would have to be removed to deprovision the System Group from this Command. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/commands/{Command_ID}/systemgroups \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - * @param ctx context.Context for authentication, logging, tracing, etc. - @param commandId ObjectID of the Command. - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "limit" (int32) The number of records to return at once. Limited to 100. - @param "xOrgId" (string) - @param "skip" (int32) The offset into the records to return. - @param "filter" ([]string) Supported operators are: eq, ne, gt, ge, lt, le, between, search, in - @return []GraphObjectWithPaths*/ -func (a *GraphApiService) GraphCommandTraverseSystemGroup(ctx context.Context, commandId string, contentType string, accept string, localVarOptionals map[string]interface{}) ([]GraphObjectWithPaths, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload []GraphObjectWithPaths - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/commands/{command_id}/systemgroups" - localVarPath = strings.Replace(localVarPath, "{"+"command_id"+"}", fmt.Sprintf("%v", commandId), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["limit"], "int32", "limit"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["skip"], "int32", "skip"); err != nil { - return successPayload, nil, err - } - - if localVarTempParam, localVarOk := localVarOptionals["limit"].(int32); localVarOk { - localVarQueryParams.Add("limit", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["skip"].(int32); localVarOk { - localVarQueryParams.Add("skip", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["filter"].([]string); localVarOk { - localVarQueryParams.Add("filter", parameterToString(localVarTempParam, "csv")) - } - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* GraphApiService List the associations of a G Suite instance - This endpoint returns the _direct_ associations of this G Suite instance. A direct association can be a non-homogeneous relationship between 2 different objects, for example G Suite and Users. #### Sample Request ``` curl -X GET 'https://console.jumpcloud.com/api/v2/gsuites/{Gsuite_ID}/associations?targets=user_group \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - * @param ctx context.Context for authentication, logging, tracing, etc. - @param gsuiteId ObjectID of the G Suite instance. - @param targets - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "limit" (int32) The number of records to return at once. Limited to 100. - @param "skip" (int32) The offset into the records to return. - @param "xOrgId" (string) - @return []GraphConnection*/ -func (a *GraphApiService) GraphGSuiteAssociationsList(ctx context.Context, gsuiteId string, targets []string, contentType string, accept string, localVarOptionals map[string]interface{}) ([]GraphConnection, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload []GraphConnection - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/gsuites/{gsuite_id}/associations" - localVarPath = strings.Replace(localVarPath, "{"+"gsuite_id"+"}", fmt.Sprintf("%v", gsuiteId), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["limit"], "int32", "limit"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["skip"], "int32", "skip"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return successPayload, nil, err - } - - localVarQueryParams.Add("targets", parameterToString(targets, "csv")) - if localVarTempParam, localVarOk := localVarOptionals["limit"].(int32); localVarOk { - localVarQueryParams.Add("limit", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["skip"].(int32); localVarOk { - localVarQueryParams.Add("skip", parameterToString(localVarTempParam, "")) - } - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* GraphApiService Manage the associations of a G Suite instance - This endpoint returns the _direct_ associations of this G Suite instance. A direct association can be a non-homogeneous relationship between 2 different objects, for example G Suite and Users. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/gsuites/{Gsuite_ID}/associations \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"op\": \"add\", \"type\": \"user_group\", \"id\": \"{Group_ID}\" }' ``` - * @param ctx context.Context for authentication, logging, tracing, etc. - @param gsuiteId ObjectID of the G Suite instance. - @param optional (nil or map[string]interface{}) with one or more of: - @param "body" (GraphManagementReq) - @param "xOrgId" (string) - @return */ -func (a *GraphApiService) GraphGSuiteAssociationsPost(ctx context.Context, gsuiteId string, localVarOptionals map[string]interface{}) ( *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Post") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/gsuites/{gsuite_id}/associations" - localVarPath = strings.Replace(localVarPath, "{"+"gsuite_id"+"}", fmt.Sprintf("%v", gsuiteId), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return nil, err - } - - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - // body params - if localVarTempParam, localVarOk := localVarOptionals["body"].(GraphManagementReq); localVarOk { - localVarPostBody = &localVarTempParam - } - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - return localVarHttpResponse, err -} - -/* GraphApiService List the Users bound to a G Suite instance - This endpoint will return all Users bound to a G Suite instance, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this G Suite instance to the corresponding User; this array represents all grouping and/or associations that would have to be removed to deprovision the User from this G Suite instance. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/gsuites/{Gsuite_ID}/users \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - * @param ctx context.Context for authentication, logging, tracing, etc. - @param gsuiteId ObjectID of the G Suite instance. - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "limit" (int32) The number of records to return at once. Limited to 100. - @param "xOrgId" (string) - @param "skip" (int32) The offset into the records to return. - @param "filter" ([]string) Supported operators are: eq, ne, gt, ge, lt, le, between, search, in - @return []GraphObjectWithPaths*/ -func (a *GraphApiService) GraphGSuiteTraverseUser(ctx context.Context, gsuiteId string, contentType string, accept string, localVarOptionals map[string]interface{}) ([]GraphObjectWithPaths, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload []GraphObjectWithPaths - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/gsuites/{gsuite_id}/users" - localVarPath = strings.Replace(localVarPath, "{"+"gsuite_id"+"}", fmt.Sprintf("%v", gsuiteId), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["limit"], "int32", "limit"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["skip"], "int32", "skip"); err != nil { - return successPayload, nil, err - } - - if localVarTempParam, localVarOk := localVarOptionals["limit"].(int32); localVarOk { - localVarQueryParams.Add("limit", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["skip"].(int32); localVarOk { - localVarQueryParams.Add("skip", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["filter"].([]string); localVarOk { - localVarQueryParams.Add("filter", parameterToString(localVarTempParam, "csv")) - } - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* GraphApiService List the User Groups bound to a G Suite instance - This endpoint will return all User Groups bound to an G Suite instance, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the group's type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this G Suite instance to the corresponding User Group; this array represents all grouping and/or associations that would have to be removed to deprovision the User Group from this G Suite instance. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/gsuites/{GSuite_ID}/usergroups \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - * @param ctx context.Context for authentication, logging, tracing, etc. - @param gsuiteId ObjectID of the G Suite instance. - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "limit" (int32) The number of records to return at once. Limited to 100. - @param "xOrgId" (string) - @param "skip" (int32) The offset into the records to return. - @param "filter" ([]string) Supported operators are: eq, ne, gt, ge, lt, le, between, search, in - @return []GraphObjectWithPaths*/ -func (a *GraphApiService) GraphGSuiteTraverseUserGroup(ctx context.Context, gsuiteId string, contentType string, accept string, localVarOptionals map[string]interface{}) ([]GraphObjectWithPaths, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload []GraphObjectWithPaths - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/gsuites/{gsuite_id}/usergroups" - localVarPath = strings.Replace(localVarPath, "{"+"gsuite_id"+"}", fmt.Sprintf("%v", gsuiteId), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["limit"], "int32", "limit"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["skip"], "int32", "skip"); err != nil { - return successPayload, nil, err - } - - if localVarTempParam, localVarOk := localVarOptionals["limit"].(int32); localVarOk { - localVarQueryParams.Add("limit", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["skip"].(int32); localVarOk { - localVarQueryParams.Add("skip", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["filter"].([]string); localVarOk { - localVarQueryParams.Add("filter", parameterToString(localVarTempParam, "csv")) - } - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* GraphApiService List the associations of a LDAP Server - This endpoint returns the _direct_ associations of this LDAP Server. A direct association can be a non-homogeneous relationship between 2 different objects, for example LDAP and Users. #### Sample Request ``` curl -X GET 'https://console.jumpcloud.com/api/v2/ldapservers/{LDAP_ID}/associations?targets=user_group \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - * @param ctx context.Context for authentication, logging, tracing, etc. - @param ldapserverId ObjectID of the LDAP Server. - @param targets - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "limit" (int32) The number of records to return at once. Limited to 100. - @param "skip" (int32) The offset into the records to return. - @param "xOrgId" (string) - @return []GraphConnection*/ -func (a *GraphApiService) GraphLdapServerAssociationsList(ctx context.Context, ldapserverId string, targets []string, contentType string, accept string, localVarOptionals map[string]interface{}) ([]GraphConnection, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload []GraphConnection - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/ldapservers/{ldapserver_id}/associations" - localVarPath = strings.Replace(localVarPath, "{"+"ldapserver_id"+"}", fmt.Sprintf("%v", ldapserverId), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["limit"], "int32", "limit"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["skip"], "int32", "skip"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return successPayload, nil, err - } - - localVarQueryParams.Add("targets", parameterToString(targets, "csv")) - if localVarTempParam, localVarOk := localVarOptionals["limit"].(int32); localVarOk { - localVarQueryParams.Add("limit", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["skip"].(int32); localVarOk { - localVarQueryParams.Add("skip", parameterToString(localVarTempParam, "")) - } - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* GraphApiService Manage the associations of a LDAP Server - This endpoint allows you to manage the _direct_ associations of a LDAP Server. A direct association can be a non-homogeneous relationship between 2 different objects, for example LDAP and Users. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/ldapservers/{LDAP_ID}/associations \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"op\": \"add\", \"type\": \"user\", \"id\": \"{User_ID}\" }' ``` - * @param ctx context.Context for authentication, logging, tracing, etc. - @param ldapserverId ObjectID of the LDAP Server. - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "body" (GraphManagementReq) - @param "xOrgId" (string) - @return */ -func (a *GraphApiService) GraphLdapServerAssociationsPost(ctx context.Context, ldapserverId string, contentType string, accept string, localVarOptionals map[string]interface{}) ( *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Post") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/ldapservers/{ldapserver_id}/associations" - localVarPath = strings.Replace(localVarPath, "{"+"ldapserver_id"+"}", fmt.Sprintf("%v", ldapserverId), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return nil, err - } - - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - // body params - if localVarTempParam, localVarOk := localVarOptionals["body"].(GraphManagementReq); localVarOk { - localVarPostBody = &localVarTempParam - } - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - return localVarHttpResponse, err -} - -/* GraphApiService List the Users bound to a LDAP Server - This endpoint will return all Users bound to an LDAP Server, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this LDAP server instance to the corresponding User; this array represents all grouping and/or associations that would have to be removed to deprovision the User from this LDAP server instance. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/ldapservers/{LDAP_ID}/users \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - * @param ctx context.Context for authentication, logging, tracing, etc. - @param ldapserverId ObjectID of the LDAP Server. - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "limit" (int32) The number of records to return at once. Limited to 100. - @param "xOrgId" (string) - @param "skip" (int32) The offset into the records to return. - @param "filter" ([]string) Supported operators are: eq, ne, gt, ge, lt, le, between, search, in - @return []GraphObjectWithPaths*/ -func (a *GraphApiService) GraphLdapServerTraverseUser(ctx context.Context, ldapserverId string, contentType string, accept string, localVarOptionals map[string]interface{}) ([]GraphObjectWithPaths, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload []GraphObjectWithPaths - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/ldapservers/{ldapserver_id}/users" - localVarPath = strings.Replace(localVarPath, "{"+"ldapserver_id"+"}", fmt.Sprintf("%v", ldapserverId), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["limit"], "int32", "limit"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["skip"], "int32", "skip"); err != nil { - return successPayload, nil, err - } - - if localVarTempParam, localVarOk := localVarOptionals["limit"].(int32); localVarOk { - localVarQueryParams.Add("limit", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["skip"].(int32); localVarOk { - localVarQueryParams.Add("skip", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["filter"].([]string); localVarOk { - localVarQueryParams.Add("filter", parameterToString(localVarTempParam, "csv")) - } - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* GraphApiService List the User Groups bound to a LDAP Server - This endpoint will return all Users Groups bound to a LDAP Server, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the group's type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this LDAP server instance to the corresponding User Group; this array represents all grouping and/or associations that would have to be removed to deprovision the User Group from this LDAP server instance. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/ldapservers/{LDAP_ID}/usergroups \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - * @param ctx context.Context for authentication, logging, tracing, etc. - @param ldapserverId ObjectID of the LDAP Server. - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "limit" (int32) The number of records to return at once. Limited to 100. - @param "xOrgId" (string) - @param "skip" (int32) The offset into the records to return. - @param "filter" ([]string) Supported operators are: eq, ne, gt, ge, lt, le, between, search, in - @return []GraphObjectWithPaths*/ -func (a *GraphApiService) GraphLdapServerTraverseUserGroup(ctx context.Context, ldapserverId string, contentType string, accept string, localVarOptionals map[string]interface{}) ([]GraphObjectWithPaths, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload []GraphObjectWithPaths - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/ldapservers/{ldapserver_id}/usergroups" - localVarPath = strings.Replace(localVarPath, "{"+"ldapserver_id"+"}", fmt.Sprintf("%v", ldapserverId), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["limit"], "int32", "limit"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["skip"], "int32", "skip"); err != nil { - return successPayload, nil, err - } - - if localVarTempParam, localVarOk := localVarOptionals["limit"].(int32); localVarOk { - localVarQueryParams.Add("limit", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["skip"].(int32); localVarOk { - localVarQueryParams.Add("skip", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["filter"].([]string); localVarOk { - localVarQueryParams.Add("filter", parameterToString(localVarTempParam, "csv")) - } - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* GraphApiService List the associations of an Office 365 instance - This endpoint returns _direct_ associations of an Office 365 instance. A direct association can be a non-homogeneous relationship between 2 different objects, for example Office 365 and Users. #### Sample Request ``` curl -X GET 'https://console.jumpcloud.com/api/v2/office365s/{O365_ID}/associations?targets=user_group \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - * @param ctx context.Context for authentication, logging, tracing, etc. - @param office365Id ObjectID of the Office 365 instance. - @param targets - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "limit" (int32) The number of records to return at once. Limited to 100. - @param "skip" (int32) The offset into the records to return. - @param "xOrgId" (string) - @return []GraphConnection*/ -func (a *GraphApiService) GraphOffice365AssociationsList(ctx context.Context, office365Id string, targets []string, contentType string, accept string, localVarOptionals map[string]interface{}) ([]GraphConnection, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload []GraphConnection - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/office365s/{office365_id}/associations" - localVarPath = strings.Replace(localVarPath, "{"+"office365_id"+"}", fmt.Sprintf("%v", office365Id), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["limit"], "int32", "limit"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["skip"], "int32", "skip"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return successPayload, nil, err - } - - localVarQueryParams.Add("targets", parameterToString(targets, "csv")) - if localVarTempParam, localVarOk := localVarOptionals["limit"].(int32); localVarOk { - localVarQueryParams.Add("limit", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["skip"].(int32); localVarOk { - localVarQueryParams.Add("skip", parameterToString(localVarTempParam, "")) - } - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* GraphApiService Manage the associations of an Office 365 instance - This endpoint allows you to manage the _direct_ associations of a Office 365 instance. A direct association can be a non-homogeneous relationship between 2 different objects, for example Office 365 and Users. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/office365s/{O365_ID}/associations \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"op\": \"add\", \"type\": \"user_group\", \"id\": \"{Group_ID}\" }' ``` - * @param ctx context.Context for authentication, logging, tracing, etc. - @param office365Id ObjectID of the Office 365 instance. - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "body" (GraphManagementReq) - @param "xOrgId" (string) - @return */ -func (a *GraphApiService) GraphOffice365AssociationsPost(ctx context.Context, office365Id string, contentType string, accept string, localVarOptionals map[string]interface{}) ( *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Post") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/office365s/{office365_id}/associations" - localVarPath = strings.Replace(localVarPath, "{"+"office365_id"+"}", fmt.Sprintf("%v", office365Id), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return nil, err - } - - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - // body params - if localVarTempParam, localVarOk := localVarOptionals["body"].(GraphManagementReq); localVarOk { - localVarPostBody = &localVarTempParam - } - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - return localVarHttpResponse, err -} - -/* GraphApiService List the Users bound to an Office 365 instance - This endpoint will return all Users bound to an Office 365 instance, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this Office 365 instance to the corresponding User; this array represents all grouping and/or associations that would have to be removed to deprovision the User from this Office 365 instance. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/office365s/{O365_ID}/users \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - * @param ctx context.Context for authentication, logging, tracing, etc. - @param office365Id ObjectID of the Office 365 suite. - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "limit" (int32) The number of records to return at once. Limited to 100. - @param "xOrgId" (string) - @param "skip" (int32) The offset into the records to return. - @param "filter" ([]string) Supported operators are: eq, ne, gt, ge, lt, le, between, search, in - @return []GraphObjectWithPaths*/ -func (a *GraphApiService) GraphOffice365TraverseUser(ctx context.Context, office365Id string, contentType string, accept string, localVarOptionals map[string]interface{}) ([]GraphObjectWithPaths, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload []GraphObjectWithPaths - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/office365s/{office365_id}/users" - localVarPath = strings.Replace(localVarPath, "{"+"office365_id"+"}", fmt.Sprintf("%v", office365Id), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["limit"], "int32", "limit"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["skip"], "int32", "skip"); err != nil { - return successPayload, nil, err - } - - if localVarTempParam, localVarOk := localVarOptionals["limit"].(int32); localVarOk { - localVarQueryParams.Add("limit", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["skip"].(int32); localVarOk { - localVarQueryParams.Add("skip", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["filter"].([]string); localVarOk { - localVarQueryParams.Add("filter", parameterToString(localVarTempParam, "csv")) - } - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* GraphApiService List the User Groups bound to an Office 365 instance - This endpoint will return all Users Groups bound to an Office 365 instance, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the group's type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this Office 365 instance to the corresponding User Group; this array represents all grouping and/or associations that would have to be removed to deprovision the User Group from this Office 365 instance. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/office365s/{O365_ID/usergroups \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - * @param ctx context.Context for authentication, logging, tracing, etc. - @param office365Id ObjectID of the Office 365 suite. - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "limit" (int32) The number of records to return at once. Limited to 100. - @param "xOrgId" (string) - @param "skip" (int32) The offset into the records to return. - @param "filter" ([]string) Supported operators are: eq, ne, gt, ge, lt, le, between, search, in - @return []GraphObjectWithPaths*/ -func (a *GraphApiService) GraphOffice365TraverseUserGroup(ctx context.Context, office365Id string, contentType string, accept string, localVarOptionals map[string]interface{}) ([]GraphObjectWithPaths, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload []GraphObjectWithPaths - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/office365s/{office365_id}/usergroups" - localVarPath = strings.Replace(localVarPath, "{"+"office365_id"+"}", fmt.Sprintf("%v", office365Id), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["limit"], "int32", "limit"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["skip"], "int32", "skip"); err != nil { - return successPayload, nil, err - } - - if localVarTempParam, localVarOk := localVarOptionals["limit"].(int32); localVarOk { - localVarQueryParams.Add("limit", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["skip"].(int32); localVarOk { - localVarQueryParams.Add("skip", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["filter"].([]string); localVarOk { - localVarQueryParams.Add("filter", parameterToString(localVarTempParam, "csv")) - } - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* GraphApiService List the associations of a Policy - This endpoint returns the _direct_ associations of a Policy. A direct association can be a non-homogeneous relationship between 2 different objects, for example Policies and Systems. #### Sample Request ``` curl -X GET 'https://console.jumpcloud.com/api/v2/policies/{Policy_ID}/associations?targets=system_group \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - * @param ctx context.Context for authentication, logging, tracing, etc. - @param policyId ObjectID of the Policy. - @param targets - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "limit" (int32) The number of records to return at once. Limited to 100. - @param "skip" (int32) The offset into the records to return. - @param "xOrgId" (string) - @return []GraphConnection*/ -func (a *GraphApiService) GraphPolicyAssociationsList(ctx context.Context, policyId string, targets []string, contentType string, accept string, localVarOptionals map[string]interface{}) ([]GraphConnection, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload []GraphConnection - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/policies/{policy_id}/associations" - localVarPath = strings.Replace(localVarPath, "{"+"policy_id"+"}", fmt.Sprintf("%v", policyId), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["limit"], "int32", "limit"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["skip"], "int32", "skip"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return successPayload, nil, err - } - - localVarQueryParams.Add("targets", parameterToString(targets, "csv")) - if localVarTempParam, localVarOk := localVarOptionals["limit"].(int32); localVarOk { - localVarQueryParams.Add("limit", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["skip"].(int32); localVarOk { - localVarQueryParams.Add("skip", parameterToString(localVarTempParam, "")) - } - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* GraphApiService Manage the associations of a Policy - This endpoint allows you to manage the _direct_ associations of a Policy. A direct association can be a non-homogeneous relationship between 2 different objects, for example Policies and Systems. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/policies/{Policy_ID}/associations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"op\": \"add\", \"type\": \"system_group\", \"id\": \"{Group_ID}\" }' ``` - * @param ctx context.Context for authentication, logging, tracing, etc. - @param policyId ObjectID of the Policy. - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "body" (GraphManagementReq) - @param "xOrgId" (string) - @return */ -func (a *GraphApiService) GraphPolicyAssociationsPost(ctx context.Context, policyId string, contentType string, accept string, localVarOptionals map[string]interface{}) ( *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Post") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/policies/{policy_id}/associations" - localVarPath = strings.Replace(localVarPath, "{"+"policy_id"+"}", fmt.Sprintf("%v", policyId), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return nil, err - } - - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - // body params - if localVarTempParam, localVarOk := localVarOptionals["body"].(GraphManagementReq); localVarOk { - localVarPostBody = &localVarTempParam - } - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - return localVarHttpResponse, err -} - -/* GraphApiService List the Systems bound to a Policy - This endpoint will return all Systems bound to a Policy, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this Policy to the corresponding System; this array represents all grouping and/or associations that would have to be removed to deprovision the System from this Policy. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/policies/{Policy_ID}/systems \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - * @param ctx context.Context for authentication, logging, tracing, etc. - @param policyId ObjectID of the Command. - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "limit" (int32) The number of records to return at once. Limited to 100. - @param "xOrgId" (string) - @param "skip" (int32) The offset into the records to return. - @param "filter" ([]string) Supported operators are: eq, ne, gt, ge, lt, le, between, search, in - @return []GraphObjectWithPaths*/ -func (a *GraphApiService) GraphPolicyTraverseSystem(ctx context.Context, policyId string, contentType string, accept string, localVarOptionals map[string]interface{}) ([]GraphObjectWithPaths, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload []GraphObjectWithPaths - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/policies/{policy_id}/systems" - localVarPath = strings.Replace(localVarPath, "{"+"policy_id"+"}", fmt.Sprintf("%v", policyId), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["limit"], "int32", "limit"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["skip"], "int32", "skip"); err != nil { - return successPayload, nil, err - } - - if localVarTempParam, localVarOk := localVarOptionals["limit"].(int32); localVarOk { - localVarQueryParams.Add("limit", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["skip"].(int32); localVarOk { - localVarQueryParams.Add("skip", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["filter"].([]string); localVarOk { - localVarQueryParams.Add("filter", parameterToString(localVarTempParam, "csv")) - } - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* GraphApiService List the System Groups bound to a Policy - This endpoint will return all Systems Groups bound to a Policy, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the group's type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this Policy to the corresponding System Group; this array represents all grouping and/or associations that would have to be removed to deprovision the System Group from this Policy. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/policies/{Policy_ID}/systemgroups \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - * @param ctx context.Context for authentication, logging, tracing, etc. - @param policyId ObjectID of the Command. - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "limit" (int32) The number of records to return at once. Limited to 100. - @param "xOrgId" (string) - @param "skip" (int32) The offset into the records to return. - @param "filter" ([]string) Supported operators are: eq, ne, gt, ge, lt, le, between, search, in - @return []GraphObjectWithPaths*/ -func (a *GraphApiService) GraphPolicyTraverseSystemGroup(ctx context.Context, policyId string, contentType string, accept string, localVarOptionals map[string]interface{}) ([]GraphObjectWithPaths, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload []GraphObjectWithPaths - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/policies/{policy_id}/systemgroups" - localVarPath = strings.Replace(localVarPath, "{"+"policy_id"+"}", fmt.Sprintf("%v", policyId), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["limit"], "int32", "limit"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["skip"], "int32", "skip"); err != nil { - return successPayload, nil, err - } - - if localVarTempParam, localVarOk := localVarOptionals["limit"].(int32); localVarOk { - localVarQueryParams.Add("limit", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["skip"].(int32); localVarOk { - localVarQueryParams.Add("skip", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["filter"].([]string); localVarOk { - localVarQueryParams.Add("filter", parameterToString(localVarTempParam, "csv")) - } - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* GraphApiService List the associations of a RADIUS Server - This endpoint returns the _direct_ associations of a Radius Server. A direct association can be a non-homogeneous relationship between 2 different objects, for example Radius Servers and Users. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/radiusservers/{RADIUS_ID}/associations?targets=user_group \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - * @param ctx context.Context for authentication, logging, tracing, etc. - @param radiusserverId ObjectID of the Radius Server. - @param targets - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "limit" (int32) The number of records to return at once. Limited to 100. - @param "skip" (int32) The offset into the records to return. - @param "xOrgId" (string) - @return []GraphConnection*/ -func (a *GraphApiService) GraphRadiusServerAssociationsList(ctx context.Context, radiusserverId string, targets []string, contentType string, accept string, localVarOptionals map[string]interface{}) ([]GraphConnection, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload []GraphConnection - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/radiusservers/{radiusserver_id}/associations" - localVarPath = strings.Replace(localVarPath, "{"+"radiusserver_id"+"}", fmt.Sprintf("%v", radiusserverId), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["limit"], "int32", "limit"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["skip"], "int32", "skip"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return successPayload, nil, err - } - - localVarQueryParams.Add("targets", parameterToString(targets, "csv")) - if localVarTempParam, localVarOk := localVarOptionals["limit"].(int32); localVarOk { - localVarQueryParams.Add("limit", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["skip"].(int32); localVarOk { - localVarQueryParams.Add("skip", parameterToString(localVarTempParam, "")) - } - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* GraphApiService Manage the associations of a RADIUS Server - This endpoint allows you to manage the _direct_ associations of a Radius Server. A direct association can be a non-homogeneous relationship between 2 different objects, for example Radius Servers and Users. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/radiusservers/{RADIUS_ID}/associations \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"type\":\"user\", \"id\":\"{USER_ID}\", \"op\":\"add\" }' ``` - * @param ctx context.Context for authentication, logging, tracing, etc. - @param radiusserverId ObjectID of the Radius Server. - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "body" (GraphManagementReq) - @param "xOrgId" (string) - @return */ -func (a *GraphApiService) GraphRadiusServerAssociationsPost(ctx context.Context, radiusserverId string, contentType string, accept string, localVarOptionals map[string]interface{}) ( *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Post") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/radiusservers/{radiusserver_id}/associations" - localVarPath = strings.Replace(localVarPath, "{"+"radiusserver_id"+"}", fmt.Sprintf("%v", radiusserverId), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return nil, err - } - - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - // body params - if localVarTempParam, localVarOk := localVarOptionals["body"].(GraphManagementReq); localVarOk { - localVarPostBody = &localVarTempParam - } - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - return localVarHttpResponse, err -} - -/* GraphApiService List the Users bound to a RADIUS Server - This endpoint will return all Users bound to a RADIUS Server, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this RADIUS server instance to the corresponding User; this array represents all grouping and/or associations that would have to be removed to deprovision the User from this RADIUS server instance. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/ldapservers/{LDAP_ID}/users \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - * @param ctx context.Context for authentication, logging, tracing, etc. - @param radiusserverId ObjectID of the Radius Server. - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "limit" (int32) The number of records to return at once. Limited to 100. - @param "xOrgId" (string) - @param "skip" (int32) The offset into the records to return. - @param "filter" ([]string) Supported operators are: eq, ne, gt, ge, lt, le, between, search, in - @return []GraphObjectWithPaths*/ -func (a *GraphApiService) GraphRadiusServerTraverseUser(ctx context.Context, radiusserverId string, contentType string, accept string, localVarOptionals map[string]interface{}) ([]GraphObjectWithPaths, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload []GraphObjectWithPaths - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/radiusservers/{radiusserver_id}/users" - localVarPath = strings.Replace(localVarPath, "{"+"radiusserver_id"+"}", fmt.Sprintf("%v", radiusserverId), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["limit"], "int32", "limit"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["skip"], "int32", "skip"); err != nil { - return successPayload, nil, err - } - - if localVarTempParam, localVarOk := localVarOptionals["limit"].(int32); localVarOk { - localVarQueryParams.Add("limit", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["skip"].(int32); localVarOk { - localVarQueryParams.Add("skip", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["filter"].([]string); localVarOk { - localVarQueryParams.Add("filter", parameterToString(localVarTempParam, "csv")) - } - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* GraphApiService List the User Groups bound to a RADIUS Server - This endpoint will return all Users Groups bound to a RADIUS Server, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the group's type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this RADIUS server instance to the corresponding User Group; this array represents all grouping and/or associations that would have to be removed to deprovision the User Group from this RADIUS server instance. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/radiusservers/{RADIUS_ID}/usergroups \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - * @param ctx context.Context for authentication, logging, tracing, etc. - @param radiusserverId ObjectID of the Radius Server. - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "limit" (int32) The number of records to return at once. Limited to 100. - @param "xOrgId" (string) - @param "skip" (int32) The offset into the records to return. - @param "filter" ([]string) Supported operators are: eq, ne, gt, ge, lt, le, between, search, in - @return []GraphObjectWithPaths*/ -func (a *GraphApiService) GraphRadiusServerTraverseUserGroup(ctx context.Context, radiusserverId string, contentType string, accept string, localVarOptionals map[string]interface{}) ([]GraphObjectWithPaths, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload []GraphObjectWithPaths - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/radiusservers/{radiusserver_id}/usergroups" - localVarPath = strings.Replace(localVarPath, "{"+"radiusserver_id"+"}", fmt.Sprintf("%v", radiusserverId), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["limit"], "int32", "limit"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["skip"], "int32", "skip"); err != nil { - return successPayload, nil, err - } - - if localVarTempParam, localVarOk := localVarOptionals["limit"].(int32); localVarOk { - localVarQueryParams.Add("limit", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["skip"].(int32); localVarOk { - localVarQueryParams.Add("skip", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["filter"].([]string); localVarOk { - localVarQueryParams.Add("filter", parameterToString(localVarTempParam, "csv")) - } - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* GraphApiService List the associations of a System - This endpoint returns the _direct_ associations of a System. A direct association can be a non-homogeneous relationship between 2 different objects, for example Systems and Users. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/systems/{System_ID}/associations?targets=user \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - * @param ctx context.Context for authentication, logging, tracing, etc. - @param systemId ObjectID of the System. - @param contentType - @param accept - @param targets - @param optional (nil or map[string]interface{}) with one or more of: - @param "limit" (int32) The number of records to return at once. Limited to 100. - @param "skip" (int32) The offset into the records to return. - @param "date" (string) Current date header for the System Context API - @param "authorization" (string) Authorization header for the System Context API - @param "xOrgId" (string) - @return []GraphConnection*/ -func (a *GraphApiService) GraphSystemAssociationsList(ctx context.Context, systemId string, contentType string, accept string, targets []string, localVarOptionals map[string]interface{}) ([]GraphConnection, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload []GraphConnection - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/systems/{system_id}/associations" - localVarPath = strings.Replace(localVarPath, "{"+"system_id"+"}", fmt.Sprintf("%v", systemId), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["limit"], "int32", "limit"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["skip"], "int32", "skip"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["date"], "string", "date"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["authorization"], "string", "authorization"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return successPayload, nil, err - } - - if localVarTempParam, localVarOk := localVarOptionals["limit"].(int32); localVarOk { - localVarQueryParams.Add("limit", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["skip"].(int32); localVarOk { - localVarQueryParams.Add("skip", parameterToString(localVarTempParam, "")) - } - localVarQueryParams.Add("targets", parameterToString(targets, "csv")) - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if localVarTempParam, localVarOk := localVarOptionals["date"].(string); localVarOk { - localVarHeaderParams["Date"] = parameterToString(localVarTempParam, "") - } - if localVarTempParam, localVarOk := localVarOptionals["authorization"].(string); localVarOk { - localVarHeaderParams["Authorization"] = parameterToString(localVarTempParam, "") - } - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* GraphApiService Manage associations of a System - This endpoint allows you to manage the _direct_ associations of a System. A direct association can be a non-homogeneous relationship between 2 different objects, for example Systems and Users. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/systems/{System_ID}/associations \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"attributes\": { \"sudo\": { \"enabled\": true, \"withoutPassword\": false } }, \"op\": \"add\", \"type\": \"user\", \"id\": \"UserID\" }' ``` - * @param ctx context.Context for authentication, logging, tracing, etc. - @param systemId ObjectID of the System. - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "body" (SystemGraphManagementReq) - @param "date" (string) Current date header for the System Context API - @param "authorization" (string) Authorization header for the System Context API - @param "xOrgId" (string) - @return */ -func (a *GraphApiService) GraphSystemAssociationsPost(ctx context.Context, systemId string, contentType string, accept string, localVarOptionals map[string]interface{}) ( *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Post") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/systems/{system_id}/associations" - localVarPath = strings.Replace(localVarPath, "{"+"system_id"+"}", fmt.Sprintf("%v", systemId), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["date"], "string", "date"); err != nil { - return nil, err - } - if err := typeCheckParameter(localVarOptionals["authorization"], "string", "authorization"); err != nil { - return nil, err - } - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return nil, err - } - - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if localVarTempParam, localVarOk := localVarOptionals["date"].(string); localVarOk { - localVarHeaderParams["Date"] = parameterToString(localVarTempParam, "") - } - if localVarTempParam, localVarOk := localVarOptionals["authorization"].(string); localVarOk { - localVarHeaderParams["Authorization"] = parameterToString(localVarTempParam, "") - } - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - // body params - if localVarTempParam, localVarOk := localVarOptionals["body"].(SystemGraphManagementReq); localVarOk { - localVarPostBody = &localVarTempParam - } - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - return localVarHttpResponse, err -} - -/* GraphApiService List the associations of a System Group - This endpoint returns the _direct_ associations of a System Group. A direct association can be a non-homogeneous relationship between 2 different objects, for example System Groups and Users. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/systemgroups/{GroupID}/associations?targets=user \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - * @param ctx context.Context for authentication, logging, tracing, etc. - @param groupId ObjectID of the System Group. - @param contentType - @param accept - @param targets - @param optional (nil or map[string]interface{}) with one or more of: - @param "limit" (int32) The number of records to return at once. Limited to 100. - @param "skip" (int32) The offset into the records to return. - @param "xOrgId" (string) - @return []GraphConnection*/ -func (a *GraphApiService) GraphSystemGroupAssociationsList(ctx context.Context, groupId string, contentType string, accept string, targets []string, localVarOptionals map[string]interface{}) ([]GraphConnection, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload []GraphConnection - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/systemgroups/{group_id}/associations" - localVarPath = strings.Replace(localVarPath, "{"+"group_id"+"}", fmt.Sprintf("%v", groupId), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["limit"], "int32", "limit"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["skip"], "int32", "skip"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return successPayload, nil, err - } - - if localVarTempParam, localVarOk := localVarOptionals["limit"].(int32); localVarOk { - localVarQueryParams.Add("limit", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["skip"].(int32); localVarOk { - localVarQueryParams.Add("skip", parameterToString(localVarTempParam, "")) - } - localVarQueryParams.Add("targets", parameterToString(targets, "csv")) - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* GraphApiService Manage the associations of a System Group - This endpoint allows you to manage the _direct_ associations of a System Group. A direct association can be a non-homogeneous relationship between 2 different objects, for example System Groups and Users. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/systemgroups/{GroupID}/associations \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"op\": \"add\", \"type\": \"user\", \"id\": \"{UserID}\" }' ``` - * @param ctx context.Context for authentication, logging, tracing, etc. - @param groupId ObjectID of the System Group. - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "body" (SystemGroupGraphManagementReq) - @param "xOrgId" (string) - @return */ -func (a *GraphApiService) GraphSystemGroupAssociationsPost(ctx context.Context, groupId string, contentType string, accept string, localVarOptionals map[string]interface{}) ( *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Post") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/systemgroups/{group_id}/associations" - localVarPath = strings.Replace(localVarPath, "{"+"group_id"+"}", fmt.Sprintf("%v", groupId), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return nil, err - } - - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - // body params - if localVarTempParam, localVarOk := localVarOptionals["body"].(SystemGroupGraphManagementReq); localVarOk { - localVarPostBody = &localVarTempParam - } - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - return localVarHttpResponse, err -} - -/* GraphApiService List the System Group's parents - This endpoint returns all System Groups a System Group is a member of. This endpoint is not yet public as we haven't completed the code yet. - * @param ctx context.Context for authentication, logging, tracing, etc. - @param groupId ObjectID of the System Group. - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "filter" ([]string) Supported operators are: eq, ne, gt, ge, lt, le, between, search, in - @param "limit" (int32) The number of records to return at once. Limited to 100. - @param "skip" (int32) The offset into the records to return. - @param "sort" ([]string) The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. - @param "xOrgId" (string) - @return []GraphObjectWithPaths*/ -func (a *GraphApiService) GraphSystemGroupMemberOf(ctx context.Context, groupId string, contentType string, accept string, localVarOptionals map[string]interface{}) ([]GraphObjectWithPaths, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload []GraphObjectWithPaths - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/systemgroups/{group_id}/memberof" - localVarPath = strings.Replace(localVarPath, "{"+"group_id"+"}", fmt.Sprintf("%v", groupId), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["limit"], "int32", "limit"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["skip"], "int32", "skip"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return successPayload, nil, err - } - - if localVarTempParam, localVarOk := localVarOptionals["filter"].([]string); localVarOk { - localVarQueryParams.Add("filter", parameterToString(localVarTempParam, "csv")) - } - if localVarTempParam, localVarOk := localVarOptionals["limit"].(int32); localVarOk { - localVarQueryParams.Add("limit", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["skip"].(int32); localVarOk { - localVarQueryParams.Add("skip", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["sort"].([]string); localVarOk { - localVarQueryParams.Add("sort", parameterToString(localVarTempParam, "csv")) - } - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* GraphApiService List the members of a System Group - This endpoint returns the system members of a System Group. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/systemgroups/{Group_ID}/members \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - * @param ctx context.Context for authentication, logging, tracing, etc. - @param groupId ObjectID of the System Group. - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "limit" (int32) The number of records to return at once. Limited to 100. - @param "skip" (int32) The offset into the records to return. - @param "xOrgId" (string) - @return []GraphConnection*/ -func (a *GraphApiService) GraphSystemGroupMembersList(ctx context.Context, groupId string, contentType string, accept string, localVarOptionals map[string]interface{}) ([]GraphConnection, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload []GraphConnection - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/systemgroups/{group_id}/members" - localVarPath = strings.Replace(localVarPath, "{"+"group_id"+"}", fmt.Sprintf("%v", groupId), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["limit"], "int32", "limit"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["skip"], "int32", "skip"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return successPayload, nil, err - } - - if localVarTempParam, localVarOk := localVarOptionals["limit"].(int32); localVarOk { - localVarQueryParams.Add("limit", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["skip"].(int32); localVarOk { - localVarQueryParams.Add("skip", parameterToString(localVarTempParam, "")) - } - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* GraphApiService Manage the members of a System Group - This endpoint allows you to manage the system members of a System Group. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/systemgroups/{Group_ID}/members \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"op\": \"add\", \"type\": \"system\", \"id\": \"{System_ID}\" }' ``` - * @param ctx context.Context for authentication, logging, tracing, etc. - @param groupId ObjectID of the System Group. - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "body" (SystemGroupMembersReq) - @param "date" (string) Current date header for the System Context API - @param "authorization" (string) Authorization header for the System Context API - @param "xOrgId" (string) - @return */ -func (a *GraphApiService) GraphSystemGroupMembersPost(ctx context.Context, groupId string, contentType string, accept string, localVarOptionals map[string]interface{}) ( *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Post") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/systemgroups/{group_id}/members" - localVarPath = strings.Replace(localVarPath, "{"+"group_id"+"}", fmt.Sprintf("%v", groupId), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["date"], "string", "date"); err != nil { - return nil, err - } - if err := typeCheckParameter(localVarOptionals["authorization"], "string", "authorization"); err != nil { - return nil, err - } - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return nil, err - } - - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if localVarTempParam, localVarOk := localVarOptionals["date"].(string); localVarOk { - localVarHeaderParams["Date"] = parameterToString(localVarTempParam, "") - } - if localVarTempParam, localVarOk := localVarOptionals["authorization"].(string); localVarOk { - localVarHeaderParams["Authorization"] = parameterToString(localVarTempParam, "") - } - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - // body params - if localVarTempParam, localVarOk := localVarOptionals["body"].(SystemGroupMembersReq); localVarOk { - localVarPostBody = &localVarTempParam - } - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - return localVarHttpResponse, err -} - -/* GraphApiService List the System Group's membership - This endpoint returns all Systems that are a member of this System Group. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/systemgroups/{Group_ID/membership \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - * @param ctx context.Context for authentication, logging, tracing, etc. - @param groupId ObjectID of the System Group. - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "limit" (int32) The number of records to return at once. Limited to 100. - @param "skip" (int32) The offset into the records to return. - @param "sort" ([]string) The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. - @param "filter" ([]string) Supported operators are: eq, ne, gt, ge, lt, le, between, search, in - @param "xOrgId" (string) - @return []GraphObjectWithPaths*/ -func (a *GraphApiService) GraphSystemGroupMembership(ctx context.Context, groupId string, contentType string, accept string, localVarOptionals map[string]interface{}) ([]GraphObjectWithPaths, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload []GraphObjectWithPaths - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/systemgroups/{group_id}/membership" - localVarPath = strings.Replace(localVarPath, "{"+"group_id"+"}", fmt.Sprintf("%v", groupId), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["limit"], "int32", "limit"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["skip"], "int32", "skip"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return successPayload, nil, err - } - - if localVarTempParam, localVarOk := localVarOptionals["limit"].(int32); localVarOk { - localVarQueryParams.Add("limit", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["skip"].(int32); localVarOk { - localVarQueryParams.Add("skip", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["sort"].([]string); localVarOk { - localVarQueryParams.Add("sort", parameterToString(localVarTempParam, "csv")) - } - if localVarTempParam, localVarOk := localVarOptionals["filter"].([]string); localVarOk { - localVarQueryParams.Add("filter", parameterToString(localVarTempParam, "csv")) - } - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* GraphApiService List the Commands bound to a System Group - This endpoint will return all Commands bound to a System Group, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the group's type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this System Group to the corresponding Command; this array represents all grouping and/or associations that would have to be removed to deprovision the Command from this System Group. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/systemgroups/{GroupID}/commands \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - * @param ctx context.Context for authentication, logging, tracing, etc. - @param groupId ObjectID of the System Group. - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "limit" (int32) The number of records to return at once. Limited to 100. - @param "xOrgId" (string) - @param "skip" (int32) The offset into the records to return. - @param "filter" ([]string) Supported operators are: eq, ne, gt, ge, lt, le, between, search, in - @return []GraphObjectWithPaths*/ -func (a *GraphApiService) GraphSystemGroupTraverseCommand(ctx context.Context, groupId string, contentType string, accept string, localVarOptionals map[string]interface{}) ([]GraphObjectWithPaths, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload []GraphObjectWithPaths - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/systemgroups/{group_id}/commands" - localVarPath = strings.Replace(localVarPath, "{"+"group_id"+"}", fmt.Sprintf("%v", groupId), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["limit"], "int32", "limit"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["skip"], "int32", "skip"); err != nil { - return successPayload, nil, err - } - - if localVarTempParam, localVarOk := localVarOptionals["limit"].(int32); localVarOk { - localVarQueryParams.Add("limit", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["skip"].(int32); localVarOk { - localVarQueryParams.Add("skip", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["filter"].([]string); localVarOk { - localVarQueryParams.Add("filter", parameterToString(localVarTempParam, "csv")) - } - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* GraphApiService List the Policies bound to a System Group - This endpoint will return all Policies bound to a System Group, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this System Group to the corresponding Policy; this array represents all grouping and/or associations that would have to be removed to deprovision the Policy from this System Group. See `/members` and `/associations` endpoints to manage those collections. This endpoint is not public yet as we haven't finished the code. ##### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/systemgroups/{GroupID}/policies \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - * @param ctx context.Context for authentication, logging, tracing, etc. - @param groupId ObjectID of the System Group. - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "limit" (int32) The number of records to return at once. Limited to 100. - @param "xOrgId" (string) - @param "skip" (int32) The offset into the records to return. - @param "filter" ([]string) Supported operators are: eq, ne, gt, ge, lt, le, between, search, in - @return []GraphObjectWithPaths*/ -func (a *GraphApiService) GraphSystemGroupTraversePolicy(ctx context.Context, groupId string, contentType string, accept string, localVarOptionals map[string]interface{}) ([]GraphObjectWithPaths, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload []GraphObjectWithPaths - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/systemgroups/{group_id}/policies" - localVarPath = strings.Replace(localVarPath, "{"+"group_id"+"}", fmt.Sprintf("%v", groupId), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["limit"], "int32", "limit"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["skip"], "int32", "skip"); err != nil { - return successPayload, nil, err - } - - if localVarTempParam, localVarOk := localVarOptionals["limit"].(int32); localVarOk { - localVarQueryParams.Add("limit", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["skip"].(int32); localVarOk { - localVarQueryParams.Add("skip", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["filter"].([]string); localVarOk { - localVarQueryParams.Add("filter", parameterToString(localVarTempParam, "csv")) - } - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* GraphApiService List the Users bound to a System Group - This endpoint will return all Users bound to a System Group, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this System Group to the corresponding User; this array represents all grouping and/or associations that would have to be removed to deprovision the User from this System Group. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/systemgroups/{GroupID}/users \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - * @param ctx context.Context for authentication, logging, tracing, etc. - @param groupId ObjectID of the System Group. - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "limit" (int32) The number of records to return at once. Limited to 100. - @param "xOrgId" (string) - @param "skip" (int32) The offset into the records to return. - @param "filter" ([]string) Supported operators are: eq, ne, gt, ge, lt, le, between, search, in - @return []GraphObjectWithPaths*/ -func (a *GraphApiService) GraphSystemGroupTraverseUser(ctx context.Context, groupId string, contentType string, accept string, localVarOptionals map[string]interface{}) ([]GraphObjectWithPaths, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload []GraphObjectWithPaths - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/systemgroups/{group_id}/users" - localVarPath = strings.Replace(localVarPath, "{"+"group_id"+"}", fmt.Sprintf("%v", groupId), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["limit"], "int32", "limit"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["skip"], "int32", "skip"); err != nil { - return successPayload, nil, err - } - - if localVarTempParam, localVarOk := localVarOptionals["limit"].(int32); localVarOk { - localVarQueryParams.Add("limit", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["skip"].(int32); localVarOk { - localVarQueryParams.Add("skip", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["filter"].([]string); localVarOk { - localVarQueryParams.Add("filter", parameterToString(localVarTempParam, "csv")) - } - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* GraphApiService List the User Groups bound to a System Group - This endpoint will return all User Groups bound to a System Group, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this System Group to the corresponding User Group; this array represents all grouping and/or associations that would have to be removed to deprovision the User Group from this System Group. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/systemgroups/{GroupID}/usergroups \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - * @param ctx context.Context for authentication, logging, tracing, etc. - @param groupId ObjectID of the System Group. - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "limit" (int32) The number of records to return at once. Limited to 100. - @param "xOrgId" (string) - @param "skip" (int32) The offset into the records to return. - @param "filter" ([]string) Supported operators are: eq, ne, gt, ge, lt, le, between, search, in - @return []GraphObjectWithPaths*/ -func (a *GraphApiService) GraphSystemGroupTraverseUserGroup(ctx context.Context, groupId string, contentType string, accept string, localVarOptionals map[string]interface{}) ([]GraphObjectWithPaths, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload []GraphObjectWithPaths - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/systemgroups/{group_id}/usergroups" - localVarPath = strings.Replace(localVarPath, "{"+"group_id"+"}", fmt.Sprintf("%v", groupId), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["limit"], "int32", "limit"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["skip"], "int32", "skip"); err != nil { - return successPayload, nil, err - } - - if localVarTempParam, localVarOk := localVarOptionals["limit"].(int32); localVarOk { - localVarQueryParams.Add("limit", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["skip"].(int32); localVarOk { - localVarQueryParams.Add("skip", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["filter"].([]string); localVarOk { - localVarQueryParams.Add("filter", parameterToString(localVarTempParam, "csv")) - } - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* GraphApiService List the parent Groups of a System - This endpoint returns all the System Groups a System is a member of. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/systems/{System_ID}/memberof \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - * @param ctx context.Context for authentication, logging, tracing, etc. - @param systemId ObjectID of the System. - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "filter" ([]string) Supported operators are: eq, ne, gt, ge, lt, le, between, search, in - @param "limit" (int32) The number of records to return at once. Limited to 100. - @param "skip" (int32) The offset into the records to return. - @param "date" (string) Current date header for the System Context API - @param "authorization" (string) Authorization header for the System Context API - @param "sort" ([]string) The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. - @param "xOrgId" (string) - @return []GraphObjectWithPaths*/ -func (a *GraphApiService) GraphSystemMemberOf(ctx context.Context, systemId string, contentType string, accept string, localVarOptionals map[string]interface{}) ([]GraphObjectWithPaths, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload []GraphObjectWithPaths - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/systems/{system_id}/memberof" - localVarPath = strings.Replace(localVarPath, "{"+"system_id"+"}", fmt.Sprintf("%v", systemId), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["limit"], "int32", "limit"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["skip"], "int32", "skip"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["date"], "string", "date"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["authorization"], "string", "authorization"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return successPayload, nil, err - } - - if localVarTempParam, localVarOk := localVarOptionals["filter"].([]string); localVarOk { - localVarQueryParams.Add("filter", parameterToString(localVarTempParam, "csv")) - } - if localVarTempParam, localVarOk := localVarOptionals["limit"].(int32); localVarOk { - localVarQueryParams.Add("limit", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["skip"].(int32); localVarOk { - localVarQueryParams.Add("skip", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["sort"].([]string); localVarOk { - localVarQueryParams.Add("sort", parameterToString(localVarTempParam, "csv")) - } - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if localVarTempParam, localVarOk := localVarOptionals["date"].(string); localVarOk { - localVarHeaderParams["Date"] = parameterToString(localVarTempParam, "") - } - if localVarTempParam, localVarOk := localVarOptionals["authorization"].(string); localVarOk { - localVarHeaderParams["Authorization"] = parameterToString(localVarTempParam, "") - } - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* GraphApiService List the Commands bound to a System - This endpoint will return all Commands bound to a System, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this System to the corresponding Command; this array represents all grouping and/or associations that would have to be removed to deprovision the Command from this System. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/systems/{System_ID}/commands \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - * @param ctx context.Context for authentication, logging, tracing, etc. - @param systemId ObjectID of the System. - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "limit" (int32) The number of records to return at once. Limited to 100. - @param "xOrgId" (string) - @param "skip" (int32) The offset into the records to return. - @param "filter" ([]string) Supported operators are: eq, ne, gt, ge, lt, le, between, search, in - @return []GraphObjectWithPaths*/ -func (a *GraphApiService) GraphSystemTraverseCommand(ctx context.Context, systemId string, contentType string, accept string, localVarOptionals map[string]interface{}) ([]GraphObjectWithPaths, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload []GraphObjectWithPaths - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/systems/{system_id}/commands" - localVarPath = strings.Replace(localVarPath, "{"+"system_id"+"}", fmt.Sprintf("%v", systemId), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["limit"], "int32", "limit"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["skip"], "int32", "skip"); err != nil { - return successPayload, nil, err - } - - if localVarTempParam, localVarOk := localVarOptionals["limit"].(int32); localVarOk { - localVarQueryParams.Add("limit", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["skip"].(int32); localVarOk { - localVarQueryParams.Add("skip", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["filter"].([]string); localVarOk { - localVarQueryParams.Add("filter", parameterToString(localVarTempParam, "csv")) - } - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* GraphApiService List the Policies bound to a System - This endpoint will return all Policies bound to a System, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this System to the corresponding Policy; this array represents all grouping and/or associations that would have to be removed to deprovision the Policy from this System. See `/members` and `/associations` endpoints to manage those collections. This endpoint is not yet public as we have finish the code. ##### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/{System_ID}/policies \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - * @param ctx context.Context for authentication, logging, tracing, etc. - @param systemId ObjectID of the System. - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "limit" (int32) The number of records to return at once. Limited to 100. - @param "xOrgId" (string) - @param "skip" (int32) The offset into the records to return. - @param "filter" ([]string) Supported operators are: eq, ne, gt, ge, lt, le, between, search, in - @return []GraphObjectWithPaths*/ -func (a *GraphApiService) GraphSystemTraversePolicy(ctx context.Context, systemId string, contentType string, accept string, localVarOptionals map[string]interface{}) ([]GraphObjectWithPaths, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload []GraphObjectWithPaths - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/systems/{system_id}/policies" - localVarPath = strings.Replace(localVarPath, "{"+"system_id"+"}", fmt.Sprintf("%v", systemId), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["limit"], "int32", "limit"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["skip"], "int32", "skip"); err != nil { - return successPayload, nil, err - } - - if localVarTempParam, localVarOk := localVarOptionals["limit"].(int32); localVarOk { - localVarQueryParams.Add("limit", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["skip"].(int32); localVarOk { - localVarQueryParams.Add("skip", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["filter"].([]string); localVarOk { - localVarQueryParams.Add("filter", parameterToString(localVarTempParam, "csv")) - } - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* GraphApiService List the Users bound to a System - This endpoint will return all Users bound to a System, either directly or indirectly essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this System to the corresponding User; this array represents all grouping and/or associations that would have to be removed to deprovision the User from this System. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/systems/{System_ID}/users \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - * @param ctx context.Context for authentication, logging, tracing, etc. - @param systemId ObjectID of the System. - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "limit" (int32) The number of records to return at once. Limited to 100. - @param "xOrgId" (string) - @param "skip" (int32) The offset into the records to return. - @param "date" (string) Current date header for the System Context API - @param "authorization" (string) Authorization header for the System Context API - @param "filter" ([]string) Supported operators are: eq, ne, gt, ge, lt, le, between, search, in - @return []GraphObjectWithPaths*/ -func (a *GraphApiService) GraphSystemTraverseUser(ctx context.Context, systemId string, contentType string, accept string, localVarOptionals map[string]interface{}) ([]GraphObjectWithPaths, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload []GraphObjectWithPaths - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/systems/{system_id}/users" - localVarPath = strings.Replace(localVarPath, "{"+"system_id"+"}", fmt.Sprintf("%v", systemId), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["limit"], "int32", "limit"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["skip"], "int32", "skip"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["date"], "string", "date"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["authorization"], "string", "authorization"); err != nil { - return successPayload, nil, err - } - - if localVarTempParam, localVarOk := localVarOptionals["limit"].(int32); localVarOk { - localVarQueryParams.Add("limit", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["skip"].(int32); localVarOk { - localVarQueryParams.Add("skip", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["filter"].([]string); localVarOk { - localVarQueryParams.Add("filter", parameterToString(localVarTempParam, "csv")) - } - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if localVarTempParam, localVarOk := localVarOptionals["date"].(string); localVarOk { - localVarHeaderParams["Date"] = parameterToString(localVarTempParam, "") - } - if localVarTempParam, localVarOk := localVarOptionals["authorization"].(string); localVarOk { - localVarHeaderParams["Authorization"] = parameterToString(localVarTempParam, "") - } - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* GraphApiService List the User Groups bound to a System - This endpoint will return all User Groups bound to a System, either directly or indirectly essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this System to the corresponding User Group; this array represents all grouping and/or associations that would have to be removed to deprovision the User Group from this System. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/systems/{System_ID}/usergroups \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - * @param ctx context.Context for authentication, logging, tracing, etc. - @param systemId ObjectID of the System. - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "limit" (int32) The number of records to return at once. Limited to 100. - @param "xOrgId" (string) - @param "skip" (int32) The offset into the records to return. - @param "date" (string) Current date header for the System Context API - @param "authorization" (string) Authorization header for the System Context API - @param "filter" ([]string) Supported operators are: eq, ne, gt, ge, lt, le, between, search, in - @return []GraphObjectWithPaths*/ -func (a *GraphApiService) GraphSystemTraverseUserGroup(ctx context.Context, systemId string, contentType string, accept string, localVarOptionals map[string]interface{}) ([]GraphObjectWithPaths, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload []GraphObjectWithPaths - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/systems/{system_id}/usergroups" - localVarPath = strings.Replace(localVarPath, "{"+"system_id"+"}", fmt.Sprintf("%v", systemId), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["limit"], "int32", "limit"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["skip"], "int32", "skip"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["date"], "string", "date"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["authorization"], "string", "authorization"); err != nil { - return successPayload, nil, err - } - - if localVarTempParam, localVarOk := localVarOptionals["limit"].(int32); localVarOk { - localVarQueryParams.Add("limit", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["skip"].(int32); localVarOk { - localVarQueryParams.Add("skip", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["filter"].([]string); localVarOk { - localVarQueryParams.Add("filter", parameterToString(localVarTempParam, "csv")) - } - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if localVarTempParam, localVarOk := localVarOptionals["date"].(string); localVarOk { - localVarHeaderParams["Date"] = parameterToString(localVarTempParam, "") - } - if localVarTempParam, localVarOk := localVarOptionals["authorization"].(string); localVarOk { - localVarHeaderParams["Authorization"] = parameterToString(localVarTempParam, "") - } - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* GraphApiService List the associations of a User - This endpoint returns the _direct_ associations of a User. A direct association can be a non-homogeneous relationship between 2 different objects, for example Users and Systems. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/users/{UserID}/associations?targets=system_group \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - * @param ctx context.Context for authentication, logging, tracing, etc. - @param userId ObjectID of the User. - @param contentType - @param accept - @param targets - @param optional (nil or map[string]interface{}) with one or more of: - @param "limit" (int32) The number of records to return at once. Limited to 100. - @param "skip" (int32) The offset into the records to return. - @param "xOrgId" (string) - @return []GraphConnection*/ -func (a *GraphApiService) GraphUserAssociationsList(ctx context.Context, userId string, contentType string, accept string, targets []string, localVarOptionals map[string]interface{}) ([]GraphConnection, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload []GraphConnection - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/users/{user_id}/associations" - localVarPath = strings.Replace(localVarPath, "{"+"user_id"+"}", fmt.Sprintf("%v", userId), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["limit"], "int32", "limit"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["skip"], "int32", "skip"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return successPayload, nil, err - } - - if localVarTempParam, localVarOk := localVarOptionals["limit"].(int32); localVarOk { - localVarQueryParams.Add("limit", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["skip"].(int32); localVarOk { - localVarQueryParams.Add("skip", parameterToString(localVarTempParam, "")) - } - localVarQueryParams.Add("targets", parameterToString(targets, "csv")) - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* GraphApiService Manage the associations of a User - This endpoint allows you to manage the _direct_ associations of a User. A direct association can be a non-homogeneous relationship between 2 different objects, for example Users and Systems. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/users/{UserID}/associations \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"attributes\": { \"sudo\": { \"enabled\": true, \"withoutPassword\": false } }, \"op\": \"add\", \"type\": \"system_group\", \"id\": \"{GroupID}\" }' - * @param ctx context.Context for authentication, logging, tracing, etc. - @param userId ObjectID of the User. - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "body" (UserGraphManagementReq) - @param "xOrgId" (string) - @return */ -func (a *GraphApiService) GraphUserAssociationsPost(ctx context.Context, userId string, contentType string, accept string, localVarOptionals map[string]interface{}) ( *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Post") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/users/{user_id}/associations" - localVarPath = strings.Replace(localVarPath, "{"+"user_id"+"}", fmt.Sprintf("%v", userId), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return nil, err - } - - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - // body params - if localVarTempParam, localVarOk := localVarOptionals["body"].(UserGraphManagementReq); localVarOk { - localVarPostBody = &localVarTempParam - } - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - return localVarHttpResponse, err -} - -/* GraphApiService List the associations of a User Group. - This endpoint returns the _direct_ associations of this User Group. A direct association can be a non-homogeneous relationship between 2 different objects, for example User Groups and Users. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/usergroups/{GroupID}/associations?targets=system \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - * @param ctx context.Context for authentication, logging, tracing, etc. - @param groupId ObjectID of the User Group. - @param contentType - @param accept - @param targets - @param optional (nil or map[string]interface{}) with one or more of: - @param "limit" (int32) The number of records to return at once. Limited to 100. - @param "skip" (int32) The offset into the records to return. - @param "xOrgId" (string) - @return []GraphConnection*/ -func (a *GraphApiService) GraphUserGroupAssociationsList(ctx context.Context, groupId string, contentType string, accept string, targets []string, localVarOptionals map[string]interface{}) ([]GraphConnection, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload []GraphConnection - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/usergroups/{group_id}/associations" - localVarPath = strings.Replace(localVarPath, "{"+"group_id"+"}", fmt.Sprintf("%v", groupId), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["limit"], "int32", "limit"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["skip"], "int32", "skip"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return successPayload, nil, err - } - - if localVarTempParam, localVarOk := localVarOptionals["limit"].(int32); localVarOk { - localVarQueryParams.Add("limit", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["skip"].(int32); localVarOk { - localVarQueryParams.Add("skip", parameterToString(localVarTempParam, "")) - } - localVarQueryParams.Add("targets", parameterToString(targets, "csv")) - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* GraphApiService Manage the associations of a User Group - This endpoint manages the _direct_ associations of this User Group. A direct association can be a non-homogeneous relationship between 2 different objects, for example User Groups and Users. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/usergroups/{GroupID}/associations \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"op\": \"add\", \"type\": \"system\", \"id\": \"{SystemID}\" }' ``` - * @param ctx context.Context for authentication, logging, tracing, etc. - @param groupId ObjectID of the User Group. - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "body" (UserGroupGraphManagementReq) - @param "xOrgId" (string) - @return */ -func (a *GraphApiService) GraphUserGroupAssociationsPost(ctx context.Context, groupId string, contentType string, accept string, localVarOptionals map[string]interface{}) ( *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Post") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/usergroups/{group_id}/associations" - localVarPath = strings.Replace(localVarPath, "{"+"group_id"+"}", fmt.Sprintf("%v", groupId), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return nil, err - } - - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - // body params - if localVarTempParam, localVarOk := localVarOptionals["body"].(UserGroupGraphManagementReq); localVarOk { - localVarPostBody = &localVarTempParam - } - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - return localVarHttpResponse, err -} - -/* GraphApiService List the User Group's parents - This endpoint returns all User Groups a User Group is a member of. #### Sample Request ``` https://console.jumpcloud.com/api/v2/usergroups/{group_id}/memberof ``` Not public yet, as the code is not finished, - * @param ctx context.Context for authentication, logging, tracing, etc. - @param groupId ObjectID of the User Group. - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "filter" ([]string) Supported operators are: eq, ne, gt, ge, lt, le, between, search, in - @param "limit" (int32) The number of records to return at once. Limited to 100. - @param "skip" (int32) The offset into the records to return. - @param "sort" ([]string) The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. - @param "xOrgId" (string) - @return []GraphObjectWithPaths*/ -func (a *GraphApiService) GraphUserGroupMemberOf(ctx context.Context, groupId string, contentType string, accept string, localVarOptionals map[string]interface{}) ([]GraphObjectWithPaths, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload []GraphObjectWithPaths - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/usergroups/{group_id}/memberof" - localVarPath = strings.Replace(localVarPath, "{"+"group_id"+"}", fmt.Sprintf("%v", groupId), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["limit"], "int32", "limit"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["skip"], "int32", "skip"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return successPayload, nil, err - } - - if localVarTempParam, localVarOk := localVarOptionals["filter"].([]string); localVarOk { - localVarQueryParams.Add("filter", parameterToString(localVarTempParam, "csv")) - } - if localVarTempParam, localVarOk := localVarOptionals["limit"].(int32); localVarOk { - localVarQueryParams.Add("limit", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["skip"].(int32); localVarOk { - localVarQueryParams.Add("skip", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["sort"].([]string); localVarOk { - localVarQueryParams.Add("sort", parameterToString(localVarTempParam, "csv")) - } - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* GraphApiService List the members of a User Group - This endpoint returns the user members of a User Group. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/usergroups/{GroupID}/members \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - * @param ctx context.Context for authentication, logging, tracing, etc. - @param groupId ObjectID of the User Group. - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "limit" (int32) The number of records to return at once. Limited to 100. - @param "skip" (int32) The offset into the records to return. - @param "xOrgId" (string) - @return []GraphConnection*/ -func (a *GraphApiService) GraphUserGroupMembersList(ctx context.Context, groupId string, contentType string, accept string, localVarOptionals map[string]interface{}) ([]GraphConnection, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload []GraphConnection - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/usergroups/{group_id}/members" - localVarPath = strings.Replace(localVarPath, "{"+"group_id"+"}", fmt.Sprintf("%v", groupId), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["limit"], "int32", "limit"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["skip"], "int32", "skip"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return successPayload, nil, err - } - - if localVarTempParam, localVarOk := localVarOptionals["limit"].(int32); localVarOk { - localVarQueryParams.Add("limit", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["skip"].(int32); localVarOk { - localVarQueryParams.Add("skip", parameterToString(localVarTempParam, "")) - } - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* GraphApiService Manage the members of a User Group - This endpoint allows you to manage the user members of a User Group. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/usergroups/{GroupID}/members \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"op\": \"add\", \"type\": \"user\", \"id\": \"{User_ID}\" }' ``` - * @param ctx context.Context for authentication, logging, tracing, etc. - @param groupId ObjectID of the User Group. - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "body" (UserGroupMembersReq) - @param "xOrgId" (string) - @return */ -func (a *GraphApiService) GraphUserGroupMembersPost(ctx context.Context, groupId string, contentType string, accept string, localVarOptionals map[string]interface{}) ( *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Post") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/usergroups/{group_id}/members" - localVarPath = strings.Replace(localVarPath, "{"+"group_id"+"}", fmt.Sprintf("%v", groupId), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return nil, err - } - - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - // body params - if localVarTempParam, localVarOk := localVarOptionals["body"].(UserGroupMembersReq); localVarOk { - localVarPostBody = &localVarTempParam - } - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - return localVarHttpResponse, err -} - -/* GraphApiService List the User Group's membership - This endpoint returns all users members that are a member of this User Group. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/usergroups/{GroupID}/membership \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - * @param ctx context.Context for authentication, logging, tracing, etc. - @param groupId ObjectID of the User Group. - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "filter" ([]string) Supported operators are: eq, ne, gt, ge, lt, le, between, search, in - @param "limit" (int32) The number of records to return at once. Limited to 100. - @param "skip" (int32) The offset into the records to return. - @param "sort" ([]string) The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. - @param "xOrgId" (string) - @return []GraphObjectWithPaths*/ -func (a *GraphApiService) GraphUserGroupMembership(ctx context.Context, groupId string, contentType string, accept string, localVarOptionals map[string]interface{}) ([]GraphObjectWithPaths, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload []GraphObjectWithPaths - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/usergroups/{group_id}/membership" - localVarPath = strings.Replace(localVarPath, "{"+"group_id"+"}", fmt.Sprintf("%v", groupId), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["limit"], "int32", "limit"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["skip"], "int32", "skip"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return successPayload, nil, err - } - - if localVarTempParam, localVarOk := localVarOptionals["filter"].([]string); localVarOk { - localVarQueryParams.Add("filter", parameterToString(localVarTempParam, "csv")) - } - if localVarTempParam, localVarOk := localVarOptionals["limit"].(int32); localVarOk { - localVarQueryParams.Add("limit", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["skip"].(int32); localVarOk { - localVarQueryParams.Add("skip", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["sort"].([]string); localVarOk { - localVarQueryParams.Add("sort", parameterToString(localVarTempParam, "csv")) - } - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* GraphApiService List the Active Directories bound to a User Group - This endpoint will return all Active Directory Instances bound to a User Group, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this User Group to the corresponding Active Directory; this array represents all grouping and/or associations that would have to be removed to deprovision the Active Directory from this User Group. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/usergroups/{GroupID}/activedirectories \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - * @param ctx context.Context for authentication, logging, tracing, etc. - @param groupId ObjectID of the User Group. - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "limit" (int32) The number of records to return at once. Limited to 100. - @param "xOrgId" (string) - @param "skip" (int32) The offset into the records to return. - @param "filter" ([]string) Supported operators are: eq, ne, gt, ge, lt, le, between, search, in - @return []GraphObjectWithPaths*/ -func (a *GraphApiService) GraphUserGroupTraverseActiveDirectory(ctx context.Context, groupId string, contentType string, accept string, localVarOptionals map[string]interface{}) ([]GraphObjectWithPaths, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload []GraphObjectWithPaths - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/usergroups/{group_id}/activedirectories" - localVarPath = strings.Replace(localVarPath, "{"+"group_id"+"}", fmt.Sprintf("%v", groupId), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["limit"], "int32", "limit"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["skip"], "int32", "skip"); err != nil { - return successPayload, nil, err - } - - if localVarTempParam, localVarOk := localVarOptionals["limit"].(int32); localVarOk { - localVarQueryParams.Add("limit", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["skip"].(int32); localVarOk { - localVarQueryParams.Add("skip", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["filter"].([]string); localVarOk { - localVarQueryParams.Add("filter", parameterToString(localVarTempParam, "csv")) - } - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* GraphApiService List the Applications bound to a User Group - This endpoint will return all Applications bound to a User Group, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this User Group to the corresponding Application; this array represents all grouping and/or associations that would have to be removed to deprovision the Application from this User Group. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/usergroups/{GroupID}/applications \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - * @param ctx context.Context for authentication, logging, tracing, etc. - @param groupId ObjectID of the User Group. - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "limit" (int32) The number of records to return at once. Limited to 100. - @param "xOrgId" (string) - @param "skip" (int32) The offset into the records to return. - @param "filter" ([]string) Supported operators are: eq, ne, gt, ge, lt, le, between, search, in - @return []GraphObjectWithPaths*/ -func (a *GraphApiService) GraphUserGroupTraverseApplication(ctx context.Context, groupId string, contentType string, accept string, localVarOptionals map[string]interface{}) ([]GraphObjectWithPaths, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload []GraphObjectWithPaths - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/usergroups/{group_id}/applications" - localVarPath = strings.Replace(localVarPath, "{"+"group_id"+"}", fmt.Sprintf("%v", groupId), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["limit"], "int32", "limit"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["skip"], "int32", "skip"); err != nil { - return successPayload, nil, err - } - - if localVarTempParam, localVarOk := localVarOptionals["limit"].(int32); localVarOk { - localVarQueryParams.Add("limit", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["skip"].(int32); localVarOk { - localVarQueryParams.Add("skip", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["filter"].([]string); localVarOk { - localVarQueryParams.Add("filter", parameterToString(localVarTempParam, "csv")) - } - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* GraphApiService List the Directories bound to a User Group - This endpoint will return all Directories bound to a User Group, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this User Group to the corresponding Directory; this array represents all grouping and/or associations that would have to be removed to deprovision the Directories from this User Group. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/usergroups/{GroupID}/directories \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - * @param ctx context.Context for authentication, logging, tracing, etc. - @param groupId ObjectID of the User Group. - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "limit" (int32) The number of records to return at once. Limited to 100. - @param "xOrgId" (string) - @param "skip" (int32) The offset into the records to return. - @param "filter" ([]string) Supported operators are: eq, ne, gt, ge, lt, le, between, search, in - @return []GraphObjectWithPaths*/ -func (a *GraphApiService) GraphUserGroupTraverseDirectory(ctx context.Context, groupId string, contentType string, accept string, localVarOptionals map[string]interface{}) ([]GraphObjectWithPaths, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload []GraphObjectWithPaths - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/usergroups/{group_id}/directories" - localVarPath = strings.Replace(localVarPath, "{"+"group_id"+"}", fmt.Sprintf("%v", groupId), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["limit"], "int32", "limit"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["skip"], "int32", "skip"); err != nil { - return successPayload, nil, err - } - - if localVarTempParam, localVarOk := localVarOptionals["limit"].(int32); localVarOk { - localVarQueryParams.Add("limit", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["skip"].(int32); localVarOk { - localVarQueryParams.Add("skip", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["filter"].([]string); localVarOk { - localVarQueryParams.Add("filter", parameterToString(localVarTempParam, "csv")) - } - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* GraphApiService List the G Suite instances bound to a User Group - This endpoint will return all G Suite Instances bound to a User Group, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this User Group to the corresponding G Suite instance; this array represents all grouping and/or associations that would have to be removed to deprovision the G Suite instance from this User Group. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/usergroups/{GroupID/gsuites \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - * @param ctx context.Context for authentication, logging, tracing, etc. - @param groupId ObjectID of the User Group. - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "limit" (int32) The number of records to return at once. Limited to 100. - @param "xOrgId" (string) - @param "skip" (int32) The offset into the records to return. - @param "filter" ([]string) Supported operators are: eq, ne, gt, ge, lt, le, between, search, in - @return []GraphObjectWithPaths*/ -func (a *GraphApiService) GraphUserGroupTraverseGSuite(ctx context.Context, groupId string, contentType string, accept string, localVarOptionals map[string]interface{}) ([]GraphObjectWithPaths, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload []GraphObjectWithPaths - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/usergroups/{group_id}/gsuites" - localVarPath = strings.Replace(localVarPath, "{"+"group_id"+"}", fmt.Sprintf("%v", groupId), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["limit"], "int32", "limit"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["skip"], "int32", "skip"); err != nil { - return successPayload, nil, err - } - - if localVarTempParam, localVarOk := localVarOptionals["limit"].(int32); localVarOk { - localVarQueryParams.Add("limit", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["skip"].(int32); localVarOk { - localVarQueryParams.Add("skip", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["filter"].([]string); localVarOk { - localVarQueryParams.Add("filter", parameterToString(localVarTempParam, "csv")) - } - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* GraphApiService List the LDAP Servers bound to a User Group - This endpoint will return all LDAP Servers bound to a User Group, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this User Group to the corresponding LDAP Server; this array represents all grouping and/or associations that would have to be removed to deprovision the LDAP Server from this User Group. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/usergroups/{GroupID}/ldapservers \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - * @param ctx context.Context for authentication, logging, tracing, etc. - @param groupId ObjectID of the User Group. - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "limit" (int32) The number of records to return at once. Limited to 100. - @param "xOrgId" (string) - @param "skip" (int32) The offset into the records to return. - @param "filter" ([]string) Supported operators are: eq, ne, gt, ge, lt, le, between, search, in - @return []GraphObjectWithPaths*/ -func (a *GraphApiService) GraphUserGroupTraverseLdapServer(ctx context.Context, groupId string, contentType string, accept string, localVarOptionals map[string]interface{}) ([]GraphObjectWithPaths, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload []GraphObjectWithPaths - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/usergroups/{group_id}/ldapservers" - localVarPath = strings.Replace(localVarPath, "{"+"group_id"+"}", fmt.Sprintf("%v", groupId), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["limit"], "int32", "limit"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["skip"], "int32", "skip"); err != nil { - return successPayload, nil, err - } - - if localVarTempParam, localVarOk := localVarOptionals["limit"].(int32); localVarOk { - localVarQueryParams.Add("limit", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["skip"].(int32); localVarOk { - localVarQueryParams.Add("skip", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["filter"].([]string); localVarOk { - localVarQueryParams.Add("filter", parameterToString(localVarTempParam, "csv")) - } - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* GraphApiService List the Office 365 instances bound to a User Group - This endpoint will return all Office 365 instances bound to a User Group, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this User Group to the corresponding Office 365 instance; this array represents all grouping and/or associations that would have to be removed to deprovision the Office 365 instance from this User Group. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/usergroups/{GroupID}/office365s \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - * @param ctx context.Context for authentication, logging, tracing, etc. - @param groupId ObjectID of the User Group. - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "limit" (int32) The number of records to return at once. Limited to 100. - @param "xOrgId" (string) - @param "skip" (int32) The offset into the records to return. - @param "filter" ([]string) Supported operators are: eq, ne, gt, ge, lt, le, between, search, in - @return []GraphObjectWithPaths*/ -func (a *GraphApiService) GraphUserGroupTraverseOffice365(ctx context.Context, groupId string, contentType string, accept string, localVarOptionals map[string]interface{}) ([]GraphObjectWithPaths, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload []GraphObjectWithPaths - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/usergroups/{group_id}/office365s" - localVarPath = strings.Replace(localVarPath, "{"+"group_id"+"}", fmt.Sprintf("%v", groupId), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["limit"], "int32", "limit"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["skip"], "int32", "skip"); err != nil { - return successPayload, nil, err - } - - if localVarTempParam, localVarOk := localVarOptionals["limit"].(int32); localVarOk { - localVarQueryParams.Add("limit", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["skip"].(int32); localVarOk { - localVarQueryParams.Add("skip", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["filter"].([]string); localVarOk { - localVarQueryParams.Add("filter", parameterToString(localVarTempParam, "csv")) - } - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* GraphApiService List the RADIUS Servers bound to a User Group - This endpoint will return all RADIUS servers bound to a User Group, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this User Group to the corresponding RADIUS Server; this array represents all grouping and/or associations that would have to be removed to deprovision the RADIUS Server from this User Group. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/usergroups/{GroupID}/radiusservers \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - * @param ctx context.Context for authentication, logging, tracing, etc. - @param groupId ObjectID of the User Group. - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "limit" (int32) The number of records to return at once. Limited to 100. - @param "xOrgId" (string) - @param "skip" (int32) The offset into the records to return. - @param "filter" ([]string) Supported operators are: eq, ne, gt, ge, lt, le, between, search, in - @return []GraphObjectWithPaths*/ -func (a *GraphApiService) GraphUserGroupTraverseRadiusServer(ctx context.Context, groupId string, contentType string, accept string, localVarOptionals map[string]interface{}) ([]GraphObjectWithPaths, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload []GraphObjectWithPaths - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/usergroups/{group_id}/radiusservers" - localVarPath = strings.Replace(localVarPath, "{"+"group_id"+"}", fmt.Sprintf("%v", groupId), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["limit"], "int32", "limit"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["skip"], "int32", "skip"); err != nil { - return successPayload, nil, err - } - - if localVarTempParam, localVarOk := localVarOptionals["limit"].(int32); localVarOk { - localVarQueryParams.Add("limit", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["skip"].(int32); localVarOk { - localVarQueryParams.Add("skip", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["filter"].([]string); localVarOk { - localVarQueryParams.Add("filter", parameterToString(localVarTempParam, "csv")) - } - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* GraphApiService List the Systems bound to a User Group - This endpoint will return all Systems bound to a User Group, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this User Group to the corresponding System; this array represents all grouping and/or associations that would have to be removed to deprovision the System from this User Group. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/usergroups/{GroupID}/systems \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - * @param ctx context.Context for authentication, logging, tracing, etc. - @param groupId ObjectID of the User Group. - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "limit" (int32) The number of records to return at once. Limited to 100. - @param "xOrgId" (string) - @param "skip" (int32) The offset into the records to return. - @param "filter" ([]string) Supported operators are: eq, ne, gt, ge, lt, le, between, search, in - @return []GraphObjectWithPaths*/ -func (a *GraphApiService) GraphUserGroupTraverseSystem(ctx context.Context, groupId string, contentType string, accept string, localVarOptionals map[string]interface{}) ([]GraphObjectWithPaths, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload []GraphObjectWithPaths - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/usergroups/{group_id}/systems" - localVarPath = strings.Replace(localVarPath, "{"+"group_id"+"}", fmt.Sprintf("%v", groupId), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["limit"], "int32", "limit"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["skip"], "int32", "skip"); err != nil { - return successPayload, nil, err - } - - if localVarTempParam, localVarOk := localVarOptionals["limit"].(int32); localVarOk { - localVarQueryParams.Add("limit", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["skip"].(int32); localVarOk { - localVarQueryParams.Add("skip", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["filter"].([]string); localVarOk { - localVarQueryParams.Add("filter", parameterToString(localVarTempParam, "csv")) - } - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* GraphApiService List the System Groups bound to User Groups - This endpoint will return all System Groups bound to a User Group, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this User Group to the corresponding System Group; this array represents all grouping and/or associations that would have to be removed to deprovision the System Group from this User Group. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/usergroups/{GroupID}/systemgroups \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - * @param ctx context.Context for authentication, logging, tracing, etc. - @param groupId ObjectID of the User Group. - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "limit" (int32) The number of records to return at once. Limited to 100. - @param "xOrgId" (string) - @param "skip" (int32) The offset into the records to return. - @param "filter" ([]string) Supported operators are: eq, ne, gt, ge, lt, le, between, search, in - @return []GraphObjectWithPaths*/ -func (a *GraphApiService) GraphUserGroupTraverseSystemGroup(ctx context.Context, groupId string, contentType string, accept string, localVarOptionals map[string]interface{}) ([]GraphObjectWithPaths, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload []GraphObjectWithPaths - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/usergroups/{group_id}/systemgroups" - localVarPath = strings.Replace(localVarPath, "{"+"group_id"+"}", fmt.Sprintf("%v", groupId), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["limit"], "int32", "limit"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["skip"], "int32", "skip"); err != nil { - return successPayload, nil, err - } - - if localVarTempParam, localVarOk := localVarOptionals["limit"].(int32); localVarOk { - localVarQueryParams.Add("limit", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["skip"].(int32); localVarOk { - localVarQueryParams.Add("skip", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["filter"].([]string); localVarOk { - localVarQueryParams.Add("filter", parameterToString(localVarTempParam, "csv")) - } - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* GraphApiService List the parent Groups of a User - This endpoint returns all the User Groups a User is a member of. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/users/{UserID}/memberof \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - * @param ctx context.Context for authentication, logging, tracing, etc. - @param userId ObjectID of the User. - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "filter" ([]string) Supported operators are: eq, ne, gt, ge, lt, le, between, search, in - @param "limit" (int32) The number of records to return at once. Limited to 100. - @param "skip" (int32) The offset into the records to return. - @param "sort" ([]string) The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. - @param "xOrgId" (string) - @return []GraphObjectWithPaths*/ -func (a *GraphApiService) GraphUserMemberOf(ctx context.Context, userId string, contentType string, accept string, localVarOptionals map[string]interface{}) ([]GraphObjectWithPaths, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload []GraphObjectWithPaths - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/users/{user_id}/memberof" - localVarPath = strings.Replace(localVarPath, "{"+"user_id"+"}", fmt.Sprintf("%v", userId), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["limit"], "int32", "limit"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["skip"], "int32", "skip"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return successPayload, nil, err - } - - if localVarTempParam, localVarOk := localVarOptionals["filter"].([]string); localVarOk { - localVarQueryParams.Add("filter", parameterToString(localVarTempParam, "csv")) - } - if localVarTempParam, localVarOk := localVarOptionals["limit"].(int32); localVarOk { - localVarQueryParams.Add("limit", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["skip"].(int32); localVarOk { - localVarQueryParams.Add("skip", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["sort"].([]string); localVarOk { - localVarQueryParams.Add("sort", parameterToString(localVarTempParam, "csv")) - } - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* GraphApiService List the Active Directory instances bound to a User - This endpoint will return all Active Directory Instances bound to a User, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this User to the corresponding Active Directory instance; this array represents all grouping and/or associations that would have to be removed to deprovision the Active Directory instance from this User. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/users/{UserID}/activedirectories \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - * @param ctx context.Context for authentication, logging, tracing, etc. - @param userId ObjectID of the User. - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "filter" ([]string) Supported operators are: eq, ne, gt, ge, lt, le, between, search, in - @param "limit" (int32) The number of records to return at once. Limited to 100. - @param "xOrgId" (string) - @param "skip" (int32) The offset into the records to return. - @return []GraphObjectWithPaths*/ -func (a *GraphApiService) GraphUserTraverseActiveDirectory(ctx context.Context, userId string, contentType string, accept string, localVarOptionals map[string]interface{}) ([]GraphObjectWithPaths, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload []GraphObjectWithPaths - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/users/{user_id}/activedirectories" - localVarPath = strings.Replace(localVarPath, "{"+"user_id"+"}", fmt.Sprintf("%v", userId), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["limit"], "int32", "limit"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["skip"], "int32", "skip"); err != nil { - return successPayload, nil, err - } - - if localVarTempParam, localVarOk := localVarOptionals["filter"].([]string); localVarOk { - localVarQueryParams.Add("filter", parameterToString(localVarTempParam, "csv")) - } - if localVarTempParam, localVarOk := localVarOptionals["limit"].(int32); localVarOk { - localVarQueryParams.Add("limit", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["skip"].(int32); localVarOk { - localVarQueryParams.Add("skip", parameterToString(localVarTempParam, "")) - } - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* GraphApiService List the Applications bound to a User - This endpoint will return all Applications bound to a User, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this User to the corresponding Application; this array represents all grouping and/or associations that would have to be removed to deprovision the Application from this User. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/users/{UserID}/applications \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - * @param ctx context.Context for authentication, logging, tracing, etc. - @param userId ObjectID of the User. - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "limit" (int32) The number of records to return at once. Limited to 100. - @param "xOrgId" (string) - @param "skip" (int32) The offset into the records to return. - @param "filter" ([]string) Supported operators are: eq, ne, gt, ge, lt, le, between, search, in - @return []GraphObjectWithPaths*/ -func (a *GraphApiService) GraphUserTraverseApplication(ctx context.Context, userId string, contentType string, accept string, localVarOptionals map[string]interface{}) ([]GraphObjectWithPaths, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload []GraphObjectWithPaths - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/users/{user_id}/applications" - localVarPath = strings.Replace(localVarPath, "{"+"user_id"+"}", fmt.Sprintf("%v", userId), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["limit"], "int32", "limit"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["skip"], "int32", "skip"); err != nil { - return successPayload, nil, err - } - - if localVarTempParam, localVarOk := localVarOptionals["limit"].(int32); localVarOk { - localVarQueryParams.Add("limit", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["skip"].(int32); localVarOk { - localVarQueryParams.Add("skip", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["filter"].([]string); localVarOk { - localVarQueryParams.Add("filter", parameterToString(localVarTempParam, "csv")) - } - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* GraphApiService List the Directories bound to a User - This endpoint will return all Directories bound to a User, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this User to the corresponding Directory; this array represents all grouping and/or associations that would have to be removed to deprovision the Directory from this User. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/users/{UserID}/directories \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - * @param ctx context.Context for authentication, logging, tracing, etc. - @param userId ObjectID of the User. - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "limit" (int32) The number of records to return at once. Limited to 100. - @param "xOrgId" (string) - @param "skip" (int32) The offset into the records to return. - @param "filter" ([]string) Supported operators are: eq, ne, gt, ge, lt, le, between, search, in - @return []GraphObjectWithPaths*/ -func (a *GraphApiService) GraphUserTraverseDirectory(ctx context.Context, userId string, contentType string, accept string, localVarOptionals map[string]interface{}) ([]GraphObjectWithPaths, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload []GraphObjectWithPaths - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/users/{user_id}/directories" - localVarPath = strings.Replace(localVarPath, "{"+"user_id"+"}", fmt.Sprintf("%v", userId), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["limit"], "int32", "limit"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["skip"], "int32", "skip"); err != nil { - return successPayload, nil, err - } - - if localVarTempParam, localVarOk := localVarOptionals["limit"].(int32); localVarOk { - localVarQueryParams.Add("limit", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["skip"].(int32); localVarOk { - localVarQueryParams.Add("skip", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["filter"].([]string); localVarOk { - localVarQueryParams.Add("filter", parameterToString(localVarTempParam, "csv")) - } - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* GraphApiService List the G Suite instances bound to a User - This endpoint will return all G-Suite Instances bound to a User, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this User to the corresponding G Suite instance; this array represents all grouping and/or associations that would have to be removed to deprovision the G Suite instance from this User. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/users/{UserID}/gsuites \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - * @param ctx context.Context for authentication, logging, tracing, etc. - @param userId ObjectID of the User. - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "limit" (int32) The number of records to return at once. Limited to 100. - @param "xOrgId" (string) - @param "skip" (int32) The offset into the records to return. - @param "filter" ([]string) Supported operators are: eq, ne, gt, ge, lt, le, between, search, in - @return []GraphObjectWithPaths*/ -func (a *GraphApiService) GraphUserTraverseGSuite(ctx context.Context, userId string, contentType string, accept string, localVarOptionals map[string]interface{}) ([]GraphObjectWithPaths, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload []GraphObjectWithPaths - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/users/{user_id}/gsuites" - localVarPath = strings.Replace(localVarPath, "{"+"user_id"+"}", fmt.Sprintf("%v", userId), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["limit"], "int32", "limit"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["skip"], "int32", "skip"); err != nil { - return successPayload, nil, err - } - - if localVarTempParam, localVarOk := localVarOptionals["limit"].(int32); localVarOk { - localVarQueryParams.Add("limit", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["skip"].(int32); localVarOk { - localVarQueryParams.Add("skip", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["filter"].([]string); localVarOk { - localVarQueryParams.Add("filter", parameterToString(localVarTempParam, "csv")) - } - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* GraphApiService List the LDAP servers bound to a User - This endpoint will return all LDAP Servers bound to a User, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this User to the corresponding LDAP Server; this array represents all grouping and/or associations that would have to be removed to deprovision the LDAP Server from this User. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/users/{UserID}/ldapservers \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - * @param ctx context.Context for authentication, logging, tracing, etc. - @param userId ObjectID of the User. - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "limit" (int32) The number of records to return at once. Limited to 100. - @param "xOrgId" (string) - @param "skip" (int32) The offset into the records to return. - @param "filter" ([]string) Supported operators are: eq, ne, gt, ge, lt, le, between, search, in - @return []GraphObjectWithPaths*/ -func (a *GraphApiService) GraphUserTraverseLdapServer(ctx context.Context, userId string, contentType string, accept string, localVarOptionals map[string]interface{}) ([]GraphObjectWithPaths, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload []GraphObjectWithPaths - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/users/{user_id}/ldapservers" - localVarPath = strings.Replace(localVarPath, "{"+"user_id"+"}", fmt.Sprintf("%v", userId), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["limit"], "int32", "limit"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["skip"], "int32", "skip"); err != nil { - return successPayload, nil, err - } - - if localVarTempParam, localVarOk := localVarOptionals["limit"].(int32); localVarOk { - localVarQueryParams.Add("limit", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["skip"].(int32); localVarOk { - localVarQueryParams.Add("skip", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["filter"].([]string); localVarOk { - localVarQueryParams.Add("filter", parameterToString(localVarTempParam, "csv")) - } - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* GraphApiService List the Office 365 instances bound to a User - This endpoint will return all Office 365 Instances bound to a User, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this User to the corresponding Office 365 instance; this array represents all grouping and/or associations that would have to be removed to deprovision the Office 365 instance from this User. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/users/{UserID}/office365s \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - * @param ctx context.Context for authentication, logging, tracing, etc. - @param userId ObjectID of the User. - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "limit" (int32) The number of records to return at once. Limited to 100. - @param "xOrgId" (string) - @param "skip" (int32) The offset into the records to return. - @param "filter" ([]string) Supported operators are: eq, ne, gt, ge, lt, le, between, search, in - @return []GraphObjectWithPaths*/ -func (a *GraphApiService) GraphUserTraverseOffice365(ctx context.Context, userId string, contentType string, accept string, localVarOptionals map[string]interface{}) ([]GraphObjectWithPaths, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload []GraphObjectWithPaths - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/users/{user_id}/office365s" - localVarPath = strings.Replace(localVarPath, "{"+"user_id"+"}", fmt.Sprintf("%v", userId), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["limit"], "int32", "limit"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["skip"], "int32", "skip"); err != nil { - return successPayload, nil, err - } - - if localVarTempParam, localVarOk := localVarOptionals["limit"].(int32); localVarOk { - localVarQueryParams.Add("limit", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["skip"].(int32); localVarOk { - localVarQueryParams.Add("skip", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["filter"].([]string); localVarOk { - localVarQueryParams.Add("filter", parameterToString(localVarTempParam, "csv")) - } - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* GraphApiService List the RADIUS Servers bound to a User - This endpoint will return all RADIUS Servers bound to a User, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this User to the corresponding RADIUS Server; this array represents all grouping and/or associations that would have to be removed to deprovision the RADIUS Server from this User. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/users/{UserID}/radiusservers \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - * @param ctx context.Context for authentication, logging, tracing, etc. - @param userId ObjectID of the User. - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "limit" (int32) The number of records to return at once. Limited to 100. - @param "xOrgId" (string) - @param "skip" (int32) The offset into the records to return. - @param "filter" ([]string) Supported operators are: eq, ne, gt, ge, lt, le, between, search, in - @return []GraphObjectWithPaths*/ -func (a *GraphApiService) GraphUserTraverseRadiusServer(ctx context.Context, userId string, contentType string, accept string, localVarOptionals map[string]interface{}) ([]GraphObjectWithPaths, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload []GraphObjectWithPaths - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/users/{user_id}/radiusservers" - localVarPath = strings.Replace(localVarPath, "{"+"user_id"+"}", fmt.Sprintf("%v", userId), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["limit"], "int32", "limit"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["skip"], "int32", "skip"); err != nil { - return successPayload, nil, err - } - - if localVarTempParam, localVarOk := localVarOptionals["limit"].(int32); localVarOk { - localVarQueryParams.Add("limit", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["skip"].(int32); localVarOk { - localVarQueryParams.Add("skip", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["filter"].([]string); localVarOk { - localVarQueryParams.Add("filter", parameterToString(localVarTempParam, "csv")) - } - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* GraphApiService List the Systems bound to a User - This endpoint will return all Systems bound to a User, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this User to the corresponding System; this array represents all grouping and/or associations that would have to be removed to deprovision the System from this User. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/users/{UserID}/systems\\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - * @param ctx context.Context for authentication, logging, tracing, etc. - @param userId ObjectID of the User. - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "limit" (int32) The number of records to return at once. Limited to 100. - @param "xOrgId" (string) - @param "skip" (int32) The offset into the records to return. - @param "filter" ([]string) Supported operators are: eq, ne, gt, ge, lt, le, between, search, in - @return []GraphObjectWithPaths*/ -func (a *GraphApiService) GraphUserTraverseSystem(ctx context.Context, userId string, contentType string, accept string, localVarOptionals map[string]interface{}) ([]GraphObjectWithPaths, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload []GraphObjectWithPaths - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/users/{user_id}/systems" - localVarPath = strings.Replace(localVarPath, "{"+"user_id"+"}", fmt.Sprintf("%v", userId), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["limit"], "int32", "limit"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["skip"], "int32", "skip"); err != nil { - return successPayload, nil, err - } - - if localVarTempParam, localVarOk := localVarOptionals["limit"].(int32); localVarOk { - localVarQueryParams.Add("limit", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["skip"].(int32); localVarOk { - localVarQueryParams.Add("skip", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["filter"].([]string); localVarOk { - localVarQueryParams.Add("filter", parameterToString(localVarTempParam, "csv")) - } - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* GraphApiService List the System Groups bound to a User - This endpoint will return all System Groups bound to a User, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this User to the corresponding System Group; this array represents all grouping and/or associations that would have to be removed to deprovision the System Group from this User. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/users/{UserID}/systemgroups\\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - * @param ctx context.Context for authentication, logging, tracing, etc. - @param userId ObjectID of the User. - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "limit" (int32) The number of records to return at once. Limited to 100. - @param "xOrgId" (string) - @param "skip" (int32) The offset into the records to return. - @param "filter" ([]string) Supported operators are: eq, ne, gt, ge, lt, le, between, search, in - @return []GraphObjectWithPaths*/ -func (a *GraphApiService) GraphUserTraverseSystemGroup(ctx context.Context, userId string, contentType string, accept string, localVarOptionals map[string]interface{}) ([]GraphObjectWithPaths, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload []GraphObjectWithPaths - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/users/{user_id}/systemgroups" - localVarPath = strings.Replace(localVarPath, "{"+"user_id"+"}", fmt.Sprintf("%v", userId), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["limit"], "int32", "limit"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["skip"], "int32", "skip"); err != nil { - return successPayload, nil, err - } - - if localVarTempParam, localVarOk := localVarOptionals["limit"].(int32); localVarOk { - localVarQueryParams.Add("limit", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["skip"].(int32); localVarOk { - localVarQueryParams.Add("skip", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["filter"].([]string); localVarOk { - localVarQueryParams.Add("filter", parameterToString(localVarTempParam, "csv")) - } - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* GraphApiService List the policy statuses for a system - This endpoint returns the policy results for a particular system. ##### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/systems/{System_ID}/policystatuses \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - * @param ctx context.Context for authentication, logging, tracing, etc. - @param systemId ObjectID of the System. - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "fields" ([]string) The comma separated fields included in the returned records. If omitted, the default list of fields will be returned. - @param "filter" ([]string) Supported operators are: eq, ne, gt, ge, lt, le, between, search, in - @param "limit" (int32) The number of records to return at once. Limited to 100. - @param "skip" (int32) The offset into the records to return. - @param "sort" ([]string) The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. - @param "xOrgId" (string) - @return []PolicyResult*/ -func (a *GraphApiService) PolicystatusesList(ctx context.Context, systemId string, contentType string, accept string, localVarOptionals map[string]interface{}) ([]PolicyResult, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload []PolicyResult - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/systems/{system_id}/policystatuses" - localVarPath = strings.Replace(localVarPath, "{"+"system_id"+"}", fmt.Sprintf("%v", systemId), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["limit"], "int32", "limit"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["skip"], "int32", "skip"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return successPayload, nil, err - } - - if localVarTempParam, localVarOk := localVarOptionals["fields"].([]string); localVarOk { - localVarQueryParams.Add("fields", parameterToString(localVarTempParam, "csv")) - } - if localVarTempParam, localVarOk := localVarOptionals["filter"].([]string); localVarOk { - localVarQueryParams.Add("filter", parameterToString(localVarTempParam, "csv")) - } - if localVarTempParam, localVarOk := localVarOptionals["limit"].(int32); localVarOk { - localVarQueryParams.Add("limit", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["skip"].(int32); localVarOk { - localVarQueryParams.Add("skip", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["sort"].([]string); localVarOk { - localVarQueryParams.Add("sort", parameterToString(localVarTempParam, "csv")) - } - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - diff --git a/v2/graph_connection.go b/v2/graph_connection.go deleted file mode 100644 index d4d7f7c..0000000 --- a/v2/graph_connection.go +++ /dev/null @@ -1,18 +0,0 @@ -/* - * JumpCloud APIs - * - * JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. - * - * API version: 2.0 - * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) - */ - -package v2 - -// Represents an edge between two graph objects. From can be omitted if it is clear from context. -type GraphConnection struct { - - From *GraphObject `json:"from,omitempty"` - - To *GraphObject `json:"to"` -} diff --git a/v2/graph_management_req.go b/v2/graph_management_req.go deleted file mode 100644 index 90c75db..0000000 --- a/v2/graph_management_req.go +++ /dev/null @@ -1,21 +0,0 @@ -/* - * JumpCloud APIs - * - * JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. - * - * API version: 2.0 - * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) - */ - -package v2 - -type GraphManagementReq struct { - - // The ObjectID of graph object being added or removed as an association. - Id string `json:"id"` - - // How to modify the graph connection. - Op string `json:"op"` - - Type_ *GraphType `json:"type"` -} diff --git a/v2/graph_object.go b/v2/graph_object.go deleted file mode 100644 index cd16e7e..0000000 --- a/v2/graph_object.go +++ /dev/null @@ -1,19 +0,0 @@ -/* - * JumpCloud APIs - * - * JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. - * - * API version: 2.0 - * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) - */ - -package v2 - -type GraphObject struct { - - // The ObjectID of the graph object. - Id string `json:"id"` - - // The type of graph object. - Type_ string `json:"type"` -} diff --git a/v2/graph_object_with_paths.go b/v2/graph_object_with_paths.go deleted file mode 100644 index 5835f9c..0000000 --- a/v2/graph_object_with_paths.go +++ /dev/null @@ -1,21 +0,0 @@ -/* - * JumpCloud APIs - * - * JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. - * - * API version: 2.0 - * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) - */ - -package v2 - -type GraphObjectWithPaths struct { - - // Object ID of this graph object. - Id string `json:"id"` - - // A path through the graph between two graph objects. - Paths [][]GraphConnection `json:"paths"` - - Type_ *GraphType `json:"type"` -} diff --git a/v2/graph_type.go b/v2/graph_type.go deleted file mode 100644 index 1244b18..0000000 --- a/v2/graph_type.go +++ /dev/null @@ -1,12 +0,0 @@ -/* - * JumpCloud APIs - * - * JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. - * - * API version: 2.0 - * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) - */ - -package v2 -// GraphType : The graph type. -type GraphType string diff --git a/v2/group.go b/v2/group.go deleted file mode 100644 index 992d149..0000000 --- a/v2/group.go +++ /dev/null @@ -1,21 +0,0 @@ -/* - * JumpCloud APIs - * - * JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. - * - * API version: 2.0 - * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) - */ - -package v2 - -type Group struct { - - // ObjectId uniquely identifying a Group. - Id string `json:"id,omitempty"` - - // Display name of a Group. - Name string `json:"name,omitempty"` - - Type_ *GroupType `json:"type,omitempty"` -} diff --git a/v2/group_type.go b/v2/group_type.go deleted file mode 100644 index f7ed706..0000000 --- a/v2/group_type.go +++ /dev/null @@ -1,12 +0,0 @@ -/* - * JumpCloud APIs - * - * JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. - * - * API version: 2.0 - * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) - */ - -package v2 -// GroupType : The group type. -type GroupType string diff --git a/v2/groups_api.go b/v2/groups_api.go deleted file mode 100644 index 96cbe9e..0000000 --- a/v2/groups_api.go +++ /dev/null @@ -1,141 +0,0 @@ -/* - * JumpCloud APIs - * - * JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. - * - * API version: 2.0 - * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) - */ - -package v2 - -import ( - "io/ioutil" - "net/url" - "net/http" - "strings" - "golang.org/x/net/context" - "encoding/json" -) - -// Linger please -var ( - _ context.Context -) - -type GroupsApiService service - - -/* GroupsApiService List All Groups - This endpoint returns all Groups that exist in your organization. #### Available filter fields: - `name` - `disabled` - `type` #### Sample Request ``` curl -X GET \\ https://console.jumpcloud.com/api/v2/groups \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - * @param ctx context.Context for authentication, logging, tracing, etc. - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "fields" ([]string) The comma separated fields included in the returned records. If omitted, the default list of fields will be returned. - @param "filter" ([]string) Supported operators are: eq, ne, gt, ge, lt, le, between, search, in - @param "limit" (int32) The number of records to return at once. Limited to 100. - @param "skip" (int32) The offset into the records to return. - @param "sort" ([]string) The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. - @param "xOrgId" (string) - @return []Group*/ -func (a *GroupsApiService) GroupsList(ctx context.Context, contentType string, accept string, localVarOptionals map[string]interface{}) ([]Group, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload []Group - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/groups" - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["limit"], "int32", "limit"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["skip"], "int32", "skip"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return successPayload, nil, err - } - - if localVarTempParam, localVarOk := localVarOptionals["fields"].([]string); localVarOk { - localVarQueryParams.Add("fields", parameterToString(localVarTempParam, "csv")) - } - if localVarTempParam, localVarOk := localVarOptionals["filter"].([]string); localVarOk { - localVarQueryParams.Add("filter", parameterToString(localVarTempParam, "csv")) - } - if localVarTempParam, localVarOk := localVarOptionals["limit"].(int32); localVarOk { - localVarQueryParams.Add("limit", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["skip"].(int32); localVarOk { - localVarQueryParams.Add("skip", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["sort"].([]string); localVarOk { - localVarQueryParams.Add("sort", parameterToString(localVarTempParam, "csv")) - } - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - diff --git a/v2/gsuite_output.go b/v2/gsuite_output.go deleted file mode 100644 index c2b5fca..0000000 --- a/v2/gsuite_output.go +++ /dev/null @@ -1,19 +0,0 @@ -/* - * JumpCloud APIs - * - * JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. - * - * API version: 2.0 - * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) - */ - -package v2 - -type GsuiteOutput struct { - - Id string `json:"id,omitempty"` - - UserLockoutAction string `json:"userLockoutAction,omitempty"` - - UserPasswordExpirationAction string `json:"userPasswordExpirationAction,omitempty"` -} diff --git a/v2/gsuite_patch_input.go b/v2/gsuite_patch_input.go deleted file mode 100644 index 5233863..0000000 --- a/v2/gsuite_patch_input.go +++ /dev/null @@ -1,17 +0,0 @@ -/* - * JumpCloud APIs - * - * JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. - * - * API version: 2.0 - * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) - */ - -package v2 - -type GsuitePatchInput struct { - - UserLockoutAction string `json:"userLockoutAction,omitempty"` - - UserPasswordExpirationAction string `json:"userPasswordExpirationAction,omitempty"` -} diff --git a/v2/inline_response_200.go b/v2/inline_response_200.go deleted file mode 100644 index 76f5b60..0000000 --- a/v2/inline_response_200.go +++ /dev/null @@ -1,21 +0,0 @@ -/* - * JumpCloud APIs - * - * JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. - * - * API version: 2.0 - * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) - */ - -package v2 - -type InlineResponse200 struct { - - Id string `json:"id,omitempty"` - - Name string `json:"name,omitempty"` - - UserLockoutAction *LdapServerAction `json:"userLockoutAction,omitempty"` - - UserPasswordExpirationAction *LdapServerAction `json:"userPasswordExpirationAction,omitempty"` -} diff --git a/v2/inline_response_200_1.go b/v2/inline_response_200_1.go deleted file mode 100644 index 541c5b0..0000000 --- a/v2/inline_response_200_1.go +++ /dev/null @@ -1,17 +0,0 @@ -/* - * JumpCloud APIs - * - * JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. - * - * API version: 2.0 - * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) - */ - -package v2 - -type InlineResponse2001 struct { - - Results []Administrator `json:"results,omitempty"` - - TotalCount int32 `json:"totalCount,omitempty"` -} diff --git a/v2/inline_response_201.go b/v2/inline_response_201.go deleted file mode 100644 index 9fd56c2..0000000 --- a/v2/inline_response_201.go +++ /dev/null @@ -1,17 +0,0 @@ -/* - * JumpCloud APIs - * - * JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. - * - * API version: 2.0 - * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) - */ - -package v2 - -type InlineResponse201 struct { - - AppleMdm *AppleMdm `json:"appleMdm,omitempty"` - - SignedCsrPlist string `json:"signedCsrPlist,omitempty"` -} diff --git a/v2/inline_response_400.go b/v2/inline_response_400.go deleted file mode 100644 index 252386c..0000000 --- a/v2/inline_response_400.go +++ /dev/null @@ -1,15 +0,0 @@ -/* - * JumpCloud APIs - * - * JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. - * - * API version: 2.0 - * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) - */ - -package v2 - -type InlineResponse400 struct { - - Message string `json:"message,omitempty"` -} diff --git a/v2/jc_enrollment_profile.go b/v2/jc_enrollment_profile.go deleted file mode 100644 index 0e96302..0000000 --- a/v2/jc_enrollment_profile.go +++ /dev/null @@ -1,23 +0,0 @@ -/* - * JumpCloud APIs - * - * JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. - * - * API version: 2.0 - * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) - */ - -package v2 - -type JcEnrollmentProfile struct { - - Groups []string `json:"groups,omitempty"` - - Id string `json:"id,omitempty"` - - Name string `json:"name,omitempty"` - - Organization string `json:"organization,omitempty"` - - Users []string `json:"users,omitempty"` -} diff --git a/v2/job_details.go b/v2/job_details.go deleted file mode 100644 index 5c0d58e..0000000 --- a/v2/job_details.go +++ /dev/null @@ -1,29 +0,0 @@ -/* - * JumpCloud APIs - * - * JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. - * - * API version: 2.0 - * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) - */ - -package v2 - -type JobDetails struct { - - AdminId string `json:"adminId,omitempty"` - - Id string `json:"id,omitempty"` - - Meta *interface{} `json:"meta,omitempty"` - - Name string `json:"name,omitempty"` - - PersistedFields []string `json:"persistedFields,omitempty"` - - Status string `json:"status,omitempty"` - - UpdatedAt string `json:"updatedAt,omitempty"` - - WorkUnitsCount int32 `json:"workUnitsCount,omitempty"` -} diff --git a/v2/job_id.go b/v2/job_id.go deleted file mode 100644 index 0d9ce53..0000000 --- a/v2/job_id.go +++ /dev/null @@ -1,15 +0,0 @@ -/* - * JumpCloud APIs - * - * JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. - * - * API version: 2.0 - * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) - */ - -package v2 - -type JobId struct { - - JobId string `json:"jobId,omitempty"` -} diff --git a/v2/job_workresult.go b/v2/job_workresult.go deleted file mode 100644 index 288170c..0000000 --- a/v2/job_workresult.go +++ /dev/null @@ -1,15 +0,0 @@ -/* - * JumpCloud APIs - * - * JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. - * - * API version: 2.0 - * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) - */ - -package v2 - -type JobWorkresult struct { - - Meta *interface{} `json:"meta,omitempty"` -} diff --git a/v2/knowledge_api.go b/v2/knowledge_api.go deleted file mode 100644 index cdf455e..0000000 --- a/v2/knowledge_api.go +++ /dev/null @@ -1,130 +0,0 @@ -/* - * JumpCloud APIs - * - * JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. - * - * API version: 2.0 - * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) - */ - -package v2 - -import ( - "io/ioutil" - "net/url" - "net/http" - "strings" - "golang.org/x/net/context" - "encoding/json" -) - -// Linger please -var ( - _ context.Context -) - -type KnowledgeApiService service - - -/* KnowledgeApiService List Knowledge Articles - This endpoint returns a list of knowledge articles hosted in salesforce. ``` Sample Request curl -X GET https://console.jumpcloud.com/api/v2/knowledge/salesforce \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - * @param ctx context.Context for authentication, logging, tracing, etc. - @param optional (nil or map[string]interface{}) with one or more of: - @param "fields" ([]string) - @param "filter" ([]string) Supported operators are: eq, ne, gt, ge, lt, le, between, search, in - @param "limit" (int32) The number of records to return at once. Limited to 100. - @param "skip" (int32) The offset into the records to return. - @param "sort" ([]string) The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. - @return SalesforceKnowledgeListOutput*/ -func (a *KnowledgeApiService) KnowledgeSalesforceList(ctx context.Context, localVarOptionals map[string]interface{}) (SalesforceKnowledgeListOutput, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload SalesforceKnowledgeListOutput - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/knowledge/salesforce" - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["limit"], "int32", "limit"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["skip"], "int32", "skip"); err != nil { - return successPayload, nil, err - } - - if localVarTempParam, localVarOk := localVarOptionals["fields"].([]string); localVarOk { - localVarQueryParams.Add("fields", parameterToString(localVarTempParam, "csv")) - } - if localVarTempParam, localVarOk := localVarOptionals["filter"].([]string); localVarOk { - localVarQueryParams.Add("filter", parameterToString(localVarTempParam, "csv")) - } - if localVarTempParam, localVarOk := localVarOptionals["limit"].(int32); localVarOk { - localVarQueryParams.Add("limit", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["skip"].(int32); localVarOk { - localVarQueryParams.Add("skip", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["sort"].([]string); localVarOk { - localVarQueryParams.Add("sort", parameterToString(localVarTempParam, "csv")) - } - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - diff --git a/v2/ldap_server_action.go b/v2/ldap_server_action.go deleted file mode 100644 index c8c11db..0000000 --- a/v2/ldap_server_action.go +++ /dev/null @@ -1,18 +0,0 @@ -/* - * JumpCloud APIs - * - * JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. - * - * API version: 2.0 - * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) - */ - -package v2 - -type LdapServerAction string - -// List of LdapServerAction -const ( - DISABLE LdapServerAction = "disable" - REMOVE LdapServerAction = "remove" -) diff --git a/v2/ldap_server_input.go b/v2/ldap_server_input.go deleted file mode 100644 index 8179a73..0000000 --- a/v2/ldap_server_input.go +++ /dev/null @@ -1,22 +0,0 @@ -/* - * JumpCloud APIs - * - * JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. - * - * API version: 2.0 - * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) - */ - -package v2 - -type LdapServerInput struct { - - // The name of this LDAP server - Name string `json:"name,omitempty"` - - // action to take; one of 'remove' or 'disable' - UserLockoutAction string `json:"userLockoutAction,omitempty"` - - // action to take; one of 'remove' or 'disable' - UserPasswordExpirationAction string `json:"userPasswordExpirationAction,omitempty"` -} diff --git a/v2/ldap_server_output.go b/v2/ldap_server_output.go deleted file mode 100644 index 664bd76..0000000 --- a/v2/ldap_server_output.go +++ /dev/null @@ -1,25 +0,0 @@ -/* - * JumpCloud APIs - * - * JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. - * - * API version: 2.0 - * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) - */ - -package v2 - -type LdapServerOutput struct { - - // The name of this LDAP server - Name string `json:"name,omitempty"` - - // action to take; one of 'remove' or 'disable' - UserLockoutAction string `json:"userLockoutAction,omitempty"` - - // action to take; one of 'remove' or 'disable' - UserPasswordExpirationAction string `json:"userPasswordExpirationAction,omitempty"` - - // Unique identifier of this LDAP server - Id string `json:"id"` -} diff --git a/v2/ldap_servers_api.go b/v2/ldap_servers_api.go deleted file mode 100644 index 955bcc3..0000000 --- a/v2/ldap_servers_api.go +++ /dev/null @@ -1,739 +0,0 @@ -/* - * JumpCloud APIs - * - * JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. - * - * API version: 2.0 - * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) - */ - -package v2 - -import ( - "io/ioutil" - "net/url" - "net/http" - "strings" - "golang.org/x/net/context" - "encoding/json" - "fmt" -) - -// Linger please -var ( - _ context.Context -) - -type LDAPServersApiService service - - -/* LDAPServersApiService List the associations of a LDAP Server - This endpoint returns the _direct_ associations of this LDAP Server. A direct association can be a non-homogeneous relationship between 2 different objects, for example LDAP and Users. #### Sample Request ``` curl -X GET 'https://console.jumpcloud.com/api/v2/ldapservers/{LDAP_ID}/associations?targets=user_group \\ -H 'accept: application/json' \\ -H 'content-type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - * @param ctx context.Context for authentication, logging, tracing, etc. - @param ldapserverId ObjectID of the LDAP Server. - @param targets - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "limit" (int32) The number of records to return at once. Limited to 100. - @param "skip" (int32) The offset into the records to return. - @param "xOrgId" (string) - @return []GraphConnection*/ -func (a *LDAPServersApiService) GraphLdapServerAssociationsList(ctx context.Context, ldapserverId string, targets []string, contentType string, accept string, localVarOptionals map[string]interface{}) ([]GraphConnection, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload []GraphConnection - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/ldapservers/{ldapserver_id}/associations" - localVarPath = strings.Replace(localVarPath, "{"+"ldapserver_id"+"}", fmt.Sprintf("%v", ldapserverId), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["limit"], "int32", "limit"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["skip"], "int32", "skip"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return successPayload, nil, err - } - - localVarQueryParams.Add("targets", parameterToString(targets, "csv")) - if localVarTempParam, localVarOk := localVarOptionals["limit"].(int32); localVarOk { - localVarQueryParams.Add("limit", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["skip"].(int32); localVarOk { - localVarQueryParams.Add("skip", parameterToString(localVarTempParam, "")) - } - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* LDAPServersApiService Manage the associations of a LDAP Server - This endpoint allows you to manage the _direct_ associations of a LDAP Server. A direct association can be a non-homogeneous relationship between 2 different objects, for example LDAP and Users. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/ldapservers/{LDAP_ID}/associations \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"op\": \"add\", \"type\": \"user\", \"id\": \"{User_ID}\" }' ``` - * @param ctx context.Context for authentication, logging, tracing, etc. - @param ldapserverId ObjectID of the LDAP Server. - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "body" (GraphManagementReq) - @param "xOrgId" (string) - @return */ -func (a *LDAPServersApiService) GraphLdapServerAssociationsPost(ctx context.Context, ldapserverId string, contentType string, accept string, localVarOptionals map[string]interface{}) ( *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Post") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/ldapservers/{ldapserver_id}/associations" - localVarPath = strings.Replace(localVarPath, "{"+"ldapserver_id"+"}", fmt.Sprintf("%v", ldapserverId), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return nil, err - } - - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - // body params - if localVarTempParam, localVarOk := localVarOptionals["body"].(GraphManagementReq); localVarOk { - localVarPostBody = &localVarTempParam - } - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - return localVarHttpResponse, err -} - -/* LDAPServersApiService List the Users bound to a LDAP Server - This endpoint will return all Users bound to an LDAP Server, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this LDAP server instance to the corresponding User; this array represents all grouping and/or associations that would have to be removed to deprovision the User from this LDAP server instance. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/ldapservers/{LDAP_ID}/users \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - * @param ctx context.Context for authentication, logging, tracing, etc. - @param ldapserverId ObjectID of the LDAP Server. - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "limit" (int32) The number of records to return at once. Limited to 100. - @param "xOrgId" (string) - @param "skip" (int32) The offset into the records to return. - @param "filter" ([]string) Supported operators are: eq, ne, gt, ge, lt, le, between, search, in - @return []GraphObjectWithPaths*/ -func (a *LDAPServersApiService) GraphLdapServerTraverseUser(ctx context.Context, ldapserverId string, contentType string, accept string, localVarOptionals map[string]interface{}) ([]GraphObjectWithPaths, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload []GraphObjectWithPaths - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/ldapservers/{ldapserver_id}/users" - localVarPath = strings.Replace(localVarPath, "{"+"ldapserver_id"+"}", fmt.Sprintf("%v", ldapserverId), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["limit"], "int32", "limit"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["skip"], "int32", "skip"); err != nil { - return successPayload, nil, err - } - - if localVarTempParam, localVarOk := localVarOptionals["limit"].(int32); localVarOk { - localVarQueryParams.Add("limit", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["skip"].(int32); localVarOk { - localVarQueryParams.Add("skip", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["filter"].([]string); localVarOk { - localVarQueryParams.Add("filter", parameterToString(localVarTempParam, "csv")) - } - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* LDAPServersApiService List the User Groups bound to a LDAP Server - This endpoint will return all Users Groups bound to a LDAP Server, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the group's type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this LDAP server instance to the corresponding User Group; this array represents all grouping and/or associations that would have to be removed to deprovision the User Group from this LDAP server instance. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/ldapservers/{LDAP_ID}/usergroups \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - * @param ctx context.Context for authentication, logging, tracing, etc. - @param ldapserverId ObjectID of the LDAP Server. - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "limit" (int32) The number of records to return at once. Limited to 100. - @param "xOrgId" (string) - @param "skip" (int32) The offset into the records to return. - @param "filter" ([]string) Supported operators are: eq, ne, gt, ge, lt, le, between, search, in - @return []GraphObjectWithPaths*/ -func (a *LDAPServersApiService) GraphLdapServerTraverseUserGroup(ctx context.Context, ldapserverId string, contentType string, accept string, localVarOptionals map[string]interface{}) ([]GraphObjectWithPaths, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload []GraphObjectWithPaths - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/ldapservers/{ldapserver_id}/usergroups" - localVarPath = strings.Replace(localVarPath, "{"+"ldapserver_id"+"}", fmt.Sprintf("%v", ldapserverId), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["limit"], "int32", "limit"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["skip"], "int32", "skip"); err != nil { - return successPayload, nil, err - } - - if localVarTempParam, localVarOk := localVarOptionals["limit"].(int32); localVarOk { - localVarQueryParams.Add("limit", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["skip"].(int32); localVarOk { - localVarQueryParams.Add("skip", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["filter"].([]string); localVarOk { - localVarQueryParams.Add("filter", parameterToString(localVarTempParam, "csv")) - } - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* LDAPServersApiService Get LDAP Server - This endpoint returns a specific LDAP server. ##### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/ldapservers/{LDAP_ID} \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - * @param ctx context.Context for authentication, logging, tracing, etc. - @param id Unique identifier of the LDAP server. - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "xOrgId" (string) - @return LdapServerOutput*/ -func (a *LDAPServersApiService) LdapserversGet(ctx context.Context, id string, contentType string, accept string, localVarOptionals map[string]interface{}) (LdapServerOutput, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload LdapServerOutput - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/ldapservers/{id}" - localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return successPayload, nil, err - } - - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* LDAPServersApiService List LDAP Servers - This endpoint returns the object IDs of your LDAP servers. ##### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/ldapservers/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' - * @param ctx context.Context for authentication, logging, tracing, etc. - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "fields" ([]string) The comma separated fields included in the returned records. If omitted, the default list of fields will be returned. - @param "filter" ([]string) Supported operators are: eq, ne, gt, ge, lt, le, between, search, in - @param "limit" (int32) The number of records to return at once. Limited to 100. - @param "skip" (int32) The offset into the records to return. - @param "sort" ([]string) The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. - @param "xOrgId" (string) - @return []LdapServerOutput*/ -func (a *LDAPServersApiService) LdapserversList(ctx context.Context, contentType string, accept string, localVarOptionals map[string]interface{}) ([]LdapServerOutput, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload []LdapServerOutput - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/ldapservers" - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["limit"], "int32", "limit"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["skip"], "int32", "skip"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return successPayload, nil, err - } - - if localVarTempParam, localVarOk := localVarOptionals["fields"].([]string); localVarOk { - localVarQueryParams.Add("fields", parameterToString(localVarTempParam, "csv")) - } - if localVarTempParam, localVarOk := localVarOptionals["filter"].([]string); localVarOk { - localVarQueryParams.Add("filter", parameterToString(localVarTempParam, "csv")) - } - if localVarTempParam, localVarOk := localVarOptionals["limit"].(int32); localVarOk { - localVarQueryParams.Add("limit", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["skip"].(int32); localVarOk { - localVarQueryParams.Add("skip", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["sort"].([]string); localVarOk { - localVarQueryParams.Add("sort", parameterToString(localVarTempParam, "csv")) - } - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* LDAPServersApiService Update existing LDAP server - This endpoint allows updating some attributes of an LDAP server. Sample Request ``` curl -X PATCH https://console.jumpcloud.com/api/v2/ldapservers/{LDAP_ID} \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"userLockoutAction\": \"remove\", \"userPasswordExpirationAction\": \"disable\" }' ``` - * @param ctx context.Context for authentication, logging, tracing, etc. - @param id Unique identifier of the LDAP server. - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "body" (Body3) - @param "xApiKey" (string) - @param "xOrgId" (string) - @return InlineResponse200*/ -func (a *LDAPServersApiService) LdapserversPatch(ctx context.Context, id string, contentType string, accept string, localVarOptionals map[string]interface{}) (InlineResponse200, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Patch") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload InlineResponse200 - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/ldapservers/{id}" - localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["xApiKey"], "string", "xApiKey"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return successPayload, nil, err - } - - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - if localVarTempParam, localVarOk := localVarOptionals["xApiKey"].(string); localVarOk { - localVarHeaderParams["x-api-key"] = parameterToString(localVarTempParam, "") - } - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - // body params - if localVarTempParam, localVarOk := localVarOptionals["body"].(Body3); localVarOk { - localVarPostBody = &localVarTempParam - } - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - diff --git a/v2/mfa.go b/v2/mfa.go deleted file mode 100644 index cf76175..0000000 --- a/v2/mfa.go +++ /dev/null @@ -1,23 +0,0 @@ -/* - * JumpCloud APIs - * - * JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. - * - * API version: 2.0 - * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) - */ - -package v2 - -import ( - "time" -) - -type Mfa struct { - - Configured bool `json:"configured,omitempty"` - - Exclusion bool `json:"exclusion,omitempty"` - - ExclusionUntil time.Time `json:"exclusionUntil,omitempty"` -} diff --git a/v2/mobileconfig.go b/v2/mobileconfig.go deleted file mode 100644 index 5cbf6b9..0000000 --- a/v2/mobileconfig.go +++ /dev/null @@ -1,13 +0,0 @@ -/* - * JumpCloud APIs - * - * JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. - * - * API version: 2.0 - * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) - */ - -package v2 - -type Mobileconfig struct { -} diff --git a/v2/model_error.go b/v2/model_error.go deleted file mode 100644 index 25e6aa3..0000000 --- a/v2/model_error.go +++ /dev/null @@ -1,19 +0,0 @@ -/* - * JumpCloud APIs - * - * JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. - * - * API version: 2.0 - * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) - */ - -package v2 - -type ModelError struct { - - Code int32 `json:"code,omitempty"` - - Fields string `json:"fields,omitempty"` - - Message string `json:"message,omitempty"` -} diff --git a/v2/oauth_code_input.go b/v2/oauth_code_input.go deleted file mode 100644 index 84eeb87..0000000 --- a/v2/oauth_code_input.go +++ /dev/null @@ -1,15 +0,0 @@ -/* - * JumpCloud APIs - * - * JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. - * - * API version: 2.0 - * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) - */ - -package v2 - -type OauthCodeInput struct { - - Code string `json:"code,omitempty"` -} diff --git a/v2/office365_api.go b/v2/office365_api.go deleted file mode 100644 index 1b8cfe7..0000000 --- a/v2/office365_api.go +++ /dev/null @@ -1,791 +0,0 @@ -/* - * JumpCloud APIs - * - * JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. - * - * API version: 2.0 - * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) - */ - -package v2 - -import ( - "io/ioutil" - "net/url" - "net/http" - "strings" - "golang.org/x/net/context" - "encoding/json" - "fmt" -) - -// Linger please -var ( - _ context.Context -) - -type Office365ApiService service - - -/* Office365ApiService List the associations of an Office 365 instance - This endpoint returns _direct_ associations of an Office 365 instance. A direct association can be a non-homogeneous relationship between 2 different objects, for example Office 365 and Users. #### Sample Request ``` curl -X GET 'https://console.jumpcloud.com/api/v2/office365s/{O365_ID}/associations?targets=user_group \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - * @param ctx context.Context for authentication, logging, tracing, etc. - @param office365Id ObjectID of the Office 365 instance. - @param targets - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "limit" (int32) The number of records to return at once. Limited to 100. - @param "skip" (int32) The offset into the records to return. - @param "xOrgId" (string) - @return []GraphConnection*/ -func (a *Office365ApiService) GraphOffice365AssociationsList(ctx context.Context, office365Id string, targets []string, contentType string, accept string, localVarOptionals map[string]interface{}) ([]GraphConnection, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload []GraphConnection - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/office365s/{office365_id}/associations" - localVarPath = strings.Replace(localVarPath, "{"+"office365_id"+"}", fmt.Sprintf("%v", office365Id), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["limit"], "int32", "limit"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["skip"], "int32", "skip"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return successPayload, nil, err - } - - localVarQueryParams.Add("targets", parameterToString(targets, "csv")) - if localVarTempParam, localVarOk := localVarOptionals["limit"].(int32); localVarOk { - localVarQueryParams.Add("limit", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["skip"].(int32); localVarOk { - localVarQueryParams.Add("skip", parameterToString(localVarTempParam, "")) - } - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* Office365ApiService Manage the associations of an Office 365 instance - This endpoint allows you to manage the _direct_ associations of a Office 365 instance. A direct association can be a non-homogeneous relationship between 2 different objects, for example Office 365 and Users. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/office365s/{O365_ID}/associations \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"op\": \"add\", \"type\": \"user_group\", \"id\": \"{Group_ID}\" }' ``` - * @param ctx context.Context for authentication, logging, tracing, etc. - @param office365Id ObjectID of the Office 365 instance. - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "body" (GraphManagementReq) - @param "xOrgId" (string) - @return */ -func (a *Office365ApiService) GraphOffice365AssociationsPost(ctx context.Context, office365Id string, contentType string, accept string, localVarOptionals map[string]interface{}) ( *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Post") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/office365s/{office365_id}/associations" - localVarPath = strings.Replace(localVarPath, "{"+"office365_id"+"}", fmt.Sprintf("%v", office365Id), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return nil, err - } - - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - // body params - if localVarTempParam, localVarOk := localVarOptionals["body"].(GraphManagementReq); localVarOk { - localVarPostBody = &localVarTempParam - } - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - return localVarHttpResponse, err -} - -/* Office365ApiService List the Users bound to an Office 365 instance - This endpoint will return all Users bound to an Office 365 instance, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this Office 365 instance to the corresponding User; this array represents all grouping and/or associations that would have to be removed to deprovision the User from this Office 365 instance. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/office365s/{O365_ID}/users \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - * @param ctx context.Context for authentication, logging, tracing, etc. - @param office365Id ObjectID of the Office 365 suite. - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "limit" (int32) The number of records to return at once. Limited to 100. - @param "xOrgId" (string) - @param "skip" (int32) The offset into the records to return. - @param "filter" ([]string) Supported operators are: eq, ne, gt, ge, lt, le, between, search, in - @return []GraphObjectWithPaths*/ -func (a *Office365ApiService) GraphOffice365TraverseUser(ctx context.Context, office365Id string, contentType string, accept string, localVarOptionals map[string]interface{}) ([]GraphObjectWithPaths, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload []GraphObjectWithPaths - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/office365s/{office365_id}/users" - localVarPath = strings.Replace(localVarPath, "{"+"office365_id"+"}", fmt.Sprintf("%v", office365Id), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["limit"], "int32", "limit"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["skip"], "int32", "skip"); err != nil { - return successPayload, nil, err - } - - if localVarTempParam, localVarOk := localVarOptionals["limit"].(int32); localVarOk { - localVarQueryParams.Add("limit", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["skip"].(int32); localVarOk { - localVarQueryParams.Add("skip", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["filter"].([]string); localVarOk { - localVarQueryParams.Add("filter", parameterToString(localVarTempParam, "csv")) - } - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* Office365ApiService List the User Groups bound to an Office 365 instance - This endpoint will return all Users Groups bound to an Office 365 instance, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the group's type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this Office 365 instance to the corresponding User Group; this array represents all grouping and/or associations that would have to be removed to deprovision the User Group from this Office 365 instance. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/office365s/{O365_ID/usergroups \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - * @param ctx context.Context for authentication, logging, tracing, etc. - @param office365Id ObjectID of the Office 365 suite. - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "limit" (int32) The number of records to return at once. Limited to 100. - @param "xOrgId" (string) - @param "skip" (int32) The offset into the records to return. - @param "filter" ([]string) Supported operators are: eq, ne, gt, ge, lt, le, between, search, in - @return []GraphObjectWithPaths*/ -func (a *Office365ApiService) GraphOffice365TraverseUserGroup(ctx context.Context, office365Id string, contentType string, accept string, localVarOptionals map[string]interface{}) ([]GraphObjectWithPaths, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload []GraphObjectWithPaths - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/office365s/{office365_id}/usergroups" - localVarPath = strings.Replace(localVarPath, "{"+"office365_id"+"}", fmt.Sprintf("%v", office365Id), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["limit"], "int32", "limit"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["skip"], "int32", "skip"); err != nil { - return successPayload, nil, err - } - - if localVarTempParam, localVarOk := localVarOptionals["limit"].(int32); localVarOk { - localVarQueryParams.Add("limit", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["skip"].(int32); localVarOk { - localVarQueryParams.Add("skip", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["filter"].([]string); localVarOk { - localVarQueryParams.Add("filter", parameterToString(localVarTempParam, "csv")) - } - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* Office365ApiService Deletes a Office 365 translation rule - This endpoint allows you to delete a translation rule for a specific Office 365 instance. These rules specify how JumpCloud attributes translate to [Microsoft Graph](https://developer.microsoft.com/en-us/graph) attributes. #### Sample Request ``` curl -X DELETE https://console.jumpcloud.com/api/v2/office365s/{office365_id}/translationrules/{id} \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - * @param ctx context.Context for authentication, logging, tracing, etc. - @param office365Id - @param id - @param contentType - @param accept - @return */ -func (a *Office365ApiService) TranslationRulesOffice365Delete(ctx context.Context, office365Id string, id string, contentType string, accept string) ( *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Delete") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/office365s/{office365_id}/translationrules/{id}" - localVarPath = strings.Replace(localVarPath, "{"+"office365_id"+"}", fmt.Sprintf("%v", office365Id), -1) - localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - return localVarHttpResponse, err -} - -/* Office365ApiService Gets a specific Office 365 translation rule - This endpoint returns a specific translation rule for a specific Office 365 instance. These rules specify how JumpCloud attributes translate to [Microsoft Graph](https://developer.microsoft.com/en-us/graph) attributes. ###### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/office365s/{office365_id}/translationrules/{id} \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - * @param ctx context.Context for authentication, logging, tracing, etc. - @param office365Id - @param id - @param contentType - @param accept - @return Office365TranslationRule*/ -func (a *Office365ApiService) TranslationRulesOffice365Get(ctx context.Context, office365Id string, id string, contentType string, accept string) (Office365TranslationRule, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload Office365TranslationRule - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/office365s/{office365_id}/translationrules/{id}" - localVarPath = strings.Replace(localVarPath, "{"+"office365_id"+"}", fmt.Sprintf("%v", office365Id), -1) - localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* Office365ApiService List all the Office 365 Translation Rules - This endpoint returns all translation rules for a specific Office 365 instance. These rules specify how JumpCloud attributes translate to [Microsoft Graph](https://developer.microsoft.com/en-us/graph) attributes. ##### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/office365s/{office365_id}/translationrules \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - * @param ctx context.Context for authentication, logging, tracing, etc. - @param office365Id - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "fields" ([]string) The comma separated fields included in the returned records. If omitted, the default list of fields will be returned. - @param "filter" ([]string) Supported operators are: eq, ne, gt, ge, lt, le, between, search, in - @param "limit" (int32) The number of records to return at once. Limited to 100. - @param "skip" (int32) The offset into the records to return. - @param "sort" ([]string) The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. - @return []Office365TranslationRule*/ -func (a *Office365ApiService) TranslationRulesOffice365List(ctx context.Context, office365Id string, contentType string, accept string, localVarOptionals map[string]interface{}) ([]Office365TranslationRule, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload []Office365TranslationRule - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/office365s/{office365_id}/translationrules" - localVarPath = strings.Replace(localVarPath, "{"+"office365_id"+"}", fmt.Sprintf("%v", office365Id), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["limit"], "int32", "limit"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["skip"], "int32", "skip"); err != nil { - return successPayload, nil, err - } - - if localVarTempParam, localVarOk := localVarOptionals["fields"].([]string); localVarOk { - localVarQueryParams.Add("fields", parameterToString(localVarTempParam, "csv")) - } - if localVarTempParam, localVarOk := localVarOptionals["filter"].([]string); localVarOk { - localVarQueryParams.Add("filter", parameterToString(localVarTempParam, "csv")) - } - if localVarTempParam, localVarOk := localVarOptionals["limit"].(int32); localVarOk { - localVarQueryParams.Add("limit", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["skip"].(int32); localVarOk { - localVarQueryParams.Add("skip", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["sort"].([]string); localVarOk { - localVarQueryParams.Add("sort", parameterToString(localVarTempParam, "csv")) - } - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* Office365ApiService Create a new Office 365 Translation Rule - This endpoint allows you to create a translation rule for a specific Office 365 instance. These rules specify how JumpCloud attributes translate to [Microsoft Graph](https://developer.microsoft.com/en-us/graph) attributes. ##### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/office365s/{office365_id}/translationrules \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ {Translation Rule Parameters} }' ``` - * @param ctx context.Context for authentication, logging, tracing, etc. - @param office365Id - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "body" (Office365TranslationRuleRequest) - @return Office365TranslationRule*/ -func (a *Office365ApiService) TranslationRulesOffice365Post(ctx context.Context, office365Id string, contentType string, accept string, localVarOptionals map[string]interface{}) (Office365TranslationRule, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Post") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload Office365TranslationRule - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/office365s/{office365_id}/translationrules" - localVarPath = strings.Replace(localVarPath, "{"+"office365_id"+"}", fmt.Sprintf("%v", office365Id), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - // body params - if localVarTempParam, localVarOk := localVarOptionals["body"].(Office365TranslationRuleRequest); localVarOk { - localVarPostBody = &localVarTempParam - } - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - diff --git a/v2/office365_builtin_translation.go b/v2/office365_builtin_translation.go deleted file mode 100644 index 8a6162a..0000000 --- a/v2/office365_builtin_translation.go +++ /dev/null @@ -1,26 +0,0 @@ -/* - * JumpCloud APIs - * - * JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. - * - * API version: 2.0 - * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) - */ - -package v2 -// Office365BuiltinTranslation : Built-in translations for Office 365 (Microsoft Graph) export: * `user_street_address` - Translate `streetAddress` field of JumpCloud user address of type `work` to `city` field of Microsoft Graph user * `user_city` - Translate `locality` field of JumpCloud user address of type `work` to `city` field of Microsoft Graph user * `user_state` - Translate `region` field of JumpCloud user address of type `work` to `state` field of Microsoft Graph `user` * `user_country` - Translate `country` field of JumpCloud user address of type `work` to `country` field of Microsoft Graph `user` * `user_postal_code` - Translate `postalCode` field of JumpCloud user address of type `work` to `postalCode` field of Microsoft Graph `user` * `user_business_phones` - Translate `number` field of first JumpCloud user `phoneNumber` of type `work` to `businessPhones` field of Microsoft Graph `user` * `user_mobile_phone` - Translate `number` field of first JumpCloud user `phoneNumber` of type `mobile` to `mobilePhone` field of Microsoft Graph `user` * `user_department` - Translate `department` field of JumpCloud user to `department` field of Microsoft Graph `user` * `user_job_title` - Translate `jobTitle` field of JumpCloud user to `jobTitle` field of Microsoft Graph `user` * `user_office_location` - Translate `location` field of JumpCloud user to `officeLocation` field of Microsoft Graph `user` -type Office365BuiltinTranslation string - -// List of Office365BuiltinTranslation -const ( - STREET_ADDRESS Office365BuiltinTranslation = "user_street_address" - CITY Office365BuiltinTranslation = "user_city" - STATE Office365BuiltinTranslation = "user_state" - COUNTRY Office365BuiltinTranslation = "user_country" - POSTAL_CODE Office365BuiltinTranslation = "user_postal_code" - BUSINESS_PHONES Office365BuiltinTranslation = "user_business_phones" - MOBILE_PHONE Office365BuiltinTranslation = "user_mobile_phone" - DEPARTMENT Office365BuiltinTranslation = "user_department" - JOB_TITLE Office365BuiltinTranslation = "user_job_title" - OFFICE_LOCATION Office365BuiltinTranslation = "user_office_location" -) diff --git a/v2/office365_translation_rule.go b/v2/office365_translation_rule.go deleted file mode 100644 index c870541..0000000 --- a/v2/office365_translation_rule.go +++ /dev/null @@ -1,18 +0,0 @@ -/* - * JumpCloud APIs - * - * JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. - * - * API version: 2.0 - * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) - */ - -package v2 - -type Office365TranslationRule struct { - - BuiltIn *Office365BuiltinTranslation `json:"builtIn,omitempty"` - - // ObjectId uniquely identifying a Translation Rule. - Id string `json:"id,omitempty"` -} diff --git a/v2/office365_translation_rule_request.go b/v2/office365_translation_rule_request.go deleted file mode 100644 index 957e47d..0000000 --- a/v2/office365_translation_rule_request.go +++ /dev/null @@ -1,15 +0,0 @@ -/* - * JumpCloud APIs - * - * JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. - * - * API version: 2.0 - * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) - */ - -package v2 - -type Office365TranslationRuleRequest struct { - - BuiltIn *Office365BuiltinTranslation `json:"builtIn,omitempty"` -} diff --git a/v2/org_crypto_settings.go b/v2/org_crypto_settings.go deleted file mode 100644 index 3a83b50..0000000 --- a/v2/org_crypto_settings.go +++ /dev/null @@ -1,15 +0,0 @@ -/* - * JumpCloud APIs - * - * JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. - * - * API version: 2.0 - * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) - */ - -package v2 - -type OrgCryptoSettings struct { - - SshKeys *OrgcryptosettingsSshKeys `json:"sshKeys,omitempty"` -} diff --git a/v2/organizations_api.go b/v2/organizations_api.go deleted file mode 100644 index 6bc5bd3..0000000 --- a/v2/organizations_api.go +++ /dev/null @@ -1,262 +0,0 @@ -/* - * JumpCloud APIs - * - * JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. - * - * API version: 2.0 - * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) - */ - -package v2 - -import ( - "io/ioutil" - "net/url" - "net/http" - "strings" - "golang.org/x/net/context" - "encoding/json" - "fmt" -) - -// Linger please -var ( - _ context.Context -) - -type OrganizationsApiService service - - -/* OrganizationsApiService Get Crypto Settings - * @param ctx context.Context for authentication, logging, tracing, etc. - @param id - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "fields" ([]string) The comma separated fields included in the returned records. If omitted, the default list of fields will be returned. - @param "filter" ([]string) Supported operators are: eq, ne, gt, ge, lt, le, between, search, in - @param "xOrgId" (string) - @param "skip" (int32) The offset into the records to return. - @param "sort" ([]string) The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. - @param "limit" (int32) The number of records to return at once. Limited to 100. - @return OrgCryptoSettings*/ -func (a *OrganizationsApiService) OrgCryptoGet(ctx context.Context, id string, contentType string, accept string, localVarOptionals map[string]interface{}) (OrgCryptoSettings, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload OrgCryptoSettings - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/organizations/{id}/crypto" - localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["skip"], "int32", "skip"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["limit"], "int32", "limit"); err != nil { - return successPayload, nil, err - } - - if localVarTempParam, localVarOk := localVarOptionals["fields"].([]string); localVarOk { - localVarQueryParams.Add("fields", parameterToString(localVarTempParam, "csv")) - } - if localVarTempParam, localVarOk := localVarOptionals["filter"].([]string); localVarOk { - localVarQueryParams.Add("filter", parameterToString(localVarTempParam, "csv")) - } - if localVarTempParam, localVarOk := localVarOptionals["skip"].(int32); localVarOk { - localVarQueryParams.Add("skip", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["sort"].([]string); localVarOk { - localVarQueryParams.Add("sort", parameterToString(localVarTempParam, "csv")) - } - if localVarTempParam, localVarOk := localVarOptionals["limit"].(int32); localVarOk { - localVarQueryParams.Add("limit", parameterToString(localVarTempParam, "")) - } - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* OrganizationsApiService Edit Crypto Settings - * @param ctx context.Context for authentication, logging, tracing, etc. - @param id - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "body" (OrgCryptoSettings) - @param "fields" ([]string) The comma separated fields included in the returned records. If omitted, the default list of fields will be returned. - @param "filter" ([]string) Supported operators are: eq, ne, gt, ge, lt, le, between, search, in - @param "xOrgId" (string) - @param "skip" (int32) The offset into the records to return. - @param "sort" ([]string) The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. - @param "limit" (int32) The number of records to return at once. Limited to 100. - @return interface{}*/ -func (a *OrganizationsApiService) OrgCryptoPut(ctx context.Context, id string, contentType string, accept string, localVarOptionals map[string]interface{}) (interface{}, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Put") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload interface{} - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/organizations/{id}/crypto" - localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["skip"], "int32", "skip"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["limit"], "int32", "limit"); err != nil { - return successPayload, nil, err - } - - if localVarTempParam, localVarOk := localVarOptionals["fields"].([]string); localVarOk { - localVarQueryParams.Add("fields", parameterToString(localVarTempParam, "csv")) - } - if localVarTempParam, localVarOk := localVarOptionals["filter"].([]string); localVarOk { - localVarQueryParams.Add("filter", parameterToString(localVarTempParam, "csv")) - } - if localVarTempParam, localVarOk := localVarOptionals["skip"].(int32); localVarOk { - localVarQueryParams.Add("skip", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["sort"].([]string); localVarOk { - localVarQueryParams.Add("sort", parameterToString(localVarTempParam, "csv")) - } - if localVarTempParam, localVarOk := localVarOptionals["limit"].(int32); localVarOk { - localVarQueryParams.Add("limit", parameterToString(localVarTempParam, "")) - } - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - // body params - if localVarTempParam, localVarOk := localVarOptionals["body"].(OrgCryptoSettings); localVarOk { - localVarPostBody = &localVarTempParam - } - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - diff --git a/v2/orgcryptosettings_ssh_keys.go b/v2/orgcryptosettings_ssh_keys.go deleted file mode 100644 index cba334b..0000000 --- a/v2/orgcryptosettings_ssh_keys.go +++ /dev/null @@ -1,19 +0,0 @@ -/* - * JumpCloud APIs - * - * JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. - * - * API version: 2.0 - * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) - */ - -package v2 - -type OrgcryptosettingsSshKeys struct { - - KeySize int32 `json:"keySize,omitempty"` - - Validate bool `json:"validate,omitempty"` - - ValidateKeySize bool `json:"validateKeySize,omitempty"` -} diff --git a/v2/policies_api.go b/v2/policies_api.go deleted file mode 100644 index 103dbf3..0000000 --- a/v2/policies_api.go +++ /dev/null @@ -1,1652 +0,0 @@ -/* - * JumpCloud APIs - * - * JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. - * - * API version: 2.0 - * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) - */ - -package v2 - -import ( - "io/ioutil" - "net/url" - "net/http" - "strings" - "golang.org/x/net/context" - "encoding/json" - "fmt" -) - -// Linger please -var ( - _ context.Context -) - -type PoliciesApiService service - - -/* PoliciesApiService List the associations of a Policy - This endpoint returns the _direct_ associations of a Policy. A direct association can be a non-homogeneous relationship between 2 different objects, for example Policies and Systems. #### Sample Request ``` curl -X GET 'https://console.jumpcloud.com/api/v2/policies/{Policy_ID}/associations?targets=system_group \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - * @param ctx context.Context for authentication, logging, tracing, etc. - @param policyId ObjectID of the Policy. - @param targets - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "limit" (int32) The number of records to return at once. Limited to 100. - @param "skip" (int32) The offset into the records to return. - @param "xOrgId" (string) - @return []GraphConnection*/ -func (a *PoliciesApiService) GraphPolicyAssociationsList(ctx context.Context, policyId string, targets []string, contentType string, accept string, localVarOptionals map[string]interface{}) ([]GraphConnection, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload []GraphConnection - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/policies/{policy_id}/associations" - localVarPath = strings.Replace(localVarPath, "{"+"policy_id"+"}", fmt.Sprintf("%v", policyId), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["limit"], "int32", "limit"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["skip"], "int32", "skip"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return successPayload, nil, err - } - - localVarQueryParams.Add("targets", parameterToString(targets, "csv")) - if localVarTempParam, localVarOk := localVarOptionals["limit"].(int32); localVarOk { - localVarQueryParams.Add("limit", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["skip"].(int32); localVarOk { - localVarQueryParams.Add("skip", parameterToString(localVarTempParam, "")) - } - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* PoliciesApiService Manage the associations of a Policy - This endpoint allows you to manage the _direct_ associations of a Policy. A direct association can be a non-homogeneous relationship between 2 different objects, for example Policies and Systems. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/policies/{Policy_ID}/associations/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"op\": \"add\", \"type\": \"system_group\", \"id\": \"{Group_ID}\" }' ``` - * @param ctx context.Context for authentication, logging, tracing, etc. - @param policyId ObjectID of the Policy. - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "body" (GraphManagementReq) - @param "xOrgId" (string) - @return */ -func (a *PoliciesApiService) GraphPolicyAssociationsPost(ctx context.Context, policyId string, contentType string, accept string, localVarOptionals map[string]interface{}) ( *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Post") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/policies/{policy_id}/associations" - localVarPath = strings.Replace(localVarPath, "{"+"policy_id"+"}", fmt.Sprintf("%v", policyId), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return nil, err - } - - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - // body params - if localVarTempParam, localVarOk := localVarOptionals["body"].(GraphManagementReq); localVarOk { - localVarPostBody = &localVarTempParam - } - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - return localVarHttpResponse, err -} - -/* PoliciesApiService List the Systems bound to a Policy - This endpoint will return all Systems bound to a Policy, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this Policy to the corresponding System; this array represents all grouping and/or associations that would have to be removed to deprovision the System from this Policy. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/policies/{Policy_ID}/systems \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - * @param ctx context.Context for authentication, logging, tracing, etc. - @param policyId ObjectID of the Command. - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "limit" (int32) The number of records to return at once. Limited to 100. - @param "xOrgId" (string) - @param "skip" (int32) The offset into the records to return. - @param "filter" ([]string) Supported operators are: eq, ne, gt, ge, lt, le, between, search, in - @return []GraphObjectWithPaths*/ -func (a *PoliciesApiService) GraphPolicyTraverseSystem(ctx context.Context, policyId string, contentType string, accept string, localVarOptionals map[string]interface{}) ([]GraphObjectWithPaths, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload []GraphObjectWithPaths - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/policies/{policy_id}/systems" - localVarPath = strings.Replace(localVarPath, "{"+"policy_id"+"}", fmt.Sprintf("%v", policyId), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["limit"], "int32", "limit"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["skip"], "int32", "skip"); err != nil { - return successPayload, nil, err - } - - if localVarTempParam, localVarOk := localVarOptionals["limit"].(int32); localVarOk { - localVarQueryParams.Add("limit", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["skip"].(int32); localVarOk { - localVarQueryParams.Add("skip", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["filter"].([]string); localVarOk { - localVarQueryParams.Add("filter", parameterToString(localVarTempParam, "csv")) - } - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* PoliciesApiService List the System Groups bound to a Policy - This endpoint will return all Systems Groups bound to a Policy, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the group's type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this Policy to the corresponding System Group; this array represents all grouping and/or associations that would have to be removed to deprovision the System Group from this Policy. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/policies/{Policy_ID}/systemgroups \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - * @param ctx context.Context for authentication, logging, tracing, etc. - @param policyId ObjectID of the Command. - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "limit" (int32) The number of records to return at once. Limited to 100. - @param "xOrgId" (string) - @param "skip" (int32) The offset into the records to return. - @param "filter" ([]string) Supported operators are: eq, ne, gt, ge, lt, le, between, search, in - @return []GraphObjectWithPaths*/ -func (a *PoliciesApiService) GraphPolicyTraverseSystemGroup(ctx context.Context, policyId string, contentType string, accept string, localVarOptionals map[string]interface{}) ([]GraphObjectWithPaths, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload []GraphObjectWithPaths - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/policies/{policy_id}/systemgroups" - localVarPath = strings.Replace(localVarPath, "{"+"policy_id"+"}", fmt.Sprintf("%v", policyId), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["limit"], "int32", "limit"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["skip"], "int32", "skip"); err != nil { - return successPayload, nil, err - } - - if localVarTempParam, localVarOk := localVarOptionals["limit"].(int32); localVarOk { - localVarQueryParams.Add("limit", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["skip"].(int32); localVarOk { - localVarQueryParams.Add("skip", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["filter"].([]string); localVarOk { - localVarQueryParams.Add("filter", parameterToString(localVarTempParam, "csv")) - } - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* PoliciesApiService Deletes a Policy - This endpoint allows you to delete a policy. #### Sample Request ``` curl -X DELETE https://console.jumpcloud.com/api/v2/policies/5a837ecd232e110d4291e6b9 \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - * @param ctx context.Context for authentication, logging, tracing, etc. - @param id ObjectID of the Policy object. - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "xOrgId" (string) - @return */ -func (a *PoliciesApiService) PoliciesDelete(ctx context.Context, id string, contentType string, accept string, localVarOptionals map[string]interface{}) ( *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Delete") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/policies/{id}" - localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return nil, err - } - - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - return localVarHttpResponse, err -} - -/* PoliciesApiService Gets a specific Policy. - This endpoint returns a specific policy. ###### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/policies/{PolicyID} \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - * @param ctx context.Context for authentication, logging, tracing, etc. - @param id ObjectID of the Policy object. - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "xOrgId" (string) - @return PolicyWithDetails*/ -func (a *PoliciesApiService) PoliciesGet(ctx context.Context, id string, contentType string, accept string, localVarOptionals map[string]interface{}) (PolicyWithDetails, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload PolicyWithDetails - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/policies/{id}" - localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return successPayload, nil, err - } - - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* PoliciesApiService Lists all the Policies - This endpoint returns all policies. ##### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/policies \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - * @param ctx context.Context for authentication, logging, tracing, etc. - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "fields" ([]string) The comma separated fields included in the returned records. If omitted, the default list of fields will be returned. - @param "filter" ([]string) Supported operators are: eq, ne, gt, ge, lt, le, between, search, in - @param "limit" (int32) The number of records to return at once. Limited to 100. - @param "skip" (int32) The offset into the records to return. - @param "sort" ([]string) The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. - @param "xOrgId" (string) - @return []Policy*/ -func (a *PoliciesApiService) PoliciesList(ctx context.Context, contentType string, accept string, localVarOptionals map[string]interface{}) ([]Policy, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload []Policy - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/policies" - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["limit"], "int32", "limit"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["skip"], "int32", "skip"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return successPayload, nil, err - } - - if localVarTempParam, localVarOk := localVarOptionals["fields"].([]string); localVarOk { - localVarQueryParams.Add("fields", parameterToString(localVarTempParam, "csv")) - } - if localVarTempParam, localVarOk := localVarOptionals["filter"].([]string); localVarOk { - localVarQueryParams.Add("filter", parameterToString(localVarTempParam, "csv")) - } - if localVarTempParam, localVarOk := localVarOptionals["limit"].(int32); localVarOk { - localVarQueryParams.Add("limit", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["skip"].(int32); localVarOk { - localVarQueryParams.Add("skip", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["sort"].([]string); localVarOk { - localVarQueryParams.Add("sort", parameterToString(localVarTempParam, "csv")) - } - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* PoliciesApiService Create a new Policy - This endpoint allows you to create a policy. Given the amount of configurable parameters required to create a Policy, we suggest you use the JumpCloud Admin Console to create new policies. ##### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/policies \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ {Policy_Parameters} }' ``` - * @param ctx context.Context for authentication, logging, tracing, etc. - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "body" (PolicyRequest) - @param "xOrgId" (string) - @return PolicyWithDetails*/ -func (a *PoliciesApiService) PoliciesPost(ctx context.Context, contentType string, accept string, localVarOptionals map[string]interface{}) (PolicyWithDetails, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Post") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload PolicyWithDetails - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/policies" - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return successPayload, nil, err - } - - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - // body params - if localVarTempParam, localVarOk := localVarOptionals["body"].(PolicyRequest); localVarOk { - localVarPostBody = &localVarTempParam - } - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* PoliciesApiService Update an existing Policy - This endpoint allows you to update a policy. Given the amount of configurable parameters required to update a Policy, we suggest you use the JumpCloud Admin Console to create new policies. ##### Sample Request ``` curl -X PUT https://console.jumpcloud.com/api/v2/policies/59fced45c9118022172547ff \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY' \\ -d '{ {Policy_Parameters} }' ``` - * @param ctx context.Context for authentication, logging, tracing, etc. - @param id ObjectID of the Policy object. - @param optional (nil or map[string]interface{}) with one or more of: - @param "body" (PolicyRequest) - @param "xOrgId" (string) - @return Policy*/ -func (a *PoliciesApiService) PoliciesPut(ctx context.Context, id string, localVarOptionals map[string]interface{}) (Policy, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Put") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload Policy - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/policies/{id}" - localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return successPayload, nil, err - } - - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - // body params - if localVarTempParam, localVarOk := localVarOptionals["body"].(PolicyRequest); localVarOk { - localVarPostBody = &localVarTempParam - } - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* PoliciesApiService Get a specific Policy Result. - This endpoint will return the policy results for a specific policy. ##### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/policyresults/{Policy_ID} \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - * @param ctx context.Context for authentication, logging, tracing, etc. - @param id ObjectID of the Policy Result. - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "xOrgId" (string) - @return PolicyResult*/ -func (a *PoliciesApiService) PolicyresultsGet(ctx context.Context, id string, contentType string, accept string, localVarOptionals map[string]interface{}) (PolicyResult, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload PolicyResult - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/policyresults/{id}" - localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return successPayload, nil, err - } - - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* PoliciesApiService Lists all the policy results of a policy. - This endpoint returns all policies results for a specific policy. ##### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/policies/{Policy_ID}/policyresults \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - * @param ctx context.Context for authentication, logging, tracing, etc. - @param policyId - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "fields" ([]string) The comma separated fields included in the returned records. If omitted, the default list of fields will be returned. - @param "filter" ([]string) Supported operators are: eq, ne, gt, ge, lt, le, between, search, in - @param "limit" (int32) The number of records to return at once. Limited to 100. - @param "xOrgId" (string) - @param "skip" (int32) The offset into the records to return. - @param "sort" ([]string) The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. - @return []PolicyResult*/ -func (a *PoliciesApiService) PolicyresultsList(ctx context.Context, policyId string, contentType string, accept string, localVarOptionals map[string]interface{}) ([]PolicyResult, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload []PolicyResult - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/policies/{policy_id}/policyresults" - localVarPath = strings.Replace(localVarPath, "{"+"policy_id"+"}", fmt.Sprintf("%v", policyId), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["limit"], "int32", "limit"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["skip"], "int32", "skip"); err != nil { - return successPayload, nil, err - } - - if localVarTempParam, localVarOk := localVarOptionals["fields"].([]string); localVarOk { - localVarQueryParams.Add("fields", parameterToString(localVarTempParam, "csv")) - } - if localVarTempParam, localVarOk := localVarOptionals["filter"].([]string); localVarOk { - localVarQueryParams.Add("filter", parameterToString(localVarTempParam, "csv")) - } - if localVarTempParam, localVarOk := localVarOptionals["limit"].(int32); localVarOk { - localVarQueryParams.Add("limit", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["skip"].(int32); localVarOk { - localVarQueryParams.Add("skip", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["sort"].([]string); localVarOk { - localVarQueryParams.Add("sort", parameterToString(localVarTempParam, "csv")) - } - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* PoliciesApiService Lists all the policy results for an organization. - This endpoint returns all policies results for an organization. ##### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/policyresults \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - * @param ctx context.Context for authentication, logging, tracing, etc. - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "fields" ([]string) The comma separated fields included in the returned records. If omitted, the default list of fields will be returned. - @param "filter" ([]string) Supported operators are: eq, ne, gt, ge, lt, le, between, search, in - @param "limit" (int32) The number of records to return at once. Limited to 100. - @param "xOrgId" (string) - @param "skip" (int32) The offset into the records to return. - @param "sort" ([]string) The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. - @return []PolicyResult*/ -func (a *PoliciesApiService) PolicyresultsOrgList(ctx context.Context, contentType string, accept string, localVarOptionals map[string]interface{}) ([]PolicyResult, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload []PolicyResult - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/policyresults" - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["limit"], "int32", "limit"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["skip"], "int32", "skip"); err != nil { - return successPayload, nil, err - } - - if localVarTempParam, localVarOk := localVarOptionals["fields"].([]string); localVarOk { - localVarQueryParams.Add("fields", parameterToString(localVarTempParam, "csv")) - } - if localVarTempParam, localVarOk := localVarOptionals["filter"].([]string); localVarOk { - localVarQueryParams.Add("filter", parameterToString(localVarTempParam, "csv")) - } - if localVarTempParam, localVarOk := localVarOptionals["limit"].(int32); localVarOk { - localVarQueryParams.Add("limit", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["skip"].(int32); localVarOk { - localVarQueryParams.Add("skip", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["sort"].([]string); localVarOk { - localVarQueryParams.Add("sort", parameterToString(localVarTempParam, "csv")) - } - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* PoliciesApiService Lists the latest policy results of a policy. - This endpoint returns the latest policies results for a specific policy. ##### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/policies/{Policy_ID}/policystatuses \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - * @param ctx context.Context for authentication, logging, tracing, etc. - @param policyId - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "fields" ([]string) The comma separated fields included in the returned records. If omitted, the default list of fields will be returned. - @param "filter" ([]string) Supported operators are: eq, ne, gt, ge, lt, le, between, search, in - @param "limit" (int32) The number of records to return at once. Limited to 100. - @param "skip" (int32) The offset into the records to return. - @param "sort" ([]string) The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. - @param "xOrgId" (string) - @return []PolicyResult*/ -func (a *PoliciesApiService) PolicystatusesList(ctx context.Context, policyId string, contentType string, accept string, localVarOptionals map[string]interface{}) ([]PolicyResult, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload []PolicyResult - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/policies/{policy_id}/policystatuses" - localVarPath = strings.Replace(localVarPath, "{"+"policy_id"+"}", fmt.Sprintf("%v", policyId), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["limit"], "int32", "limit"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["skip"], "int32", "skip"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return successPayload, nil, err - } - - if localVarTempParam, localVarOk := localVarOptionals["fields"].([]string); localVarOk { - localVarQueryParams.Add("fields", parameterToString(localVarTempParam, "csv")) - } - if localVarTempParam, localVarOk := localVarOptionals["filter"].([]string); localVarOk { - localVarQueryParams.Add("filter", parameterToString(localVarTempParam, "csv")) - } - if localVarTempParam, localVarOk := localVarOptionals["limit"].(int32); localVarOk { - localVarQueryParams.Add("limit", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["skip"].(int32); localVarOk { - localVarQueryParams.Add("skip", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["sort"].([]string); localVarOk { - localVarQueryParams.Add("sort", parameterToString(localVarTempParam, "csv")) - } - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* PoliciesApiService List the policy statuses for a system - This endpoint returns the policy results for a particular system. ##### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/systems/{System_ID}/policystatuses \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - * @param ctx context.Context for authentication, logging, tracing, etc. - @param systemId ObjectID of the System. - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "fields" ([]string) The comma separated fields included in the returned records. If omitted, the default list of fields will be returned. - @param "filter" ([]string) Supported operators are: eq, ne, gt, ge, lt, le, between, search, in - @param "limit" (int32) The number of records to return at once. Limited to 100. - @param "skip" (int32) The offset into the records to return. - @param "sort" ([]string) The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. - @param "xOrgId" (string) - @return []PolicyResult*/ -func (a *PoliciesApiService) PolicystatusesList_1(ctx context.Context, systemId string, contentType string, accept string, localVarOptionals map[string]interface{}) ([]PolicyResult, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload []PolicyResult - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/systems/{system_id}/policystatuses" - localVarPath = strings.Replace(localVarPath, "{"+"system_id"+"}", fmt.Sprintf("%v", systemId), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["limit"], "int32", "limit"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["skip"], "int32", "skip"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return successPayload, nil, err - } - - if localVarTempParam, localVarOk := localVarOptionals["fields"].([]string); localVarOk { - localVarQueryParams.Add("fields", parameterToString(localVarTempParam, "csv")) - } - if localVarTempParam, localVarOk := localVarOptionals["filter"].([]string); localVarOk { - localVarQueryParams.Add("filter", parameterToString(localVarTempParam, "csv")) - } - if localVarTempParam, localVarOk := localVarOptionals["limit"].(int32); localVarOk { - localVarQueryParams.Add("limit", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["skip"].(int32); localVarOk { - localVarQueryParams.Add("skip", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["sort"].([]string); localVarOk { - localVarQueryParams.Add("sort", parameterToString(localVarTempParam, "csv")) - } - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* PoliciesApiService Get a specific Policy Template - This endpoint returns a specific policy template. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/policies/{Policy_ID}\\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - * @param ctx context.Context for authentication, logging, tracing, etc. - @param id ObjectID of the Policy Template. - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "xOrgId" (string) - @return PolicyTemplateWithDetails*/ -func (a *PoliciesApiService) PolicytemplatesGet(ctx context.Context, id string, contentType string, accept string, localVarOptionals map[string]interface{}) (PolicyTemplateWithDetails, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload PolicyTemplateWithDetails - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/policytemplates/{id}" - localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return successPayload, nil, err - } - - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* PoliciesApiService Lists all of the Policy Templates - This endpoint returns all policy templates. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/policytemplates \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - * @param ctx context.Context for authentication, logging, tracing, etc. - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "fields" ([]string) The comma separated fields included in the returned records. If omitted, the default list of fields will be returned. - @param "filter" ([]string) Supported operators are: eq, ne, gt, ge, lt, le, between, search, in - @param "limit" (int32) The number of records to return at once. Limited to 100. - @param "skip" (int32) The offset into the records to return. - @param "sort" ([]string) The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. - @param "xOrgId" (string) - @return []PolicyTemplate*/ -func (a *PoliciesApiService) PolicytemplatesList(ctx context.Context, contentType string, accept string, localVarOptionals map[string]interface{}) ([]PolicyTemplate, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload []PolicyTemplate - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/policytemplates" - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["limit"], "int32", "limit"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["skip"], "int32", "skip"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return successPayload, nil, err - } - - if localVarTempParam, localVarOk := localVarOptionals["fields"].([]string); localVarOk { - localVarQueryParams.Add("fields", parameterToString(localVarTempParam, "csv")) - } - if localVarTempParam, localVarOk := localVarOptionals["filter"].([]string); localVarOk { - localVarQueryParams.Add("filter", parameterToString(localVarTempParam, "csv")) - } - if localVarTempParam, localVarOk := localVarOptionals["limit"].(int32); localVarOk { - localVarQueryParams.Add("limit", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["skip"].(int32); localVarOk { - localVarQueryParams.Add("skip", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["sort"].([]string); localVarOk { - localVarQueryParams.Add("sort", parameterToString(localVarTempParam, "csv")) - } - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - diff --git a/v2/policy.go b/v2/policy.go deleted file mode 100644 index 83a3a3a..0000000 --- a/v2/policy.go +++ /dev/null @@ -1,22 +0,0 @@ -/* - * JumpCloud APIs - * - * JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. - * - * API version: 2.0 - * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) - */ - -package v2 - -// An instance of a policy template. -type Policy struct { - - // ObjectId uniquely identifying a Policy. - Id string `json:"id,omitempty"` - - // The description for this specific Policy. - Name string `json:"name,omitempty"` - - Template *PolicyTemplate `json:"template,omitempty"` -} diff --git a/v2/policy_request.go b/v2/policy_request.go deleted file mode 100644 index b63095e..0000000 --- a/v2/policy_request.go +++ /dev/null @@ -1,21 +0,0 @@ -/* - * JumpCloud APIs - * - * JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. - * - * API version: 2.0 - * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) - */ - -package v2 - -// An instance of a policy template. -type PolicyRequest struct { - - // The description for this specific Policy. - Name string `json:"name"` - - Template *PolicyRequestTemplate `json:"template,omitempty"` - - Values []PolicyValue `json:"values,omitempty"` -} diff --git a/v2/policy_request_template.go b/v2/policy_request_template.go deleted file mode 100644 index 682bd3c..0000000 --- a/v2/policy_request_template.go +++ /dev/null @@ -1,16 +0,0 @@ -/* - * JumpCloud APIs - * - * JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. - * - * API version: 2.0 - * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) - */ - -package v2 - -type PolicyRequestTemplate struct { - - // ObjectId uniquely identifying a Policy instance; only allowed on POST requests. - Id string `json:"id,omitempty"` -} diff --git a/v2/policy_result.go b/v2/policy_result.go deleted file mode 100644 index 858b221..0000000 --- a/v2/policy_result.go +++ /dev/null @@ -1,50 +0,0 @@ -/* - * JumpCloud APIs - * - * JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. - * - * API version: 2.0 - * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) - */ - -package v2 - -import ( - "time" -) - -type PolicyResult struct { - - // Details pertaining to the policy result. - Detail string `json:"detail,omitempty"` - - // The end of the policy application. - EndedAt time.Time `json:"endedAt,omitempty"` - - // The 32-bit unsigned exit status from the applying the policy. - ExitStatus int32 `json:"exitStatus,omitempty"` - - // ObjectId uniquely identifying a Policy Result. - Id string `json:"id,omitempty"` - - // ObjectId uniquely identifying the parent Policy. - PolicyID string `json:"policyID,omitempty"` - - // The start of the policy application. - StartedAt time.Time `json:"startedAt,omitempty"` - - // Enumeration describing the state of the policy. Success, failed, or pending. - State string `json:"state,omitempty"` - - // The STDERR output from applying the policy. - StdErr string `json:"stdErr,omitempty"` - - // The STDOUT output from applying the policy. - StdOut string `json:"stdOut,omitempty"` - - // True if the policy was successfully applied; false otherwise. - Success bool `json:"success,omitempty"` - - // ObjectId uniquely identifying the parent System. - SystemID string `json:"systemID,omitempty"` -} diff --git a/v2/policy_template.go b/v2/policy_template.go deleted file mode 100644 index 94425d1..0000000 --- a/v2/policy_template.go +++ /dev/null @@ -1,37 +0,0 @@ -/* - * JumpCloud APIs - * - * JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. - * - * API version: 2.0 - * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) - */ - -package v2 - -// The shallow information about a Policy Template. -type PolicyTemplate struct { - - // Requirements before the policy can be activated. - Activation string `json:"activation,omitempty"` - - // Specifics about the behavior of the policy. - Behavior string `json:"behavior,omitempty"` - - // The default description for the Policy. - Description string `json:"description,omitempty"` - - // The default display name for the Policy. - DisplayName string `json:"displayName,omitempty"` - - // ObjectId uniquely identifying a Policy Template. - Id string `json:"id,omitempty"` - - // The unique name for the Policy Template. - Name string `json:"name,omitempty"` - - OsMetaFamily string `json:"osMetaFamily,omitempty"` - - // String describing the release status of the policy template. - State string `json:"state,omitempty"` -} diff --git a/v2/policy_template_config_field.go b/v2/policy_template_config_field.go deleted file mode 100644 index 40c4187..0000000 --- a/v2/policy_template_config_field.go +++ /dev/null @@ -1,36 +0,0 @@ -/* - * JumpCloud APIs - * - * JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. - * - * API version: 2.0 - * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) - */ - -package v2 - -type PolicyTemplateConfigField struct { - - // The default rendering for this field. - DisplayType string `json:"displayType,omitempty"` - - // ObjectId uniquely identifying a Policy Template Configuration Field - Id string `json:"id"` - - // The default label for this field. - Label string `json:"label,omitempty"` - - // A unique name identifying this config field. - Name string `json:"name"` - - // The default position to render this field. - Position float32 `json:"position,omitempty"` - - // If an admin is allowed to modify this field. - ReadOnly bool `json:"readOnly,omitempty"` - - // If this field is required for this field. - Required bool `json:"required,omitempty"` - - Tooltip *PolicyTemplateConfigFieldTooltip `json:"tooltip,omitempty"` -} diff --git a/v2/policy_template_config_field_tooltip.go b/v2/policy_template_config_field_tooltip.go deleted file mode 100644 index 99d5054..0000000 --- a/v2/policy_template_config_field_tooltip.go +++ /dev/null @@ -1,17 +0,0 @@ -/* - * JumpCloud APIs - * - * JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. - * - * API version: 2.0 - * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) - */ - -package v2 - -type PolicyTemplateConfigFieldTooltip struct { - - Template string `json:"template,omitempty"` - - Variables *PolicyTemplateConfigFieldTooltipVariables `json:"variables,omitempty"` -} diff --git a/v2/policy_template_config_field_tooltip_variables.go b/v2/policy_template_config_field_tooltip_variables.go deleted file mode 100644 index 25836b1..0000000 --- a/v2/policy_template_config_field_tooltip_variables.go +++ /dev/null @@ -1,17 +0,0 @@ -/* - * JumpCloud APIs - * - * JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. - * - * API version: 2.0 - * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) - */ - -package v2 - -type PolicyTemplateConfigFieldTooltipVariables struct { - - Icon string `json:"icon,omitempty"` - - Message string `json:"message,omitempty"` -} diff --git a/v2/policy_template_with_details.go b/v2/policy_template_with_details.go deleted file mode 100644 index a490a74..0000000 --- a/v2/policy_template_with_details.go +++ /dev/null @@ -1,37 +0,0 @@ -/* - * JumpCloud APIs - * - * JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. - * - * API version: 2.0 - * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) - */ - -package v2 - -// The shallow information about a Policy Template. -type PolicyTemplateWithDetails struct { - - // Requirements before the policy can be activated. - Activation string `json:"activation,omitempty"` - - // Specifics about the behavior of the policy. - Behavior string `json:"behavior,omitempty"` - - // An unordered list of all the fields that can be configured for this Policy Template. - ConfigFields []PolicyTemplateConfigField `json:"configFields,omitempty"` - - // The default description for the Policy. - Description string `json:"description,omitempty"` - - // The default display name for the Policy. - DisplayName string `json:"displayName,omitempty"` - - // ObjectId uniquely identifying a Policy Template. - Id string `json:"id,omitempty"` - - // The unique name for the Policy Template. - Name string `json:"name,omitempty"` - - OsMetaFamily string `json:"osMetaFamily,omitempty"` -} diff --git a/v2/policy_value.go b/v2/policy_value.go deleted file mode 100644 index b05bd54..0000000 --- a/v2/policy_value.go +++ /dev/null @@ -1,16 +0,0 @@ -/* - * JumpCloud APIs - * - * JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. - * - * API version: 2.0 - * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) - */ - -package v2 - -type PolicyValue struct { - - // The ObjectId of the corresponding Policy Template configuration field. - ConfigFieldID string `json:"configFieldID,omitempty"` -} diff --git a/v2/policy_with_details.go b/v2/policy_with_details.go deleted file mode 100644 index 5e61923..0000000 --- a/v2/policy_with_details.go +++ /dev/null @@ -1,26 +0,0 @@ -/* - * JumpCloud APIs - * - * JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. - * - * API version: 2.0 - * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) - */ - -package v2 - -// An instance of a policy template. -type PolicyWithDetails struct { - - ConfigFields []PolicyTemplateConfigField `json:"configFields,omitempty"` - - // ObjectId uniquely identifying a Policy. - Id string `json:"id,omitempty"` - - // The description for this specific Policy. - Name string `json:"name,omitempty"` - - Template *PolicyTemplate `json:"template,omitempty"` - - Values []PolicyValue `json:"values,omitempty"` -} diff --git a/v2/policytemplates_api.go b/v2/policytemplates_api.go deleted file mode 100644 index c95f63e..0000000 --- a/v2/policytemplates_api.go +++ /dev/null @@ -1,231 +0,0 @@ -/* - * JumpCloud APIs - * - * JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. - * - * API version: 2.0 - * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) - */ - -package v2 - -import ( - "io/ioutil" - "net/url" - "net/http" - "strings" - "golang.org/x/net/context" - "encoding/json" - "fmt" -) - -// Linger please -var ( - _ context.Context -) - -type PolicytemplatesApiService service - - -/* PolicytemplatesApiService Get a specific Policy Template - This endpoint returns a specific policy template. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/policies/{Policy_ID}\\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - * @param ctx context.Context for authentication, logging, tracing, etc. - @param id ObjectID of the Policy Template. - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "xOrgId" (string) - @return PolicyTemplateWithDetails*/ -func (a *PolicytemplatesApiService) PolicytemplatesGet(ctx context.Context, id string, contentType string, accept string, localVarOptionals map[string]interface{}) (PolicyTemplateWithDetails, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload PolicyTemplateWithDetails - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/policytemplates/{id}" - localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return successPayload, nil, err - } - - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* PolicytemplatesApiService Lists all of the Policy Templates - This endpoint returns all policy templates. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/policytemplates \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - * @param ctx context.Context for authentication, logging, tracing, etc. - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "fields" ([]string) The comma separated fields included in the returned records. If omitted, the default list of fields will be returned. - @param "filter" ([]string) Supported operators are: eq, ne, gt, ge, lt, le, between, search, in - @param "limit" (int32) The number of records to return at once. Limited to 100. - @param "skip" (int32) The offset into the records to return. - @param "sort" ([]string) The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. - @param "xOrgId" (string) - @return []PolicyTemplate*/ -func (a *PolicytemplatesApiService) PolicytemplatesList(ctx context.Context, contentType string, accept string, localVarOptionals map[string]interface{}) ([]PolicyTemplate, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload []PolicyTemplate - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/policytemplates" - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["limit"], "int32", "limit"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["skip"], "int32", "skip"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return successPayload, nil, err - } - - if localVarTempParam, localVarOk := localVarOptionals["fields"].([]string); localVarOk { - localVarQueryParams.Add("fields", parameterToString(localVarTempParam, "csv")) - } - if localVarTempParam, localVarOk := localVarOptionals["filter"].([]string); localVarOk { - localVarQueryParams.Add("filter", parameterToString(localVarTempParam, "csv")) - } - if localVarTempParam, localVarOk := localVarOptionals["limit"].(int32); localVarOk { - localVarQueryParams.Add("limit", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["skip"].(int32); localVarOk { - localVarQueryParams.Add("skip", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["sort"].([]string); localVarOk { - localVarQueryParams.Add("sort", parameterToString(localVarTempParam, "csv")) - } - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - diff --git a/v2/provider.go b/v2/provider.go deleted file mode 100644 index a3950cc..0000000 --- a/v2/provider.go +++ /dev/null @@ -1,17 +0,0 @@ -/* - * JumpCloud APIs - * - * JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. - * - * API version: 2.0 - * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) - */ - -package v2 - -type Provider struct { - - Contact *ProviderContact `json:"contact,omitempty"` - - Name string `json:"name,omitempty"` -} diff --git a/v2/provider_admin_req.go b/v2/provider_admin_req.go deleted file mode 100644 index ef8257e..0000000 --- a/v2/provider_admin_req.go +++ /dev/null @@ -1,21 +0,0 @@ -/* - * JumpCloud APIs - * - * JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. - * - * API version: 2.0 - * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) - */ - -package v2 - -type ProviderAdminReq struct { - - Email string `json:"email"` - - EnableMultiFactor bool `json:"enableMultiFactor,omitempty"` - - Firstname string `json:"firstname,omitempty"` - - Lastname string `json:"lastname,omitempty"` -} diff --git a/v2/provider_contact.go b/v2/provider_contact.go deleted file mode 100644 index 4c07307..0000000 --- a/v2/provider_contact.go +++ /dev/null @@ -1,17 +0,0 @@ -/* - * JumpCloud APIs - * - * JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. - * - * API version: 2.0 - * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) - */ - -package v2 - -type ProviderContact struct { - - Email string `json:"email,omitempty"` - - Name string `json:"name,omitempty"` -} diff --git a/v2/providers_api.go b/v2/providers_api.go deleted file mode 100644 index 5483020..0000000 --- a/v2/providers_api.go +++ /dev/null @@ -1,224 +0,0 @@ -/* - * JumpCloud APIs - * - * JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. - * - * API version: 2.0 - * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) - */ - -package v2 - -import ( - "io/ioutil" - "net/url" - "net/http" - "strings" - "golang.org/x/net/context" - "encoding/json" - "fmt" -) - -// Linger please -var ( - _ context.Context -) - -type ProvidersApiService service - - -/* ProvidersApiService List Provider Administrators - This endpoint returns a list of the Administrators associated with the Provider. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/providers/{ProviderID}/administrators \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - * @param ctx context.Context for authentication, logging, tracing, etc. - @param providerId - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "fields" ([]string) The comma separated fields included in the returned records. If omitted, the default list of fields will be returned. - @param "filter" ([]string) Supported operators are: eq, ne, gt, ge, lt, le, between, search, in - @param "limit" (int32) The number of records to return at once. Limited to 100. - @param "skip" (int32) The offset into the records to return. - @param "sort" ([]string) The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. - @return InlineResponse2001*/ -func (a *ProvidersApiService) ProvidersListAdministrators(ctx context.Context, providerId string, contentType string, accept string, localVarOptionals map[string]interface{}) (InlineResponse2001, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload InlineResponse2001 - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/providers/{provider_id}/administrators" - localVarPath = strings.Replace(localVarPath, "{"+"provider_id"+"}", fmt.Sprintf("%v", providerId), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["limit"], "int32", "limit"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["skip"], "int32", "skip"); err != nil { - return successPayload, nil, err - } - - if localVarTempParam, localVarOk := localVarOptionals["fields"].([]string); localVarOk { - localVarQueryParams.Add("fields", parameterToString(localVarTempParam, "csv")) - } - if localVarTempParam, localVarOk := localVarOptionals["filter"].([]string); localVarOk { - localVarQueryParams.Add("filter", parameterToString(localVarTempParam, "csv")) - } - if localVarTempParam, localVarOk := localVarOptionals["limit"].(int32); localVarOk { - localVarQueryParams.Add("limit", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["skip"].(int32); localVarOk { - localVarQueryParams.Add("skip", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["sort"].([]string); localVarOk { - localVarQueryParams.Add("sort", parameterToString(localVarTempParam, "csv")) - } - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* ProvidersApiService Create a new Provider Administrator - This endpoint allows you to create a provider administrator. You must be associated to the provider to use this route. **Sample Request** ``` curl -X POST https://console.jumpcloud.com/api/v2/providers/{ProviderID}/administrators \\ -H 'Accept: application/json' \\ -H 'Context-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"email\":\"{ADMIN_EMAIL}\" }' ``` - * @param ctx context.Context for authentication, logging, tracing, etc. - @param providerId - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "body" (ProviderAdminReq) - @return Administrator*/ -func (a *ProvidersApiService) ProvidersPostAdmins(ctx context.Context, providerId string, contentType string, accept string, localVarOptionals map[string]interface{}) (Administrator, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Post") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload Administrator - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/providers/{provider_id}/administrators" - localVarPath = strings.Replace(localVarPath, "{"+"provider_id"+"}", fmt.Sprintf("%v", providerId), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - // body params - if localVarTempParam, localVarOk := localVarOptionals["body"].(ProviderAdminReq); localVarOk { - localVarPostBody = &localVarTempParam - } - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - diff --git a/v2/radius_servers_api.go b/v2/radius_servers_api.go deleted file mode 100644 index 762a255..0000000 --- a/v2/radius_servers_api.go +++ /dev/null @@ -1,436 +0,0 @@ -/* - * JumpCloud APIs - * - * JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. - * - * API version: 2.0 - * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) - */ - -package v2 - -import ( - "io/ioutil" - "net/url" - "net/http" - "strings" - "golang.org/x/net/context" - "encoding/json" - "fmt" -) - -// Linger please -var ( - _ context.Context -) - -type RADIUSServersApiService service - - -/* RADIUSServersApiService List the associations of a RADIUS Server - This endpoint returns the _direct_ associations of a Radius Server. A direct association can be a non-homogeneous relationship between 2 different objects, for example Radius Servers and Users. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/radiusservers/{RADIUS_ID}/associations?targets=user_group \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - * @param ctx context.Context for authentication, logging, tracing, etc. - @param radiusserverId ObjectID of the Radius Server. - @param targets - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "limit" (int32) The number of records to return at once. Limited to 100. - @param "skip" (int32) The offset into the records to return. - @param "xOrgId" (string) - @return []GraphConnection*/ -func (a *RADIUSServersApiService) GraphRadiusServerAssociationsList(ctx context.Context, radiusserverId string, targets []string, contentType string, accept string, localVarOptionals map[string]interface{}) ([]GraphConnection, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload []GraphConnection - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/radiusservers/{radiusserver_id}/associations" - localVarPath = strings.Replace(localVarPath, "{"+"radiusserver_id"+"}", fmt.Sprintf("%v", radiusserverId), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["limit"], "int32", "limit"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["skip"], "int32", "skip"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return successPayload, nil, err - } - - localVarQueryParams.Add("targets", parameterToString(targets, "csv")) - if localVarTempParam, localVarOk := localVarOptionals["limit"].(int32); localVarOk { - localVarQueryParams.Add("limit", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["skip"].(int32); localVarOk { - localVarQueryParams.Add("skip", parameterToString(localVarTempParam, "")) - } - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* RADIUSServersApiService Manage the associations of a RADIUS Server - This endpoint allows you to manage the _direct_ associations of a Radius Server. A direct association can be a non-homogeneous relationship between 2 different objects, for example Radius Servers and Users. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/radiusservers/{RADIUS_ID}/associations \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"type\":\"user\", \"id\":\"{USER_ID}\", \"op\":\"add\" }' ``` - * @param ctx context.Context for authentication, logging, tracing, etc. - @param radiusserverId ObjectID of the Radius Server. - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "body" (GraphManagementReq) - @param "xOrgId" (string) - @return */ -func (a *RADIUSServersApiService) GraphRadiusServerAssociationsPost(ctx context.Context, radiusserverId string, contentType string, accept string, localVarOptionals map[string]interface{}) ( *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Post") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/radiusservers/{radiusserver_id}/associations" - localVarPath = strings.Replace(localVarPath, "{"+"radiusserver_id"+"}", fmt.Sprintf("%v", radiusserverId), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return nil, err - } - - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - // body params - if localVarTempParam, localVarOk := localVarOptionals["body"].(GraphManagementReq); localVarOk { - localVarPostBody = &localVarTempParam - } - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - return localVarHttpResponse, err -} - -/* RADIUSServersApiService List the Users bound to a RADIUS Server - This endpoint will return all Users bound to a RADIUS Server, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this RADIUS server instance to the corresponding User; this array represents all grouping and/or associations that would have to be removed to deprovision the User from this RADIUS server instance. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/ldapservers/{LDAP_ID}/users \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - * @param ctx context.Context for authentication, logging, tracing, etc. - @param radiusserverId ObjectID of the Radius Server. - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "limit" (int32) The number of records to return at once. Limited to 100. - @param "xOrgId" (string) - @param "skip" (int32) The offset into the records to return. - @param "filter" ([]string) Supported operators are: eq, ne, gt, ge, lt, le, between, search, in - @return []GraphObjectWithPaths*/ -func (a *RADIUSServersApiService) GraphRadiusServerTraverseUser(ctx context.Context, radiusserverId string, contentType string, accept string, localVarOptionals map[string]interface{}) ([]GraphObjectWithPaths, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload []GraphObjectWithPaths - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/radiusservers/{radiusserver_id}/users" - localVarPath = strings.Replace(localVarPath, "{"+"radiusserver_id"+"}", fmt.Sprintf("%v", radiusserverId), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["limit"], "int32", "limit"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["skip"], "int32", "skip"); err != nil { - return successPayload, nil, err - } - - if localVarTempParam, localVarOk := localVarOptionals["limit"].(int32); localVarOk { - localVarQueryParams.Add("limit", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["skip"].(int32); localVarOk { - localVarQueryParams.Add("skip", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["filter"].([]string); localVarOk { - localVarQueryParams.Add("filter", parameterToString(localVarTempParam, "csv")) - } - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* RADIUSServersApiService List the User Groups bound to a RADIUS Server - This endpoint will return all Users Groups bound to a RADIUS Server, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the group's type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this RADIUS server instance to the corresponding User Group; this array represents all grouping and/or associations that would have to be removed to deprovision the User Group from this RADIUS server instance. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/radiusservers/{RADIUS_ID}/usergroups \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - * @param ctx context.Context for authentication, logging, tracing, etc. - @param radiusserverId ObjectID of the Radius Server. - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "limit" (int32) The number of records to return at once. Limited to 100. - @param "xOrgId" (string) - @param "skip" (int32) The offset into the records to return. - @param "filter" ([]string) Supported operators are: eq, ne, gt, ge, lt, le, between, search, in - @return []GraphObjectWithPaths*/ -func (a *RADIUSServersApiService) GraphRadiusServerTraverseUserGroup(ctx context.Context, radiusserverId string, contentType string, accept string, localVarOptionals map[string]interface{}) ([]GraphObjectWithPaths, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload []GraphObjectWithPaths - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/radiusservers/{radiusserver_id}/usergroups" - localVarPath = strings.Replace(localVarPath, "{"+"radiusserver_id"+"}", fmt.Sprintf("%v", radiusserverId), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["limit"], "int32", "limit"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["skip"], "int32", "skip"); err != nil { - return successPayload, nil, err - } - - if localVarTempParam, localVarOk := localVarOptionals["limit"].(int32); localVarOk { - localVarQueryParams.Add("limit", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["skip"].(int32); localVarOk { - localVarQueryParams.Add("skip", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["filter"].([]string); localVarOk { - localVarQueryParams.Add("filter", parameterToString(localVarTempParam, "csv")) - } - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - diff --git a/v2/salesforce_knowledge_list_output.go b/v2/salesforce_knowledge_list_output.go deleted file mode 100644 index cacff1a..0000000 --- a/v2/salesforce_knowledge_list_output.go +++ /dev/null @@ -1,13 +0,0 @@ -/* - * JumpCloud APIs - * - * JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. - * - * API version: 2.0 - * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) - */ - -package v2 - -type SalesforceKnowledgeListOutput struct { -} diff --git a/v2/salesforceknowledgelistoutput_inner.go b/v2/salesforceknowledgelistoutput_inner.go deleted file mode 100644 index 8d4bc9f..0000000 --- a/v2/salesforceknowledgelistoutput_inner.go +++ /dev/null @@ -1,15 +0,0 @@ -/* - * JumpCloud APIs - * - * JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. - * - * API version: 2.0 - * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) - */ - -package v2 - -type SalesforceknowledgelistoutputInner struct { - - Id string `json:"id,omitempty"` -} diff --git a/v2/samba_domain_input.go b/v2/samba_domain_input.go deleted file mode 100644 index 189973a..0000000 --- a/v2/samba_domain_input.go +++ /dev/null @@ -1,19 +0,0 @@ -/* - * JumpCloud APIs - * - * JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. - * - * API version: 2.0 - * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) - */ - -package v2 - -type SambaDomainInput struct { - - // Name of this domain's WorkGroup - Name string `json:"name"` - - // Security identifier of this domain - Sid string `json:"sid"` -} diff --git a/v2/samba_domain_output.go b/v2/samba_domain_output.go deleted file mode 100644 index a0376dc..0000000 --- a/v2/samba_domain_output.go +++ /dev/null @@ -1,22 +0,0 @@ -/* - * JumpCloud APIs - * - * JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. - * - * API version: 2.0 - * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) - */ - -package v2 - -type SambaDomainOutput struct { - - // Name of this domain's WorkGroup - Name string `json:"name"` - - // Security identifier of this domain - Sid string `json:"sid"` - - // Unique identifier of this domain - Id string `json:"id"` -} diff --git a/v2/samba_domains_api.go b/v2/samba_domains_api.go deleted file mode 100644 index cf1e6a2..0000000 --- a/v2/samba_domains_api.go +++ /dev/null @@ -1,566 +0,0 @@ -/* - * JumpCloud APIs - * - * JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. - * - * API version: 2.0 - * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) - */ - -package v2 - -import ( - "io/ioutil" - "net/url" - "net/http" - "strings" - "golang.org/x/net/context" - "encoding/json" - "fmt" -) - -// Linger please -var ( - _ context.Context -) - -type SambaDomainsApiService service - - -/* SambaDomainsApiService Delete Samba Domain - This endpoint allows you to delete a samba domain from an LDAP server. ##### Sample Request ``` curl -X DELETE https://console.jumpcloud.com/api/v2/ldapservers/{LDAP_ID}/sambadomains/{SAMBA_ID} \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - * @param ctx context.Context for authentication, logging, tracing, etc. - @param ldapserverId Unique identifier of the LDAP server. - @param id Unique identifier of the samba domain. - @param optional (nil or map[string]interface{}) with one or more of: - @param "contentType" (string) - @param "accept" (string) - @param "xOrgId" (string) - @return string*/ -func (a *SambaDomainsApiService) LdapserversSambaDomainsDelete(ctx context.Context, ldapserverId string, id string, localVarOptionals map[string]interface{}) (string, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Delete") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload string - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/ldapservers/{ldapserver_id}/sambadomains/{id}" - localVarPath = strings.Replace(localVarPath, "{"+"ldapserver_id"+"}", fmt.Sprintf("%v", ldapserverId), -1) - localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["contentType"], "string", "contentType"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["accept"], "string", "accept"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return successPayload, nil, err - } - - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - if localVarTempParam, localVarOk := localVarOptionals["contentType"].(string); localVarOk { - localVarHeaderParams["Content-Type"] = parameterToString(localVarTempParam, "") - } - if localVarTempParam, localVarOk := localVarOptionals["accept"].(string); localVarOk { - localVarHeaderParams["Accept"] = parameterToString(localVarTempParam, "") - } - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* SambaDomainsApiService Get Samba Domain - This endpoint returns a specific samba domain for an LDAP server. ##### Sample Request ``` curl -X GET \\ https://console.jumpcloud.com/api/v2/ldapservers/ldapservers/{LDAP_ID}/sambadomains/{SAMBA_ID} \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - * @param ctx context.Context for authentication, logging, tracing, etc. - @param ldapserverId Unique identifier of the LDAP server. - @param id Unique identifier of the samba domain. - @param optional (nil or map[string]interface{}) with one or more of: - @param "contentType" (string) - @param "accept" (string) - @param "xOrgId" (string) - @return SambaDomainOutput*/ -func (a *SambaDomainsApiService) LdapserversSambaDomainsGet(ctx context.Context, ldapserverId string, id string, localVarOptionals map[string]interface{}) (SambaDomainOutput, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload SambaDomainOutput - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/ldapservers/{ldapserver_id}/sambadomains/{id}" - localVarPath = strings.Replace(localVarPath, "{"+"ldapserver_id"+"}", fmt.Sprintf("%v", ldapserverId), -1) - localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["contentType"], "string", "contentType"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["accept"], "string", "accept"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return successPayload, nil, err - } - - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - if localVarTempParam, localVarOk := localVarOptionals["contentType"].(string); localVarOk { - localVarHeaderParams["Content-Type"] = parameterToString(localVarTempParam, "") - } - if localVarTempParam, localVarOk := localVarOptionals["accept"].(string); localVarOk { - localVarHeaderParams["Accept"] = parameterToString(localVarTempParam, "") - } - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* SambaDomainsApiService List Samba Domains - This endpoint returns all samba domains for an LDAP server. ##### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/ldapservers/{LDAP_ID}/sambadomains \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - * @param ctx context.Context for authentication, logging, tracing, etc. - @param ldapserverId Unique identifier of the LDAP server. - @param optional (nil or map[string]interface{}) with one or more of: - @param "contentType" (string) - @param "accept" (string) - @param "fields" ([]string) The comma separated fields included in the returned records. If omitted, the default list of fields will be returned. - @param "filter" ([]string) Supported operators are: eq, ne, gt, ge, lt, le, between, search, in - @param "limit" (int32) The number of records to return at once. Limited to 100. - @param "skip" (int32) The offset into the records to return. - @param "sort" ([]string) The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. - @param "xOrgId" (string) - @return []SambaDomainOutput*/ -func (a *SambaDomainsApiService) LdapserversSambaDomainsList(ctx context.Context, ldapserverId string, localVarOptionals map[string]interface{}) ([]SambaDomainOutput, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload []SambaDomainOutput - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/ldapservers/{ldapserver_id}/sambadomains" - localVarPath = strings.Replace(localVarPath, "{"+"ldapserver_id"+"}", fmt.Sprintf("%v", ldapserverId), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["contentType"], "string", "contentType"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["accept"], "string", "accept"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["limit"], "int32", "limit"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["skip"], "int32", "skip"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return successPayload, nil, err - } - - if localVarTempParam, localVarOk := localVarOptionals["fields"].([]string); localVarOk { - localVarQueryParams.Add("fields", parameterToString(localVarTempParam, "csv")) - } - if localVarTempParam, localVarOk := localVarOptionals["filter"].([]string); localVarOk { - localVarQueryParams.Add("filter", parameterToString(localVarTempParam, "csv")) - } - if localVarTempParam, localVarOk := localVarOptionals["limit"].(int32); localVarOk { - localVarQueryParams.Add("limit", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["skip"].(int32); localVarOk { - localVarQueryParams.Add("skip", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["sort"].([]string); localVarOk { - localVarQueryParams.Add("sort", parameterToString(localVarTempParam, "csv")) - } - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - if localVarTempParam, localVarOk := localVarOptionals["contentType"].(string); localVarOk { - localVarHeaderParams["Content-Type"] = parameterToString(localVarTempParam, "") - } - if localVarTempParam, localVarOk := localVarOptionals["accept"].(string); localVarOk { - localVarHeaderParams["Accept"] = parameterToString(localVarTempParam, "") - } - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* SambaDomainsApiService Create Samba Domain - This endpoint allows you to create a samba domain for an LDAP server. ##### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/ldapservers/{LDAP_ID}/sambadomains \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"sid\":\"{SID_ID}\", \"name\":\"{WORKGROUP_NAME}\" }' ``` - * @param ctx context.Context for authentication, logging, tracing, etc. - @param ldapserverId Unique identifier of the LDAP server. - @param optional (nil or map[string]interface{}) with one or more of: - @param "body" (SambaDomainInput) - @param "contentType" (string) - @param "accept" (string) - @param "xOrgId" (string) - @return SambaDomainOutput*/ -func (a *SambaDomainsApiService) LdapserversSambaDomainsPost(ctx context.Context, ldapserverId string, localVarOptionals map[string]interface{}) (SambaDomainOutput, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Post") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload SambaDomainOutput - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/ldapservers/{ldapserver_id}/sambadomains" - localVarPath = strings.Replace(localVarPath, "{"+"ldapserver_id"+"}", fmt.Sprintf("%v", ldapserverId), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["contentType"], "string", "contentType"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["accept"], "string", "accept"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return successPayload, nil, err - } - - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - if localVarTempParam, localVarOk := localVarOptionals["contentType"].(string); localVarOk { - localVarHeaderParams["Content-Type"] = parameterToString(localVarTempParam, "") - } - if localVarTempParam, localVarOk := localVarOptionals["accept"].(string); localVarOk { - localVarHeaderParams["Accept"] = parameterToString(localVarTempParam, "") - } - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - // body params - if localVarTempParam, localVarOk := localVarOptionals["body"].(SambaDomainInput); localVarOk { - localVarPostBody = &localVarTempParam - } - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* SambaDomainsApiService Update Samba Domain - This endpoint allows you to update the samba domain information for an LDAP server. ##### Sample Request ``` curl -X PUT https://console.jumpcloud.com/api/v2/ldapservers/{LDAP_ID}/sambadomains/{SAMBA_ID} \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"sid\":\"{SID_ID}\", \"name\":\"{WORKGROUP_NAME}\" }' ``` - * @param ctx context.Context for authentication, logging, tracing, etc. - @param ldapserverId Unique identifier of the LDAP server. - @param id Unique identifier of the samba domain. - @param optional (nil or map[string]interface{}) with one or more of: - @param "body" (SambaDomainInput) - @param "contentType" (string) - @param "accept" (string) - @param "xOrgId" (string) - @return SambaDomainOutput*/ -func (a *SambaDomainsApiService) LdapserversSambaDomainsPut(ctx context.Context, ldapserverId string, id string, localVarOptionals map[string]interface{}) (SambaDomainOutput, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Put") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload SambaDomainOutput - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/ldapservers/{ldapserver_id}/sambadomains/{id}" - localVarPath = strings.Replace(localVarPath, "{"+"ldapserver_id"+"}", fmt.Sprintf("%v", ldapserverId), -1) - localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["contentType"], "string", "contentType"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["accept"], "string", "accept"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return successPayload, nil, err - } - - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - if localVarTempParam, localVarOk := localVarOptionals["contentType"].(string); localVarOk { - localVarHeaderParams["Content-Type"] = parameterToString(localVarTempParam, "") - } - if localVarTempParam, localVarOk := localVarOptionals["accept"].(string); localVarOk { - localVarHeaderParams["Accept"] = parameterToString(localVarTempParam, "") - } - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - // body params - if localVarTempParam, localVarOk := localVarOptionals["body"].(SambaDomainInput); localVarOk { - localVarPostBody = &localVarTempParam - } - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - diff --git a/v2/sshkeylist.go b/v2/sshkeylist.go deleted file mode 100644 index b729eb3..0000000 --- a/v2/sshkeylist.go +++ /dev/null @@ -1,25 +0,0 @@ -/* - * JumpCloud APIs - * - * JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. - * - * API version: 2.0 - * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) - */ - -package v2 - -type Sshkeylist struct { - - // The ID of the SSH key. - Id string `json:"_id,omitempty"` - - // The date the SSH key was created. - CreateDate string `json:"create_date,omitempty"` - - // The name of the SSH key. - Name string `json:"name,omitempty"` - - // The Public SSH key. - PublicKey string `json:"public_key,omitempty"` -} diff --git a/v2/system_graph_management_req.go b/v2/system_graph_management_req.go deleted file mode 100644 index 90aba58..0000000 --- a/v2/system_graph_management_req.go +++ /dev/null @@ -1,23 +0,0 @@ -/* - * JumpCloud APIs - * - * JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. - * - * API version: 2.0 - * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) - */ - -package v2 - -type SystemGraphManagementReq struct { - - Attributes *SystemGraphManagementReqAttributes `json:"attributes,omitempty"` - - // The ObjectID of graph object being added or removed as an association. - Id string `json:"id"` - - // How to modify the graph connection. - Op string `json:"op"` - - Type_ string `json:"type"` -} diff --git a/v2/system_graph_management_req_attributes.go b/v2/system_graph_management_req_attributes.go deleted file mode 100644 index fd87c9e..0000000 --- a/v2/system_graph_management_req_attributes.go +++ /dev/null @@ -1,16 +0,0 @@ -/* - * JumpCloud APIs - * - * JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. - * - * API version: 2.0 - * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) - */ - -package v2 - -// The graph connection's attributes -type SystemGraphManagementReqAttributes struct { - - Sudo *SystemGraphManagementReqAttributesSudo `json:"sudo,omitempty"` -} diff --git a/v2/system_graph_management_req_attributes_sudo.go b/v2/system_graph_management_req_attributes_sudo.go deleted file mode 100644 index 524110a..0000000 --- a/v2/system_graph_management_req_attributes_sudo.go +++ /dev/null @@ -1,17 +0,0 @@ -/* - * JumpCloud APIs - * - * JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. - * - * API version: 2.0 - * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) - */ - -package v2 - -type SystemGraphManagementReqAttributesSudo struct { - - Enabled bool `json:"enabled,omitempty"` - - WithoutPassword bool `json:"withoutPassword,omitempty"` -} diff --git a/v2/system_group.go b/v2/system_group.go deleted file mode 100644 index 17efdf2..0000000 --- a/v2/system_group.go +++ /dev/null @@ -1,22 +0,0 @@ -/* - * JumpCloud APIs - * - * JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. - * - * API version: 2.0 - * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) - */ - -package v2 - -type SystemGroup struct { - - // ObjectId uniquely identifying a System Group. - Id string `json:"id,omitempty"` - - // Display name of a System Group. - Name string `json:"name,omitempty"` - - // The type of the group; always 'system' for a System Group. - Type_ string `json:"type,omitempty"` -} diff --git a/v2/system_group_associations_api.go b/v2/system_group_associations_api.go deleted file mode 100644 index 6260748..0000000 --- a/v2/system_group_associations_api.go +++ /dev/null @@ -1,650 +0,0 @@ -/* - * JumpCloud APIs - * - * JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. - * - * API version: 2.0 - * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) - */ - -package v2 - -import ( - "io/ioutil" - "net/url" - "net/http" - "strings" - "golang.org/x/net/context" - "encoding/json" - "fmt" -) - -// Linger please -var ( - _ context.Context -) - -type SystemGroupAssociationsApiService service - - -/* SystemGroupAssociationsApiService List the associations of a System Group - This endpoint returns the _direct_ associations of a System Group. A direct association can be a non-homogeneous relationship between 2 different objects, for example System Groups and Users. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/systemgroups/{GroupID}/associations?targets=user \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - * @param ctx context.Context for authentication, logging, tracing, etc. - @param groupId ObjectID of the System Group. - @param contentType - @param accept - @param targets - @param optional (nil or map[string]interface{}) with one or more of: - @param "limit" (int32) The number of records to return at once. Limited to 100. - @param "skip" (int32) The offset into the records to return. - @param "xOrgId" (string) - @return []GraphConnection*/ -func (a *SystemGroupAssociationsApiService) GraphSystemGroupAssociationsList(ctx context.Context, groupId string, contentType string, accept string, targets []string, localVarOptionals map[string]interface{}) ([]GraphConnection, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload []GraphConnection - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/systemgroups/{group_id}/associations" - localVarPath = strings.Replace(localVarPath, "{"+"group_id"+"}", fmt.Sprintf("%v", groupId), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["limit"], "int32", "limit"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["skip"], "int32", "skip"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return successPayload, nil, err - } - - if localVarTempParam, localVarOk := localVarOptionals["limit"].(int32); localVarOk { - localVarQueryParams.Add("limit", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["skip"].(int32); localVarOk { - localVarQueryParams.Add("skip", parameterToString(localVarTempParam, "")) - } - localVarQueryParams.Add("targets", parameterToString(targets, "csv")) - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* SystemGroupAssociationsApiService Manage the associations of a System Group - This endpoint allows you to manage the _direct_ associations of a System Group. A direct association can be a non-homogeneous relationship between 2 different objects, for example System Groups and Users. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/systemgroups/{GroupID}/associations \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"op\": \"add\", \"type\": \"user\", \"id\": \"{UserID}\" }' ``` - * @param ctx context.Context for authentication, logging, tracing, etc. - @param groupId ObjectID of the System Group. - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "body" (SystemGroupGraphManagementReq) - @param "xOrgId" (string) - @return */ -func (a *SystemGroupAssociationsApiService) GraphSystemGroupAssociationsPost(ctx context.Context, groupId string, contentType string, accept string, localVarOptionals map[string]interface{}) ( *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Post") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/systemgroups/{group_id}/associations" - localVarPath = strings.Replace(localVarPath, "{"+"group_id"+"}", fmt.Sprintf("%v", groupId), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return nil, err - } - - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - // body params - if localVarTempParam, localVarOk := localVarOptionals["body"].(SystemGroupGraphManagementReq); localVarOk { - localVarPostBody = &localVarTempParam - } - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - return localVarHttpResponse, err -} - -/* SystemGroupAssociationsApiService List the Commands bound to a System Group - This endpoint will return all Commands bound to a System Group, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the group's type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this System Group to the corresponding Command; this array represents all grouping and/or associations that would have to be removed to deprovision the Command from this System Group. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/systemgroups/{GroupID}/commands \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - * @param ctx context.Context for authentication, logging, tracing, etc. - @param groupId ObjectID of the System Group. - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "limit" (int32) The number of records to return at once. Limited to 100. - @param "xOrgId" (string) - @param "skip" (int32) The offset into the records to return. - @param "filter" ([]string) Supported operators are: eq, ne, gt, ge, lt, le, between, search, in - @return []GraphObjectWithPaths*/ -func (a *SystemGroupAssociationsApiService) GraphSystemGroupTraverseCommand(ctx context.Context, groupId string, contentType string, accept string, localVarOptionals map[string]interface{}) ([]GraphObjectWithPaths, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload []GraphObjectWithPaths - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/systemgroups/{group_id}/commands" - localVarPath = strings.Replace(localVarPath, "{"+"group_id"+"}", fmt.Sprintf("%v", groupId), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["limit"], "int32", "limit"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["skip"], "int32", "skip"); err != nil { - return successPayload, nil, err - } - - if localVarTempParam, localVarOk := localVarOptionals["limit"].(int32); localVarOk { - localVarQueryParams.Add("limit", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["skip"].(int32); localVarOk { - localVarQueryParams.Add("skip", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["filter"].([]string); localVarOk { - localVarQueryParams.Add("filter", parameterToString(localVarTempParam, "csv")) - } - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* SystemGroupAssociationsApiService List the Policies bound to a System Group - This endpoint will return all Policies bound to a System Group, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this System Group to the corresponding Policy; this array represents all grouping and/or associations that would have to be removed to deprovision the Policy from this System Group. See `/members` and `/associations` endpoints to manage those collections. This endpoint is not public yet as we haven't finished the code. ##### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/systemgroups/{GroupID}/policies \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - * @param ctx context.Context for authentication, logging, tracing, etc. - @param groupId ObjectID of the System Group. - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "limit" (int32) The number of records to return at once. Limited to 100. - @param "xOrgId" (string) - @param "skip" (int32) The offset into the records to return. - @param "filter" ([]string) Supported operators are: eq, ne, gt, ge, lt, le, between, search, in - @return []GraphObjectWithPaths*/ -func (a *SystemGroupAssociationsApiService) GraphSystemGroupTraversePolicy(ctx context.Context, groupId string, contentType string, accept string, localVarOptionals map[string]interface{}) ([]GraphObjectWithPaths, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload []GraphObjectWithPaths - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/systemgroups/{group_id}/policies" - localVarPath = strings.Replace(localVarPath, "{"+"group_id"+"}", fmt.Sprintf("%v", groupId), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["limit"], "int32", "limit"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["skip"], "int32", "skip"); err != nil { - return successPayload, nil, err - } - - if localVarTempParam, localVarOk := localVarOptionals["limit"].(int32); localVarOk { - localVarQueryParams.Add("limit", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["skip"].(int32); localVarOk { - localVarQueryParams.Add("skip", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["filter"].([]string); localVarOk { - localVarQueryParams.Add("filter", parameterToString(localVarTempParam, "csv")) - } - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* SystemGroupAssociationsApiService List the Users bound to a System Group - This endpoint will return all Users bound to a System Group, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this System Group to the corresponding User; this array represents all grouping and/or associations that would have to be removed to deprovision the User from this System Group. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/systemgroups/{GroupID}/users \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - * @param ctx context.Context for authentication, logging, tracing, etc. - @param groupId ObjectID of the System Group. - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "limit" (int32) The number of records to return at once. Limited to 100. - @param "xOrgId" (string) - @param "skip" (int32) The offset into the records to return. - @param "filter" ([]string) Supported operators are: eq, ne, gt, ge, lt, le, between, search, in - @return []GraphObjectWithPaths*/ -func (a *SystemGroupAssociationsApiService) GraphSystemGroupTraverseUser(ctx context.Context, groupId string, contentType string, accept string, localVarOptionals map[string]interface{}) ([]GraphObjectWithPaths, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload []GraphObjectWithPaths - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/systemgroups/{group_id}/users" - localVarPath = strings.Replace(localVarPath, "{"+"group_id"+"}", fmt.Sprintf("%v", groupId), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["limit"], "int32", "limit"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["skip"], "int32", "skip"); err != nil { - return successPayload, nil, err - } - - if localVarTempParam, localVarOk := localVarOptionals["limit"].(int32); localVarOk { - localVarQueryParams.Add("limit", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["skip"].(int32); localVarOk { - localVarQueryParams.Add("skip", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["filter"].([]string); localVarOk { - localVarQueryParams.Add("filter", parameterToString(localVarTempParam, "csv")) - } - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* SystemGroupAssociationsApiService List the User Groups bound to a System Group - This endpoint will return all User Groups bound to a System Group, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this System Group to the corresponding User Group; this array represents all grouping and/or associations that would have to be removed to deprovision the User Group from this System Group. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/systemgroups/{GroupID}/usergroups \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - * @param ctx context.Context for authentication, logging, tracing, etc. - @param groupId ObjectID of the System Group. - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "limit" (int32) The number of records to return at once. Limited to 100. - @param "xOrgId" (string) - @param "skip" (int32) The offset into the records to return. - @param "filter" ([]string) Supported operators are: eq, ne, gt, ge, lt, le, between, search, in - @return []GraphObjectWithPaths*/ -func (a *SystemGroupAssociationsApiService) GraphSystemGroupTraverseUserGroup(ctx context.Context, groupId string, contentType string, accept string, localVarOptionals map[string]interface{}) ([]GraphObjectWithPaths, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload []GraphObjectWithPaths - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/systemgroups/{group_id}/usergroups" - localVarPath = strings.Replace(localVarPath, "{"+"group_id"+"}", fmt.Sprintf("%v", groupId), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["limit"], "int32", "limit"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["skip"], "int32", "skip"); err != nil { - return successPayload, nil, err - } - - if localVarTempParam, localVarOk := localVarOptionals["limit"].(int32); localVarOk { - localVarQueryParams.Add("limit", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["skip"].(int32); localVarOk { - localVarQueryParams.Add("skip", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["filter"].([]string); localVarOk { - localVarQueryParams.Add("filter", parameterToString(localVarTempParam, "csv")) - } - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - diff --git a/v2/system_group_data.go b/v2/system_group_data.go deleted file mode 100644 index 1755cbd..0000000 --- a/v2/system_group_data.go +++ /dev/null @@ -1,16 +0,0 @@ -/* - * JumpCloud APIs - * - * JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. - * - * API version: 2.0 - * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) - */ - -package v2 - -type SystemGroupData struct { - - // Display name of a System Group. - Name string `json:"name"` -} diff --git a/v2/system_group_graph_management_req.go b/v2/system_group_graph_management_req.go deleted file mode 100644 index 3a29993..0000000 --- a/v2/system_group_graph_management_req.go +++ /dev/null @@ -1,21 +0,0 @@ -/* - * JumpCloud APIs - * - * JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. - * - * API version: 2.0 - * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) - */ - -package v2 - -type SystemGroupGraphManagementReq struct { - - // The ObjectID of graph object being added or removed as an association. - Id string `json:"id"` - - // How to modify the graph connection. - Op string `json:"op"` - - Type_ string `json:"type"` -} diff --git a/v2/system_group_members_membership_api.go b/v2/system_group_members_membership_api.go deleted file mode 100644 index 9235396..0000000 --- a/v2/system_group_members_membership_api.go +++ /dev/null @@ -1,456 +0,0 @@ -/* - * JumpCloud APIs - * - * JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. - * - * API version: 2.0 - * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) - */ - -package v2 - -import ( - "io/ioutil" - "net/url" - "net/http" - "strings" - "golang.org/x/net/context" - "encoding/json" - "fmt" -) - -// Linger please -var ( - _ context.Context -) - -type SystemGroupMembersMembershipApiService service - - -/* SystemGroupMembersMembershipApiService List the System Group's parents - This endpoint returns all System Groups a System Group is a member of. This endpoint is not yet public as we haven't completed the code yet. - * @param ctx context.Context for authentication, logging, tracing, etc. - @param groupId ObjectID of the System Group. - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "filter" ([]string) Supported operators are: eq, ne, gt, ge, lt, le, between, search, in - @param "limit" (int32) The number of records to return at once. Limited to 100. - @param "skip" (int32) The offset into the records to return. - @param "sort" ([]string) The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. - @param "xOrgId" (string) - @return []GraphObjectWithPaths*/ -func (a *SystemGroupMembersMembershipApiService) GraphSystemGroupMemberOf(ctx context.Context, groupId string, contentType string, accept string, localVarOptionals map[string]interface{}) ([]GraphObjectWithPaths, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload []GraphObjectWithPaths - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/systemgroups/{group_id}/memberof" - localVarPath = strings.Replace(localVarPath, "{"+"group_id"+"}", fmt.Sprintf("%v", groupId), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["limit"], "int32", "limit"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["skip"], "int32", "skip"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return successPayload, nil, err - } - - if localVarTempParam, localVarOk := localVarOptionals["filter"].([]string); localVarOk { - localVarQueryParams.Add("filter", parameterToString(localVarTempParam, "csv")) - } - if localVarTempParam, localVarOk := localVarOptionals["limit"].(int32); localVarOk { - localVarQueryParams.Add("limit", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["skip"].(int32); localVarOk { - localVarQueryParams.Add("skip", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["sort"].([]string); localVarOk { - localVarQueryParams.Add("sort", parameterToString(localVarTempParam, "csv")) - } - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* SystemGroupMembersMembershipApiService List the members of a System Group - This endpoint returns the system members of a System Group. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/systemgroups/{Group_ID}/members \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - * @param ctx context.Context for authentication, logging, tracing, etc. - @param groupId ObjectID of the System Group. - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "limit" (int32) The number of records to return at once. Limited to 100. - @param "skip" (int32) The offset into the records to return. - @param "xOrgId" (string) - @return []GraphConnection*/ -func (a *SystemGroupMembersMembershipApiService) GraphSystemGroupMembersList(ctx context.Context, groupId string, contentType string, accept string, localVarOptionals map[string]interface{}) ([]GraphConnection, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload []GraphConnection - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/systemgroups/{group_id}/members" - localVarPath = strings.Replace(localVarPath, "{"+"group_id"+"}", fmt.Sprintf("%v", groupId), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["limit"], "int32", "limit"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["skip"], "int32", "skip"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return successPayload, nil, err - } - - if localVarTempParam, localVarOk := localVarOptionals["limit"].(int32); localVarOk { - localVarQueryParams.Add("limit", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["skip"].(int32); localVarOk { - localVarQueryParams.Add("skip", parameterToString(localVarTempParam, "")) - } - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* SystemGroupMembersMembershipApiService Manage the members of a System Group - This endpoint allows you to manage the system members of a System Group. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/systemgroups/{Group_ID}/members \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"op\": \"add\", \"type\": \"system\", \"id\": \"{System_ID}\" }' ``` - * @param ctx context.Context for authentication, logging, tracing, etc. - @param groupId ObjectID of the System Group. - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "body" (SystemGroupMembersReq) - @param "date" (string) Current date header for the System Context API - @param "authorization" (string) Authorization header for the System Context API - @param "xOrgId" (string) - @return */ -func (a *SystemGroupMembersMembershipApiService) GraphSystemGroupMembersPost(ctx context.Context, groupId string, contentType string, accept string, localVarOptionals map[string]interface{}) ( *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Post") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/systemgroups/{group_id}/members" - localVarPath = strings.Replace(localVarPath, "{"+"group_id"+"}", fmt.Sprintf("%v", groupId), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["date"], "string", "date"); err != nil { - return nil, err - } - if err := typeCheckParameter(localVarOptionals["authorization"], "string", "authorization"); err != nil { - return nil, err - } - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return nil, err - } - - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if localVarTempParam, localVarOk := localVarOptionals["date"].(string); localVarOk { - localVarHeaderParams["Date"] = parameterToString(localVarTempParam, "") - } - if localVarTempParam, localVarOk := localVarOptionals["authorization"].(string); localVarOk { - localVarHeaderParams["Authorization"] = parameterToString(localVarTempParam, "") - } - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - // body params - if localVarTempParam, localVarOk := localVarOptionals["body"].(SystemGroupMembersReq); localVarOk { - localVarPostBody = &localVarTempParam - } - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - return localVarHttpResponse, err -} - -/* SystemGroupMembersMembershipApiService List the System Group's membership - This endpoint returns all Systems that are a member of this System Group. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/systemgroups/{Group_ID/membership \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - * @param ctx context.Context for authentication, logging, tracing, etc. - @param groupId ObjectID of the System Group. - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "limit" (int32) The number of records to return at once. Limited to 100. - @param "skip" (int32) The offset into the records to return. - @param "sort" ([]string) The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. - @param "filter" ([]string) Supported operators are: eq, ne, gt, ge, lt, le, between, search, in - @param "xOrgId" (string) - @return []GraphObjectWithPaths*/ -func (a *SystemGroupMembersMembershipApiService) GraphSystemGroupMembership(ctx context.Context, groupId string, contentType string, accept string, localVarOptionals map[string]interface{}) ([]GraphObjectWithPaths, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload []GraphObjectWithPaths - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/systemgroups/{group_id}/membership" - localVarPath = strings.Replace(localVarPath, "{"+"group_id"+"}", fmt.Sprintf("%v", groupId), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["limit"], "int32", "limit"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["skip"], "int32", "skip"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return successPayload, nil, err - } - - if localVarTempParam, localVarOk := localVarOptionals["limit"].(int32); localVarOk { - localVarQueryParams.Add("limit", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["skip"].(int32); localVarOk { - localVarQueryParams.Add("skip", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["sort"].([]string); localVarOk { - localVarQueryParams.Add("sort", parameterToString(localVarTempParam, "csv")) - } - if localVarTempParam, localVarOk := localVarOptionals["filter"].([]string); localVarOk { - localVarQueryParams.Add("filter", parameterToString(localVarTempParam, "csv")) - } - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - diff --git a/v2/system_group_members_req.go b/v2/system_group_members_req.go deleted file mode 100644 index 8df68c7..0000000 --- a/v2/system_group_members_req.go +++ /dev/null @@ -1,22 +0,0 @@ -/* - * JumpCloud APIs - * - * JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. - * - * API version: 2.0 - * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) - */ - -package v2 - -type SystemGroupMembersReq struct { - - // The ObjectID of member being added or removed. - Id string `json:"id"` - - // How to modify the membership connection. - Op string `json:"op"` - - // The member type. - Type_ string `json:"type"` -} diff --git a/v2/system_groups_api.go b/v2/system_groups_api.go deleted file mode 100644 index 482364a..0000000 --- a/v2/system_groups_api.go +++ /dev/null @@ -1,1535 +0,0 @@ -/* - * JumpCloud APIs - * - * JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. - * - * API version: 2.0 - * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) - */ - -package v2 - -import ( - "io/ioutil" - "net/url" - "net/http" - "strings" - "golang.org/x/net/context" - "encoding/json" - "fmt" -) - -// Linger please -var ( - _ context.Context -) - -type SystemGroupsApiService service - - -/* SystemGroupsApiService List the associations of a System Group - This endpoint returns the _direct_ associations of a System Group. A direct association can be a non-homogeneous relationship between 2 different objects, for example System Groups and Users. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/systemgroups/{GroupID}/associations?targets=user \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - * @param ctx context.Context for authentication, logging, tracing, etc. - @param groupId ObjectID of the System Group. - @param contentType - @param accept - @param targets - @param optional (nil or map[string]interface{}) with one or more of: - @param "limit" (int32) The number of records to return at once. Limited to 100. - @param "skip" (int32) The offset into the records to return. - @param "xOrgId" (string) - @return []GraphConnection*/ -func (a *SystemGroupsApiService) GraphSystemGroupAssociationsList(ctx context.Context, groupId string, contentType string, accept string, targets []string, localVarOptionals map[string]interface{}) ([]GraphConnection, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload []GraphConnection - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/systemgroups/{group_id}/associations" - localVarPath = strings.Replace(localVarPath, "{"+"group_id"+"}", fmt.Sprintf("%v", groupId), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["limit"], "int32", "limit"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["skip"], "int32", "skip"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return successPayload, nil, err - } - - if localVarTempParam, localVarOk := localVarOptionals["limit"].(int32); localVarOk { - localVarQueryParams.Add("limit", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["skip"].(int32); localVarOk { - localVarQueryParams.Add("skip", parameterToString(localVarTempParam, "")) - } - localVarQueryParams.Add("targets", parameterToString(targets, "csv")) - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* SystemGroupsApiService Manage the associations of a System Group - This endpoint allows you to manage the _direct_ associations of a System Group. A direct association can be a non-homogeneous relationship between 2 different objects, for example System Groups and Users. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/systemgroups/{GroupID}/associations \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"op\": \"add\", \"type\": \"user\", \"id\": \"{UserID}\" }' ``` - * @param ctx context.Context for authentication, logging, tracing, etc. - @param groupId ObjectID of the System Group. - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "body" (SystemGroupGraphManagementReq) - @param "xOrgId" (string) - @return */ -func (a *SystemGroupsApiService) GraphSystemGroupAssociationsPost(ctx context.Context, groupId string, contentType string, accept string, localVarOptionals map[string]interface{}) ( *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Post") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/systemgroups/{group_id}/associations" - localVarPath = strings.Replace(localVarPath, "{"+"group_id"+"}", fmt.Sprintf("%v", groupId), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return nil, err - } - - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - // body params - if localVarTempParam, localVarOk := localVarOptionals["body"].(SystemGroupGraphManagementReq); localVarOk { - localVarPostBody = &localVarTempParam - } - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - return localVarHttpResponse, err -} - -/* SystemGroupsApiService List the System Group's parents - This endpoint returns all System Groups a System Group is a member of. This endpoint is not yet public as we haven't completed the code yet. - * @param ctx context.Context for authentication, logging, tracing, etc. - @param groupId ObjectID of the System Group. - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "filter" ([]string) Supported operators are: eq, ne, gt, ge, lt, le, between, search, in - @param "limit" (int32) The number of records to return at once. Limited to 100. - @param "skip" (int32) The offset into the records to return. - @param "sort" ([]string) The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. - @param "xOrgId" (string) - @return []GraphObjectWithPaths*/ -func (a *SystemGroupsApiService) GraphSystemGroupMemberOf(ctx context.Context, groupId string, contentType string, accept string, localVarOptionals map[string]interface{}) ([]GraphObjectWithPaths, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload []GraphObjectWithPaths - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/systemgroups/{group_id}/memberof" - localVarPath = strings.Replace(localVarPath, "{"+"group_id"+"}", fmt.Sprintf("%v", groupId), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["limit"], "int32", "limit"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["skip"], "int32", "skip"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return successPayload, nil, err - } - - if localVarTempParam, localVarOk := localVarOptionals["filter"].([]string); localVarOk { - localVarQueryParams.Add("filter", parameterToString(localVarTempParam, "csv")) - } - if localVarTempParam, localVarOk := localVarOptionals["limit"].(int32); localVarOk { - localVarQueryParams.Add("limit", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["skip"].(int32); localVarOk { - localVarQueryParams.Add("skip", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["sort"].([]string); localVarOk { - localVarQueryParams.Add("sort", parameterToString(localVarTempParam, "csv")) - } - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* SystemGroupsApiService List the members of a System Group - This endpoint returns the system members of a System Group. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/systemgroups/{Group_ID}/members \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - * @param ctx context.Context for authentication, logging, tracing, etc. - @param groupId ObjectID of the System Group. - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "limit" (int32) The number of records to return at once. Limited to 100. - @param "skip" (int32) The offset into the records to return. - @param "xOrgId" (string) - @return []GraphConnection*/ -func (a *SystemGroupsApiService) GraphSystemGroupMembersList(ctx context.Context, groupId string, contentType string, accept string, localVarOptionals map[string]interface{}) ([]GraphConnection, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload []GraphConnection - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/systemgroups/{group_id}/members" - localVarPath = strings.Replace(localVarPath, "{"+"group_id"+"}", fmt.Sprintf("%v", groupId), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["limit"], "int32", "limit"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["skip"], "int32", "skip"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return successPayload, nil, err - } - - if localVarTempParam, localVarOk := localVarOptionals["limit"].(int32); localVarOk { - localVarQueryParams.Add("limit", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["skip"].(int32); localVarOk { - localVarQueryParams.Add("skip", parameterToString(localVarTempParam, "")) - } - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* SystemGroupsApiService Manage the members of a System Group - This endpoint allows you to manage the system members of a System Group. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/systemgroups/{Group_ID}/members \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"op\": \"add\", \"type\": \"system\", \"id\": \"{System_ID}\" }' ``` - * @param ctx context.Context for authentication, logging, tracing, etc. - @param groupId ObjectID of the System Group. - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "body" (SystemGroupMembersReq) - @param "date" (string) Current date header for the System Context API - @param "authorization" (string) Authorization header for the System Context API - @param "xOrgId" (string) - @return */ -func (a *SystemGroupsApiService) GraphSystemGroupMembersPost(ctx context.Context, groupId string, contentType string, accept string, localVarOptionals map[string]interface{}) ( *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Post") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/systemgroups/{group_id}/members" - localVarPath = strings.Replace(localVarPath, "{"+"group_id"+"}", fmt.Sprintf("%v", groupId), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["date"], "string", "date"); err != nil { - return nil, err - } - if err := typeCheckParameter(localVarOptionals["authorization"], "string", "authorization"); err != nil { - return nil, err - } - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return nil, err - } - - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if localVarTempParam, localVarOk := localVarOptionals["date"].(string); localVarOk { - localVarHeaderParams["Date"] = parameterToString(localVarTempParam, "") - } - if localVarTempParam, localVarOk := localVarOptionals["authorization"].(string); localVarOk { - localVarHeaderParams["Authorization"] = parameterToString(localVarTempParam, "") - } - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - // body params - if localVarTempParam, localVarOk := localVarOptionals["body"].(SystemGroupMembersReq); localVarOk { - localVarPostBody = &localVarTempParam - } - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - return localVarHttpResponse, err -} - -/* SystemGroupsApiService List the System Group's membership - This endpoint returns all Systems that are a member of this System Group. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/systemgroups/{Group_ID/membership \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - * @param ctx context.Context for authentication, logging, tracing, etc. - @param groupId ObjectID of the System Group. - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "limit" (int32) The number of records to return at once. Limited to 100. - @param "skip" (int32) The offset into the records to return. - @param "sort" ([]string) The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. - @param "filter" ([]string) Supported operators are: eq, ne, gt, ge, lt, le, between, search, in - @param "xOrgId" (string) - @return []GraphObjectWithPaths*/ -func (a *SystemGroupsApiService) GraphSystemGroupMembership(ctx context.Context, groupId string, contentType string, accept string, localVarOptionals map[string]interface{}) ([]GraphObjectWithPaths, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload []GraphObjectWithPaths - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/systemgroups/{group_id}/membership" - localVarPath = strings.Replace(localVarPath, "{"+"group_id"+"}", fmt.Sprintf("%v", groupId), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["limit"], "int32", "limit"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["skip"], "int32", "skip"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return successPayload, nil, err - } - - if localVarTempParam, localVarOk := localVarOptionals["limit"].(int32); localVarOk { - localVarQueryParams.Add("limit", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["skip"].(int32); localVarOk { - localVarQueryParams.Add("skip", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["sort"].([]string); localVarOk { - localVarQueryParams.Add("sort", parameterToString(localVarTempParam, "csv")) - } - if localVarTempParam, localVarOk := localVarOptionals["filter"].([]string); localVarOk { - localVarQueryParams.Add("filter", parameterToString(localVarTempParam, "csv")) - } - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* SystemGroupsApiService List the Policies bound to a System Group - This endpoint will return all Policies bound to a System Group, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this System Group to the corresponding Policy; this array represents all grouping and/or associations that would have to be removed to deprovision the Policy from this System Group. See `/members` and `/associations` endpoints to manage those collections. This endpoint is not public yet as we haven't finished the code. ##### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/systemgroups/{GroupID}/policies \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - * @param ctx context.Context for authentication, logging, tracing, etc. - @param groupId ObjectID of the System Group. - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "limit" (int32) The number of records to return at once. Limited to 100. - @param "xOrgId" (string) - @param "skip" (int32) The offset into the records to return. - @param "filter" ([]string) Supported operators are: eq, ne, gt, ge, lt, le, between, search, in - @return []GraphObjectWithPaths*/ -func (a *SystemGroupsApiService) GraphSystemGroupTraversePolicy(ctx context.Context, groupId string, contentType string, accept string, localVarOptionals map[string]interface{}) ([]GraphObjectWithPaths, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload []GraphObjectWithPaths - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/systemgroups/{group_id}/policies" - localVarPath = strings.Replace(localVarPath, "{"+"group_id"+"}", fmt.Sprintf("%v", groupId), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["limit"], "int32", "limit"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["skip"], "int32", "skip"); err != nil { - return successPayload, nil, err - } - - if localVarTempParam, localVarOk := localVarOptionals["limit"].(int32); localVarOk { - localVarQueryParams.Add("limit", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["skip"].(int32); localVarOk { - localVarQueryParams.Add("skip", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["filter"].([]string); localVarOk { - localVarQueryParams.Add("filter", parameterToString(localVarTempParam, "csv")) - } - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* SystemGroupsApiService List the Users bound to a System Group - This endpoint will return all Users bound to a System Group, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this System Group to the corresponding User; this array represents all grouping and/or associations that would have to be removed to deprovision the User from this System Group. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/systemgroups/{GroupID}/users \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - * @param ctx context.Context for authentication, logging, tracing, etc. - @param groupId ObjectID of the System Group. - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "limit" (int32) The number of records to return at once. Limited to 100. - @param "xOrgId" (string) - @param "skip" (int32) The offset into the records to return. - @param "filter" ([]string) Supported operators are: eq, ne, gt, ge, lt, le, between, search, in - @return []GraphObjectWithPaths*/ -func (a *SystemGroupsApiService) GraphSystemGroupTraverseUser(ctx context.Context, groupId string, contentType string, accept string, localVarOptionals map[string]interface{}) ([]GraphObjectWithPaths, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload []GraphObjectWithPaths - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/systemgroups/{group_id}/users" - localVarPath = strings.Replace(localVarPath, "{"+"group_id"+"}", fmt.Sprintf("%v", groupId), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["limit"], "int32", "limit"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["skip"], "int32", "skip"); err != nil { - return successPayload, nil, err - } - - if localVarTempParam, localVarOk := localVarOptionals["limit"].(int32); localVarOk { - localVarQueryParams.Add("limit", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["skip"].(int32); localVarOk { - localVarQueryParams.Add("skip", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["filter"].([]string); localVarOk { - localVarQueryParams.Add("filter", parameterToString(localVarTempParam, "csv")) - } - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* SystemGroupsApiService List the User Groups bound to a System Group - This endpoint will return all User Groups bound to a System Group, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this System Group to the corresponding User Group; this array represents all grouping and/or associations that would have to be removed to deprovision the User Group from this System Group. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/systemgroups/{GroupID}/usergroups \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - * @param ctx context.Context for authentication, logging, tracing, etc. - @param groupId ObjectID of the System Group. - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "limit" (int32) The number of records to return at once. Limited to 100. - @param "xOrgId" (string) - @param "skip" (int32) The offset into the records to return. - @param "filter" ([]string) Supported operators are: eq, ne, gt, ge, lt, le, between, search, in - @return []GraphObjectWithPaths*/ -func (a *SystemGroupsApiService) GraphSystemGroupTraverseUserGroup(ctx context.Context, groupId string, contentType string, accept string, localVarOptionals map[string]interface{}) ([]GraphObjectWithPaths, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload []GraphObjectWithPaths - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/systemgroups/{group_id}/usergroups" - localVarPath = strings.Replace(localVarPath, "{"+"group_id"+"}", fmt.Sprintf("%v", groupId), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["limit"], "int32", "limit"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["skip"], "int32", "skip"); err != nil { - return successPayload, nil, err - } - - if localVarTempParam, localVarOk := localVarOptionals["limit"].(int32); localVarOk { - localVarQueryParams.Add("limit", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["skip"].(int32); localVarOk { - localVarQueryParams.Add("skip", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["filter"].([]string); localVarOk { - localVarQueryParams.Add("filter", parameterToString(localVarTempParam, "csv")) - } - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* SystemGroupsApiService Delete a System Group - This endpoint allows you to delete a System Group. #### Sample Request ``` curl -X DELETE https://console.jumpcloud.com/api/v2/systemgroups/{Group_ID} \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - * @param ctx context.Context for authentication, logging, tracing, etc. - @param id ObjectID of the System Group. - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "xOrgId" (string) - @return */ -func (a *SystemGroupsApiService) GroupsSystemDelete(ctx context.Context, id string, contentType string, accept string, localVarOptionals map[string]interface{}) ( *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Delete") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/systemgroups/{id}" - localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return nil, err - } - - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - return localVarHttpResponse, err -} - -/* SystemGroupsApiService View an individual System Group details - This endpoint returns the details of a System Group. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/systemgroups/{Group_ID} \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - * @param ctx context.Context for authentication, logging, tracing, etc. - @param id ObjectID of the System Group. - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "xOrgId" (string) - @return SystemGroup*/ -func (a *SystemGroupsApiService) GroupsSystemGet(ctx context.Context, id string, contentType string, accept string, localVarOptionals map[string]interface{}) (SystemGroup, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload SystemGroup - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/systemgroups/{id}" - localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return successPayload, nil, err - } - - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* SystemGroupsApiService List all System Groups - This endpoint returns all System Groups. Available filter fields: - `name` - `disabled` - `type` #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/systemgroups \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - * @param ctx context.Context for authentication, logging, tracing, etc. - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "fields" ([]string) The comma separated fields included in the returned records. If omitted, the default list of fields will be returned. - @param "filter" ([]string) Supported operators are: eq, ne, gt, ge, lt, le, between, search, in - @param "limit" (int32) The number of records to return at once. Limited to 100. - @param "skip" (int32) The offset into the records to return. - @param "sort" ([]string) The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. - @param "xOrgId" (string) - @return []SystemGroup*/ -func (a *SystemGroupsApiService) GroupsSystemList(ctx context.Context, contentType string, accept string, localVarOptionals map[string]interface{}) ([]SystemGroup, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload []SystemGroup - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/systemgroups" - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["limit"], "int32", "limit"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["skip"], "int32", "skip"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return successPayload, nil, err - } - - if localVarTempParam, localVarOk := localVarOptionals["fields"].([]string); localVarOk { - localVarQueryParams.Add("fields", parameterToString(localVarTempParam, "csv")) - } - if localVarTempParam, localVarOk := localVarOptionals["filter"].([]string); localVarOk { - localVarQueryParams.Add("filter", parameterToString(localVarTempParam, "csv")) - } - if localVarTempParam, localVarOk := localVarOptionals["limit"].(int32); localVarOk { - localVarQueryParams.Add("limit", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["skip"].(int32); localVarOk { - localVarQueryParams.Add("skip", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["sort"].([]string); localVarOk { - localVarQueryParams.Add("sort", parameterToString(localVarTempParam, "csv")) - } - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* SystemGroupsApiService Partial update a System Group - We have hidden PATCH on the systemgroups and usergroups for now; we don't have that implemented correctly yet, people should use PUT until we do a true PATCH operation. #### Sample Request ``` https://console.jumpcloud.com/api/v2/systemgroups/{id} ``` - * @param ctx context.Context for authentication, logging, tracing, etc. - @param id ObjectID of the System Group. - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "body" (SystemGroupData) - @param "xOrgId" (string) - @return SystemGroup*/ -func (a *SystemGroupsApiService) GroupsSystemPatch(ctx context.Context, id string, contentType string, accept string, localVarOptionals map[string]interface{}) (SystemGroup, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Patch") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload SystemGroup - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/systemgroups/{id}" - localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return successPayload, nil, err - } - - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - // body params - if localVarTempParam, localVarOk := localVarOptionals["body"].(SystemGroupData); localVarOk { - localVarPostBody = &localVarTempParam - } - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* SystemGroupsApiService Create a new System Group - This endpoint allows you to create a new System Group. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/systemgroups \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"name\": \"{Group_Name}\" }' ``` - * @param ctx context.Context for authentication, logging, tracing, etc. - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "body" (SystemGroupData) - @param "xOrgId" (string) - @return SystemGroup*/ -func (a *SystemGroupsApiService) GroupsSystemPost(ctx context.Context, contentType string, accept string, localVarOptionals map[string]interface{}) (SystemGroup, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Post") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload SystemGroup - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/systemgroups" - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return successPayload, nil, err - } - - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - // body params - if localVarTempParam, localVarOk := localVarOptionals["body"].(SystemGroupData); localVarOk { - localVarPostBody = &localVarTempParam - } - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* SystemGroupsApiService Update a System Group - This endpoint allows you to do a full update of the System Group. #### Sample Request ``` curl -X PUT https://console.jumpcloud.com/api/v2/systemgroups/{Group_ID} \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"name\": \"Name_Update\" }' ``` - * @param ctx context.Context for authentication, logging, tracing, etc. - @param id ObjectID of the System Group. - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "body" (SystemGroupData) - @param "xOrgId" (string) - @return SystemGroup*/ -func (a *SystemGroupsApiService) GroupsSystemPut(ctx context.Context, id string, contentType string, accept string, localVarOptionals map[string]interface{}) (SystemGroup, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Put") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload SystemGroup - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/systemgroups/{id}" - localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return successPayload, nil, err - } - - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - // body params - if localVarTempParam, localVarOk := localVarOptionals["body"].(SystemGroupData); localVarOk { - localVarPostBody = &localVarTempParam - } - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - diff --git a/v2/system_insights_api.go b/v2/system_insights_api.go deleted file mode 100644 index f0dc6c5..0000000 --- a/v2/system_insights_api.go +++ /dev/null @@ -1,5321 +0,0 @@ -/* - * JumpCloud APIs - * - * JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. - * - * API version: 2.0 - * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) - */ - -package v2 - -import ( - "io/ioutil" - "net/url" - "net/http" - "strings" - "golang.org/x/net/context" - "encoding/json" - "fmt" -) - -// Linger please -var ( - _ context.Context -) - -type SystemInsightsApiService service - - -/* SystemInsightsApiService List System Insights Apps - Valid filter fields are `system_id` and `bundle_name`. - * @param ctx context.Context for authentication, logging, tracing, etc. - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "limit" (int32) - @param "xOrgId" (string) - @param "skip" (int32) The offset into the records to return. - @param "filter" ([]string) Supported operators are: eq - @return []SystemInsightsApps*/ -func (a *SystemInsightsApiService) SysteminsightsListApps(ctx context.Context, contentType string, accept string, localVarOptionals map[string]interface{}) ([]SystemInsightsApps, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload []SystemInsightsApps - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/systeminsights/apps" - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["limit"], "int32", "limit"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["skip"], "int32", "skip"); err != nil { - return successPayload, nil, err - } - - if localVarTempParam, localVarOk := localVarOptionals["limit"].(int32); localVarOk { - localVarQueryParams.Add("limit", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["skip"].(int32); localVarOk { - localVarQueryParams.Add("skip", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["filter"].([]string); localVarOk { - localVarQueryParams.Add("filter", parameterToString(localVarTempParam, "csv")) - } - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* SystemInsightsApiService List System Insights Battery - Valid filter fields are `system_id` and `health`. - * @param ctx context.Context for authentication, logging, tracing, etc. - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "limit" (int32) - @param "xOrgId" (string) - @param "skip" (int32) The offset into the records to return. - @param "filter" ([]string) Supported operators are: eq - @return []SystemInsightsBattery*/ -func (a *SystemInsightsApiService) SysteminsightsListBattery(ctx context.Context, contentType string, accept string, localVarOptionals map[string]interface{}) ([]SystemInsightsBattery, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload []SystemInsightsBattery - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/systeminsights/battery" - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["limit"], "int32", "limit"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["skip"], "int32", "skip"); err != nil { - return successPayload, nil, err - } - - if localVarTempParam, localVarOk := localVarOptionals["limit"].(int32); localVarOk { - localVarQueryParams.Add("limit", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["skip"].(int32); localVarOk { - localVarQueryParams.Add("skip", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["filter"].([]string); localVarOk { - localVarQueryParams.Add("filter", parameterToString(localVarTempParam, "csv")) - } - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* SystemInsightsApiService List System Insights Bitlocker Info - Valid filter fields are `system_id` and `protection_status`. - * @param ctx context.Context for authentication, logging, tracing, etc. - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "limit" (int32) - @param "skip" (int32) The offset into the records to return. - @param "filter" ([]string) Supported operators are: eq - @param "xOrgId" (string) - @return []SystemInsightsBitlockerInfo*/ -func (a *SystemInsightsApiService) SysteminsightsListBitlockerInfo(ctx context.Context, contentType string, accept string, localVarOptionals map[string]interface{}) ([]SystemInsightsBitlockerInfo, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload []SystemInsightsBitlockerInfo - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/systeminsights/bitlocker_info" - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["limit"], "int32", "limit"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["skip"], "int32", "skip"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return successPayload, nil, err - } - - if localVarTempParam, localVarOk := localVarOptionals["limit"].(int32); localVarOk { - localVarQueryParams.Add("limit", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["skip"].(int32); localVarOk { - localVarQueryParams.Add("skip", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["filter"].([]string); localVarOk { - localVarQueryParams.Add("filter", parameterToString(localVarTempParam, "csv")) - } - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* SystemInsightsApiService List System Insights Browser Plugins - Valid filter fields are `system_id` and `name`. - * @param ctx context.Context for authentication, logging, tracing, etc. - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "limit" (int32) - @param "skip" (int32) The offset into the records to return. - @param "filter" ([]string) Supported operators are: eq - @param "xOrgId" (string) - @return []SystemInsightsBrowserPlugins*/ -func (a *SystemInsightsApiService) SysteminsightsListBrowserPlugins(ctx context.Context, contentType string, accept string, localVarOptionals map[string]interface{}) ([]SystemInsightsBrowserPlugins, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload []SystemInsightsBrowserPlugins - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/systeminsights/browser_plugins" - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["limit"], "int32", "limit"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["skip"], "int32", "skip"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return successPayload, nil, err - } - - if localVarTempParam, localVarOk := localVarOptionals["limit"].(int32); localVarOk { - localVarQueryParams.Add("limit", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["skip"].(int32); localVarOk { - localVarQueryParams.Add("skip", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["filter"].([]string); localVarOk { - localVarQueryParams.Add("filter", parameterToString(localVarTempParam, "csv")) - } - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* SystemInsightsApiService List System Insights Chrome Extensions - Valid filter fields are `system_id` and `name`. - * @param ctx context.Context for authentication, logging, tracing, etc. - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "limit" (int32) - @param "skip" (int32) The offset into the records to return. - @param "filter" ([]string) Supported operators are: eq - @param "xOrgId" (string) - @return []SystemInsightsChromeExtensions*/ -func (a *SystemInsightsApiService) SysteminsightsListChromeExtensions(ctx context.Context, contentType string, accept string, localVarOptionals map[string]interface{}) ([]SystemInsightsChromeExtensions, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload []SystemInsightsChromeExtensions - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/systeminsights/chrome_extensions" - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["limit"], "int32", "limit"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["skip"], "int32", "skip"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return successPayload, nil, err - } - - if localVarTempParam, localVarOk := localVarOptionals["limit"].(int32); localVarOk { - localVarQueryParams.Add("limit", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["skip"].(int32); localVarOk { - localVarQueryParams.Add("skip", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["filter"].([]string); localVarOk { - localVarQueryParams.Add("filter", parameterToString(localVarTempParam, "csv")) - } - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* SystemInsightsApiService List System Insights Crashes - Valid filter fields are `system_id` and `identifier`. - * @param ctx context.Context for authentication, logging, tracing, etc. - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "limit" (int32) - @param "xOrgId" (string) - @param "skip" (int32) The offset into the records to return. - @param "filter" ([]string) Supported operators are: eq - @return []SystemInsightsCrashes*/ -func (a *SystemInsightsApiService) SysteminsightsListCrashes(ctx context.Context, contentType string, accept string, localVarOptionals map[string]interface{}) ([]SystemInsightsCrashes, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload []SystemInsightsCrashes - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/systeminsights/crashes" - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["limit"], "int32", "limit"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["skip"], "int32", "skip"); err != nil { - return successPayload, nil, err - } - - if localVarTempParam, localVarOk := localVarOptionals["limit"].(int32); localVarOk { - localVarQueryParams.Add("limit", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["skip"].(int32); localVarOk { - localVarQueryParams.Add("skip", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["filter"].([]string); localVarOk { - localVarQueryParams.Add("filter", parameterToString(localVarTempParam, "csv")) - } - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* SystemInsightsApiService List System Insights Disk Encryption - Valid filter fields are `system_id` and `encryption_status`. - * @param ctx context.Context for authentication, logging, tracing, etc. - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "limit" (int32) - @param "skip" (int32) The offset into the records to return. - @param "filter" ([]string) Supported operators are: eq - @param "xOrgId" (string) - @return []SystemInsightsDiskEncryption*/ -func (a *SystemInsightsApiService) SysteminsightsListDiskEncryption(ctx context.Context, contentType string, accept string, localVarOptionals map[string]interface{}) ([]SystemInsightsDiskEncryption, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload []SystemInsightsDiskEncryption - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/systeminsights/disk_encryption" - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["limit"], "int32", "limit"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["skip"], "int32", "skip"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return successPayload, nil, err - } - - if localVarTempParam, localVarOk := localVarOptionals["limit"].(int32); localVarOk { - localVarQueryParams.Add("limit", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["skip"].(int32); localVarOk { - localVarQueryParams.Add("skip", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["filter"].([]string); localVarOk { - localVarQueryParams.Add("filter", parameterToString(localVarTempParam, "csv")) - } - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* SystemInsightsApiService List System Insights Disk Info - Valid filter fields are `system_id` and `disk_index`. - * @param ctx context.Context for authentication, logging, tracing, etc. - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "limit" (int32) - @param "skip" (int32) The offset into the records to return. - @param "filter" ([]string) Supported operators are: eq - @param "xOrgId" (string) - @return []SystemInsightsDiskInfo*/ -func (a *SystemInsightsApiService) SysteminsightsListDiskInfo(ctx context.Context, contentType string, accept string, localVarOptionals map[string]interface{}) ([]SystemInsightsDiskInfo, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload []SystemInsightsDiskInfo - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/systeminsights/disk_info" - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["limit"], "int32", "limit"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["skip"], "int32", "skip"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return successPayload, nil, err - } - - if localVarTempParam, localVarOk := localVarOptionals["limit"].(int32); localVarOk { - localVarQueryParams.Add("limit", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["skip"].(int32); localVarOk { - localVarQueryParams.Add("skip", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["filter"].([]string); localVarOk { - localVarQueryParams.Add("filter", parameterToString(localVarTempParam, "csv")) - } - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* SystemInsightsApiService List System Insights Etc Hosts - Valid filter fields are `system_id` and `address`. - * @param ctx context.Context for authentication, logging, tracing, etc. - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "limit" (int32) - @param "skip" (int32) The offset into the records to return. - @param "filter" ([]string) Supported operators are: eq - @param "xOrgId" (string) - @return []SystemInsightsEtcHosts*/ -func (a *SystemInsightsApiService) SysteminsightsListEtcHosts(ctx context.Context, contentType string, accept string, localVarOptionals map[string]interface{}) ([]SystemInsightsEtcHosts, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload []SystemInsightsEtcHosts - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/systeminsights/etc_hosts" - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["limit"], "int32", "limit"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["skip"], "int32", "skip"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return successPayload, nil, err - } - - if localVarTempParam, localVarOk := localVarOptionals["limit"].(int32); localVarOk { - localVarQueryParams.Add("limit", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["skip"].(int32); localVarOk { - localVarQueryParams.Add("skip", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["filter"].([]string); localVarOk { - localVarQueryParams.Add("filter", parameterToString(localVarTempParam, "csv")) - } - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* SystemInsightsApiService List System Insights Firefox Addons - Valid filter fields are `system_id` and `name`. - * @param ctx context.Context for authentication, logging, tracing, etc. - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "limit" (int32) - @param "skip" (int32) The offset into the records to return. - @param "filter" ([]string) Supported operators are: eq - @param "xOrgId" (string) - @return []SystemInsightsFirefoxAddons*/ -func (a *SystemInsightsApiService) SysteminsightsListFirefoxAddons(ctx context.Context, contentType string, accept string, localVarOptionals map[string]interface{}) ([]SystemInsightsFirefoxAddons, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload []SystemInsightsFirefoxAddons - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/systeminsights/firefox_addons" - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["limit"], "int32", "limit"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["skip"], "int32", "skip"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return successPayload, nil, err - } - - if localVarTempParam, localVarOk := localVarOptionals["limit"].(int32); localVarOk { - localVarQueryParams.Add("limit", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["skip"].(int32); localVarOk { - localVarQueryParams.Add("skip", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["filter"].([]string); localVarOk { - localVarQueryParams.Add("filter", parameterToString(localVarTempParam, "csv")) - } - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* SystemInsightsApiService List System Insights Groups - Valid filter fields are `system_id` and `groupname`. - * @param ctx context.Context for authentication, logging, tracing, etc. - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "limit" (int32) - @param "skip" (int32) The offset into the records to return. - @param "filter" ([]string) Supported operators are: eq - @param "xOrgId" (string) - @return []SystemInsightsGroups*/ -func (a *SystemInsightsApiService) SysteminsightsListGroups(ctx context.Context, contentType string, accept string, localVarOptionals map[string]interface{}) ([]SystemInsightsGroups, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload []SystemInsightsGroups - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/systeminsights/groups" - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["limit"], "int32", "limit"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["skip"], "int32", "skip"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return successPayload, nil, err - } - - if localVarTempParam, localVarOk := localVarOptionals["limit"].(int32); localVarOk { - localVarQueryParams.Add("limit", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["skip"].(int32); localVarOk { - localVarQueryParams.Add("skip", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["filter"].([]string); localVarOk { - localVarQueryParams.Add("filter", parameterToString(localVarTempParam, "csv")) - } - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* SystemInsightsApiService List System Insights IE Extensions - Valid filter fields are `system_id` and `name`. - * @param ctx context.Context for authentication, logging, tracing, etc. - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "limit" (int32) - @param "xOrgId" (string) - @param "skip" (int32) The offset into the records to return. - @param "filter" ([]string) Supported operators are: eq - @return []SystemInsightsIeExtensions*/ -func (a *SystemInsightsApiService) SysteminsightsListIeExtensions(ctx context.Context, contentType string, accept string, localVarOptionals map[string]interface{}) ([]SystemInsightsIeExtensions, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload []SystemInsightsIeExtensions - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/systeminsights/ie_extensions" - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["limit"], "int32", "limit"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["skip"], "int32", "skip"); err != nil { - return successPayload, nil, err - } - - if localVarTempParam, localVarOk := localVarOptionals["limit"].(int32); localVarOk { - localVarQueryParams.Add("limit", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["skip"].(int32); localVarOk { - localVarQueryParams.Add("skip", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["filter"].([]string); localVarOk { - localVarQueryParams.Add("filter", parameterToString(localVarTempParam, "csv")) - } - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* SystemInsightsApiService List System Insights Interface Addresses - Valid filter fields are `system_id` and `address`. - * @param ctx context.Context for authentication, logging, tracing, etc. - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "limit" (int32) - @param "skip" (int32) The offset into the records to return. - @param "filter" ([]string) Supported operators are: eq - @param "xOrgId" (string) - @return []SystemInsightsInterfaceAddresses*/ -func (a *SystemInsightsApiService) SysteminsightsListInterfaceAddresses(ctx context.Context, contentType string, accept string, localVarOptionals map[string]interface{}) ([]SystemInsightsInterfaceAddresses, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload []SystemInsightsInterfaceAddresses - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/systeminsights/interface_addresses" - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["limit"], "int32", "limit"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["skip"], "int32", "skip"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return successPayload, nil, err - } - - if localVarTempParam, localVarOk := localVarOptionals["limit"].(int32); localVarOk { - localVarQueryParams.Add("limit", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["skip"].(int32); localVarOk { - localVarQueryParams.Add("skip", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["filter"].([]string); localVarOk { - localVarQueryParams.Add("filter", parameterToString(localVarTempParam, "csv")) - } - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* SystemInsightsApiService List System Insights Kernel Info - Valid filter fields are `system_id` and `version`. - * @param ctx context.Context for authentication, logging, tracing, etc. - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "limit" (int32) - @param "skip" (int32) The offset into the records to return. - @param "filter" ([]string) Supported operators are: eq - @param "xOrgId" (string) - @return []SystemInsightsKernelInfo*/ -func (a *SystemInsightsApiService) SysteminsightsListKernelInfo(ctx context.Context, contentType string, accept string, localVarOptionals map[string]interface{}) ([]SystemInsightsKernelInfo, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload []SystemInsightsKernelInfo - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/systeminsights/kernel_info" - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["limit"], "int32", "limit"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["skip"], "int32", "skip"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return successPayload, nil, err - } - - if localVarTempParam, localVarOk := localVarOptionals["limit"].(int32); localVarOk { - localVarQueryParams.Add("limit", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["skip"].(int32); localVarOk { - localVarQueryParams.Add("skip", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["filter"].([]string); localVarOk { - localVarQueryParams.Add("filter", parameterToString(localVarTempParam, "csv")) - } - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* SystemInsightsApiService List System Insights Launchd - Valid filter fields are `system_id` and `name`. - * @param ctx context.Context for authentication, logging, tracing, etc. - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "limit" (int32) - @param "xOrgId" (string) - @param "skip" (int32) The offset into the records to return. - @param "filter" ([]string) Supported operators are: eq - @return []SystemInsightsLaunchd*/ -func (a *SystemInsightsApiService) SysteminsightsListLaunchd(ctx context.Context, contentType string, accept string, localVarOptionals map[string]interface{}) ([]SystemInsightsLaunchd, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload []SystemInsightsLaunchd - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/systeminsights/launchd" - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["limit"], "int32", "limit"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["skip"], "int32", "skip"); err != nil { - return successPayload, nil, err - } - - if localVarTempParam, localVarOk := localVarOptionals["limit"].(int32); localVarOk { - localVarQueryParams.Add("limit", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["skip"].(int32); localVarOk { - localVarQueryParams.Add("skip", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["filter"].([]string); localVarOk { - localVarQueryParams.Add("filter", parameterToString(localVarTempParam, "csv")) - } - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* SystemInsightsApiService List System Insights Logged-In Users - Valid filter fields are `system_id` and `user`. - * @param ctx context.Context for authentication, logging, tracing, etc. - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "limit" (int32) - @param "xOrgId" (string) - @param "skip" (int32) The offset into the records to return. - @param "filter" ([]string) Supported operators are: eq - @return []SystemInsightsLoggedInUsers*/ -func (a *SystemInsightsApiService) SysteminsightsListLoggedInUsers(ctx context.Context, contentType string, accept string, localVarOptionals map[string]interface{}) ([]SystemInsightsLoggedInUsers, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload []SystemInsightsLoggedInUsers - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/systeminsights/logged_in_users" - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["limit"], "int32", "limit"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["skip"], "int32", "skip"); err != nil { - return successPayload, nil, err - } - - if localVarTempParam, localVarOk := localVarOptionals["limit"].(int32); localVarOk { - localVarQueryParams.Add("limit", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["skip"].(int32); localVarOk { - localVarQueryParams.Add("skip", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["filter"].([]string); localVarOk { - localVarQueryParams.Add("filter", parameterToString(localVarTempParam, "csv")) - } - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* SystemInsightsApiService List System Insights Logical Drives - Valid filter fields are `system_id` and `device_id`. - * @param ctx context.Context for authentication, logging, tracing, etc. - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "limit" (int32) - @param "skip" (int32) The offset into the records to return. - @param "filter" ([]string) Supported operators are: eq - @param "xOrgId" (string) - @return []SystemInsightsLogicalDrvies*/ -func (a *SystemInsightsApiService) SysteminsightsListLogicalDrives(ctx context.Context, contentType string, accept string, localVarOptionals map[string]interface{}) ([]SystemInsightsLogicalDrvies, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload []SystemInsightsLogicalDrvies - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/systeminsights/logical_drives" - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["limit"], "int32", "limit"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["skip"], "int32", "skip"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return successPayload, nil, err - } - - if localVarTempParam, localVarOk := localVarOptionals["limit"].(int32); localVarOk { - localVarQueryParams.Add("limit", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["skip"].(int32); localVarOk { - localVarQueryParams.Add("skip", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["filter"].([]string); localVarOk { - localVarQueryParams.Add("filter", parameterToString(localVarTempParam, "csv")) - } - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* SystemInsightsApiService List System Insights Mounts - Valid filter fields are `system_id` and `path`. - * @param ctx context.Context for authentication, logging, tracing, etc. - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "limit" (int32) - @param "skip" (int32) The offset into the records to return. - @param "filter" ([]string) Supported operators are: eq - @param "xOrgId" (string) - @return []SystemInsightsMounts*/ -func (a *SystemInsightsApiService) SysteminsightsListMounts(ctx context.Context, contentType string, accept string, localVarOptionals map[string]interface{}) ([]SystemInsightsMounts, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload []SystemInsightsMounts - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/systeminsights/mounts" - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["limit"], "int32", "limit"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["skip"], "int32", "skip"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return successPayload, nil, err - } - - if localVarTempParam, localVarOk := localVarOptionals["limit"].(int32); localVarOk { - localVarQueryParams.Add("limit", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["skip"].(int32); localVarOk { - localVarQueryParams.Add("skip", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["filter"].([]string); localVarOk { - localVarQueryParams.Add("filter", parameterToString(localVarTempParam, "csv")) - } - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* SystemInsightsApiService List System Insights OS Version - Valid filter fields are `system_id` and `version`. - * @param ctx context.Context for authentication, logging, tracing, etc. - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "limit" (int32) - @param "skip" (int32) The offset into the records to return. - @param "filter" ([]string) Supported operators are: eq - @param "xOrgId" (string) - @return []SystemInsightsOsVersion*/ -func (a *SystemInsightsApiService) SysteminsightsListOsVersion(ctx context.Context, contentType string, accept string, localVarOptionals map[string]interface{}) ([]SystemInsightsOsVersion, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload []SystemInsightsOsVersion - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/systeminsights/os_version" - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["limit"], "int32", "limit"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["skip"], "int32", "skip"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return successPayload, nil, err - } - - if localVarTempParam, localVarOk := localVarOptionals["limit"].(int32); localVarOk { - localVarQueryParams.Add("limit", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["skip"].(int32); localVarOk { - localVarQueryParams.Add("skip", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["filter"].([]string); localVarOk { - localVarQueryParams.Add("filter", parameterToString(localVarTempParam, "csv")) - } - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* SystemInsightsApiService List System Insights Patches - Valid filter fields are `system_id` and `hotfix_id`. - * @param ctx context.Context for authentication, logging, tracing, etc. - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "limit" (int32) - @param "skip" (int32) The offset into the records to return. - @param "filter" ([]string) Supported operators are: eq - @param "xOrgId" (string) - @return []SystemInsightsPatches*/ -func (a *SystemInsightsApiService) SysteminsightsListPatches(ctx context.Context, contentType string, accept string, localVarOptionals map[string]interface{}) ([]SystemInsightsPatches, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload []SystemInsightsPatches - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/systeminsights/patches" - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["limit"], "int32", "limit"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["skip"], "int32", "skip"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return successPayload, nil, err - } - - if localVarTempParam, localVarOk := localVarOptionals["limit"].(int32); localVarOk { - localVarQueryParams.Add("limit", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["skip"].(int32); localVarOk { - localVarQueryParams.Add("skip", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["filter"].([]string); localVarOk { - localVarQueryParams.Add("filter", parameterToString(localVarTempParam, "csv")) - } - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* SystemInsightsApiService List System Insights Programs - Valid filter fields are `system_id` and `name`. - * @param ctx context.Context for authentication, logging, tracing, etc. - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "limit" (int32) - @param "skip" (int32) The offset into the records to return. - @param "filter" ([]string) Supported operators are: eq - @param "xOrgId" (string) - @return []SystemInsightsPrograms*/ -func (a *SystemInsightsApiService) SysteminsightsListPrograms(ctx context.Context, contentType string, accept string, localVarOptionals map[string]interface{}) ([]SystemInsightsPrograms, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload []SystemInsightsPrograms - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/systeminsights/programs" - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["limit"], "int32", "limit"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["skip"], "int32", "skip"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return successPayload, nil, err - } - - if localVarTempParam, localVarOk := localVarOptionals["limit"].(int32); localVarOk { - localVarQueryParams.Add("limit", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["skip"].(int32); localVarOk { - localVarQueryParams.Add("skip", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["filter"].([]string); localVarOk { - localVarQueryParams.Add("filter", parameterToString(localVarTempParam, "csv")) - } - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* SystemInsightsApiService List System Insights Safari Extensions - Valid filter fields are `system_id` and `name`. - * @param ctx context.Context for authentication, logging, tracing, etc. - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "limit" (int32) - @param "skip" (int32) The offset into the records to return. - @param "filter" ([]string) Supported operators are: eq - @param "xOrgId" (string) - @return []SystemInsightsSafariExtensions*/ -func (a *SystemInsightsApiService) SysteminsightsListSafariExtensions(ctx context.Context, contentType string, accept string, localVarOptionals map[string]interface{}) ([]SystemInsightsSafariExtensions, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload []SystemInsightsSafariExtensions - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/systeminsights/safari_extensions" - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["limit"], "int32", "limit"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["skip"], "int32", "skip"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return successPayload, nil, err - } - - if localVarTempParam, localVarOk := localVarOptionals["limit"].(int32); localVarOk { - localVarQueryParams.Add("limit", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["skip"].(int32); localVarOk { - localVarQueryParams.Add("skip", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["filter"].([]string); localVarOk { - localVarQueryParams.Add("filter", parameterToString(localVarTempParam, "csv")) - } - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* SystemInsightsApiService List System Insights System Apps - Valid filter fields are `bundle_name`. - * @param ctx context.Context for authentication, logging, tracing, etc. - @param systemId - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "limit" (int32) - @param "skip" (int32) The offset into the records to return. - @param "filter" ([]string) Supported operators are: eq - @param "xOrgId" (string) - @return []SystemInsightsApps*/ -func (a *SystemInsightsApiService) SysteminsightsListSystemApps(ctx context.Context, systemId string, contentType string, accept string, localVarOptionals map[string]interface{}) ([]SystemInsightsApps, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload []SystemInsightsApps - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/systeminsights/{system_id}/apps" - localVarPath = strings.Replace(localVarPath, "{"+"system_id"+"}", fmt.Sprintf("%v", systemId), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["limit"], "int32", "limit"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["skip"], "int32", "skip"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return successPayload, nil, err - } - - if localVarTempParam, localVarOk := localVarOptionals["limit"].(int32); localVarOk { - localVarQueryParams.Add("limit", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["skip"].(int32); localVarOk { - localVarQueryParams.Add("skip", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["filter"].([]string); localVarOk { - localVarQueryParams.Add("filter", parameterToString(localVarTempParam, "csv")) - } - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* SystemInsightsApiService List System Insights System Bitlocker Info - Valid filter fields are `protection_status`. - * @param ctx context.Context for authentication, logging, tracing, etc. - @param systemId - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "limit" (int32) - @param "skip" (int32) The offset into the records to return. - @param "filter" ([]string) Supported operators are: eq - @param "xOrgId" (string) - @return []SystemInsightsBitlockerInfo*/ -func (a *SystemInsightsApiService) SysteminsightsListSystemBitlockerInfo(ctx context.Context, systemId string, contentType string, accept string, localVarOptionals map[string]interface{}) ([]SystemInsightsBitlockerInfo, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload []SystemInsightsBitlockerInfo - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/systeminsights/{system_id}/bitlocker_info" - localVarPath = strings.Replace(localVarPath, "{"+"system_id"+"}", fmt.Sprintf("%v", systemId), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["limit"], "int32", "limit"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["skip"], "int32", "skip"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return successPayload, nil, err - } - - if localVarTempParam, localVarOk := localVarOptionals["limit"].(int32); localVarOk { - localVarQueryParams.Add("limit", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["skip"].(int32); localVarOk { - localVarQueryParams.Add("skip", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["filter"].([]string); localVarOk { - localVarQueryParams.Add("filter", parameterToString(localVarTempParam, "csv")) - } - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* SystemInsightsApiService List System Insights System Browser Plugins - Valid filter fields are `name`. - * @param ctx context.Context for authentication, logging, tracing, etc. - @param systemId - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "limit" (int32) - @param "skip" (int32) The offset into the records to return. - @param "filter" ([]string) Supported operators are: eq - @param "xOrgId" (string) - @return []SystemInsightsBrowserPlugins*/ -func (a *SystemInsightsApiService) SysteminsightsListSystemBrowserPlugins(ctx context.Context, systemId string, contentType string, accept string, localVarOptionals map[string]interface{}) ([]SystemInsightsBrowserPlugins, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload []SystemInsightsBrowserPlugins - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/systeminsights/{system_id}/browser_plugins" - localVarPath = strings.Replace(localVarPath, "{"+"system_id"+"}", fmt.Sprintf("%v", systemId), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["limit"], "int32", "limit"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["skip"], "int32", "skip"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return successPayload, nil, err - } - - if localVarTempParam, localVarOk := localVarOptionals["limit"].(int32); localVarOk { - localVarQueryParams.Add("limit", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["skip"].(int32); localVarOk { - localVarQueryParams.Add("skip", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["filter"].([]string); localVarOk { - localVarQueryParams.Add("filter", parameterToString(localVarTempParam, "csv")) - } - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* SystemInsightsApiService List System Insights System Chrome Extensions - Valid filter fields are `name`. - * @param ctx context.Context for authentication, logging, tracing, etc. - @param systemId - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "limit" (int32) - @param "skip" (int32) The offset into the records to return. - @param "filter" ([]string) Supported operators are: eq - @param "xOrgId" (string) - @return []SystemInsightsChromeExtensions*/ -func (a *SystemInsightsApiService) SysteminsightsListSystemChromeExtensions(ctx context.Context, systemId string, contentType string, accept string, localVarOptionals map[string]interface{}) ([]SystemInsightsChromeExtensions, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload []SystemInsightsChromeExtensions - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/systeminsights/{system_id}/chrome_extensions" - localVarPath = strings.Replace(localVarPath, "{"+"system_id"+"}", fmt.Sprintf("%v", systemId), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["limit"], "int32", "limit"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["skip"], "int32", "skip"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return successPayload, nil, err - } - - if localVarTempParam, localVarOk := localVarOptionals["limit"].(int32); localVarOk { - localVarQueryParams.Add("limit", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["skip"].(int32); localVarOk { - localVarQueryParams.Add("skip", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["filter"].([]string); localVarOk { - localVarQueryParams.Add("filter", parameterToString(localVarTempParam, "csv")) - } - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* SystemInsightsApiService List System Insights System Control - Valid filter fields are `system_id` and `name`. - * @param ctx context.Context for authentication, logging, tracing, etc. - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "limit" (int32) - @param "skip" (int32) The offset into the records to return. - @param "filter" ([]string) Supported operators are: eq - @param "xOrgId" (string) - @return []SystemInsightsSystemControls*/ -func (a *SystemInsightsApiService) SysteminsightsListSystemControls(ctx context.Context, contentType string, accept string, localVarOptionals map[string]interface{}) ([]SystemInsightsSystemControls, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload []SystemInsightsSystemControls - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/systeminsights/system_controls" - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["limit"], "int32", "limit"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["skip"], "int32", "skip"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return successPayload, nil, err - } - - if localVarTempParam, localVarOk := localVarOptionals["limit"].(int32); localVarOk { - localVarQueryParams.Add("limit", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["skip"].(int32); localVarOk { - localVarQueryParams.Add("skip", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["filter"].([]string); localVarOk { - localVarQueryParams.Add("filter", parameterToString(localVarTempParam, "csv")) - } - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* SystemInsightsApiService List System Insights System Disk Encryption - Valid filter fields are `encryption_status`. - * @param ctx context.Context for authentication, logging, tracing, etc. - @param systemId - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "limit" (int32) - @param "skip" (int32) The offset into the records to return. - @param "filter" ([]string) Supported operators are: eq - @param "xOrgId" (string) - @return []SystemInsightsDiskEncryption*/ -func (a *SystemInsightsApiService) SysteminsightsListSystemDiskEncryption(ctx context.Context, systemId string, contentType string, accept string, localVarOptionals map[string]interface{}) ([]SystemInsightsDiskEncryption, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload []SystemInsightsDiskEncryption - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/systeminsights/{system_id}/disk_encryption" - localVarPath = strings.Replace(localVarPath, "{"+"system_id"+"}", fmt.Sprintf("%v", systemId), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["limit"], "int32", "limit"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["skip"], "int32", "skip"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return successPayload, nil, err - } - - if localVarTempParam, localVarOk := localVarOptionals["limit"].(int32); localVarOk { - localVarQueryParams.Add("limit", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["skip"].(int32); localVarOk { - localVarQueryParams.Add("skip", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["filter"].([]string); localVarOk { - localVarQueryParams.Add("filter", parameterToString(localVarTempParam, "csv")) - } - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* SystemInsightsApiService List System Insights System Disk Info - Valid filter fields are `disk_index`. - * @param ctx context.Context for authentication, logging, tracing, etc. - @param systemId - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "limit" (int32) - @param "skip" (int32) The offset into the records to return. - @param "filter" ([]string) Supported operators are: eq - @param "xOrgId" (string) - @return []SystemInsightsBitlockerInfo*/ -func (a *SystemInsightsApiService) SysteminsightsListSystemDiskInfo(ctx context.Context, systemId string, contentType string, accept string, localVarOptionals map[string]interface{}) ([]SystemInsightsBitlockerInfo, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload []SystemInsightsBitlockerInfo - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/systeminsights/{system_id}/disk_info" - localVarPath = strings.Replace(localVarPath, "{"+"system_id"+"}", fmt.Sprintf("%v", systemId), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["limit"], "int32", "limit"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["skip"], "int32", "skip"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return successPayload, nil, err - } - - if localVarTempParam, localVarOk := localVarOptionals["limit"].(int32); localVarOk { - localVarQueryParams.Add("limit", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["skip"].(int32); localVarOk { - localVarQueryParams.Add("skip", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["filter"].([]string); localVarOk { - localVarQueryParams.Add("filter", parameterToString(localVarTempParam, "csv")) - } - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* SystemInsightsApiService List System Insights System Etc Hosts - Valid filter fields are `address`. - * @param ctx context.Context for authentication, logging, tracing, etc. - @param systemId - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "limit" (int32) - @param "skip" (int32) The offset into the records to return. - @param "filter" ([]string) Supported operators are: eq - @param "xOrgId" (string) - @return []SystemInsightsBitlockerInfo*/ -func (a *SystemInsightsApiService) SysteminsightsListSystemEtcHosts(ctx context.Context, systemId string, contentType string, accept string, localVarOptionals map[string]interface{}) ([]SystemInsightsBitlockerInfo, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload []SystemInsightsBitlockerInfo - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/systeminsights/{system_id}/etc_hosts" - localVarPath = strings.Replace(localVarPath, "{"+"system_id"+"}", fmt.Sprintf("%v", systemId), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["limit"], "int32", "limit"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["skip"], "int32", "skip"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return successPayload, nil, err - } - - if localVarTempParam, localVarOk := localVarOptionals["limit"].(int32); localVarOk { - localVarQueryParams.Add("limit", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["skip"].(int32); localVarOk { - localVarQueryParams.Add("skip", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["filter"].([]string); localVarOk { - localVarQueryParams.Add("filter", parameterToString(localVarTempParam, "csv")) - } - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* SystemInsightsApiService List System Insights System Firefox Addons - Valid filter fields are `name`. - * @param ctx context.Context for authentication, logging, tracing, etc. - @param systemId - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "limit" (int32) - @param "skip" (int32) The offset into the records to return. - @param "filter" ([]string) Supported operators are: eq - @param "xOrgId" (string) - @return []SystemInsightsFirefoxAddons*/ -func (a *SystemInsightsApiService) SysteminsightsListSystemFirefoxAddons(ctx context.Context, systemId string, contentType string, accept string, localVarOptionals map[string]interface{}) ([]SystemInsightsFirefoxAddons, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload []SystemInsightsFirefoxAddons - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/systeminsights/{system_id}/firefox_addons" - localVarPath = strings.Replace(localVarPath, "{"+"system_id"+"}", fmt.Sprintf("%v", systemId), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["limit"], "int32", "limit"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["skip"], "int32", "skip"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return successPayload, nil, err - } - - if localVarTempParam, localVarOk := localVarOptionals["limit"].(int32); localVarOk { - localVarQueryParams.Add("limit", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["skip"].(int32); localVarOk { - localVarQueryParams.Add("skip", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["filter"].([]string); localVarOk { - localVarQueryParams.Add("filter", parameterToString(localVarTempParam, "csv")) - } - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* SystemInsightsApiService List System Insights System Groups - Valid filter fields are `groupname`. - * @param ctx context.Context for authentication, logging, tracing, etc. - @param systemId - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "limit" (int32) - @param "skip" (int32) The offset into the records to return. - @param "filter" ([]string) Supported operators are: eq - @param "xOrgId" (string) - @return []SystemInsightsGroups*/ -func (a *SystemInsightsApiService) SysteminsightsListSystemGroups(ctx context.Context, systemId string, contentType string, accept string, localVarOptionals map[string]interface{}) ([]SystemInsightsGroups, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload []SystemInsightsGroups - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/systeminsights/{system_id}/groups" - localVarPath = strings.Replace(localVarPath, "{"+"system_id"+"}", fmt.Sprintf("%v", systemId), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["limit"], "int32", "limit"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["skip"], "int32", "skip"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return successPayload, nil, err - } - - if localVarTempParam, localVarOk := localVarOptionals["limit"].(int32); localVarOk { - localVarQueryParams.Add("limit", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["skip"].(int32); localVarOk { - localVarQueryParams.Add("skip", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["filter"].([]string); localVarOk { - localVarQueryParams.Add("filter", parameterToString(localVarTempParam, "csv")) - } - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* SystemInsightsApiService List System Insights System Info - Valid filter fields are `system_id` and `cpu_subtype`. - * @param ctx context.Context for authentication, logging, tracing, etc. - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "limit" (int32) - @param "skip" (int32) The offset into the records to return. - @param "filter" ([]string) Supported operators are: eq - @param "xOrgId" (string) - @return []SystemInsightsSystemInfo*/ -func (a *SystemInsightsApiService) SysteminsightsListSystemInfo(ctx context.Context, contentType string, accept string, localVarOptionals map[string]interface{}) ([]SystemInsightsSystemInfo, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload []SystemInsightsSystemInfo - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/systeminsights/system_info" - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["limit"], "int32", "limit"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["skip"], "int32", "skip"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return successPayload, nil, err - } - - if localVarTempParam, localVarOk := localVarOptionals["limit"].(int32); localVarOk { - localVarQueryParams.Add("limit", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["skip"].(int32); localVarOk { - localVarQueryParams.Add("skip", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["filter"].([]string); localVarOk { - localVarQueryParams.Add("filter", parameterToString(localVarTempParam, "csv")) - } - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* SystemInsightsApiService List System Insights System Interface Addresses - Valid filter fields are `address`. - * @param ctx context.Context for authentication, logging, tracing, etc. - @param systemId - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "limit" (int32) - @param "skip" (int32) The offset into the records to return. - @param "filter" ([]string) Supported operators are: eq - @param "xOrgId" (string) - @return []SystemInsightsInterfaceAddresses*/ -func (a *SystemInsightsApiService) SysteminsightsListSystemInterfaceAddresses(ctx context.Context, systemId string, contentType string, accept string, localVarOptionals map[string]interface{}) ([]SystemInsightsInterfaceAddresses, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload []SystemInsightsInterfaceAddresses - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/systeminsights/{system_id}/interface_addresses" - localVarPath = strings.Replace(localVarPath, "{"+"system_id"+"}", fmt.Sprintf("%v", systemId), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["limit"], "int32", "limit"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["skip"], "int32", "skip"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return successPayload, nil, err - } - - if localVarTempParam, localVarOk := localVarOptionals["limit"].(int32); localVarOk { - localVarQueryParams.Add("limit", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["skip"].(int32); localVarOk { - localVarQueryParams.Add("skip", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["filter"].([]string); localVarOk { - localVarQueryParams.Add("filter", parameterToString(localVarTempParam, "csv")) - } - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* SystemInsightsApiService List System Insights System Kernel Info - Valid filter fields are `version`. - * @param ctx context.Context for authentication, logging, tracing, etc. - @param systemId - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "limit" (int32) - @param "skip" (int32) The offset into the records to return. - @param "filter" ([]string) Supported operators are: eq - @param "xOrgId" (string) - @return []SystemInsightsKernelInfo*/ -func (a *SystemInsightsApiService) SysteminsightsListSystemKernelInfo(ctx context.Context, systemId string, contentType string, accept string, localVarOptionals map[string]interface{}) ([]SystemInsightsKernelInfo, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload []SystemInsightsKernelInfo - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/systeminsights/{system_id}/kernel_info" - localVarPath = strings.Replace(localVarPath, "{"+"system_id"+"}", fmt.Sprintf("%v", systemId), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["limit"], "int32", "limit"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["skip"], "int32", "skip"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return successPayload, nil, err - } - - if localVarTempParam, localVarOk := localVarOptionals["limit"].(int32); localVarOk { - localVarQueryParams.Add("limit", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["skip"].(int32); localVarOk { - localVarQueryParams.Add("skip", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["filter"].([]string); localVarOk { - localVarQueryParams.Add("filter", parameterToString(localVarTempParam, "csv")) - } - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* SystemInsightsApiService List System Insights System Logical Drives - Valid filter fields are `device_id`. - * @param ctx context.Context for authentication, logging, tracing, etc. - @param systemId - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "limit" (int32) - @param "skip" (int32) The offset into the records to return. - @param "filter" ([]string) Supported operators are: eq - @param "xOrgId" (string) - @return []SystemInsightsLogicalDrvies*/ -func (a *SystemInsightsApiService) SysteminsightsListSystemLogicalDrives(ctx context.Context, systemId string, contentType string, accept string, localVarOptionals map[string]interface{}) ([]SystemInsightsLogicalDrvies, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload []SystemInsightsLogicalDrvies - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/systeminsights/{system_id}/logical_drives" - localVarPath = strings.Replace(localVarPath, "{"+"system_id"+"}", fmt.Sprintf("%v", systemId), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["limit"], "int32", "limit"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["skip"], "int32", "skip"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return successPayload, nil, err - } - - if localVarTempParam, localVarOk := localVarOptionals["limit"].(int32); localVarOk { - localVarQueryParams.Add("limit", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["skip"].(int32); localVarOk { - localVarQueryParams.Add("skip", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["filter"].([]string); localVarOk { - localVarQueryParams.Add("filter", parameterToString(localVarTempParam, "csv")) - } - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* SystemInsightsApiService List System Insights System Mounts - Valid filter fields are `path`. - * @param ctx context.Context for authentication, logging, tracing, etc. - @param systemId - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "limit" (int32) - @param "skip" (int32) The offset into the records to return. - @param "filter" ([]string) Supported operators are: eq - @param "xOrgId" (string) - @return []SystemInsightsMounts*/ -func (a *SystemInsightsApiService) SysteminsightsListSystemMounts(ctx context.Context, systemId string, contentType string, accept string, localVarOptionals map[string]interface{}) ([]SystemInsightsMounts, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload []SystemInsightsMounts - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/systeminsights/{system_id}/mounts" - localVarPath = strings.Replace(localVarPath, "{"+"system_id"+"}", fmt.Sprintf("%v", systemId), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["limit"], "int32", "limit"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["skip"], "int32", "skip"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return successPayload, nil, err - } - - if localVarTempParam, localVarOk := localVarOptionals["limit"].(int32); localVarOk { - localVarQueryParams.Add("limit", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["skip"].(int32); localVarOk { - localVarQueryParams.Add("skip", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["filter"].([]string); localVarOk { - localVarQueryParams.Add("filter", parameterToString(localVarTempParam, "csv")) - } - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* SystemInsightsApiService List System Insights System OS Version - Valid filter fields are `version`. - * @param ctx context.Context for authentication, logging, tracing, etc. - @param systemId - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "limit" (int32) - @param "skip" (int32) The offset into the records to return. - @param "filter" ([]string) Supported operators are: eq - @param "xOrgId" (string) - @return []SystemInsightsOsVersion*/ -func (a *SystemInsightsApiService) SysteminsightsListSystemOsVersion(ctx context.Context, systemId string, contentType string, accept string, localVarOptionals map[string]interface{}) ([]SystemInsightsOsVersion, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload []SystemInsightsOsVersion - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/systeminsights/{system_id}/os_version" - localVarPath = strings.Replace(localVarPath, "{"+"system_id"+"}", fmt.Sprintf("%v", systemId), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["limit"], "int32", "limit"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["skip"], "int32", "skip"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return successPayload, nil, err - } - - if localVarTempParam, localVarOk := localVarOptionals["limit"].(int32); localVarOk { - localVarQueryParams.Add("limit", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["skip"].(int32); localVarOk { - localVarQueryParams.Add("skip", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["filter"].([]string); localVarOk { - localVarQueryParams.Add("filter", parameterToString(localVarTempParam, "csv")) - } - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* SystemInsightsApiService List System Insights System Patches - Valid filter fields are `hotfix_id `. - * @param ctx context.Context for authentication, logging, tracing, etc. - @param systemId - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "limit" (int32) - @param "skip" (int32) The offset into the records to return. - @param "filter" ([]string) Supported operators are: eq - @param "xOrgId" (string) - @return []SystemInsightsPatches*/ -func (a *SystemInsightsApiService) SysteminsightsListSystemPatches(ctx context.Context, systemId string, contentType string, accept string, localVarOptionals map[string]interface{}) ([]SystemInsightsPatches, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload []SystemInsightsPatches - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/systeminsights/{system_id}/patches" - localVarPath = strings.Replace(localVarPath, "{"+"system_id"+"}", fmt.Sprintf("%v", systemId), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["limit"], "int32", "limit"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["skip"], "int32", "skip"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return successPayload, nil, err - } - - if localVarTempParam, localVarOk := localVarOptionals["limit"].(int32); localVarOk { - localVarQueryParams.Add("limit", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["skip"].(int32); localVarOk { - localVarQueryParams.Add("skip", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["filter"].([]string); localVarOk { - localVarQueryParams.Add("filter", parameterToString(localVarTempParam, "csv")) - } - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* SystemInsightsApiService List System Insights System Programs - Valid filter fields are `name`. - * @param ctx context.Context for authentication, logging, tracing, etc. - @param systemId - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "limit" (int32) - @param "skip" (int32) The offset into the records to return. - @param "filter" ([]string) Supported operators are: eq - @param "xOrgId" (string) - @return []SystemInsightsPrograms*/ -func (a *SystemInsightsApiService) SysteminsightsListSystemPrograms(ctx context.Context, systemId string, contentType string, accept string, localVarOptionals map[string]interface{}) ([]SystemInsightsPrograms, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload []SystemInsightsPrograms - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/systeminsights/{system_id}/programs" - localVarPath = strings.Replace(localVarPath, "{"+"system_id"+"}", fmt.Sprintf("%v", systemId), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["limit"], "int32", "limit"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["skip"], "int32", "skip"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return successPayload, nil, err - } - - if localVarTempParam, localVarOk := localVarOptionals["limit"].(int32); localVarOk { - localVarQueryParams.Add("limit", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["skip"].(int32); localVarOk { - localVarQueryParams.Add("skip", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["filter"].([]string); localVarOk { - localVarQueryParams.Add("filter", parameterToString(localVarTempParam, "csv")) - } - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* SystemInsightsApiService List System Insights System Safari Extensions - Valid filter fields are `name`. - * @param ctx context.Context for authentication, logging, tracing, etc. - @param systemId - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "limit" (int32) - @param "skip" (int32) The offset into the records to return. - @param "filter" ([]string) Supported operators are: eq - @param "xOrgId" (string) - @return []SystemInsightsSafariExtensions*/ -func (a *SystemInsightsApiService) SysteminsightsListSystemSafariExtensions(ctx context.Context, systemId string, contentType string, accept string, localVarOptionals map[string]interface{}) ([]SystemInsightsSafariExtensions, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload []SystemInsightsSafariExtensions - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/systeminsights/{system_id}/safari_extensions" - localVarPath = strings.Replace(localVarPath, "{"+"system_id"+"}", fmt.Sprintf("%v", systemId), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["limit"], "int32", "limit"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["skip"], "int32", "skip"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return successPayload, nil, err - } - - if localVarTempParam, localVarOk := localVarOptionals["limit"].(int32); localVarOk { - localVarQueryParams.Add("limit", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["skip"].(int32); localVarOk { - localVarQueryParams.Add("skip", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["filter"].([]string); localVarOk { - localVarQueryParams.Add("filter", parameterToString(localVarTempParam, "csv")) - } - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* SystemInsightsApiService List System Insights System System Controls - Valid filter fields are `name`. - * @param ctx context.Context for authentication, logging, tracing, etc. - @param systemId - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "limit" (int32) - @param "skip" (int32) The offset into the records to return. - @param "filter" ([]string) Supported operators are: eq - @param "xOrgId" (string) - @return []SystemInsightsSystemControls*/ -func (a *SystemInsightsApiService) SysteminsightsListSystemSystemControls(ctx context.Context, systemId string, contentType string, accept string, localVarOptionals map[string]interface{}) ([]SystemInsightsSystemControls, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload []SystemInsightsSystemControls - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/systeminsights/{system_id}/system_controls" - localVarPath = strings.Replace(localVarPath, "{"+"system_id"+"}", fmt.Sprintf("%v", systemId), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["limit"], "int32", "limit"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["skip"], "int32", "skip"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return successPayload, nil, err - } - - if localVarTempParam, localVarOk := localVarOptionals["limit"].(int32); localVarOk { - localVarQueryParams.Add("limit", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["skip"].(int32); localVarOk { - localVarQueryParams.Add("skip", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["filter"].([]string); localVarOk { - localVarQueryParams.Add("filter", parameterToString(localVarTempParam, "csv")) - } - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* SystemInsightsApiService List System Insights System System Info - Valid filter fields are `cpu_subtype`. - * @param ctx context.Context for authentication, logging, tracing, etc. - @param systemId - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "limit" (int32) - @param "skip" (int32) The offset into the records to return. - @param "filter" ([]string) Supported operators are: eq - @param "xOrgId" (string) - @return []SystemInsightsSystemInfo*/ -func (a *SystemInsightsApiService) SysteminsightsListSystemSystemInfo(ctx context.Context, systemId string, contentType string, accept string, localVarOptionals map[string]interface{}) ([]SystemInsightsSystemInfo, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload []SystemInsightsSystemInfo - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/systeminsights/{system_id}/system_info" - localVarPath = strings.Replace(localVarPath, "{"+"system_id"+"}", fmt.Sprintf("%v", systemId), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["limit"], "int32", "limit"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["skip"], "int32", "skip"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return successPayload, nil, err - } - - if localVarTempParam, localVarOk := localVarOptionals["limit"].(int32); localVarOk { - localVarQueryParams.Add("limit", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["skip"].(int32); localVarOk { - localVarQueryParams.Add("skip", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["filter"].([]string); localVarOk { - localVarQueryParams.Add("filter", parameterToString(localVarTempParam, "csv")) - } - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* SystemInsightsApiService List System Insights System Uptime - Valid filter fields are `days`. - * @param ctx context.Context for authentication, logging, tracing, etc. - @param systemId - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "limit" (int32) - @param "skip" (int32) The offset into the records to return. - @param "filter" ([]string) Supported operators are: eq - @param "xOrgId" (string) - @return []SystemInsightsUptime*/ -func (a *SystemInsightsApiService) SysteminsightsListSystemUptime(ctx context.Context, systemId string, contentType string, accept string, localVarOptionals map[string]interface{}) ([]SystemInsightsUptime, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload []SystemInsightsUptime - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/systeminsights/{system_id}/uptime" - localVarPath = strings.Replace(localVarPath, "{"+"system_id"+"}", fmt.Sprintf("%v", systemId), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["limit"], "int32", "limit"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["skip"], "int32", "skip"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return successPayload, nil, err - } - - if localVarTempParam, localVarOk := localVarOptionals["limit"].(int32); localVarOk { - localVarQueryParams.Add("limit", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["skip"].(int32); localVarOk { - localVarQueryParams.Add("skip", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["filter"].([]string); localVarOk { - localVarQueryParams.Add("filter", parameterToString(localVarTempParam, "csv")) - } - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* SystemInsightsApiService List System Insights System Users - Valid filter fields are `username`. - * @param ctx context.Context for authentication, logging, tracing, etc. - @param systemId - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "limit" (int32) - @param "skip" (int32) The offset into the records to return. - @param "filter" ([]string) Supported operators are: eq - @param "xOrgId" (string) - @return []SystemInsightsUsers*/ -func (a *SystemInsightsApiService) SysteminsightsListSystemUsers(ctx context.Context, systemId string, contentType string, accept string, localVarOptionals map[string]interface{}) ([]SystemInsightsUsers, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload []SystemInsightsUsers - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/systeminsights/{system_id}/users" - localVarPath = strings.Replace(localVarPath, "{"+"system_id"+"}", fmt.Sprintf("%v", systemId), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["limit"], "int32", "limit"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["skip"], "int32", "skip"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return successPayload, nil, err - } - - if localVarTempParam, localVarOk := localVarOptionals["limit"].(int32); localVarOk { - localVarQueryParams.Add("limit", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["skip"].(int32); localVarOk { - localVarQueryParams.Add("skip", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["filter"].([]string); localVarOk { - localVarQueryParams.Add("filter", parameterToString(localVarTempParam, "csv")) - } - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* SystemInsightsApiService List System Insights Uptime - Valid filter fields are `system_id` and `days`. - * @param ctx context.Context for authentication, logging, tracing, etc. - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "limit" (int32) - @param "skip" (int32) The offset into the records to return. - @param "filter" ([]string) Supported operators are: eq - @param "xOrgId" (string) - @return []SystemInsightsUptime*/ -func (a *SystemInsightsApiService) SysteminsightsListUptime(ctx context.Context, contentType string, accept string, localVarOptionals map[string]interface{}) ([]SystemInsightsUptime, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload []SystemInsightsUptime - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/systeminsights/uptime" - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["limit"], "int32", "limit"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["skip"], "int32", "skip"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return successPayload, nil, err - } - - if localVarTempParam, localVarOk := localVarOptionals["limit"].(int32); localVarOk { - localVarQueryParams.Add("limit", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["skip"].(int32); localVarOk { - localVarQueryParams.Add("skip", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["filter"].([]string); localVarOk { - localVarQueryParams.Add("filter", parameterToString(localVarTempParam, "csv")) - } - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* SystemInsightsApiService List System Insights USB Devices - Valid filter fields are `system_id` and `model`. - * @param ctx context.Context for authentication, logging, tracing, etc. - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "limit" (int32) - @param "xOrgId" (string) - @param "skip" (int32) The offset into the records to return. - @param "filter" ([]string) Supported operators are: eq - @return []SystemInsightsUsbDevices*/ -func (a *SystemInsightsApiService) SysteminsightsListUsbDevices(ctx context.Context, contentType string, accept string, localVarOptionals map[string]interface{}) ([]SystemInsightsUsbDevices, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload []SystemInsightsUsbDevices - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/systeminsights/usb_devices" - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["limit"], "int32", "limit"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["skip"], "int32", "skip"); err != nil { - return successPayload, nil, err - } - - if localVarTempParam, localVarOk := localVarOptionals["limit"].(int32); localVarOk { - localVarQueryParams.Add("limit", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["skip"].(int32); localVarOk { - localVarQueryParams.Add("skip", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["filter"].([]string); localVarOk { - localVarQueryParams.Add("filter", parameterToString(localVarTempParam, "csv")) - } - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* SystemInsightsApiService List System Insights User Groups - Only valid filter field is `system_id`. - * @param ctx context.Context for authentication, logging, tracing, etc. - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "limit" (int32) - @param "xOrgId" (string) - @param "skip" (int32) The offset into the records to return. - @param "filter" ([]string) Supported operators are: eq - @return []SystemInsightsUserGroups*/ -func (a *SystemInsightsApiService) SysteminsightsListUserGroups(ctx context.Context, contentType string, accept string, localVarOptionals map[string]interface{}) ([]SystemInsightsUserGroups, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload []SystemInsightsUserGroups - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/systeminsights/user_groups" - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["limit"], "int32", "limit"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["skip"], "int32", "skip"); err != nil { - return successPayload, nil, err - } - - if localVarTempParam, localVarOk := localVarOptionals["limit"].(int32); localVarOk { - localVarQueryParams.Add("limit", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["skip"].(int32); localVarOk { - localVarQueryParams.Add("skip", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["filter"].([]string); localVarOk { - localVarQueryParams.Add("filter", parameterToString(localVarTempParam, "csv")) - } - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* SystemInsightsApiService List System Insights Users - Valid filter fields are `system_id` and `username`. - * @param ctx context.Context for authentication, logging, tracing, etc. - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "limit" (int32) - @param "skip" (int32) The offset into the records to return. - @param "filter" ([]string) Supported operators are: eq - @param "xOrgId" (string) - @return []SystemInsightsUsers*/ -func (a *SystemInsightsApiService) SysteminsightsListUsers(ctx context.Context, contentType string, accept string, localVarOptionals map[string]interface{}) ([]SystemInsightsUsers, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload []SystemInsightsUsers - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/systeminsights/users" - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["limit"], "int32", "limit"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["skip"], "int32", "skip"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return successPayload, nil, err - } - - if localVarTempParam, localVarOk := localVarOptionals["limit"].(int32); localVarOk { - localVarQueryParams.Add("limit", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["skip"].(int32); localVarOk { - localVarQueryParams.Add("skip", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["filter"].([]string); localVarOk { - localVarQueryParams.Add("filter", parameterToString(localVarTempParam, "csv")) - } - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* SystemInsightsApiService List System Insights Windows Crashes - Valid filter fields are `system_id` and `type`. - * @param ctx context.Context for authentication, logging, tracing, etc. - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "limit" (int32) - @param "xOrgId" (string) - @param "skip" (int32) The offset into the records to return. - @param "filter" ([]string) Supported operators are: eq - @return []SystemInsightsWindowsCrashes*/ -func (a *SystemInsightsApiService) SysteminsightsListWindowsCrashes(ctx context.Context, contentType string, accept string, localVarOptionals map[string]interface{}) ([]SystemInsightsWindowsCrashes, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload []SystemInsightsWindowsCrashes - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/systeminsights/windows_crashes" - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["limit"], "int32", "limit"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["skip"], "int32", "skip"); err != nil { - return successPayload, nil, err - } - - if localVarTempParam, localVarOk := localVarOptionals["limit"].(int32); localVarOk { - localVarQueryParams.Add("limit", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["skip"].(int32); localVarOk { - localVarQueryParams.Add("skip", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["filter"].([]string); localVarOk { - localVarQueryParams.Add("filter", parameterToString(localVarTempParam, "csv")) - } - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - diff --git a/v2/system_insights_apps.go b/v2/system_insights_apps.go deleted file mode 100644 index 78c61dc..0000000 --- a/v2/system_insights_apps.go +++ /dev/null @@ -1,55 +0,0 @@ -/* - * JumpCloud APIs - * - * JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. - * - * API version: 2.0 - * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) - */ - -package v2 - -type SystemInsightsApps struct { - - ApplescriptEnabled string `json:"applescript_enabled,omitempty"` - - BundleExecutable string `json:"bundle_executable,omitempty"` - - BundleIdentifier string `json:"bundle_identifier,omitempty"` - - BundleName string `json:"bundle_name,omitempty"` - - BundlePackageType string `json:"bundle_package_type,omitempty"` - - BundleShortVersion string `json:"bundle_short_version,omitempty"` - - BundleVersion string `json:"bundle_version,omitempty"` - - Category string `json:"category,omitempty"` - - CollectionTime string `json:"collection_time,omitempty"` - - Compiler string `json:"compiler,omitempty"` - - Copyright string `json:"copyright,omitempty"` - - DevelopmentRegion string `json:"development_region,omitempty"` - - DisplayName string `json:"display_name,omitempty"` - - Element string `json:"element,omitempty"` - - Environment string `json:"environment,omitempty"` - - InfoString string `json:"info_string,omitempty"` - - LastOpenedTime float32 `json:"last_opened_time,omitempty"` - - MinimumSystemVersion string `json:"minimum_system_version,omitempty"` - - Name string `json:"name,omitempty"` - - Path string `json:"path,omitempty"` - - SystemId string `json:"system_id,omitempty"` -} diff --git a/v2/system_insights_battery.go b/v2/system_insights_battery.go deleted file mode 100644 index ffe87e1..0000000 --- a/v2/system_insights_battery.go +++ /dev/null @@ -1,53 +0,0 @@ -/* - * JumpCloud APIs - * - * JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. - * - * API version: 2.0 - * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) - */ - -package v2 - -type SystemInsightsBattery struct { - - Amgerage int32 `json:"amgerage,omitempty"` - - Charged int32 `json:"charged,omitempty"` - - Charging int32 `json:"charging,omitempty"` - - CollectionTime string `json:"collection_time,omitempty"` - - Condition string `json:"condition,omitempty"` - - CurrentCapacity int32 `json:"current_capacity,omitempty"` - - CycleCount int32 `json:"cycle_count,omitempty"` - - DesignedCapacity int32 `json:"designed_capacity,omitempty"` - - Health string `json:"health,omitempty"` - - ManufactureDate int32 `json:"manufacture_date,omitempty"` - - Manufacturer string `json:"manufacturer,omitempty"` - - MaxCapacity int32 `json:"max_capacity,omitempty"` - - MinutesToFullCharge int32 `json:"minutes_to_full_charge,omitempty"` - - MinutesUntilEmpty int32 `json:"minutes_until_empty,omitempty"` - - Model string `json:"model,omitempty"` - - PercentRemaining int32 `json:"percent_remaining,omitempty"` - - SerialNumber string `json:"serial_number,omitempty"` - - State string `json:"state,omitempty"` - - SystemId string `json:"system_id,omitempty"` - - Voltage int32 `json:"voltage,omitempty"` -} diff --git a/v2/system_insights_bitlocker_info.go b/v2/system_insights_bitlocker_info.go deleted file mode 100644 index 74df7aa..0000000 --- a/v2/system_insights_bitlocker_info.go +++ /dev/null @@ -1,29 +0,0 @@ -/* - * JumpCloud APIs - * - * JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. - * - * API version: 2.0 - * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) - */ - -package v2 - -type SystemInsightsBitlockerInfo struct { - - CollectionTime string `json:"collection_time,omitempty"` - - ConversionStatus int32 `json:"conversion_status,omitempty"` - - DeviceId string `json:"device_id,omitempty"` - - DriveLetter string `json:"drive_letter,omitempty"` - - EncryptionMethod string `json:"encryption_method,omitempty"` - - PersistentVolumeId string `json:"persistent_volume_id,omitempty"` - - ProtectionStatus int32 `json:"protection_status,omitempty"` - - SystemId string `json:"system_id,omitempty"` -} diff --git a/v2/system_insights_browser_plugins.go b/v2/system_insights_browser_plugins.go deleted file mode 100644 index 3b3bb66..0000000 --- a/v2/system_insights_browser_plugins.go +++ /dev/null @@ -1,37 +0,0 @@ -/* - * JumpCloud APIs - * - * JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. - * - * API version: 2.0 - * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) - */ - -package v2 - -type SystemInsightsBrowserPlugins struct { - - CollectionTime string `json:"collection_time,omitempty"` - - Description string `json:"description,omitempty"` - - DevelopmentRegion string `json:"development_region,omitempty"` - - Disabled int32 `json:"disabled,omitempty"` - - Identifier string `json:"identifier,omitempty"` - - Name string `json:"name,omitempty"` - - Native int32 `json:"native,omitempty"` - - Path string `json:"path,omitempty"` - - Sdk string `json:"sdk,omitempty"` - - SystemId string `json:"system_id,omitempty"` - - Uid string `json:"uid,omitempty"` - - Version string `json:"version,omitempty"` -} diff --git a/v2/system_insights_chrome_extensions.go b/v2/system_insights_chrome_extensions.go deleted file mode 100644 index e8222d2..0000000 --- a/v2/system_insights_chrome_extensions.go +++ /dev/null @@ -1,39 +0,0 @@ -/* - * JumpCloud APIs - * - * JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. - * - * API version: 2.0 - * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) - */ - -package v2 - -type SystemInsightsChromeExtensions struct { - - Author string `json:"author,omitempty"` - - CollectionTime string `json:"collection_time,omitempty"` - - Description string `json:"description,omitempty"` - - Identifier string `json:"identifier,omitempty"` - - Locale string `json:"locale,omitempty"` - - Name string `json:"name,omitempty"` - - Path string `json:"path,omitempty"` - - Permissions string `json:"permissions,omitempty"` - - Persistent int32 `json:"persistent,omitempty"` - - SystemId string `json:"system_id,omitempty"` - - Uid string `json:"uid,omitempty"` - - UpdateUrl string `json:"update_url,omitempty"` - - Version string `json:"version,omitempty"` -} diff --git a/v2/system_insights_crashes.go b/v2/system_insights_crashes.go deleted file mode 100644 index b86dbaf..0000000 --- a/v2/system_insights_crashes.go +++ /dev/null @@ -1,45 +0,0 @@ -/* - * JumpCloud APIs - * - * JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. - * - * API version: 2.0 - * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) - */ - -package v2 - -type SystemInsightsCrashes struct { - - CrashPath string `json:"crash_path,omitempty"` - - CrashedThread string `json:"crashed_thread,omitempty"` - - Datetime string `json:"datetime,omitempty"` - - ExceptionCodes string `json:"exception_codes,omitempty"` - - ExceptionNotes string `json:"exception_notes,omitempty"` - - ExceptionType string `json:"exception_type,omitempty"` - - Identifier string `json:"identifier,omitempty"` - - Parent string `json:"parent,omitempty"` - - Path string `json:"path,omitempty"` - - Pid string `json:"pid,omitempty"` - - Registers string `json:"registers,omitempty"` - - Responsible string `json:"responsible,omitempty"` - - StackTrace string `json:"stack_trace,omitempty"` - - Type_ string `json:"type,omitempty"` - - Uid int32 `json:"uid,omitempty"` - - Version string `json:"version,omitempty"` -} diff --git a/v2/system_insights_disk_encryption.go b/v2/system_insights_disk_encryption.go deleted file mode 100644 index 4ddd410..0000000 --- a/v2/system_insights_disk_encryption.go +++ /dev/null @@ -1,31 +0,0 @@ -/* - * JumpCloud APIs - * - * JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. - * - * API version: 2.0 - * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) - */ - -package v2 - -type SystemInsightsDiskEncryption struct { - - CollectionTime string `json:"collection_time,omitempty"` - - Encrypted int32 `json:"encrypted,omitempty"` - - EncryptionStatus string `json:"encryption_status,omitempty"` - - Name string `json:"name,omitempty"` - - SystemId string `json:"system_id,omitempty"` - - Type_ string `json:"type,omitempty"` - - Uid string `json:"uid,omitempty"` - - UserUuid string `json:"user_uuid,omitempty"` - - Uuid string `json:"uuid,omitempty"` -} diff --git a/v2/system_insights_disk_info.go b/v2/system_insights_disk_info.go deleted file mode 100644 index 61fc298..0000000 --- a/v2/system_insights_disk_info.go +++ /dev/null @@ -1,39 +0,0 @@ -/* - * JumpCloud APIs - * - * JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. - * - * API version: 2.0 - * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) - */ - -package v2 - -type SystemInsightsDiskInfo struct { - - CollectionTime string `json:"collection_time,omitempty"` - - Description string `json:"description,omitempty"` - - DiskIndex int32 `json:"disk_index,omitempty"` - - DiskSize string `json:"disk_size,omitempty"` - - HardwareModel string `json:"hardware_model,omitempty"` - - Id string `json:"id,omitempty"` - - Manufacturer string `json:"manufacturer,omitempty"` - - Name string `json:"name,omitempty"` - - Partitions int32 `json:"partitions,omitempty"` - - PnpDeviceId string `json:"pnp_device_id,omitempty"` - - Serial string `json:"serial,omitempty"` - - SystemId string `json:"system_id,omitempty"` - - Type_ string `json:"type,omitempty"` -} diff --git a/v2/system_insights_etc_hosts.go b/v2/system_insights_etc_hosts.go deleted file mode 100644 index 02c8e94..0000000 --- a/v2/system_insights_etc_hosts.go +++ /dev/null @@ -1,21 +0,0 @@ -/* - * JumpCloud APIs - * - * JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. - * - * API version: 2.0 - * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) - */ - -package v2 - -type SystemInsightsEtcHosts struct { - - Address string `json:"address,omitempty"` - - CollectionTime string `json:"collection_time,omitempty"` - - Hostnames string `json:"hostnames,omitempty"` - - SystemId string `json:"system_id,omitempty"` -} diff --git a/v2/system_insights_firefox_addons.go b/v2/system_insights_firefox_addons.go deleted file mode 100644 index 356966f..0000000 --- a/v2/system_insights_firefox_addons.go +++ /dev/null @@ -1,45 +0,0 @@ -/* - * JumpCloud APIs - * - * JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. - * - * API version: 2.0 - * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) - */ - -package v2 - -type SystemInsightsFirefoxAddons struct { - - Active int32 `json:"active,omitempty"` - - Autoupdate int32 `json:"autoupdate,omitempty"` - - CollectionTime string `json:"collection_time,omitempty"` - - Creator string `json:"creator,omitempty"` - - Description string `json:"description,omitempty"` - - Disabled int32 `json:"disabled,omitempty"` - - Identifier string `json:"identifier,omitempty"` - - Location string `json:"location,omitempty"` - - Name string `json:"name,omitempty"` - - Path string `json:"path,omitempty"` - - SourceUrl string `json:"source_url,omitempty"` - - SystemId string `json:"system_id,omitempty"` - - Type_ string `json:"type,omitempty"` - - Uid string `json:"uid,omitempty"` - - Version string `json:"version,omitempty"` - - Visible int32 `json:"visible,omitempty"` -} diff --git a/v2/system_insights_groups.go b/v2/system_insights_groups.go deleted file mode 100644 index 1afc2e6..0000000 --- a/v2/system_insights_groups.go +++ /dev/null @@ -1,27 +0,0 @@ -/* - * JumpCloud APIs - * - * JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. - * - * API version: 2.0 - * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) - */ - -package v2 - -type SystemInsightsGroups struct { - - CollectionTime string `json:"collection_time,omitempty"` - - Comment string `json:"comment,omitempty"` - - Gid string `json:"gid,omitempty"` - - GidSigned string `json:"gid_signed,omitempty"` - - GroupSid string `json:"group_sid,omitempty"` - - Groupname string `json:"groupname,omitempty"` - - SystemId string `json:"system_id,omitempty"` -} diff --git a/v2/system_insights_ie_extensions.go b/v2/system_insights_ie_extensions.go deleted file mode 100644 index e0c264f..0000000 --- a/v2/system_insights_ie_extensions.go +++ /dev/null @@ -1,25 +0,0 @@ -/* - * JumpCloud APIs - * - * JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. - * - * API version: 2.0 - * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) - */ - -package v2 - -type SystemInsightsIeExtensions struct { - - CollectionTime string `json:"collection_time,omitempty"` - - Name string `json:"name,omitempty"` - - Path string `json:"path,omitempty"` - - RegistryPath string `json:"registry_path,omitempty"` - - SystemId string `json:"system_id,omitempty"` - - Version string `json:"version,omitempty"` -} diff --git a/v2/system_insights_interface_addresses.go b/v2/system_insights_interface_addresses.go deleted file mode 100644 index a39a0c5..0000000 --- a/v2/system_insights_interface_addresses.go +++ /dev/null @@ -1,31 +0,0 @@ -/* - * JumpCloud APIs - * - * JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. - * - * API version: 2.0 - * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) - */ - -package v2 - -type SystemInsightsInterfaceAddresses struct { - - Address string `json:"address,omitempty"` - - Broadcast string `json:"broadcast,omitempty"` - - CollectionTime string `json:"collection_time,omitempty"` - - FriendlyName string `json:"friendly_name,omitempty"` - - Interface_ string `json:"interface,omitempty"` - - Mask string `json:"mask,omitempty"` - - PointToPoint string `json:"point_to_point,omitempty"` - - SystemId string `json:"system_id,omitempty"` - - Type_ string `json:"type,omitempty"` -} diff --git a/v2/system_insights_kernel_info.go b/v2/system_insights_kernel_info.go deleted file mode 100644 index 068f394..0000000 --- a/v2/system_insights_kernel_info.go +++ /dev/null @@ -1,25 +0,0 @@ -/* - * JumpCloud APIs - * - * JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. - * - * API version: 2.0 - * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) - */ - -package v2 - -type SystemInsightsKernelInfo struct { - - Arguments string `json:"arguments,omitempty"` - - CollectionTime string `json:"collection_time,omitempty"` - - Device string `json:"device,omitempty"` - - Path string `json:"path,omitempty"` - - SystemId string `json:"system_id,omitempty"` - - Version string `json:"version,omitempty"` -} diff --git a/v2/system_insights_launchd.go b/v2/system_insights_launchd.go deleted file mode 100644 index e5536cd..0000000 --- a/v2/system_insights_launchd.go +++ /dev/null @@ -1,59 +0,0 @@ -/* - * JumpCloud APIs - * - * JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. - * - * API version: 2.0 - * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) - */ - -package v2 - -type SystemInsightsLaunchd struct { - - CollectionTime string `json:"collection_time,omitempty"` - - Disabled string `json:"disabled,omitempty"` - - Groupname string `json:"groupname,omitempty"` - - InetdCompatibility string `json:"inetd_compatibility,omitempty"` - - KeepAlive string `json:"keep_alive,omitempty"` - - Label string `json:"label,omitempty"` - - Name string `json:"name,omitempty"` - - OnDemand string `json:"on_demand,omitempty"` - - Path string `json:"path,omitempty"` - - ProcessType string `json:"process_type,omitempty"` - - Program string `json:"program,omitempty"` - - ProgramArguments string `json:"program_arguments,omitempty"` - - QueueDirectories string `json:"queue_directories,omitempty"` - - RootDirectory string `json:"root_directory,omitempty"` - - RunAtLoad string `json:"run_at_load,omitempty"` - - StartInterval string `json:"start_interval,omitempty"` - - StartOnMount string `json:"start_on_mount,omitempty"` - - StderrPath string `json:"stderr_path,omitempty"` - - StdoutPath string `json:"stdout_path,omitempty"` - - SystemId string `json:"system_id,omitempty"` - - Username string `json:"username,omitempty"` - - WatchPaths string `json:"watch_paths,omitempty"` - - WorkingDirectory string `json:"working_directory,omitempty"` -} diff --git a/v2/system_insights_logged_in_users.go b/v2/system_insights_logged_in_users.go deleted file mode 100644 index 2c3f0f0..0000000 --- a/v2/system_insights_logged_in_users.go +++ /dev/null @@ -1,29 +0,0 @@ -/* - * JumpCloud APIs - * - * JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. - * - * API version: 2.0 - * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) - */ - -package v2 - -type SystemInsightsLoggedInUsers struct { - - CollectionTime string `json:"collection_time,omitempty"` - - Host string `json:"host,omitempty"` - - Pid int32 `json:"pid,omitempty"` - - SystemId string `json:"system_id,omitempty"` - - Time int32 `json:"time,omitempty"` - - Tty string `json:"tty,omitempty"` - - Type_ string `json:"type,omitempty"` - - User string `json:"user,omitempty"` -} diff --git a/v2/system_insights_logical_drvies.go b/v2/system_insights_logical_drvies.go deleted file mode 100644 index 374a858..0000000 --- a/v2/system_insights_logical_drvies.go +++ /dev/null @@ -1,29 +0,0 @@ -/* - * JumpCloud APIs - * - * JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. - * - * API version: 2.0 - * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) - */ - -package v2 - -type SystemInsightsLogicalDrvies struct { - - BootPartition int32 `json:"boot_partition,omitempty"` - - CollectionTime string `json:"collection_time,omitempty"` - - DeviceId string `json:"device_id,omitempty"` - - FileSystem string `json:"file_system,omitempty"` - - FreeSpace string `json:"free_space,omitempty"` - - Size string `json:"size,omitempty"` - - SystemId string `json:"system_id,omitempty"` - - Type_ string `json:"type,omitempty"` -} diff --git a/v2/system_insights_mounts.go b/v2/system_insights_mounts.go deleted file mode 100644 index 750ed9a..0000000 --- a/v2/system_insights_mounts.go +++ /dev/null @@ -1,39 +0,0 @@ -/* - * JumpCloud APIs - * - * JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. - * - * API version: 2.0 - * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) - */ - -package v2 - -type SystemInsightsMounts struct { - - Blocks string `json:"blocks,omitempty"` - - BlocksAvailable string `json:"blocks_available,omitempty"` - - BlocksFree string `json:"blocks_free,omitempty"` - - BlocksSize string `json:"blocks_size,omitempty"` - - CollectionTime string `json:"collection_time,omitempty"` - - Device string `json:"device,omitempty"` - - DeviceAlias string `json:"device_alias,omitempty"` - - Flags string `json:"flags,omitempty"` - - Inodes string `json:"inodes,omitempty"` - - InodesFree string `json:"inodes_free,omitempty"` - - Path string `json:"path,omitempty"` - - SystemId string `json:"system_id,omitempty"` - - Type_ string `json:"type,omitempty"` -} diff --git a/v2/system_insights_os_version.go b/v2/system_insights_os_version.go deleted file mode 100644 index 77906e7..0000000 --- a/v2/system_insights_os_version.go +++ /dev/null @@ -1,37 +0,0 @@ -/* - * JumpCloud APIs - * - * JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. - * - * API version: 2.0 - * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) - */ - -package v2 - -type SystemInsightsOsVersion struct { - - Build string `json:"build,omitempty"` - - Codename string `json:"codename,omitempty"` - - CollectionTime string `json:"collection_time,omitempty"` - - InstallDate string `json:"install_date,omitempty"` - - Major int32 `json:"major,omitempty"` - - Minor int32 `json:"minor,omitempty"` - - Name string `json:"name,omitempty"` - - Patch int32 `json:"patch,omitempty"` - - Platform string `json:"platform,omitempty"` - - PlatformLike string `json:"platform_like,omitempty"` - - SystemId string `json:"system_id,omitempty"` - - Version string `json:"version,omitempty"` -} diff --git a/v2/system_insights_patches.go b/v2/system_insights_patches.go deleted file mode 100644 index 2924eaa..0000000 --- a/v2/system_insights_patches.go +++ /dev/null @@ -1,33 +0,0 @@ -/* - * JumpCloud APIs - * - * JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. - * - * API version: 2.0 - * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) - */ - -package v2 - -type SystemInsightsPatches struct { - - Caption string `json:"caption,omitempty"` - - CollectionTime string `json:"collection_time,omitempty"` - - Csname string `json:"csname,omitempty"` - - Description string `json:"description,omitempty"` - - FixComments string `json:"fix_comments,omitempty"` - - HotfixId string `json:"hotfix_id,omitempty"` - - InstallDate string `json:"install_date,omitempty"` - - InstalledBy string `json:"installed_by,omitempty"` - - InstalledOn string `json:"installed_on,omitempty"` - - SystemId string `json:"system_id,omitempty"` -} diff --git a/v2/system_insights_programs.go b/v2/system_insights_programs.go deleted file mode 100644 index 7131f64..0000000 --- a/v2/system_insights_programs.go +++ /dev/null @@ -1,35 +0,0 @@ -/* - * JumpCloud APIs - * - * JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. - * - * API version: 2.0 - * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) - */ - -package v2 - -type SystemInsightsPrograms struct { - - CollectionTime string `json:"collection_time,omitempty"` - - IdentifyingNumber string `json:"identifying_number,omitempty"` - - InstallDate string `json:"install_date,omitempty"` - - InstallLocation string `json:"install_location,omitempty"` - - InstallSource string `json:"install_source,omitempty"` - - Language string `json:"language,omitempty"` - - Name string `json:"name,omitempty"` - - Publisher string `json:"publisher,omitempty"` - - SystemId string `json:"system_id,omitempty"` - - UninstallString string `json:"uninstall_string,omitempty"` - - Version string `json:"version,omitempty"` -} diff --git a/v2/system_insights_safari_extensions.go b/v2/system_insights_safari_extensions.go deleted file mode 100644 index c2ee139..0000000 --- a/v2/system_insights_safari_extensions.go +++ /dev/null @@ -1,37 +0,0 @@ -/* - * JumpCloud APIs - * - * JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. - * - * API version: 2.0 - * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) - */ - -package v2 - -type SystemInsightsSafariExtensions struct { - - Author string `json:"author,omitempty"` - - CollectionTime string `json:"collection_time,omitempty"` - - Description string `json:"description,omitempty"` - - DeveloperId string `json:"developer_id,omitempty"` - - Identifier string `json:"identifier,omitempty"` - - Name string `json:"name,omitempty"` - - Path string `json:"path,omitempty"` - - Sdk string `json:"sdk,omitempty"` - - SystemId string `json:"system_id,omitempty"` - - Uid string `json:"uid,omitempty"` - - UpdateUrl string `json:"update_url,omitempty"` - - Version string `json:"version,omitempty"` -} diff --git a/v2/system_insights_system_controls.go b/v2/system_insights_system_controls.go deleted file mode 100644 index 032a17c..0000000 --- a/v2/system_insights_system_controls.go +++ /dev/null @@ -1,31 +0,0 @@ -/* - * JumpCloud APIs - * - * JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. - * - * API version: 2.0 - * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) - */ - -package v2 - -type SystemInsightsSystemControls struct { - - CollectionTime string `json:"collection_time,omitempty"` - - ConfigValue string `json:"config_value,omitempty"` - - CurrentValue string `json:"current_value,omitempty"` - - FieldName string `json:"field_name,omitempty"` - - Name string `json:"name,omitempty"` - - Oid string `json:"oid,omitempty"` - - Subsystem string `json:"subsystem,omitempty"` - - SystemId string `json:"system_id,omitempty"` - - Type_ string `json:"type,omitempty"` -} diff --git a/v2/system_insights_system_info.go b/v2/system_insights_system_info.go deleted file mode 100644 index e06c3d7..0000000 --- a/v2/system_insights_system_info.go +++ /dev/null @@ -1,47 +0,0 @@ -/* - * JumpCloud APIs - * - * JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. - * - * API version: 2.0 - * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) - */ - -package v2 - -type SystemInsightsSystemInfo struct { - - CollectionTime string `json:"collection_time,omitempty"` - - ComputerName string `json:"computer_name,omitempty"` - - CpuBrand string `json:"cpu_brand,omitempty"` - - CpuLogicalCores int32 `json:"cpu_logical_cores,omitempty"` - - CpuMicrocode string `json:"cpu_microcode,omitempty"` - - CpuPhysicalCores int32 `json:"cpu_physical_cores,omitempty"` - - CpuSubtype string `json:"cpu_subtype,omitempty"` - - CpuType string `json:"cpu_type,omitempty"` - - HardwareModel string `json:"hardware_model,omitempty"` - - HardwareSerial string `json:"hardware_serial,omitempty"` - - HardwareVendor string `json:"hardware_vendor,omitempty"` - - HardwareVersion string `json:"hardware_version,omitempty"` - - Hostname string `json:"hostname,omitempty"` - - LocalHostname string `json:"local_hostname,omitempty"` - - PhysicalMemory string `json:"physical_memory,omitempty"` - - SystemId string `json:"system_id,omitempty"` - - Uuid string `json:"uuid,omitempty"` -} diff --git a/v2/system_insights_uptime.go b/v2/system_insights_uptime.go deleted file mode 100644 index bbff081..0000000 --- a/v2/system_insights_uptime.go +++ /dev/null @@ -1,27 +0,0 @@ -/* - * JumpCloud APIs - * - * JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. - * - * API version: 2.0 - * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) - */ - -package v2 - -type SystemInsightsUptime struct { - - CollectionTime string `json:"collection_time,omitempty"` - - Days int32 `json:"days,omitempty"` - - Hours int32 `json:"hours,omitempty"` - - Minutes int32 `json:"minutes,omitempty"` - - Seconds int32 `json:"seconds,omitempty"` - - SystemId string `json:"system_id,omitempty"` - - TotalSeconds string `json:"total_seconds,omitempty"` -} diff --git a/v2/system_insights_usb_devices.go b/v2/system_insights_usb_devices.go deleted file mode 100644 index 36b9d12..0000000 --- a/v2/system_insights_usb_devices.go +++ /dev/null @@ -1,41 +0,0 @@ -/* - * JumpCloud APIs - * - * JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. - * - * API version: 2.0 - * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) - */ - -package v2 - -type SystemInsightsUsbDevices struct { - - Class string `json:"class,omitempty"` - - CollectionTime string `json:"collection_time,omitempty"` - - Model string `json:"model,omitempty"` - - ModelId string `json:"model_id,omitempty"` - - Protocol string `json:"protocol,omitempty"` - - Removable int32 `json:"removable,omitempty"` - - Serial string `json:"serial,omitempty"` - - Subclass string `json:"subclass,omitempty"` - - SystemId string `json:"system_id,omitempty"` - - UsbAddress int32 `json:"usb_address,omitempty"` - - UsbPort int32 `json:"usb_port,omitempty"` - - Vendor string `json:"vendor,omitempty"` - - VendorId string `json:"vendor_id,omitempty"` - - Version string `json:"version,omitempty"` -} diff --git a/v2/system_insights_user_groups.go b/v2/system_insights_user_groups.go deleted file mode 100644 index ed9ab96..0000000 --- a/v2/system_insights_user_groups.go +++ /dev/null @@ -1,21 +0,0 @@ -/* - * JumpCloud APIs - * - * JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. - * - * API version: 2.0 - * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) - */ - -package v2 - -type SystemInsightsUserGroups struct { - - CollectionTime string `json:"collection_time,omitempty"` - - Gid string `json:"gid,omitempty"` - - SystemId string `json:"system_id,omitempty"` - - Uid string `json:"uid,omitempty"` -} diff --git a/v2/system_insights_users.go b/v2/system_insights_users.go deleted file mode 100644 index 8a8d360..0000000 --- a/v2/system_insights_users.go +++ /dev/null @@ -1,37 +0,0 @@ -/* - * JumpCloud APIs - * - * JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. - * - * API version: 2.0 - * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) - */ - -package v2 - -type SystemInsightsUsers struct { - - CollectionTime string `json:"collection_time,omitempty"` - - Description string `json:"description,omitempty"` - - Directory string `json:"directory,omitempty"` - - Gid string `json:"gid,omitempty"` - - GidSigned string `json:"gid_signed,omitempty"` - - Shell string `json:"shell,omitempty"` - - SystemId string `json:"system_id,omitempty"` - - Type_ string `json:"type,omitempty"` - - Uid string `json:"uid,omitempty"` - - UidSigned string `json:"uid_signed,omitempty"` - - Username string `json:"username,omitempty"` - - Uuid string `json:"uuid,omitempty"` -} diff --git a/v2/system_insights_windows_crashes.go b/v2/system_insights_windows_crashes.go deleted file mode 100644 index 225a4f3..0000000 --- a/v2/system_insights_windows_crashes.go +++ /dev/null @@ -1,55 +0,0 @@ -/* - * JumpCloud APIs - * - * JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. - * - * API version: 2.0 - * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) - */ - -package v2 - -type SystemInsightsWindowsCrashes struct { - - BuildNumber int32 `json:"build_number,omitempty"` - - CommandLine string `json:"command_line,omitempty"` - - CrashPath string `json:"crash_path,omitempty"` - - CurrentDirectory string `json:"current_directory,omitempty"` - - Datetime string `json:"datetime,omitempty"` - - ExceptionAddress string `json:"exception_address,omitempty"` - - ExceptionCode string `json:"exception_code,omitempty"` - - ExceptionMessage string `json:"exception_message,omitempty"` - - MachineName string `json:"machine_name,omitempty"` - - MajorVersion int32 `json:"major_version,omitempty"` - - MinorVersion int32 `json:"minor_version,omitempty"` - - Module string `json:"module,omitempty"` - - Path string `json:"path,omitempty"` - - Pid string `json:"pid,omitempty"` - - ProcessUptime string `json:"process_uptime,omitempty"` - - Registers string `json:"registers,omitempty"` - - StackTrace string `json:"stack_trace,omitempty"` - - Tid string `json:"tid,omitempty"` - - Type_ string `json:"type,omitempty"` - - Username string `json:"username,omitempty"` - - Version string `json:"version,omitempty"` -} diff --git a/v2/systemfdekey.go b/v2/systemfdekey.go deleted file mode 100644 index e138f30..0000000 --- a/v2/systemfdekey.go +++ /dev/null @@ -1,15 +0,0 @@ -/* - * JumpCloud APIs - * - * JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. - * - * API version: 2.0 - * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) - */ - -package v2 - -type Systemfdekey struct { - - Key string `json:"key"` -} diff --git a/v2/systems_api.go b/v2/systems_api.go deleted file mode 100644 index 4720f25..0000000 --- a/v2/systems_api.go +++ /dev/null @@ -1,916 +0,0 @@ -/* - * JumpCloud APIs - * - * JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. - * - * API version: 2.0 - * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) - */ - -package v2 - -import ( - "io/ioutil" - "net/url" - "net/http" - "strings" - "golang.org/x/net/context" - "encoding/json" - "fmt" -) - -// Linger please -var ( - _ context.Context -) - -type SystemsApiService service - - -/* SystemsApiService List the associations of a System - This endpoint returns the _direct_ associations of a System. A direct association can be a non-homogeneous relationship between 2 different objects, for example Systems and Users. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/systems/{System_ID}/associations?targets=user \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - * @param ctx context.Context for authentication, logging, tracing, etc. - @param systemId ObjectID of the System. - @param contentType - @param accept - @param targets - @param optional (nil or map[string]interface{}) with one or more of: - @param "limit" (int32) The number of records to return at once. Limited to 100. - @param "skip" (int32) The offset into the records to return. - @param "date" (string) Current date header for the System Context API - @param "authorization" (string) Authorization header for the System Context API - @param "xOrgId" (string) - @return []GraphConnection*/ -func (a *SystemsApiService) GraphSystemAssociationsList(ctx context.Context, systemId string, contentType string, accept string, targets []string, localVarOptionals map[string]interface{}) ([]GraphConnection, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload []GraphConnection - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/systems/{system_id}/associations" - localVarPath = strings.Replace(localVarPath, "{"+"system_id"+"}", fmt.Sprintf("%v", systemId), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["limit"], "int32", "limit"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["skip"], "int32", "skip"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["date"], "string", "date"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["authorization"], "string", "authorization"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return successPayload, nil, err - } - - if localVarTempParam, localVarOk := localVarOptionals["limit"].(int32); localVarOk { - localVarQueryParams.Add("limit", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["skip"].(int32); localVarOk { - localVarQueryParams.Add("skip", parameterToString(localVarTempParam, "")) - } - localVarQueryParams.Add("targets", parameterToString(targets, "csv")) - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if localVarTempParam, localVarOk := localVarOptionals["date"].(string); localVarOk { - localVarHeaderParams["Date"] = parameterToString(localVarTempParam, "") - } - if localVarTempParam, localVarOk := localVarOptionals["authorization"].(string); localVarOk { - localVarHeaderParams["Authorization"] = parameterToString(localVarTempParam, "") - } - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* SystemsApiService Manage associations of a System - This endpoint allows you to manage the _direct_ associations of a System. A direct association can be a non-homogeneous relationship between 2 different objects, for example Systems and Users. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/systems/{System_ID}/associations \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"attributes\": { \"sudo\": { \"enabled\": true, \"withoutPassword\": false } }, \"op\": \"add\", \"type\": \"user\", \"id\": \"UserID\" }' ``` - * @param ctx context.Context for authentication, logging, tracing, etc. - @param systemId ObjectID of the System. - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "body" (SystemGraphManagementReq) - @param "date" (string) Current date header for the System Context API - @param "authorization" (string) Authorization header for the System Context API - @param "xOrgId" (string) - @return */ -func (a *SystemsApiService) GraphSystemAssociationsPost(ctx context.Context, systemId string, contentType string, accept string, localVarOptionals map[string]interface{}) ( *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Post") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/systems/{system_id}/associations" - localVarPath = strings.Replace(localVarPath, "{"+"system_id"+"}", fmt.Sprintf("%v", systemId), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["date"], "string", "date"); err != nil { - return nil, err - } - if err := typeCheckParameter(localVarOptionals["authorization"], "string", "authorization"); err != nil { - return nil, err - } - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return nil, err - } - - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if localVarTempParam, localVarOk := localVarOptionals["date"].(string); localVarOk { - localVarHeaderParams["Date"] = parameterToString(localVarTempParam, "") - } - if localVarTempParam, localVarOk := localVarOptionals["authorization"].(string); localVarOk { - localVarHeaderParams["Authorization"] = parameterToString(localVarTempParam, "") - } - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - // body params - if localVarTempParam, localVarOk := localVarOptionals["body"].(SystemGraphManagementReq); localVarOk { - localVarPostBody = &localVarTempParam - } - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - return localVarHttpResponse, err -} - -/* SystemsApiService List the parent Groups of a System - This endpoint returns all the System Groups a System is a member of. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/systems/{System_ID}/memberof \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - * @param ctx context.Context for authentication, logging, tracing, etc. - @param systemId ObjectID of the System. - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "filter" ([]string) Supported operators are: eq, ne, gt, ge, lt, le, between, search, in - @param "limit" (int32) The number of records to return at once. Limited to 100. - @param "skip" (int32) The offset into the records to return. - @param "date" (string) Current date header for the System Context API - @param "authorization" (string) Authorization header for the System Context API - @param "sort" ([]string) The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. - @param "xOrgId" (string) - @return []GraphObjectWithPaths*/ -func (a *SystemsApiService) GraphSystemMemberOf(ctx context.Context, systemId string, contentType string, accept string, localVarOptionals map[string]interface{}) ([]GraphObjectWithPaths, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload []GraphObjectWithPaths - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/systems/{system_id}/memberof" - localVarPath = strings.Replace(localVarPath, "{"+"system_id"+"}", fmt.Sprintf("%v", systemId), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["limit"], "int32", "limit"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["skip"], "int32", "skip"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["date"], "string", "date"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["authorization"], "string", "authorization"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return successPayload, nil, err - } - - if localVarTempParam, localVarOk := localVarOptionals["filter"].([]string); localVarOk { - localVarQueryParams.Add("filter", parameterToString(localVarTempParam, "csv")) - } - if localVarTempParam, localVarOk := localVarOptionals["limit"].(int32); localVarOk { - localVarQueryParams.Add("limit", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["skip"].(int32); localVarOk { - localVarQueryParams.Add("skip", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["sort"].([]string); localVarOk { - localVarQueryParams.Add("sort", parameterToString(localVarTempParam, "csv")) - } - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if localVarTempParam, localVarOk := localVarOptionals["date"].(string); localVarOk { - localVarHeaderParams["Date"] = parameterToString(localVarTempParam, "") - } - if localVarTempParam, localVarOk := localVarOptionals["authorization"].(string); localVarOk { - localVarHeaderParams["Authorization"] = parameterToString(localVarTempParam, "") - } - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* SystemsApiService List the Commands bound to a System - This endpoint will return all Commands bound to a System, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this System to the corresponding Command; this array represents all grouping and/or associations that would have to be removed to deprovision the Command from this System. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/systems/{System_ID}/commands \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - * @param ctx context.Context for authentication, logging, tracing, etc. - @param systemId ObjectID of the System. - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "limit" (int32) The number of records to return at once. Limited to 100. - @param "xOrgId" (string) - @param "skip" (int32) The offset into the records to return. - @param "filter" ([]string) Supported operators are: eq, ne, gt, ge, lt, le, between, search, in - @return []GraphObjectWithPaths*/ -func (a *SystemsApiService) GraphSystemTraverseCommand(ctx context.Context, systemId string, contentType string, accept string, localVarOptionals map[string]interface{}) ([]GraphObjectWithPaths, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload []GraphObjectWithPaths - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/systems/{system_id}/commands" - localVarPath = strings.Replace(localVarPath, "{"+"system_id"+"}", fmt.Sprintf("%v", systemId), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["limit"], "int32", "limit"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["skip"], "int32", "skip"); err != nil { - return successPayload, nil, err - } - - if localVarTempParam, localVarOk := localVarOptionals["limit"].(int32); localVarOk { - localVarQueryParams.Add("limit", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["skip"].(int32); localVarOk { - localVarQueryParams.Add("skip", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["filter"].([]string); localVarOk { - localVarQueryParams.Add("filter", parameterToString(localVarTempParam, "csv")) - } - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* SystemsApiService List the Policies bound to a System - This endpoint will return all Policies bound to a System, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this System to the corresponding Policy; this array represents all grouping and/or associations that would have to be removed to deprovision the Policy from this System. See `/members` and `/associations` endpoints to manage those collections. This endpoint is not yet public as we have finish the code. ##### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/{System_ID}/policies \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - * @param ctx context.Context for authentication, logging, tracing, etc. - @param systemId ObjectID of the System. - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "limit" (int32) The number of records to return at once. Limited to 100. - @param "xOrgId" (string) - @param "skip" (int32) The offset into the records to return. - @param "filter" ([]string) Supported operators are: eq, ne, gt, ge, lt, le, between, search, in - @return []GraphObjectWithPaths*/ -func (a *SystemsApiService) GraphSystemTraversePolicy(ctx context.Context, systemId string, contentType string, accept string, localVarOptionals map[string]interface{}) ([]GraphObjectWithPaths, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload []GraphObjectWithPaths - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/systems/{system_id}/policies" - localVarPath = strings.Replace(localVarPath, "{"+"system_id"+"}", fmt.Sprintf("%v", systemId), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["limit"], "int32", "limit"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["skip"], "int32", "skip"); err != nil { - return successPayload, nil, err - } - - if localVarTempParam, localVarOk := localVarOptionals["limit"].(int32); localVarOk { - localVarQueryParams.Add("limit", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["skip"].(int32); localVarOk { - localVarQueryParams.Add("skip", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["filter"].([]string); localVarOk { - localVarQueryParams.Add("filter", parameterToString(localVarTempParam, "csv")) - } - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* SystemsApiService List the Users bound to a System - This endpoint will return all Users bound to a System, either directly or indirectly essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this System to the corresponding User; this array represents all grouping and/or associations that would have to be removed to deprovision the User from this System. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/systems/{System_ID}/users \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - * @param ctx context.Context for authentication, logging, tracing, etc. - @param systemId ObjectID of the System. - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "limit" (int32) The number of records to return at once. Limited to 100. - @param "xOrgId" (string) - @param "skip" (int32) The offset into the records to return. - @param "date" (string) Current date header for the System Context API - @param "authorization" (string) Authorization header for the System Context API - @param "filter" ([]string) Supported operators are: eq, ne, gt, ge, lt, le, between, search, in - @return []GraphObjectWithPaths*/ -func (a *SystemsApiService) GraphSystemTraverseUser(ctx context.Context, systemId string, contentType string, accept string, localVarOptionals map[string]interface{}) ([]GraphObjectWithPaths, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload []GraphObjectWithPaths - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/systems/{system_id}/users" - localVarPath = strings.Replace(localVarPath, "{"+"system_id"+"}", fmt.Sprintf("%v", systemId), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["limit"], "int32", "limit"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["skip"], "int32", "skip"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["date"], "string", "date"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["authorization"], "string", "authorization"); err != nil { - return successPayload, nil, err - } - - if localVarTempParam, localVarOk := localVarOptionals["limit"].(int32); localVarOk { - localVarQueryParams.Add("limit", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["skip"].(int32); localVarOk { - localVarQueryParams.Add("skip", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["filter"].([]string); localVarOk { - localVarQueryParams.Add("filter", parameterToString(localVarTempParam, "csv")) - } - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if localVarTempParam, localVarOk := localVarOptionals["date"].(string); localVarOk { - localVarHeaderParams["Date"] = parameterToString(localVarTempParam, "") - } - if localVarTempParam, localVarOk := localVarOptionals["authorization"].(string); localVarOk { - localVarHeaderParams["Authorization"] = parameterToString(localVarTempParam, "") - } - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* SystemsApiService List the User Groups bound to a System - This endpoint will return all User Groups bound to a System, either directly or indirectly essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this System to the corresponding User Group; this array represents all grouping and/or associations that would have to be removed to deprovision the User Group from this System. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/systems/{System_ID}/usergroups \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - * @param ctx context.Context for authentication, logging, tracing, etc. - @param systemId ObjectID of the System. - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "limit" (int32) The number of records to return at once. Limited to 100. - @param "xOrgId" (string) - @param "skip" (int32) The offset into the records to return. - @param "date" (string) Current date header for the System Context API - @param "authorization" (string) Authorization header for the System Context API - @param "filter" ([]string) Supported operators are: eq, ne, gt, ge, lt, le, between, search, in - @return []GraphObjectWithPaths*/ -func (a *SystemsApiService) GraphSystemTraverseUserGroup(ctx context.Context, systemId string, contentType string, accept string, localVarOptionals map[string]interface{}) ([]GraphObjectWithPaths, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload []GraphObjectWithPaths - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/systems/{system_id}/usergroups" - localVarPath = strings.Replace(localVarPath, "{"+"system_id"+"}", fmt.Sprintf("%v", systemId), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["limit"], "int32", "limit"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["skip"], "int32", "skip"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["date"], "string", "date"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["authorization"], "string", "authorization"); err != nil { - return successPayload, nil, err - } - - if localVarTempParam, localVarOk := localVarOptionals["limit"].(int32); localVarOk { - localVarQueryParams.Add("limit", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["skip"].(int32); localVarOk { - localVarQueryParams.Add("skip", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["filter"].([]string); localVarOk { - localVarQueryParams.Add("filter", parameterToString(localVarTempParam, "csv")) - } - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if localVarTempParam, localVarOk := localVarOptionals["date"].(string); localVarOk { - localVarHeaderParams["Date"] = parameterToString(localVarTempParam, "") - } - if localVarTempParam, localVarOk := localVarOptionals["authorization"].(string); localVarOk { - localVarHeaderParams["Authorization"] = parameterToString(localVarTempParam, "") - } - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* SystemsApiService Get System FDE Key - This endpoint will return the current (latest) fde key saved for a system. - * @param ctx context.Context for authentication, logging, tracing, etc. - @param systemId - @param optional (nil or map[string]interface{}) with one or more of: - @param "xOrgId" (string) - @return Systemfdekey*/ -func (a *SystemsApiService) SystemsGetFDEKey(ctx context.Context, systemId string, localVarOptionals map[string]interface{}) (Systemfdekey, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload Systemfdekey - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/systems/{system_id}/fdekey" - localVarPath = strings.Replace(localVarPath, "{"+"system_id"+"}", fmt.Sprintf("%v", systemId), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return successPayload, nil, err - } - - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - diff --git a/v2/systemuser.go b/v2/systemuser.go deleted file mode 100644 index 759e412..0000000 --- a/v2/systemuser.go +++ /dev/null @@ -1,96 +0,0 @@ -/* - * JumpCloud APIs - * - * JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. - * - * API version: 2.0 - * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) - */ - -package v2 - -type Systemuser struct { - - Id string `json:"_id,omitempty"` - - AccountLocked bool `json:"account_locked,omitempty"` - - Activated bool `json:"activated,omitempty"` - - AllowPublicKey bool `json:"allow_public_key,omitempty"` - - AssociatedTagCount int32 `json:"associatedTagCount,omitempty"` - - Attributes []interface{} `json:"attributes,omitempty"` - - Company string `json:"company,omitempty"` - - CostCenter string `json:"costCenter,omitempty"` - - Created string `json:"created,omitempty"` - - Department string `json:"department,omitempty"` - - Description string `json:"description,omitempty"` - - Displayname string `json:"displayname,omitempty"` - - Email string `json:"email,omitempty"` - - // Must be unique per user. - EmployeeIdentifier string `json:"employeeIdentifier,omitempty"` - - EmployeeType string `json:"employeeType,omitempty"` - - EnableManagedUid bool `json:"enable_managed_uid,omitempty"` - - EnableUserPortalMultifactor bool `json:"enable_user_portal_multifactor,omitempty"` - - ExternalDn string `json:"external_dn,omitempty"` - - ExternalSourceType string `json:"external_source_type,omitempty"` - - ExternallyManaged bool `json:"externally_managed,omitempty"` - - Firstname string `json:"firstname,omitempty"` - - JobTitle string `json:"jobTitle,omitempty"` - - Lastname string `json:"lastname,omitempty"` - - LdapBindingUser bool `json:"ldap_binding_user,omitempty"` - - Location string `json:"location,omitempty"` - - Mfa *Mfa `json:"mfa,omitempty"` - - Middlename string `json:"middlename,omitempty"` - - PasswordExpirationDate string `json:"password_expiration_date,omitempty"` - - PasswordExpired bool `json:"password_expired,omitempty"` - - PasswordNeverExpires bool `json:"password_never_expires,omitempty"` - - PasswordlessSudo bool `json:"passwordless_sudo,omitempty"` - - PublicKey string `json:"public_key,omitempty"` - - SambaServiceUser bool `json:"samba_service_user,omitempty"` - - SshKeys []Sshkeylist `json:"ssh_keys,omitempty"` - - Sudo bool `json:"sudo,omitempty"` - - Suspended bool `json:"suspended,omitempty"` - - Tags []string `json:"tags,omitempty"` - - TotpEnabled bool `json:"totp_enabled,omitempty"` - - UnixGuid int32 `json:"unix_guid,omitempty"` - - UnixUid int32 `json:"unix_uid,omitempty"` - - Username string `json:"username,omitempty"` -} diff --git a/v2/systemuserputpost.go b/v2/systemuserputpost.go deleted file mode 100644 index 15ae86a..0000000 --- a/v2/systemuserputpost.go +++ /dev/null @@ -1,90 +0,0 @@ -/* - * JumpCloud APIs - * - * JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. - * - * API version: 2.0 - * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) - */ - -package v2 - -type Systemuserputpost struct { - - AccountLocked bool `json:"account_locked,omitempty"` - - Activated bool `json:"activated,omitempty"` - - Addresses []SystemuserputpostAddresses `json:"addresses,omitempty"` - - AllowPublicKey bool `json:"allow_public_key,omitempty"` - - Attributes []interface{} `json:"attributes,omitempty"` - - Company string `json:"company,omitempty"` - - CostCenter string `json:"costCenter,omitempty"` - - Department string `json:"department,omitempty"` - - Description string `json:"description,omitempty"` - - Displayname string `json:"displayname,omitempty"` - - Email string `json:"email"` - - // Must be unique per user. - EmployeeIdentifier string `json:"employeeIdentifier,omitempty"` - - EmployeeType string `json:"employeeType,omitempty"` - - EnableManagedUid bool `json:"enable_managed_uid,omitempty"` - - EnableUserPortalMultifactor bool `json:"enable_user_portal_multifactor,omitempty"` - - ExternalDn string `json:"external_dn,omitempty"` - - ExternalSourceType string `json:"external_source_type,omitempty"` - - ExternallyManaged bool `json:"externally_managed,omitempty"` - - Firstname string `json:"firstname,omitempty"` - - JobTitle string `json:"jobTitle,omitempty"` - - Lastname string `json:"lastname,omitempty"` - - LdapBindingUser bool `json:"ldap_binding_user,omitempty"` - - Location string `json:"location,omitempty"` - - Mfa *Mfa `json:"mfa,omitempty"` - - Middlename string `json:"middlename,omitempty"` - - Password string `json:"password,omitempty"` - - PasswordNeverExpires bool `json:"password_never_expires,omitempty"` - - PasswordlessSudo bool `json:"passwordless_sudo,omitempty"` - - PhoneNumbers []SystemuserputpostPhoneNumbers `json:"phoneNumbers,omitempty"` - - PublicKey string `json:"public_key,omitempty"` - - Relationships []interface{} `json:"relationships,omitempty"` - - SambaServiceUser bool `json:"samba_service_user,omitempty"` - - Sudo bool `json:"sudo,omitempty"` - - Suspended bool `json:"suspended,omitempty"` - - Tags []string `json:"tags,omitempty"` - - UnixGuid int32 `json:"unix_guid,omitempty"` - - UnixUid int32 `json:"unix_uid,omitempty"` - - Username string `json:"username"` -} diff --git a/v2/systemuserputpost_addresses.go b/v2/systemuserputpost_addresses.go deleted file mode 100644 index af26f04..0000000 --- a/v2/systemuserputpost_addresses.go +++ /dev/null @@ -1,29 +0,0 @@ -/* - * JumpCloud APIs - * - * JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. - * - * API version: 2.0 - * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) - */ - -package v2 - -type SystemuserputpostAddresses struct { - - Country string `json:"country,omitempty"` - - ExtendedAddress string `json:"extendedAddress,omitempty"` - - Locality string `json:"locality,omitempty"` - - PoBox string `json:"poBox,omitempty"` - - PostalCode string `json:"postalCode,omitempty"` - - Region string `json:"region,omitempty"` - - StreetAddress string `json:"streetAddress,omitempty"` - - Type_ string `json:"type,omitempty"` -} diff --git a/v2/systemuserputpost_phone_numbers.go b/v2/systemuserputpost_phone_numbers.go deleted file mode 100644 index c74c45e..0000000 --- a/v2/systemuserputpost_phone_numbers.go +++ /dev/null @@ -1,17 +0,0 @@ -/* - * JumpCloud APIs - * - * JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. - * - * API version: 2.0 - * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) - */ - -package v2 - -type SystemuserputpostPhoneNumbers struct { - - Number string `json:"number,omitempty"` - - Type_ string `json:"type,omitempty"` -} diff --git a/v2/user_graph_management_req.go b/v2/user_graph_management_req.go deleted file mode 100644 index 282f4c1..0000000 --- a/v2/user_graph_management_req.go +++ /dev/null @@ -1,23 +0,0 @@ -/* - * JumpCloud APIs - * - * JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. - * - * API version: 2.0 - * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) - */ - -package v2 - -type UserGraphManagementReq struct { - - Attributes *SystemGraphManagementReqAttributes `json:"attributes,omitempty"` - - // The ObjectID of graph object being added or removed as an association. - Id string `json:"id"` - - // How to modify the graph connection. - Op string `json:"op"` - - Type_ string `json:"type"` -} diff --git a/v2/user_group.go b/v2/user_group.go deleted file mode 100644 index c0ad7da..0000000 --- a/v2/user_group.go +++ /dev/null @@ -1,24 +0,0 @@ -/* - * JumpCloud APIs - * - * JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. - * - * API version: 2.0 - * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) - */ - -package v2 - -type UserGroup struct { - - Attributes *UserGroupAttributes `json:"attributes,omitempty"` - - // ObjectId uniquely identifying a User Group. - Id string `json:"id,omitempty"` - - // Display name of a User Group. - Name string `json:"name,omitempty"` - - // The type of the group. - Type_ string `json:"type,omitempty"` -} diff --git a/v2/user_group_associations_api.go b/v2/user_group_associations_api.go deleted file mode 100644 index d208656..0000000 --- a/v2/user_group_associations_api.go +++ /dev/null @@ -1,1185 +0,0 @@ -/* - * JumpCloud APIs - * - * JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. - * - * API version: 2.0 - * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) - */ - -package v2 - -import ( - "io/ioutil" - "net/url" - "net/http" - "strings" - "golang.org/x/net/context" - "encoding/json" - "fmt" -) - -// Linger please -var ( - _ context.Context -) - -type UserGroupAssociationsApiService service - - -/* UserGroupAssociationsApiService List the associations of a User Group. - This endpoint returns the _direct_ associations of this User Group. A direct association can be a non-homogeneous relationship between 2 different objects, for example User Groups and Users. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/usergroups/{GroupID}/associations?targets=system \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - * @param ctx context.Context for authentication, logging, tracing, etc. - @param groupId ObjectID of the User Group. - @param contentType - @param accept - @param targets - @param optional (nil or map[string]interface{}) with one or more of: - @param "limit" (int32) The number of records to return at once. Limited to 100. - @param "skip" (int32) The offset into the records to return. - @param "xOrgId" (string) - @return []GraphConnection*/ -func (a *UserGroupAssociationsApiService) GraphUserGroupAssociationsList(ctx context.Context, groupId string, contentType string, accept string, targets []string, localVarOptionals map[string]interface{}) ([]GraphConnection, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload []GraphConnection - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/usergroups/{group_id}/associations" - localVarPath = strings.Replace(localVarPath, "{"+"group_id"+"}", fmt.Sprintf("%v", groupId), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["limit"], "int32", "limit"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["skip"], "int32", "skip"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return successPayload, nil, err - } - - if localVarTempParam, localVarOk := localVarOptionals["limit"].(int32); localVarOk { - localVarQueryParams.Add("limit", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["skip"].(int32); localVarOk { - localVarQueryParams.Add("skip", parameterToString(localVarTempParam, "")) - } - localVarQueryParams.Add("targets", parameterToString(targets, "csv")) - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* UserGroupAssociationsApiService Manage the associations of a User Group - This endpoint manages the _direct_ associations of this User Group. A direct association can be a non-homogeneous relationship between 2 different objects, for example User Groups and Users. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/usergroups/{GroupID}/associations \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"op\": \"add\", \"type\": \"system\", \"id\": \"{SystemID}\" }' ``` - * @param ctx context.Context for authentication, logging, tracing, etc. - @param groupId ObjectID of the User Group. - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "body" (UserGroupGraphManagementReq) - @param "xOrgId" (string) - @return */ -func (a *UserGroupAssociationsApiService) GraphUserGroupAssociationsPost(ctx context.Context, groupId string, contentType string, accept string, localVarOptionals map[string]interface{}) ( *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Post") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/usergroups/{group_id}/associations" - localVarPath = strings.Replace(localVarPath, "{"+"group_id"+"}", fmt.Sprintf("%v", groupId), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return nil, err - } - - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - // body params - if localVarTempParam, localVarOk := localVarOptionals["body"].(UserGroupGraphManagementReq); localVarOk { - localVarPostBody = &localVarTempParam - } - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - return localVarHttpResponse, err -} - -/* UserGroupAssociationsApiService List the Active Directories bound to a User Group - This endpoint will return all Active Directory Instances bound to a User Group, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this User Group to the corresponding Active Directory; this array represents all grouping and/or associations that would have to be removed to deprovision the Active Directory from this User Group. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/usergroups/{GroupID}/activedirectories \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - * @param ctx context.Context for authentication, logging, tracing, etc. - @param groupId ObjectID of the User Group. - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "limit" (int32) The number of records to return at once. Limited to 100. - @param "xOrgId" (string) - @param "skip" (int32) The offset into the records to return. - @param "filter" ([]string) Supported operators are: eq, ne, gt, ge, lt, le, between, search, in - @return []GraphObjectWithPaths*/ -func (a *UserGroupAssociationsApiService) GraphUserGroupTraverseActiveDirectory(ctx context.Context, groupId string, contentType string, accept string, localVarOptionals map[string]interface{}) ([]GraphObjectWithPaths, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload []GraphObjectWithPaths - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/usergroups/{group_id}/activedirectories" - localVarPath = strings.Replace(localVarPath, "{"+"group_id"+"}", fmt.Sprintf("%v", groupId), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["limit"], "int32", "limit"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["skip"], "int32", "skip"); err != nil { - return successPayload, nil, err - } - - if localVarTempParam, localVarOk := localVarOptionals["limit"].(int32); localVarOk { - localVarQueryParams.Add("limit", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["skip"].(int32); localVarOk { - localVarQueryParams.Add("skip", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["filter"].([]string); localVarOk { - localVarQueryParams.Add("filter", parameterToString(localVarTempParam, "csv")) - } - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* UserGroupAssociationsApiService List the Applications bound to a User Group - This endpoint will return all Applications bound to a User Group, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this User Group to the corresponding Application; this array represents all grouping and/or associations that would have to be removed to deprovision the Application from this User Group. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/usergroups/{GroupID}/applications \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - * @param ctx context.Context for authentication, logging, tracing, etc. - @param groupId ObjectID of the User Group. - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "limit" (int32) The number of records to return at once. Limited to 100. - @param "xOrgId" (string) - @param "skip" (int32) The offset into the records to return. - @param "filter" ([]string) Supported operators are: eq, ne, gt, ge, lt, le, between, search, in - @return []GraphObjectWithPaths*/ -func (a *UserGroupAssociationsApiService) GraphUserGroupTraverseApplication(ctx context.Context, groupId string, contentType string, accept string, localVarOptionals map[string]interface{}) ([]GraphObjectWithPaths, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload []GraphObjectWithPaths - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/usergroups/{group_id}/applications" - localVarPath = strings.Replace(localVarPath, "{"+"group_id"+"}", fmt.Sprintf("%v", groupId), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["limit"], "int32", "limit"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["skip"], "int32", "skip"); err != nil { - return successPayload, nil, err - } - - if localVarTempParam, localVarOk := localVarOptionals["limit"].(int32); localVarOk { - localVarQueryParams.Add("limit", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["skip"].(int32); localVarOk { - localVarQueryParams.Add("skip", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["filter"].([]string); localVarOk { - localVarQueryParams.Add("filter", parameterToString(localVarTempParam, "csv")) - } - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* UserGroupAssociationsApiService List the Directories bound to a User Group - This endpoint will return all Directories bound to a User Group, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this User Group to the corresponding Directory; this array represents all grouping and/or associations that would have to be removed to deprovision the Directories from this User Group. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/usergroups/{GroupID}/directories \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - * @param ctx context.Context for authentication, logging, tracing, etc. - @param groupId ObjectID of the User Group. - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "limit" (int32) The number of records to return at once. Limited to 100. - @param "xOrgId" (string) - @param "skip" (int32) The offset into the records to return. - @param "filter" ([]string) Supported operators are: eq, ne, gt, ge, lt, le, between, search, in - @return []GraphObjectWithPaths*/ -func (a *UserGroupAssociationsApiService) GraphUserGroupTraverseDirectory(ctx context.Context, groupId string, contentType string, accept string, localVarOptionals map[string]interface{}) ([]GraphObjectWithPaths, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload []GraphObjectWithPaths - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/usergroups/{group_id}/directories" - localVarPath = strings.Replace(localVarPath, "{"+"group_id"+"}", fmt.Sprintf("%v", groupId), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["limit"], "int32", "limit"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["skip"], "int32", "skip"); err != nil { - return successPayload, nil, err - } - - if localVarTempParam, localVarOk := localVarOptionals["limit"].(int32); localVarOk { - localVarQueryParams.Add("limit", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["skip"].(int32); localVarOk { - localVarQueryParams.Add("skip", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["filter"].([]string); localVarOk { - localVarQueryParams.Add("filter", parameterToString(localVarTempParam, "csv")) - } - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* UserGroupAssociationsApiService List the G Suite instances bound to a User Group - This endpoint will return all G Suite Instances bound to a User Group, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this User Group to the corresponding G Suite instance; this array represents all grouping and/or associations that would have to be removed to deprovision the G Suite instance from this User Group. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/usergroups/{GroupID/gsuites \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - * @param ctx context.Context for authentication, logging, tracing, etc. - @param groupId ObjectID of the User Group. - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "limit" (int32) The number of records to return at once. Limited to 100. - @param "xOrgId" (string) - @param "skip" (int32) The offset into the records to return. - @param "filter" ([]string) Supported operators are: eq, ne, gt, ge, lt, le, between, search, in - @return []GraphObjectWithPaths*/ -func (a *UserGroupAssociationsApiService) GraphUserGroupTraverseGSuite(ctx context.Context, groupId string, contentType string, accept string, localVarOptionals map[string]interface{}) ([]GraphObjectWithPaths, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload []GraphObjectWithPaths - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/usergroups/{group_id}/gsuites" - localVarPath = strings.Replace(localVarPath, "{"+"group_id"+"}", fmt.Sprintf("%v", groupId), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["limit"], "int32", "limit"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["skip"], "int32", "skip"); err != nil { - return successPayload, nil, err - } - - if localVarTempParam, localVarOk := localVarOptionals["limit"].(int32); localVarOk { - localVarQueryParams.Add("limit", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["skip"].(int32); localVarOk { - localVarQueryParams.Add("skip", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["filter"].([]string); localVarOk { - localVarQueryParams.Add("filter", parameterToString(localVarTempParam, "csv")) - } - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* UserGroupAssociationsApiService List the LDAP Servers bound to a User Group - This endpoint will return all LDAP Servers bound to a User Group, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this User Group to the corresponding LDAP Server; this array represents all grouping and/or associations that would have to be removed to deprovision the LDAP Server from this User Group. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/usergroups/{GroupID}/ldapservers \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - * @param ctx context.Context for authentication, logging, tracing, etc. - @param groupId ObjectID of the User Group. - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "limit" (int32) The number of records to return at once. Limited to 100. - @param "xOrgId" (string) - @param "skip" (int32) The offset into the records to return. - @param "filter" ([]string) Supported operators are: eq, ne, gt, ge, lt, le, between, search, in - @return []GraphObjectWithPaths*/ -func (a *UserGroupAssociationsApiService) GraphUserGroupTraverseLdapServer(ctx context.Context, groupId string, contentType string, accept string, localVarOptionals map[string]interface{}) ([]GraphObjectWithPaths, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload []GraphObjectWithPaths - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/usergroups/{group_id}/ldapservers" - localVarPath = strings.Replace(localVarPath, "{"+"group_id"+"}", fmt.Sprintf("%v", groupId), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["limit"], "int32", "limit"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["skip"], "int32", "skip"); err != nil { - return successPayload, nil, err - } - - if localVarTempParam, localVarOk := localVarOptionals["limit"].(int32); localVarOk { - localVarQueryParams.Add("limit", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["skip"].(int32); localVarOk { - localVarQueryParams.Add("skip", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["filter"].([]string); localVarOk { - localVarQueryParams.Add("filter", parameterToString(localVarTempParam, "csv")) - } - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* UserGroupAssociationsApiService List the Office 365 instances bound to a User Group - This endpoint will return all Office 365 instances bound to a User Group, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this User Group to the corresponding Office 365 instance; this array represents all grouping and/or associations that would have to be removed to deprovision the Office 365 instance from this User Group. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/usergroups/{GroupID}/office365s \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - * @param ctx context.Context for authentication, logging, tracing, etc. - @param groupId ObjectID of the User Group. - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "limit" (int32) The number of records to return at once. Limited to 100. - @param "xOrgId" (string) - @param "skip" (int32) The offset into the records to return. - @param "filter" ([]string) Supported operators are: eq, ne, gt, ge, lt, le, between, search, in - @return []GraphObjectWithPaths*/ -func (a *UserGroupAssociationsApiService) GraphUserGroupTraverseOffice365(ctx context.Context, groupId string, contentType string, accept string, localVarOptionals map[string]interface{}) ([]GraphObjectWithPaths, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload []GraphObjectWithPaths - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/usergroups/{group_id}/office365s" - localVarPath = strings.Replace(localVarPath, "{"+"group_id"+"}", fmt.Sprintf("%v", groupId), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["limit"], "int32", "limit"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["skip"], "int32", "skip"); err != nil { - return successPayload, nil, err - } - - if localVarTempParam, localVarOk := localVarOptionals["limit"].(int32); localVarOk { - localVarQueryParams.Add("limit", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["skip"].(int32); localVarOk { - localVarQueryParams.Add("skip", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["filter"].([]string); localVarOk { - localVarQueryParams.Add("filter", parameterToString(localVarTempParam, "csv")) - } - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* UserGroupAssociationsApiService List the RADIUS Servers bound to a User Group - This endpoint will return all RADIUS servers bound to a User Group, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this User Group to the corresponding RADIUS Server; this array represents all grouping and/or associations that would have to be removed to deprovision the RADIUS Server from this User Group. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/usergroups/{GroupID}/radiusservers \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - * @param ctx context.Context for authentication, logging, tracing, etc. - @param groupId ObjectID of the User Group. - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "limit" (int32) The number of records to return at once. Limited to 100. - @param "xOrgId" (string) - @param "skip" (int32) The offset into the records to return. - @param "filter" ([]string) Supported operators are: eq, ne, gt, ge, lt, le, between, search, in - @return []GraphObjectWithPaths*/ -func (a *UserGroupAssociationsApiService) GraphUserGroupTraverseRadiusServer(ctx context.Context, groupId string, contentType string, accept string, localVarOptionals map[string]interface{}) ([]GraphObjectWithPaths, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload []GraphObjectWithPaths - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/usergroups/{group_id}/radiusservers" - localVarPath = strings.Replace(localVarPath, "{"+"group_id"+"}", fmt.Sprintf("%v", groupId), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["limit"], "int32", "limit"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["skip"], "int32", "skip"); err != nil { - return successPayload, nil, err - } - - if localVarTempParam, localVarOk := localVarOptionals["limit"].(int32); localVarOk { - localVarQueryParams.Add("limit", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["skip"].(int32); localVarOk { - localVarQueryParams.Add("skip", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["filter"].([]string); localVarOk { - localVarQueryParams.Add("filter", parameterToString(localVarTempParam, "csv")) - } - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* UserGroupAssociationsApiService List the Systems bound to a User Group - This endpoint will return all Systems bound to a User Group, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this User Group to the corresponding System; this array represents all grouping and/or associations that would have to be removed to deprovision the System from this User Group. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/usergroups/{GroupID}/systems \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - * @param ctx context.Context for authentication, logging, tracing, etc. - @param groupId ObjectID of the User Group. - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "limit" (int32) The number of records to return at once. Limited to 100. - @param "xOrgId" (string) - @param "skip" (int32) The offset into the records to return. - @param "filter" ([]string) Supported operators are: eq, ne, gt, ge, lt, le, between, search, in - @return []GraphObjectWithPaths*/ -func (a *UserGroupAssociationsApiService) GraphUserGroupTraverseSystem(ctx context.Context, groupId string, contentType string, accept string, localVarOptionals map[string]interface{}) ([]GraphObjectWithPaths, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload []GraphObjectWithPaths - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/usergroups/{group_id}/systems" - localVarPath = strings.Replace(localVarPath, "{"+"group_id"+"}", fmt.Sprintf("%v", groupId), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["limit"], "int32", "limit"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["skip"], "int32", "skip"); err != nil { - return successPayload, nil, err - } - - if localVarTempParam, localVarOk := localVarOptionals["limit"].(int32); localVarOk { - localVarQueryParams.Add("limit", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["skip"].(int32); localVarOk { - localVarQueryParams.Add("skip", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["filter"].([]string); localVarOk { - localVarQueryParams.Add("filter", parameterToString(localVarTempParam, "csv")) - } - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* UserGroupAssociationsApiService List the System Groups bound to User Groups - This endpoint will return all System Groups bound to a User Group, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this User Group to the corresponding System Group; this array represents all grouping and/or associations that would have to be removed to deprovision the System Group from this User Group. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/usergroups/{GroupID}/systemgroups \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - * @param ctx context.Context for authentication, logging, tracing, etc. - @param groupId ObjectID of the User Group. - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "limit" (int32) The number of records to return at once. Limited to 100. - @param "xOrgId" (string) - @param "skip" (int32) The offset into the records to return. - @param "filter" ([]string) Supported operators are: eq, ne, gt, ge, lt, le, between, search, in - @return []GraphObjectWithPaths*/ -func (a *UserGroupAssociationsApiService) GraphUserGroupTraverseSystemGroup(ctx context.Context, groupId string, contentType string, accept string, localVarOptionals map[string]interface{}) ([]GraphObjectWithPaths, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload []GraphObjectWithPaths - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/usergroups/{group_id}/systemgroups" - localVarPath = strings.Replace(localVarPath, "{"+"group_id"+"}", fmt.Sprintf("%v", groupId), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["limit"], "int32", "limit"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["skip"], "int32", "skip"); err != nil { - return successPayload, nil, err - } - - if localVarTempParam, localVarOk := localVarOptionals["limit"].(int32); localVarOk { - localVarQueryParams.Add("limit", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["skip"].(int32); localVarOk { - localVarQueryParams.Add("skip", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["filter"].([]string); localVarOk { - localVarQueryParams.Add("filter", parameterToString(localVarTempParam, "csv")) - } - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - diff --git a/v2/user_group_attributes.go b/v2/user_group_attributes.go deleted file mode 100644 index 1239c63..0000000 --- a/v2/user_group_attributes.go +++ /dev/null @@ -1,17 +0,0 @@ -/* - * JumpCloud APIs - * - * JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. - * - * API version: 2.0 - * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) - */ - -package v2 - -type UserGroupAttributes struct { - - PosixGroups []UserGroupAttributesPosixGroups `json:"posixGroups,omitempty"` - - SambaEnabled bool `json:"sambaEnabled,omitempty"` -} diff --git a/v2/user_group_attributes_posix_groups.go b/v2/user_group_attributes_posix_groups.go deleted file mode 100644 index bf35373..0000000 --- a/v2/user_group_attributes_posix_groups.go +++ /dev/null @@ -1,17 +0,0 @@ -/* - * JumpCloud APIs - * - * JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. - * - * API version: 2.0 - * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) - */ - -package v2 - -type UserGroupAttributesPosixGroups struct { - - Id int32 `json:"id,omitempty"` - - Name string `json:"name,omitempty"` -} diff --git a/v2/user_group_graph_management_req.go b/v2/user_group_graph_management_req.go deleted file mode 100644 index 55a1064..0000000 --- a/v2/user_group_graph_management_req.go +++ /dev/null @@ -1,22 +0,0 @@ -/* - * JumpCloud APIs - * - * JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. - * - * API version: 2.0 - * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) - */ - -package v2 - -type UserGroupGraphManagementReq struct { - - // The ObjectID of graph object being added or removed as an association. - Id string `json:"id"` - - // How to modify the graph connection. - Op string `json:"op"` - - // The graph type - Type_ string `json:"type"` -} diff --git a/v2/user_group_members_membership_api.go b/v2/user_group_members_membership_api.go deleted file mode 100644 index c324ac7..0000000 --- a/v2/user_group_members_membership_api.go +++ /dev/null @@ -1,442 +0,0 @@ -/* - * JumpCloud APIs - * - * JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. - * - * API version: 2.0 - * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) - */ - -package v2 - -import ( - "io/ioutil" - "net/url" - "net/http" - "strings" - "golang.org/x/net/context" - "encoding/json" - "fmt" -) - -// Linger please -var ( - _ context.Context -) - -type UserGroupMembersMembershipApiService service - - -/* UserGroupMembersMembershipApiService List the User Group's parents - This endpoint returns all User Groups a User Group is a member of. #### Sample Request ``` https://console.jumpcloud.com/api/v2/usergroups/{group_id}/memberof ``` Not public yet, as the code is not finished, - * @param ctx context.Context for authentication, logging, tracing, etc. - @param groupId ObjectID of the User Group. - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "filter" ([]string) Supported operators are: eq, ne, gt, ge, lt, le, between, search, in - @param "limit" (int32) The number of records to return at once. Limited to 100. - @param "skip" (int32) The offset into the records to return. - @param "sort" ([]string) The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. - @param "xOrgId" (string) - @return []GraphObjectWithPaths*/ -func (a *UserGroupMembersMembershipApiService) GraphUserGroupMemberOf(ctx context.Context, groupId string, contentType string, accept string, localVarOptionals map[string]interface{}) ([]GraphObjectWithPaths, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload []GraphObjectWithPaths - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/usergroups/{group_id}/memberof" - localVarPath = strings.Replace(localVarPath, "{"+"group_id"+"}", fmt.Sprintf("%v", groupId), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["limit"], "int32", "limit"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["skip"], "int32", "skip"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return successPayload, nil, err - } - - if localVarTempParam, localVarOk := localVarOptionals["filter"].([]string); localVarOk { - localVarQueryParams.Add("filter", parameterToString(localVarTempParam, "csv")) - } - if localVarTempParam, localVarOk := localVarOptionals["limit"].(int32); localVarOk { - localVarQueryParams.Add("limit", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["skip"].(int32); localVarOk { - localVarQueryParams.Add("skip", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["sort"].([]string); localVarOk { - localVarQueryParams.Add("sort", parameterToString(localVarTempParam, "csv")) - } - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* UserGroupMembersMembershipApiService List the members of a User Group - This endpoint returns the user members of a User Group. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/usergroups/{GroupID}/members \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - * @param ctx context.Context for authentication, logging, tracing, etc. - @param groupId ObjectID of the User Group. - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "limit" (int32) The number of records to return at once. Limited to 100. - @param "skip" (int32) The offset into the records to return. - @param "xOrgId" (string) - @return []GraphConnection*/ -func (a *UserGroupMembersMembershipApiService) GraphUserGroupMembersList(ctx context.Context, groupId string, contentType string, accept string, localVarOptionals map[string]interface{}) ([]GraphConnection, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload []GraphConnection - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/usergroups/{group_id}/members" - localVarPath = strings.Replace(localVarPath, "{"+"group_id"+"}", fmt.Sprintf("%v", groupId), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["limit"], "int32", "limit"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["skip"], "int32", "skip"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return successPayload, nil, err - } - - if localVarTempParam, localVarOk := localVarOptionals["limit"].(int32); localVarOk { - localVarQueryParams.Add("limit", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["skip"].(int32); localVarOk { - localVarQueryParams.Add("skip", parameterToString(localVarTempParam, "")) - } - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* UserGroupMembersMembershipApiService Manage the members of a User Group - This endpoint allows you to manage the user members of a User Group. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/usergroups/{GroupID}/members \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"op\": \"add\", \"type\": \"user\", \"id\": \"{User_ID}\" }' ``` - * @param ctx context.Context for authentication, logging, tracing, etc. - @param groupId ObjectID of the User Group. - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "body" (UserGroupMembersReq) - @param "xOrgId" (string) - @return */ -func (a *UserGroupMembersMembershipApiService) GraphUserGroupMembersPost(ctx context.Context, groupId string, contentType string, accept string, localVarOptionals map[string]interface{}) ( *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Post") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/usergroups/{group_id}/members" - localVarPath = strings.Replace(localVarPath, "{"+"group_id"+"}", fmt.Sprintf("%v", groupId), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return nil, err - } - - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - // body params - if localVarTempParam, localVarOk := localVarOptionals["body"].(UserGroupMembersReq); localVarOk { - localVarPostBody = &localVarTempParam - } - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - return localVarHttpResponse, err -} - -/* UserGroupMembersMembershipApiService List the User Group's membership - This endpoint returns all users members that are a member of this User Group. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/usergroups/{GroupID}/membership \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - * @param ctx context.Context for authentication, logging, tracing, etc. - @param groupId ObjectID of the User Group. - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "filter" ([]string) Supported operators are: eq, ne, gt, ge, lt, le, between, search, in - @param "limit" (int32) The number of records to return at once. Limited to 100. - @param "skip" (int32) The offset into the records to return. - @param "sort" ([]string) The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. - @param "xOrgId" (string) - @return []GraphObjectWithPaths*/ -func (a *UserGroupMembersMembershipApiService) GraphUserGroupMembership(ctx context.Context, groupId string, contentType string, accept string, localVarOptionals map[string]interface{}) ([]GraphObjectWithPaths, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload []GraphObjectWithPaths - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/usergroups/{group_id}/membership" - localVarPath = strings.Replace(localVarPath, "{"+"group_id"+"}", fmt.Sprintf("%v", groupId), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["limit"], "int32", "limit"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["skip"], "int32", "skip"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return successPayload, nil, err - } - - if localVarTempParam, localVarOk := localVarOptionals["filter"].([]string); localVarOk { - localVarQueryParams.Add("filter", parameterToString(localVarTempParam, "csv")) - } - if localVarTempParam, localVarOk := localVarOptionals["limit"].(int32); localVarOk { - localVarQueryParams.Add("limit", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["skip"].(int32); localVarOk { - localVarQueryParams.Add("skip", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["sort"].([]string); localVarOk { - localVarQueryParams.Add("sort", parameterToString(localVarTempParam, "csv")) - } - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - diff --git a/v2/user_group_members_req.go b/v2/user_group_members_req.go deleted file mode 100644 index 1a5937c..0000000 --- a/v2/user_group_members_req.go +++ /dev/null @@ -1,22 +0,0 @@ -/* - * JumpCloud APIs - * - * JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. - * - * API version: 2.0 - * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) - */ - -package v2 - -type UserGroupMembersReq struct { - - // The ObjectID of member being added or removed. - Id string `json:"id"` - - // How to modify the membership connection. - Op string `json:"op"` - - // The member type. - Type_ string `json:"type"` -} diff --git a/v2/user_group_post.go b/v2/user_group_post.go deleted file mode 100644 index b249f72..0000000 --- a/v2/user_group_post.go +++ /dev/null @@ -1,18 +0,0 @@ -/* - * JumpCloud APIs - * - * JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. - * - * API version: 2.0 - * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) - */ - -package v2 - -type UserGroupPost struct { - - Attributes *UserGroupAttributes `json:"attributes,omitempty"` - - // Display name of a User Group. - Name string `json:"name"` -} diff --git a/v2/user_group_put.go b/v2/user_group_put.go deleted file mode 100644 index 94958a2..0000000 --- a/v2/user_group_put.go +++ /dev/null @@ -1,18 +0,0 @@ -/* - * JumpCloud APIs - * - * JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. - * - * API version: 2.0 - * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) - */ - -package v2 - -type UserGroupPut struct { - - Attributes *UserGroupAttributes `json:"attributes,omitempty"` - - // Display name of a User Group. - Name string `json:"name"` -} diff --git a/v2/user_groups_api.go b/v2/user_groups_api.go deleted file mode 100644 index 72a4842..0000000 --- a/v2/user_groups_api.go +++ /dev/null @@ -1,2163 +0,0 @@ -/* - * JumpCloud APIs - * - * JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. - * - * API version: 2.0 - * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) - */ - -package v2 - -import ( - "io/ioutil" - "net/url" - "net/http" - "strings" - "golang.org/x/net/context" - "encoding/json" - "fmt" -) - -// Linger please -var ( - _ context.Context -) - -type UserGroupsApiService service - - -/* UserGroupsApiService List the associations of a User Group. - This endpoint returns the _direct_ associations of this User Group. A direct association can be a non-homogeneous relationship between 2 different objects, for example User Groups and Users. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/usergroups/{GroupID}/associations?targets=system \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - * @param ctx context.Context for authentication, logging, tracing, etc. - @param groupId ObjectID of the User Group. - @param contentType - @param accept - @param targets - @param optional (nil or map[string]interface{}) with one or more of: - @param "limit" (int32) The number of records to return at once. Limited to 100. - @param "skip" (int32) The offset into the records to return. - @param "xOrgId" (string) - @return []GraphConnection*/ -func (a *UserGroupsApiService) GraphUserGroupAssociationsList(ctx context.Context, groupId string, contentType string, accept string, targets []string, localVarOptionals map[string]interface{}) ([]GraphConnection, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload []GraphConnection - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/usergroups/{group_id}/associations" - localVarPath = strings.Replace(localVarPath, "{"+"group_id"+"}", fmt.Sprintf("%v", groupId), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["limit"], "int32", "limit"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["skip"], "int32", "skip"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return successPayload, nil, err - } - - if localVarTempParam, localVarOk := localVarOptionals["limit"].(int32); localVarOk { - localVarQueryParams.Add("limit", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["skip"].(int32); localVarOk { - localVarQueryParams.Add("skip", parameterToString(localVarTempParam, "")) - } - localVarQueryParams.Add("targets", parameterToString(targets, "csv")) - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* UserGroupsApiService Manage the associations of a User Group - This endpoint manages the _direct_ associations of this User Group. A direct association can be a non-homogeneous relationship between 2 different objects, for example User Groups and Users. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/usergroups/{GroupID}/associations \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"op\": \"add\", \"type\": \"system\", \"id\": \"{SystemID}\" }' ``` - * @param ctx context.Context for authentication, logging, tracing, etc. - @param groupId ObjectID of the User Group. - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "body" (UserGroupGraphManagementReq) - @param "xOrgId" (string) - @return */ -func (a *UserGroupsApiService) GraphUserGroupAssociationsPost(ctx context.Context, groupId string, contentType string, accept string, localVarOptionals map[string]interface{}) ( *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Post") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/usergroups/{group_id}/associations" - localVarPath = strings.Replace(localVarPath, "{"+"group_id"+"}", fmt.Sprintf("%v", groupId), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return nil, err - } - - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - // body params - if localVarTempParam, localVarOk := localVarOptionals["body"].(UserGroupGraphManagementReq); localVarOk { - localVarPostBody = &localVarTempParam - } - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - return localVarHttpResponse, err -} - -/* UserGroupsApiService List the User Group's parents - This endpoint returns all User Groups a User Group is a member of. #### Sample Request ``` https://console.jumpcloud.com/api/v2/usergroups/{group_id}/memberof ``` Not public yet, as the code is not finished, - * @param ctx context.Context for authentication, logging, tracing, etc. - @param groupId ObjectID of the User Group. - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "filter" ([]string) Supported operators are: eq, ne, gt, ge, lt, le, between, search, in - @param "limit" (int32) The number of records to return at once. Limited to 100. - @param "skip" (int32) The offset into the records to return. - @param "sort" ([]string) The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. - @param "xOrgId" (string) - @return []GraphObjectWithPaths*/ -func (a *UserGroupsApiService) GraphUserGroupMemberOf(ctx context.Context, groupId string, contentType string, accept string, localVarOptionals map[string]interface{}) ([]GraphObjectWithPaths, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload []GraphObjectWithPaths - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/usergroups/{group_id}/memberof" - localVarPath = strings.Replace(localVarPath, "{"+"group_id"+"}", fmt.Sprintf("%v", groupId), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["limit"], "int32", "limit"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["skip"], "int32", "skip"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return successPayload, nil, err - } - - if localVarTempParam, localVarOk := localVarOptionals["filter"].([]string); localVarOk { - localVarQueryParams.Add("filter", parameterToString(localVarTempParam, "csv")) - } - if localVarTempParam, localVarOk := localVarOptionals["limit"].(int32); localVarOk { - localVarQueryParams.Add("limit", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["skip"].(int32); localVarOk { - localVarQueryParams.Add("skip", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["sort"].([]string); localVarOk { - localVarQueryParams.Add("sort", parameterToString(localVarTempParam, "csv")) - } - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* UserGroupsApiService List the members of a User Group - This endpoint returns the user members of a User Group. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/usergroups/{GroupID}/members \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - * @param ctx context.Context for authentication, logging, tracing, etc. - @param groupId ObjectID of the User Group. - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "limit" (int32) The number of records to return at once. Limited to 100. - @param "skip" (int32) The offset into the records to return. - @param "xOrgId" (string) - @return []GraphConnection*/ -func (a *UserGroupsApiService) GraphUserGroupMembersList(ctx context.Context, groupId string, contentType string, accept string, localVarOptionals map[string]interface{}) ([]GraphConnection, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload []GraphConnection - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/usergroups/{group_id}/members" - localVarPath = strings.Replace(localVarPath, "{"+"group_id"+"}", fmt.Sprintf("%v", groupId), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["limit"], "int32", "limit"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["skip"], "int32", "skip"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return successPayload, nil, err - } - - if localVarTempParam, localVarOk := localVarOptionals["limit"].(int32); localVarOk { - localVarQueryParams.Add("limit", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["skip"].(int32); localVarOk { - localVarQueryParams.Add("skip", parameterToString(localVarTempParam, "")) - } - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* UserGroupsApiService Manage the members of a User Group - This endpoint allows you to manage the user members of a User Group. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/usergroups/{GroupID}/members \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"op\": \"add\", \"type\": \"user\", \"id\": \"{User_ID}\" }' ``` - * @param ctx context.Context for authentication, logging, tracing, etc. - @param groupId ObjectID of the User Group. - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "body" (UserGroupMembersReq) - @param "xOrgId" (string) - @return */ -func (a *UserGroupsApiService) GraphUserGroupMembersPost(ctx context.Context, groupId string, contentType string, accept string, localVarOptionals map[string]interface{}) ( *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Post") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/usergroups/{group_id}/members" - localVarPath = strings.Replace(localVarPath, "{"+"group_id"+"}", fmt.Sprintf("%v", groupId), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return nil, err - } - - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - // body params - if localVarTempParam, localVarOk := localVarOptionals["body"].(UserGroupMembersReq); localVarOk { - localVarPostBody = &localVarTempParam - } - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - return localVarHttpResponse, err -} - -/* UserGroupsApiService List the User Group's membership - This endpoint returns all users members that are a member of this User Group. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/usergroups/{GroupID}/membership \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - * @param ctx context.Context for authentication, logging, tracing, etc. - @param groupId ObjectID of the User Group. - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "filter" ([]string) Supported operators are: eq, ne, gt, ge, lt, le, between, search, in - @param "limit" (int32) The number of records to return at once. Limited to 100. - @param "skip" (int32) The offset into the records to return. - @param "sort" ([]string) The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. - @param "xOrgId" (string) - @return []GraphObjectWithPaths*/ -func (a *UserGroupsApiService) GraphUserGroupMembership(ctx context.Context, groupId string, contentType string, accept string, localVarOptionals map[string]interface{}) ([]GraphObjectWithPaths, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload []GraphObjectWithPaths - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/usergroups/{group_id}/membership" - localVarPath = strings.Replace(localVarPath, "{"+"group_id"+"}", fmt.Sprintf("%v", groupId), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["limit"], "int32", "limit"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["skip"], "int32", "skip"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return successPayload, nil, err - } - - if localVarTempParam, localVarOk := localVarOptionals["filter"].([]string); localVarOk { - localVarQueryParams.Add("filter", parameterToString(localVarTempParam, "csv")) - } - if localVarTempParam, localVarOk := localVarOptionals["limit"].(int32); localVarOk { - localVarQueryParams.Add("limit", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["skip"].(int32); localVarOk { - localVarQueryParams.Add("skip", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["sort"].([]string); localVarOk { - localVarQueryParams.Add("sort", parameterToString(localVarTempParam, "csv")) - } - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* UserGroupsApiService List the Active Directories bound to a User Group - This endpoint will return all Active Directory Instances bound to a User Group, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this User Group to the corresponding Active Directory; this array represents all grouping and/or associations that would have to be removed to deprovision the Active Directory from this User Group. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/usergroups/{GroupID}/activedirectories \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - * @param ctx context.Context for authentication, logging, tracing, etc. - @param groupId ObjectID of the User Group. - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "limit" (int32) The number of records to return at once. Limited to 100. - @param "xOrgId" (string) - @param "skip" (int32) The offset into the records to return. - @param "filter" ([]string) Supported operators are: eq, ne, gt, ge, lt, le, between, search, in - @return []GraphObjectWithPaths*/ -func (a *UserGroupsApiService) GraphUserGroupTraverseActiveDirectory(ctx context.Context, groupId string, contentType string, accept string, localVarOptionals map[string]interface{}) ([]GraphObjectWithPaths, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload []GraphObjectWithPaths - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/usergroups/{group_id}/activedirectories" - localVarPath = strings.Replace(localVarPath, "{"+"group_id"+"}", fmt.Sprintf("%v", groupId), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["limit"], "int32", "limit"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["skip"], "int32", "skip"); err != nil { - return successPayload, nil, err - } - - if localVarTempParam, localVarOk := localVarOptionals["limit"].(int32); localVarOk { - localVarQueryParams.Add("limit", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["skip"].(int32); localVarOk { - localVarQueryParams.Add("skip", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["filter"].([]string); localVarOk { - localVarQueryParams.Add("filter", parameterToString(localVarTempParam, "csv")) - } - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* UserGroupsApiService List the Applications bound to a User Group - This endpoint will return all Applications bound to a User Group, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this User Group to the corresponding Application; this array represents all grouping and/or associations that would have to be removed to deprovision the Application from this User Group. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/usergroups/{GroupID}/applications \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - * @param ctx context.Context for authentication, logging, tracing, etc. - @param groupId ObjectID of the User Group. - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "limit" (int32) The number of records to return at once. Limited to 100. - @param "xOrgId" (string) - @param "skip" (int32) The offset into the records to return. - @param "filter" ([]string) Supported operators are: eq, ne, gt, ge, lt, le, between, search, in - @return []GraphObjectWithPaths*/ -func (a *UserGroupsApiService) GraphUserGroupTraverseApplication(ctx context.Context, groupId string, contentType string, accept string, localVarOptionals map[string]interface{}) ([]GraphObjectWithPaths, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload []GraphObjectWithPaths - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/usergroups/{group_id}/applications" - localVarPath = strings.Replace(localVarPath, "{"+"group_id"+"}", fmt.Sprintf("%v", groupId), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["limit"], "int32", "limit"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["skip"], "int32", "skip"); err != nil { - return successPayload, nil, err - } - - if localVarTempParam, localVarOk := localVarOptionals["limit"].(int32); localVarOk { - localVarQueryParams.Add("limit", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["skip"].(int32); localVarOk { - localVarQueryParams.Add("skip", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["filter"].([]string); localVarOk { - localVarQueryParams.Add("filter", parameterToString(localVarTempParam, "csv")) - } - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* UserGroupsApiService List the Directories bound to a User Group - This endpoint will return all Directories bound to a User Group, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this User Group to the corresponding Directory; this array represents all grouping and/or associations that would have to be removed to deprovision the Directories from this User Group. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/usergroups/{GroupID}/directories \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - * @param ctx context.Context for authentication, logging, tracing, etc. - @param groupId ObjectID of the User Group. - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "limit" (int32) The number of records to return at once. Limited to 100. - @param "xOrgId" (string) - @param "skip" (int32) The offset into the records to return. - @param "filter" ([]string) Supported operators are: eq, ne, gt, ge, lt, le, between, search, in - @return []GraphObjectWithPaths*/ -func (a *UserGroupsApiService) GraphUserGroupTraverseDirectory(ctx context.Context, groupId string, contentType string, accept string, localVarOptionals map[string]interface{}) ([]GraphObjectWithPaths, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload []GraphObjectWithPaths - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/usergroups/{group_id}/directories" - localVarPath = strings.Replace(localVarPath, "{"+"group_id"+"}", fmt.Sprintf("%v", groupId), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["limit"], "int32", "limit"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["skip"], "int32", "skip"); err != nil { - return successPayload, nil, err - } - - if localVarTempParam, localVarOk := localVarOptionals["limit"].(int32); localVarOk { - localVarQueryParams.Add("limit", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["skip"].(int32); localVarOk { - localVarQueryParams.Add("skip", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["filter"].([]string); localVarOk { - localVarQueryParams.Add("filter", parameterToString(localVarTempParam, "csv")) - } - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* UserGroupsApiService List the G Suite instances bound to a User Group - This endpoint will return all G Suite Instances bound to a User Group, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this User Group to the corresponding G Suite instance; this array represents all grouping and/or associations that would have to be removed to deprovision the G Suite instance from this User Group. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/usergroups/{GroupID/gsuites \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - * @param ctx context.Context for authentication, logging, tracing, etc. - @param groupId ObjectID of the User Group. - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "limit" (int32) The number of records to return at once. Limited to 100. - @param "xOrgId" (string) - @param "skip" (int32) The offset into the records to return. - @param "filter" ([]string) Supported operators are: eq, ne, gt, ge, lt, le, between, search, in - @return []GraphObjectWithPaths*/ -func (a *UserGroupsApiService) GraphUserGroupTraverseGSuite(ctx context.Context, groupId string, contentType string, accept string, localVarOptionals map[string]interface{}) ([]GraphObjectWithPaths, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload []GraphObjectWithPaths - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/usergroups/{group_id}/gsuites" - localVarPath = strings.Replace(localVarPath, "{"+"group_id"+"}", fmt.Sprintf("%v", groupId), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["limit"], "int32", "limit"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["skip"], "int32", "skip"); err != nil { - return successPayload, nil, err - } - - if localVarTempParam, localVarOk := localVarOptionals["limit"].(int32); localVarOk { - localVarQueryParams.Add("limit", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["skip"].(int32); localVarOk { - localVarQueryParams.Add("skip", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["filter"].([]string); localVarOk { - localVarQueryParams.Add("filter", parameterToString(localVarTempParam, "csv")) - } - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* UserGroupsApiService List the LDAP Servers bound to a User Group - This endpoint will return all LDAP Servers bound to a User Group, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this User Group to the corresponding LDAP Server; this array represents all grouping and/or associations that would have to be removed to deprovision the LDAP Server from this User Group. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/usergroups/{GroupID}/ldapservers \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - * @param ctx context.Context for authentication, logging, tracing, etc. - @param groupId ObjectID of the User Group. - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "limit" (int32) The number of records to return at once. Limited to 100. - @param "xOrgId" (string) - @param "skip" (int32) The offset into the records to return. - @param "filter" ([]string) Supported operators are: eq, ne, gt, ge, lt, le, between, search, in - @return []GraphObjectWithPaths*/ -func (a *UserGroupsApiService) GraphUserGroupTraverseLdapServer(ctx context.Context, groupId string, contentType string, accept string, localVarOptionals map[string]interface{}) ([]GraphObjectWithPaths, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload []GraphObjectWithPaths - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/usergroups/{group_id}/ldapservers" - localVarPath = strings.Replace(localVarPath, "{"+"group_id"+"}", fmt.Sprintf("%v", groupId), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["limit"], "int32", "limit"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["skip"], "int32", "skip"); err != nil { - return successPayload, nil, err - } - - if localVarTempParam, localVarOk := localVarOptionals["limit"].(int32); localVarOk { - localVarQueryParams.Add("limit", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["skip"].(int32); localVarOk { - localVarQueryParams.Add("skip", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["filter"].([]string); localVarOk { - localVarQueryParams.Add("filter", parameterToString(localVarTempParam, "csv")) - } - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* UserGroupsApiService List the Office 365 instances bound to a User Group - This endpoint will return all Office 365 instances bound to a User Group, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this User Group to the corresponding Office 365 instance; this array represents all grouping and/or associations that would have to be removed to deprovision the Office 365 instance from this User Group. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/usergroups/{GroupID}/office365s \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - * @param ctx context.Context for authentication, logging, tracing, etc. - @param groupId ObjectID of the User Group. - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "limit" (int32) The number of records to return at once. Limited to 100. - @param "xOrgId" (string) - @param "skip" (int32) The offset into the records to return. - @param "filter" ([]string) Supported operators are: eq, ne, gt, ge, lt, le, between, search, in - @return []GraphObjectWithPaths*/ -func (a *UserGroupsApiService) GraphUserGroupTraverseOffice365(ctx context.Context, groupId string, contentType string, accept string, localVarOptionals map[string]interface{}) ([]GraphObjectWithPaths, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload []GraphObjectWithPaths - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/usergroups/{group_id}/office365s" - localVarPath = strings.Replace(localVarPath, "{"+"group_id"+"}", fmt.Sprintf("%v", groupId), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["limit"], "int32", "limit"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["skip"], "int32", "skip"); err != nil { - return successPayload, nil, err - } - - if localVarTempParam, localVarOk := localVarOptionals["limit"].(int32); localVarOk { - localVarQueryParams.Add("limit", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["skip"].(int32); localVarOk { - localVarQueryParams.Add("skip", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["filter"].([]string); localVarOk { - localVarQueryParams.Add("filter", parameterToString(localVarTempParam, "csv")) - } - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* UserGroupsApiService List the RADIUS Servers bound to a User Group - This endpoint will return all RADIUS servers bound to a User Group, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this User Group to the corresponding RADIUS Server; this array represents all grouping and/or associations that would have to be removed to deprovision the RADIUS Server from this User Group. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/usergroups/{GroupID}/radiusservers \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - * @param ctx context.Context for authentication, logging, tracing, etc. - @param groupId ObjectID of the User Group. - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "limit" (int32) The number of records to return at once. Limited to 100. - @param "xOrgId" (string) - @param "skip" (int32) The offset into the records to return. - @param "filter" ([]string) Supported operators are: eq, ne, gt, ge, lt, le, between, search, in - @return []GraphObjectWithPaths*/ -func (a *UserGroupsApiService) GraphUserGroupTraverseRadiusServer(ctx context.Context, groupId string, contentType string, accept string, localVarOptionals map[string]interface{}) ([]GraphObjectWithPaths, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload []GraphObjectWithPaths - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/usergroups/{group_id}/radiusservers" - localVarPath = strings.Replace(localVarPath, "{"+"group_id"+"}", fmt.Sprintf("%v", groupId), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["limit"], "int32", "limit"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["skip"], "int32", "skip"); err != nil { - return successPayload, nil, err - } - - if localVarTempParam, localVarOk := localVarOptionals["limit"].(int32); localVarOk { - localVarQueryParams.Add("limit", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["skip"].(int32); localVarOk { - localVarQueryParams.Add("skip", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["filter"].([]string); localVarOk { - localVarQueryParams.Add("filter", parameterToString(localVarTempParam, "csv")) - } - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* UserGroupsApiService List the Systems bound to a User Group - This endpoint will return all Systems bound to a User Group, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this User Group to the corresponding System; this array represents all grouping and/or associations that would have to be removed to deprovision the System from this User Group. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/usergroups/{GroupID}/systems \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - * @param ctx context.Context for authentication, logging, tracing, etc. - @param groupId ObjectID of the User Group. - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "limit" (int32) The number of records to return at once. Limited to 100. - @param "xOrgId" (string) - @param "skip" (int32) The offset into the records to return. - @param "filter" ([]string) Supported operators are: eq, ne, gt, ge, lt, le, between, search, in - @return []GraphObjectWithPaths*/ -func (a *UserGroupsApiService) GraphUserGroupTraverseSystem(ctx context.Context, groupId string, contentType string, accept string, localVarOptionals map[string]interface{}) ([]GraphObjectWithPaths, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload []GraphObjectWithPaths - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/usergroups/{group_id}/systems" - localVarPath = strings.Replace(localVarPath, "{"+"group_id"+"}", fmt.Sprintf("%v", groupId), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["limit"], "int32", "limit"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["skip"], "int32", "skip"); err != nil { - return successPayload, nil, err - } - - if localVarTempParam, localVarOk := localVarOptionals["limit"].(int32); localVarOk { - localVarQueryParams.Add("limit", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["skip"].(int32); localVarOk { - localVarQueryParams.Add("skip", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["filter"].([]string); localVarOk { - localVarQueryParams.Add("filter", parameterToString(localVarTempParam, "csv")) - } - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* UserGroupsApiService List the System Groups bound to User Groups - This endpoint will return all System Groups bound to a User Group, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this User Group to the corresponding System Group; this array represents all grouping and/or associations that would have to be removed to deprovision the System Group from this User Group. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/usergroups/{GroupID}/systemgroups \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - * @param ctx context.Context for authentication, logging, tracing, etc. - @param groupId ObjectID of the User Group. - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "limit" (int32) The number of records to return at once. Limited to 100. - @param "xOrgId" (string) - @param "skip" (int32) The offset into the records to return. - @param "filter" ([]string) Supported operators are: eq, ne, gt, ge, lt, le, between, search, in - @return []GraphObjectWithPaths*/ -func (a *UserGroupsApiService) GraphUserGroupTraverseSystemGroup(ctx context.Context, groupId string, contentType string, accept string, localVarOptionals map[string]interface{}) ([]GraphObjectWithPaths, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload []GraphObjectWithPaths - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/usergroups/{group_id}/systemgroups" - localVarPath = strings.Replace(localVarPath, "{"+"group_id"+"}", fmt.Sprintf("%v", groupId), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["limit"], "int32", "limit"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["skip"], "int32", "skip"); err != nil { - return successPayload, nil, err - } - - if localVarTempParam, localVarOk := localVarOptionals["limit"].(int32); localVarOk { - localVarQueryParams.Add("limit", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["skip"].(int32); localVarOk { - localVarQueryParams.Add("skip", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["filter"].([]string); localVarOk { - localVarQueryParams.Add("filter", parameterToString(localVarTempParam, "csv")) - } - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* UserGroupsApiService Delete a User Group - This endpoint allows you to delete a User Group. #### Sample Request ``` curl -X DELETE https://console.jumpcloud.com/api/v2/usergroups/{GroupID} \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - * @param ctx context.Context for authentication, logging, tracing, etc. - @param id ObjectID of the User Group. - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "xOrgId" (string) - @return */ -func (a *UserGroupsApiService) GroupsUserDelete(ctx context.Context, id string, contentType string, accept string, localVarOptionals map[string]interface{}) ( *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Delete") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/usergroups/{id}" - localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return nil, err - } - - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - return localVarHttpResponse, err -} - -/* UserGroupsApiService View an individual User Group details - This endpoint returns the details of a User Group. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/usergroups/{GroupID} \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - * @param ctx context.Context for authentication, logging, tracing, etc. - @param id ObjectID of the User Group. - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "xOrgId" (string) - @return UserGroup*/ -func (a *UserGroupsApiService) GroupsUserGet(ctx context.Context, id string, contentType string, accept string, localVarOptionals map[string]interface{}) (UserGroup, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload UserGroup - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/usergroups/{id}" - localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return successPayload, nil, err - } - - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* UserGroupsApiService List all User Groups - This endpoint returns all User Groups. Available filter fields: - `name` - `disabled` - `type` #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/usergroups \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - * @param ctx context.Context for authentication, logging, tracing, etc. - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "fields" ([]string) The comma separated fields included in the returned records. If omitted, the default list of fields will be returned. - @param "filter" ([]string) Supported operators are: eq, ne, gt, ge, lt, le, between, search, in - @param "limit" (int32) The number of records to return at once. Limited to 100. - @param "skip" (int32) The offset into the records to return. - @param "sort" ([]string) The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. - @param "xOrgId" (string) - @return []UserGroup*/ -func (a *UserGroupsApiService) GroupsUserList(ctx context.Context, contentType string, accept string, localVarOptionals map[string]interface{}) ([]UserGroup, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload []UserGroup - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/usergroups" - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["limit"], "int32", "limit"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["skip"], "int32", "skip"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return successPayload, nil, err - } - - if localVarTempParam, localVarOk := localVarOptionals["fields"].([]string); localVarOk { - localVarQueryParams.Add("fields", parameterToString(localVarTempParam, "csv")) - } - if localVarTempParam, localVarOk := localVarOptionals["filter"].([]string); localVarOk { - localVarQueryParams.Add("filter", parameterToString(localVarTempParam, "csv")) - } - if localVarTempParam, localVarOk := localVarOptionals["limit"].(int32); localVarOk { - localVarQueryParams.Add("limit", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["skip"].(int32); localVarOk { - localVarQueryParams.Add("skip", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["sort"].([]string); localVarOk { - localVarQueryParams.Add("sort", parameterToString(localVarTempParam, "csv")) - } - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* UserGroupsApiService Partial update a User Group - We have hidden PATCH on the systemgroups and usergroups for now; we don't have that implemented correctly yet, people should use PUT until we do a true PATCH operation. #### Sample Request ``` https://console.jumpcloud.com/api/v2/usergroups/{id} ``` - * @param ctx context.Context for authentication, logging, tracing, etc. - @param id ObjectID of the User Group. - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "body" (UserGroupPost) - @param "xOrgId" (string) - @return UserGroup*/ -func (a *UserGroupsApiService) GroupsUserPatch(ctx context.Context, id string, contentType string, accept string, localVarOptionals map[string]interface{}) (UserGroup, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Patch") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload UserGroup - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/usergroups/{id}" - localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return successPayload, nil, err - } - - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - // body params - if localVarTempParam, localVarOk := localVarOptionals["body"].(UserGroupPost); localVarOk { - localVarPostBody = &localVarTempParam - } - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* UserGroupsApiService Create a new User Group - This endpoint allows you to create a new User Group. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/usergroups \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"name\": \"{Group_Name}\" }' ``` - * @param ctx context.Context for authentication, logging, tracing, etc. - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "body" (UserGroupPost) - @param "xOrgId" (string) - @return UserGroup*/ -func (a *UserGroupsApiService) GroupsUserPost(ctx context.Context, contentType string, accept string, localVarOptionals map[string]interface{}) (UserGroup, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Post") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload UserGroup - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/usergroups" - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return successPayload, nil, err - } - - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - // body params - if localVarTempParam, localVarOk := localVarOptionals["body"].(UserGroupPost); localVarOk { - localVarPostBody = &localVarTempParam - } - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* UserGroupsApiService Update a User Group - This endpoint allows you to do a full update of the User Group. #### Sample Request ``` curl -X PUT https://console.jumpcloud.com/api/v2/usergroups/{Group_ID} \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY' \\ -d '{ \"name\": \"group_update\" }' ``` - * @param ctx context.Context for authentication, logging, tracing, etc. - @param id ObjectID of the User Group. - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "body" (UserGroupPut) - @param "xOrgId" (string) - @return UserGroup*/ -func (a *UserGroupsApiService) GroupsUserPut(ctx context.Context, id string, contentType string, accept string, localVarOptionals map[string]interface{}) (UserGroup, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Put") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload UserGroup - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/usergroups/{id}" - localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return successPayload, nil, err - } - - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - // body params - if localVarTempParam, localVarOk := localVarOptionals["body"].(UserGroupPut); localVarOk { - localVarPostBody = &localVarTempParam - } - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - diff --git a/v2/users_api.go b/v2/users_api.go deleted file mode 100644 index 9629d50..0000000 --- a/v2/users_api.go +++ /dev/null @@ -1,1277 +0,0 @@ -/* - * JumpCloud APIs - * - * JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. - * - * API version: 2.0 - * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) - */ - -package v2 - -import ( - "io/ioutil" - "net/url" - "net/http" - "strings" - "golang.org/x/net/context" - "encoding/json" - "fmt" -) - -// Linger please -var ( - _ context.Context -) - -type UsersApiService service - - -/* UsersApiService List the associations of a User - This endpoint returns the _direct_ associations of a User. A direct association can be a non-homogeneous relationship between 2 different objects, for example Users and Systems. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/users/{UserID}/associations?targets=system_group \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - * @param ctx context.Context for authentication, logging, tracing, etc. - @param userId ObjectID of the User. - @param contentType - @param accept - @param targets - @param optional (nil or map[string]interface{}) with one or more of: - @param "limit" (int32) The number of records to return at once. Limited to 100. - @param "skip" (int32) The offset into the records to return. - @param "xOrgId" (string) - @return []GraphConnection*/ -func (a *UsersApiService) GraphUserAssociationsList(ctx context.Context, userId string, contentType string, accept string, targets []string, localVarOptionals map[string]interface{}) ([]GraphConnection, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload []GraphConnection - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/users/{user_id}/associations" - localVarPath = strings.Replace(localVarPath, "{"+"user_id"+"}", fmt.Sprintf("%v", userId), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["limit"], "int32", "limit"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["skip"], "int32", "skip"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return successPayload, nil, err - } - - if localVarTempParam, localVarOk := localVarOptionals["limit"].(int32); localVarOk { - localVarQueryParams.Add("limit", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["skip"].(int32); localVarOk { - localVarQueryParams.Add("skip", parameterToString(localVarTempParam, "")) - } - localVarQueryParams.Add("targets", parameterToString(targets, "csv")) - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* UsersApiService Manage the associations of a User - This endpoint allows you to manage the _direct_ associations of a User. A direct association can be a non-homogeneous relationship between 2 different objects, for example Users and Systems. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/users/{UserID}/associations \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"attributes\": { \"sudo\": { \"enabled\": true, \"withoutPassword\": false } }, \"op\": \"add\", \"type\": \"system_group\", \"id\": \"{GroupID}\" }' - * @param ctx context.Context for authentication, logging, tracing, etc. - @param userId ObjectID of the User. - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "body" (UserGraphManagementReq) - @param "xOrgId" (string) - @return */ -func (a *UsersApiService) GraphUserAssociationsPost(ctx context.Context, userId string, contentType string, accept string, localVarOptionals map[string]interface{}) ( *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Post") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/users/{user_id}/associations" - localVarPath = strings.Replace(localVarPath, "{"+"user_id"+"}", fmt.Sprintf("%v", userId), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return nil, err - } - - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - // body params - if localVarTempParam, localVarOk := localVarOptionals["body"].(UserGraphManagementReq); localVarOk { - localVarPostBody = &localVarTempParam - } - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - return localVarHttpResponse, err -} - -/* UsersApiService List the parent Groups of a User - This endpoint returns all the User Groups a User is a member of. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/users/{UserID}/memberof \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - * @param ctx context.Context for authentication, logging, tracing, etc. - @param userId ObjectID of the User. - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "filter" ([]string) Supported operators are: eq, ne, gt, ge, lt, le, between, search, in - @param "limit" (int32) The number of records to return at once. Limited to 100. - @param "skip" (int32) The offset into the records to return. - @param "sort" ([]string) The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. - @param "xOrgId" (string) - @return []GraphObjectWithPaths*/ -func (a *UsersApiService) GraphUserMemberOf(ctx context.Context, userId string, contentType string, accept string, localVarOptionals map[string]interface{}) ([]GraphObjectWithPaths, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload []GraphObjectWithPaths - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/users/{user_id}/memberof" - localVarPath = strings.Replace(localVarPath, "{"+"user_id"+"}", fmt.Sprintf("%v", userId), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["limit"], "int32", "limit"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["skip"], "int32", "skip"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return successPayload, nil, err - } - - if localVarTempParam, localVarOk := localVarOptionals["filter"].([]string); localVarOk { - localVarQueryParams.Add("filter", parameterToString(localVarTempParam, "csv")) - } - if localVarTempParam, localVarOk := localVarOptionals["limit"].(int32); localVarOk { - localVarQueryParams.Add("limit", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["skip"].(int32); localVarOk { - localVarQueryParams.Add("skip", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["sort"].([]string); localVarOk { - localVarQueryParams.Add("sort", parameterToString(localVarTempParam, "csv")) - } - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* UsersApiService List the Applications bound to a User - This endpoint will return all Applications bound to a User, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this User to the corresponding Application; this array represents all grouping and/or associations that would have to be removed to deprovision the Application from this User. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/users/{UserID}/applications \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - * @param ctx context.Context for authentication, logging, tracing, etc. - @param userId ObjectID of the User. - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "limit" (int32) The number of records to return at once. Limited to 100. - @param "xOrgId" (string) - @param "skip" (int32) The offset into the records to return. - @param "filter" ([]string) Supported operators are: eq, ne, gt, ge, lt, le, between, search, in - @return []GraphObjectWithPaths*/ -func (a *UsersApiService) GraphUserTraverseApplication(ctx context.Context, userId string, contentType string, accept string, localVarOptionals map[string]interface{}) ([]GraphObjectWithPaths, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload []GraphObjectWithPaths - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/users/{user_id}/applications" - localVarPath = strings.Replace(localVarPath, "{"+"user_id"+"}", fmt.Sprintf("%v", userId), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["limit"], "int32", "limit"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["skip"], "int32", "skip"); err != nil { - return successPayload, nil, err - } - - if localVarTempParam, localVarOk := localVarOptionals["limit"].(int32); localVarOk { - localVarQueryParams.Add("limit", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["skip"].(int32); localVarOk { - localVarQueryParams.Add("skip", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["filter"].([]string); localVarOk { - localVarQueryParams.Add("filter", parameterToString(localVarTempParam, "csv")) - } - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* UsersApiService List the Directories bound to a User - This endpoint will return all Directories bound to a User, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this User to the corresponding Directory; this array represents all grouping and/or associations that would have to be removed to deprovision the Directory from this User. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/users/{UserID}/directories \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - * @param ctx context.Context for authentication, logging, tracing, etc. - @param userId ObjectID of the User. - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "limit" (int32) The number of records to return at once. Limited to 100. - @param "xOrgId" (string) - @param "skip" (int32) The offset into the records to return. - @param "filter" ([]string) Supported operators are: eq, ne, gt, ge, lt, le, between, search, in - @return []GraphObjectWithPaths*/ -func (a *UsersApiService) GraphUserTraverseDirectory(ctx context.Context, userId string, contentType string, accept string, localVarOptionals map[string]interface{}) ([]GraphObjectWithPaths, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload []GraphObjectWithPaths - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/users/{user_id}/directories" - localVarPath = strings.Replace(localVarPath, "{"+"user_id"+"}", fmt.Sprintf("%v", userId), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["limit"], "int32", "limit"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["skip"], "int32", "skip"); err != nil { - return successPayload, nil, err - } - - if localVarTempParam, localVarOk := localVarOptionals["limit"].(int32); localVarOk { - localVarQueryParams.Add("limit", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["skip"].(int32); localVarOk { - localVarQueryParams.Add("skip", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["filter"].([]string); localVarOk { - localVarQueryParams.Add("filter", parameterToString(localVarTempParam, "csv")) - } - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* UsersApiService List the G Suite instances bound to a User - This endpoint will return all G-Suite Instances bound to a User, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this User to the corresponding G Suite instance; this array represents all grouping and/or associations that would have to be removed to deprovision the G Suite instance from this User. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/users/{UserID}/gsuites \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - * @param ctx context.Context for authentication, logging, tracing, etc. - @param userId ObjectID of the User. - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "limit" (int32) The number of records to return at once. Limited to 100. - @param "xOrgId" (string) - @param "skip" (int32) The offset into the records to return. - @param "filter" ([]string) Supported operators are: eq, ne, gt, ge, lt, le, between, search, in - @return []GraphObjectWithPaths*/ -func (a *UsersApiService) GraphUserTraverseGSuite(ctx context.Context, userId string, contentType string, accept string, localVarOptionals map[string]interface{}) ([]GraphObjectWithPaths, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload []GraphObjectWithPaths - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/users/{user_id}/gsuites" - localVarPath = strings.Replace(localVarPath, "{"+"user_id"+"}", fmt.Sprintf("%v", userId), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["limit"], "int32", "limit"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["skip"], "int32", "skip"); err != nil { - return successPayload, nil, err - } - - if localVarTempParam, localVarOk := localVarOptionals["limit"].(int32); localVarOk { - localVarQueryParams.Add("limit", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["skip"].(int32); localVarOk { - localVarQueryParams.Add("skip", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["filter"].([]string); localVarOk { - localVarQueryParams.Add("filter", parameterToString(localVarTempParam, "csv")) - } - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* UsersApiService List the LDAP servers bound to a User - This endpoint will return all LDAP Servers bound to a User, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this User to the corresponding LDAP Server; this array represents all grouping and/or associations that would have to be removed to deprovision the LDAP Server from this User. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/users/{UserID}/ldapservers \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - * @param ctx context.Context for authentication, logging, tracing, etc. - @param userId ObjectID of the User. - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "limit" (int32) The number of records to return at once. Limited to 100. - @param "xOrgId" (string) - @param "skip" (int32) The offset into the records to return. - @param "filter" ([]string) Supported operators are: eq, ne, gt, ge, lt, le, between, search, in - @return []GraphObjectWithPaths*/ -func (a *UsersApiService) GraphUserTraverseLdapServer(ctx context.Context, userId string, contentType string, accept string, localVarOptionals map[string]interface{}) ([]GraphObjectWithPaths, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload []GraphObjectWithPaths - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/users/{user_id}/ldapservers" - localVarPath = strings.Replace(localVarPath, "{"+"user_id"+"}", fmt.Sprintf("%v", userId), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["limit"], "int32", "limit"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["skip"], "int32", "skip"); err != nil { - return successPayload, nil, err - } - - if localVarTempParam, localVarOk := localVarOptionals["limit"].(int32); localVarOk { - localVarQueryParams.Add("limit", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["skip"].(int32); localVarOk { - localVarQueryParams.Add("skip", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["filter"].([]string); localVarOk { - localVarQueryParams.Add("filter", parameterToString(localVarTempParam, "csv")) - } - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* UsersApiService List the Office 365 instances bound to a User - This endpoint will return all Office 365 Instances bound to a User, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this User to the corresponding Office 365 instance; this array represents all grouping and/or associations that would have to be removed to deprovision the Office 365 instance from this User. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/users/{UserID}/office365s \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - * @param ctx context.Context for authentication, logging, tracing, etc. - @param userId ObjectID of the User. - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "limit" (int32) The number of records to return at once. Limited to 100. - @param "xOrgId" (string) - @param "skip" (int32) The offset into the records to return. - @param "filter" ([]string) Supported operators are: eq, ne, gt, ge, lt, le, between, search, in - @return []GraphObjectWithPaths*/ -func (a *UsersApiService) GraphUserTraverseOffice365(ctx context.Context, userId string, contentType string, accept string, localVarOptionals map[string]interface{}) ([]GraphObjectWithPaths, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload []GraphObjectWithPaths - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/users/{user_id}/office365s" - localVarPath = strings.Replace(localVarPath, "{"+"user_id"+"}", fmt.Sprintf("%v", userId), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["limit"], "int32", "limit"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["skip"], "int32", "skip"); err != nil { - return successPayload, nil, err - } - - if localVarTempParam, localVarOk := localVarOptionals["limit"].(int32); localVarOk { - localVarQueryParams.Add("limit", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["skip"].(int32); localVarOk { - localVarQueryParams.Add("skip", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["filter"].([]string); localVarOk { - localVarQueryParams.Add("filter", parameterToString(localVarTempParam, "csv")) - } - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* UsersApiService List the RADIUS Servers bound to a User - This endpoint will return all RADIUS Servers bound to a User, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this User to the corresponding RADIUS Server; this array represents all grouping and/or associations that would have to be removed to deprovision the RADIUS Server from this User. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/users/{UserID}/radiusservers \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - * @param ctx context.Context for authentication, logging, tracing, etc. - @param userId ObjectID of the User. - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "limit" (int32) The number of records to return at once. Limited to 100. - @param "xOrgId" (string) - @param "skip" (int32) The offset into the records to return. - @param "filter" ([]string) Supported operators are: eq, ne, gt, ge, lt, le, between, search, in - @return []GraphObjectWithPaths*/ -func (a *UsersApiService) GraphUserTraverseRadiusServer(ctx context.Context, userId string, contentType string, accept string, localVarOptionals map[string]interface{}) ([]GraphObjectWithPaths, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload []GraphObjectWithPaths - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/users/{user_id}/radiusservers" - localVarPath = strings.Replace(localVarPath, "{"+"user_id"+"}", fmt.Sprintf("%v", userId), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["limit"], "int32", "limit"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["skip"], "int32", "skip"); err != nil { - return successPayload, nil, err - } - - if localVarTempParam, localVarOk := localVarOptionals["limit"].(int32); localVarOk { - localVarQueryParams.Add("limit", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["skip"].(int32); localVarOk { - localVarQueryParams.Add("skip", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["filter"].([]string); localVarOk { - localVarQueryParams.Add("filter", parameterToString(localVarTempParam, "csv")) - } - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* UsersApiService List the Systems bound to a User - This endpoint will return all Systems bound to a User, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this User to the corresponding System; this array represents all grouping and/or associations that would have to be removed to deprovision the System from this User. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/users/{UserID}/systems\\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - * @param ctx context.Context for authentication, logging, tracing, etc. - @param userId ObjectID of the User. - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "limit" (int32) The number of records to return at once. Limited to 100. - @param "xOrgId" (string) - @param "skip" (int32) The offset into the records to return. - @param "filter" ([]string) Supported operators are: eq, ne, gt, ge, lt, le, between, search, in - @return []GraphObjectWithPaths*/ -func (a *UsersApiService) GraphUserTraverseSystem(ctx context.Context, userId string, contentType string, accept string, localVarOptionals map[string]interface{}) ([]GraphObjectWithPaths, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload []GraphObjectWithPaths - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/users/{user_id}/systems" - localVarPath = strings.Replace(localVarPath, "{"+"user_id"+"}", fmt.Sprintf("%v", userId), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["limit"], "int32", "limit"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["skip"], "int32", "skip"); err != nil { - return successPayload, nil, err - } - - if localVarTempParam, localVarOk := localVarOptionals["limit"].(int32); localVarOk { - localVarQueryParams.Add("limit", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["skip"].(int32); localVarOk { - localVarQueryParams.Add("skip", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["filter"].([]string); localVarOk { - localVarQueryParams.Add("filter", parameterToString(localVarTempParam, "csv")) - } - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* UsersApiService List the System Groups bound to a User - This endpoint will return all System Groups bound to a User, either directly or indirectly, essentially traversing the JumpCloud Graph for your Organization. Each element will contain the type, id, attributes and paths. The `attributes` object is a key/value hash of compiled graph attributes for all paths followed. The `paths` array enumerates each path from this User to the corresponding System Group; this array represents all grouping and/or associations that would have to be removed to deprovision the System Group from this User. See `/members` and `/associations` endpoints to manage those collections. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/users/{UserID}/systemgroups\\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - * @param ctx context.Context for authentication, logging, tracing, etc. - @param userId ObjectID of the User. - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "limit" (int32) The number of records to return at once. Limited to 100. - @param "xOrgId" (string) - @param "skip" (int32) The offset into the records to return. - @param "filter" ([]string) Supported operators are: eq, ne, gt, ge, lt, le, between, search, in - @return []GraphObjectWithPaths*/ -func (a *UsersApiService) GraphUserTraverseSystemGroup(ctx context.Context, userId string, contentType string, accept string, localVarOptionals map[string]interface{}) ([]GraphObjectWithPaths, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload []GraphObjectWithPaths - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/users/{user_id}/systemgroups" - localVarPath = strings.Replace(localVarPath, "{"+"user_id"+"}", fmt.Sprintf("%v", userId), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["limit"], "int32", "limit"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["skip"], "int32", "skip"); err != nil { - return successPayload, nil, err - } - - if localVarTempParam, localVarOk := localVarOptionals["limit"].(int32); localVarOk { - localVarQueryParams.Add("limit", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["skip"].(int32); localVarOk { - localVarQueryParams.Add("skip", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["filter"].([]string); localVarOk { - localVarQueryParams.Add("filter", parameterToString(localVarTempParam, "csv")) - } - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* UsersApiService Send User Emails - This endpoint allows you to send a specific email to a user without waiting for or triggering a workflow. - * @param ctx context.Context for authentication, logging, tracing, etc. - @param userId ObjectID of the User. - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "body" (Emailrequest) - @param "xOrgId" (string) - @return */ -func (a *UsersApiService) UsersSendEmails(ctx context.Context, userId string, contentType string, accept string, localVarOptionals map[string]interface{}) ( *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Post") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/users/{user_id}/emails" - localVarPath = strings.Replace(localVarPath, "{"+"user_id"+"}", fmt.Sprintf("%v", userId), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return nil, err - } - - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - // body params - if localVarTempParam, localVarOk := localVarOptionals["body"].(Emailrequest); localVarOk { - localVarPostBody = &localVarTempParam - } - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - return localVarHttpResponse, err -} - diff --git a/v2/workday_fields.go b/v2/workday_fields.go deleted file mode 100644 index 5fd6622..0000000 --- a/v2/workday_fields.go +++ /dev/null @@ -1,17 +0,0 @@ -/* - * JumpCloud APIs - * - * JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. - * - * API version: 2.0 - * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) - */ - -package v2 - -type WorkdayFields struct { - - Name string `json:"name,omitempty"` - - ReportUrl string `json:"reportUrl,omitempty"` -} diff --git a/v2/workday_import_api.go b/v2/workday_import_api.go deleted file mode 100644 index eecb19c..0000000 --- a/v2/workday_import_api.go +++ /dev/null @@ -1,1065 +0,0 @@ -/* - * JumpCloud APIs - * - * JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. - * - * API version: 2.0 - * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) - */ - -package v2 - -import ( - "io/ioutil" - "net/url" - "net/http" - "strings" - "golang.org/x/net/context" - "encoding/json" - "fmt" -) - -// Linger please -var ( - _ context.Context -) - -type WorkdayImportApiService service - - -/* WorkdayImportApiService Authorize Workday - This endpoint adds an authorization method to a workday instance. You must supply a username and password for `Basic Authentication` that is the same as your WorkDay Integrator System User. Failure to provide these credentials will result in the request being rejected. Currently `O-Auth` isn't a supported authentication protocol for WorkDay, but will be in the future. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/workdays/{WorkDayID}/auth \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"auth\":{ \"basic\": { \"username\": \"someDeveloper\", \"password\": \"notTheRealPassword\" } } }' ``` - * @param ctx context.Context for authentication, logging, tracing, etc. - @param workdayId - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "body" (AuthInputObject) - @param "xOrgId" (string) - @return */ -func (a *WorkdayImportApiService) WorkdaysAuthorize(ctx context.Context, workdayId string, contentType string, accept string, localVarOptionals map[string]interface{}) ( *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Post") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/workdays/{workday_id}/auth" - localVarPath = strings.Replace(localVarPath, "{"+"workday_id"+"}", fmt.Sprintf("%v", workdayId), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return nil, err - } - - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - // body params - if localVarTempParam, localVarOk := localVarOptionals["body"].(AuthInputObject); localVarOk { - localVarPostBody = &localVarTempParam - } - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - return localVarHttpResponse, err -} - -/* WorkdayImportApiService Deauthorize Workday - Removes any and all authorization methods from the workday instance ##### Sample Request ``` curl -X DELETE https://console.jumpcloud.com/api/v2/workdays/{WorkDayID}/auth \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - * @param ctx context.Context for authentication, logging, tracing, etc. - @param workdayId - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "xOrgId" (string) - @return */ -func (a *WorkdayImportApiService) WorkdaysDeauthorize(ctx context.Context, workdayId string, contentType string, accept string, localVarOptionals map[string]interface{}) ( *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Delete") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/workdays/{workday_id}/auth" - localVarPath = strings.Replace(localVarPath, "{"+"workday_id"+"}", fmt.Sprintf("%v", workdayId), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return nil, err - } - - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - return localVarHttpResponse, err -} - -/* WorkdayImportApiService Delete Workday - This endpoint allows you to delete an instance of Workday. **This functionality is currently not enable for users.** - * @param ctx context.Context for authentication, logging, tracing, etc. - @param id - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "xOrgId" (string) - @return interface{}*/ -func (a *WorkdayImportApiService) WorkdaysDelete(ctx context.Context, id string, contentType string, accept string, localVarOptionals map[string]interface{}) (interface{}, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Delete") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload interface{} - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/workdays/{id}" - localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return successPayload, nil, err - } - - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* WorkdayImportApiService Get Workday - This endpoint will return all the available information about an instance of Workday. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/workdays/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - * @param ctx context.Context for authentication, logging, tracing, etc. - @param id - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "xOrgId" (string) - @return WorkdayOutput*/ -func (a *WorkdayImportApiService) WorkdaysGet(ctx context.Context, id string, contentType string, accept string, localVarOptionals map[string]interface{}) (WorkdayOutput, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload WorkdayOutput - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/workdays/{id}" - localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return successPayload, nil, err - } - - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* WorkdayImportApiService Workday Import - The endpoint allows you to create a Workday Import request. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/workdays/{WorkdayID}/import \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '[ { \"email\":\"{email}\", \"firstname\":\"{firstname}\", \"lastname\":\"{firstname}\", \"username\":\"{username}\", \"attributes\":[ {\"name\":\"EmployeeID\",\"value\":\"0000\"}, {\"name\":\"WorkdayID\",\"value\":\"name.name\"} ] } ] ``` - * @param ctx context.Context for authentication, logging, tracing, etc. - @param workdayId - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "body" ([]BulkUserCreate) - @param "xOrgId" (string) - @return JobId*/ -func (a *WorkdayImportApiService) WorkdaysImport(ctx context.Context, workdayId string, contentType string, accept string, localVarOptionals map[string]interface{}) (JobId, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Post") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload JobId - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/workdays/{workday_id}/import" - localVarPath = strings.Replace(localVarPath, "{"+"workday_id"+"}", fmt.Sprintf("%v", workdayId), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return successPayload, nil, err - } - - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - // body params - if localVarTempParam, localVarOk := localVarOptionals["body"].([]BulkUserCreate); localVarOk { - localVarPostBody = &localVarTempParam - } - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* WorkdayImportApiService List Import Results - This endpoint provides a list of job results from the workday import and will contain all imported data from Workday. #### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/workdays/{WorkdayID}/import/{ImportJobID}/results \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - * @param ctx context.Context for authentication, logging, tracing, etc. - @param id - @param jobId - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "limit" (int32) The number of records to return at once. Limited to 100. - @param "skip" (int32) The offset into the records to return. - @param "xOrgId" (string) - @return []JobWorkresult*/ -func (a *WorkdayImportApiService) WorkdaysImportresults(ctx context.Context, id string, jobId string, contentType string, accept string, localVarOptionals map[string]interface{}) ([]JobWorkresult, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload []JobWorkresult - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/workdays/{id}/import/{job_id}/results" - localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1) - localVarPath = strings.Replace(localVarPath, "{"+"job_id"+"}", fmt.Sprintf("%v", jobId), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["limit"], "int32", "limit"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["skip"], "int32", "skip"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return successPayload, nil, err - } - - if localVarTempParam, localVarOk := localVarOptionals["limit"].(int32); localVarOk { - localVarQueryParams.Add("limit", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["skip"].(int32); localVarOk { - localVarQueryParams.Add("skip", parameterToString(localVarTempParam, "")) - } - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* WorkdayImportApiService List Workdays - This endpoint will return all the available information about all your instances of Workday. ##### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/workdays/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - * @param ctx context.Context for authentication, logging, tracing, etc. - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "fields" ([]string) The comma separated fields included in the returned records. If omitted, the default list of fields will be returned. - @param "limit" (int32) The number of records to return at once. Limited to 100. - @param "skip" (int32) The offset into the records to return. - @param "sort" ([]string) The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. - @param "filter" ([]string) Supported operators are: eq, ne, gt, ge, lt, le, between, search, in - @param "xOrgId" (string) - @return []WorkdayOutput*/ -func (a *WorkdayImportApiService) WorkdaysList(ctx context.Context, contentType string, accept string, localVarOptionals map[string]interface{}) ([]WorkdayOutput, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload []WorkdayOutput - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/workdays" - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["limit"], "int32", "limit"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["skip"], "int32", "skip"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return successPayload, nil, err - } - - if localVarTempParam, localVarOk := localVarOptionals["fields"].([]string); localVarOk { - localVarQueryParams.Add("fields", parameterToString(localVarTempParam, "csv")) - } - if localVarTempParam, localVarOk := localVarOptionals["limit"].(int32); localVarOk { - localVarQueryParams.Add("limit", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["skip"].(int32); localVarOk { - localVarQueryParams.Add("skip", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["sort"].([]string); localVarOk { - localVarQueryParams.Add("sort", parameterToString(localVarTempParam, "csv")) - } - if localVarTempParam, localVarOk := localVarOptionals["filter"].([]string); localVarOk { - localVarQueryParams.Add("filter", parameterToString(localVarTempParam, "csv")) - } - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* WorkdayImportApiService Create new Workday - This endpoint allows you to create a new workday instance. You must supply a username and password for `Basic Authentication` that is the same as your WorkDay Integrator System User. Failure to provide these credentials will result in the request being rejected. Currently `O-Auth` isn't a supported authentication protocol for WorkDay, but will be in the future. Currently, only one instance is allowed and it must be `Workday Import`. #### Sample Request ``` curl -X POST https://console.jumpcloud.com/api/v2/workdays/ \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"name\": \"Workday2\", \"reportUrl\":\"https://workday.com/ccx/service/customreport2/gms/user/reportname?format=json\", \"auth\": { \"basic\": { \"username\": \"someDeveloper\", \"password\": \"notTheRealPassword\" } } }' ``` - * @param ctx context.Context for authentication, logging, tracing, etc. - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "body" (WorkdayInput) - @param "xOrgId" (string) - @return */ -func (a *WorkdayImportApiService) WorkdaysPost(ctx context.Context, contentType string, accept string, localVarOptionals map[string]interface{}) ( *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Post") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/workdays" - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return nil, err - } - - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - // body params - if localVarTempParam, localVarOk := localVarOptionals["body"].(WorkdayInput); localVarOk { - localVarPostBody = &localVarTempParam - } - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - return localVarHttpResponse, err -} - -/* WorkdayImportApiService Update Workday - This endpoint allows you to update the name and Custom Report URL for a Workday Instance. Currently, the name can not be changed from the default of `Workday Import`. ##### Sample Request ``` curl -X PUT https://console.jumpcloud.com/api/v2/workdays/{WorkdayID} \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' \\ -d '{ \"reportUrl\":\"{Report_URL}\", \"name\":\"{Name}\" } ' ``` - * @param ctx context.Context for authentication, logging, tracing, etc. - @param id - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "body" (WorkdayFields) - @param "xOrgId" (string) - @return WorkdayOutput*/ -func (a *WorkdayImportApiService) WorkdaysPut(ctx context.Context, id string, contentType string, accept string, localVarOptionals map[string]interface{}) (WorkdayOutput, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Put") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload WorkdayOutput - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/workdays/{id}" - localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", fmt.Sprintf("%v", id), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return successPayload, nil, err - } - - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - // body params - if localVarTempParam, localVarOk := localVarOptionals["body"].(WorkdayFields); localVarOk { - localVarPostBody = &localVarTempParam - } - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - -/* WorkdayImportApiService Get Workday Settings (incomplete) - This endpoint allows you to obtain all settings needed for creating a workday instance, specifically the URL to initiate Basic Authentication with WorkDay. **This functionality is currently not enable for users.** - * @param ctx context.Context for authentication, logging, tracing, etc. - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "state" (string) - @param "xOrgId" (string) - @return */ -func (a *WorkdayImportApiService) WorkdaysSettings(ctx context.Context, contentType string, accept string, localVarOptionals map[string]interface{}) ( *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/workdays/settings" - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["state"], "string", "state"); err != nil { - return nil, err - } - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return nil, err - } - - if localVarTempParam, localVarOk := localVarOptionals["state"].(string); localVarOk { - localVarQueryParams.Add("state", parameterToString(localVarTempParam, "")) - } - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - return localVarHttpResponse, err -} - -/* WorkdayImportApiService List Workday Workers - This endpoint will return all of the data in your WorkDay Custom Report that has been associated with your WorkDay Instance in JumpCloud. ##### Sample Request ``` curl -X GET https://console.jumpcloud.com/api/v2/workdays/{WorkDayID}/workers \\ -H 'Accept: application/json' \\ -H 'Content-Type: application/json' \\ -H 'x-api-key: {API_KEY}' ``` - * @param ctx context.Context for authentication, logging, tracing, etc. - @param workdayId - @param contentType - @param accept - @param optional (nil or map[string]interface{}) with one or more of: - @param "limit" (int32) The number of records to return at once. Limited to 100. - @param "skip" (int32) The offset into the records to return. - @param "sort" ([]string) The comma separated fields used to sort the collection. Default sort is ascending, prefix with `-` to sort descending. - @param "xOrgId" (string) - @return []WorkdayWorker*/ -func (a *WorkdayImportApiService) WorkdaysWorkers(ctx context.Context, workdayId string, contentType string, accept string, localVarOptionals map[string]interface{}) ([]WorkdayWorker, *http.Response, error) { - var ( - localVarHttpMethod = strings.ToUpper("Get") - localVarPostBody interface{} - localVarFileName string - localVarFileBytes []byte - successPayload []WorkdayWorker - ) - - // create path and map variables - localVarPath := a.client.cfg.BasePath + "/workdays/{workday_id}/workers" - localVarPath = strings.Replace(localVarPath, "{"+"workday_id"+"}", fmt.Sprintf("%v", workdayId), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - - if err := typeCheckParameter(localVarOptionals["limit"], "int32", "limit"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["skip"], "int32", "skip"); err != nil { - return successPayload, nil, err - } - if err := typeCheckParameter(localVarOptionals["xOrgId"], "string", "xOrgId"); err != nil { - return successPayload, nil, err - } - - if localVarTempParam, localVarOk := localVarOptionals["limit"].(int32); localVarOk { - localVarQueryParams.Add("limit", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["skip"].(int32); localVarOk { - localVarQueryParams.Add("skip", parameterToString(localVarTempParam, "")) - } - if localVarTempParam, localVarOk := localVarOptionals["sort"].([]string); localVarOk { - localVarQueryParams.Add("sort", parameterToString(localVarTempParam, "csv")) - } - // to determine the Content-Type header - localVarHttpContentTypes := []string{ "application/json", } - - // set Content-Type header - localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) - if localVarHttpContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHttpContentType - } - - // to determine the Accept header - localVarHttpHeaderAccepts := []string{ - "application/json", - } - - // set Accept header - localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) - if localVarHttpHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHttpHeaderAccept - } - localVarHeaderParams["Content-Type"] = parameterToString(contentType, "") - localVarHeaderParams["Accept"] = parameterToString(accept, "") - if localVarTempParam, localVarOk := localVarOptionals["xOrgId"].(string); localVarOk { - localVarHeaderParams["x-org-id"] = parameterToString(localVarTempParam, "") - } - if ctx != nil { - // API Key Authentication - if auth, ok := ctx.Value(ContextAPIKey).(APIKey); ok { - var key string - if auth.Prefix != "" { - key = auth.Prefix + " " + auth.Key - } else { - key = auth.Key - } - localVarHeaderParams["x-api-key"] = key - } - } - r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) - if err != nil { - return successPayload, nil, err - } - - localVarHttpResponse, err := a.client.callAPI(r) - if err != nil || localVarHttpResponse == nil { - return successPayload, localVarHttpResponse, err - } - defer localVarHttpResponse.Body.Close() - if localVarHttpResponse.StatusCode >= 300 { - bodyBytes, _ := ioutil.ReadAll(localVarHttpResponse.Body) - return successPayload, localVarHttpResponse, reportError("Status: %v, Body: %s", localVarHttpResponse.Status, bodyBytes) - } - - if err = json.NewDecoder(localVarHttpResponse.Body).Decode(&successPayload); err != nil { - return successPayload, localVarHttpResponse, err - } - - - return successPayload, localVarHttpResponse, err -} - diff --git a/v2/workday_input.go b/v2/workday_input.go deleted file mode 100644 index 0f42ba9..0000000 --- a/v2/workday_input.go +++ /dev/null @@ -1,19 +0,0 @@ -/* - * JumpCloud APIs - * - * JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. - * - * API version: 2.0 - * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) - */ - -package v2 - -type WorkdayInput struct { - - Auth *AuthInput `json:"auth,omitempty"` - - Name string `json:"name,omitempty"` - - ReportUrl string `json:"reportUrl,omitempty"` -} diff --git a/v2/workday_output.go b/v2/workday_output.go deleted file mode 100644 index 2467cbb..0000000 --- a/v2/workday_output.go +++ /dev/null @@ -1,23 +0,0 @@ -/* - * JumpCloud APIs - * - * JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. - * - * API version: 2.0 - * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) - */ - -package v2 - -type WorkdayOutput struct { - - Auth *WorkdayoutputAuth `json:"auth,omitempty"` - - Id string `json:"id,omitempty"` - - LastImport string `json:"lastImport,omitempty"` - - Name string `json:"name,omitempty"` - - ReportUrl string `json:"reportUrl,omitempty"` -} diff --git a/v2/workday_request.go b/v2/workday_request.go deleted file mode 100644 index 944b08b..0000000 --- a/v2/workday_request.go +++ /dev/null @@ -1,17 +0,0 @@ -/* - * JumpCloud APIs - * - * JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. - * - * API version: 2.0 - * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) - */ - -package v2 - -type WorkdayRequest struct { - - Name string `json:"name,omitempty"` - - ObjectId string `json:"objectId,omitempty"` -} diff --git a/v2/workday_worker.go b/v2/workday_worker.go deleted file mode 100644 index 588d3b3..0000000 --- a/v2/workday_worker.go +++ /dev/null @@ -1,23 +0,0 @@ -/* - * JumpCloud APIs - * - * JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. - * - * API version: 2.0 - * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) - */ - -package v2 - -type WorkdayWorker struct { - - Attributes *interface{} `json:"attributes,omitempty"` - - Email string `json:"email,omitempty"` - - FirstName string `json:"firstName,omitempty"` - - LastName string `json:"lastName,omitempty"` - - Username string `json:"username,omitempty"` -} diff --git a/v2/workdayoutput_auth.go b/v2/workdayoutput_auth.go deleted file mode 100644 index 282d590..0000000 --- a/v2/workdayoutput_auth.go +++ /dev/null @@ -1,17 +0,0 @@ -/* - * JumpCloud APIs - * - * JumpCloud's V2 API. This set of endpoints allows JumpCloud customers to manage objects, groupings and mappings and interact with the JumpCloud Graph. - * - * API version: 2.0 - * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) - */ - -package v2 - -type WorkdayoutputAuth struct { - - Basic *AuthInfo `json:"basic,omitempty"` - - Oauth *AuthInfo `json:"oauth,omitempty"` -}